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();
279 $diffLink = htmlspecialchars(
280 wfMessage(
'patrol-log-diff', $parameters[
'4::curid'] )
281 ->inContentLanguage()->
text() );
282 $text =
wfMessage(
'patrol-log-line', $diffLink,
"[[$target]]",
"" )
283 ->inContentLanguage()->text();
293 ->rawParams( $target .
' ' . $parameters[
'4::description'] )->inContentLanguage()->escaped();
296 $text =
wfMessage(
'unprotectedarticle' )
297 ->rawParams( $target )->inContentLanguage()->escaped();
300 $text =
wfMessage(
'modifiedarticleprotection' )
301 ->rawParams( $target .
' ' . $parameters[
'4::description'] )->inContentLanguage()->escaped();
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 );
609 $user = User::newFromName(
$value );
610 $value = $user->getName();
615 $user = User::newFromName(
$value );
621 $title = Title::newFromText(
$value );
622 $value = $title->getPrefixedText();
625 $title = Title::newFromText(
$value );
647 if ( !$this->plaintext ) {
650 if ( !$title instanceof
Title ) {
651 throw new MWException(
"Expected title, got null" );
653 $link =
'[[' . $title->getPrefixedText() .
']]';
667 $performer = $this->entry->getPerformer();
687 $element = ltrim( $comment );
704 if ( $this->plaintext ) {
705 return $this->
msg( $message )->text();
708 $content = $this->
msg( $message )->escaped();
709 $attribs = [
'class' =>
'history-deleted' ];
711 return Html::rawElement(
'span',
$attribs, $content );
720 if ( $this->plaintext ) {
723 $attribs = [
'class' =>
'history-deleted' ];
725 return Html::rawElement(
'span',
$attribs, $content );
733 protected function msg( $key ) {
734 return $this->context->msg( $key );
738 if ( $this->plaintext ) {
739 $element = $user->getName();
746 if ( $this->linkFlood ) {
752 $user->getEditCount()
783 return $this->entry->getParameters();
803 $vals = explode(
':', $key, 3 );
804 if ( count( $vals ) !== 3 ) {
805 $logParams[$key] =
$value;
843 if ( is_array(
$value ) ) {
855 if (
$type ===
'msg-content' ) {
856 $msg->inContentLanguage();
859 $value[
"{$name}_key"] = $msg->getKey();
860 if ( $msg->getParams() ) {
861 $value[
"{$name}_params"] = $msg->getParams();
863 $value[
"{$name}_text"] = $msg->text();
868 $title = Title::newFromText(
$value );
877 $user = User::newFromName(
$value );
879 $value = $user->getName();
888 return [ $name =>
$value ];
923 if ( $this->comment ===
null ) {
924 $this->comment = parent::getComment();
929 if ( $this->revert ===
null ) {
942 $this->plaintext ?
null : $this->context->getSkin(),
948 if ( !$this->irctext ) {
949 $sep = $this->
msg(
'word-separator' );
950 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
951 $action = $performer . $sep . $action;
958 if ( $this->revert !==
null ) {
967 $title = $this->entry->getTarget();
968 $type = $this->entry->getType();
969 $subtype = $this->entry->getSubtype();
978 if ( $this->comment ===
null ) {
982 $params = $this->entry->getParameters();
984 Hooks::run(
'LogLine', [
$type, $subtype, $title,
$params,
985 &$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.
static link( $target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
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()
Static methods.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
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
it s the revision text itself In either if gzip is the revision text is gzipped $flags
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.