/** * Set the action to call and log type to work with. After that call the action. */ public static function init() { if (!empty($_GET['action']) and in_array($_GET['action'], array_keys(self::$actions))) { self::$action = $_GET['action']; } else { self::$action = 'table'; } if (!empty($_GET['log_type']) and in_array($_GET['log_type'], array_keys(self::$logTypes))) { self::$logType = $_GET['log_type']; } else { self::$logType = 'question_post'; } call_user_func(array(__CLASS__, self::$action)); }
protected static function _addAdminPages() { if (is_admin() and isset($_GET['page']) and $_GET['page'] == self::ADMIN_SETTINGS) { add_action('init', array(__CLASS__, 'processClearDatabase'), 998); add_action('init', array(__CLASS__, 'processSettings'), 999); } if (isset($_GET['page'])) { if ($_GET['page'] == self::ADMIN_LOGS and !empty($_GET['action']) and CMA_LogsController::isActionBeforeRender($_GET['action'])) { CMA_LogsController::init(); } else { if ($_GET['page'] == self::ADMIN_SETTINGS_SEARCH_USERS) { self::settingsSearchUsers(); } else { if ($_GET['page'] == self::ADMIN_SETTINGS_USER_GET_ITEM) { self::settingsSearchUsersGetItem(); } else { if ($_GET['page'] == self::ADMIN_IMPORT and self::_isPost() and !empty($_POST['step'])) { self::processCustomImport(); } else { if ($_GET['page'] == self::ADMIN_UNMARK_SPAM) { self::processUnmarkSpam(); } else { if ($_GET['page'] == self::ADMIN_PRIVATE_ANSWER) { self::processPrivateAnswer(); } else { if ($_GET['page'] == self::ADMIN_BP_NOTIFY) { CMA_BuddyPress::notifyAllUsers(); } } } } } } } } add_action('CMA_custom_post_type_nav', array(get_class(), 'addCustomPostTypeNav'), 1, 1); add_action('CMA_custom_taxonomy_nav', array(get_class(), 'addCustomTaxonomyNav'), 1, 1); if (current_user_can('manage_options')) { add_action('admin_menu', array(get_class(), 'registerAdminPages'), 15); } }