global $wgDisableCounters, $wgSitename, $wgLogo, $wgHideInterlanguageLinks;
global $wgMaxCredits, $wgShowCreditsIfMax;
global $wgPageShowWatchingUsers;
- global $wgDebugComments;
global $wgArticlePath, $wgScriptPath, $wgServer;
wfProfileIn( __METHOD__ );
}
}
- if ( $wgDebugComments ) {
- $tpl->setRef( 'debug', $out->mDebugtext );
- } else {
- $tpl->set( 'debug', '' );
- }
-
$tpl->set( 'sitenotice', $this->getSiteNotice() );
$tpl->set( 'bottomscripts', $this->bottomScripts() );
$tpl->set( 'printfooter', $this->printSource() );
if ( !in_array( $title->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) &&
in_array( $request->getVal( 'action', 'view' ), array( 'view', 'historysubmit' ) ) &&
( $title->exists() || $title->getNamespace() == NS_MEDIAWIKI ) ) {
- $pageLang = $title->getPageLanguage();
+ $pageLang = $title->getPageViewLanguage();
$realBodyAttribs['lang'] = $pageLang->getHtmlCode();
$realBodyAttribs['dir'] = $pageLang->getDir();
$realBodyAttribs['class'] = 'mw-content-'.$pageLang->getDir();
if ( strval( $ilLangName ) === '' ) {
$ilLangName = $l;
} else {
- $ilLangName = $this->getLanguage()->ucfirst( $ilLangName );
+ $ilLangName = $this->formatLanguageName( $ilLangName );
}
$language_urls[] = array(
'href' => $nt->getFullURL(),
$tpl->set( 'headscripts', $out->getHeadScripts() . $out->getHeadItems() );
}
+ $tpl->set( 'debug', '' );
$tpl->set( 'debughtml', $this->generateDebugHTML() );
$tpl->set( 'reporttime', wfReportTime() );
wfProfileOut( __METHOD__ );
}
+ /**
+ * Format language name for use in sidebar interlanguage links list.
+ * By default it is capitalized.
+ *
+ * @param $name string Language name, e.g. "English" or "espaƱol"
+ * @return string
+ * @private
+ */
+ function formatLanguageName( $name ) {
+ return $this->getLanguage()->ucfirst( $name );
+ }
+
/**
* Output the string, or print error message if it's
* an error object of the appropriate type.
* @return array
*/
protected function buildPersonalUrls() {
+ global $wgSecureLogin;
+
$title = $this->getTitle();
$request = $this->getRequest();
$pageurl = $title->getLocalURL();
$a['returntoquery'] = $query;
}
}
+
+ if ( $wgSecureLogin && $request->detectProtocol() === 'https' ) {
+ $a['wpStickHTTPS'] = true;
+ }
+
$returnto = wfArrayToCGI( $a );
if( $this->loggedin ) {
$personal_urls['userpage'] = array(
$nav_urls['print'] = false;
$nav_urls['permalink'] = false;
+ $nav_urls['info'] = false;
$nav_urls['whatlinkshere'] = false;
$nav_urls['recentchangeslinked'] = false;
$nav_urls['contributions'] = false;
if ( $revid ) {
$nav_urls['permalink'] = array(
'text' => $this->msg( 'permalink' )->text(),
- 'href' => $out->getTitle()->getLocalURL( "oldid=$revid" )
+ 'href' => $this->getTitle()->getLocalURL( "oldid=$revid" )
);
}
+ $nav_urls['info'] = array(
+ 'text' => $this->msg( 'pageinfo-toolboxlink' )->text(),
+ 'href' => $out->getTitle()->getLocalURL( "action=info" )
+ );
+
// Use the copy of revision ID in case this undocumented, shady hook tries to mess with internals
wfRunHooks( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink',
array( &$this, &$nav_urls, &$revid, &$revid ) );
'href' => self::makeSpecialUrlSubpage( 'Contributions', $rootUser )
);
- $logPage = SpecialPage::getTitleFor( 'Log' );
$nav_urls['log'] = array(
- 'href' => $logPage->getLocalUrl( array( 'user' => $rootUser ) )
+ 'href' => self::makeSpecialUrlSubpage( 'Log', $rootUser )
);
if ( $this->getUser()->isAllowed( 'block' ) ) {
/**
* Constructor
*/
- public function QuickTemplate() {
+ function __construct() {
$this->data = array();
$this->translator = new MediaWiki_I18N();
}
$toolbox['permalink']['id'] = 't-permalink';
}
}
+ if ( isset( $this->data['nav_urls']['info'] ) && $this->data['nav_urls']['info'] ) {
+ $toolbox['info'] = $this->data['nav_urls']['info'];
+ $toolbox['info']['id'] = 't-info';
+ }
+
wfRunHooks( 'BaseTemplateToolbox', array( &$this, &$toolbox ) );
wfProfileOut( __METHOD__ );
return $toolbox;
foreach ( array( 'id', 'class', 'active', 'tag' ) as $k ) {
unset( $link[$k] );
}
- if ( isset( $item['id'] ) ) {
+ if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) {
// The id goes on the <li> not on the <a> for single links
// but makeSidebarLink still needs to know what id to use when
// generating tooltips and accesskeys.
);
unset( $buttonAttrs['src'] );
unset( $buttonAttrs['alt'] );
+ unset( $buttonAttrs['width'] );
+ unset( $buttonAttrs['height'] );
$imgAttrs = array(
'src' => $attrs['src'],
'alt' => isset( $attrs['alt'] )
? $attrs['alt']
: $this->translator->translate( 'searchbutton' ),
+ 'width' => isset( $attrs['width'] ) ? $attrs['width'] : null,
+ 'height' => isset( $attrs['height'] ) ? $attrs['height'] : null,
);
return Html::rawElement( 'button', $buttonAttrs, Html::element( 'img', $imgAttrs ) );
default:
function printTrail() { ?>
<?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
<?php $this->html( 'reporttime' ) ?>
-<?php if ( $this->data['debug'] ): ?>
-<!-- Debug output:
-<?php $this->text( 'debug' ); ?>
-
--->
-<?php endif;
+<?php echo MWDebug::getDebugHTML( $this->getSkin()->getContext() );
}
}
-