$wgOut->setArticleRelated( true );
$wgOut->setRobotpolicy( 'noindex,nofollow' );
$wgOut->setSyndicated( true );
+ $wgOut->setFeedAppendQuery( 'action=history' );
$logPage = SpecialPage::getTitleFor( 'Log' );
$logLink = $this->mSkin->makeKnownLinkObj( $logPage, wfMsgHtml( 'viewpagelogs' ), 'page=' . $this->mTitle->getPrefixedUrl() );
* Fail if article doesn't exist.
*/
if( !$this->mTitle->exists() ) {
- $wgOut->addWikiText( wfMsg( 'nohistory' ) );
+ $wgOut->addWikiMsg( 'nohistory' );
wfProfileOut( $fname );
return;
}
*/
function submitButton( $bits = array() ) {
# Disable submit button if history has 1 revision only
- if ( $this->linesonpage == 1 ) {
- $bits = $bits + array( 'disabled' => 'disabled' );
- }
- return Xml::submitButton( wfMsg( 'compareselectedversions' ),
+ if ( $this->linesonpage > 1 ) {
+ return Xml::submitButton( wfMsg( 'compareselectedversions' ),
$bits + array(
'class' => 'historysubmit',
'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
'title' => wfMsg( 'tooltip-compareselectedversions' ),
)
);
+ } else {
+ return '';
+ }
}
/**
$tools = array();
if ( !is_null( $next ) && is_object( $next ) ) {
- if( $wgUser->isAllowed( 'rollback' ) && $latest ) {
+ if( !$this->mTitle->getUserPermissionsErrors( 'rollback', $wgUser )
+ && !$this->mTitle->getUserPermissionsErrors( 'edit', $wgUser )
+ && $latest ) {
$tools[] = '<span class="mw-rollback-link">'
. $this->mSkin->buildRollbackLink( $rev )
. '</span>';
}
- $undolink = $this->mSkin->makeKnownLinkObj(
- $this->mTitle,
- wfMsgHtml( 'editundo' ),
- 'action=edit&undoafter=' . $next->rev_id . '&undo=' . $rev->getId()
- );
- $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
+ if( $this->mTitle->quickUserCan( 'edit' ) ) {
+ $undolink = $this->mSkin->makeKnownLinkObj(
+ $this->mTitle,
+ wfMsgHtml( 'editundo' ),
+ 'action=edit&undoafter=' . $next->rev_id . '&undo=' . $rev->getId()
+ );
+ $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
+ }
}
if( $tools ) {
function feed( $type ) {
require_once 'SpecialRecentchanges.php';
- global $wgFeedClasses;
+ global $wgFeed, $wgFeedClasses;
+
+ if ( !$wgFeed ) {
+ global $wgOut;
+ $wgOut->addWikiMsg( 'feed-unavailable' );
+ return;
+ }
+
if( !isset( $wgFeedClasses[$type] ) ) {
global $wgOut;
- $wgOut->addWikiText( wfMsg( 'feed-invalid' ) );
+ $wgOut->addWikiMsg( 'feed-invalid' );
return;
}