if ( $wgMaxCredits != 0 ) {
$s .= ' ' . Credits::getCredits( $article, $wgMaxCredits, $wgShowCreditsIfMax );
} else {
- $s .= $this->lastModified();
+ $s .= $this->lastModified( $article );
}
if ( $wgPageShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' ) ) {
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 ) {
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 );