3 * Vector - Modern version of MonoBook with fresh look and many usability
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * http://www.gnu.org/copyleft/gpl.html
26 * SkinTemplate class for Vector skin
29 class SkinVector
extends SkinTemplate
{
30 public $skinname = 'vector';
31 public $stylename = 'Vector';
32 public $template = 'VectorTemplate';
36 private $vectorConfig;
38 public function __construct() {
39 $this->vectorConfig
= ConfigFactory
::getDefaultInstance()->makeConfig( 'vector' );
43 * Initializes output page and sets up skin-specific parameters
44 * @param OutputPage $out Object to initialize
46 public function initPage( OutputPage
$out ) {
47 parent
::initPage( $out );
49 if ( $this->vectorConfig
->get( 'VectorResponsive' ) ) {
50 $out->addMeta( 'viewport', 'width=device-width, initial-scale=1' );
51 $out->addModuleStyles( 'skins.vector.styles.responsive' );
54 $out->addModules( 'skins.vector.js' );
58 * Loads skin and user CSS files.
59 * @param OutputPage $out
61 function setupSkinUserCss( OutputPage
$out ) {
62 parent
::setupSkinUserCss( $out );
64 $styles = [ 'mediawiki.skinning.interface', 'skins.vector.styles' ];
65 Hooks
::run( 'SkinVectorStyleModules', [ $this, &$styles ] );
66 $out->addModuleStyles( $styles );
70 * Override to pass our Config instance to it
72 public function setupTemplate( $classname, $repository = false, $cache_dir = false ) {
73 return new $classname( $this->vectorConfig
);