Go to the documentation of this file.
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' );
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' );
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;
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
queryExistingProps( $limit=null, $offset=0)
getOutput()
Get the OutputPage being used for this instance.
Special:PagesWithProp to search the page_props table.
__construct( $name='PagesWithProp')
getLanguage()
Shortcut to get user's language.
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.
execute( $par)
This is the actual workhorse.
isSyndicated()
Disable RSS/Atom feeds.
static newFromRow( $row)
Make a Title object from a DB row.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
string[] null $existingPropNames
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getContext()
Gets the context this SpecialPage is executed in.
static prefixSearchArray( $search, $limit, array $subpages, $offset)
Helper function for implementations of prefixSearchSubpages() that filter the values in memory (as op...
getRequest()
Get the WebRequest being used for this instance.
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
formatResult( $skin, $result)
isCacheable()
Is the output of this query cacheable? Non-cacheable expensive pages will be disabled in miser mode a...
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getOrderFields()
Subclasses return an array of fields to order by here.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...