summaryrefslogtreecommitdiff
path: root/includes/SkinTemplate.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
commit72e90545454c0e014318fa3c81658e035aac58c1 (patch)
tree9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /includes/SkinTemplate.php
parent565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff)
applying patch to version 1.15.0
Diffstat (limited to 'includes/SkinTemplate.php')
-rw-r--r--includes/SkinTemplate.php40
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&section=new' )
- );
+ if ( !$wgOut->forceHideNewSectionLink() ) {
+ $content_actions['addsection'] = array(
+ 'class' => $section == 'new' ? 'selected' : false,
+ 'text' => wfMsg('addsection'),
+ 'href' => $this->mTitle->getLocalUrl( 'action=edit&section=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 ) ) {