MediaWiki  master
LogEventsList.php
Go to the documentation of this file.
1 <?php
30 
32  public const NO_ACTION_LINK = 1;
33  public const NO_EXTRA_USER_LINKS = 2;
34  public const USE_CHECKBOXES = 4;
35 
36  public $flags;
37 
42  protected $mDefaultQuery;
43 
47  protected $showTagEditUI;
48 
52  protected $allowedActions = null;
53 
57  private $linkRenderer;
58 
60  private $hookRunner;
61 
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->getUser() );
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-raw' => $this->msg( 'tag-filter' )->parse(),
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  $options = [];
207  $default = [];
208  foreach ( $filter as $type => $val ) {
209  $message = $this->msg( "logeventslist-{$type}-log" );
210  // FIXME: Remove this check once T199657 is fully resolved.
211  if ( !$message->exists() ) {
212  $message = $this->msg( "log-show-hide-{$type}" )->params( $this->msg( 'show' )->text() );
213  }
214  $options[ $message->text() ] = $type;
215 
216  if ( $val === false ) {
217  $default[] = $type;
218  }
219  }
220  return [
221  'class' => 'HTMLMultiSelectField',
222  'label-message' => 'logeventslist-more-filters',
223  'flatlist' => true,
224  'options' => $options,
225  'default' => $default,
226  ];
227  }
228 
233  private function getTypeMenuDesc( $queryTypes ) {
234  $queryType = count( $queryTypes ) == 1 ? $queryTypes[0] : '';
235 
236  $typesByName = []; // Temporary array
237  // First pass to load the log names
238  foreach ( LogPage::validTypes() as $type ) {
239  $page = new LogPage( $type );
240  $restriction = $page->getRestriction();
241  if ( MediaWikiServices::getInstance()
243  ->userHasRight( $this->getUser(), $restriction )
244  ) {
245  $typesByName[$type] = $page->getName()->text();
246  }
247  }
248 
249  // Second pass to sort by name
250  asort( $typesByName );
251 
252  // Always put "All public logs" on top
253  $public = $typesByName[''];
254  unset( $typesByName[''] );
255  $typesByName = [ '' => $public ] + $typesByName;
256 
257  return [
258  'class' => 'HTMLSelectField',
259  'name' => 'type',
260  'options' => array_flip( $typesByName ),
261  'default' => $queryType,
262  ];
263  }
264 
269  private function getUserInputDesc( $user ) {
270  return [
271  'class' => 'HTMLUserTextField',
272  'label-message' => 'specialloguserlabel',
273  'name' => 'user',
274  'default' => $user,
275  ];
276  }
277 
282  private function getTitleInputDesc( $title ) {
283  return [
284  'class' => 'HTMLTitleTextField',
285  'label-message' => 'speciallogtitlelabel',
286  'name' => 'page',
287  'required' => false
288  ];
289  }
290 
295  private function getTitlePatternDesc( $pattern ) {
296  return [
297  'type' => 'check',
298  'label-message' => 'log-title-wildcard',
299  'name' => 'pattern',
300  ];
301  }
302 
307  private function getExtraInputsDesc( $types ) {
308  if ( count( $types ) == 1 ) {
309  if ( $types[0] == 'suppress' ) {
310  return [
311  'type' => 'text',
312  'label-message' => 'revdelete-offender',
313  'name' => 'offender',
314  ];
315  } else {
316  // Allow extensions to add their own extra inputs
317  // This could be an array or string. See T199495.
318  $input = ''; // Deprecated
319  $formDescriptor = [];
320  $this->hookRunner->onLogEventsListGetExtraInputs( $types[0], $this, $input, $formDescriptor );
321 
322  return empty( $formDescriptor ) ? $input : $formDescriptor;
323  }
324  }
325 
326  return [];
327  }
328 
335  private function getActionSelectorDesc( $types, $action ) {
336  $actionOptions = [];
337  $actionOptions[ 'log-action-filter-all' ] = '';
338 
339  foreach ( $this->allowedActions as $value ) {
340  $msgKey = 'log-action-filter-' . $types[0] . '-' . $value;
341  $actionOptions[ $msgKey ] = $value;
342  }
343 
344  return [
345  'class' => 'HTMLSelectField',
346  'name' => 'subtype',
347  'options-messages' => $actionOptions,
348  'default' => $action,
349  'label' => $this->msg( 'log-action-filter-' . $types[0] )->text(),
350  ];
351  }
352 
359  public function setAllowedActions( $actions ) {
360  $this->allowedActions = $actions;
361  }
362 
366  public function beginLogEventsList() {
367  return "<ul>\n";
368  }
369 
373  public function endLogEventsList() {
374  return "</ul>\n";
375  }
376 
381  public function logLine( $row ) {
382  $entry = DatabaseLogEntry::newFromRow( $row );
383  $formatter = LogFormatter::newFromEntry( $entry );
384  $formatter->setContext( $this->getContext() );
385  $formatter->setLinkRenderer( $this->getLinkRenderer() );
386  $formatter->setShowUserToolLinks( !( $this->flags & self::NO_EXTRA_USER_LINKS ) );
387 
388  $time = htmlspecialchars( $this->getLanguage()->userTimeAndDate(
389  $entry->getTimestamp(), $this->getUser() ) );
390 
391  $action = $formatter->getActionText();
392 
393  if ( $this->flags & self::NO_ACTION_LINK ) {
394  $revert = '';
395  } else {
396  $revert = $formatter->getActionLinks();
397  if ( $revert != '' ) {
398  $revert = '<span class="mw-logevent-actionlink">' . $revert . '</span>';
399  }
400  }
401 
402  $comment = $formatter->getComment();
403 
404  // Some user can hide log items and have review links
405  $del = $this->getShowHideLinks( $row );
406 
407  // Any tags...
408  list( $tagDisplay, $newClasses ) = ChangeTags::formatSummaryRow(
409  $row->ts_tags,
410  'logevent',
411  $this->getContext()
412  );
413  $classes = array_merge(
414  [ 'mw-logline-' . $entry->getType() ],
415  $newClasses
416  );
417  $attribs = [
418  'data-mw-logid' => $entry->getId(),
419  'data-mw-logaction' => $entry->getFullType(),
420  ];
421  $ret = "$del $time $action $comment $revert $tagDisplay";
422 
423  // Let extensions add data
424  $this->hookRunner->onLogEventsListLineEnding( $this, $ret, $entry, $classes, $attribs );
425  $attribs = array_filter( $attribs,
426  [ Sanitizer::class, 'isReservedDataAttribute' ],
427  ARRAY_FILTER_USE_KEY
428  );
429  $attribs['class'] = implode( ' ', $classes );
430 
431  return Html::rawElement( 'li', $attribs, $ret ) . "\n";
432  }
433 
438  private function getShowHideLinks( $row ) {
439  // We don't want to see the links and
440  if ( $this->flags == self::NO_ACTION_LINK ) {
441  return '';
442  }
443 
444  $user = $this->getUser();
445 
446  // If change tag editing is available to this user, return the checkbox
447  if ( $this->flags & self::USE_CHECKBOXES && $this->showTagEditUI ) {
448  return Xml::check(
449  'showhiderevisions',
450  false,
451  [ 'name' => 'ids[' . $row->log_id . ']' ]
452  );
453  }
454 
455  // no one can hide items from the suppress log.
456  if ( $row->log_type == 'suppress' ) {
457  return '';
458  }
459 
460  $del = '';
461  $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
462  // Don't show useless checkbox to people who cannot hide log entries
463  if ( $permissionManager->userHasRight( $user, 'deletedhistory' ) ) {
464  $canHide = $permissionManager->userHasRight( $user, 'deletelogentry' );
465  $canViewSuppressedOnly = $permissionManager->userHasRight( $user, 'viewsuppressed' ) &&
466  !$permissionManager->userHasRight( $user, '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 
512  public static function typeAction( $row, $type, $action, $right = '' ) {
513  if ( $right !== '' ) {
514  wfDeprecated( __METHOD__ . ' with a right specified', '1.35' );
515  }
516  $match = is_array( $type ) ?
517  in_array( $row->log_type, $type ) : $row->log_type == $type;
518  if ( $match ) {
519  $match = is_array( $action ) ?
520  in_array( $row->log_action, $action ) : $row->log_action == $action;
521  if ( $match && $right ) {
522  global $wgUser;
523  $match = MediaWikiServices::getInstance()
524  ->getPermissionManager()
525  ->userHasRight( $wgUser, $right );
526  }
527  }
528 
529  return $match;
530  }
531 
541  public static function userCan( $row, $field, User $user = null ) {
542  if ( !$user ) {
543  wfDeprecated( __METHOD__ . ' without passing a $user parameter', '1.35' );
544  global $wgUser;
545  $user = $wgUser;
546  }
547  return self::userCanBitfield( $row->log_deleted, $field, $user ) &&
548  self::userCanViewLogType( $row->log_type, $user );
549  }
550 
560  public static function userCanBitfield( $bitfield, $field, User $user = null ) {
561  if ( $bitfield & $field ) {
562  if ( $user === null ) {
563  wfDeprecated( __METHOD__ . ' without passing a $user parameter', '1.35' );
564  global $wgUser;
565  $user = $wgUser;
566  }
567  if ( $bitfield & LogPage::DELETED_RESTRICTED ) {
568  $permissions = [ 'suppressrevision', 'viewsuppressed' ];
569  } else {
570  $permissions = [ 'deletedhistory' ];
571  }
572  $permissionlist = implode( ', ', $permissions );
573  wfDebug( "Checking for $permissionlist due to $field match on $bitfield" );
574  return MediaWikiServices::getInstance()
575  ->getPermissionManager()
576  ->userHasAnyRight( $user, ...$permissions );
577  }
578  return true;
579  }
580 
589  public static function userCanViewLogType( $type, User $user = null ) {
590  if ( $user === null ) {
591  wfDeprecated( __METHOD__ . ' without passing a $user parameter', '1.35' );
592  global $wgUser;
593  $user = $wgUser;
594  }
595  $logRestrictions = MediaWikiServices::getInstance()->getMainConfig()->get( 'LogRestrictions' );
596  if ( isset( $logRestrictions[$type] ) && !MediaWikiServices::getInstance()
598  ->userHasRight( $user, $logRestrictions[$type] )
599  ) {
600  return false;
601  }
602  return true;
603  }
604 
610  public static function isDeleted( $row, $field ) {
611  return ( $row->log_deleted & $field ) == $field;
612  }
613 
639  public static function showLogExtract(
640  &$out, $types = [], $page = '', $user = '', $param = []
641  ) {
642  $defaultParameters = [
643  'lim' => 25,
644  'conds' => [],
645  'showIfEmpty' => true,
646  'msgKey' => [ '' ],
647  'wrap' => "$1",
648  'flags' => 0,
649  'useRequestParams' => false,
650  'useMaster' => false,
651  'extraUrlParams' => false,
652  ];
653  # The + operator appends elements of remaining keys from the right
654  # handed array to the left handed, whereas duplicated keys are NOT overwritten.
655  $param += $defaultParameters;
656  # Convert $param array to individual variables
657  $lim = $param['lim'];
658  $conds = $param['conds'];
659  $showIfEmpty = $param['showIfEmpty'];
660  $msgKey = $param['msgKey'];
661  $wrap = $param['wrap'];
662  $flags = $param['flags'];
663  $extraUrlParams = $param['extraUrlParams'];
664 
665  $useRequestParams = $param['useRequestParams'];
666  // @phan-suppress-next-line PhanRedundantCondition
667  if ( !is_array( $msgKey ) ) {
668  $msgKey = [ $msgKey ];
669  }
670 
671  if ( $out instanceof OutputPage ) {
672  $context = $out->getContext();
673  } else {
675  }
676 
677  // FIXME: Figure out how to inject this
678  $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
679 
680  # Insert list of top 50 (or top $lim) items
681  $loglist = new LogEventsList( $context, $linkRenderer, $flags );
682  $pager = new LogPager( $loglist, $types, $user, $page, '', $conds );
683  if ( !$useRequestParams ) {
684  # Reset vars that may have been taken from the request
685  $pager->mLimit = 50;
686  $pager->mDefaultLimit = 50;
687  $pager->mOffset = "";
688  $pager->mIsBackwards = false;
689  }
690 
691  if ( $param['useMaster'] ) {
692  $pager->mDb = wfGetDB( DB_MASTER );
693  }
694  if ( isset( $param['offset'] ) ) { # Tell pager to ignore WebRequest offset
695  $pager->setOffset( $param['offset'] );
696  }
697 
698  // @phan-suppress-next-line PhanSuspiciousValueComparison
699  if ( $lim > 0 ) {
700  $pager->mLimit = $lim;
701  }
702  // Fetch the log rows and build the HTML if needed
703  $logBody = $pager->getBody();
704  $numRows = $pager->getNumRows();
705 
706  $s = '';
707 
708  if ( $logBody ) {
709  if ( $msgKey[0] ) {
710  $dir = $context->getLanguage()->getDir();
711  $lang = $context->getLanguage()->getHtmlCode();
712 
713  $s = Xml::openElement( 'div', [
714  'class' => "warningbox mw-warning-with-logexcerpt mw-content-$dir",
715  'dir' => $dir,
716  'lang' => $lang,
717  ] );
718 
719  // @phan-suppress-next-line PhanSuspiciousValueComparison
720  if ( count( $msgKey ) == 1 ) {
721  $s .= $context->msg( $msgKey[0] )->parseAsBlock();
722  } else { // Process additional arguments
723  $args = $msgKey;
724  array_shift( $args );
725  $s .= $context->msg( $msgKey[0], $args )->parseAsBlock();
726  }
727  }
728  $s .= $loglist->beginLogEventsList() .
729  $logBody .
730  $loglist->endLogEventsList();
731  // add styles for change tags
732  $context->getOutput()->addModuleStyles( 'mediawiki.interface.helpers.styles' );
733  } elseif ( $showIfEmpty ) {
734  $s = Html::rawElement( 'div', [ 'class' => 'mw-warning-logempty' ],
735  $context->msg( 'logempty' )->parse() );
736  }
737 
738  if ( $numRows > $pager->mLimit ) { # Show "Full log" link
739  $urlParam = [];
740  if ( $page instanceof Title ) {
741  $urlParam['page'] = $page->getPrefixedDBkey();
742  } elseif ( $page != '' ) {
743  $urlParam['page'] = $page;
744  }
745 
746  if ( $user != '' ) {
747  $urlParam['user'] = $user;
748  }
749 
750  if ( !is_array( $types ) ) { # Make it an array, if it isn't
751  $types = [ $types ];
752  }
753 
754  # If there is exactly one log type, we can link to Special:Log?type=foo
755  if ( count( $types ) == 1 ) {
756  $urlParam['type'] = $types[0];
757  }
758 
759  // @phan-suppress-next-line PhanSuspiciousValueComparison
760  if ( $extraUrlParams !== false ) {
761  $urlParam = array_merge( $urlParam, $extraUrlParams );
762  }
763 
764  $s .= $linkRenderer->makeKnownLink(
765  SpecialPage::getTitleFor( 'Log' ),
766  $context->msg( 'log-fulllog' )->text(),
767  [],
768  $urlParam
769  );
770  }
771 
772  if ( $logBody && $msgKey[0] ) {
773  $s .= '</div>';
774  }
775 
776  // @phan-suppress-next-line PhanSuspiciousValueComparison
777  if ( $wrap != '' ) { // Wrap message in html
778  $s = str_replace( '$1', $s, $wrap );
779  }
780 
781  /* hook can return false, if we don't want the message to be emitted (Wikia BugId:7093) */
782  if ( Hooks::runner()->onLogEventsListShowLogExtract( $s, $types, $page, $user, $param ) ) {
783  // $out can be either an OutputPage object or a String-by-reference
784  if ( $out instanceof OutputPage ) {
785  $out->addHTML( $s );
786  } else {
787  $out = $s;
788  }
789  }
790 
791  return $numRows;
792  }
793 
802  public static function getExcludeClause( $db, $audience = 'public', User $user = null ) {
803  global $wgLogRestrictions;
804 
805  if ( $audience != 'public' && $user === null ) {
806  wfDeprecated(
807  __METHOD__ .
808  ' using a non-public audience without passing a $user parameter',
809  '1.35'
810  );
811  global $wgUser;
812  $user = $wgUser;
813  }
814 
815  // Reset the array, clears extra "where" clauses when $par is used
816  $hiddenLogs = [];
817 
818  // Don't show private logs to unprivileged users
819  foreach ( $wgLogRestrictions as $logType => $right ) {
820  if ( $audience == 'public' || !MediaWikiServices::getInstance()
822  ->userHasRight( $user, $right )
823  ) {
824  $hiddenLogs[] = $logType;
825  }
826  }
827  if ( count( $hiddenLogs ) == 1 ) {
828  return 'log_type != ' . $db->addQuotes( $hiddenLogs[0] );
829  } elseif ( $hiddenLogs ) {
830  return 'log_type NOT IN (' . $db->makeList( $hiddenLogs ) . ')';
831  }
832 
833  return false;
834  }
835 }
ContextSource\$context
IContextSource $context
Definition: ContextSource.php:33
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:63
ContextSource\getContext
getContext()
Get the base IContextSource object.
Definition: ContextSource.php:40
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:152
$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\$showTagEditUI
bool $showTagEditUI
Definition: LogEventsList.php:47
LogPager
Definition: LogPager.php:31
LogEventsList\userCanViewLogType
static userCanViewLogType( $type, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
Definition: LogEventsList.php:589
LogEventsList\getTitlePatternDesc
getTitlePatternDesc( $pattern)
Definition: LogEventsList.php:295
$s
$s
Definition: mergeMessageFileList.php:185
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:90
ChangeTags\showTagEditingUI
static showTagEditingUI(User $user)
Indicate whether change tag editing UI is relevant.
Definition: ChangeTags.php:1627
LogEventsList\$mDefaultQuery
array $mDefaultQuery
Definition: LogEventsList.php:42
ContextSource\getUser
getUser()
Definition: ContextSource.php:120
Xml\openElement
static openElement( $element, $attribs=null)
This opens an XML element.
Definition: Xml.php:108
LogEventsList\USE_CHECKBOXES
const USE_CHECKBOXES
Definition: LogEventsList.php:34
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
ContextSource\getLanguage
getLanguage()
Definition: ContextSource.php:128
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:31
DatabaseLogEntry\newFromRow
static newFromRow( $row)
Constructs new LogEntry from database result row.
Definition: DatabaseLogEntry.php:80
LogEventsList\setAllowedActions
setAllowedActions( $actions)
Sets the action types allowed for log filtering To one action type may correspond several log_actions...
Definition: LogEventsList.php:359
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that $function is deprecated.
Definition: GlobalFunctions.php:1026
MessageLocalizer\msg
msg( $key,... $params)
This is the method for getting translated interface messages.
LogEventsList\getActionSelectorDesc
getActionSelectorDesc( $types, $action)
Drop down menu for selection of actions that can be used to filter the log.
Definition: LogEventsList.php:335
getPermissionManager
getPermissionManager()
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2461
ContextSource
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
Definition: ContextSource.php:29
Xml\check
static check( $name, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox.
Definition: Xml.php:327
LogEventsList\typeAction
static typeAction( $row, $type, $action, $right='')
Definition: LogEventsList.php:512
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:381
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:2275
$title
$title
Definition: testCompression.php:38
LogEventsList\showLogExtract
static showLogExtract(&$out, $types=[], $page='', $user='', $param=[])
Show log extract.
Definition: LogEventsList.php:639
DB_MASTER
const DB_MASTER
Definition: defines.php:26
wfDebug
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:909
ContextSource\setContext
setContext(IContextSource $context)
Definition: ContextSource.php:55
LogEventsList
Definition: LogEventsList.php:31
OutputPage
This is one of the Core classes and should be read at least once by any new developers.
Definition: OutputPage.php:47
ContextSource\msg
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
Definition: ContextSource.php:168
$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:8167
Hooks\runner
static runner()
Get a HookRunner instance for calling hooks using the new interfaces.
Definition: Hooks.php:172
LogEventsList\getExcludeClause
static getExcludeClause( $db, $audience='public', User $user=null)
SQL clause to skip forbidden log types for this user.
Definition: LogEventsList.php:802
LogEventsList\getTitleInputDesc
getTitleInputDesc( $title)
Definition: LogEventsList.php:282
LogEventsList\$linkRenderer
LinkRenderer null $linkRenderer
Definition: LogEventsList.php:57
LogEventsList\getShowHideLinks
getShowHideLinks( $row)
Definition: LogEventsList.php:438
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:455
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition: IContextSource.php:55
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:42
LogEventsList\userCanBitfield
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
Definition: LogEventsList.php:560
LogEventsList\$flags
$flags
Definition: LogEventsList.php:36
LogEventsList\userCan
static userCan( $row, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
Definition: LogEventsList.php:541
LogEventsList\isDeleted
static isDeleted( $row, $field)
Definition: LogEventsList.php:610
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:209
Linker\revDeleteLink
static revDeleteLink( $query=[], $restricted=false, $delete=true)
Creates a (show/hide) link for deleting revisions/log entries.
Definition: Linker.php:2253
LogEventsList\getTypeMenuDesc
getTypeMenuDesc( $queryTypes)
Definition: LogEventsList.php:233
LogPage\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: LogPage.php:41
LogEventsList\NO_ACTION_LINK
const NO_ACTION_LINK
Definition: LogEventsList.php:32
LogEventsList\endLogEventsList
endLogEventsList()
Definition: LogEventsList.php:373
MediaWiki\HookContainer\HookRunner
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
Definition: HookRunner.php:571
LogEventsList\NO_EXTRA_USER_LINKS
const NO_EXTRA_USER_LINKS
Definition: LogEventsList.php:33
LogEventsList\$allowedActions
array $allowedActions
Definition: LogEventsList.php:52
LogEventsList\getUserInputDesc
getUserInputDesc( $user)
Definition: LogEventsList.php:269
LogEventsList\getLinkRenderer
getLinkRenderer()
Definition: LogEventsList.php:92
LogEventsList\getFiltersDesc
getFiltersDesc( $filter)
Definition: LogEventsList.php:205
LogEventsList\beginLogEventsList
beginLogEventsList()
Definition: LogEventsList.php:366
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:59
IContextSource\getOutput
getOutput()
HTMLForm\factory
static factory( $displayFormat,... $arguments)
Construct a HTMLForm object for given display type.
Definition: HTMLForm.php:311
ChangeTags\formatSummaryRow
static formatSummaryRow( $tags, $page, IContextSource $context=null)
Creates HTML for the given tags.
Definition: ChangeTags.php:112
LogEventsList\getExtraInputsDesc
getExtraInputsDesc( $types)
Definition: LogEventsList.php:307
IContextSource\getLanguage
getLanguage()
LogEventsList\$hookRunner
HookRunner $hookRunner
Definition: LogEventsList.php:60
LogFormatter\newFromEntry
static newFromEntry(LogEntry $entry)
Constructs a new formatter suitable for given entry.
Definition: LogFormatter.php:50
$type
$type
Definition: testCompression.php:52