137 if ( $this->linkRenderer !==
null ) {
140 return MediaWikiServices::getInstance()->getLinkRenderer();
152 ? self::FOR_THIS_USER
162 if ( $this->audience == self::FOR_THIS_USER ) {
164 $this->entry->getDeleted(), $field, $this->context->getUser() );
166 return !$this->entry->isDeleted( $field );
177 $this->linkFlood =
$value;
188 $this->plaintext =
true;
190 $this->plaintext =
false;
203 $comment = $this->entry->getComment();
205 if ( $comment !=
'' ) {
206 if ( $actionComment ==
'' ) {
207 $actionComment = $comment;
209 $actionComment .=
wfMessage(
'colon-separator' )->inContentLanguage()->text() . $comment;
213 return $actionComment;
225 $this->plaintext =
true;
226 $this->irctext =
true;
238 $movesource = $parameters[
'4::target'];
240 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
243 $movesource = $parameters[
'4::target'];
245 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
247 case 'move-noredirect':
249 case 'move_redir-noredirect':
258 ->rawParams( $target )->inContentLanguage()->escaped();
262 ->rawParams( $target )->inContentLanguage()->escaped();
275 $diffLink = htmlspecialchars(
276 wfMessage(
'patrol-log-diff', $parameters[
'4::curid'] )
277 ->inContentLanguage()->
text() );
278 $text =
wfMessage(
'patrol-log-line', $diffLink,
"[[$target]]",
"" )
279 ->inContentLanguage()->text();
289 ->rawParams( $target .
' ' . $parameters[
'4::description'] )
290 ->inContentLanguage()
294 $text =
wfMessage(
'unprotectedarticle' )
295 ->rawParams( $target )->inContentLanguage()->escaped();
298 $text =
wfMessage(
'modifiedarticleprotection' )
299 ->rawParams( $target .
' ' . $parameters[
'4::description'] )
300 ->inContentLanguage()
304 $text =
wfMessage(
'movedarticleprotection' )
305 ->rawParams( $target, $parameters[
'4::oldtitle'] )->inContentLanguage()->escaped();
314 $text =
wfMessage(
'newuserlog-create-entry' )
315 ->inContentLanguage()->escaped();
319 $text =
wfMessage(
'newuserlog-create2-entry' )
320 ->rawParams( $target )->inContentLanguage()->escaped();
323 $text =
wfMessage(
'newuserlog-autocreate-entry' )
324 ->inContentLanguage()->escaped();
333 ->rawParams( $target )->inContentLanguage()->escaped();
337 ->rawParams( $target )->inContentLanguage()->escaped();
343 if ( count( $parameters[
'4::oldgroups'] ) ) {
344 $oldgroups = implode(
', ', $parameters[
'4::oldgroups'] );
346 $oldgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
348 if ( count( $parameters[
'5::newgroups'] ) ) {
349 $newgroups = implode(
', ', $parameters[
'5::newgroups'] );
351 $newgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
356 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
359 $text =
wfMessage(
'rightslogentry-autopromote' )
360 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
366 $text =
wfMessage(
'pagemerge-logentry' )
367 ->rawParams( $target, $parameters[
'4::dest'], $parameters[
'5::mergepoint'] )
368 ->inContentLanguage()->escaped();
377 $rawDuration = $parameters[0];
378 $rawFlags = isset( $parameters[1] ) ? $parameters[1] :
'';
380 $rawDuration = $parameters[
'5::duration'];
381 $rawFlags = $parameters[
'6::flags'];
390 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
394 ->rawParams( $target )->inContentLanguage()->escaped();
398 $parameters[
'5::duration'],
404 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
412 $text =
wfMessage(
'import-logentry-upload' )
413 ->rawParams( $target )->inContentLanguage()->escaped();
416 $text =
wfMessage(
'import-logentry-interwiki' )
417 ->rawParams( $target )->inContentLanguage()->escaped();
424 if ( is_null( $text ) ) {
428 $this->plaintext =
false;
429 $this->irctext =
false;
441 if ( $element instanceof
Message ) {
442 $element = $this->plaintext ? $element->text() : $element->escaped();
448 $sep = $this->
msg(
'word-separator' );
449 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
478 $type = $this->entry->getType();
479 $subtype = $this->entry->getSubtype();
481 return "logentry-$type-$subtype";
510 if ( strpos( $key,
':' ) ===
false ) {
513 list( $index,
$type, ) = explode(
':', $key, 3 );
514 if ( ctype_digit( $index ) ) {
524 $max = max( array_keys(
$params ) );
526 for ( $i = 3; $i < $max; $i++ ) {
546 if ( isset( $this->parsedParameters ) ) {
547 return $this->parsedParameters;
559 $this->parsedParameters =
$params;
560 return $this->parsedParameters;
592 switch ( strtolower( trim(
$type ) ) ) {
597 $value = $this->context->getLanguage()->commaList(
$value );
610 $value = $user->getName();
621 $title = Title::newFromText(
$value );
622 $value = $title->getPrefixedText();
625 $title = Title::newFromText(
$value );
646 if ( !$title instanceof
Title ) {
647 $msg = $this->
msg(
'invalidtitle' )->text();
648 if ( !$this->plaintext ) {
649 return Html::element(
'span', [
'class' =>
'mw-invalidtitle' ], $msg );
655 if ( !$this->plaintext ) {
659 $link =
'[[' . $title->getPrefixedText() .
']]';
673 $performer = $this->entry->getPerformer();
693 $element = ltrim( $comment );
710 if ( $this->plaintext ) {
711 return $this->
msg( $message )->text();
714 $content = $this->
msg( $message )->escaped();
715 $attribs = [
'class' =>
'history-deleted' ];
717 return Html::rawElement(
'span',
$attribs, $content );
726 if ( $this->plaintext ) {
729 $attribs = [
'class' =>
'history-deleted' ];
731 return Html::rawElement(
'span',
$attribs, $content );
739 protected function msg( $key ) {
740 return $this->context->msg( $key );
744 if ( $this->plaintext ) {
745 $element = $user->getName();
752 if ( $this->linkFlood ) {
758 $user->getEditCount()
789 return $this->entry->getParameters();
809 $vals = explode(
':', $key, 3 );
810 if ( count( $vals ) !== 3 ) {
811 $logParams[$key] =
$value;
849 if ( is_array(
$value ) ) {
861 if (
$type ===
'msg-content' ) {
862 $msg->inContentLanguage();
865 $value[
"{$name}_key"] = $msg->getKey();
866 if ( $msg->getParams() ) {
867 $value[
"{$name}_params"] = $msg->getParams();
869 $value[
"{$name}_text"] = $msg->text();
874 $title = Title::newFromText(
$value );
877 $title = SpecialPage::getTitleFor(
'Badtitle',
$value );
887 $value = $user->getName();
896 return [ $name =>
$value ];
931 if ( $this->comment ===
null ) {
932 $this->comment = parent::getComment();
937 if ( $this->revert ===
null ) {
950 $this->plaintext ?
null : $this->context->getSkin(),
956 if ( !$this->irctext ) {
957 $sep = $this->
msg(
'word-separator' );
958 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
959 $action = $performer . $sep . $action;
966 if ( $this->revert !==
null ) {
975 $title = $this->entry->getTarget();
976 $type = $this->entry->getType();
977 $subtype = $this->entry->getSubtype();
986 if ( $this->comment ===
null ) {
990 $params = $this->entry->getParameters();
992 Hooks::run(
'LogLine', [
$type, $subtype, $title,
$params,
993 &$this->comment, &$this->revert, $this->entry->getTimestamp() ] );
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static newFromRow( $row)
Constructs new LogEntry from database result row.
Marks HTML that shouldn't be escaped.
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
static commentBlock( $comment, $title=null, $local=false, $wikiId=null)
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty strin...
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
Extends the LogEntryInterface with some basic functionality.
isLegacy()
Whether the parameters for this log are stored in new or old format.
getFullType()
The full logtype in format maintype/subtype.
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
static actionText( $type, $action, $title=null, $skin=null, $params=[], $filterWikilinks=false)
Generate text for a log entry.
The Message class provides methods which fulfil two basic services:
static getMain()
Get the RequestContext object associated with the main request.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
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
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
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
the array() calling protocol came about after MediaWiki 1.4rc1.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation 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 "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
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 & $html
usually copyright or history_copyright This message must be in HTML not wikitext & $link
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
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves $handler
Interface for objects which can provide a MediaWiki context on request.
Interface for log entries.
getParameters()
Get the extra parameters stored for this message.
getTimestamp()
Get the timestamp when the action was executed.
getTarget()
Get the target page of this action.
getSubtype()
The log subtype.
getPerformer()
Get the user for performed this action.
getType()
The main log type.