MediaWiki  1.23.8
SpecialRecentchanges.php
Go to the documentation of this file.
1 <?php
30  // @codingStandardsIgnoreStart Needed "useless" override to change parameters.
31  public function __construct( $name = 'Recentchanges', $restriction = '' ) {
32  parent::__construct( $name, $restriction );
33  }
34  // @codingStandardsIgnoreEnd
35 
41  public function execute( $subpage ) {
42  // Backwards-compatibility: redirect to new feed URLs
43  $feedFormat = $this->getRequest()->getVal( 'feed' );
44  if ( !$this->including() && $feedFormat ) {
45  $query = $this->getFeedQuery();
46  $query['feedformat'] = $feedFormat === 'atom' ? 'atom' : 'rss';
47  $this->getOutput()->redirect( wfAppendQuery( wfScript( 'api' ), $query ) );
48 
49  return;
50  }
51 
52  // 10 seconds server-side caching max
53  $this->getOutput()->setSquidMaxage( 10 );
54  // Check if the client has a cached version
55  $lastmod = $this->checkLastModified();
56  if ( $lastmod === false ) {
57  return;
58  }
59 
60  parent::execute( $subpage );
61  }
62 
68  public function getDefaultOptions() {
69  $opts = parent::getDefaultOptions();
70  $user = $this->getUser();
71 
72  $opts->add( 'days', $user->getIntOption( 'rcdays' ) );
73  $opts->add( 'limit', $user->getIntOption( 'rclimit' ) );
74  $opts->add( 'from', '' );
75 
76  $opts->add( 'hideminor', $user->getBoolOption( 'hideminor' ) );
77  $opts->add( 'hidebots', true );
78  $opts->add( 'hideanons', false );
79  $opts->add( 'hideliu', false );
80  $opts->add( 'hidepatrolled', $user->getBoolOption( 'hidepatrolled' ) );
81  $opts->add( 'hidemyself', false );
82 
83  $opts->add( 'categories', '' );
84  $opts->add( 'categories_any', false );
85  $opts->add( 'tagfilter', '' );
86 
87  return $opts;
88  }
89 
95  protected function getCustomFilters() {
96  if ( $this->customFilters === null ) {
97  $this->customFilters = parent::getCustomFilters();
98  wfRunHooks( 'SpecialRecentChangesFilters', array( $this, &$this->customFilters ), '1.23' );
99  }
100 
101  return $this->customFilters;
102  }
103 
110  public function parseParameters( $par, FormOptions $opts ) {
111  $bits = preg_split( '/\s*,\s*/', trim( $par ) );
112  foreach ( $bits as $bit ) {
113  if ( 'hidebots' === $bit ) {
114  $opts['hidebots'] = true;
115  }
116  if ( 'bots' === $bit ) {
117  $opts['hidebots'] = false;
118  }
119  if ( 'hideminor' === $bit ) {
120  $opts['hideminor'] = true;
121  }
122  if ( 'minor' === $bit ) {
123  $opts['hideminor'] = false;
124  }
125  if ( 'hideliu' === $bit ) {
126  $opts['hideliu'] = true;
127  }
128  if ( 'hidepatrolled' === $bit ) {
129  $opts['hidepatrolled'] = true;
130  }
131  if ( 'hideanons' === $bit ) {
132  $opts['hideanons'] = true;
133  }
134  if ( 'hidemyself' === $bit ) {
135  $opts['hidemyself'] = true;
136  }
137 
138  if ( is_numeric( $bit ) ) {
139  $opts['limit'] = $bit;
140  }
141 
142  $m = array();
143  if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) {
144  $opts['limit'] = $m[1];
145  }
146  if ( preg_match( '/^days=(\d+)$/', $bit, $m ) ) {
147  $opts['days'] = $m[1];
148  }
149  if ( preg_match( '/^namespace=(\d+)$/', $bit, $m ) ) {
150  $opts['namespace'] = $m[1];
151  }
152  }
153  }
154 
155  public function validateOptions( FormOptions $opts ) {
156  $opts->validateIntBounds( 'limit', 0, 5000 );
157  parent::validateOptions( $opts );
158  }
159 
166  public function buildMainQueryConds( FormOptions $opts ) {
167  $dbr = $this->getDB();
168  $conds = parent::buildMainQueryConds( $opts );
169 
170  // Calculate cutoff
171  $cutoff_unixtime = time() - ( $opts['days'] * 86400 );
172  $cutoff_unixtime = $cutoff_unixtime - ( $cutoff_unixtime % 86400 );
173  $cutoff = $dbr->timestamp( $cutoff_unixtime );
174 
175  $fromValid = preg_match( '/^[0-9]{14}$/', $opts['from'] );
176  if ( $fromValid && $opts['from'] > wfTimestamp( TS_MW, $cutoff ) ) {
177  $cutoff = $dbr->timestamp( $opts['from'] );
178  } else {
179  $opts->reset( 'from' );
180  }
181 
182  $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes( $cutoff );
183 
184  return $conds;
185  }
186 
194  public function doMainQuery( $conds, $opts ) {
195  global $wgAllowCategorizedRecentChanges;
196 
197  $dbr = $this->getDB();
198  $user = $this->getUser();
199 
200  $tables = array( 'recentchanges' );
201  $fields = RecentChange::selectFields();
202  $query_options = array();
203  $join_conds = array();
204 
205  // JOIN on watchlist for users
206  if ( $user->getId() && $user->isAllowed( 'viewmywatchlist' ) ) {
207  $tables[] = 'watchlist';
208  $fields[] = 'wl_user';
209  $fields[] = 'wl_notificationtimestamp';
210  $join_conds['watchlist'] = array( 'LEFT JOIN', array(
211  'wl_user' => $user->getId(),
212  'wl_title=rc_title',
213  'wl_namespace=rc_namespace'
214  ) );
215  }
216 
217  if ( $user->isAllowed( 'rollback' ) ) {
218  $tables[] = 'page';
219  $fields[] = 'page_latest';
220  $join_conds['page'] = array( 'LEFT JOIN', 'rc_cur_id=page_id' );
221  }
222 
224  $tables,
225  $fields,
226  $conds,
227  $join_conds,
228  $query_options,
229  $opts['tagfilter']
230  );
231 
232  if ( !wfRunHooks( 'SpecialRecentChangesQuery',
233  array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ),
234  '1.23' )
235  ) {
236  return false;
237  }
238 
239  // rc_new is not an ENUM, but adding a redundant rc_new IN (0,1) gives mysql enough
240  // knowledge to use an index merge if it wants (it may use some other index though).
241  $rows = $dbr->select(
242  $tables,
243  $fields,
244  $conds + array( 'rc_new' => array( 0, 1 ) ),
245  __METHOD__,
246  array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $opts['limit'] ) + $query_options,
247  $join_conds
248  );
249 
250  // Build the final data
251  if ( $wgAllowCategorizedRecentChanges ) {
252  $this->filterByCategories( $rows, $opts );
253  }
254 
255  return $rows;
256  }
257 
258  public function outputFeedLinks() {
259  $this->addFeedLinks( $this->getFeedQuery() );
260  }
261 
267  private function getFeedQuery() {
268  global $wgFeedLimit;
269  $query = array_filter( $this->getOptions()->getAllValues(), function ( $value ) {
270  // API handles empty parameters in a different way
271  return $value !== '';
272  } );
273  $query['action'] = 'feedrecentchanges';
274  if ( $query['limit'] > $wgFeedLimit ) {
275  $query['limit'] = $wgFeedLimit;
276  }
277 
278  return $query;
279  }
280 
287  public function outputChangesList( $rows, $opts ) {
288  global $wgRCShowWatchingUsers, $wgShowUpdatedMarker;
289 
290  $limit = $opts['limit'];
291 
292  $showWatcherCount = $wgRCShowWatchingUsers
293  && $this->getUser()->getOption( 'shownumberswatching' );
294  $watcherCache = array();
295 
296  $dbr = $this->getDB();
297 
298  $counter = 1;
299  $list = ChangesList::newFromContext( $this->getContext() );
300  $list->initChangesListRows( $rows );
301 
302  $rclistOutput = $list->beginRecentChangesList();
303  foreach ( $rows as $obj ) {
304  if ( $limit == 0 ) {
305  break;
306  }
307  $rc = RecentChange::newFromRow( $obj );
308  $rc->counter = $counter++;
309  # Check if the page has been updated since the last visit
310  if ( $wgShowUpdatedMarker && !empty( $obj->wl_notificationtimestamp ) ) {
311  $rc->notificationtimestamp = ( $obj->rc_timestamp >= $obj->wl_notificationtimestamp );
312  } else {
313  $rc->notificationtimestamp = false; // Default
314  }
315  # Check the number of users watching the page
316  $rc->numberofWatchingusers = 0; // Default
317  if ( $showWatcherCount && $obj->rc_namespace >= 0 ) {
318  if ( !isset( $watcherCache[$obj->rc_namespace][$obj->rc_title] ) ) {
319  $watcherCache[$obj->rc_namespace][$obj->rc_title] =
320  $dbr->selectField(
321  'watchlist',
322  'COUNT(*)',
323  array(
324  'wl_namespace' => $obj->rc_namespace,
325  'wl_title' => $obj->rc_title,
326  ),
327  __METHOD__ . '-watchers'
328  );
329  }
330  $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title];
331  }
332 
333  $changeLine = $list->recentChangesLine( $rc, !empty( $obj->wl_user ), $counter );
334  if ( $changeLine !== false ) {
335  $rclistOutput .= $changeLine;
336  --$limit;
337  }
338  }
339  $rclistOutput .= $list->endRecentChangesList();
340 
341  if ( $rows->numRows() === 0 ) {
342  $this->getOutput()->addHtml(
343  '<div class="mw-changeslist-empty">' .
344  $this->msg( 'recentchanges-noresult' )->parse() .
345  '</div>'
346  );
347  } else {
348  $this->getOutput()->addHTML( $rclistOutput );
349  }
350  }
351 
358  public function doHeader( $opts, $numRows ) {
359  global $wgScript;
360 
361  $this->setTopText( $opts );
362 
363  $defaults = $opts->getAllValues();
364  $nondefaults = $opts->getChangedValues();
365 
366  $panel = array();
367  $panel[] = self::makeLegend( $this->getContext() );
368  $panel[] = $this->optionsPanel( $defaults, $nondefaults );
369  $panel[] = '<hr />';
370 
371  $extraOpts = $this->getExtraOptions( $opts );
372  $extraOptsCount = count( $extraOpts );
373  $count = 0;
374  $submit = ' ' . Xml::submitbutton( $this->msg( 'allpagessubmit' )->text() );
375 
376  $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
377  foreach ( $extraOpts as $name => $optionRow ) {
378  # Add submit button to the last row only
379  ++$count;
380  $addSubmit = ( $count === $extraOptsCount ) ? $submit : '';
381 
382  $out .= Xml::openElement( 'tr' );
383  if ( is_array( $optionRow ) ) {
384  $out .= Xml::tags(
385  'td',
386  array( 'class' => 'mw-label mw-' . $name . '-label' ),
387  $optionRow[0]
388  );
389  $out .= Xml::tags(
390  'td',
391  array( 'class' => 'mw-input' ),
392  $optionRow[1] . $addSubmit
393  );
394  } else {
395  $out .= Xml::tags(
396  'td',
397  array( 'class' => 'mw-input', 'colspan' => 2 ),
398  $optionRow . $addSubmit
399  );
400  }
401  $out .= Xml::closeElement( 'tr' );
402  }
403  $out .= Xml::closeElement( 'table' );
404 
405  $unconsumed = $opts->getUnconsumedValues();
406  foreach ( $unconsumed as $key => $value ) {
407  $out .= Html::hidden( $key, $value );
408  }
409 
410  $t = $this->getPageTitle();
411  $out .= Html::hidden( 'title', $t->getPrefixedText() );
412  $form = Xml::tags( 'form', array( 'action' => $wgScript ), $out );
413  $panel[] = $form;
414  $panelString = implode( "\n", $panel );
415 
416  $this->getOutput()->addHTML(
418  $this->msg( 'recentchanges-legend' )->text(),
419  $panelString,
420  array( 'class' => 'rcoptions' )
421  )
422  );
423 
424  $this->setBottomText( $opts );
425  }
426 
432  function setTopText( FormOptions $opts ) {
434 
435  $message = $this->msg( 'recentchangestext' )->inContentLanguage();
436  if ( !$message->isDisabled() ) {
437  $this->getOutput()->addWikiText(
438  Html::rawElement( 'p',
439  array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ),
440  "\n" . $message->plain() . "\n"
441  ),
442  /* $lineStart */ false,
443  /* $interface */ false
444  );
445  }
446  }
447 
454  function getExtraOptions( $opts ) {
455  $opts->consumeValues( array(
456  'namespace', 'invert', 'associated', 'tagfilter', 'categories', 'categories_any'
457  ) );
458 
459  $extraOpts = array();
460  $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
461 
462  global $wgAllowCategorizedRecentChanges;
463  if ( $wgAllowCategorizedRecentChanges ) {
464  $extraOpts['category'] = $this->categoryFilterForm( $opts );
465  }
466 
467  $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] );
468  if ( count( $tagFilter ) ) {
469  $extraOpts['tagfilter'] = $tagFilter;
470  }
471 
472  // Don't fire the hook for subclasses. (Or should we?)
473  if ( $this->getName() === 'Recentchanges' ) {
474  wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
475  }
476 
477  return $extraOpts;
478  }
479 
483  protected function addModules() {
484  parent::addModules();
485  $out = $this->getOutput();
486  $out->addModules( 'mediawiki.special.recentchanges' );
487  }
488 
496  public function checkLastModified() {
497  $dbr = $this->getDB();
498  $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __METHOD__ );
499 
500  return $lastmod;
501  }
502 
509  protected function namespaceFilterForm( FormOptions $opts ) {
510  $nsSelect = Html::namespaceSelector(
511  array( 'selected' => $opts['namespace'], 'all' => '' ),
512  array( 'name' => 'namespace', 'id' => 'namespace' )
513  );
514  $nsLabel = Xml::label( $this->msg( 'namespace' )->text(), 'namespace' );
515  $invert = Xml::checkLabel(
516  $this->msg( 'invert' )->text(), 'invert', 'nsinvert',
517  $opts['invert'],
518  array( 'title' => $this->msg( 'tooltip-invert' )->text() )
519  );
520  $associated = Xml::checkLabel(
521  $this->msg( 'namespace_association' )->text(), 'associated', 'nsassociated',
522  $opts['associated'],
523  array( 'title' => $this->msg( 'tooltip-namespace_association' )->text() )
524  );
525 
526  return array( $nsLabel, "$nsSelect $invert $associated" );
527  }
528 
535  protected function categoryFilterForm( FormOptions $opts ) {
536  list( $label, $input ) = Xml::inputLabelSep( $this->msg( 'rc_categories' )->text(),
537  'categories', 'mw-categories', false, $opts['categories'] );
538 
539  $input .= ' ' . Xml::checkLabel( $this->msg( 'rc_categories_any' )->text(),
540  'categories_any', 'mw-categories_any', $opts['categories_any'] );
541 
542  return array( $label, $input );
543  }
544 
551  function filterByCategories( &$rows, FormOptions $opts ) {
552  $categories = array_map( 'trim', explode( '|', $opts['categories'] ) );
553 
554  if ( !count( $categories ) ) {
555  return;
556  }
557 
558  # Filter categories
559  $cats = array();
560  foreach ( $categories as $cat ) {
561  $cat = trim( $cat );
562  if ( $cat == '' ) {
563  continue;
564  }
565  $cats[] = $cat;
566  }
567 
568  # Filter articles
569  $articles = array();
570  $a2r = array();
571  $rowsarr = array();
572  foreach ( $rows as $k => $r ) {
573  $nt = Title::makeTitle( $r->rc_namespace, $r->rc_title );
574  $id = $nt->getArticleID();
575  if ( $id == 0 ) {
576  continue; # Page might have been deleted...
577  }
578  if ( !in_array( $id, $articles ) ) {
579  $articles[] = $id;
580  }
581  if ( !isset( $a2r[$id] ) ) {
582  $a2r[$id] = array();
583  }
584  $a2r[$id][] = $k;
585  $rowsarr[$k] = $r;
586  }
587 
588  # Shortcut?
589  if ( !count( $articles ) || !count( $cats ) ) {
590  return;
591  }
592 
593  # Look up
594  $c = new Categoryfinder;
595  $c->seed( $articles, $cats, $opts['categories_any'] ? 'OR' : 'AND' );
596  $match = $c->run();
597 
598  # Filter
599  $newrows = array();
600  foreach ( $match as $id ) {
601  foreach ( $a2r[$id] as $rev ) {
602  $k = $rev;
603  $newrows[$k] = $rowsarr[$k];
604  }
605  }
606  $rows = $newrows;
607  }
608 
618  function makeOptionsLink( $title, $override, $options, $active = false ) {
619  $params = $override + $options;
620 
621  // Bug 36524: false values have be converted to "0" otherwise
622  // wfArrayToCgi() will omit it them.
623  foreach ( $params as &$value ) {
624  if ( $value === false ) {
625  $value = '0';
626  }
627  }
628  unset( $value );
629 
630  $text = htmlspecialchars( $title );
631  if ( $active ) {
632  $text = '<strong>' . $text . '</strong>';
633  }
634 
635  return Linker::linkKnown( $this->getPageTitle(), $text, array(), $params );
636  }
637 
645  function optionsPanel( $defaults, $nondefaults ) {
646  global $wgRCLinkLimits, $wgRCLinkDays;
647 
648  $options = $nondefaults + $defaults;
649 
650  $note = '';
651  $msg = $this->msg( 'rclegend' );
652  if ( !$msg->isDisabled() ) {
653  $note .= '<div class="mw-rclegend">' . $msg->parse() . "</div>\n";
654  }
655 
656  $lang = $this->getLanguage();
657  $user = $this->getUser();
658  if ( $options['from'] ) {
659  $note .= $this->msg( 'rcnotefrom' )->numParams( $options['limit'] )->params(
660  $lang->userTimeAndDate( $options['from'], $user ),
661  $lang->userDate( $options['from'], $user ),
662  $lang->userTime( $options['from'], $user ) )->parse() . '<br />';
663  }
664 
665  # Sort data for display and make sure it's unique after we've added user data.
666  $linkLimits = $wgRCLinkLimits;
667  $linkLimits[] = $options['limit'];
668  sort( $linkLimits );
669  $linkLimits = array_unique( $linkLimits );
670 
671  $linkDays = $wgRCLinkDays;
672  $linkDays[] = $options['days'];
673  sort( $linkDays );
674  $linkDays = array_unique( $linkDays );
675 
676  // limit links
677  $cl = array();
678  foreach ( $linkLimits as $value ) {
679  $cl[] = $this->makeOptionsLink( $lang->formatNum( $value ),
680  array( 'limit' => $value ), $nondefaults, $value == $options['limit'] );
681  }
682  $cl = $lang->pipeList( $cl );
683 
684  // day links, reset 'from' to none
685  $dl = array();
686  foreach ( $linkDays as $value ) {
687  $dl[] = $this->makeOptionsLink( $lang->formatNum( $value ),
688  array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] );
689  }
690  $dl = $lang->pipeList( $dl );
691 
692  // show/hide links
693  $filters = array(
694  'hideminor' => 'rcshowhideminor',
695  'hidebots' => 'rcshowhidebots',
696  'hideanons' => 'rcshowhideanons',
697  'hideliu' => 'rcshowhideliu',
698  'hidepatrolled' => 'rcshowhidepatr',
699  'hidemyself' => 'rcshowhidemine'
700  );
701 
702  $showhide = array( 'show', 'hide' );
703 
704  foreach ( $this->getCustomFilters() as $key => $params ) {
705  $filters[$key] = $params['msg'];
706  }
707  // Disable some if needed
708  if ( !$user->useRCPatrol() ) {
709  unset( $filters['hidepatrolled'] );
710  }
711 
712  $links = array();
713  foreach ( $filters as $key => $msg ) {
714  // The following messages are used here:
715  // rcshowhideminor-show, rcshowhideminor-hide, rcshowhidebots-show, rcshowhidebots-hide,
716  // rcshowhideanons-show, rcshowhideanons-hide, rcshowhideliu-show, rcshowhideliu-hide,
717  // rcshowhidepatr-show, rcshowhidepatr-hide, rcshowhidemine-show, rcshowhidemine-hide.
718  $linkMessage = $this->msg( $msg . '-' . $showhide[1 - $options[$key]] );
719  // Extensions can define additional filters, but don't need to define the corresponding
720  // messages. If they don't exist, just fall back to 'show' and 'hide'.
721  if ( !$linkMessage->exists() ) {
722  $linkMessage = $this->msg( $showhide[1 - $options[$key]] );
723  }
724 
725  $link = $this->makeOptionsLink( $linkMessage->text(),
726  array( $key => 1 - $options[$key] ), $nondefaults );
727  $links[] = $this->msg( $msg )->rawParams( $link )->escaped();
728  }
729 
730  // show from this onward link
732  $now = $lang->userTimeAndDate( $timestamp, $user );
733  $timenow = $lang->userTime( $timestamp, $user );
734  $datenow = $lang->userDate( $timestamp, $user );
735  $rclinks = $this->msg( 'rclinks' )->rawParams( $cl, $dl, $lang->pipeList( $links ) )
736  ->parse();
737  $rclistfrom = $this->makeOptionsLink(
738  $this->msg( 'rclistfrom' )->rawParams( $now, $timenow, $datenow )->parse(),
739  array( 'from' => $timestamp ),
740  $nondefaults
741  );
742 
743  return "{$note}$rclinks<br />$rclistfrom";
744  }
745 
746  public function isIncludable() {
747  return true;
748  }
749 }
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
Page
Abstract class for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
Definition: WikiPage.php:26
SpecialRecentChanges\parseParameters
parseParameters( $par, FormOptions $opts)
Process $par and put options found in $opts.
Definition: SpecialRecentchanges.php:110
ChangesList\newFromContext
static newFromContext(IContextSource $context)
Fetch an appropriate changes list class for the specified context Some users might want to use an enh...
Definition: ChangesList.php:61
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
Xml\tags
static tags( $element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
Definition: Xml.php:131
$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
SpecialRecentChanges\optionsPanel
optionsPanel( $defaults, $nondefaults)
Creates the options panel.
Definition: SpecialRecentchanges.php:645
SpecialRecentChanges\filterByCategories
filterByCategories(&$rows, FormOptions $opts)
Filter $rows by categories set in $opts.
Definition: SpecialRecentchanges.php:551
SpecialRecentChanges\namespaceFilterForm
namespaceFilterForm(FormOptions $opts)
Creates the choose namespace selection.
Definition: SpecialRecentchanges.php:509
SpecialRecentChanges\validateOptions
validateOptions(FormOptions $opts)
Validate a FormOptions object generated by getDefaultOptions() with values already populated.
Definition: SpecialRecentchanges.php:155
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
$timestamp
if( $limit) $timestamp
Definition: importImages.php:104
$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
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:2483
SpecialRecentChanges\__construct
__construct( $name='Recentchanges', $restriction='')
Definition: SpecialRecentchanges.php:31
ChangesListSpecialPage
Special page which uses a ChangesList to show query results.
Definition: ChangesListSpecialPage.php:30
SpecialRecentChanges\outputChangesList
outputChangesList( $rows, $opts)
Build and output the actual changes list.
Definition: SpecialRecentchanges.php:287
$params
$params
Definition: styleTest.css.php:40
$limit
if( $sleep) $limit
Definition: importImages.php:99
Categoryfinder
The "Categoryfinder" class takes a list of articles, creates an internal representation of all their ...
Definition: Categoryfinder.php:45
ChangeTags\buildTagFilterSelector
static buildTagFilterSelector( $selected='', $fullForm=false, Title $title=null)
Build a text box to select a change tag.
Definition: ChangeTags.php:250
FormOptions\reset
reset( $name)
Delete the option value.
Definition: FormOptions.php:200
Categoryfinder\seed
seed( $article_ids, $categories, $mode='AND')
Initializes the instance.
Definition: Categoryfinder.php:71
SpecialRecentChanges\getCustomFilters
getCustomFilters()
Get custom show/hide filters.
Definition: SpecialRecentchanges.php:95
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
$wgContLang
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
Definition: design.txt:56
SpecialPage\getLanguage
getLanguage()
Shortcut to get user's language.
Definition: SpecialPage.php:578
SpecialRecentChanges\isIncludable
isIncludable()
Whether it's allowed to transclude the special page via {{Special:Foo/params}}.
Definition: SpecialRecentchanges.php:746
SpecialPage\getName
getName()
Get the name of this Special Page.
Definition: SpecialPage.php:139
$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
Xml\openElement
static openElement( $element, $attribs=null)
This opens an XML element.
Definition: Xml.php:109
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
ChangesListSpecialPage\makeLegend
static makeLegend(IContextSource $context)
Return the legend displayed within the fieldset.
Definition: ChangesListSpecialPage.php:401
$dbr
$dbr
Definition: testCompression.php:48
wfAppendQuery
wfAppendQuery( $url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
Definition: GlobalFunctions.php:459
SpecialRecentChanges\addModules
addModules()
Add page-specific modules.
Definition: SpecialRecentchanges.php:483
$out
$out
Definition: UtfNormalGenerate.php:167
SpecialPage\addFeedLinks
addFeedLinks( $params)
Adds RSS/atom links.
Definition: SpecialPage.php:630
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
wfScript
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
Definition: GlobalFunctions.php:3739
RecentChange\newFromRow
static newFromRow( $row)
Definition: RecentChange.php:95
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4010
SpecialRecentChanges\getFeedQuery
getFeedQuery()
Get URL query parameters for action=feedrecentchanges API feed of current recent changes view.
Definition: SpecialRecentchanges.php:267
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:545
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
wfTimestampNow
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
Definition: GlobalFunctions.php:2514
SpecialRecentChanges\execute
execute( $subpage)
Main execution point.
Definition: SpecialRecentchanges.php:41
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
SpecialPage\getContext
getContext()
Gets the context this SpecialPage is executed in.
Definition: SpecialPage.php:508
$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
execute
$batch execute()
TS_MW
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
Definition: GlobalFunctions.php:2431
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
SpecialRecentChanges\buildMainQueryConds
buildMainQueryConds(FormOptions $opts)
Return an array of conditions depending of options set in $opts.
Definition: SpecialRecentchanges.php:166
$value
$value
Definition: styleTest.css.php:45
SpecialPage\msg
msg()
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:609
Xml\inputLabelSep
static inputLabelSep( $label, $name, $id, $size=false, $value=false, $attribs=array())
Same as Xml::inputLabel() but return input and label in an array.
Definition: Xml.php:415
SpecialRecentChanges\getDefaultOptions
getDefaultOptions()
Get a FormOptions object containing the default options.
Definition: SpecialRecentchanges.php:68
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:525
SpecialRecentChanges
A special page that lists last changes made to the wiki.
Definition: SpecialRecentchanges.php:29
SpecialRecentChanges\categoryFilterForm
categoryFilterForm(FormOptions $opts)
Create a input to filter changes by categories.
Definition: SpecialRecentchanges.php:535
$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
$count
$count
Definition: UtfNormalTest2.php:96
$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
SpecialRecentChanges\setTopText
setTopText(FormOptions $opts)
Send the text to be displayed above the options.
Definition: SpecialRecentchanges.php:432
SpecialRecentChanges\doHeader
doHeader( $opts, $numRows)
Set the text to be displayed above the changes.
Definition: SpecialRecentchanges.php:358
RecentChange\selectFields
static selectFields()
Return the list of recentchanges fields that should be selected to create a new recentchanges object.
Definition: RecentChange.php:151
Xml\closeElement
static closeElement( $element)
Shortcut to close an XML element.
Definition: Xml.php:118
SpecialRecentChanges\getExtraOptions
getExtraOptions( $opts)
Get options to be displayed in a form.
Definition: SpecialRecentchanges.php:454
ChangesListSpecialPage\getDB
getDB()
Return a DatabaseBase object for reading.
Definition: ChangesListSpecialPage.php:313
SpecialRecentChanges\outputFeedLinks
outputFeedLinks()
Output feed links.
Definition: SpecialRecentchanges.php:258
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
FormOptions
Helper class to keep track of options when mixing links and form elements.
Definition: FormOptions.php:35
$t
$t
Definition: testCompression.php:65
Html\rawElement
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
Definition: Html.php:124
SpecialRecentChanges\doMainQuery
doMainQuery( $conds, $opts)
Process the query.
Definition: SpecialRecentchanges.php:194
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
ChangesListSpecialPage\setBottomText
setBottomText(FormOptions $opts)
Send the text to be displayed after the options.
Definition: ChangesListSpecialPage.php:377
ChangesListSpecialPage\getOptions
getOptions()
Get the current FormOptions for this request.
Definition: ChangesListSpecialPage.php:89
SpecialPage\including
including( $x=null)
Whether the special page is being evaluated via transclusion.
Definition: SpecialPage.php:207
SpecialRecentChanges\checkLastModified
checkLastModified()
Get last modified date, for client caching Don't use this if we are using the patrol feature,...
Definition: SpecialRecentchanges.php:496
ChangesListSpecialPage\$customFilters
array $customFilters
Definition: ChangesListSpecialPage.php:35
Xml\fieldset
static fieldset( $legend=false, $content=false, $attribs=array())
Shortcut for creating fieldsets.
Definition: Xml.php:563
SpecialRecentChanges\makeOptionsLink
makeOptionsLink( $title, $override, $options, $active=false)
Makes change an option link which carries all the other options.
Definition: SpecialRecentchanges.php:618