$loglist = new LogEventsList(
$this->getContext(),
null,
- LogEventsList::USE_REVDEL_CHECKBOXES
+ LogEventsList::USE_CHECKBOXES
);
$pager = new LogPager(
$loglist,
private function getActionButtons( $formcontents ) {
$user = $this->getUser();
$canRevDelete = $user->isAllowedAll( 'deletedhistory', 'deletelogentry' );
- $canModifyTags = $user->isAllowed( 'changetags' );
+ $showTagEditUI = ChangeTags::showTagEditingUI( $user );
# If the user doesn't have the ability to delete log entries nor edit tags,
# don't bother showing them the button(s).
- if ( !$canRevDelete && !$canModifyTags ) {
+ if ( !$canRevDelete && !$showTagEditUI ) {
return $formcontents;
}
$this->msg( 'showhideselectedlogentries' )->text()
) . "\n";
}
- if ( $canModifyTags ) {
+ if ( $showTagEditUI ) {
$buttons .= Html::element(
'button',
array(
$this->msg( 'log-edit-tags' )->text()
) . "\n";
}
+
+ // Select: All, None, Invert
+ $links = array();
+ $links[] = Html::element(
+ 'a', array( 'href' => '#', 'id' => 'checkbox-all' ),
+ $this->msg( 'checkbox-all' )->text()
+ );
+ $links[] = Html::element(
+ 'a', array( 'href' => '#', 'id' => 'checkbox-none' ),
+ $this->msg( 'checkbox-none' )->text()
+ );
+ $links[] = Html::element(
+ 'a', array( 'href' => '#', 'id' => 'checkbox-invert' ),
+ $this->msg( 'checkbox-invert' )->text()
+ );
+
+ $buttons .= Html::rawElement( 'p',
+ array(
+ 'class' => "mw-checkbox-toggle-controls"
+ ),
+ $this->msg( 'checkbox-select' )
+ ->rawParams( $this->getLanguage()->commaList( $links ) )->escaped()
+ );
+
+ $this->getOutput()->addModules( 'mediawiki.checkboxtoggle' );
+ $this->getOutput()->addModuleStyles( 'mediawiki.checkboxtoggle.styles' );
+
$s .= $buttons . $formcontents . $buttons;
$s .= Html::closeElement( 'form' );