| 1 |
<?php |
| 2 |
class MaxGalleriaAdmin { |
| 3 |
public function __construct() { |
| 4 |
add_action('admin_menu', array($this, 'add_menu_pages')); |
| 5 |
} |
| 6 |
|
| 7 |
public function add_menu_pages() { |
| 8 |
$edit_page = 'edit.php?post_type=' . MAXGALLERIA_POST_TYPE; |
| 9 |
|
| 10 |
do_action(MAXGALLERIA_ACTION_BEFORE_ADMIN_MENU_PAGES, $edit_page); |
| 11 |
|
| 12 |
$parent_slug = $edit_page; |
| 13 |
$page_title = __('MaxGalleria: NextGEN Importer', 'maxgalleria'); |
| 14 |
$sub_menu_title = __('NextGEN Importer', 'maxgalleria'); |
| 15 |
$capability = 'upload_files'; |
| 16 |
$menu_slug = 'maxgalleria-nextgen-importer'; |
| 17 |
$function = array($this, 'add_nextgen_importer_page'); |
| 18 |
add_submenu_page($parent_slug, $page_title, $sub_menu_title, $capability, $menu_slug, $function); |
| 19 |
|
| 20 |
$parent_slug = $edit_page; |
| 21 |
$page_title = __('MaxGalleria: Settings', 'maxgalleria'); |
| 22 |
$sub_menu_title = __('Settings', 'maxgalleria'); |
| 23 |
$capability = 'manage_options'; |
| 24 |
$menu_slug = 'maxgalleria-settings'; |
| 25 |
$function = array($this, 'add_settings_page'); |
| 26 |
add_submenu_page($parent_slug, $page_title, $sub_menu_title, $capability, $menu_slug, $function); |
| 27 |
|
| 28 |
$parent_slug = $edit_page; |
| 29 |
$page_title = __('MaxGalleria: Support', 'maxgalleria'); |
| 30 |
$sub_menu_title = __('Support', 'maxgalleria'); |
| 31 |
$capability = 'manage_options'; |
| 32 |
$menu_slug = 'maxgalleria-support'; |
| 33 |
$function = array($this, 'add_support_page'); |
| 34 |
add_submenu_page($parent_slug, $page_title, $sub_menu_title, $capability, $menu_slug, $function); |
| 35 |
|
| 36 |
do_action(MAXGALLERIA_ACTION_AFTER_ADMIN_MENU_PAGES, $edit_page); |
| 37 |
} |
| 38 |
|
| 39 |
public function add_nextgen_importer_page() { |
| 40 |
require_once 'admin/nextgen-importer.php'; |
| 41 |
} |
| 42 |
|
| 43 |
public function add_settings_page() { |
| 44 |
require_once 'admin/settings.php'; |
| 45 |
} |
| 46 |
|
| 47 |
public function add_support_page() { |
| 48 |
require_once 'admin/support.php'; |
| 49 |
} |
| 50 |
} |
| 51 |
?> |