MediaWiki master
SiteModule.php
Go to the documentation of this file.
1<?php
24
26
33class SiteModule extends WikiModule {
40 protected function getPages( Context $context ) {
41 $pages = [];
42 if ( $this->getConfig()->get( MainConfigNames::UseSiteJs ) ) {
43 $skin = $context->getSkin();
44 $pages['MediaWiki:Common.js'] = [ 'type' => 'script' ];
45 $pages['MediaWiki:' . ucfirst( $skin ) . '.js'] = [ 'type' => 'script' ];
46 $this->getHookRunner()->onResourceLoaderSiteModulePages( $skin, $pages );
47 }
48 return $pages;
49 }
50
55 public function getDependencies( Context $context = null ) {
56 return [ 'site.styles' ];
57 }
58}
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:45
getHookRunner()
Get a HookRunner for running core hooks.
Definition Module.php:335
Module for site customizations.
getPages(Context $context)
Get list of pages used by this module.
getDependencies(Context $context=null)
Abstraction for ResourceLoader modules which pull from wiki pages.