Go to the documentation of this file.
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 );
647 if ( !$this->plaintext ) {
651 throw new MWException(
"Expected title, got null" );
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' ];
720 if ( $this->plaintext ) {
723 $attribs = [
'class' =>
'history-deleted' ];
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();
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();
985 &$this->comment, &$this->revert, $this->entry->getTimestamp() ] );
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
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
processing should stop and the error should be shown to the user * false
getTimestamp()
Get the timestamp when the action was executed.
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
getParameters()
Get the extra parameters stored for this message.
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
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
isLegacy()
Whether the parameters for this log are stored in new or old format.
getTarget()
Get the target page of this action.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Allows to change the fields on the form that will be generated $name
static actionText( $type, $action, $title=null, $skin=null, $params=[], $filterWikilinks=false)
Generate text for a log entry.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
getType()
The main log type.
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.
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
namespace and then decline to actually register it file or subcat img or subcat $title
static newFromRow( $row)
Constructs new LogEntry from database result row.
Interface for log entries.
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
when a variable name is used in a it is silently declared as a new masking the global
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
Extends the LogEntryInterface with some basic functionality.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
static link( $target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
getFullType()
The full logtype in format maintype/subtype.
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
static getMain()
Static methods.
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
getSubtype()
The log subtype.
Interface for objects which can provide a MediaWiki context on request.
Represents a title within MediaWiki.
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
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
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
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...
usually copyright or history_copyright This message must be in HTML not wikitext & $link
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 "<
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
getPerformer()
Get the user for performed this action.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
the array() calling protocol came about after MediaWiki 1.4rc1.
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 content language as $wgContLang