}
/**
- * Add only CSS of one or more modules recognized by the resource loader. Module
- * styles added through this function will be loaded by the resource loader when
- * the page loads.
+ * Add only CSS of one or more modules recognized by the resource loader.
+ *
+ * Module styles added through this function will be added using standard link CSS
+ * tags, rather than as a combined Javascript and CSS package. Thus, they will
+ * load when JavaScript is disabled (unless CSS also happens to be disabled).
*
* @param $modules Mixed: module name (string) or array of module names
*/
$this->addHTML( $text );
}
-
/**
* Add the output of a QuickTemplate to the output buffer
*
$this->mJsConfigVars[$keys] = $value;
}
-
/**
* Get an array containing the variables to be set in mw.config in JavaScript.
*
implode( "\t", $digitTransTable ),
);
+ $user = $this->getUser();
+
$vars = array(
'wgCanonicalNamespace' => $nsname,
'wgCanonicalSpecialPageName' => $canonicalName,
'wgArticleId' => $pageID,
'wgIsArticle' => $this->isArticle(),
'wgAction' => Action::getActionName( $this->getContext() ),
- 'wgUserName' => $this->getUser()->isAnon() ? null : $this->getUser()->getName(),
- 'wgUserGroups' => $this->getUser()->getEffectiveGroups(),
+ 'wgUserName' => $user->isAnon() ? null : $user->getName(),
+ 'wgUserGroups' => $user->getEffectiveGroups(),
'wgCategories' => $this->getCategories(),
'wgBreakFrames' => $this->getFrameOptions() == 'DENY',
'wgPageContentLanguage' => $lang->getCode(),
'wgMonthNamesShort' => $lang->getMonthAbbreviationsArray(),
'wgRelevantPageName' => $relevantTitle->getPrefixedDBKey(),
);
+ if ( $user->isLoggedIn() ) {
+ $vars['wgUserId'] = $user->getId();
+ $vars['wgUserEditCount'] = $user->getEditCount();
+ $userReg = wfTimestampOrNull( TS_UNIX, $user->getRegistration() );
+ $vars['wgUserRegistration'] = $userReg !== null ? ( $userReg * 1000 ) : null;
+ }
if ( $wgContLang->hasVariants() ) {
$vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
}
) );
}
-
# Language variants
if ( !$wgDisableLangConversion && $wgCanonicalLanguageLinks ) {
$lang = $this->getTitle()->getPageLanguage();