MediaWiki  master
LogEventsList.php
Go to the documentation of this file.
1 <?php
32 
34  public const NO_ACTION_LINK = 1;
35  public const NO_EXTRA_USER_LINKS = 2;
36  public const USE_CHECKBOXES = 4;
37 
38  public $flags;
39 
43  protected $showTagEditUI;
44 
48  protected $allowedActions = null;
49 
53  private $linkRenderer;
54 
56  private $hookRunner;
57 
72  public function __construct( $context, $linkRenderer = null, $flags = 0 ) {
73  if ( $context instanceof IContextSource ) {
74  $this->setContext( $context );
75  } else {
76  // Old parameters, $context should be a Skin object
77  $this->setContext( $context->getContext() );
78  }
79 
80  $this->flags = $flags;
81  $this->showTagEditUI = ChangeTags::showTagEditingUI( $this->getAuthority() );
82  if ( $linkRenderer instanceof LinkRenderer ) {
83  $this->linkRenderer = $linkRenderer;
84  }
85  $this->hookRunner = Hooks::runner();
86  }
87 
92  protected function getLinkRenderer() {
93  if ( $this->linkRenderer !== null ) {
94  return $this->linkRenderer;
95  } else {
96  return MediaWikiServices::getInstance()->getLinkRenderer();
97  }
98  }
99 
116  public function showOptions( $types = [], $user = '', $page = '', $pattern = false, $year = 0,
117  $month = 0, $day = 0, $filter = null, $tagFilter = '', $action = null
118  ) {
119  // For B/C, we take strings, but make sure they are converted...
120  $types = ( $types === '' ) ? [] : (array)$types;
121 
122  $formDescriptor = [];
123 
124  // Basic selectors
125  $formDescriptor['type'] = $this->getTypeMenuDesc( $types );
126  $formDescriptor['user'] = $this->getUserInputDesc( $user );
127  $formDescriptor['page'] = $this->getTitleInputDesc( $page );
128 
129  // Add extra inputs if any
130  // This could either be a form descriptor array or a string with raw HTML.
131  // We need it to work in both cases and show a deprecation warning if it
132  // is a string. See T199495.
133  $extraInputsDescriptor = $this->getExtraInputsDesc( $types );
134  if (
135  is_array( $extraInputsDescriptor ) &&
136  !empty( $extraInputsDescriptor )
137  ) {
138  $formDescriptor[ 'extra' ] = $extraInputsDescriptor;
139  } elseif (
140  is_string( $extraInputsDescriptor ) &&
141  $extraInputsDescriptor !== ''
142  ) {
143  // We'll add this to the footer of the form later
144  $extraInputsString = $extraInputsDescriptor;
145  wfDeprecated( '$input in LogEventsListGetExtraInputs hook', '1.32' );
146  }
147 
148  // Title pattern, if allowed
149  if ( !$this->getConfig()->get( 'MiserMode' ) ) {
150  $formDescriptor['pattern'] = $this->getTitlePatternDesc( $pattern );
151  }
152 
153  // Date menu
154  $formDescriptor['date'] = [
155  'type' => 'date',
156  'label-message' => 'date',
157  'default' => $year && $month && $day ? sprintf( "%04d-%02d-%02d", $year, $month, $day ) : '',
158  ];
159 
160  // Tag filter
161  $formDescriptor['tagfilter'] = [
162  'type' => 'tagfilter',
163  'name' => 'tagfilter',
164  'label-message' => 'tag-filter',
165  ];
166 
167  // Filter links
168  if ( $filter ) {
169  $formDescriptor['filters'] = $this->getFiltersDesc( $filter );
170  }
171 
172  // Action filter
173  if (
174  $action !== null &&
175  $this->allowedActions !== null &&
176  count( $this->allowedActions ) > 0
177  ) {
178  $formDescriptor['subtype'] = $this->getActionSelectorDesc( $types, $action );
179  }
180 
181  $context = new DerivativeContext( $this->getContext() );
182  $context->setTitle( SpecialPage::getTitleFor( 'Log' ) ); // Remove subpage
183  $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $context );
184  $htmlForm
185  ->setSubmitText( $this->msg( 'logeventslist-submit' )->text() )
186  ->setMethod( 'get' )
187  ->setWrapperLegendMsg( 'log' );
188 
189  // TODO This will should be removed at some point. See T199495.
190  if ( isset( $extraInputsString ) ) {
191  $htmlForm->addFooterText( Html::rawElement(
192  'div',
193  null,
194  $extraInputsString
195  ) );
196  }
197 
198  $htmlForm->prepareForm()->displayForm( false );
199  }
200 
205  private function getFiltersDesc( $filter ) {
206  $optionsMsg = [];
207  $default = [];
208  foreach ( $filter as $type => $val ) {
209  $optionsMsg["logeventslist-{$type}-log"] = $type;
210 
211  if ( $val === false ) {
212  $default[] = $type;
213  }
214  }
215  return [
216  'class' => HTMLMultiSelectField::class,
217  'label-message' => 'logeventslist-more-filters',
218  'flatlist' => true,
219  'options-messages' => $optionsMsg,
220  'default' => $default,
221  ];
222  }
223 
228  private function getTypeMenuDesc( $queryTypes ) {
229  $queryType = count( $queryTypes ) == 1 ? $queryTypes[0] : '';
230 
231  $typesByName = []; // Temporary array
232  // First pass to load the log names
233  foreach ( LogPage::validTypes() as $type ) {
234  $page = new LogPage( $type );
235  $restriction = $page->getRestriction();
236  if ( $this->getAuthority()->isAllowed( $restriction ) ) {
237  $typesByName[$type] = $page->getName()->text();
238  }
239  }
240 
241  // Second pass to sort by name
242  asort( $typesByName );
243 
244  // Always put "All public logs" on top
245  $public = $typesByName[''];
246  unset( $typesByName[''] );
247  $typesByName = [ '' => $public ] + $typesByName;
248 
249  return [
250  'class' => HTMLSelectField::class,
251  'name' => 'type',
252  'options' => array_flip( $typesByName ),
253  'default' => $queryType,
254  ];
255  }
256 
261  private function getUserInputDesc( $user ) {
262  return [
263  'class' => HTMLUserTextField::class,
264  'label-message' => 'specialloguserlabel',
265  'name' => 'user',
266  'default' => $user,
267  ];
268  }
269 
274  private function getTitleInputDesc( $page ) {
275  return [
276  'class' => HTMLTitleTextField::class,
277  'label-message' => 'speciallogtitlelabel',
278  'name' => 'page',
279  'required' => false
280  ];
281  }
282 
287  private function getTitlePatternDesc( $pattern ) {
288  return [
289  'type' => 'check',
290  'label-message' => 'log-title-wildcard',
291  'name' => 'pattern',
292  ];
293  }
294 
299  private function getExtraInputsDesc( $types ) {
300  if ( count( $types ) == 1 ) {
301  if ( $types[0] == 'suppress' ) {
302  return [
303  'type' => 'text',
304  'label-message' => 'revdelete-offender',
305  'name' => 'offender',
306  ];
307  } else {
308  // Allow extensions to add their own extra inputs
309  // This could be an array or string. See T199495.
310  $input = ''; // Deprecated
311  $formDescriptor = [];
312  $this->hookRunner->onLogEventsListGetExtraInputs( $types[0], $this, $input, $formDescriptor );
313 
314  return empty( $formDescriptor ) ? $input : $formDescriptor;
315  }
316  }
317 
318  return [];
319  }
320 
327  private function getActionSelectorDesc( $types, $action ) {
328  $actionOptions = [];
329  $actionOptions[ 'log-action-filter-all' ] = '';
330 
331  foreach ( $this->allowedActions as $value ) {
332  $msgKey = 'log-action-filter-' . $types[0] . '-' . $value;
333  $actionOptions[ $msgKey ] = $value;
334  }
335 
336  return [
337  'class' => HTMLSelectField::class,
338  'name' => 'subtype',
339  'options-messages' => $actionOptions,
340  'default' => $action,
341  'label' => $this->msg( 'log-action-filter-' . $types[0] )->text(),
342  ];
343  }
344 
351  public function setAllowedActions( $actions ) {
352  $this->allowedActions = $actions;
353  }
354 
358  public function beginLogEventsList() {
359  return "<ul class='mw-logevent-loglines'>\n";
360  }
361 
365  public function endLogEventsList() {
366  return "</ul>\n";
367  }
368 
373  public function logLine( $row ) {
374  $entry = DatabaseLogEntry::newFromRow( $row );
375  $formatter = LogFormatter::newFromEntry( $entry );
376  $formatter->setContext( $this->getContext() );
377  $formatter->setLinkRenderer( $this->getLinkRenderer() );
378  $formatter->setShowUserToolLinks( !( $this->flags & self::NO_EXTRA_USER_LINKS ) );
379 
380  $time = $this->getLanguage()->userTimeAndDate(
381  $entry->getTimestamp(),
382  $this->getUser()
383  );
384  // Link the time text to the specific log entry, see T207562
385  $timeLink = $this->getLinkRenderer()->makeKnownLink(
387  $time,
388  [],
389  [ 'logid' => $entry->getId() ]
390  );
391 
392  $action = $formatter->getActionText();
393 
394  if ( $this->flags & self::NO_ACTION_LINK ) {
395  $revert = '';
396  } else {
397  $revert = $formatter->getActionLinks();
398  if ( $revert != '' ) {
399  $revert = '<span class="mw-logevent-actionlink">' . $revert . '</span>';
400  }
401  }
402 
403  $comment = $formatter->getComment();
404 
405  // Some user can hide log items and have review links
406  $del = $this->getShowHideLinks( $row );
407 
408  // Any tags...
409  list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow(
410  $row->ts_tags,
411  'logevent',
412  $this->getContext()
413  );
414  $classes = array_merge(
415  [ 'mw-logline-' . $entry->getType() ],
416  $newClasses
417  );
418  $attribs = [
419  'data-mw-logid' => $entry->getId(),
420  'data-mw-logaction' => $entry->getFullType(),
421  ];
422  $ret = "$del $timeLink $action $comment $revert $tagDisplay";
423 
424  // Let extensions add data
425  $this->hookRunner->onLogEventsListLineEnding( $this, $ret, $entry, $classes, $attribs );
426  $attribs = array_filter( $attribs,
427  [ Sanitizer::class, 'isReservedDataAttribute' ],
428  ARRAY_FILTER_USE_KEY
429  );
430  $attribs['class'] = $classes;
431 
432  return Html::rawElement( 'li', $attribs, $ret ) . "\n";
433  }
434 
439  private function getShowHideLinks( $row ) {
440  // We don't want to see the links and
441  if ( $this->flags == self::NO_ACTION_LINK ) {
442  return '';
443  }
444 
445  $user = $this->getUser();
446 
447  // If change tag editing is available to this user, return the checkbox
448  if ( $this->flags & self::USE_CHECKBOXES && $this->showTagEditUI ) {
449  return Xml::check(
450  'showhiderevisions',
451  false,
452  [ 'name' => 'ids[' . $row->log_id . ']' ]
453  );
454  }
455 
456  // no one can hide items from the suppress log.
457  if ( $row->log_type == 'suppress' ) {
458  return '';
459  }
460 
461  $del = '';
462  // Don't show useless checkbox to people who cannot hide log entries
463  if ( $this->getAuthority()->isAllowed( 'deletedhistory' ) ) {
464  $canHide = $this->getAuthority()->isAllowed( 'deletelogentry' );
465  $canViewSuppressedOnly = $this->getAuthority()->isAllowed( 'viewsuppressed' ) &&
466  !$this->getAuthority()->isAllowed( 'suppressrevision' );
467  $entryIsSuppressed = self::isDeleted( $row, LogPage::DELETED_RESTRICTED );
468  $canViewThisSuppressedEntry = $canViewSuppressedOnly && $entryIsSuppressed;
469  if ( $row->log_deleted || $canHide ) {
470  // Show checkboxes instead of links.
471  if ( $canHide && $this->flags & self::USE_CHECKBOXES && !$canViewThisSuppressedEntry ) {
472  // If event was hidden from sysops
473  if ( !self::userCan( $row, LogPage::DELETED_RESTRICTED, $user ) ) {
474  $del = Xml::check( 'deleterevisions', false, [ 'disabled' => 'disabled' ] );
475  } else {
476  $del = Xml::check(
477  'showhiderevisions',
478  false,
479  [ 'name' => 'ids[' . $row->log_id . ']' ]
480  );
481  }
482  } else {
483  // If event was hidden from sysops
484  if ( !self::userCan( $row, LogPage::DELETED_RESTRICTED, $user ) ) {
485  $del = Linker::revDeleteLinkDisabled( $canHide );
486  } else {
487  $query = [
488  'target' => SpecialPage::getTitleFor( 'Log', $row->log_type )->getPrefixedDBkey(),
489  'type' => 'logging',
490  'ids' => $row->log_id,
491  ];
492  $del = Linker::revDeleteLink(
493  $query,
494  $entryIsSuppressed,
495  $canHide && !$canViewThisSuppressedEntry
496  );
497  }
498  }
499  }
500  }
501 
502  return $del;
503  }
504 
511  public static function typeAction( $row, $type, $action ) {
512  $match = is_array( $type ) ?
513  in_array( $row->log_type, $type ) : $row->log_type == $type;
514  if ( $match ) {
515  $match = is_array( $action ) ?
516  in_array( $row->log_action, $action ) : $row->log_action == $action;
517  }
518 
519  return $match;
520  }
521 
531  public static function userCan( $row, $field, Authority $performer ) {
532  return self::userCanBitfield( $row->log_deleted, $field, $performer ) &&
533  self::userCanViewLogType( $row->log_type, $performer );
534  }
535 
545  public static function userCanBitfield( $bitfield, $field, Authority $performer ) {
546  if ( $bitfield & $field ) {
547  if ( $bitfield & LogPage::DELETED_RESTRICTED ) {
548  return $performer->isAllowedAny( 'suppressrevision', 'viewsuppressed' );
549  } else {
550  return $performer->isAllowed( 'deletedhistory' );
551  }
552  }
553  return true;
554  }
555 
564  public static function userCanViewLogType( $type, Authority $performer ) {
565  $logRestrictions = MediaWikiServices::getInstance()->getMainConfig()->get( 'LogRestrictions' );
566  if ( isset( $logRestrictions[$type] ) && !$performer->isAllowed( $logRestrictions[$type] )
567  ) {
568  return false;
569  }
570  return true;
571  }
572 
578  public static function isDeleted( $row, $field ) {
579  return ( $row->log_deleted & $field ) == $field;
580  }
581 
607  public static function showLogExtract(
608  &$out, $types = [], $page = '', $user = '', $param = []
609  ) {
610  $defaultParameters = [
611  'lim' => 25,
612  'conds' => [],
613  'showIfEmpty' => true,
614  'msgKey' => [ '' ],
615  'wrap' => "$1",
616  'flags' => 0,
617  'useRequestParams' => false,
618  'useMaster' => false,
619  'extraUrlParams' => false,
620  ];
621  # The + operator appends elements of remaining keys from the right
622  # handed array to the left handed, whereas duplicated keys are NOT overwritten.
623  $param += $defaultParameters;
624  # Convert $param array to individual variables
625  $lim = $param['lim'];
626  $conds = $param['conds'];
627  $showIfEmpty = $param['showIfEmpty'];
628  $msgKey = $param['msgKey'];
629  $wrap = $param['wrap'];
630  $flags = $param['flags'];
631  $extraUrlParams = $param['extraUrlParams'];
632 
633  $useRequestParams = $param['useRequestParams'];
634  // @phan-suppress-next-line PhanRedundantCondition
635  if ( !is_array( $msgKey ) ) {
636  $msgKey = [ $msgKey ];
637  }
638 
639  if ( $out instanceof OutputPage ) {
640  $context = $out->getContext();
641  } else {
643  }
644 
645  $services = MediaWikiServices::getInstance();
646  // FIXME: Figure out how to inject this
647  $linkRenderer = $services->getLinkRenderer();
648 
649  # Insert list of top 50 (or top $lim) items
650  $loglist = new LogEventsList( $context, $linkRenderer, $flags );
651  $pager = new LogPager(
652  $loglist,
653  $types,
654  $user,
655  $page,
656  '',
657  $conds,
658  false,
659  false,
660  false,
661  '',
662  '',
663  0,
664  $services->getLinkBatchFactory(),
665  $services->getDBLoadBalancer(),
666  $services->getActorNormalization()
667  );
668  if ( !$useRequestParams ) {
669  # Reset vars that may have been taken from the request
670  $pager->mLimit = 50;
671  $pager->mDefaultLimit = 50;
672  $pager->mOffset = "";
673  $pager->mIsBackwards = false;
674  }
675 
676  if ( $param['useMaster'] ) {
677  $pager->mDb = wfGetDB( DB_PRIMARY );
678  }
679  if ( isset( $param['offset'] ) ) { # Tell pager to ignore WebRequest offset
680  $pager->setOffset( $param['offset'] );
681  }
682 
683  // @phan-suppress-next-line PhanSuspiciousValueComparison
684  if ( $lim > 0 ) {
685  $pager->mLimit = $lim;
686  }
687  // Fetch the log rows and build the HTML if needed
688  $logBody = $pager->getBody();
689  $numRows = $pager->getNumRows();
690 
691  $s = '';
692 
693  if ( $logBody ) {
694  if ( $msgKey[0] ) {
695  $dir = $context->getLanguage()->getDir();
696  $lang = $context->getLanguage()->getHtmlCode();
697 
698  $s = Xml::openElement( 'div', [
699  'class' => "warningbox mw-warning-with-logexcerpt mw-content-$dir",
700  'dir' => $dir,
701  'lang' => $lang,
702  ] );
703 
704  // @phan-suppress-next-line PhanSuspiciousValueComparison
705  if ( count( $msgKey ) == 1 ) {
706  $s .= $context->msg( $msgKey[0] )->parseAsBlock();
707  } else { // Process additional arguments
708  $args = $msgKey;
709  array_shift( $args );
710  $s .= $context->msg( $msgKey[0], $args )->parseAsBlock();
711  }
712  }
713  $s .= $loglist->beginLogEventsList() .
714  $logBody .
715  $loglist->endLogEventsList();
716  // add styles for change tags
717  $context->getOutput()->addModuleStyles( 'mediawiki.interface.helpers.styles' );
718  } elseif ( $showIfEmpty ) {
719  $s = Html::rawElement( 'div', [ 'class' => 'mw-warning-logempty' ],
720  $context->msg( 'logempty' )->parse() );
721  }
722 
723  if ( $page instanceof PageReference ) {
724  $titleFormatter = MediaWikiServices::getInstance()->getTitleFormatter();
725  $pageName = $titleFormatter->getPrefixedDBkey( $page );
726  } elseif ( $page != '' ) {
727  $pageName = $page;
728  } else {
729  $pageName = null;
730  }
731 
732  if ( $numRows > $pager->mLimit ) { # Show "Full log" link
733  $urlParam = [];
734  if ( $pageName ) {
735  $urlParam['page'] = $pageName;
736  }
737 
738  if ( $user != '' ) {
739  $urlParam['user'] = $user;
740  }
741 
742  if ( !is_array( $types ) ) { # Make it an array, if it isn't
743  $types = [ $types ];
744  }
745 
746  # If there is exactly one log type, we can link to Special:Log?type=foo
747  if ( count( $types ) == 1 ) {
748  $urlParam['type'] = $types[0];
749  }
750 
751  // @phan-suppress-next-line PhanSuspiciousValueComparison
752  if ( $extraUrlParams !== false ) {
753  $urlParam = array_merge( $urlParam, $extraUrlParams );
754  }
755 
756  $s .= $linkRenderer->makeKnownLink(
757  SpecialPage::getTitleFor( 'Log' ),
758  $context->msg( 'log-fulllog' )->text(),
759  [],
760  $urlParam
761  );
762  }
763 
764  if ( $logBody && $msgKey[0] ) {
765  $s .= '</div>';
766  }
767 
768  // @phan-suppress-next-line PhanSuspiciousValueComparison
769  if ( $wrap != '' ) { // Wrap message in html
770  $s = str_replace( '$1', $s, $wrap );
771  }
772 
773  /* hook can return false, if we don't want the message to be emitted (Wikia BugId:7093) */
774  if ( Hooks::runner()->onLogEventsListShowLogExtract( $s, $types, $pageName, $user, $param ) ) {
775  // $out can be either an OutputPage object or a String-by-reference
776  if ( $out instanceof OutputPage ) {
777  $out->addHTML( $s );
778  } else {
779  $out = $s;
780  }
781  }
782 
783  return $numRows;
784  }
785 
795  public static function getExcludeClause( $db, $audience = 'public', Authority $performer = null ) {
796  global $wgLogRestrictions;
797 
798  if ( $audience != 'public' && $performer === null ) {
799  throw new InvalidArgumentException(
800  'A User object must be given when checking for a user audience.'
801  );
802  }
803 
804  // Reset the array, clears extra "where" clauses when $par is used
805  $hiddenLogs = [];
806 
807  // Don't show private logs to unprivileged users
808  foreach ( $wgLogRestrictions as $logType => $right ) {
809  if ( $audience == 'public' || !$performer->isAllowed( $right )
810  ) {
811  $hiddenLogs[] = $logType;
812  }
813  }
814  if ( count( $hiddenLogs ) == 1 ) {
815  return 'log_type != ' . $db->addQuotes( $hiddenLogs[0] );
816  } elseif ( $hiddenLogs ) {
817  return 'log_type NOT IN (' . $db->makeList( $hiddenLogs ) . ')';
818  }
819 
820  return false;
821  }
822 }
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:206
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:180
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:37
MediaWiki\Linker\LinkRenderer
Class that generates HTML links for pages.
Definition: LinkRenderer.php:43
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:545
LogEventsList\$showTagEditUI
bool $showTagEditUI
Definition: LogEventsList.php:43
LogPager
Definition: LogPager.php:35
LogEventsList\userCan
static userCan( $row, $field, Authority $performer)
Determine if the current user is allowed to view a particular field of this log row,...
Definition: LogEventsList.php:531
LogEventsList\getTitlePatternDesc
getTitlePatternDesc( $pattern)
Definition: LogEventsList.php:287
LogEventsList\getExcludeClause
static getExcludeClause( $db, $audience='public', Authority $performer=null)
SQL clause to skip forbidden log types for this user.
Definition: LogEventsList.php:795
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
ContextSource\getUser
getUser()
Definition: ContextSource.php:135
Xml\openElement
static openElement( $element, $attribs=null)
This opens an XML element.
Definition: Xml.php:110
Page\PageReference
Interface for objects (potentially) representing a page that can be viewable and linked to on a wiki.
Definition: PageReference.php:49
LogEventsList\USE_CHECKBOXES
const USE_CHECKBOXES
Definition: LogEventsList.php:36
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:152
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:72
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:96
LogEventsList\setAllowedActions
setAllowedActions( $actions)
Sets the action types allowed for log filtering To one action type may correspond several log_actions...
Definition: LogEventsList.php:351
LogEventsList\typeAction
static typeAction( $row, $type, $action)
Definition: LogEventsList.php:511
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition: GlobalFunctions.php:996
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:327
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2306
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:38
$args
if( $line===false) $args
Definition: mcc.php:124
LogEventsList\logLine
logLine( $row)
Definition: LogEventsList.php:373
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:116
Linker\revDeleteLinkDisabled
static revDeleteLinkDisabled( $delete=true)
Creates a dead (show/hide) link for deleting revisions/log entries.
Definition: Linker.php:2271
LogEventsList\showLogExtract
static showLogExtract(&$out, $types=[], $page='', $user='', $param=[])
Show log extract.
Definition: LogEventsList.php:607
ContextSource\setContext
setContext(IContextSource $context)
Definition: ContextSource.php:62
LogEventsList
Definition: LogEventsList.php:33
OutputPage
This is one of the Core classes and should be read at least once by any new developers.
Definition: OutputPage.php:52
MediaWiki\Permissions\Authority
This interface represents the authority associated the current execution context, such as a web reque...
Definition: Authority.php:35
ContextSource\msg
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
Definition: ContextSource.php:196
$s
foreach( $mmfl['setupFiles'] as $fileName) if( $queue) if(empty( $mmfl['quiet'])) $s
Definition: mergeMessageFileList.php:206
$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:8879
ContextSource\getAuthority
getAuthority()
Definition: ContextSource.php:143
DB_PRIMARY
const DB_PRIMARY
Definition: defines.php:27
Hooks\runner
static runner()
Get a HookRunner instance for calling hooks using the new interfaces.
Definition: Hooks.php:172
LogEventsList\$linkRenderer
LinkRenderer null $linkRenderer
Definition: LogEventsList.php:53
LogEventsList\getShowHideLinks
getShowHideLinks( $row)
Definition: LogEventsList.php:439
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:564
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:483
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
MediaWiki\Permissions\Authority\isAllowed
isAllowed(string $permission)
Checks whether this authority has the given permission in general.
LogEventsList\$flags
$flags
Definition: LogEventsList.php:38
LogEventsList\getTitleInputDesc
getTitleInputDesc( $page)
Definition: LogEventsList.php:274
LogEventsList\isDeleted
static isDeleted( $row, $field)
Definition: LogEventsList.php:578
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:2247
LogEventsList\getTypeMenuDesc
getTypeMenuDesc( $queryTypes)
Definition: LogEventsList.php:228
LogPage\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: LogPage.php:42
LogEventsList\NO_ACTION_LINK
const NO_ACTION_LINK
Definition: LogEventsList.php:34
LogEventsList\endLogEventsList
endLogEventsList()
Definition: LogEventsList.php:365
MediaWiki\HookContainer\HookRunner
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
Definition: HookRunner.php:558
LogEventsList\NO_EXTRA_USER_LINKS
const NO_EXTRA_USER_LINKS
Definition: LogEventsList.php:35
LogEventsList\$allowedActions
array $allowedActions
Definition: LogEventsList.php:48
LogEventsList\getUserInputDesc
getUserInputDesc( $user)
Definition: LogEventsList.php:261
LogEventsList\getLinkRenderer
getLinkRenderer()
Definition: LogEventsList.php:92
LogEventsList\getFiltersDesc
getFiltersDesc( $filter)
Definition: LogEventsList.php:205
LogEventsList\beginLogEventsList
beginLogEventsList()
Definition: LogEventsList.php:358
ChangeTags\showTagEditingUI
static showTagEditingUI(Authority $performer)
Indicate whether change tag editing UI is relevant.
Definition: ChangeTags.php:1713
IContextSource\getOutput
getOutput()
HTMLForm\factory
static factory( $displayFormat,... $arguments)
Construct a HTMLForm object for given display type.
Definition: HTMLForm.php:326
ChangeTags\formatSummaryRow
static formatSummaryRow( $tags, $page, IContextSource $context=null)
Creates HTML for the given tags.
Definition: ChangeTags.php:194
LogEventsList\getExtraInputsDesc
getExtraInputsDesc( $types)
Definition: LogEventsList.php:299
IContextSource\getLanguage
getLanguage()
LogEventsList\$hookRunner
HookRunner $hookRunner
Definition: LogEventsList.php:56
LogFormatter\newFromEntry
static newFromEntry(LogEntry $entry)
Constructs a new formatter suitable for given entry.
Definition: LogFormatter.php:54
$type
$type
Definition: testCompression.php:52