MediaWiki  master
LogEventsList.php
Go to the documentation of this file.
1 <?php
31 
33  public const NO_ACTION_LINK = 1;
34  public const NO_EXTRA_USER_LINKS = 2;
35  public const USE_CHECKBOXES = 4;
36 
37  public $flags;
38 
42  protected $showTagEditUI;
43 
47  protected $allowedActions = null;
48 
52  private $linkRenderer;
53 
55  private $hookRunner;
56 
67  public function __construct( $context, $linkRenderer = null, $flags = 0 ) {
68  if ( $context instanceof IContextSource ) {
69  $this->setContext( $context );
70  } else {
71  // Old parameters, $context should be a Skin object
72  $this->setContext( $context->getContext() );
73  }
74 
75  $this->flags = $flags;
76  $this->showTagEditUI = ChangeTags::showTagEditingUI( $this->getAuthority() );
77  if ( $linkRenderer instanceof LinkRenderer ) {
78  $this->linkRenderer = $linkRenderer;
79  }
80  $this->hookRunner = Hooks::runner();
81  }
82 
87  protected function getLinkRenderer() {
88  if ( $this->linkRenderer !== null ) {
89  return $this->linkRenderer;
90  } else {
91  return MediaWikiServices::getInstance()->getLinkRenderer();
92  }
93  }
94 
111  public function showOptions( $types = [], $user = '', $page = '', $pattern = false, $year = 0,
112  $month = 0, $day = 0, $filter = null, $tagFilter = '', $action = null
113  ) {
114  // For B/C, we take strings, but make sure they are converted...
115  $types = ( $types === '' ) ? [] : (array)$types;
116 
117  $formDescriptor = [];
118 
119  // Basic selectors
120  $formDescriptor['type'] = $this->getTypeMenuDesc( $types );
121  $formDescriptor['user'] = $this->getUserInputDesc( $user );
122  $formDescriptor['page'] = $this->getTitleInputDesc( $page );
123 
124  // Add extra inputs if any
125  // This could either be a form descriptor array or a string with raw HTML.
126  // We need it to work in both cases and show a deprecation warning if it
127  // is a string. See T199495.
128  $extraInputsDescriptor = $this->getExtraInputsDesc( $types );
129  if (
130  is_array( $extraInputsDescriptor ) &&
131  !empty( $extraInputsDescriptor )
132  ) {
133  $formDescriptor[ 'extra' ] = $extraInputsDescriptor;
134  } elseif (
135  is_string( $extraInputsDescriptor ) &&
136  $extraInputsDescriptor !== ''
137  ) {
138  // We'll add this to the footer of the form later
139  $extraInputsString = $extraInputsDescriptor;
140  wfDeprecated( '$input in LogEventsListGetExtraInputs hook', '1.32' );
141  }
142 
143  // Title pattern, if allowed
144  if ( !$this->getConfig()->get( 'MiserMode' ) ) {
145  $formDescriptor['pattern'] = $this->getTitlePatternDesc( $pattern );
146  }
147 
148  // Date menu
149  $formDescriptor['date'] = [
150  'type' => 'date',
151  'label-message' => 'date',
152  'default' => $year && $month && $day ? sprintf( "%04d-%02d-%02d", $year, $month, $day ) : '',
153  ];
154 
155  // Tag filter
156  $formDescriptor['tagfilter'] = [
157  'type' => 'tagfilter',
158  'name' => 'tagfilter',
159  'label-raw' => $this->msg( 'tag-filter' )->parse(),
160  ];
161 
162  // Filter links
163  if ( $filter ) {
164  $formDescriptor['filters'] = $this->getFiltersDesc( $filter );
165  }
166 
167  // Action filter
168  if (
169  $action !== null &&
170  $this->allowedActions !== null &&
171  count( $this->allowedActions ) > 0
172  ) {
173  $formDescriptor['subtype'] = $this->getActionSelectorDesc( $types, $action );
174  }
175 
176  $context = new DerivativeContext( $this->getContext() );
177  $context->setTitle( SpecialPage::getTitleFor( 'Log' ) ); // Remove subpage
178  $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $context );
179  $htmlForm
180  ->setSubmitText( $this->msg( 'logeventslist-submit' )->text() )
181  ->setMethod( 'get' )
182  ->setWrapperLegendMsg( 'log' );
183 
184  // TODO This will should be removed at some point. See T199495.
185  if ( isset( $extraInputsString ) ) {
186  $htmlForm->addFooterText( Html::rawElement(
187  'div',
188  null,
189  $extraInputsString
190  ) );
191  }
192 
193  $htmlForm->prepareForm()->displayForm( false );
194  }
195 
200  private function getFiltersDesc( $filter ) {
201  $optionsMsg = [];
202  $default = [];
203  foreach ( $filter as $type => $val ) {
204  $optionsMsg["logeventslist-{$type}-log"] = $type;
205 
206  if ( $val === false ) {
207  $default[] = $type;
208  }
209  }
210  return [
211  'class' => HTMLMultiSelectField::class,
212  'label-message' => 'logeventslist-more-filters',
213  'flatlist' => true,
214  'options-messages' => $optionsMsg,
215  'default' => $default,
216  ];
217  }
218 
223  private function getTypeMenuDesc( $queryTypes ) {
224  $queryType = count( $queryTypes ) == 1 ? $queryTypes[0] : '';
225 
226  $typesByName = []; // Temporary array
227  // First pass to load the log names
228  foreach ( LogPage::validTypes() as $type ) {
229  $page = new LogPage( $type );
230  $restriction = $page->getRestriction();
231  if ( $this->getAuthority()->isAllowed( $restriction ) ) {
232  $typesByName[$type] = $page->getName()->text();
233  }
234  }
235 
236  // Second pass to sort by name
237  asort( $typesByName );
238 
239  // Always put "All public logs" on top
240  $public = $typesByName[''];
241  unset( $typesByName[''] );
242  $typesByName = [ '' => $public ] + $typesByName;
243 
244  return [
245  'class' => HTMLSelectField::class,
246  'name' => 'type',
247  'options' => array_flip( $typesByName ),
248  'default' => $queryType,
249  ];
250  }
251 
256  private function getUserInputDesc( $user ) {
257  return [
258  'class' => HTMLUserTextField::class,
259  'label-message' => 'specialloguserlabel',
260  'name' => 'user',
261  'default' => $user,
262  ];
263  }
264 
269  private function getTitleInputDesc( $title ) {
270  return [
271  'class' => HTMLTitleTextField::class,
272  'label-message' => 'speciallogtitlelabel',
273  'name' => 'page',
274  'required' => false
275  ];
276  }
277 
282  private function getTitlePatternDesc( $pattern ) {
283  return [
284  'type' => 'check',
285  'label-message' => 'log-title-wildcard',
286  'name' => 'pattern',
287  ];
288  }
289 
294  private function getExtraInputsDesc( $types ) {
295  if ( count( $types ) == 1 ) {
296  if ( $types[0] == 'suppress' ) {
297  return [
298  'type' => 'text',
299  'label-message' => 'revdelete-offender',
300  'name' => 'offender',
301  ];
302  } else {
303  // Allow extensions to add their own extra inputs
304  // This could be an array or string. See T199495.
305  $input = ''; // Deprecated
306  $formDescriptor = [];
307  $this->hookRunner->onLogEventsListGetExtraInputs( $types[0], $this, $input, $formDescriptor );
308 
309  return empty( $formDescriptor ) ? $input : $formDescriptor;
310  }
311  }
312 
313  return [];
314  }
315 
322  private function getActionSelectorDesc( $types, $action ) {
323  $actionOptions = [];
324  $actionOptions[ 'log-action-filter-all' ] = '';
325 
326  foreach ( $this->allowedActions as $value ) {
327  $msgKey = 'log-action-filter-' . $types[0] . '-' . $value;
328  $actionOptions[ $msgKey ] = $value;
329  }
330 
331  return [
332  'class' => HTMLSelectField::class,
333  'name' => 'subtype',
334  'options-messages' => $actionOptions,
335  'default' => $action,
336  'label' => $this->msg( 'log-action-filter-' . $types[0] )->text(),
337  ];
338  }
339 
346  public function setAllowedActions( $actions ) {
347  $this->allowedActions = $actions;
348  }
349 
353  public function beginLogEventsList() {
354  return "<ul>\n";
355  }
356 
360  public function endLogEventsList() {
361  return "</ul>\n";
362  }
363 
368  public function logLine( $row ) {
369  $entry = DatabaseLogEntry::newFromRow( $row );
370  $formatter = LogFormatter::newFromEntry( $entry );
371  $formatter->setContext( $this->getContext() );
372  $formatter->setLinkRenderer( $this->getLinkRenderer() );
373  $formatter->setShowUserToolLinks( !( $this->flags & self::NO_EXTRA_USER_LINKS ) );
374 
375  $time = $this->getLanguage()->userTimeAndDate(
376  $entry->getTimestamp(),
377  $this->getUser()
378  );
379  // Link the time text to the specific log entry, see T207562
380  $timeLink = $this->getLinkRenderer()->makeKnownLink(
382  $time,
383  [],
384  [ 'logid' => $entry->getId() ]
385  );
386 
387  $action = $formatter->getActionText();
388 
389  if ( $this->flags & self::NO_ACTION_LINK ) {
390  $revert = '';
391  } else {
392  $revert = $formatter->getActionLinks();
393  if ( $revert != '' ) {
394  $revert = '<span class="mw-logevent-actionlink">' . $revert . '</span>';
395  }
396  }
397 
398  $comment = $formatter->getComment();
399 
400  // Some user can hide log items and have review links
401  $del = $this->getShowHideLinks( $row );
402 
403  // Any tags...
404  list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow(
405  $row->ts_tags,
406  'logevent',
407  $this->getContext()
408  );
409  $classes = array_merge(
410  [ 'mw-logline-' . $entry->getType() ],
411  $newClasses
412  );
413  $attribs = [
414  'data-mw-logid' => $entry->getId(),
415  'data-mw-logaction' => $entry->getFullType(),
416  ];
417  $ret = "$del $timeLink $action $comment $revert $tagDisplay";
418 
419  // Let extensions add data
420  $this->hookRunner->onLogEventsListLineEnding( $this, $ret, $entry, $classes, $attribs );
421  $attribs = array_filter( $attribs,
422  [ Sanitizer::class, 'isReservedDataAttribute' ],
423  ARRAY_FILTER_USE_KEY
424  );
425  $attribs['class'] = $classes;
426 
427  return Html::rawElement( 'li', $attribs, $ret ) . "\n";
428  }
429 
434  private function getShowHideLinks( $row ) {
435  // We don't want to see the links and
436  if ( $this->flags == self::NO_ACTION_LINK ) {
437  return '';
438  }
439 
440  $user = $this->getUser();
441 
442  // If change tag editing is available to this user, return the checkbox
443  if ( $this->flags & self::USE_CHECKBOXES && $this->showTagEditUI ) {
444  return Xml::check(
445  'showhiderevisions',
446  false,
447  [ 'name' => 'ids[' . $row->log_id . ']' ]
448  );
449  }
450 
451  // no one can hide items from the suppress log.
452  if ( $row->log_type == 'suppress' ) {
453  return '';
454  }
455 
456  $del = '';
457  // Don't show useless checkbox to people who cannot hide log entries
458  if ( $this->getAuthority()->isAllowed( 'deletedhistory' ) ) {
459  $canHide = $this->getAuthority()->isAllowed( 'deletelogentry' );
460  $canViewSuppressedOnly = $this->getAuthority()->isAllowed( 'viewsuppressed' ) &&
461  !$this->getAuthority()->isAllowed( 'suppressrevision' );
462  $entryIsSuppressed = self::isDeleted( $row, LogPage::DELETED_RESTRICTED );
463  $canViewThisSuppressedEntry = $canViewSuppressedOnly && $entryIsSuppressed;
464  if ( $row->log_deleted || $canHide ) {
465  // Show checkboxes instead of links.
466  if ( $canHide && $this->flags & self::USE_CHECKBOXES && !$canViewThisSuppressedEntry ) {
467  // If event was hidden from sysops
468  if ( !self::userCan( $row, LogPage::DELETED_RESTRICTED, $user ) ) {
469  $del = Xml::check( 'deleterevisions', false, [ 'disabled' => 'disabled' ] );
470  } else {
471  $del = Xml::check(
472  'showhiderevisions',
473  false,
474  [ 'name' => 'ids[' . $row->log_id . ']' ]
475  );
476  }
477  } else {
478  // If event was hidden from sysops
479  if ( !self::userCan( $row, LogPage::DELETED_RESTRICTED, $user ) ) {
480  $del = Linker::revDeleteLinkDisabled( $canHide );
481  } else {
482  $query = [
483  'target' => SpecialPage::getTitleFor( 'Log', $row->log_type )->getPrefixedDBkey(),
484  'type' => 'logging',
485  'ids' => $row->log_id,
486  ];
487  $del = Linker::revDeleteLink(
488  $query,
489  $entryIsSuppressed,
490  $canHide && !$canViewThisSuppressedEntry
491  );
492  }
493  }
494  }
495  }
496 
497  return $del;
498  }
499 
506  public static function typeAction( $row, $type, $action ) {
507  $match = is_array( $type ) ?
508  in_array( $row->log_type, $type ) : $row->log_type == $type;
509  if ( $match ) {
510  $match = is_array( $action ) ?
511  in_array( $row->log_action, $action ) : $row->log_action == $action;
512  }
513 
514  return $match;
515  }
516 
526  public static function userCan( $row, $field, User $user ) {
527  return self::userCanBitfield( $row->log_deleted, $field, $user ) &&
528  self::userCanViewLogType( $row->log_type, $user );
529  }
530 
540  public static function userCanBitfield( $bitfield, $field, Authority $performer ) {
541  if ( $bitfield & $field ) {
542  if ( $bitfield & LogPage::DELETED_RESTRICTED ) {
543  return $performer->isAllowedAny( 'suppressrevision', 'viewsuppressed' );
544  } else {
545  return $performer->isAllowed( 'deletedhistory' );
546  }
547  }
548  return true;
549  }
550 
559  public static function userCanViewLogType( $type, Authority $performer ) {
560  $logRestrictions = MediaWikiServices::getInstance()->getMainConfig()->get( 'LogRestrictions' );
561  if ( isset( $logRestrictions[$type] ) && !$performer->isAllowed( $logRestrictions[$type] )
562  ) {
563  return false;
564  }
565  return true;
566  }
567 
573  public static function isDeleted( $row, $field ) {
574  return ( $row->log_deleted & $field ) == $field;
575  }
576 
602  public static function showLogExtract(
603  &$out, $types = [], $page = '', $user = '', $param = []
604  ) {
605  $defaultParameters = [
606  'lim' => 25,
607  'conds' => [],
608  'showIfEmpty' => true,
609  'msgKey' => [ '' ],
610  'wrap' => "$1",
611  'flags' => 0,
612  'useRequestParams' => false,
613  'useMaster' => false,
614  'extraUrlParams' => false,
615  ];
616  # The + operator appends elements of remaining keys from the right
617  # handed array to the left handed, whereas duplicated keys are NOT overwritten.
618  $param += $defaultParameters;
619  # Convert $param array to individual variables
620  $lim = $param['lim'];
621  $conds = $param['conds'];
622  $showIfEmpty = $param['showIfEmpty'];
623  $msgKey = $param['msgKey'];
624  $wrap = $param['wrap'];
625  $flags = $param['flags'];
626  $extraUrlParams = $param['extraUrlParams'];
627 
628  $useRequestParams = $param['useRequestParams'];
629  // @phan-suppress-next-line PhanRedundantCondition
630  if ( !is_array( $msgKey ) ) {
631  $msgKey = [ $msgKey ];
632  }
633 
634  if ( $out instanceof OutputPage ) {
635  $context = $out->getContext();
636  } else {
638  }
639 
640  $services = MediaWikiServices::getInstance();
641  // FIXME: Figure out how to inject this
642  $linkRenderer = $services->getLinkRenderer();
643 
644  # Insert list of top 50 (or top $lim) items
645  $loglist = new LogEventsList( $context, $linkRenderer, $flags );
646  $pager = new LogPager(
647  $loglist,
648  $types,
649  $user,
650  $page,
651  '',
652  $conds,
653  false,
654  false,
655  false,
656  '',
657  '',
658  0,
659  $services->getLinkBatchFactory(),
660  $services->getDBLoadBalancer(),
661  $services->getActorMigration()
662  );
663  if ( !$useRequestParams ) {
664  # Reset vars that may have been taken from the request
665  $pager->mLimit = 50;
666  $pager->mDefaultLimit = 50;
667  $pager->mOffset = "";
668  $pager->mIsBackwards = false;
669  }
670 
671  if ( $param['useMaster'] ) {
672  $pager->mDb = wfGetDB( DB_MASTER );
673  }
674  if ( isset( $param['offset'] ) ) { # Tell pager to ignore WebRequest offset
675  $pager->setOffset( $param['offset'] );
676  }
677 
678  // @phan-suppress-next-line PhanSuspiciousValueComparison
679  if ( $lim > 0 ) {
680  $pager->mLimit = $lim;
681  }
682  // Fetch the log rows and build the HTML if needed
683  $logBody = $pager->getBody();
684  $numRows = $pager->getNumRows();
685 
686  $s = '';
687 
688  if ( $logBody ) {
689  if ( $msgKey[0] ) {
690  $dir = $context->getLanguage()->getDir();
691  $lang = $context->getLanguage()->getHtmlCode();
692 
693  $s = Xml::openElement( 'div', [
694  'class' => "warningbox mw-warning-with-logexcerpt mw-content-$dir",
695  'dir' => $dir,
696  'lang' => $lang,
697  ] );
698 
699  // @phan-suppress-next-line PhanSuspiciousValueComparison
700  if ( count( $msgKey ) == 1 ) {
701  $s .= $context->msg( $msgKey[0] )->parseAsBlock();
702  } else { // Process additional arguments
703  $args = $msgKey;
704  array_shift( $args );
705  $s .= $context->msg( $msgKey[0], $args )->parseAsBlock();
706  }
707  }
708  $s .= $loglist->beginLogEventsList() .
709  $logBody .
710  $loglist->endLogEventsList();
711  // add styles for change tags
712  $context->getOutput()->addModuleStyles( 'mediawiki.interface.helpers.styles' );
713  } elseif ( $showIfEmpty ) {
714  $s = Html::rawElement( 'div', [ 'class' => 'mw-warning-logempty' ],
715  $context->msg( 'logempty' )->parse() );
716  }
717 
718  if ( $numRows > $pager->mLimit ) { # Show "Full log" link
719  $urlParam = [];
720  if ( $page instanceof Title ) {
721  $urlParam['page'] = $page->getPrefixedDBkey();
722  } elseif ( $page != '' ) {
723  $urlParam['page'] = $page;
724  }
725 
726  if ( $user != '' ) {
727  $urlParam['user'] = $user;
728  }
729 
730  if ( !is_array( $types ) ) { # Make it an array, if it isn't
731  $types = [ $types ];
732  }
733 
734  # If there is exactly one log type, we can link to Special:Log?type=foo
735  if ( count( $types ) == 1 ) {
736  $urlParam['type'] = $types[0];
737  }
738 
739  // @phan-suppress-next-line PhanSuspiciousValueComparison
740  if ( $extraUrlParams !== false ) {
741  $urlParam = array_merge( $urlParam, $extraUrlParams );
742  }
743 
744  $s .= $linkRenderer->makeKnownLink(
745  SpecialPage::getTitleFor( 'Log' ),
746  $context->msg( 'log-fulllog' )->text(),
747  [],
748  $urlParam
749  );
750  }
751 
752  if ( $logBody && $msgKey[0] ) {
753  $s .= '</div>';
754  }
755 
756  // @phan-suppress-next-line PhanSuspiciousValueComparison
757  if ( $wrap != '' ) { // Wrap message in html
758  $s = str_replace( '$1', $s, $wrap );
759  }
760 
761  /* hook can return false, if we don't want the message to be emitted (Wikia BugId:7093) */
762  if ( Hooks::runner()->onLogEventsListShowLogExtract( $s, $types, $page, $user, $param ) ) {
763  // $out can be either an OutputPage object or a String-by-reference
764  if ( $out instanceof OutputPage ) {
765  $out->addHTML( $s );
766  } else {
767  $out = $s;
768  }
769  }
770 
771  return $numRows;
772  }
773 
783  public static function getExcludeClause( $db, $audience = 'public', Authority $performer = null ) {
784  global $wgLogRestrictions;
785 
786  if ( $audience != 'public' && $performer === null ) {
787  throw new InvalidArgumentException(
788  'A User object must be given when checking for a user audience.'
789  );
790  }
791 
792  // Reset the array, clears extra "where" clauses when $par is used
793  $hiddenLogs = [];
794 
795  // Don't show private logs to unprivileged users
796  foreach ( $wgLogRestrictions as $logType => $right ) {
797  if ( $audience == 'public' || !$performer->isAllowed( $right )
798  ) {
799  $hiddenLogs[] = $logType;
800  }
801  }
802  if ( count( $hiddenLogs ) == 1 ) {
803  return 'log_type != ' . $db->addQuotes( $hiddenLogs[0] );
804  } elseif ( $hiddenLogs ) {
805  return 'log_type NOT IN (' . $db->makeList( $hiddenLogs ) . ')';
806  }
807 
808  return false;
809  }
810 }
ContextSource\$context
IContextSource $context
Definition: ContextSource.php:38
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:71
ContextSource\getContext
getContext()
Get the base IContextSource object.
Definition: ContextSource.php:46
LogPage\validTypes
static validTypes()
Get the list of valid log types.
Definition: LogPage.php:203
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:172
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:37
MediaWiki\Linker\LinkRenderer
Class that generates HTML links for pages.
Definition: LinkRenderer.php:41
LogEventsList\userCanBitfield
static userCanBitfield( $bitfield, $field, Authority $performer)
Determine if the current user is allowed to view a particular field of this log row,...
Definition: LogEventsList.php:540
LogEventsList\$showTagEditUI
bool $showTagEditUI
Definition: LogEventsList.php:42
LogPager
Definition: LogPager.php:33
LogEventsList\getTitlePatternDesc
getTitlePatternDesc( $pattern)
Definition: LogEventsList.php:282
LogEventsList\getExcludeClause
static getExcludeClause( $db, $audience='public', Authority $performer=null)
SQL clause to skip forbidden log types for this user.
Definition: LogEventsList.php:783
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Definition: SpecialPage.php:107
LogEventsList\userCan
static userCan( $row, $field, User $user)
Determine if the current user is allowed to view a particular field of this log row,...
Definition: LogEventsList.php:526
ContextSource\getUser
getUser()
Stable to override.
Definition: ContextSource.php:135
Xml\openElement
static openElement( $element, $attribs=null)
This opens an XML element.
Definition: Xml.php:110
LogEventsList\USE_CHECKBOXES
const USE_CHECKBOXES
Definition: LogEventsList.php:35
MediaWiki\Permissions\Authority\isAllowedAny
isAllowedAny(... $permissions)
Checks whether this authority has any of the given permissions in general.
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
ContextSource\getLanguage
getLanguage()
Definition: ContextSource.php:151
LogEventsList\__construct
__construct( $context, $linkRenderer=null, $flags=0)
The first two parameters used to be $skin and $out, but now only a context is needed,...
Definition: LogEventsList.php:67
DerivativeContext
An IContextSource implementation which will inherit context from another source but allow individual ...
Definition: DerivativeContext.php:32
DatabaseLogEntry\newFromRow
static newFromRow( $row)
Constructs new LogEntry from database result row.
Definition: DatabaseLogEntry.php:81
LogEventsList\setAllowedActions
setAllowedActions( $actions)
Sets the action types allowed for log filtering To one action type may correspond several log_actions...
Definition: LogEventsList.php:346
LogEventsList\typeAction
static typeAction( $row, $type, $action)
Definition: LogEventsList.php:506
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition: GlobalFunctions.php:1034
MessageLocalizer\msg
msg( $key,... $params)
This is the method for getting translated interface messages.
SpecialPage\getTitleValueFor
static getTitleValueFor( $name, $subpage=false, $fragment='')
Get a localised TitleValue object for a specified special page name.
Definition: SpecialPage.php:122
LogEventsList\getActionSelectorDesc
getActionSelectorDesc( $types, $action)
Drop down menu for selection of actions that can be used to filter the log.
Definition: LogEventsList.php:322
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2467
ContextSource
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
Definition: ContextSource.php:32
Xml\check
static check( $name, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox.
Definition: Xml.php:329
LogPage
Class to simplify the use of log pages.
Definition: LogPage.php:37
$args
if( $line===false) $args
Definition: mcc.php:124
LogEventsList\logLine
logLine( $row)
Definition: LogEventsList.php:368
LogEventsList\showOptions
showOptions( $types=[], $user='', $page='', $pattern=false, $year=0, $month=0, $day=0, $filter=null, $tagFilter='', $action=null)
Show options for the log list.
Definition: LogEventsList.php:111
Linker\revDeleteLinkDisabled
static revDeleteLinkDisabled( $delete=true)
Creates a dead (show/hide) link for deleting revisions/log entries.
Definition: Linker.php:2265
$title
$title
Definition: testCompression.php:38
LogEventsList\showLogExtract
static showLogExtract(&$out, $types=[], $page='', $user='', $param=[])
Show log extract.
Definition: LogEventsList.php:602
DB_MASTER
const DB_MASTER
Definition: defines.php:26
ContextSource\setContext
setContext(IContextSource $context)
Definition: ContextSource.php:62
LogEventsList
Definition: LogEventsList.php:32
OutputPage
This is one of the Core classes and should be read at least once by any new developers.
Definition: OutputPage.php:47
MediaWiki\Permissions\Authority
@unstable
Definition: Authority.php:30
ContextSource\msg
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
Definition: ContextSource.php:195
$s
foreach( $mmfl['setupFiles'] as $fileName) if( $queue) if(empty( $mmfl['quiet'])) $s
Definition: mergeMessageFileList.php:188
$wgLogRestrictions
$wgLogRestrictions
This restricts log access to those who have a certain right Users without this will not see it in the...
Definition: DefaultSettings.php:8248
ContextSource\getAuthority
getAuthority()
Definition: ContextSource.php:142
Hooks\runner
static runner()
Get a HookRunner instance for calling hooks using the new interfaces.
Definition: Hooks.php:172
LogEventsList\getTitleInputDesc
getTitleInputDesc( $title)
Definition: LogEventsList.php:269
LogEventsList\$linkRenderer
LinkRenderer null $linkRenderer
Definition: LogEventsList.php:52
LogEventsList\getShowHideLinks
getShowHideLinks( $row)
Definition: LogEventsList.php:434
LogEventsList\userCanViewLogType
static userCanViewLogType( $type, Authority $performer)
Determine if the current user is allowed to view a particular field of this log row,...
Definition: LogEventsList.php:559
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:476
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition: IContextSource.php:57
WebRequest
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
Definition: WebRequest.php:42
Title
Represents a title within MediaWiki.
Definition: Title.php:46
MediaWiki\Permissions\Authority\isAllowed
isAllowed(string $permission)
Checks whether this authority has the given permission in general.
LogEventsList\$flags
$flags
Definition: LogEventsList.php:37
LogEventsList\isDeleted
static isDeleted( $row, $field)
Definition: LogEventsList.php:573
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:212
Linker\revDeleteLink
static revDeleteLink( $query=[], $restricted=false, $delete=true)
Creates a (show/hide) link for deleting revisions/log entries.
Definition: Linker.php:2243
LogEventsList\getTypeMenuDesc
getTypeMenuDesc( $queryTypes)
Definition: LogEventsList.php:223
LogPage\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: LogPage.php:41
LogEventsList\NO_ACTION_LINK
const NO_ACTION_LINK
Definition: LogEventsList.php:33
LogEventsList\endLogEventsList
endLogEventsList()
Definition: LogEventsList.php:360
MediaWiki\HookContainer\HookRunner
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
Definition: HookRunner.php:575
LogEventsList\NO_EXTRA_USER_LINKS
const NO_EXTRA_USER_LINKS
Definition: LogEventsList.php:34
LogEventsList\$allowedActions
array $allowedActions
Definition: LogEventsList.php:47
LogEventsList\getUserInputDesc
getUserInputDesc( $user)
Definition: LogEventsList.php:256
LogEventsList\getLinkRenderer
getLinkRenderer()
Definition: LogEventsList.php:87
LogEventsList\getFiltersDesc
getFiltersDesc( $filter)
Definition: LogEventsList.php:200
LogEventsList\beginLogEventsList
beginLogEventsList()
Definition: LogEventsList.php:353
ChangeTags\showTagEditingUI
static showTagEditingUI(Authority $performer)
Indicate whether change tag editing UI is relevant.
Definition: ChangeTags.php:1692
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:66
IContextSource\getOutput
getOutput()
HTMLForm\factory
static factory( $displayFormat,... $arguments)
Construct a HTMLForm object for given display type.
Definition: HTMLForm.php:322
ChangeTags\formatSummaryRow
static formatSummaryRow( $tags, $page, IContextSource $context=null)
Creates HTML for the given tags.
Definition: ChangeTags.php:176
LogEventsList\getExtraInputsDesc
getExtraInputsDesc( $types)
Definition: LogEventsList.php:294
IContextSource\getLanguage
getLanguage()
LogEventsList\$hookRunner
HookRunner $hookRunner
Definition: LogEventsList.php:55
LogFormatter\newFromEntry
static newFromEntry(LogEntry $entry)
Constructs a new formatter suitable for given entry.
Definition: LogFormatter.php:54
$type
$type
Definition: testCompression.php:52