true, self::OPTIONS_MOBILE_BETA => false, /** * Whether the main menu should include a link to * Special:Preferences of Special:MobileOptions */ self::OPTION_MOBILE_OPTIONS => false, /** Whether a categories button should appear at the bottom of the skin. */ self::OPTION_CATEGORIES => false, /** Whether a back to top button appears at the bottom of the view page */ self::OPTION_BACK_TO_TOP => false, /** Whether a share button should appear in icons section */ self::OPTION_SHARE_BUTTON => false, /** Whether sections can be collapsed (requires MobileFrontend and MobileFormatter) */ self::OPTION_TOGGLING => false, self::OPTION_PAGE_ISSUES => false, self::OPTIONS_TALK_AT_TOP => false, self::OPTIONS_HISTORY_PAGE_ACTIONS => false, self::OPTION_OVERFLOW_SUBMENU => false, /** Whether to show tabs on special pages */ self::OPTION_TABS_ON_SPECIALS => false, ]; /** * override an existing option or options with new values * @param array $options */ public function setMultiple( array $options ) { $this->skinOptions = array_merge( $this->skinOptions, $options ); } /** * Return whether a skin option is truthy. Should be one of self:OPTION_* flags * @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; } }