public function getModifiedTime( ResourceLoaderContext $context ) {
$hash = $context->getHash();
if ( !isset( $this->modifiedTime[$hash] ) ) {
- global $wgUser;
- $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() );
+ $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $context->getUserObj()->getTouched() );
}
return $this->modifiedTime[$hash];
* @return array
*/
public function getStyles( ResourceLoaderContext $context ) {
- global $wgUser;
-
if ( !$this->getConfig()->get( 'AllowUserCssPrefs' ) ) {
return array();
}
- $options = $wgUser->getOptions();
+ $options = $context->getUserObj()->getOptions();
// Build CSS rules
$rules = array();
$style = implode( "\n", $rules );
if ( $this->getFlip( $context ) ) {
$style = CSSJanus::transform( $style, true, false );
- } else {
- $style = CSSJanus::nullTransform( $style );
}
return array( 'all' => $style );
}
public function getGroup() {
return 'private';
}
-
- /**
- * @return array
- */
- public function getDependencies() {
- return array( 'mediawiki.user' );
- }
}