protected function showCssOrJsPage() {
global $wgOut;
- $dir = $this->getContext()->getLang()->getDir();
- $lang = $this->getContext()->getLang()->getCode();
+ $dir = $this->getContext()->getLanguage()->getDir();
+ $lang = $this->getContext()->getLanguage()->getCode();
$wgOut->wrapWikiMsg( "<div id='mw-clearyourcache' lang='$lang' dir='$dir' class='mw-content-$dir'>\n$1\n</div>",
'clearyourcache' );
'href' => $this->getTitle()->getLocalURL() )
);
+ // Tell $wgOut the user arrived at this article through a redirect
+ $wgOut->setRedirectedFrom( $this->mRedirectedFrom );
+
return true;
}
} elseif ( $rdfrom ) {
* Show the footer section of an ordinary page view
*/
public function showViewFooter() {
- global $wgOut, $wgUseTrackbacks;
+ global $wgOut;
# check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page
if ( $this->getTitle()->getNamespace() == NS_USER_TALK && IP::isValid( $this->getTitle()->getText() ) ) {
# chance to mark this new article as patrolled.
$this->showPatrolFooter();
- # Trackbacks
- if ( $wgUseTrackbacks ) {
- $this->addTrackbacks();
- }
-
wfRunHooks( 'ArticleViewFooter', array( $this ) );
}
$user = User::newFromName( $rootPart, false /* allow IP users*/ );
$ip = User::isIP( $rootPart );
- if ( !$user->isLoggedIn() && !$ip ) { # User does not exist
+ if ( !($user && $user->isLoggedIn()) && !$ip ) { # User does not exist
$wgOut->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n\$1\n</div>",
array( 'userpage-userdoesnotexist-view', wfEscapeWikiText( $rootPart ) ) );
} elseif ( $user->isBlocked() ) { # Show log extract if the user is currently blocked
'<span class="redirectText">' . $link . '</span></div>';
}
- /**
- * Builds trackback links for article display if $wgUseTrackbacks is set to true
- */
- public function addTrackbacks() {
- global $wgOut;
-
- $dbr = wfGetDB( DB_SLAVE );
- $tbs = $dbr->select( 'trackbacks',
- array( 'tb_id', 'tb_title', 'tb_url', 'tb_ex', 'tb_name' ),
- array( 'tb_page' => $this->mPage->getID() )
- );
-
- if ( !$dbr->numRows( $tbs ) ) {
- return;
- }
-
- $wgOut->preventClickjacking();
-
- $tbtext = "";
- foreach ( $tbs as $o ) {
- $rmvtxt = "";
-
- if ( $this->getContext()->getUser()->isAllowed( 'trackback' ) ) {
- $delurl = $this->getTitle()->getFullURL( "action=deletetrackback&tbid=" .
- $o->tb_id . "&token=" . urlencode( $this->getContext()->getUser()->getEditToken() ) );
- $rmvtxt = wfMsg( 'trackbackremove', htmlspecialchars( $delurl ) );
- }
-
- $tbtext .= "\n";
- $tbtext .= wfMsgNoTrans( strlen( $o->tb_ex ) ? 'trackbackexcerpt' : 'trackback',
- $o->tb_title,
- $o->tb_url,
- $o->tb_ex,
- $o->tb_name,
- $rmvtxt );
- }
-
- $wgOut->wrapWikiMsg( "<div id='mw_trackbacks'>\n$1\n</div>\n", array( 'trackbackbox', $tbtext ) );
- }
-
/**
* Handle action=render
*/
}
}
- /**
- * Removes trackback record for current article from trackbacks table
- * @deprecated since 1.18
- */
- public function deletetrackback() {
- return Action::factory( 'deletetrackback', $this )->show();
- }
-
/**
* Info about this page
* @deprecated since 1.19