Ejemplo n.º 1
0
 public static function initMenu()
 {
     $customPage = apply_filters('mainwp-getcustompage-backups', false);
     if (is_array($customPage) && isset($customPage['slug'])) {
         self::$hideSubmenuBackups = true;
         add_submenu_page('mainwp_tab', $customPage['title'], '<span id="mainwp-Backups">' . $customPage['title'] . '</span>', 'read', 'ManageBackups' . $customPage['slug'], $customPage['callback']);
     } else {
         $page = add_submenu_page('mainwp_tab', __('Schedule Backup', 'mainwp'), '<span id="mainwp-Backups">' . __('Schedule Backup', 'mainwp') . '</span>', 'read', 'ManageBackups', array(MainWPManageBackups::getClassName(), 'renderManager'));
         add_action('load-' . $page, array(MainWPManageBackups::getClassName(), 'load_page'));
         if (mainwp_current_user_can("dashboard", "add_backup_tasks")) {
             add_submenu_page('mainwp_tab', __('Add New Schedule', 'mainwp'), '<div class="mainwp-hidden">' . __('Add New', 'mainwp') . '</div>', 'read', 'ManageBackupsAddNew', array(MainWPManageBackups::getClassName(), 'renderNew'));
         }
         add_submenu_page('mainwp_tab', __('Backups Help', 'mainwp'), '<div class="mainwp-hidden">' . __('Backups Help', 'mainwp') . '</div>', 'read', 'BackupsHelp', array(MainWPManageBackups::getClassName(), 'QSGManageBackups'));
     }
     self::$subPages = apply_filters('mainwp-getsubpages-backups', array());
     if (isset(self::$subPages) && is_array(self::$subPages)) {
         foreach (self::$subPages as $subPage) {
             add_submenu_page('mainwp_tab', $subPage['title'], '<div class="mainwp-hidden">' . $subPage['title'] . '</div>', 'read', 'ManageBackups' . $subPage['slug'], $subPage['callback']);
         }
     }
 }