/** The RevDel_List object, storing the list of items to be deleted/undeleted */
var $list;
- /** New bitfield value, used for form display post-submit */
- var $newBits;
-
/**
* Assorted information about each type, needed by the special page.
* TODO Move some of this to the list class
$qc = $this->getLogQueryCond();
# Show relevant lines from the deletion log
$wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
- LogEventsList::showLogExtract( $wgOut, 'delete', $this->targetObj->getPrefixedText(), '', 25, $qc );
+ LogEventsList::showLogExtract( $wgOut, 'delete',
+ $this->targetObj->getPrefixedText(), '', 25, $qc );
# Show relevant lines from the suppression log
if( $wgUser->isAllowed( 'suppressionlog' ) ) {
$wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "</h2>\n" );
- LogEventsList::showLogExtract( $wgOut, 'suppress', $this->targetObj->getPrefixedText(), '', 25, $qc );
+ LogEventsList::showLogExtract( $wgOut, 'suppress',
+ $this->targetObj->getPrefixedText(), '', 25, $qc );
}
}
if( $this->targetObj ) {
$links = array();
$logtitle = SpecialPage::getTitleFor( 'Log' );
- $links[] = $this->skin->makeKnownLinkObj( $logtitle, wfMsgHtml( 'viewpagelogs' ),
- wfArrayToCGI( array( 'page' => $this->targetObj->getPrefixedUrl() ) ) );
+ $links[] = $this->skin->linkKnown(
+ $logtitle,
+ wfMsgHtml( 'viewpagelogs' ),
+ array(),
+ array( 'page' => $this->targetObj->getPrefixedText() )
+ );
# Give a link to the page history
- $links[] = $this->skin->makeKnownLinkObj( $this->targetObj, wfMsgHtml( 'pagehist' ),
- wfArrayToCGI( array( 'action' => 'history' ) ) );
+ $links[] = $this->skin->linkKnown(
+ $this->targetObj,
+ wfMsgHtml( 'pagehist' ),
+ array(),
+ array( 'action' => 'history' )
+ );
# Link to deleted edits
if( $wgUser->isAllowed('undelete') ) {
$undelete = SpecialPage::getTitleFor( 'Undelete' );
- $links[] = $this->skin->makeKnownLinkObj( $undelete, wfMsgHtml( 'deletedhist' ),
- wfArrayToCGI( array( 'target' => $this->targetObj->getPrefixedDBkey() ) ) );
+ $links[] = $this->skin->linkKnown(
+ $undelete,
+ wfMsgHtml( 'deletedhist' ),
+ array(),
+ array( 'target' => $this->targetObj->getPrefixedDBkey() )
+ );
}
# Logs themselves don't have histories or archived revisions
$wgOut->setSubtitle( '<p>'.implode($links,' / ').'</p>' );
if ( $this->typeName == 'logging' ) {
$wgOut->addWikiMsg( 'logdelete-selected', $wgLang->formatNum( count($this->ids) ) );
} else {
- $wgOut->addWikiMsg( 'revdelete-selected', $this->targetObj->getPrefixedText(), count( $this->ids ) );
+ $wgOut->addWikiMsg( 'revdelete-selected',
+ $this->targetObj->getPrefixedText(), count( $this->ids ) );
}
$bitfields = 0;
$wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
return;
}
-
- if ( !is_null( $this->newBits ) ) {
- $bitfields = $this->newBits;
- }
$wgOut->addHTML( "</ul>" );
// Explanation text
$wgOut->addHTML(
Xml::openElement( 'form', array( 'method' => 'post',
- 'action' => $this->getTitle()->getLocalUrl( 'action=submit' ),
+ 'action' => $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) ),
'id' => 'mw-revdel-form-revisions' ) ) .
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', null, wfMsg( 'revdelete-legend' ) ) .
global $wgOut;
$wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
$wgOut->wrapWikiMsg( '<span class="success">$1</span>', $this->typeInfo['success'] );
+ $this->list->reloadFromMaster();
$this->showForm();
}
if( $bitfield == Revision::DELETED_RESTRICTED ) {
return Status::newFatal( 'revdelete-only-restricted' );
}
- $this->newBits = $bitfield;
return $this->getList()->setVisibility( array(
'value' => $bitfield,
'comment' => $reason ) );
return $status;
}
+ /**
+ * Reload the list data from the master DB. This can be done after setVisibility()
+ * to allow $item->getHTML() to show the new data.
+ */
+ function reloadFromMaster() {
+ $dbw = wfGetDB( DB_MASTER );
+ $this->res = $this->doQuery( $dbw );
+ }
+
/**
* Record a log entry on the action
* @param $params Associative array of parameters:
$logParams = $this->getLogParams( $params );
// Actually add the deletion log entry
$log = new LogPage( $logType );
- $logid = $log->addEntry( $this->getLogAction(), $params['title'], $params['comment'], $logParams );
+ $logid = $log->addEntry( $this->getLogAction(), $params['title'],
+ $params['comment'], $logParams );
// Allow for easy searching of deletion log items for revision/log items
$log->addRelations( $field, $params['ids'], $logid );
}
),
array(
'rc_this_oldid' => $this->revision->getId(), // condition
- 'rc_timestamp' => $dbw->timestamp( $this->revision->getTimestamp() ), // non-unique index
+ // non-unique timestamp index
+ 'rc_timestamp' => $dbw->timestamp( $this->revision->getTimestamp() ),
),
__METHOD__
);
if ( $this->isDeleted() && !$this->canView() ) {
return $date;
}
- return $this->special->skin->makeLinkObj( $this->list->title, $date,
- 'oldid='.$this->revision->getId() . '&unhide=1' );
+ return $this->special->skin->link(
+ $this->list->title,
+ $date,
+ array(),
+ array(
+ 'oldid' => $this->revision->getId(),
+ 'unhide' => 1
+ )
+ );
}
/**
return wfMsgHtml('diff');
} else {
return
- $this->special->skin->makeKnownLinkObj(
+ $this->special->skin->link(
$this->list->title,
wfMsgHtml('diff'),
- 'diff=' . $this->revision->getId() . '&oldid=prev&unhide=1'
+ array(),
+ array(
+ 'diff' => $this->revision->getId(),
+ 'oldid' => 'prev',
+ 'unhide' => 1
+ ),
+ array(
+ 'known',
+ 'noclasses'
+ )
);
}
}
$title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
$logtitle = SpecialPage::getTitleFor( 'Log' );
- $loglink = $this->special->skin->link( $logtitle, wfMsgHtml( 'log' ), array(),
- array( 'page' => $title->getPrefixedUrl() ) );
+ $loglink = $this->special->skin->link(
+ $logtitle,
+ wfMsgHtml( 'log' ),
+ array(),
+ array( 'page' => $title->getPrefixedText() )
+ );
// Action text
if( !$this->canView() ) {
$action = '<span class="history-deleted">' . wfMsgHtml('rev-deleted-event') . '</span>';