Merge "Add namespace filter to Special:PagesWithProp"
This commit is contained in:
commit
7e49f068f0
1 changed files with 20 additions and 1 deletions
|
|
@ -39,6 +39,11 @@ class SpecialPagesWithProp extends QueryPage {
|
|||
*/
|
||||
private $existingPropNames = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private $ns;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
|
|
@ -78,6 +83,13 @@ class SpecialPagesWithProp extends QueryPage {
|
|||
'label-message' => 'pageswithprop-prop',
|
||||
'required' => true,
|
||||
],
|
||||
'namespace' => [
|
||||
'type' => 'namespaceselect',
|
||||
'name' => 'namespace',
|
||||
'label-message' => 'namespace',
|
||||
'all' => null,
|
||||
'default' => null,
|
||||
],
|
||||
'reverse' => [
|
||||
'type' => 'check',
|
||||
'name' => 'reverse',
|
||||
|
|
@ -108,6 +120,7 @@ class SpecialPagesWithProp extends QueryPage {
|
|||
|
||||
public function onSubmit( $data, $form ) {
|
||||
$this->propName = $data['propname'];
|
||||
$this->ns = $data['namespace'];
|
||||
parent::execute( $data['propname'] );
|
||||
}
|
||||
|
||||
|
|
@ -134,7 +147,7 @@ class SpecialPagesWithProp extends QueryPage {
|
|||
}
|
||||
|
||||
public function getQueryInfo() {
|
||||
return [
|
||||
$query = [
|
||||
'tables' => [ 'page_props', 'page' ],
|
||||
'fields' => [
|
||||
'page_id' => 'pp_page',
|
||||
|
|
@ -153,6 +166,12 @@ class SpecialPagesWithProp extends QueryPage {
|
|||
],
|
||||
'options' => []
|
||||
];
|
||||
|
||||
if ( $this->ns && isset( $this->ns ) ) {
|
||||
$query['conds']['page_namespace'] = $this->ns;
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
function getOrderFields() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue