MediaWiki  1.23.2
SpecialNewpages.php
Go to the documentation of this file.
1 <?php
30  // Stored objects
31 
35  protected $opts;
36  protected $customFilters;
37 
38  // Some internal settings
39  protected $showNavigation = false;
40 
41  public function __construct() {
42  parent::__construct( 'Newpages' );
43  }
44 
45  protected function setup( $par ) {
46  global $wgEnableNewpagesUserFilter;
47 
48  // Options
49  $opts = new FormOptions();
50  $this->opts = $opts; // bind
51  $opts->add( 'hideliu', false );
52  $opts->add( 'hidepatrolled', $this->getUser()->getBoolOption( 'newpageshidepatrolled' ) );
53  $opts->add( 'hidebots', false );
54  $opts->add( 'hideredirs', true );
55  $opts->add( 'limit', $this->getUser()->getIntOption( 'rclimit' ) );
56  $opts->add( 'offset', '' );
57  $opts->add( 'namespace', '0' );
58  $opts->add( 'username', '' );
59  $opts->add( 'feed', '' );
60  $opts->add( 'tagfilter', '' );
61  $opts->add( 'invert', false );
62 
63  $this->customFilters = array();
64  wfRunHooks( 'SpecialNewPagesFilters', array( $this, &$this->customFilters ) );
65  foreach ( $this->customFilters as $key => $params ) {
66  $opts->add( $key, $params['default'] );
67  }
68 
69  // Set values
71  if ( $par ) {
72  $this->parseParams( $par );
73  }
74 
75  // Validate
76  $opts->validateIntBounds( 'limit', 0, 5000 );
77  if ( !$wgEnableNewpagesUserFilter ) {
78  $opts->setValue( 'username', '' );
79  }
80  }
81 
82  protected function parseParams( $par ) {
83  $bits = preg_split( '/\s*,\s*/', trim( $par ) );
84  foreach ( $bits as $bit ) {
85  if ( 'shownav' == $bit ) {
86  $this->showNavigation = true;
87  }
88  if ( 'hideliu' === $bit ) {
89  $this->opts->setValue( 'hideliu', true );
90  }
91  if ( 'hidepatrolled' == $bit ) {
92  $this->opts->setValue( 'hidepatrolled', true );
93  }
94  if ( 'hidebots' == $bit ) {
95  $this->opts->setValue( 'hidebots', true );
96  }
97  if ( 'showredirs' == $bit ) {
98  $this->opts->setValue( 'hideredirs', false );
99  }
100  if ( is_numeric( $bit ) ) {
101  $this->opts->setValue( 'limit', intval( $bit ) );
102  }
103 
104  $m = array();
105  if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) {
106  $this->opts->setValue( 'limit', intval( $m[1] ) );
107  }
108  // PG offsets not just digits!
109  if ( preg_match( '/^offset=([^=]+)$/', $bit, $m ) ) {
110  $this->opts->setValue( 'offset', intval( $m[1] ) );
111  }
112  if ( preg_match( '/^username=(.*)$/', $bit, $m ) ) {
113  $this->opts->setValue( 'username', $m[1] );
114  }
115  if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) {
116  $ns = $this->getLanguage()->getNsIndex( $m[1] );
117  if ( $ns !== false ) {
118  $this->opts->setValue( 'namespace', $ns );
119  }
120  }
121  }
122  }
123 
130  public function execute( $par ) {
131  $out = $this->getOutput();
132 
133  $this->setHeaders();
134  $this->outputHeader();
135 
136  $this->showNavigation = !$this->including(); // Maybe changed in setup
137  $this->setup( $par );
138 
139  if ( !$this->including() ) {
140  // Settings
141  $this->form();
142 
143  $feedType = $this->opts->getValue( 'feed' );
144  if ( $feedType ) {
145  $this->feed( $feedType );
146 
147  return;
148  }
149 
150  $allValues = $this->opts->getAllValues();
151  unset( $allValues['feed'] );
152  $out->setFeedAppendQuery( wfArrayToCgi( $allValues ) );
153  }
154 
155  $pager = new NewPagesPager( $this, $this->opts );
156  $pager->mLimit = $this->opts->getValue( 'limit' );
157  $pager->mOffset = $this->opts->getValue( 'offset' );
158 
159  if ( $pager->getNumRows() ) {
160  $navigation = '';
161  if ( $this->showNavigation ) {
162  $navigation = $pager->getNavigationBar();
163  }
164  $out->addHTML( $navigation . $pager->getBody() . $navigation );
165  } else {
166  $out->addWikiMsg( 'specialpage-empty' );
167  }
168  }
169 
170  protected function filterLinks() {
171  // show/hide links
172  $showhide = array( $this->msg( 'show' )->escaped(), $this->msg( 'hide' )->escaped() );
173 
174  // Option value -> message mapping
175  $filters = array(
176  'hideliu' => 'rcshowhideliu',
177  'hidepatrolled' => 'rcshowhidepatr',
178  'hidebots' => 'rcshowhidebots',
179  'hideredirs' => 'whatlinkshere-hideredirs'
180  );
181  foreach ( $this->customFilters as $key => $params ) {
182  $filters[$key] = $params['msg'];
183  }
184 
185  // Disable some if needed
186  if ( !User::groupHasPermission( '*', 'createpage' ) ) {
187  unset( $filters['hideliu'] );
188  }
189  if ( !$this->getUser()->useNPPatrol() ) {
190  unset( $filters['hidepatrolled'] );
191  }
192 
193  $links = array();
194  $changed = $this->opts->getChangedValues();
195  unset( $changed['offset'] ); // Reset offset if query type changes
196 
197  $self = $this->getPageTitle();
198  foreach ( $filters as $key => $msg ) {
199  $onoff = 1 - $this->opts->getValue( $key );
200  $link = Linker::link( $self, $showhide[$onoff], array(),
201  array( $key => $onoff ) + $changed
202  );
203  $links[$key] = $this->msg( $msg )->rawParams( $link )->escaped();
204  }
205 
206  return $this->getLanguage()->pipeList( $links );
207  }
208 
209  protected function form() {
210  global $wgEnableNewpagesUserFilter, $wgScript;
211 
212  // Consume values
213  $this->opts->consumeValue( 'offset' ); // don't carry offset, DWIW
214  $namespace = $this->opts->consumeValue( 'namespace' );
215  $username = $this->opts->consumeValue( 'username' );
216  $tagFilterVal = $this->opts->consumeValue( 'tagfilter' );
217  $nsinvert = $this->opts->consumeValue( 'invert' );
218 
219  // Check username input validity
220  $ut = Title::makeTitleSafe( NS_USER, $username );
221  $userText = $ut ? $ut->getText() : '';
222 
223  // Store query values in hidden fields so that form submission doesn't lose them
224  $hidden = array();
225  foreach ( $this->opts->getUnconsumedValues() as $key => $value ) {
226  $hidden[] = Html::hidden( $key, $value );
227  }
228  $hidden = implode( "\n", $hidden );
229 
230  $tagFilter = ChangeTags::buildTagFilterSelector( $tagFilterVal );
231  if ( $tagFilter ) {
232  list( $tagFilterLabel, $tagFilterSelector ) = $tagFilter;
233  }
234 
235  $form = Xml::openElement( 'form', array( 'action' => $wgScript ) ) .
236  Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) .
237  Xml::fieldset( $this->msg( 'newpages' )->text() ) .
238  Xml::openElement( 'table', array( 'id' => 'mw-newpages-table' ) ) .
239  '<tr>
240  <td class="mw-label">' .
241  Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) .
242  '</td>
243  <td class="mw-input">' .
245  array(
246  'selected' => $namespace,
247  'all' => 'all',
248  ), array(
249  'name' => 'namespace',
250  'id' => 'namespace',
251  'class' => 'namespaceselector',
252  )
253  ) . '&#160;' .
255  $this->msg( 'invert' )->text(),
256  'invert',
257  'nsinvert',
258  $nsinvert,
259  array( 'title' => $this->msg( 'tooltip-invert' )->text() )
260  ) .
261  '</td>
262  </tr>' . ( $tagFilter ? (
263  '<tr>
264  <td class="mw-label">' .
265  $tagFilterLabel .
266  '</td>
267  <td class="mw-input">' .
268  $tagFilterSelector .
269  '</td>
270  </tr>' ) : '' ) .
271  ( $wgEnableNewpagesUserFilter ?
272  '<tr>
273  <td class="mw-label">' .
274  Xml::label( $this->msg( 'newpages-username' )->text(), 'mw-np-username' ) .
275  '</td>
276  <td class="mw-input">' .
277  Xml::input( 'username', 30, $userText, array( 'id' => 'mw-np-username' ) ) .
278  '</td>
279  </tr>' : '' ) .
280  '<tr> <td></td>
281  <td class="mw-submit">' .
282  Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) .
283  '</td>
284  </tr>' .
285  '<tr>
286  <td></td>
287  <td class="mw-input">' .
288  $this->filterLinks() .
289  '</td>
290  </tr>' .
291  Xml::closeElement( 'table' ) .
292  Xml::closeElement( 'fieldset' ) .
293  $hidden .
294  Xml::closeElement( 'form' );
295 
296  $this->getOutput()->addHTML( $form );
297  }
298 
306  public function formatRow( $result ) {
308 
309  # Revision deletion works on revisions, so we should cast one
310  $row = array(
311  'comment' => $result->rc_comment,
312  'deleted' => $result->rc_deleted,
313  'user_text' => $result->rc_user_text,
314  'user' => $result->rc_user,
315  );
316  $rev = new Revision( $row );
317  $rev->setTitle( $title );
318 
319  $classes = array();
320 
321  $lang = $this->getLanguage();
322  $dm = $lang->getDirMark();
323 
324  $spanTime = Html::element( 'span', array( 'class' => 'mw-newpages-time' ),
325  $lang->userTimeAndDate( $result->rc_timestamp, $this->getUser() )
326  );
328  $title,
329  $spanTime,
330  array(),
331  array( 'oldid' => $result->rc_this_oldid ),
332  array()
333  );
334 
335  $query = array( 'redirect' => 'no' );
336 
337  // Linker::linkKnown() uses 'known' and 'noclasses' options.
338  // This breaks the colouration for stubs.
339  $plink = Linker::link(
340  $title,
341  null,
342  array( 'class' => 'mw-newpages-pagename' ),
343  $query,
344  array( 'known' )
345  );
346  $histLink = Linker::linkKnown(
347  $title,
348  $this->msg( 'hist' )->escaped(),
349  array(),
350  array( 'action' => 'history' )
351  );
352  $hist = Html::rawElement( 'span', array( 'class' => 'mw-newpages-history' ),
353  $this->msg( 'parentheses' )->rawParams( $histLink )->escaped() );
354 
355  $length = Html::element(
356  'span',
357  array( 'class' => 'mw-newpages-length' ),
358  $this->msg( 'brackets' )->params( $this->msg( 'nbytes' )
359  ->numParams( $result->length )->text()
360  )
361  );
362 
363  $ulink = Linker::revUserTools( $rev );
365 
366  if ( $this->patrollable( $result ) ) {
367  $classes[] = 'not-patrolled';
368  }
369 
370  # Add a class for zero byte pages
371  if ( $result->length == 0 ) {
372  $classes[] = 'mw-newpages-zero-byte-page';
373  }
374 
375  # Tags, if any.
376  if ( isset( $result->ts_tags ) ) {
377  list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow(
378  $result->ts_tags,
379  'newpages'
380  );
381  $classes = array_merge( $classes, $newClasses );
382  } else {
383  $tagDisplay = '';
384  }
385 
386  $css = count( $classes ) ? ' class="' . implode( ' ', $classes ) . '"' : '';
387 
388  # Display the old title if the namespace/title has been changed
389  $oldTitleText = '';
390  $oldTitle = Title::makeTitle( $result->rc_namespace, $result->rc_title );
391 
392  if ( !$title->equals( $oldTitle ) ) {
393  $oldTitleText = $oldTitle->getPrefixedText();
394  $oldTitleText = $this->msg( 'rc-old-title' )->params( $oldTitleText )->escaped();
395  }
396 
397  return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay} {$oldTitleText}</li>\n";
398  }
399 
406  protected function patrollable( $result ) {
407  return ( $this->getUser()->useNPPatrol() && !$result->rc_patrolled );
408  }
409 
415  protected function feed( $type ) {
416  global $wgFeed, $wgFeedClasses, $wgFeedLimit;
417 
418  if ( !$wgFeed ) {
419  $this->getOutput()->addWikiMsg( 'feed-unavailable' );
420 
421  return;
422  }
423 
424  if ( !isset( $wgFeedClasses[$type] ) ) {
425  $this->getOutput()->addWikiMsg( 'feed-invalid' );
426 
427  return;
428  }
429 
430  $feed = new $wgFeedClasses[$type](
431  $this->feedTitle(),
432  $this->msg( 'tagline' )->text(),
433  $this->getPageTitle()->getFullURL()
434  );
435 
436  $pager = new NewPagesPager( $this, $this->opts );
437  $limit = $this->opts->getValue( 'limit' );
438  $pager->mLimit = min( $limit, $wgFeedLimit );
439 
440  $feed->outHeader();
441  if ( $pager->getNumRows() > 0 ) {
442  foreach ( $pager->mResult as $row ) {
443  $feed->outItem( $this->feedItem( $row ) );
444  }
445  }
446  $feed->outFooter();
447  }
448 
449  protected function feedTitle() {
450  global $wgLanguageCode, $wgSitename;
451  $desc = $this->getDescription();
452 
453  return "$wgSitename - $desc [$wgLanguageCode]";
454  }
455 
456  protected function feedItem( $row ) {
457  $title = Title::makeTitle( intval( $row->rc_namespace ), $row->rc_title );
458  if ( $title ) {
459  $date = $row->rc_timestamp;
460  $comments = $title->getTalkPage()->getFullURL();
461 
462  return new FeedItem(
463  $title->getPrefixedText(),
464  $this->feedItemDesc( $row ),
465  $title->getFullURL(),
466  $date,
467  $this->feedItemAuthor( $row ),
468  $comments
469  );
470  } else {
471  return null;
472  }
473  }
474 
475  protected function feedItemAuthor( $row ) {
476  return isset( $row->rc_user_text ) ? $row->rc_user_text : '';
477  }
478 
479  protected function feedItemDesc( $row ) {
480  $revision = Revision::newFromId( $row->rev_id );
481  if ( $revision ) {
482  //XXX: include content model/type in feed item?
483  return '<p>' . htmlspecialchars( $revision->getUserText() ) .
484  $this->msg( 'colon-separator' )->inContentLanguage()->escaped() .
485  htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
486  "</p>\n<hr />\n<div>" .
487  nl2br( htmlspecialchars( $revision->getContent()->serialize() ) ) . "</div>";
488  }
489 
490  return '';
491  }
492 
493  protected function getGroupName() {
494  return 'changes';
495  }
496 }
497 
502  // Stored opts
503  protected $opts;
504 
508  protected $mForm;
509 
510  function __construct( $form, FormOptions $opts ) {
511  parent::__construct( $form->getContext() );
512  $this->mForm = $form;
513  $this->opts = $opts;
514  }
515 
516  function getQueryInfo() {
517  global $wgEnableNewpagesUserFilter;
518  $conds = array();
519  $conds['rc_new'] = 1;
520 
521  $namespace = $this->opts->getValue( 'namespace' );
522  $namespace = ( $namespace === 'all' ) ? false : intval( $namespace );
523 
524  $username = $this->opts->getValue( 'username' );
525  $user = Title::makeTitleSafe( NS_USER, $username );
526 
527  $rcIndexes = array();
528 
529  if ( $namespace !== false ) {
530  if ( $this->opts->getValue( 'invert' ) ) {
531  $conds[] = 'rc_namespace != ' . $this->mDb->addQuotes( $namespace );
532  } else {
533  $conds['rc_namespace'] = $namespace;
534  }
535  }
536 
537  # $wgEnableNewpagesUserFilter - temp WMF hack
538  if ( $wgEnableNewpagesUserFilter && $user ) {
539  $conds['rc_user_text'] = $user->getText();
540  $rcIndexes = 'rc_user_text';
541  } elseif ( User::groupHasPermission( '*', 'createpage' ) &&
542  $this->opts->getValue( 'hideliu' )
543  ) {
544  # If anons cannot make new pages, don't "exclude logged in users"!
545  $conds['rc_user'] = 0;
546  }
547 
548  # If this user cannot see patrolled edits or they are off, don't do dumb queries!
549  if ( $this->opts->getValue( 'hidepatrolled' ) && $this->getUser()->useNPPatrol() ) {
550  $conds['rc_patrolled'] = 0;
551  }
552 
553  if ( $this->opts->getValue( 'hidebots' ) ) {
554  $conds['rc_bot'] = 0;
555  }
556 
557  if ( $this->opts->getValue( 'hideredirs' ) ) {
558  $conds['page_is_redirect'] = 0;
559  }
560 
561  // Allow changes to the New Pages query
562  $tables = array( 'recentchanges', 'page' );
563  $fields = array(
564  'rc_namespace', 'rc_title', 'rc_cur_id', 'rc_user', 'rc_user_text',
565  'rc_comment', 'rc_timestamp', 'rc_patrolled', 'rc_id', 'rc_deleted',
566  'length' => 'page_len', 'rev_id' => 'page_latest', 'rc_this_oldid',
567  'page_namespace', 'page_title'
568  );
569  $join_conds = array( 'page' => array( 'INNER JOIN', 'page_id=rc_cur_id' ) );
570 
571  wfRunHooks( 'SpecialNewpagesConditions',
572  array( &$this, $this->opts, &$conds, &$tables, &$fields, &$join_conds ) );
573 
574  $options = array();
575 
576  if ( $rcIndexes ) {
577  $options = array( 'USE INDEX' => array( 'recentchanges' => $rcIndexes ) );
578  }
579 
580  $info = array(
581  'tables' => $tables,
582  'fields' => $fields,
583  'conds' => $conds,
584  'options' => $options,
585  'join_conds' => $join_conds
586  );
587 
588  // Modify query for tags
590  $info['tables'],
591  $info['fields'],
592  $info['conds'],
593  $info['join_conds'],
594  $info['options'],
595  $this->opts['tagfilter']
596  );
597 
598  return $info;
599  }
600 
601  function getIndexField() {
602  return 'rc_timestamp';
603  }
604 
605  function formatRow( $row ) {
606  return $this->mForm->formatRow( $row );
607  }
608 
609  function getStartBody() {
610  # Do a batch existence check on pages
611  $linkBatch = new LinkBatch();
612  foreach ( $this->mResult as $row ) {
613  $linkBatch->add( NS_USER, $row->rc_user_text );
614  $linkBatch->add( NS_USER_TALK, $row->rc_user_text );
615  $linkBatch->add( $row->rc_namespace, $row->rc_title );
616  }
617  $linkBatch->execute();
618 
619  return '<ul>';
620  }
621 
622  function getEndBody() {
623  return '</ul>';
624  }
625 }
Xml\checkLabel
static checkLabel( $label, $name, $id, $checked=false, $attribs=array())
Convenience function to build an HTML checkbox with a label.
Definition: Xml.php:433
SpecialPage\getPageTitle
getPageTitle( $subpage=false)
Get a self-referential title object.
Definition: SpecialPage.php:488
Title\makeTitle
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:398
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1528
NewPagesPager\getIndexField
getIndexField()
This function should be overridden to return the name of the index fi- eld.
Definition: SpecialNewpages.php:599
$time
see documentation in includes Linker php for Linker::makeImageLink & $time
Definition: hooks.txt:1358
FeedItem
A base class for basic support for outputting syndication feeds in RSS and other formats.
Definition: Feed.php:38
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
Revision\newFromId
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
Definition: Revision.php:88
LinkBatch
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition: LinkBatch.php:30
$tables
namespace and then decline to actually register it RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist & $tables
Definition: hooks.txt:815
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:535
SpecialNewpages\__construct
__construct()
Definition: SpecialNewpages.php:40
text
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
Definition: design.txt:12
$form
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead $form
Definition: hooks.txt:2573
NewPagesPager\getStartBody
getStartBody()
Hook into getBody(), allows text to be inserted at the start.
Definition: SpecialNewpages.php:607
SpecialNewpages\execute
execute( $par)
Show a form for filtering namespace and username.
Definition: SpecialNewpages.php:129
FeedItem\stripComment
static stripComment( $text)
Quickie hack...
Definition: Feed.php:175
$params
$params
Definition: styleTest.css.php:40
$limit
if( $sleep) $limit
Definition: importImages.php:99
ChangeTags\buildTagFilterSelector
static buildTagFilterSelector( $selected='', $fullForm=false, Title $title=null)
Build a text box to select a change tag.
Definition: ChangeTags.php:250
NewPagesPager\$opts
$opts
Definition: SpecialNewpages.php:502
IncludableSpecialPage
Shortcut to construct an includable special page.
Definition: IncludableSpecialPage.php:29
FormOptions\validateIntBounds
validateIntBounds( $name, $min, $max)
Definition: FormOptions.php:245
Html\hidden
static hidden( $name, $value, $attribs=array())
Convenience function to produce an input element with type=hidden.
Definition: Html.php:662
SpecialPage\getLanguage
getLanguage()
Shortcut to get user's language.
Definition: SpecialPage.php:578
NewPagesPager\getEndBody
getEndBody()
Hook into getBody() for the end of the list.
Definition: SpecialNewpages.php:620
User\groupHasPermission
static groupHasPermission( $group, $role)
Check, if the given group has the given permission.
Definition: User.php:4146
ContextSource\getUser
getUser()
Get the User object.
Definition: ContextSource.php:132
$link
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
Definition: hooks.txt:2149
SpecialNewpages\form
form()
Definition: SpecialNewpages.php:208
FormOptions\fetchValuesFromRequest
fetchValuesFromRequest(WebRequest $r, $optionKeys=null)
Fetch values for all options (or selected options) from the given WebRequest, making them available f...
Definition: FormOptions.php:336
SpecialNewpages\feed
feed( $type)
Output a subscription feed listing recent edits to this page.
Definition: SpecialNewpages.php:414
Xml\openElement
static openElement( $element, $attribs=null)
This opens an XML element.
Definition: Xml.php:109
SpecialNewpages\setup
setup( $par)
Definition: SpecialNewpages.php:44
Linker\linkKnown
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
Definition: Linker.php:264
Linker\link
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
Definition: Linker.php:192
Revision
Definition: Revision.php:26
FormOptions\add
add( $name, $default, $type=self::AUTO)
Add an option to be handled by this FormOptions instance.
Definition: FormOptions.php:78
SpecialPage\getDescription
getDescription()
Returns the name that goes in the <h1> in the special page itself, and also the name that will be lis...
Definition: SpecialPage.php:466
$out
$out
Definition: UtfNormalGenerate.php:167
SpecialNewpages\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialNewpages.php:492
SpecialNewpages\$opts
FormOptions $opts
Definition: SpecialNewpages.php:34
ChangeTags\modifyDisplayQuery
static modifyDisplayQuery(&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag=false)
Applies all tags-related changes to a query.
Definition: ChangeTags.php:202
$css
$css
Definition: styleTest.css.php:50
Html\element
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:148
Title\newFromRow
static newFromRow( $row)
Make a Title object from a DB row.
Definition: Title.php:345
NewPagesPager\getQueryInfo
getQueryInfo()
This function should be overridden to provide all parameters needed for the main paged query.
Definition: SpecialNewpages.php:514
Linker\revUserTools
static revUserTools( $rev, $isPublic=false)
Generate a user tool link cluster if the current user is allowed to view it.
Definition: Linker.php:1219
SpecialNewpages\feedItem
feedItem( $row)
Definition: SpecialNewpages.php:455
$oldTitle
versus $oldTitle
Definition: globals.txt:16
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4001
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
Definition: SpecialPage.php:352
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:545
SpecialNewpages\parseParams
parseParams( $par)
Definition: SpecialNewpages.php:81
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
$comment
$comment
Definition: importImages.php:107
list
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
FormOptions\setValue
setValue( $name, $value, $force=false)
Use to set the value of an option.
Definition: FormOptions.php:158
$options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
Definition: hooks.txt:1530
SpecialNewpages\feedTitle
feedTitle()
Definition: SpecialNewpages.php:448
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:422
Linker\revComment
static revComment(Revision $rev, $local=false, $isPublic=false)
Wrap and format the given revision's comment block, if the current user is allowed to view it.
Definition: Linker.php:1578
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
NS_USER_TALK
const NS_USER_TALK
Definition: Defines.php:82
$value
$value
Definition: styleTest.css.php:45
SpecialPage\msg
msg()
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:609
SpecialNewpages\$showNavigation
$showNavigation
Definition: SpecialNewpages.php:38
SpecialNewpages\$customFilters
$customFilters
Definition: SpecialNewpages.php:35
NewPagesPager\formatRow
formatRow( $row)
Abstract formatting function.
Definition: SpecialNewpages.php:603
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:525
SpecialNewpages\filterLinks
filterLinks()
Definition: SpecialNewpages.php:169
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237
NewPagesPager
Definition: SpecialNewpages.php:500
SpecialNewpages\formatRow
formatRow( $result)
Format a row, providing the timestamp, links to the page/history, size, user links,...
Definition: SpecialNewpages.php:305
NewPagesPager\$mForm
HtmlForm $mForm
Definition: SpecialNewpages.php:506
$self
$self
Definition: doMaintenance.php:54
$rev
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
Definition: hooks.txt:1337
Xml\closeElement
static closeElement( $element)
Shortcut to close an XML element.
Definition: Xml.php:118
SpecialNewpages
A special page that list newly created pages.
Definition: SpecialNewpages.php:29
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
Html\namespaceSelector
static namespaceSelector(array $params=array(), array $selectAttribs=array())
Build a drop-down box for selecting a namespace.
Definition: Html.php:707
NewPagesPager\__construct
__construct( $form, FormOptions $opts)
Definition: SpecialNewpages.php:508
NS_USER
const NS_USER
Definition: Defines.php:81
Xml\submitButton
static submitButton( $value, $attribs=array())
Convenience function to build an HTML submit button.
Definition: Xml.php:463
SpecialNewpages\feedItemAuthor
feedItemAuthor( $row)
Definition: SpecialNewpages.php:474
ReverseChronologicalPager
IndexPager with a formatted navigation bar.
Definition: Pager.php:829
FormOptions
Helper class to keep track of options when mixing links and form elements.
Definition: FormOptions.php:35
Xml\input
static input( $name, $size=false, $value=false, $attribs=array())
Convenience function to build an HTML text input field.
Definition: Xml.php:294
Html\rawElement
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
Definition: Html.php:124
Xml\label
static label( $label, $id, $attribs=array())
Convenience function to build an HTML form label.
Definition: Xml.php:374
$query
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition: hooks.txt:1105
SpecialPage\outputHeader
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Definition: SpecialPage.php:443
SpecialPage\including
including( $x=null)
Whether the special page is being evaluated via transclusion.
Definition: SpecialPage.php:207
SpecialNewpages\patrollable
patrollable( $result)
Should a specific result row provide "patrollable" links?
Definition: SpecialNewpages.php:405
Xml\fieldset
static fieldset( $legend=false, $content=false, $attribs=array())
Shortcut for creating fieldsets.
Definition: Xml.php:563
SpecialNewpages\feedItemDesc
feedItemDesc( $row)
Definition: SpecialNewpages.php:478
ChangeTags\formatSummaryRow
static formatSummaryRow( $tags, $page)
Creates HTML for the given tags.
Definition: ChangeTags.php:34
$changed
$changed
Definition: UtfNormalGenerate.php:130
wfArrayToCgi
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes two arrays as input, and returns a CGI-style string, e.g.
Definition: GlobalFunctions.php:367
$type
$type
Definition: testCompression.php:46