/** * Registers settings for the Document Gallery options page. */ public static function registerSettings() { if (empty($_REQUEST['tab']) || !array_key_exists($_REQUEST['tab'], self::getTabs())) { reset(self::getTabs()); self::$current = key(self::getTabs()); } else { self::$current = $_REQUEST['tab']; } register_setting(DG_OPTION_NAME, DG_OPTION_NAME, array(__CLASS__, 'validateSettings')); $funct = 'register' . self::$current . 'Settings'; DG_Admin::$funct(); }
/** * Initializes the current tab value. */ private static function initCurrentTab() { if (empty($_GET['tab']) || !array_key_exists($_GET['tab'], self::getTabs())) { reset(self::getTabs()); self::$current = key(self::getTabs()); } else { self::$current = $_GET['tab']; } }