MediaWiki  1.23.15
LogFormatter.php
Go to the documentation of this file.
1 <?php
33 class LogFormatter {
34  // Audience options for viewing usernames, comments, and actions
35  const FOR_PUBLIC = 1;
36  const FOR_THIS_USER = 2;
37 
38  // Static->
39 
45  public static function newFromEntry( LogEntry $entry ) {
46  global $wgLogActionsHandlers;
47  $fulltype = $entry->getFullType();
48  $wildcard = $entry->getType() . '/*';
49  $handler = '';
50 
51  if ( isset( $wgLogActionsHandlers[$fulltype] ) ) {
52  $handler = $wgLogActionsHandlers[$fulltype];
53  } elseif ( isset( $wgLogActionsHandlers[$wildcard] ) ) {
54  $handler = $wgLogActionsHandlers[$wildcard];
55  }
56 
57  if ( $handler !== '' && is_string( $handler ) && class_exists( $handler ) ) {
58  return new $handler( $entry );
59  }
60 
61  return new LegacyLogFormatter( $entry );
62  }
63 
71  public static function newFromRow( $row ) {
73  }
74 
75  // Nonstatic->
76 
78  protected $entry;
79 
82 
84  protected $linkFlood = false;
85 
93  protected $plaintext = false;
94 
96  protected $irctext = false;
97 
98  protected function __construct( LogEntry $entry ) {
99  $this->entry = $entry;
100  $this->context = RequestContext::getMain();
101  }
102 
107  public function setContext( IContextSource $context ) {
108  $this->context = $context;
109  }
110 
117  public function setAudience( $audience ) {
118  $this->audience = ( $audience == self::FOR_THIS_USER )
119  ? self::FOR_THIS_USER
120  : self::FOR_PUBLIC;
121  }
122 
128  protected function canView( $field ) {
129  if ( $this->audience == self::FOR_THIS_USER ) {
131  $this->entry->getDeleted(), $field, $this->context->getUser() );
132  } else {
133  return !$this->entry->isDeleted( $field );
134  }
135  }
136 
143  public function setShowUserToolLinks( $value ) {
144  $this->linkFlood = $value;
145  }
146 
154  public function getPlainActionText() {
155  $this->plaintext = true;
156  $text = $this->getActionText();
157  $this->plaintext = false;
158 
159  return $text;
160  }
161 
168  public function getIRCActionComment() {
169  $actionComment = $this->getIRCActionText();
170  $comment = $this->entry->getComment();
171 
172  if ( $comment != '' ) {
173  if ( $actionComment == '' ) {
174  $actionComment = $comment;
175  } else {
176  $actionComment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $comment;
177  }
178  }
179 
180  return $actionComment;
181  }
182 
189  public function getIRCActionText() {
190  $this->plaintext = true;
191  $this->irctext = true;
192 
194  $parameters = $entry->getParameters();
195  // @see LogPage::actionText()
196  // Text of title the action is aimed at.
197  $target = $entry->getTarget()->getPrefixedText();
198  $text = null;
199  switch ( $entry->getType() ) {
200  case 'move':
201  switch ( $entry->getSubtype() ) {
202  case 'move':
203  $movesource = $parameters['4::target'];
204  $text = wfMessage( '1movedto2' )
205  ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
206  break;
207  case 'move_redir':
208  $movesource = $parameters['4::target'];
209  $text = wfMessage( '1movedto2_redir' )
210  ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
211  break;
212  case 'move-noredirect':
213  break;
214  case 'move_redir-noredirect':
215  break;
216  }
217  break;
218 
219  case 'delete':
220  switch ( $entry->getSubtype() ) {
221  case 'delete':
222  $text = wfMessage( 'deletedarticle' )
223  ->rawParams( $target )->inContentLanguage()->escaped();
224  break;
225  case 'restore':
226  $text = wfMessage( 'undeletedarticle' )
227  ->rawParams( $target )->inContentLanguage()->escaped();
228  break;
229  // @codingStandardsIgnoreStart Long line
230  //case 'revision': // Revision deletion
231  //case 'event': // Log deletion
232  // see https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/LogPage.php?&pathrev=97044&r1=97043&r2=97044
233  //default:
234  // @codingStandardsIgnoreEnd
235  }
236  break;
237 
238  case 'patrol':
239  // @codingStandardsIgnoreStart Long line
240  // https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/PatrolLog.php?&pathrev=97495&r1=97494&r2=97495
241  // @codingStandardsIgnoreEnd
242  // Create a diff link to the patrolled revision
243  if ( $entry->getSubtype() === 'patrol' ) {
244  $diffLink = htmlspecialchars(
245  wfMessage( 'patrol-log-diff', $parameters['4::curid'] )
246  ->inContentLanguage()->text() );
247  $text = wfMessage( 'patrol-log-line', $diffLink, "[[$target]]", "" )
248  ->inContentLanguage()->text();
249  } else {
250  // broken??
251  }
252  break;
253 
254  case 'protect':
255  switch ( $entry->getSubtype() ) {
256  case 'protect':
257  $text = wfMessage( 'protectedarticle' )
258  ->rawParams( $target . ' ' . $parameters[0] )->inContentLanguage()->escaped();
259  break;
260  case 'unprotect':
261  $text = wfMessage( 'unprotectedarticle' )
262  ->rawParams( $target )->inContentLanguage()->escaped();
263  break;
264  case 'modify':
265  $text = wfMessage( 'modifiedarticleprotection' )
266  ->rawParams( $target . ' ' . $parameters[0] )->inContentLanguage()->escaped();
267  break;
268  }
269  break;
270 
271  case 'newusers':
272  switch ( $entry->getSubtype() ) {
273  case 'newusers':
274  case 'create':
275  $text = wfMessage( 'newuserlog-create-entry' )
276  ->inContentLanguage()->escaped();
277  break;
278  case 'create2':
279  case 'byemail':
280  $text = wfMessage( 'newuserlog-create2-entry' )
281  ->rawParams( $target )->inContentLanguage()->escaped();
282  break;
283  case 'autocreate':
284  $text = wfMessage( 'newuserlog-autocreate-entry' )
285  ->inContentLanguage()->escaped();
286  break;
287  }
288  break;
289 
290  case 'upload':
291  switch ( $entry->getSubtype() ) {
292  case 'upload':
293  $text = wfMessage( 'uploadedimage' )
294  ->rawParams( $target )->inContentLanguage()->escaped();
295  break;
296  case 'overwrite':
297  $text = wfMessage( 'overwroteimage' )
298  ->rawParams( $target )->inContentLanguage()->escaped();
299  break;
300  }
301  break;
302 
303  case 'rights':
304  if ( count( $parameters['4::oldgroups'] ) ) {
305  $oldgroups = implode( ', ', $parameters['4::oldgroups'] );
306  } else {
307  $oldgroups = wfMessage( 'rightsnone' )->inContentLanguage()->escaped();
308  }
309  if ( count( $parameters['5::newgroups'] ) ) {
310  $newgroups = implode( ', ', $parameters['5::newgroups'] );
311  } else {
312  $newgroups = wfMessage( 'rightsnone' )->inContentLanguage()->escaped();
313  }
314  switch ( $entry->getSubtype() ) {
315  case 'rights':
316  $text = wfMessage( 'rightslogentry' )
317  ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
318  break;
319  case 'autopromote':
320  $text = wfMessage( 'rightslogentry-autopromote' )
321  ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
322  break;
323  }
324  break;
325  // case 'suppress' --private log -- aaron (so we know who to blame in a few years :-D)
326  // default:
327  }
328  if ( is_null( $text ) ) {
329  $text = $this->getPlainActionText();
330  }
331 
332  $this->plaintext = false;
333  $this->irctext = false;
334 
335  return $text;
336  }
337 
342  public function getActionText() {
343  if ( $this->canView( LogPage::DELETED_ACTION ) ) {
344  $element = $this->getActionMessage();
345  if ( $element instanceof Message ) {
346  $element = $this->plaintext ? $element->text() : $element->escaped();
347  }
348  if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) ) {
349  $element = $this->styleRestricedElement( $element );
350  }
351  } else {
352  $performer = $this->getPerformerElement() . $this->msg( 'word-separator' )->text();
353  $element = $performer . $this->getRestrictedElement( 'rev-deleted-event' );
354  }
355 
356  return $element;
357  }
358 
365  protected function getActionMessage() {
366  $message = $this->msg( $this->getMessageKey() );
367  $message->params( $this->getMessageParameters() );
368 
369  return $message;
370  }
371 
379  protected function getMessageKey() {
380  $type = $this->entry->getType();
381  $subtype = $this->entry->getSubtype();
382 
383  return "logentry-$type-$subtype";
384  }
385 
391  public function getActionLinks() {
392  return '';
393  }
394 
400  protected function extractParameters() {
402  $params = array();
403 
404  if ( $entry->isLegacy() ) {
405  foreach ( $entry->getParameters() as $index => $value ) {
406  $params[$index + 3] = $value;
407  }
408  }
409 
410  // Filter out parameters which are not in format #:foo
411  foreach ( $entry->getParameters() as $key => $value ) {
412  if ( strpos( $key, ':' ) === false ) {
413  continue;
414  }
415  list( $index, $type, ) = explode( ':', $key, 3 );
416  $params[$index - 1] = $this->formatParameterValue( $type, $value );
417  }
418 
419  /* Message class doesn't like non consecutive numbering.
420  * Fill in missing indexes with empty strings to avoid
421  * incorrect renumbering.
422  */
423  if ( count( $params ) ) {
424  $max = max( array_keys( $params ) );
425  for ( $i = 4; $i < $max; $i++ ) {
426  if ( !isset( $params[$i] ) ) {
427  $params[$i] = '';
428  }
429  }
430  }
431 
432  return $params;
433  }
434 
444  protected function getMessageParameters() {
445  if ( isset( $this->parsedParameters ) ) {
446  return $this->parsedParameters;
447  }
448 
450  $params = $this->extractParameters();
451  $params[0] = Message::rawParam( $this->getPerformerElement() );
452  $params[1] = $this->canView( LogPage::DELETED_USER ) ? $entry->getPerformer()->getName() : '';
453  $params[2] = Message::rawParam( $this->makePageLink( $entry->getTarget() ) );
454 
455  // Bad things happens if the numbers are not in correct order
456  ksort( $params );
457 
458  $this->parsedParameters = $params;
459  return $this->parsedParameters;
460  }
461 
489  protected function formatParameterValue( $type, $value ) {
490  $saveLinkFlood = $this->linkFlood;
491 
492  switch ( strtolower( trim( $type ) ) ) {
493  case 'raw':
494  $value = Message::rawParam( $value );
495  break;
496  case 'msg':
497  $value = $this->msg( $value )->text();
498  break;
499  case 'msg-content':
500  $value = $this->msg( $value )->inContentLanguage()->text();
501  break;
502  case 'number':
503  $value = Message::numParam( $value );
504  break;
505  case 'user':
507  $value = $user->getName();
508  break;
509  case 'user-link':
510  $this->setShowUserToolLinks( false );
511 
513  $value = Message::rawParam( $this->makeUserLink( $user ) );
514 
515  $this->setShowUserToolLinks( $saveLinkFlood );
516  break;
517  case 'title':
519  $value = $title->getPrefixedText();
520  break;
521  case 'title-link':
523  $value = Message::rawParam( $this->makePageLink( $title ) );
524  break;
525  case 'plain':
526  // Plain text, nothing to do
527  default:
528  // Catch other types and use the old behavior (return as-is)
529  }
530 
531  return $value;
532  }
533 
542  protected function makePageLink( Title $title = null, $parameters = array() ) {
543  if ( !$this->plaintext ) {
544  $link = Linker::link( $title, null, array(), $parameters );
545  } else {
546  if ( !$title instanceof Title ) {
547  throw new MWException( "Expected title, got null" );
548  }
549  $link = '[[' . $title->getPrefixedText() . ']]';
550  }
551 
552  return $link;
553  }
554 
561  public function getPerformerElement() {
562  if ( $this->canView( LogPage::DELETED_USER ) ) {
563  $performer = $this->entry->getPerformer();
564  $element = $this->makeUserLink( $performer );
565  if ( $this->entry->isDeleted( LogPage::DELETED_USER ) ) {
566  $element = $this->styleRestricedElement( $element );
567  }
568  } else {
569  $element = $this->getRestrictedElement( 'rev-deleted-user' );
570  }
571 
572  return $element;
573  }
574 
579  public function getComment() {
580  if ( $this->canView( LogPage::DELETED_COMMENT ) ) {
581  $comment = Linker::commentBlock( $this->entry->getComment() );
582  // No hard coded spaces thanx
583  $element = ltrim( $comment );
584  if ( $this->entry->isDeleted( LogPage::DELETED_COMMENT ) ) {
585  $element = $this->styleRestricedElement( $element );
586  }
587  } else {
588  $element = $this->getRestrictedElement( 'rev-deleted-comment' );
589  }
590 
591  return $element;
592  }
593 
599  protected function getRestrictedElement( $message ) {
600  if ( $this->plaintext ) {
601  return $this->msg( $message )->text();
602  }
603 
604  $content = $this->msg( $message )->escaped();
605  $attribs = array( 'class' => 'history-deleted' );
606 
607  return Html::rawElement( 'span', $attribs, $content );
608  }
609 
615  protected function styleRestricedElement( $content ) {
616  if ( $this->plaintext ) {
617  return $content;
618  }
619  $attribs = array( 'class' => 'history-deleted' );
620 
621  return Html::rawElement( 'span', $attribs, $content );
622  }
623 
629  protected function msg( $key ) {
630  return $this->context->msg( $key );
631  }
632 
633  protected function makeUserLink( User $user ) {
634  if ( $this->plaintext ) {
635  $element = $user->getName();
636  } else {
637  $element = Linker::userLink(
638  $user->getId(),
639  $user->getName()
640  );
641 
642  if ( $this->linkFlood ) {
644  $user->getId(),
645  $user->getName(),
646  $user->getEditCount()
647  );
648  }
649  }
650 
651  return $element;
652  }
653 
657  public function getPreloadTitles() {
658  return array();
659  }
660 
664  public function getMessageParametersForTesting() {
665  // This function was added because getMessageParameters() is
666  // protected and a change from protected to public caused
667  // problems with extensions
668  return $this->getMessageParameters();
669  }
670 }
671 
681 class LegacyLogFormatter extends LogFormatter {
691  private $comment = null;
692 
700  private $revert = null;
701 
702  public function getComment() {
703  if ( $this->comment === null ) {
704  $this->comment = parent::getComment();
705  }
706 
707  // Make sure we execute the LogLine hook so that we immediately return
708  // the correct value.
709  if ( $this->revert === null ) {
710  $this->getActionLinks();
711  }
712 
713  return $this->comment;
714  }
715 
716  protected function getActionMessage() {
717  $entry = $this->entry;
718  $action = LogPage::actionText(
719  $entry->getType(),
720  $entry->getSubtype(),
721  $entry->getTarget(),
722  $this->plaintext ? null : $this->context->getSkin(),
724  !$this->plaintext // whether to filter [[]] links
725  );
726 
727  $performer = $this->getPerformerElement();
728  if ( !$this->irctext ) {
729  $action = $performer . $this->msg( 'word-separator' )->text() . $action;
730  }
731 
732  return $action;
733  }
734 
735  public function getActionLinks() {
736  if ( $this->revert !== null ) {
737  return $this->revert;
738  }
739 
740  if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) ) {
741  $this->revert = '';
742  return $this->revert;
743  }
744 
745  $title = $this->entry->getTarget();
746  $type = $this->entry->getType();
747  $subtype = $this->entry->getSubtype();
748 
749  // Show unblock/change block link
750  if ( ( $type == 'block' || $type == 'suppress' )
751  && ( $subtype == 'block' || $subtype == 'reblock' )
752  ) {
753  if ( !$this->context->getUser()->isAllowed( 'block' ) ) {
754  return '';
755  }
756 
757  $links = array(
759  SpecialPage::getTitleFor( 'Unblock', $title->getDBkey() ),
760  $this->msg( 'unblocklink' )->escaped()
761  ),
763  SpecialPage::getTitleFor( 'Block', $title->getDBkey() ),
764  $this->msg( 'change-blocklink' )->escaped()
765  )
766  );
767 
768  return $this->msg( 'parentheses' )->rawParams(
769  $this->context->getLanguage()->pipeList( $links ) )->escaped();
770  // Show change protection link
771  } elseif ( $type == 'protect'
772  && ( $subtype == 'protect' || $subtype == 'modify' || $subtype == 'unprotect' )
773  ) {
774  $links = array(
776  $this->msg( 'hist' )->escaped(),
777  array(),
778  array(
779  'action' => 'history',
780  'offset' => $this->entry->getTimestamp()
781  )
782  )
783  );
784  if ( $this->context->getUser()->isAllowed( 'protect' ) ) {
785  $links[] = Linker::linkKnown(
786  $title,
787  $this->msg( 'protect_change' )->escaped(),
788  array(),
789  array( 'action' => 'protect' )
790  );
791  }
792 
793  return $this->msg( 'parentheses' )->rawParams(
794  $this->context->getLanguage()->pipeList( $links ) )->escaped();
795  // Show unmerge link
796  } elseif ( $type == 'merge' && $subtype == 'merge' ) {
797  if ( !$this->context->getUser()->isAllowed( 'mergehistory' ) ) {
798  return '';
799  }
800 
801  $params = $this->extractParameters();
803  SpecialPage::getTitleFor( 'MergeHistory' ),
804  $this->msg( 'revertmerge' )->escaped(),
805  array(),
806  array(
807  'target' => $params[3],
808  'dest' => $title->getPrefixedDBkey(),
809  'mergepoint' => $params[4]
810  )
811  );
812 
813  return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
814  }
815 
816  // Do nothing. The implementation is handled by the hook modifiying the
817  // passed-by-ref parameters. This also changes the default value so that
818  // getComment() and getActionLinks() do not call them indefinitely.
819  $this->revert = '';
820 
821  // This is to populate the $comment member of this instance so that it
822  // can be modified when calling the hook just below.
823  if ( $this->comment === null ) {
824  $this->getComment();
825  }
826 
827  $params = $this->entry->getParameters();
828 
829  wfRunHooks( 'LogLine', array( $type, $subtype, $title, $params,
830  &$this->comment, &$this->revert, $this->entry->getTimestamp() ) );
831 
832  return $this->revert;
833  }
834 }
LogFormatter\FOR_THIS_USER
const FOR_THIS_USER
Definition: LogFormatter.php:36
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:189
LogFormatter\setAudience
setAudience( $audience)
Set the visibility restrictions for displaying content.
Definition: LogFormatter.php:112
Linker\commentBlock
static commentBlock( $comment, $title=null, $local=false)
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty strin...
Definition: Linker.php:1565
LegacyLogFormatter\getComment
getComment()
Gets the user provided comment.
Definition: LogFormatter.php:695
LogFormatter\getActionLinks
getActionLinks()
Returns extra links that comes after the action text, like "revert", etc.
Definition: LogFormatter.php:386
Linker\userToolLinksRedContribs
static userToolLinksRedContribs( $userId, $userText, $edits=null)
Alias for userToolLinks( $userId, $userText, true );.
Definition: Linker.php:1164
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
LogFormatter\getPlainActionText
getPlainActionText()
Ugly hack to produce plaintext version of the message.
Definition: LogFormatter.php:149
Linker\userLink
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
Definition: Linker.php:1081
LogEntry\getParameters
getParameters()
Get the extra parameters stored for this message.
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
LogFormatter\FOR_PUBLIC
const FOR_PUBLIC
Definition: LogFormatter.php:35
LogFormatter\$entry
LogEntryBase $entry
Definition: LogFormatter.php:77
LogEntryBase\isLegacy
isLegacy()
Whether the parameters for this log are stored in new or old format.
Definition: LogEntry.php:115
LogEntry\getTarget
getTarget()
Get the target page of this action.
LogFormatter\getIRCActionComment
getIRCActionComment()
Even uglier hack to maintain backwards compatibilty with IRC bots (bug 34508).
Definition: LogFormatter.php:163
$params
$params
Definition: styleTest.css.php:40
LogFormatter\canView
canView( $field)
Check if a log item can be displayed.
Definition: LogFormatter.php:123
User\newFromName
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:389
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
Definition: SpecialPage.php:74
LogFormatter\getMessageParameters
getMessageParameters()
Formats parameters intented for action message from array of all parameters.
Definition: LogFormatter.php:439
LogFormatter\$plaintext
string $plaintext
Set to true if we are constructing a message text that is going to be included in page history or sen...
Definition: LogFormatter.php:89
LogFormatter\setContext
setContext(IContextSource $context)
Replace the default context.
Definition: LogFormatter.php:102
$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:2160
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
LegacyLogFormatter\getActionLinks
getActionLinks()
Returns extra links that comes after the action text, like "revert", etc.
Definition: LogFormatter.php:728
LogEntry\getType
getType()
The main log type.
Linker\link
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
Definition: Linker.php:192
LogFormatter\getComment
getComment()
Gets the user provided comment.
Definition: LogFormatter.php:574
LogFormatter\getPerformerElement
getPerformerElement()
Provides the name of the user who performed the log action.
Definition: LogFormatter.php:556
LogFormatter\__construct
__construct(LogEntry $entry)
Definition: LogFormatter.php:93
LogFormatter\msg
msg( $key)
Shortcut for wfMessage which honors local context.
Definition: LogFormatter.php:624
LogFormatter\makePageLink
makePageLink(Title $title=null, $parameters=array())
Helper to make a link to the page, taking the plaintext value in consideration.
Definition: LogFormatter.php:537
MWException
MediaWiki exception.
Definition: MWException.php:26
DatabaseLogEntry\newFromRow
static newFromRow( $row)
Constructs new LogEntry from database result row.
Definition: LogEntry.php:163
LogPage\DELETED_COMMENT
const DELETED_COMMENT
Definition: LogPage.php:34
LegacyLogFormatter\$revert
string null $revert
Cache for the result of getActionLinks() so that it does not need to run multiple times depending on ...
Definition: LogFormatter.php:693
LogFormatter\newFromRow
static newFromRow( $row)
Handy shortcut for constructing a formatter directly from database row.
Definition: LogFormatter.php:71
LogEntry
Interface for log entries.
Definition: LogEntry.php:35
LogPage\DELETED_USER
const DELETED_USER
Definition: LogPage.php:35
LogFormatter\getMessageParametersForTesting
getMessageParametersForTesting()
Definition: LogFormatter.php:659
wfMessage
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 noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4066
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
$comment
$comment
Definition: importImages.php:107
LogFormatter\getIRCActionText
getIRCActionText()
Even uglier hack to maintain backwards compatibilty with IRC bots (bug 34508).
Definition: LogFormatter.php:184
LogPage\actionText
static actionText( $type, $action, $title=null, $skin=null, $params=array(), $filterWikilinks=false)
Generate text for a log entry.
Definition: LogPage.php:252
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
false
processing should stop and the error should be shown to the user * false
Definition: hooks.txt:188
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition: LogPage.php:33
LogFormatter\styleRestricedElement
styleRestricedElement( $content)
Helper method for styling restricted element.
Definition: LogFormatter.php:610
LogEntryBase
Extends the LogEntryInterface with some basic functionality.
Definition: LogEntry.php:101
LogFormatter\formatParameterValue
formatParameterValue( $type, $value)
Formats parameters values dependent to their type.
Definition: LogFormatter.php:484
LogFormatter\$audience
Integer $audience
Constant for handling log_deleted *.
Definition: LogFormatter.php:79
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
$value
$value
Definition: styleTest.css.php:45
LegacyLogFormatter\$comment
string null $comment
Backward compatibility for extension changing the comment from the LogLine hook.
Definition: LogFormatter.php:685
LogFormatter\setShowUserToolLinks
setShowUserToolLinks( $value)
If set to true, will produce user tool links after the user name.
Definition: LogFormatter.php:138
LegacyLogFormatter\getActionMessage
getActionMessage()
Returns a sentence describing the log action.
Definition: LogFormatter.php:709
LogEntryBase\getFullType
getFullType()
The full logtype in format maintype/subtype.
Definition: LogEntry.php:102
LogFormatter\makeUserLink
makeUserLink(User $user)
Definition: LogFormatter.php:628
LogFormatter\getActionText
getActionText()
Gets the log action, including username.
Definition: LogFormatter.php:337
RequestContext\getMain
static getMain()
Static methods.
Definition: RequestContext.php:420
$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
LogFormatter\getActionMessage
getActionMessage()
Returns a sentence describing the log action.
Definition: LogFormatter.php:360
LogEntry\getSubtype
getSubtype()
The log subtype.
LogFormatter
Implements the default log formatting.
Definition: LogFormatter.php:33
IContextSource
Interface for objects which can provide a context on request.
Definition: IContextSource.php:29
LogFormatter\getPreloadTitles
getPreloadTitles()
Definition: LogFormatter.php:652
Title
Represents a title within MediaWiki.
Definition: Title.php:35
LogFormatter\$linkFlood
bool $linkFlood
Whether to output user tool links *.
Definition: LogFormatter.php:81
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:456
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
LogFormatter\getRestrictedElement
getRestrictedElement( $message)
Helper method for displaying restricted element.
Definition: LogFormatter.php:594
LogFormatter\$irctext
string $irctext
Definition: LogFormatter.php:91
LegacyLogFormatter
This class formats all log entries for log types which have not been converted to the new system.
Definition: LogFormatter.php:676
Html\rawElement
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
Definition: Html.php:121
LogFormatter\getMessageKey
getMessageKey()
Returns a key to be used for formatting the action sentence.
Definition: LogFormatter.php:374
$attribs
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 noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
Definition: hooks.txt:1530
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:59
LogEntry\getPerformer
getPerformer()
Get the user for performed this action.
LogFormatter\extractParameters
extractParameters()
Extracts the optional extra parameters for use in action messages.
Definition: LogFormatter.php:395
LogFormatter\newFromEntry
static newFromEntry(LogEntry $entry)
Constructs a new formatter suitable for given entry.
Definition: LogFormatter.php:45
$type
$type
Definition: testCompression.php:46