diff options
Diffstat (limited to 'includes/SkinTemplate.php')
-rw-r--r-- | includes/SkinTemplate.php | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 4f13571a..4317a93e 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -138,7 +138,7 @@ class SkinTemplate extends Skin { global $wgScript, $wgStylePath, $wgContLanguageCode; global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest; global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces; - global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgHideInterlanguageLinks; + global $wgDisableCounters, $wgLogo, $wgHideInterlanguageLinks; global $wgMaxCredits, $wgShowCreditsIfMax; global $wgPageShowWatchingUsers; global $wgUseTrackbacks, $wgUseSiteJs; @@ -148,6 +148,7 @@ class SkinTemplate extends Skin { $oldid = $wgRequest->getVal( 'oldid' ); $diff = $wgRequest->getVal( 'diff' ); + $action = $wgRequest->getVal( 'action', 'view' ); wfProfileIn( __METHOD__."-init" ); $this->initPage( $out ); @@ -258,6 +259,7 @@ class SkinTemplate extends Skin { $tpl->set( "helppage", wfMsg('helppage')); */ $tpl->set( 'searchaction', $this->escapeSearchLink() ); + $tpl->set( 'searchtitle', SpecialPage::getTitleFor('search')->getPrefixedDBKey() ); $tpl->set( 'search', trim( $wgRequest->getVal( 'search' ) ) ); $tpl->setRef( 'stylepath', $wgStylePath ); $tpl->setRef( 'articlepath', $wgArticlePath ); @@ -401,7 +403,7 @@ class SkinTemplate extends Skin { $tpl->set( 'bottomscripts', $this->bottomScripts() ); $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n"; - $out->mBodytext .= $printfooter ; + $out->mBodytext .= $printfooter . $this->generateDebugHTML(); $tpl->setRef( 'bodytext', $out->mBodytext ); # Language links @@ -449,7 +451,7 @@ class SkinTemplate extends Skin { // original version by hansm if( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) { - wfDebug( __METHOD__ . ': Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!' ); + wfDebug( __METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n" ); } // allow extensions adding stuff after the page content. @@ -647,12 +649,12 @@ class SkinTemplate extends Skin { * @private */ function buildContentActionUrls() { - global $wgContLang, $wgLang, $wgOut; + global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest; + wfProfileIn( __METHOD__ ); - global $wgUser, $wgRequest; - $action = $wgRequest->getText( 'action' ); - $section = $wgRequest->getText( 'section' ); + $action = $wgRequest->getVal( 'action', 'view' ); + $section = $wgRequest->getVal( 'section' ); $content_actions = array(); $prevent_active_tabs = false ; @@ -689,11 +691,13 @@ class SkinTemplate extends Skin { ); if ( $istalk || $wgOut->showNewSectionLink() ) { - $content_actions['addsection'] = array( - 'class' => $section == 'new'?'selected':false, - 'text' => wfMsg('addsection'), - 'href' => $this->mTitle->getLocalUrl( 'action=edit§ion=new' ) - ); + if ( !$wgOut->forceHideNewSectionLink() ) { + $content_actions['addsection'] = array( + 'class' => $section == 'new' ? 'selected' : false, + 'text' => wfMsg('addsection'), + 'href' => $this->mTitle->getLocalUrl( 'action=edit§ion=new' ) + ); + } } } elseif ( $this->mTitle->isKnown() ) { $content_actions['viewsource'] = array( @@ -710,7 +714,8 @@ class SkinTemplate extends Skin { $content_actions['history'] = array( 'class' => ($action == 'history') ? 'selected' : false, 'text' => wfMsg('history_short'), - 'href' => $this->mTitle->getLocalUrl( 'action=history') + 'href' => $this->mTitle->getLocalUrl( 'action=history' ), + 'rel' => 'archives', ); if( $wgUser->isAllowed('delete') ) { @@ -848,7 +853,7 @@ class SkinTemplate extends Skin { wfProfileIn( __METHOD__ ); - $action = $wgRequest->getText( 'action' ); + $action = $wgRequest->getVal( 'action', 'view' ); $nav_urls = array(); $nav_urls['mainpage'] = array( 'href' => self::makeMainPageUrl() ); @@ -871,7 +876,7 @@ class SkinTemplate extends Skin { // A print stylesheet is attached to all pages, but nobody ever // figures that out. :) Add a link... - if( $this->iscontent && ($action == '' || $action == 'view' || $action == 'purge' ) ) { + if( $this->iscontent && ( $action == 'view' || $action == 'purge' ) ) { $nav_urls['print'] = array( 'text' => wfMsg( 'printableversion' ), 'href' => $wgRequest->appendQuery( 'printable=yes' ) @@ -965,10 +970,11 @@ class SkinTemplate extends Skin { * @private */ function setupUserJs( $allowUserJs ) { + global $wgRequest, $wgJsMimeType; + wfProfileIn( __METHOD__ ); - global $wgRequest, $wgJsMimeType; - $action = $wgRequest->getText('action'); + $action = $wgRequest->getVal( 'action', 'view' ); if( $allowUserJs && $this->loggedin ) { if( $this->mTitle->isJsSubpage() and $this->userCanPreview( $action ) ) { |