Adding help documentation for Import
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 7 Jul 2017 13:41:07 +0000 (09:41 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 7 Jul 2017 13:41:07 +0000 (09:41 -0400)
Add help tabs for the Import of the member data Photos and Files.

setup/adminHooks.php
setup/adminMenus.php

index 2c45209..0f8c9aa 100644 (file)
@@ -284,3 +284,68 @@ add_filter( 'glm_user_is_moderated', function( $memberID ){
     }
 } );
 
+add_action( 'admin_menu', 'glm_import_add_page');
+function glm_import_add_page() {
+    global $glm_import_sub_page;
+    add_action( 'load-'.$glm_import_sub_page, 'glm_admin_import_help_tab' );
+}
+
+/**
+https://codex.wordpress.org/Adding_Contextual_Help_to_Administration_Menus
+https://codex.wordpress.org/Class_Reference/WP_Screen/add_help_tab
+ */
+function glm_admin_import_help_tab () {
+    $screen = get_current_screen();
+
+    // Add help tab if current screen is import
+    $screen->add_help_tab(
+        array(
+            'id'      => 'glm-member-db-import-help-csv',
+            'title'   => __('Import CSV'),
+            'content' => '<p>' . __( 'You must upload each file. Each Upload
+            type has a Sample File. You can download the sample file. Your
+            first line for the files must match what is given in Sample File.'
+            ) . '</p>'.
+            '<p>' . __( 'After you upload the files they are saved and can be
+                can be used for another import. Simply Click on the Continue
+                button.
+            ' ) . '</p>' .
+            '<p>' . __( 'If you have Photos for each member You can goto the
+            Import Photos tab. (After you have finished the Member Import).
+            Remember the Member Import should be done first.' ) . '</p>' .
+            '<p>' . __( 'Other plugins like the social plugin will add more
+            tabs. Once your done with the main import of the members you should
+            also complete the other plugin member uploads. (Member Contacts,
+            Social)' ) . '</p>' .
+            '<p>' . __( 'On most tabs, except for the Member Contacts, You\'ll
+            see a checkbox for Clear data. You\'ll want to uncheck this if you
+            don\'t want the import to clear out the original data.' ) . '</p>'
+
+        )
+    );
+    $screen->add_help_tab(
+        array(
+            'id'      => 'glm-member-db-import-help-photos',
+            'title'   => __( 'Import Photos' ),
+            'content' => '<p>' . __( 'This tab will allow you to import photo
+            galleries for each member. Make sure the "image" field contains a
+            complete url for the image. You should also make sure the image is
+            no larger than 800px wide.' ) .  '</p>'
+        )
+    );
+    $screen->add_help_tab(
+        array(
+            'id'      => 'glm-member-db-import-help-files',
+            'title'   => __( 'Import Files' ),
+            'content' => '<p>' . __( 'This tab will allow you to import files
+            for each member. Make sure the "file_url" field contains a complete url
+            for the file.' ) .  '</p>'
+        )
+    );
+    // Help sidebars
+    // $screen->set_help_sidebar(
+    //     '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+    //     '<p><a href="http://www.gaslightmedia.com/support/" target="_blank">' .
+    //     __( 'Support' ) . '</a></p>'
+    // );
+}
index b005603..b27f32f 100644 (file)
@@ -148,7 +148,8 @@ add_submenu_page(
 );
 
 // Add a submenu for the "Import" section
-add_submenu_page(
+global $glm_import_sub_page;
+$glm_import_sub_page = add_submenu_page(
     'glm-members-admin-menu-members',
     'Import',
     'Import',