MediaWiki master
SiteModule.php
Go to the documentation of this file.
1<?php
10
12
19class SiteModule extends WikiModule {
26 protected function getPages( Context $context ) {
27 $pages = [];
28 if ( $this->getConfig()->get( MainConfigNames::UseSiteJs ) ) {
29 $skin = $context->getSkin();
30 $pages['MediaWiki:Common.js'] = [ 'type' => 'script' ];
31 $pages['MediaWiki:' . ucfirst( $skin ) . '.js'] = [ 'type' => 'script' ];
32 $this->getHookRunner()->onResourceLoaderSiteModulePages( $skin, $pages );
33 }
34 return $pages;
35 }
36
41 public function getDependencies( ?Context $context = null ) {
42 return [ 'site.styles' ];
43 }
44}
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:32
getHookRunner()
Get a HookRunner for running core hooks.
Definition Module.php:288
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.