Go to the documentation of this file.
49 global $wgLogActionsHandlers;
54 if ( isset( $wgLogActionsHandlers[$fulltype] ) ) {
55 $handler = $wgLogActionsHandlers[$fulltype];
56 } elseif ( isset( $wgLogActionsHandlers[$wildcard] ) ) {
57 $handler = $wgLogActionsHandlers[$wildcard];
125 ? self::FOR_THIS_USER
135 if ( $this->audience == self::FOR_THIS_USER ) {
137 $this->entry->getDeleted(), $field, $this->context->getUser() );
139 return !$this->entry->isDeleted( $field );
150 $this->linkFlood =
$value;
161 $this->plaintext =
true;
163 $this->plaintext =
false;
176 $comment = $this->entry->getComment();
178 if ( $comment !=
'' ) {
179 if ( $actionComment ==
'' ) {
180 $actionComment = $comment;
182 $actionComment .=
wfMessage(
'colon-separator' )->inContentLanguage()->text() . $comment;
186 return $actionComment;
198 $this->plaintext =
true;
199 $this->irctext =
true;
211 $movesource = $parameters[
'4::target'];
213 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
216 $movesource = $parameters[
'4::target'];
218 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
220 case 'move-noredirect':
222 case 'move_redir-noredirect':
231 ->rawParams( $target )->inContentLanguage()->escaped();
235 ->rawParams( $target )->inContentLanguage()->escaped();
252 $diffLink = htmlspecialchars(
253 wfMessage(
'patrol-log-diff', $parameters[
'4::curid'] )
254 ->inContentLanguage()->
text() );
255 $text =
wfMessage(
'patrol-log-line', $diffLink,
"[[$target]]",
"" )
256 ->inContentLanguage()->text();
266 ->rawParams( $target .
' ' . $parameters[
'4::description'] )->inContentLanguage()->escaped();
269 $text =
wfMessage(
'unprotectedarticle' )
270 ->rawParams( $target )->inContentLanguage()->escaped();
273 $text =
wfMessage(
'modifiedarticleprotection' )
274 ->rawParams( $target .
' ' . $parameters[
'4::description'] )->inContentLanguage()->escaped();
277 $text =
wfMessage(
'movedarticleprotection' )
278 ->rawParams( $target, $parameters[
'4::oldtitle'] )->inContentLanguage()->escaped();
287 $text =
wfMessage(
'newuserlog-create-entry' )
288 ->inContentLanguage()->escaped();
292 $text =
wfMessage(
'newuserlog-create2-entry' )
293 ->rawParams( $target )->inContentLanguage()->escaped();
296 $text =
wfMessage(
'newuserlog-autocreate-entry' )
297 ->inContentLanguage()->escaped();
306 ->rawParams( $target )->inContentLanguage()->escaped();
310 ->rawParams( $target )->inContentLanguage()->escaped();
316 if (
count( $parameters[
'4::oldgroups'] ) ) {
317 $oldgroups = implode(
', ', $parameters[
'4::oldgroups'] );
319 $oldgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
321 if (
count( $parameters[
'5::newgroups'] ) ) {
322 $newgroups = implode(
', ', $parameters[
'5::newgroups'] );
324 $newgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
329 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
332 $text =
wfMessage(
'rightslogentry-autopromote' )
333 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
339 $text =
wfMessage(
'pagemerge-logentry' )
340 ->rawParams( $target, $parameters[
'4::dest'], $parameters[
'5::mergepoint'] )
341 ->inContentLanguage()->escaped();
350 $rawDuration = $parameters[0];
351 $rawFlags = isset( $parameters[1] ) ? $parameters[1] :
'';
353 $rawDuration = $parameters[
'5::duration'];
354 $rawFlags = $parameters[
'6::flags'];
363 ->rawParams( $target, $duration,
$flags )->inContentLanguage()->escaped();
367 ->rawParams( $target )->inContentLanguage()->escaped();
371 $parameters[
'5::duration'],
377 ->rawParams( $target, $duration,
$flags )->inContentLanguage()->escaped();
385 $text =
wfMessage(
'import-logentry-upload' )
386 ->rawParams( $target )->inContentLanguage()->escaped();
389 $text =
wfMessage(
'import-logentry-interwiki' )
390 ->rawParams( $target )->inContentLanguage()->escaped();
397 if ( is_null( $text ) ) {
401 $this->plaintext =
false;
402 $this->irctext =
false;
414 if ( $element instanceof Message ) {
415 $element = $this->plaintext ? $element->text() : $element->escaped();
421 $sep = $this->
msg(
'word-separator' );
422 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
451 $type = $this->entry->getType();
452 $subtype = $this->entry->getSubtype();
454 return "logentry-$type-$subtype";
483 if ( strpos( $key,
':' ) ===
false ) {
486 list( $index,
$type, ) = explode(
':', $key, 3 );
487 if ( ctype_digit( $index ) ) {
497 $max = max( array_keys(
$params ) );
499 for ( $i = 3; $i < $max; $i++ ) {
519 if ( isset( $this->parsedParameters ) ) {
520 return $this->parsedParameters;
532 $this->parsedParameters =
$params;
533 return $this->parsedParameters;
565 switch ( strtolower( trim(
$type ) ) ) {
570 $value = $this->context->getLanguage()->commaList(
$value );
620 if ( !$this->plaintext ) {
624 throw new MWException(
"Expected title, got null" );
640 $performer = $this->entry->getPerformer();
660 $element = ltrim( $comment );
677 if ( $this->plaintext ) {
678 return $this->
msg( $message )->text();
682 $attribs = [
'class' =>
'history-deleted' ];
693 if ( $this->plaintext ) {
696 $attribs = [
'class' =>
'history-deleted' ];
706 protected function msg( $key ) {
707 return $this->context->msg( $key );
711 if ( $this->plaintext ) {
712 $element =
$user->getName();
719 if ( $this->linkFlood ) {
725 $user->getEditCount()
756 return $this->entry->getParameters();
776 $vals = explode(
':', $key, 3 );
777 if (
count( $vals ) !== 3 ) {
778 $logParams[$key] =
$value;
816 if ( is_array(
$value ) ) {
828 if (
$type ===
'msg-content' ) {
829 $msg->inContentLanguage();
832 $value[
"{$name}_key"] = $msg->getKey();
833 if ( $msg->getParams() ) {
834 $value[
"{$name}_params"] = $msg->getParams();
836 $value[
"{$name}_text"] = $msg->text();
896 if ( $this->comment ===
null ) {
897 $this->comment = parent::getComment();
902 if ( $this->revert ===
null ) {
915 $this->plaintext ? null : $this->context->getSkin(),
921 if ( !$this->irctext ) {
922 $sep = $this->
msg(
'word-separator' );
923 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
924 $action = $performer . $sep . $action;
931 if ( $this->revert !==
null ) {
940 $title = $this->entry->getTarget();
941 $type = $this->entry->getType();
942 $subtype = $this->entry->getSubtype();
951 if ( $this->comment ===
null ) {
955 $params = $this->entry->getParameters();
958 &$this->comment, &$this->revert, $this->entry->getTimestamp() ] );
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.
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 newFromName( $name, $validate='valid')
Static factory method for creation from username.
Allows to change the fields on the form that will be generated $name
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
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.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
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.
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 "<
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