$sizetype = $request->getVal( 'size-mode' );
$size = $request->getIntOrNull( 'size' );
$ns = $request->getIntOrNull( 'namespace' );
- $indefOnly = $request->getBool( 'indefonly' ) ? 1 : 0;
- $cascadeOnly = $request->getBool( 'cascadeonly' ) ? 1 : 0;
- $noRedirect = $request->getBool( 'noredirect' ) ? 1 : 0;
+
+ $filters = $request->getArray( 'wpfilters' );
+ $filters = is_null( $filters ) ? [] : $filters;
+ $indefOnly = in_array( 'indefonly', $filters );
+ $cascadeOnly = in_array( 'cascadeonly', $filters );
+ $noRedirect = in_array( 'noredirect', $filters );
$pager = new ProtectedPagesPager(
$this,
$level,
$sizetype,
$size,
- $indefOnly,
- $cascadeOnly,
- $noRedirect
+ $filters
) );
if ( $pager->getNumRows() ) {
* @param string $level Restriction level
* @param string $sizetype "min" or "max"
* @param int $size
- * @param bool $indefOnly Only indefinite protection
- * @param bool $cascadeOnly Only cascading protection
- * @param bool $noRedirect Don't show redirects
+ * @param array $filters Filters set for the pager: indefOnly,
+ * cascadeOnly, noRedirect
* @return string Input form
*/
protected function showOptions( $namespace, $type = 'edit', $level, $sizetype,
- $size, $indefOnly, $cascadeOnly, $noRedirect
+ $size, $filters
) {
$formDescriptor = [
'namespace' => [
],
'typemenu' => $this->getTypeMenu( $type ),
'levelmenu' => $this->getLevelMenu( $level ),
- 'expirycheck' => [
- 'type' => 'check',
- 'label' => $this->msg( 'protectedpages-indef' )->text(),
- 'name' => 'indefonly',
- 'id' => 'indefonly',
- ],
- 'cascadecheck' => [
- 'type' => 'check',
- 'label' => $this->msg( 'protectedpages-cascade' )->text(),
- 'name' => 'cascadeonly',
- 'id' => 'cascadeonly',
- ],
- 'redirectcheck' => [
- 'type' => 'check',
- 'label' => $this->msg( 'protectedpages-noredirect' )->text(),
- 'name' => 'noredirect',
- 'id' => 'noredirect',
+ 'filters' => [
+ 'class' => 'HTMLMultiSelectField',
+ 'label' => $this->msg( 'protectedpages-filters' )->text(),
+ 'flatlist' => true,
+ 'options' => [
+ $this->msg( 'protectedpages-indef' )->text() => 'indefonly',
+ $this->msg( 'protectedpages-cascade' )->text() => 'cascadeonly',
+ $this->msg( 'protectedpages-noredirect' )->text() => 'noredirect',
+ ],
+ 'default' => $filters,
],
'sizelimit' => [
'class' => HTMLSizeFilterField::class,
"deadendpages-summary": "",
"deadendpagestext": "The following pages do not link to other pages in {{SITENAME}}.",
"protectedpages": "Protected pages",
+ "protectedpages-filters": "Filters:",
"protectedpages-indef": "Indefinite protections only",
"protectedpages-summary": "This page lists existing pages that are currently protected. For a list of titles that are protected from creation, see [[{{#special:ProtectedTitles}}|{{int:protectedtitles}}]].",
"protectedpages-cascade": "Cascading protections only",
"deadendpages-summary": "{{notranslate}}\nThe summary displayed at the top of [[Special:Deadendpages]]. [[mw:Manual:Interface/Special pages summary|mw manual]].",
"deadendpagestext": "Introductory text for [[Special:DeadendPages]]",
"protectedpages": "{{doc-special|ProtectedPages}}",
+ "protectedpages-filters": "Title in [[Special:ProtectedPages]]",
"protectedpages-indef": "Option in [[Special:ProtectedPages]]",
"protectedpages-summary": "Summary of [[Special:ProtectedPages]].\n\nSee also:\n* {{msg-mw|Protectedtitles-summary}}",
"protectedpages-cascade": "Option in [[Special:ProtectedPages]]",