2014-08-07 07:40:21 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* MonoBook nouveau.
|
|
|
|
*
|
|
|
|
* Translated from gwicke's previous TAL template version to remove
|
|
|
|
* dependency on PHPTAL.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @ingroup Skins
|
|
|
|
*/
|
|
|
|
|
2021-06-23 12:16:06 -04:00
|
|
|
namespace MonoBook;
|
|
|
|
|
|
|
|
use OutputPage;
|
|
|
|
use SkinTemplate;
|
|
|
|
|
2014-08-07 07:40:21 -04:00
|
|
|
/**
|
|
|
|
* Inherit main code from SkinTemplate, set the CSS and template filter.
|
|
|
|
* @ingroup Skins
|
|
|
|
*/
|
|
|
|
class SkinMonoBook extends SkinTemplate {
|
|
|
|
/**
|
2020-08-03 15:11:19 -04:00
|
|
|
* @inheritDoc
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isResponsive() {
|
|
|
|
return $this->getUser()->getOption( 'monobook-responsive' );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritDoc
|
2014-08-07 07:40:21 -04:00
|
|
|
* @param OutputPage $out
|
|
|
|
*/
|
2020-08-03 15:11:19 -04:00
|
|
|
public function initPage( OutputPage $out ) {
|
|
|
|
parent::initPage( $out );
|
2014-08-07 07:40:21 -04:00
|
|
|
|
2020-08-03 15:11:19 -04:00
|
|
|
if ( $this->isResponsive() ) {
|
2018-06-03 18:50:36 -04:00
|
|
|
$styleModule = 'skins.monobook.responsive';
|
|
|
|
$out->addModules( [
|
|
|
|
'skins.monobook.mobile'
|
|
|
|
] );
|
|
|
|
} else {
|
|
|
|
$styleModule = 'skins.monobook.styles';
|
|
|
|
}
|
2018-05-01 15:44:43 -04:00
|
|
|
|
2017-05-16 12:53:26 -04:00
|
|
|
$out->addModuleStyles( [
|
2018-06-03 18:50:36 -04:00
|
|
|
$styleModule
|
2018-05-03 15:45:10 -04:00
|
|
|
] );
|
2014-08-07 07:40:21 -04:00
|
|
|
}
|
|
|
|
}
|