summaryrefslogtreecommitdiffstats
path: root/giglogadmin.php
diff options
context:
space:
mode:
authorAndreaChirulescu <andrea.chirulescu@gmail.com>2021-03-10 20:44:42 +0100
committerAndreaChirulescu <andrea.chirulescu@gmail.com>2021-03-10 20:44:42 +0100
commit69d03fd9f451db8da8223119c363d2d5b982f273 (patch)
treebc08a5fd2a31a09304dd38827737ab4def4428bc /giglogadmin.php
parent06af2ce37c3e6f2111d3be8ae91da94873609ec6 (diff)
downloadgigologadmin-69d03fd9f451db8da8223119c363d2d5b982f273.tar.gz
gigologadmin-69d03fd9f451db8da8223119c363d2d5b982f273.tar.bz2
gigologadmin-69d03fd9f451db8da8223119c363d2d5b982f273.zip
Moved helpfiles inside giglog admin class
Added help file for photo galleries
Diffstat (limited to 'giglogadmin.php')
-rw-r--r--giglogadmin.php76
1 files changed, 31 insertions, 45 deletions
diff --git a/giglogadmin.php b/giglogadmin.php
index b711baa..4e38a3f 100644
--- a/giglogadmin.php
+++ b/giglogadmin.php
@@ -18,50 +18,6 @@
*/
-
-/*Andrea's attempt at creating help files. Didn't get it to work inside giglogadmin class so it's all defined before that section */
- require_once __DIR__ . '/includes/admin/helpfiles/instrunctions.php';
- require_once __DIR__ . '/includes/admin/helpfiles/instr_reviewers.php';
- add_action( 'admin_menu', 'add_help_pages');
-
- function add_help_pages() {
-
- add_menu_page(
-
- "Help for ET users", // Page title
-
- "Help for ET users", // Menu title
-
- "upload_files", // Will show for users with this capability
-
- "helpfiles", // menu slug
-
- array( 'Instructions_Page', 'render_instr_html' ), // callable
-
- 'dashicons-tickets-alt', // Icon url
-
- 10); // Position, just below 'Media'
-
-
- add_submenu_page(
-
- "helpfiles", // parent slug
-
- "Reviewer help files", // page title
-
- "Reviewer help files", // menu title
-
- "upload_files", // required capability
-
- "reviewer_help", // menu slug
-
- array( 'Instructions_Reviewers', 'render_instr_rev_html' )); // callable
-
-
- }
-
-
-
if ( !class_exists( 'GiglogAdmin_Plugin' ) ) {
require_once __DIR__ . '/includes/public/shortcodes/giglog_bands.php';
require_once __DIR__ . '/includes/public/shortcodes/giglog_display_unprocessed.php';
@@ -69,6 +25,8 @@ if ( !class_exists( 'GiglogAdmin_Plugin' ) ) {
require_once __DIR__ . '/includes/public/shortcodes/giglog_process_files.php';
require_once __DIR__ . '/includes/admin/views/giglog_admin_page.php';
require_once __DIR__ . '/includes/admin/views/giglog_import_gigs.php';
+ require_once __DIR__ . '/includes/admin/helpfiles/instrunctions.php';
+ require_once __DIR__ . '/includes/admin/helpfiles/instr_reviewers.php';
class GiglogAdmin_Plugin
{
@@ -80,6 +38,7 @@ if ( !class_exists( 'GiglogAdmin_Plugin' ) ) {
add_shortcode('giglog_photog', 'giglogadmin_photographers');
add_action( 'admin_menu', array( 'GiglogAdmin_Plugin', 'add_admin_pages' ));
+ add_action( 'admin_menu', 'add_help_pages');
add_filter( 'wp_nav_menu_args', array( 'GiglogAdmin_Plugin', 'nav_menu_args' ));
}
@@ -114,7 +73,34 @@ if ( !class_exists( 'GiglogAdmin_Plugin' ) ) {
add_action( 'load-' . $import_hook, array( 'GiglogAdmin_ImportGigsPage', 'submit_form' ) );
}
-
+ function add_help_pages() {
+ add_menu_page(
+ "Help for ET users", // Page title
+ "Help for ET users", // Menu title
+ "upload_files", // Will show for users with this capability
+ "helpfiles", // menu slug
+ array( 'Instructions_Page', 'render_instr_html' ), // callable
+ 'dashicons-tickets-alt', // Icon url
+ 10); // Position, just below 'Media'
+
+ add_submenu_page(
+ "helpfiles", // parent slug
+ "Reviewer help files", // page title
+ "Reviewer help files", // menu title
+ "upload_files", // required capability
+ "reviewer_help", // menu slug
+ array( 'Instructions_Reviewers', 'render_instr_rev_html' )); // callable
+
+ add_submenu_page(
+ "helpfiles", // parent slug
+ "Photogalleries help files", // page title
+ "Photogalleries help files", // menu title
+ "upload_files", // required capability
+ "photog_help", // menu slug
+ array( 'Instructions_Photogs', 'render_instr_photo_html' )); // callable
+
+ }
+
/*
* Show menus based on whether user is logged in or not.
*