63 parent::__construct(
'PagesWithProp' );
74 $this->
getOutput()->addModuleStyles(
'mediawiki.special' );
77 $propname = $request->getVal(
'propname', $par );
78 $this->ns = $request->getIntOrNull(
'namespace' );
79 $this->reverse = $request->getBool(
'reverse' );
80 $this->sortByValue = $request->getBool(
'sortbyvalue' );
88 'options' => $propnames,
89 'default' => $propname,
90 'label-message' =>
'pageswithprop-prop',
94 'type' =>
'namespaceselect',
95 'name' =>
'namespace',
96 'label-message' =>
'namespace',
104 'label-message' =>
'pageswithprop-reverse',
109 'name' =>
'sortbyvalue',
111 'label-message' =>
'pageswithprop-sortbyvalue',
118 $form = HTMLForm::factory(
'ooui', $fields, $context )
120 ->setSubmitCallback( [ $this,
'onSubmit' ] )
121 ->setWrapperLegendMsg(
'pageswithprop-legend' )
122 ->addHeaderText( $this->
msg(
'pageswithprop-text' )->parseAsBlock() )
123 ->setSubmitTextMsg(
'pageswithprop-submit' )
125 $form->displayForm(
false );
126 if ( $propname !==
'' && $propname !==
null ) {
132 $this->propName = $data[
'propname'];
133 parent::execute( $data[
'propname'] );
166 if ( $this->ns !==
null ) {
174 'tables' => [
'page_props',
'page' ],
176 'page_id' =>
'pp_page',
188 'page' => [
'JOIN',
'page_id = pp_page' ]
193 if ( $this->ns !==
null ) {
194 $query[
'conds'][
'page_namespace'] =
$this->ns;
201 $sort = [
'page_id' ];
202 if ( $this->sortByValue ) {
203 array_unshift( $sort,
'pp_sortkey' );
221 $title = Title::newFromRow( $result );
223 if ( $result->pp_value !==
'' ) {
225 $valueLength = strlen( $result->pp_value );
226 $isBinary = strpos( $result->pp_value,
"\0" ) !==
false;
227 $isTooLong = $valueLength > 1024;
229 if ( $isBinary || $isTooLong ) {
231 ->msg( $isBinary ?
'pageswithprop-prophidden-binary' :
'pageswithprop-prophidden-long' )
232 ->params( $this->
getLanguage()->formatSize( $valueLength ) );
234 $propValue = Html::element(
'span', [
'class' =>
'prop-value-hidden' ], $message->text() );
236 $propValue = Html::element(
'span', [
'class' =>
'prop-value' ], $result->pp_value );
239 $ret .= $this->
msg(
'colon-separator' )->escaped() . $propValue;
246 if ( $this->existingPropNames ===
null ) {
254 'DISTINCT',
'ORDER BY' =>
'pp_propname'
273 foreach (
$res as $row ) {
274 $propnames[$row->pp_propname] = $row->pp_propname;
An IContextSource implementation which will inherit context from another source but allow individual ...
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
setDBLoadBalancer(ILoadBalancer $loadBalancer)
int $offset
The offset and limit in use, as passed to the query() function.
ILoadBalancer null $loadBalancer
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.
getPageTitle( $subpage=false)
Get a self-referential title object.
getLanguage()
Shortcut to get user's language.
Special:PagesWithProp to search the page_props table.
execute( $par)
This is the actual workhorse.
linkParameters()
If using extra form wheely-dealies, return a set of parameters here as an associative array....
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.
__construct(ILoadBalancer $loadBalancer)
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...
formatResult( $skin, $result)