private $typeOnUser = array(
'block',
'newusers',
- 'right',
+ 'rights',
);
public function __construct() {
private function show( FormOptions $opts, array $extraConds ) {
# Create a LogPager item to get the results and a LogEventsList item to format them...
- $loglist = new LogEventsList( $this->getSkin(), $this->getOutput(), 0 );
+ $loglist = new LogEventsList( $this->getSkin(), $this->getOutput(), LogEventsList::USE_REVDEL_CHECKBOXES );
$pager = new LogPager( $loglist, $opts->getValue( 'type' ), $opts->getValue( 'user' ),
$opts->getValue( 'page' ), $opts->getValue( 'pattern' ), $extraConds, $opts->getValue( 'year' ),
$opts->getValue( 'month' ), $opts->getValue( 'tagfilter' ) );
}
# Show form options
- $loglist->showOptions( $pager->getType(), $pager->getPerformer(), $pager->getPage(), $pager->getPattern(),
+ $loglist->showOptions( $pager->getType(), $opts->getValue( 'user' ), $pager->getPage(), $pager->getPattern(),
$pager->getYear(), $pager->getMonth(), $pager->getFilterParams(), $opts->getValue( 'tagfilter' ) );
# Insert list
if ( $logBody ) {
$this->getOutput()->addHTML(
$pager->getNavigationBar() .
- $loglist->beginLogEventsList() .
- $logBody .
- $loglist->endLogEventsList() .
+ $this->getRevisionButton( $loglist->beginLogEventsList() . $logBody . $loglist->endLogEventsList() ) .
$pager->getNavigationBar()
);
} else {
}
}
+ private function getRevisionButton( $formcontents ) {
+ # If the user doesn't have the ability to delete revisions, don't bother showing him/her the button.
+ if ( !$this->getUser()->isAllowed( 'deleterevision' ) ) {
+ return $formcontents;
+ }
+
+ # Show button to hide log entries
+ global $wgScript;
+ $s = Html::openElement( 'form', array( 'action' => $wgScript, 'id' => 'mw-log-deleterevision-submit' ) ) . "\n";
+ $s .= Html::hidden( 'title', SpecialPage::getTitleFor( 'Revisiondelete' ) ) . "\n";
+ $s .= Html::hidden( 'target', SpecialPage::getTitleFor( 'Log' ) ) . "\n";
+ $s .= Html::hidden( 'type', 'logging' ) . "\n";
+ $button = Html::element( 'button',
+ array( 'type' => 'submit', 'class' => "deleterevision-log-submit mw-log-deleterevision-button" ),
+ $this->msg( 'showhideselectedversions' )->text()
+ ) . "\n";
+ $s .= $button . $formcontents . $button;
+ $s .= Html::closeElement( 'form' );
+
+ return $s;
+ }
+
+
/**
* Set page title and show header for this log type
* @param $type string