MediaWiki REL1_40
SiteModule.php
Go to the documentation of this file.
1<?php
24
26
33class SiteModule extends WikiModule {
42 protected function getPages( Context $context ) {
43 $pages = [];
44 if ( $this->getConfig()->get( MainConfigNames::UseSiteJs ) ) {
45 $skin = $context->getSkin();
46 $pages['MediaWiki:Common.js'] = [ 'type' => 'script' ];
47 $pages['MediaWiki:' . ucfirst( $skin ) . '.js'] = [ 'type' => 'script' ];
48 $this->getHookRunner()->onResourceLoaderSiteModulePages( $skin, $pages );
49 }
50 return $pages;
51 }
52
57 public function getDependencies( Context $context = null ) {
58 return [ 'site.styles' ];
59 }
60}
61
63class_alias( SiteModule::class, 'ResourceLoaderSiteModule' );
A class containing constants representing the names of configuration variables.
const UseSiteJs
Name constant for the UseSiteJs setting, for use with Config::get()
Context object that contains information about the state of a specific ResourceLoader web request.
Definition Context.php:46
getHookRunner()
Get a HookRunner for running core hooks.
Definition Module.php:304
Module for site customizations.
function getPages Context string[] $context
Get list of pages used by this module.
getDependencies(Context $context=null)
if( $this->getConfig() ->get(MainConfigNames::UseSiteJs)) return $pages
Abstraction for ResourceLoader modules which pull from wiki pages.
getPages(Context $context)
Subclasses should return an associative array of resources in the module.