MediaWiki REL1_37
ResourceLoaderSiteModule.php
Go to the documentation of this file.
1<?php
31 protected $targets = [ 'desktop', 'mobile' ];
32
39 protected function getPages( ResourceLoaderContext $context ) {
40 $pages = [];
41 if ( $this->getConfig()->get( 'UseSiteJs' ) ) {
42 $skin = $context->getSkin();
43 $pages['MediaWiki:Common.js'] = [ 'type' => 'script' ];
44 $pages['MediaWiki:' . ucfirst( $skin ) . '.js'] = [ 'type' => 'script' ];
45 $this->getHookRunner()->onResourceLoaderSiteModulePages( $skin, $pages );
46 }
47 return $pages;
48 }
49
54 public function getDependencies( ResourceLoaderContext $context = null ) {
55 return [ 'site.styles' ];
56 }
57}
Context object that contains information about the state of a specific ResourceLoader web request.
getHookRunner()
Get a HookRunner for running core hooks.
Module for site customizations.
getPages(ResourceLoaderContext $context)
Get list of pages used by this module.
getDependencies(ResourceLoaderContext $context=null)
string[] $targets
What client platforms the module targets (e.g.
Abstraction for ResourceLoader modules which pull from wiki pages.