Use the set page title and HTML title in MonoBook skin, which was ignoring
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 25 Apr 2004 00:32:24 +0000 (00:32 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 25 Apr 2004 00:32:24 +0000 (00:32 +0000)
them. Moved the action name appending into Output to work with all skins.

includes/Article.php
includes/OutputPage.php
includes/SkinPHPTal.php

index 10e6a7b..f0dba97 100644 (file)
@@ -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
 
index 7d514cf..86d2cbc 100644 (file)
@@ -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 = "";
index cddc753..1d48775 100644 (file)
                        $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());