58 parent::__construct( $name );
68 $this->
getOutput()->addModuleStyles(
'mediawiki.special' );
71 $propname = $request->getVal(
'propname', $par );
72 $this->ns = $request->getIntOrNull(
'namespace' );
73 $this->reverse = $request->getBool(
'reverse' );
74 $this->sortByValue = $request->getBool(
'sortbyvalue' );
78 $form = HTMLForm::factory(
'ooui', [
82 'options' => $propnames,
83 'default' => $propname,
84 'label-message' =>
'pageswithprop-prop',
88 'type' =>
'namespaceselect',
89 'name' =>
'namespace',
90 'label-message' =>
'namespace',
92 'default' => $this->ns,
97 'default' => $this->reverse,
98 'label-message' =>
'pageswithprop-reverse',
103 'name' =>
'sortbyvalue',
104 'default' => $this->sortByValue,
105 'label-message' =>
'pageswithprop-sortbyvalue',
109 $form->setMethod(
'get' );
110 $form->setSubmitCallback( [ $this,
'onSubmit' ] );
111 $form->setWrapperLegendMsg(
'pageswithprop-legend' );
112 $form->addHeaderText( $this->
msg(
'pageswithprop-text' )->parseAsBlock() );
113 $form->setSubmitTextMsg(
'pageswithprop-submit' );
115 $form->prepareForm();
116 $form->displayForm(
false );
117 if ( $propname !==
'' && $propname !==
null ) {
123 $this->propName = $data[
'propname'];
124 parent::execute( $data[
'propname'] );
151 'tables' => [
'page_props',
'page' ],
153 'page_id' =>
'pp_page',
165 'page' => [
'JOIN',
'page_id = pp_page' ]
170 if ( $this->ns !==
null ) {
171 $query[
'conds'][
'page_namespace'] =
$this->ns;
178 $sort = [
'page_id' ];
179 if ( $this->sortByValue ) {
180 array_unshift(
$sort,
'pp_sortkey' );
198 $title = Title::newFromRow( $result );
200 if ( $result->pp_value !==
'' ) {
202 $valueLength = strlen( $result->pp_value );
203 $isBinary = strpos( $result->pp_value,
"\0" ) !==
false;
204 $isTooLong = $valueLength > 1024;
206 if ( $isBinary || $isTooLong ) {
208 ->msg( $isBinary ?
'pageswithprop-prophidden-binary' :
'pageswithprop-prophidden-long' )
209 ->params( $this->
getLanguage()->formatSize( $valueLength ) );
211 $propValue = Html::element(
'span', [
'class' =>
'prop-value-hidden' ], $message->text() );
213 $propValue = Html::element(
'span', [
'class' =>
'prop-value' ], $result->pp_value );
216 $ret .= $this->
msg(
'colon-separator' )->escaped() . $propValue;
223 if ( $this->existingPropNames ===
null ) {
231 'DISTINCT',
'ORDER BY' =>
'pp_propname'
249 foreach (
$res as $row ) {
250 $propnames[$row->pp_propname] = $row->pp_propname;
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
int $offset
The offset and limit in use, as passed to the query() function.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
static prefixSearchArray( $search, $limit, array $subpages, $offset)
Helper function for implementations of prefixSearchSubpages() that filter the values in memory (as op...
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getRequest()
Get the WebRequest being used for this instance.
getLanguage()
Shortcut to get user's language.
Special:PagesWithProp to search the page_props table.
execute( $par)
This is the actual workhorse.
queryExistingProps( $limit=null, $offset=0)
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
isSyndicated()
Disable RSS/Atom feeds.
isCacheable()
Is the output of this query cacheable? Non-cacheable expensive pages will be disabled in miser mode a...
string[] null $existingPropNames
getOrderFields()
Subclasses return an array of fields to order by here.
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
__construct( $name='PagesWithProp')
formatResult( $skin, $result)