getUser()->getOption( 'monobook-responsive' ); } /** * @inheritDoc * @param OutputPage $out */ public function initPage( OutputPage $out ) { parent::initPage( $out ); if ( $this->isResponsive() ) { $styleModule = 'skins.monobook.responsive'; $out->addModules( [ 'skins.monobook.mobile' ] ); } else { $styleModule = 'skins.monobook.styles'; } $out->addModuleStyles( [ 'mediawiki.skinning.content.externallinks', $styleModule ] ); } /** * @param User $user * @param array &$preferences */ public static function onGetPreferences( User $user, array &$preferences ) { $preferences['monobook-responsive'] = [ 'type' => 'toggle', 'label-message' => 'monobook-responsive-label', 'section' => 'rendering/skin/skin-prefs', // Only show this section when the Monobook skin is checked. The JavaScript client also uses // this state to determine whether to show or hide the whole section. 'hide-if' => [ '!==', 'wpskin', 'monobook' ], ]; } }