2010-10-19 18:25:42 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
2012-04-30 07:16:10 +00:00
|
|
|
* Resource loader module for site customizations.
|
|
|
|
|
*
|
2010-10-19 18:25:42 +00:00
|
|
|
* 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
|
|
|
|
|
* @author Trevor Parscal
|
|
|
|
|
* @author Roan Kattouw
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Module for site customizations
|
|
|
|
|
*/
|
|
|
|
|
class ResourceLoaderSiteModule extends ResourceLoaderWikiModule {
|
|
|
|
|
|
|
|
|
|
/* Protected Methods */
|
|
|
|
|
|
2010-10-20 00:25:20 +00:00
|
|
|
/**
|
|
|
|
|
* Gets list of pages used by this module
|
2011-05-21 17:45:20 +00:00
|
|
|
*
|
|
|
|
|
* @param $context ResourceLoaderContext
|
|
|
|
|
*
|
2010-11-05 18:33:50 +00:00
|
|
|
* @return Array: List of pages
|
2010-10-20 00:25:20 +00:00
|
|
|
*/
|
2010-10-19 18:25:42 +00:00
|
|
|
protected function getPages( ResourceLoaderContext $context ) {
|
2013-04-22 12:39:53 +00:00
|
|
|
global $wgUseSiteJs, $wgUseSiteCss;
|
2010-10-20 00:25:20 +00:00
|
|
|
|
2013-04-03 20:50:08 +00:00
|
|
|
$pages = array();
|
|
|
|
|
if ( $wgUseSiteJs ) {
|
|
|
|
|
$pages['MediaWiki:Common.js'] = array( 'type' => 'script' );
|
|
|
|
|
$pages['MediaWiki:' . ucfirst( $context->getSkin() ) . '.js'] = array( 'type' => 'script' );
|
|
|
|
|
}
|
|
|
|
|
if ( $wgUseSiteCss ) {
|
|
|
|
|
$pages['MediaWiki:Common.css'] = array( 'type' => 'style' );
|
|
|
|
|
$pages['MediaWiki:' . ucfirst( $context->getSkin() ) . '.css'] = array( 'type' => 'style' );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$pages['MediaWiki:Print.css'] = array( 'type' => 'style', 'media' => 'print' );
|
2010-10-19 18:25:42 +00:00
|
|
|
return $pages;
|
|
|
|
|
}
|
2010-10-20 00:25:20 +00:00
|
|
|
|
2010-10-19 18:25:42 +00:00
|
|
|
/* Methods */
|
2010-10-20 00:25:20 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets group name
|
2012-10-19 20:03:05 +00:00
|
|
|
*
|
2010-11-05 18:33:50 +00:00
|
|
|
* @return String: Name of group
|
2010-10-20 00:25:20 +00:00
|
|
|
*/
|
2010-10-19 18:25:42 +00:00
|
|
|
public function getGroup() {
|
|
|
|
|
return 'site';
|
|
|
|
|
}
|
|
|
|
|
}
|