Last $wgArticle junk in Skin(Template). Just pass the article on hand to lastModified...
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 26 Jan 2011 17:06:18 +0000 (17:06 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 26 Jan 2011 17:06:18 +0000 (17:06 +0000)
includes/Skin.php
includes/SkinTemplate.php

index a937b4c..b5309f4 100644 (file)
@@ -1498,7 +1498,7 @@ class Skin extends Linker {
                if ( $wgMaxCredits != 0 ) {
                        $s .= ' ' . Credits::getCredits( $article, $wgMaxCredits, $wgShowCreditsIfMax );
                } else {
-                       $s .= $this->lastModified();
+                       $s .= $this->lastModified( $article );
                }
 
                if ( $wgPageShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' ) ) {
@@ -1608,13 +1608,19 @@ class Skin extends Linker {
                return $text;
        }
 
-       function lastModified() {
-               global $wgLang, $wgArticle;
+       /**
+        * Get the timestamp of the latest revision, formatted in user language
+        *
+        * @param $article Article object. Used if we're working with the current revision
+        * @return String
+        */
+       protected function lastModified( $article ) {
+               global $wgLang;
 
                if ( !$this->isRevisionCurrent() ) {
                        $timestamp = Revision::getTimestampFromId( $this->mTitle, $this->mRevisionId );
                } else {
-                       $timestamp = $wgArticle->getTimestamp();
+                       $timestamp = $article->getTimestamp();
                }
 
                if ( $timestamp ) {
index d074f1e..752f490 100644 (file)
@@ -387,7 +387,7 @@ class SkinTemplate extends Skin {
                        if( $wgMaxCredits != 0 ){
                                $this->credits = Credits::getCredits( $article, $wgMaxCredits, $wgShowCreditsIfMax );
                        } else {
-                               $tpl->set( 'lastmod', $this->lastModified() );
+                               $tpl->set( 'lastmod', $this->lastModified( $article ) );
                        }
 
                        $tpl->setRef( 'credits', $this->credits );