MediaWiki REL1_33
SkinVector.php
Go to the documentation of this file.
1<?php
29class SkinVector extends SkinTemplate {
30 public $skinname = 'vector';
31 public $stylename = 'Vector';
32 public $template = 'VectorTemplate';
37 private $responsiveMode = false;
38
39 public function __construct() {
40 $this->vectorConfig = \MediaWiki\MediaWikiServices::getInstance()->getConfigFactory()
41 ->makeConfig( 'vector' );
42 }
43
45 public function getPageClasses( $title ) {
46 $className = parent::getPageClasses( $title );
47 return $className;
48 }
49
53 public function enableResponsiveMode() {
54 if ( !$this->responsiveMode ) {
55 $out = $this->getOutput();
56 $out->addMeta( 'viewport', 'width=device-width, initial-scale=1' );
57 $out->addModuleStyles( 'skins.vector.styles.responsive' );
58 $this->responsiveMode = true;
59 }
60 }
61
66 public function initPage( OutputPage $out ) {
67 parent::initPage( $out );
68
69 if ( $this->vectorConfig->get( 'VectorResponsive' ) ) {
70 $this->enableResponsiveMode();
71 }
72
73 $out->addModules( 'skins.vector.js' );
74 }
75
80 public function setupSkinUserCss( OutputPage $out ) {
81 parent::setupSkinUserCss( $out );
82
83 $out->addModuleStyles( [
84 'mediawiki.skinning.interface',
85 'skins.vector.styles',
86 ] );
87 }
88
96 public function setupTemplate( $classname, $repository = false, $cache_dir = false ) {
97 return new $classname( $this->vectorConfig );
98 }
99
105 public function shouldPreloadLogo() {
106 return true;
107 }
108}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
This class should be covered by a general architecture document which does not exist as of January 20...
Base class for template-based skins.
Skin subclass for Vector.
setupTemplate( $classname, $repository=false, $cache_dir=false)
Override to pass our Config instance to it.
setupSkinUserCss(OutputPage $out)
Loads skin and user CSS files.
initPage(OutputPage $out)
Initializes output page and sets up skin-specific parameters.
enableResponsiveMode()
Enables the responsive mode.
shouldPreloadLogo()
Whether the logo should be preloaded with an HTTP link header or not.
Config $vectorConfig
getPageClasses( $title)
@inheritDoc
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping $template
Definition hooks.txt:822
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
Definition hooks.txt:855
Interface for configuration instances.
Definition Config.php:28