<?php
/**
- * Resource loader module for user customizations.
+ * ResourceLoader module for user customizations.
*
* 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
*/
class ResourceLoaderUserGroupsModule extends ResourceLoaderWikiModule {
- /* Protected Members */
-
protected $origin = self::ORIGIN_USER_SITEWIDE;
- protected $targets = array( 'desktop', 'mobile' );
-
- /* Protected Methods */
+ protected $targets = [ 'desktop', 'mobile' ];
/**
* @param ResourceLoaderContext $context
$useSiteJs = $this->getConfig()->get( 'UseSiteJs' );
$useSiteCss = $this->getConfig()->get( 'UseSiteCss' );
if ( !$useSiteJs && !$useSiteCss ) {
- return array();
+ return [];
}
$user = $context->getUserObj();
if ( !$user || $user->isAnon() ) {
- return array();
+ return [];
}
- $pages = array();
+ $pages = [];
foreach ( $user->getEffectiveGroups() as $group ) {
if ( $group == '*' ) {
continue;
}
if ( $useSiteJs ) {
- $pages["MediaWiki:Group-$group.js"] = array( 'type' => 'script' );
+ $pages["MediaWiki:Group-$group.js"] = [ 'type' => 'script' ];
}
if ( $useSiteCss ) {
- $pages["MediaWiki:Group-$group.css"] = array( 'type' => 'style' );
+ $pages["MediaWiki:Group-$group.css"] = [ 'type' => 'style' ];
}
}
return $pages;
}
- /* Methods */
-
/**
+ * Get group name
+ *
* @return string
*/
public function getGroup() {