false, /** * Whether the main menu should include a link to * Special:Preferences of Special:MobileOptions */ self::MOBILE_OPTIONS => false, /** Whether a categories button should appear at the bottom of the skin. */ self::CATEGORIES => false, /** requires a wiki using Template:Ambox */ self::PAGE_ISSUES => false, /** no extension requirements */ self::TALK_AT_TOP => true, /** no extension requirements */ self::HISTORY_IN_PAGE_ACTIONS => true, /** no extension requirements */ self::TOOLBAR_SUBMENU => true, /** Whether to show tabs on special pages */ self::TABS_ON_SPECIALS => false, /** whether to show a personal menu */ self::PERSONAL_MENU => true, /** whether to show a main menu with additional items */ self::MAIN_MENU_EXPANDED => true, /** whether the simplified talk page is eligible to be shown */ self::SIMPLIFIED_TALK => false, ]; /** * override an existing option or options with new values * @param array $options */ public function setMultiple( array $options ) { foreach ( $options as $option => $value ) { if ( !array_key_exists( $option, $this->skinOptions ) ) { throw new \OutOfBoundsException( "SkinOption $option is not defined" ); } } $this->skinOptions = array_merge( $this->skinOptions, $options ); } /** * Return whether a skin option is truthy. Should be one of self:* constants * @param string $key * @return bool */ public function get( $key ) { if ( !array_key_exists( $key, $this->skinOptions ) ) { throw new \OutOfBoundsException( "SkinOption $key doesn't exist" ); } return $this->skinOptions[$key]; } /** * Get all skin options * @return array */ public function getAll() { return $this->skinOptions; } /** * Return whether any of the skin options have been set * @return bool */ public function hasSkinOptions() { foreach ( $this->skinOptions as $key => $val ) { if ( $val ) { return true; } } return false; } }