$month = $wgRequest->getInt( 'month' );
$tagFilter = $wgRequest->getVal( 'tagfilter' );
$tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter );
+ /**
+ * Option to show only revisions that have been (partially) hidden via RevisionDelete
+ * Note that this can run a *long* time if there are many revisions to look at.
+ * We use "isBigDeletion" to determine if the history is too big to go through.
+ * Additionally, only users with 'deleterevision' right can filter for deleted edits.
+ */
+ if ( $this->title->userCan( 'deleterevision' ) && ( !$this->article->isBigDeletion() || $this->title->userCan( 'bigdelete' ) ) ) {
+ $conds = ( $wgRequest->getBool( 'deleted' ) ) ? array("rev_deleted != '0'") : array();
+ $checkDeleted = Xml::checkLabel( wfMsg( 'history-show-deleted' ), 'deleted', '', $wgRequest->getBool( 'deleted' ) ) . "\n";
+ }
+ else { # Don't filter and don't add the checkbox for filtering
+ $conds = array();
+ $checkDeleted = '';
+ }
$action = htmlspecialchars( $wgScript );
$wgOut->addHTML(
) .
Xml::hidden( 'title', $this->title->getPrefixedDBKey() ) . "\n" .
Xml::hidden( 'action', 'history' ) . "\n" .
- xml::dateMenu( $year, $month ) . ' ' .
+ Xml::dateMenu( $year, $month ) . ' ' .
( $tagSelector ? ( implode( ' ', $tagSelector ) . ' ' ) : '' ) .
+ $checkDeleted .
Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
'</fieldset></form>'
);
/**
* Do the list
*/
- $pager = new HistoryPager( $this, $year, $month, $tagFilter );
+ $pager = new HistoryPager( $this, $year, $month, $tagFilter, $conds );
$wgOut->addHTML(
$pager->getNavigationBar() .
$pager->getBody() .
* @ingroup Pager
*/
class HistoryPager extends ReverseChronologicalPager {
- public $lastRow = false, $counter, $historyPage, $title, $buttons;
+ public $lastRow = false, $counter, $historyPage, $title, $buttons, $conds;
protected $oldIdChecked;
- function __construct( $historyPage, $year='', $month='', $tagFilter = '' ) {
+ function __construct( $historyPage, $year='', $month='', $tagFilter = '', $conds = array() ) {
parent::__construct();
$this->historyPage = $historyPage;
$this->title = $this->historyPage->title;
$this->tagFilter = $tagFilter;
$this->getDateCond( $year, $month );
+ $this->conds = $conds;
}
// For hook compatibility...
$queryInfo = array(
'tables' => array('revision'),
'fields' => array_merge( Revision::selectFields(), array('ts_tags') ),
- 'conds' => array('rev_page' => $this->historyPage->title->getArticleID() ),
+ 'conds' => array_merge( array('rev_page' => $this->historyPage->title->getArticleID() ), $this->conds ),
'options' => array( 'USE INDEX' => array('revision' => 'page_timestamp') ),
'join_conds' => array( 'tag_summary' => array( 'LEFT JOIN', 'ts_rev_id=rev_id' ) ),
);