From: Brion Vibber Date: Sun, 25 Apr 2004 00:32:24 +0000 (+0000) Subject: Use the set page title and HTML title in MonoBook skin, which was ignoring X-Git-Tag: 1.3.0beta1~278 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=1e3a9f95801084244148c350ca99f3003d269d77;p=lhc%2Fweb%2Fwiklou.git Use the set page title and HTML title in MonoBook skin, which was ignoring them. Moved the action name appending into Output to work with all skins. --- diff --git a/includes/Article.php b/includes/Article.php index 10e6a7b4f7..f0dba9725f 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -457,8 +457,6 @@ class Article { $text = $this->getContent(); # May change mTitle $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); - $wgOut->setHTMLTitle( $this->mTitle->getPrefixedText() . - " - " . wfMsg( "wikititlesuffix" ) ); # We're looking at an old revision diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 7d514cf739..86d2cbc931 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -109,9 +109,43 @@ class OutputPage { } } + function getPageTitleActionText () { + global $action; + switch($action) { + case 'edit': + return wfMsg('edit'); + case 'history': + return wfMsg('history_short'); + case 'protect': + return wfMsg('unprotect'); + case 'unprotect': + return wfMsg('unprotect'); + case 'delete': + return wfMsg('delete'); + case 'watch': + return wfMsg('watch'); + case 'unwatch': + return wfMsg('unwatch'); + case 'submit': + return wfMsg('preview'); + default: + return ''; + } + } function setRobotpolicy( $str ) { $this->mRobotpolicy = $str; } - function setHTMLtitle( $name ) { $this->mHTMLtitle = $name; } - function setPageTitle( $name ) { $this->mPagetitle = $name; } + function setHTMLTitle( $name ) {$this->mHTMLtitle = $name; } + function setPageTitle( $name ) { + global $action; + $this->mPagetitle = $name; + if(!empty($action)) { + $taction = $this->getPageTitleActionText(); + if( !empty( $taction ) ) { + $name .= " - $taction"; + } + } + $this->setHTMLTitle( $name . " - " . wfMsg( "wikititlesuffix" ) ); + } + function getHTMLTitle() { return $this->mHTMLtitle; } function getPageTitle() { return $this->mPagetitle; } function setSubtitle( $str ) { $this->mSubtitle = $str; } function getSubtitle() { return $this->mSubtitle; } @@ -384,8 +418,8 @@ class OutputPage { $this->mDebugtext .= "Original title: " . $wgTitle->getPrefixedText() . "\n"; - $this->setHTMLTitle( wfMsg( "errorpagetitle" ) ); $this->setPageTitle( wfMsg( $title ) ); + $this->setHTMLTitle( wfMsg( "errorpagetitle" ) ); $this->setRobotpolicy( "noindex,nofollow" ); $this->setArticleRelated( false ); $this->enableClientCache( false ); @@ -402,8 +436,8 @@ class OutputPage { { global $wgUser; - $this->setHTMLTitle( wfMsg( "errorpagetitle" ) ); $this->setPageTitle( wfMsg( "sysoptitle" ) ); + $this->setHTMLTitle( wfMsg( "errorpagetitle" ) ); $this->setRobotpolicy( "noindex,nofollow" ); $this->setArticleRelated( false ); $this->mBodytext = ""; @@ -418,8 +452,8 @@ class OutputPage { { global $wgUser; - $this->setHTMLTitle( wfMsg( "errorpagetitle" ) ); $this->setPageTitle( wfMsg( "developertitle" ) ); + $this->setHTMLTitle( wfMsg( "errorpagetitle" ) ); $this->setRobotpolicy( "noindex,nofollow" ); $this->setArticleRelated( false ); $this->mBodytext = ""; @@ -434,8 +468,8 @@ class OutputPage { { global $wgUser, $wgTitle, $wgLang; - $this->setHTMLTitle( wfMsg( "errorpagetitle" ) ); $this->setPageTitle( wfMsg( "loginreqtitle" ) ); + $this->setHTMLTitle( wfMsg( "errorpagetitle" ) ); $this->setRobotpolicy( "noindex,nofollow" ); $this->setArticleFlag( false ); $this->mBodytext = ""; diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index cddc7535ca..1d48775ed8 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -83,12 +83,9 @@ $tpl->setTranslator(new MediaWiki_I18N()); #} - $tpl->setRef( "title", &$this->titletxt ); // ? - if(!empty($action)) { - $taction = $this->getPageTitleActionText(); - $taction = !empty($taction)?' - '.$taction:''; - } else { $taction = ''; } - $tpl->set( "pagetitle", wfMsg( "pagetitle", $this->titletxt.$taction ) ); + $tpl->set( "title", $wgOut->getPageTitle() ); + $tpl->set( "pagetitle", $wgOut->getHTMLTitle() ); + $tpl->setRef( "thispage", &$this->thispage ); $tpl->set( "subtitle", $out->getSubtitle() ); $tpl->set( 'catlinks', getCategories());