* @param $out OutputPage
*/
function setupSkinUserCss( OutputPage $out ) {
- $out->addModuleStyles( array( 'mediawiki.legacy.shared', 'mediawiki.legacy.commonPrint' ) );
+ $out->addModuleStyles( array(
+ 'mediawiki.legacy.shared',
+ 'mediawiki.legacy.commonPrint',
+ 'mediawiki.ui.button'
+ ) );
}
/**
}
$ilInterwikiCodeBCP47 = wfBCP47( $ilInterwikiCode );
- $languageLinks[] = array(
+ $languageLink = array(
'href' => $languageLinkTitle->getFullURL(),
'text' => $ilLangName,
'title' => $ilTitle,
'lang' => $ilInterwikiCodeBCP47,
'hreflang' => $ilInterwikiCodeBCP47,
);
+ wfRunHooks( 'SkinTemplateGetLanguageLink', array( &$languageLink, $languageLinkTitle, $this->getTitle() ) );
+ $languageLinks[] = $languageLink;
}
}
}
$out = $this->getOutput();
- $user = $this->getUser();
wfProfileIn( __METHOD__ . '-init' );
$this->initPage( $out );
* initialize various variables and generate the template
*
* @since 1.23
- * @param $out OutputPage
* @return QuickTemplate the template to be executed by outputPage
*/
- protected function prepareQuickTemplate( OutputPage $out = null ) {
+ protected function prepareQuickTemplate() {
global $wgContLang, $wgScript, $wgStylePath,
$wgMimeType, $wgJsMimeType, $wgXhtmlNamespaces, $wgHtml5Version,
$wgDisableCounters, $wgSitename, $wgLogo, $wgMaxCredits,
$title = $this->getTitle();
$request = $this->getRequest();
+ $out = $this->getOutput();
$tpl = $this->setupTemplateForOutput();
wfProfileIn( __METHOD__ . '-stuff-head' );
'active' => $active
);
$personal_urls['logout'] = array(
- 'text' => $this->msg( 'userlogout' )->text(),
+ 'text' => $this->msg( 'pt-userlogout' )->text(),
'href' => self::makeSpecialUrl( 'Userlogout',
// userlogout link must always contain an & character, otherwise we might not be able
// to detect a buggy precaching proxy (bug 17790)
$useCombinedLoginLink = $this->useCombinedLoginLink();
$loginlink = $this->getUser()->isAllowed( 'createaccount' ) && $useCombinedLoginLink
? 'nav-login-createaccount'
- : 'login';
+ : 'pt-login';
$is_signup = $request->getText( 'type' ) == 'signup';
- $login_id = $this->showIPinHeader() ? 'anonlogin' : 'login';
$login_url = array(
'text' => $this->msg( $loginlink )->text(),
'href' => self::makeSpecialUrl( 'Userlogin', $returnto ),
'active' => $title->isSpecial( 'Userlogin' ) && ( $loginlink == 'nav-login-createaccount' || !$is_signup ),
);
$createaccount_url = array(
- 'text' => $this->msg( 'createaccount' )->text(),
+ 'text' => $this->msg( 'pt-createaccount' )->text(),
'href' => self::makeSpecialUrl( 'Userlogin', "$returnto&type=signup" ),
'active' => $title->isSpecial( 'Userlogin' ) && $is_signup,
);
$personal_urls['createaccount'] = $createaccount_url;
}
- $personal_urls[$login_id] = $login_url;
+ $personal_urls['login'] = $login_url;
}
wfRunHooks( 'PersonalUrls', array( &$personal_urls, &$title, $this ) );
echo htmlspecialchars( $this->data[$str] );
}
- /**
- * @private
- * @deprecated since 1.21; use Xml::encodeJsVar() or Xml::encodeJsCall() instead
- */
- function jstext( $str ) {
- wfDeprecated( __METHOD__, '1.21' );
- echo Xml::escapeJsString( $this->data[$str] );
- }
-
/**
* @private
*/
if ( isset( $plink['active'] ) ) {
$ptool['active'] = $plink['active'];
}
- foreach ( array( 'href', 'class', 'text' ) as $k ) {
+ foreach ( array( 'href', 'class', 'text', 'dir' ) as $k ) {
if ( isset( $plink[$k] ) ) {
$ptool['links'][0][$k] = $plink[$k];
}
*
* @param $key string, usually a key from the list you are generating this link from.
* @param $item array, of list item data containing some of a specific set of keys.
- * The "id" and "class" keys will be used as attributes for the list item,
+ * The "id", "class" and "itemtitle" keys will be used as attributes for the list item,
* if "active" contains a value of true a "active" class will also be appended to class.
*
* @param $options array
* list item directly so they will not be passed to makeLink
* (however the link will still support a tooltip and accesskey from it)
* If you need an id or class on a single link you should include a "links"
- * array with just one link item inside of it.
+ * array with just one link item inside of it. If you want to add a title
+ * to the list item itself, you can set "itemtitle" to the value.
* $options is also passed on to makeLink calls
*
* @return string
} else {
$link = $item;
// These keys are used by makeListItem and shouldn't be passed on to the link
- foreach ( array( 'id', 'class', 'active', 'tag' ) as $k ) {
+ foreach ( array( 'id', 'class', 'active', 'tag', 'itemtitle' ) as $k ) {
unset( $link[$k] );
}
if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) {
$attrs['class'] .= ' active';
$attrs['class'] = trim( $attrs['class'] );
}
+ if ( isset( $item['itemtitle'] ) ) {
+ $attrs['title'] = $item['itemtitle'];
+ }
return Html::rawElement( isset( $options['tag'] ) ? $options['tag'] : 'li', $attrs, $html );
}