MediaWiki  master
SpecialNewpages.php
Go to the documentation of this file.
1 <?php
34 
44  protected $opts;
46  protected $customFilters;
47 
48  protected $showNavigation = false;
49 
52 
54  private $commentStore;
55 
58 
61 
63  private $loadBalancer;
64 
66  private $revisionLookup;
67 
69  private $namespaceInfo;
70 
72  private $actorMigration;
73 
76 
88  public function __construct(
98  ) {
99  parent::__construct( 'Newpages' );
100  $this->linkBatchFactory = $linkBatchFactory;
101  $this->commentStore = $commentStore;
102  $this->contentHandlerFactory = $contentHandlerFactory;
103  $this->permissionManager = $permissionManager;
104  $this->loadBalancer = $loadBalancer;
105  $this->revisionLookup = $revisionLookup;
106  $this->namespaceInfo = $namespaceInfo;
107  $this->actorMigration = $actorMigration;
108  $this->userOptionsLookup = $userOptionsLookup;
109  }
110 
114  protected function setup( $par ) {
115  $opts = new FormOptions();
116  $this->opts = $opts; // bind
117  $opts->add( 'hideliu', false );
118  $opts->add(
119  'hidepatrolled',
120  $this->userOptionsLookup->getBoolOption( $this->getUser(), 'newpageshidepatrolled' )
121  );
122  $opts->add( 'hidebots', false );
123  $opts->add( 'hideredirs', true );
124  $opts->add(
125  'limit',
126  $this->userOptionsLookup->getIntOption( $this->getUser(), 'rclimit' )
127  );
128  $opts->add( 'offset', '' );
129  $opts->add( 'namespace', '0' );
130  $opts->add( 'username', '' );
131  $opts->add( 'feed', '' );
132  $opts->add( 'tagfilter', '' );
133  $opts->add( 'invert', false );
134  $opts->add( 'associated', false );
135  $opts->add( 'size-mode', 'max' );
136  $opts->add( 'size', 0 );
137 
138  $this->customFilters = [];
139  $this->getHookRunner()->onSpecialNewPagesFilters( $this, $this->customFilters );
140  // @phan-suppress-next-line PhanEmptyForeach False positive
141  foreach ( $this->customFilters as $key => $params ) {
142  $opts->add( $key, $params['default'] );
143  }
144 
146  if ( $par ) {
147  $this->parseParams( $par );
148  }
149 
150  $opts->validateIntBounds( 'limit', 0, 5000 );
151  }
152 
156  protected function parseParams( $par ) {
157  $bits = preg_split( '/\s*,\s*/', trim( $par ) );
158  foreach ( $bits as $bit ) {
159  if ( $bit === 'shownav' ) {
160  $this->showNavigation = true;
161  }
162  if ( $bit === 'hideliu' ) {
163  $this->opts->setValue( 'hideliu', true );
164  }
165  if ( $bit === 'hidepatrolled' ) {
166  $this->opts->setValue( 'hidepatrolled', true );
167  }
168  if ( $bit === 'hidebots' ) {
169  $this->opts->setValue( 'hidebots', true );
170  }
171  if ( $bit === 'showredirs' ) {
172  $this->opts->setValue( 'hideredirs', false );
173  }
174  if ( is_numeric( $bit ) ) {
175  $this->opts->setValue( 'limit', intval( $bit ) );
176  }
177 
178  $m = [];
179  if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) {
180  $this->opts->setValue( 'limit', intval( $m[1] ) );
181  }
182  // PG offsets not just digits!
183  if ( preg_match( '/^offset=([^=]+)$/', $bit, $m ) ) {
184  $this->opts->setValue( 'offset', intval( $m[1] ) );
185  }
186  if ( preg_match( '/^username=(.*)$/', $bit, $m ) ) {
187  $this->opts->setValue( 'username', $m[1] );
188  }
189  if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) {
190  $ns = $this->getLanguage()->getNsIndex( $m[1] );
191  if ( $ns !== false ) {
192  $this->opts->setValue( 'namespace', $ns );
193  }
194  }
195  }
196  }
197 
203  public function execute( $par ) {
204  $out = $this->getOutput();
205 
206  $this->setHeaders();
207  $this->outputHeader();
208 
209  $this->showNavigation = !$this->including(); // Maybe changed in setup
210  $this->setup( $par );
211 
212  $this->addHelpLink( 'Help:New pages' );
213 
214  if ( !$this->including() ) {
215  // Settings
216  $this->form();
217 
218  $feedType = $this->opts->getValue( 'feed' );
219  if ( $feedType ) {
220  $this->feed( $feedType );
221 
222  return;
223  }
224 
225  $allValues = $this->opts->getAllValues();
226  unset( $allValues['feed'] );
227  $out->setFeedAppendQuery( wfArrayToCgi( $allValues ) );
228  }
229 
230  $pager = new NewPagesPager(
231  $this,
232  $this->opts,
233  $this->linkBatchFactory,
234  $this->getHookContainer(),
235  $this->permissionManager,
236  $this->loadBalancer,
237  $this->namespaceInfo,
238  $this->actorMigration
239  );
240  $pager->mLimit = $this->opts->getValue( 'limit' );
241  $pager->mOffset = $this->opts->getValue( 'offset' );
242 
243  if ( $pager->getNumRows() ) {
244  $navigation = '';
245  if ( $this->showNavigation ) {
246  $navigation = $pager->getNavigationBar();
247  }
248  $out->addHTML( $navigation . $pager->getBody() . $navigation );
249  // Add styles for change tags
250  $out->addModuleStyles( 'mediawiki.interface.helpers.styles' );
251  } else {
252  $out->addWikiMsg( 'specialpage-empty' );
253  }
254  }
255 
256  protected function filterLinks() {
257  // show/hide links
258  $showhide = [ $this->msg( 'show' )->escaped(), $this->msg( 'hide' )->escaped() ];
259 
260  // Option value -> message mapping
261  $filters = [
262  'hideliu' => 'rcshowhideliu',
263  'hidepatrolled' => 'rcshowhidepatr',
264  'hidebots' => 'rcshowhidebots',
265  'hideredirs' => 'whatlinkshere-hideredirs'
266  ];
267  foreach ( $this->customFilters as $key => $params ) {
268  $filters[$key] = $params['msg'];
269  }
270 
271  // Disable some if needed
272  if ( !$this->canAnonymousUsersCreatePages() ) {
273  unset( $filters['hideliu'] );
274  }
275  if ( !$this->getUser()->useNPPatrol() ) {
276  unset( $filters['hidepatrolled'] );
277  }
278 
279  $links = [];
280  $changed = $this->opts->getChangedValues();
281  unset( $changed['offset'] ); // Reset offset if query type changes
282 
283  // wfArrayToCgi(), called from LinkRenderer/Title, will not output null and false values
284  // to the URL, which would omit some options (T158504). Fix it by explicitly setting them
285  // to 0 or 1.
286  // Also do this only for boolean options, not eg. namespace or tagfilter
287  foreach ( $changed as $key => $value ) {
288  if ( array_key_exists( $key, $filters ) ) {
289  $changed[$key] = $changed[$key] ? '1' : '0';
290  }
291  }
292 
293  $self = $this->getPageTitle();
294  $linkRenderer = $this->getLinkRenderer();
295  foreach ( $filters as $key => $msg ) {
296  $onoff = 1 - $this->opts->getValue( $key );
297  $link = $linkRenderer->makeLink(
298  $self,
299  new HtmlArmor( $showhide[$onoff] ),
300  [],
301  [ $key => $onoff ] + $changed
302  );
303  $links[$key] = $this->msg( $msg )->rawParams( $link )->escaped();
304  }
305 
306  return $this->getLanguage()->pipeList( $links );
307  }
308 
309  protected function form() {
310  $out = $this->getOutput();
311 
312  // Consume values
313  $this->opts->consumeValue( 'offset' ); // don't carry offset, DWIW
314  $namespace = $this->opts->consumeValue( 'namespace' );
315  $username = $this->opts->consumeValue( 'username' );
316  $tagFilterVal = $this->opts->consumeValue( 'tagfilter' );
317  $nsinvert = $this->opts->consumeValue( 'invert' );
318  $nsassociated = $this->opts->consumeValue( 'associated' );
319 
320  $size = $this->opts->consumeValue( 'size' );
321  $max = $this->opts->consumeValue( 'size-mode' ) === 'max';
322 
323  // Check username input validity
324  $ut = Title::makeTitleSafe( NS_USER, $username );
325  $userText = $ut ? $ut->getText() : '';
326 
327  $formDescriptor = [
328  'namespace' => [
329  'type' => 'namespaceselect',
330  'name' => 'namespace',
331  'label-message' => 'namespace',
332  'default' => $namespace,
333  ],
334  'nsinvert' => [
335  'type' => 'check',
336  'name' => 'invert',
337  'label-message' => 'invert',
338  'default' => $nsinvert,
339  'tooltip' => 'invert',
340  ],
341  'nsassociated' => [
342  'type' => 'check',
343  'name' => 'associated',
344  'label-message' => 'namespace_association',
345  'default' => $nsassociated,
346  'tooltip' => 'namespace_association',
347  ],
348  'tagFilter' => [
349  'type' => 'tagfilter',
350  'name' => 'tagfilter',
351  'label-raw' => $this->msg( 'tag-filter' )->parse(),
352  'default' => $tagFilterVal,
353  ],
354  'username' => [
355  'type' => 'user',
356  'name' => 'username',
357  'label-message' => 'newpages-username',
358  'default' => $userText,
359  'id' => 'mw-np-username',
360  'size' => 30,
361  ],
362  'size' => [
363  'type' => 'sizefilter',
364  'name' => 'size',
365  'default' => -$max * $size,
366  ],
367  ];
368 
369  $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() );
370 
371  // Store query values in hidden fields so that form submission doesn't lose them
372  foreach ( $this->opts->getUnconsumedValues() as $key => $value ) {
373  $htmlForm->addHiddenField( $key, $value );
374  }
375 
376  $htmlForm
377  ->setMethod( 'get' )
378  ->setFormIdentifier( 'newpagesform' )
379  // The form should be visible on each request (inclusive requests with submitted forms), so
380  // return always false here.
381  ->setSubmitCallback(
382  function () {
383  return false;
384  }
385  )
386  ->setSubmitText( $this->msg( 'newpages-submit' )->text() )
387  ->setWrapperLegend( $this->msg( 'newpages' )->text() )
388  ->addFooterText( Html::rawElement(
389  'div',
390  null,
391  $this->filterLinks()
392  ) )
393  ->show();
394  $out->addModuleStyles( 'mediawiki.special' );
395  }
396 
402  private function revisionFromRcResult( stdClass $result, Title $title ) : RevisionRecord {
403  $revRecord = new MutableRevisionRecord( $title );
404  $revRecord->setComment(
405  $this->commentStore->getComment( 'rc_comment', $result )
406  );
407  $revRecord->setVisibility( (int)$result->rc_deleted );
408 
409  $user = new UserIdentityValue(
410  (int)$result->rc_user,
411  $result->rc_user_text,
412  (int)$result->rc_actor
413  );
414  $revRecord->setUser( $user );
415 
416  return $revRecord;
417  }
418 
426  public function formatRow( $result ) {
427  $title = Title::newFromRow( $result );
428 
429  // Revision deletion works on revisions,
430  // so cast our recent change row to a revision row.
431  $revRecord = $this->revisionFromRcResult( $result, $title );
432 
433  $classes = [];
434  $attribs = [ 'data-mw-revid' => $result->rev_id ];
435 
436  $lang = $this->getLanguage();
437  $dm = $lang->getDirMark();
438 
439  $spanTime = Html::element( 'span', [ 'class' => 'mw-newpages-time' ],
440  $lang->userTimeAndDate( $result->rc_timestamp, $this->getUser() )
441  );
442  $linkRenderer = $this->getLinkRenderer();
443  $time = $linkRenderer->makeKnownLink(
444  $title,
445  new HtmlArmor( $spanTime ),
446  [],
447  [ 'oldid' => $result->rc_this_oldid ]
448  );
449 
450  $query = $title->isRedirect() ? [ 'redirect' => 'no' ] : [];
451 
452  $plink = $linkRenderer->makeKnownLink(
453  $title,
454  null,
455  [ 'class' => 'mw-newpages-pagename' ],
456  $query
457  );
458  $linkArr = [];
459  $linkArr[] = $linkRenderer->makeKnownLink(
460  $title,
461  $this->msg( 'hist' )->text(),
462  [ 'class' => 'mw-newpages-history' ],
463  [ 'action' => 'history' ]
464  );
465  if ( $this->contentHandlerFactory->getContentHandler( $title->getContentModel() )
466  ->supportsDirectEditing()
467  ) {
468  $linkArr[] = $linkRenderer->makeKnownLink(
469  $title,
470  $this->msg( 'editlink' )->text(),
471  [ 'class' => 'mw-newpages-edit' ],
472  [ 'action' => 'edit' ]
473  );
474  }
475  $links = $this->msg( 'parentheses' )->rawParams( $this->getLanguage()
476  ->pipeList( $linkArr ) )->escaped();
477 
478  $length = Html::rawElement(
479  'span',
480  [ 'class' => 'mw-newpages-length' ],
481  $this->msg( 'brackets' )->rawParams(
482  $this->msg( 'nbytes' )->numParams( $result->length )->escaped()
483  )->escaped()
484  );
485 
486  $ulink = Linker::revUserTools( $revRecord );
487  $comment = Linker::revComment( $revRecord );
488 
489  if ( $this->patrollable( $result ) ) {
490  $classes[] = 'not-patrolled';
491  }
492 
493  # Add a class for zero byte pages
494  if ( $result->length == 0 ) {
495  $classes[] = 'mw-newpages-zero-byte-page';
496  }
497 
498  # Tags, if any.
499  if ( isset( $result->ts_tags ) ) {
500  list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow(
501  $result->ts_tags,
502  'newpages',
503  $this->getContext()
504  );
505  $classes = array_merge( $classes, $newClasses );
506  } else {
507  $tagDisplay = '';
508  }
509 
510  # Display the old title if the namespace/title has been changed
511  $oldTitleText = '';
512  $oldTitle = Title::makeTitle( $result->rc_namespace, $result->rc_title );
513 
514  if ( !$title->equals( $oldTitle ) ) {
515  $oldTitleText = $oldTitle->getPrefixedText();
516  $oldTitleText = Html::rawElement(
517  'span',
518  [ 'class' => 'mw-newpages-oldtitle' ],
519  $this->msg( 'rc-old-title' )->params( $oldTitleText )->escaped()
520  );
521  }
522 
523  $ret = "{$time} {$dm}{$plink} {$links} {$dm}{$length} {$dm}{$ulink} {$comment} "
524  . "{$tagDisplay} {$oldTitleText}";
525 
526  // Let extensions add data
527  $this->getHookRunner()->onNewPagesLineEnding(
528  $this, $ret, $result, $classes, $attribs );
529  $attribs = array_filter( $attribs,
530  [ Sanitizer::class, 'isReservedDataAttribute' ],
531  ARRAY_FILTER_USE_KEY
532  );
533 
534  if ( $classes ) {
535  $attribs['class'] = $classes;
536  }
537 
538  return Html::rawElement( 'li', $attribs, $ret ) . "\n";
539  }
540 
547  protected function patrollable( $result ) {
548  return ( $this->getUser()->useNPPatrol() && !$result->rc_patrolled );
549  }
550 
556  protected function feed( $type ) {
557  if ( !$this->getConfig()->get( 'Feed' ) ) {
558  $this->getOutput()->addWikiMsg( 'feed-unavailable' );
559 
560  return;
561  }
562 
563  $feedClasses = $this->getConfig()->get( 'FeedClasses' );
564  if ( !isset( $feedClasses[$type] ) ) {
565  $this->getOutput()->addWikiMsg( 'feed-invalid' );
566 
567  return;
568  }
569 
570  $feed = new $feedClasses[$type](
571  $this->feedTitle(),
572  $this->msg( 'tagline' )->text(),
573  $this->getPageTitle()->getFullURL()
574  );
575 
576  $pager = new NewPagesPager(
577  $this,
578  $this->opts,
579  $this->linkBatchFactory,
580  $this->getHookContainer(),
581  $this->permissionManager,
582  $this->loadBalancer,
583  $this->namespaceInfo,
584  $this->actorMigration
585  );
586  $limit = $this->opts->getValue( 'limit' );
587  $pager->mLimit = min( $limit, $this->getConfig()->get( 'FeedLimit' ) );
588 
589  $feed->outHeader();
590  if ( $pager->getNumRows() > 0 ) {
591  foreach ( $pager->mResult as $row ) {
592  $feed->outItem( $this->feedItem( $row ) );
593  }
594  }
595  $feed->outFooter();
596  }
597 
598  protected function feedTitle() {
599  $desc = $this->getDescription();
600  $code = $this->getConfig()->get( 'LanguageCode' );
601  $sitename = $this->getConfig()->get( 'Sitename' );
602 
603  return "$sitename - $desc [$code]";
604  }
605 
606  protected function feedItem( $row ) {
607  $title = Title::makeTitle( intval( $row->rc_namespace ), $row->rc_title );
608  if ( $title ) {
609  $date = $row->rc_timestamp;
610  $comments = $title->getTalkPage()->getFullURL();
611 
612  return new FeedItem(
613  $title->getPrefixedText(),
614  $this->feedItemDesc( $row ),
615  $title->getFullURL(),
616  $date,
617  $this->feedItemAuthor( $row ),
618  $comments
619  );
620  } else {
621  return null;
622  }
623  }
624 
625  protected function feedItemAuthor( $row ) {
626  return $row->rc_user_text ?? '';
627  }
628 
629  protected function feedItemDesc( $row ) {
630  $revisionRecord = $this->revisionLookup->getRevisionById( $row->rev_id );
631  if ( !$revisionRecord ) {
632  return '';
633  }
634 
635  $content = $revisionRecord->getContent( SlotRecord::MAIN );
636  if ( $content === null ) {
637  return '';
638  }
639 
640  // XXX: include content model/type in feed item?
641  $revUser = $revisionRecord->getUser();
642  $revUserText = $revUser ? $revUser->getName() : '';
643  $revComment = $revisionRecord->getComment();
644  $revCommentText = $revComment ? $revComment->text : '';
645  return '<p>' . htmlspecialchars( $revUserText ) .
646  $this->msg( 'colon-separator' )->inContentLanguage()->escaped() .
647  htmlspecialchars( FeedItem::stripComment( $revCommentText ) ) .
648  "</p>\n<hr />\n<div>" .
649  nl2br( htmlspecialchars( $content->serialize() ) ) . "</div>";
650  }
651 
652  private function canAnonymousUsersCreatePages() {
653  return $this->permissionManager->groupHasPermission( '*', 'createpage' ) ||
654  $this->permissionManager->groupHasPermission( '*', 'createtalk' );
655  }
656 
657  protected function getGroupName() {
658  return 'changes';
659  }
660 
661  protected function getCacheTTL() {
662  return 60 * 5;
663  }
664 }
SpecialPage\$linkRenderer
LinkRenderer null $linkRenderer
Definition: SpecialPage.php:79
MediaWiki\User\UserIdentityValue
Value object representing a user's identity.
Definition: UserIdentityValue.php:34
SpecialPage\getPageTitle
getPageTitle( $subpage=false)
Get a self-referential title object.
Definition: SpecialPage.php:742
SpecialPage\msg
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:900
FeedItem
A base class for outputting syndication feeds (e.g.
Definition: FeedItem.php:33
HtmlArmor
Marks HTML that shouldn't be escaped.
Definition: HtmlArmor.php:30
Revision\RevisionRecord
Page revision base class.
Definition: RevisionRecord.php:46
SpecialNewpages\$permissionManager
PermissionManager $permissionManager
Definition: SpecialNewpages.php:60
SpecialNewpages\$userOptionsLookup
UserOptionsLookup $userOptionsLookup
Definition: SpecialNewpages.php:75
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:788
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:37
SpecialNewpages\execute
execute( $par)
Show a form for filtering namespace and username.
Definition: SpecialNewpages.php:203
Linker\revComment
static revComment( $rev, $local=false, $isPublic=false, $useParentheses=true)
Wrap and format the given revision's comment block, if the current user is allowed to view it.
Definition: Linker.php:1605
SpecialNewpages\$loadBalancer
ILoadBalancer $loadBalancer
Definition: SpecialNewpages.php:63
CommentStore
Handle database storage of comments such as edit summaries and log reasons.
Definition: CommentStore.php:42
FeedItem\stripComment
static stripComment( $text)
Quickie hack...
Definition: FeedItem.php:220
SpecialNewpages\canAnonymousUsersCreatePages
canAnonymousUsersCreatePages()
Definition: SpecialNewpages.php:652
SpecialPage\getHookContainer
getHookContainer()
Definition: SpecialPage.php:1070
IncludableSpecialPage
Shortcut to construct an includable special page.
Definition: IncludableSpecialPage.php:29
FormOptions\validateIntBounds
validateIntBounds( $name, $min, $max)
Definition: FormOptions.php:255
SpecialPage\getLanguage
getLanguage()
Shortcut to get user's language.
Definition: SpecialPage.php:818
ActorMigration
This class handles the logic for the actor table migration and should always be used in lieu of direc...
Definition: ActorMigration.php:41
SpecialNewpages\form
form()
Definition: SpecialNewpages.php:309
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:346
SpecialNewpages\feed
feed( $type)
Output a subscription feed listing recent edits to this page.
Definition: SpecialNewpages.php:556
SpecialNewpages\setup
setup( $par)
Definition: SpecialNewpages.php:114
SpecialNewpages\$linkBatchFactory
LinkBatchFactory $linkBatchFactory
Definition: SpecialNewpages.php:51
Revision\RevisionLookup
Service for looking up page revisions.
Definition: RevisionLookup.php:38
FormOptions\add
add( $name, $default, $type=self::AUTO)
Add an option to be handled by this FormOptions instance.
Definition: FormOptions.php:83
SpecialPage\getDescription
getDescription()
Returns the name that goes in the <h1> in the special page itself, and also the name that will be l...
Definition: SpecialPage.php:731
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:936
SpecialPage\getHookRunner
getHookRunner()
Definition: SpecialPage.php:1083
SpecialNewpages\__construct
__construct(LinkBatchFactory $linkBatchFactory, CommentStore $commentStore, IContentHandlerFactory $contentHandlerFactory, PermissionManager $permissionManager, ILoadBalancer $loadBalancer, RevisionLookup $revisionLookup, NamespaceInfo $namespaceInfo, ActorMigration $actorMigration, UserOptionsLookup $userOptionsLookup)
Definition: SpecialNewpages.php:88
SpecialPage\getConfig
getConfig()
Shortcut to get main config object.
Definition: SpecialPage.php:866
SpecialNewpages\$revisionLookup
RevisionLookup $revisionLookup
Definition: SpecialNewpages.php:66
SpecialNewpages\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialNewpages.php:657
SpecialNewpages\$opts
FormOptions $opts
Definition: SpecialNewpages.php:44
Title\newFromRow
static newFromRow( $row)
Make a Title object from a DB row.
Definition: Title.php:523
MediaWiki\Cache\LinkBatchFactory
Definition: LinkBatchFactory.php:38
SpecialNewpages\feedItem
feedItem( $row)
Definition: SpecialNewpages.php:606
SpecialNewpages\$actorMigration
ActorMigration $actorMigration
Definition: SpecialNewpages.php:72
$title
$title
Definition: testCompression.php:38
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!...
Definition: SpecialPage.php:616
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:798
SpecialNewpages\parseParams
parseParams( $par)
Definition: SpecialNewpages.php:156
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:591
Linker\revUserTools
static revUserTools( $rev, $isPublic=false, $useParentheses=true)
Generate a user tool link cluster if the current user is allowed to view it.
Definition: Linker.php:1142
SpecialNewpages\$customFilters
array[] $customFilters
Definition: SpecialNewpages.php:46
SpecialPage\getContext
getContext()
Gets the context this SpecialPage is executed in.
Definition: SpecialPage.php:762
SpecialNewpages\feedTitle
feedTitle()
Definition: SpecialNewpages.php:598
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:617
MediaWiki\Permissions\PermissionManager
A service class for checking permissions To obtain an instance, use MediaWikiServices::getInstance()-...
Definition: PermissionManager.php:50
$content
$content
Definition: router.php:76
MediaWiki\Content\IContentHandlerFactory
Definition: IContentHandlerFactory.php:10
Revision\MutableRevisionRecord
Definition: MutableRevisionRecord.php:45
SpecialNewpages\$showNavigation
$showNavigation
Definition: SpecialNewpages.php:48
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:778
SpecialNewpages\filterLinks
filterLinks()
Definition: SpecialNewpages.php:256
SpecialNewpages\$contentHandlerFactory
IContentHandlerFactory $contentHandlerFactory
Definition: SpecialNewpages.php:57
MediaWiki\User\UserOptionsLookup
Provides access to user options.
Definition: UserOptionsLookup.php:29
NewPagesPager
Definition: NewPagesPager.php:31
SpecialNewpages\formatRow
formatRow( $result)
Format a row, providing the timestamp, links to the page/history, size, user links,...
Definition: SpecialNewpages.php:426
SpecialNewpages\$namespaceInfo
NamespaceInfo $namespaceInfo
Definition: SpecialNewpages.php:69
SpecialPage\getLinkRenderer
getLinkRenderer()
Definition: SpecialPage.php:1016
$self
$self
Definition: doMaintenance.php:63
Title
Represents a title within MediaWiki.
Definition: Title.php:41
SpecialNewpages\revisionFromRcResult
revisionFromRcResult(stdClass $result, Title $title)
Definition: SpecialNewpages.php:402
SpecialNewpages
A special page that list newly created pages.
Definition: SpecialNewpages.php:40
SpecialNewpages\getCacheTTL
getCacheTTL()
Stable to override.
Definition: SpecialNewpages.php:661
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:212
SpecialNewpages\$commentStore
CommentStore $commentStore
Definition: SpecialNewpages.php:54
NS_USER
const NS_USER
Definition: Defines.php:71
SpecialNewpages\feedItemAuthor
feedItemAuthor( $row)
Definition: SpecialNewpages.php:625
NamespaceInfo
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Definition: NamespaceInfo.php:35
FormOptions
Helper class to keep track of options when mixing links and form elements.
Definition: FormOptions.php:35
Html\element
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:234
HTMLForm\factory
static factory( $displayFormat,... $arguments)
Construct a HTMLForm object for given display type.
Definition: HTMLForm.php:316
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:707
ChangeTags\formatSummaryRow
static formatSummaryRow( $tags, $page, IContextSource $context=null)
Creates HTML for the given tags.
Definition: ChangeTags.php:174
SpecialPage\including
including( $x=null)
Whether the special page is being evaluated via transclusion.
Definition: SpecialPage.php:265
SpecialNewpages\patrollable
patrollable( $result)
Should a specific result row provide "patrollable" links?
Definition: SpecialNewpages.php:547
Wikimedia\Rdbms\ILoadBalancer
Database cluster connection, tracking, load balancing, and transaction manager interface.
Definition: ILoadBalancer.php:81
SpecialNewpages\feedItemDesc
feedItemDesc( $row)
Definition: SpecialNewpages.php:629
Revision\SlotRecord
Value object representing a content slot associated with a page revision.
Definition: SlotRecord.php:40
wfArrayToCgi
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....
Definition: GlobalFunctions.php:346
$type
$type
Definition: testCompression.php:52