From 783bb0a247ab0841d35a9f2a71a6d2c2f38c157b Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 7 Jul 2017 09:41:07 -0400 Subject: [PATCH] Adding help documentation for Import Add help tabs for the Import of the member data Photos and Files. --- setup/adminHooks.php | 65 ++++++++++++++++++++++++++++++++++++++++++++ setup/adminMenus.php | 3 +- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 2c452099..0f8c9aa5 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -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' => '

' . __( '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.' + ) . '

'. + '

' . __( 'After you upload the files they are saved and can be + can be used for another import. Simply Click on the Continue + button. + ' ) . '

' . + '

' . __( '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.' ) . '

' . + '

' . __( '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)' ) . '

' . + '

' . __( '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.' ) . '

' + + ) + ); + $screen->add_help_tab( + array( + 'id' => 'glm-member-db-import-help-photos', + 'title' => __( 'Import Photos' ), + 'content' => '

' . __( '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.' ) . '

' + ) + ); + $screen->add_help_tab( + array( + 'id' => 'glm-member-db-import-help-files', + 'title' => __( 'Import Files' ), + 'content' => '

' . __( 'This tab will allow you to import files + for each member. Make sure the "file_url" field contains a complete url + for the file.' ) . '

' + ) + ); + // Help sidebars + // $screen->set_help_sidebar( + // '

' . __( 'For more information:' ) . '

' . + // '

' . + // __( 'Support' ) . '

' + // ); +} diff --git a/setup/adminMenus.php b/setup/adminMenus.php index b0056033..b27f32f0 100644 --- a/setup/adminMenus.php +++ b/setup/adminMenus.php @@ -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', -- 2.17.1