Go to the documentation of this file.
46 global $wgLogActionsHandlers;
51 if ( isset( $wgLogActionsHandlers[$fulltype] ) ) {
52 $handler = $wgLogActionsHandlers[$fulltype];
53 } elseif ( isset( $wgLogActionsHandlers[$wildcard] ) ) {
54 $handler = $wgLogActionsHandlers[$wildcard];
57 if ( $handler !==
'' && is_string( $handler ) && class_exists( $handler ) ) {
58 return new $handler(
$entry );
108 $this->context = $context;
119 ? self::FOR_THIS_USER
128 protected function canView( $field ) {
129 if ( $this->audience == self::FOR_THIS_USER ) {
131 $this->entry->getDeleted(), $field, $this->context->getUser() );
133 return !$this->entry->isDeleted( $field );
144 $this->linkFlood =
$value;
155 $this->plaintext =
true;
157 $this->plaintext =
false;
170 $comment = $this->entry->getComment();
173 if ( $actionComment ==
'' ) {
176 $actionComment .=
wfMessage(
'colon-separator' )->inContentLanguage()->text() .
$comment;
180 return $actionComment;
190 $this->plaintext =
true;
191 $this->irctext =
true;
203 $movesource = $parameters[
'4::target'];
205 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
208 $movesource = $parameters[
'4::target'];
210 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
212 case 'move-noredirect':
214 case 'move_redir-noredirect':
223 ->rawParams( $target )->inContentLanguage()->escaped();
227 ->rawParams( $target )->inContentLanguage()->escaped();
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();
258 ->rawParams( $target .
' ' . $parameters[0] )->inContentLanguage()->escaped();
261 $text =
wfMessage(
'unprotectedarticle' )
262 ->rawParams( $target )->inContentLanguage()->escaped();
265 $text =
wfMessage(
'modifiedarticleprotection' )
266 ->rawParams( $target .
' ' . $parameters[0] )->inContentLanguage()->escaped();
275 $text =
wfMessage(
'newuserlog-create-entry' )
276 ->inContentLanguage()->escaped();
280 $text =
wfMessage(
'newuserlog-create2-entry' )
281 ->rawParams( $target )->inContentLanguage()->escaped();
284 $text =
wfMessage(
'newuserlog-autocreate-entry' )
285 ->inContentLanguage()->escaped();
294 ->rawParams( $target )->inContentLanguage()->escaped();
298 ->rawParams( $target )->inContentLanguage()->escaped();
304 if ( count( $parameters[
'4::oldgroups'] ) ) {
305 $oldgroups = implode(
', ', $parameters[
'4::oldgroups'] );
307 $oldgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
309 if ( count( $parameters[
'5::newgroups'] ) ) {
310 $newgroups = implode(
', ', $parameters[
'5::newgroups'] );
312 $newgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
317 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
320 $text =
wfMessage(
'rightslogentry-autopromote' )
321 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
328 if ( is_null( $text ) ) {
332 $this->plaintext =
false;
333 $this->irctext =
false;
345 if ( $element instanceof Message ) {
346 $element = $this->plaintext ? $element->text() : $element->escaped();
380 $type = $this->entry->getType();
381 $subtype = $this->entry->getSubtype();
383 return "logentry-$type-$subtype";
412 if ( strpos( $key,
':' ) ===
false ) {
415 list( $index,
$type, ) = explode(
':', $key, 3 );
424 $max = max( array_keys(
$params ) );
425 for ( $i = 4; $i < $max; $i++ ) {
445 if ( isset( $this->parsedParameters ) ) {
446 return $this->parsedParameters;
458 $this->parsedParameters =
$params;
459 return $this->parsedParameters;
492 switch ( strtolower( trim(
$type ) ) ) {
543 if ( !$this->plaintext ) {
547 throw new MWException(
"Expected title, got null" );
563 $performer = $this->entry->getPerformer();
600 if ( $this->plaintext ) {
601 return $this->
msg( $message )->text();
604 $content = $this->
msg( $message )->escaped();
616 if ( $this->plaintext ) {
629 protected function msg( $key ) {
630 return $this->context->msg( $key );
634 if ( $this->plaintext ) {
635 $element =
$user->getName();
642 if ( $this->linkFlood ) {
646 $user->getEditCount()
703 if ( $this->comment ===
null ) {
704 $this->comment = parent::getComment();
709 if ( $this->revert ===
null ) {
722 $this->plaintext ? null : $this->context->getSkin(),
728 if ( !$this->irctext ) {
729 $action = $performer . $this->
msg(
'word-separator' )->text() . $action;
736 if ( $this->revert !==
null ) {
745 $title = $this->entry->getTarget();
746 $type = $this->entry->getType();
747 $subtype = $this->entry->getSubtype();
750 if ( (
$type ==
'block' ||
$type ==
'suppress' )
751 && ( $subtype ==
'block' || $subtype ==
'reblock' )
753 if ( !$this->context->getUser()->isAllowed(
'block' ) ) {
760 $this->
msg(
'unblocklink' )->escaped()
764 $this->
msg(
'change-blocklink' )->escaped()
768 return $this->
msg(
'parentheses' )->rawParams(
769 $this->context->getLanguage()->pipeList( $links ) )->escaped();
771 } elseif (
$type ==
'protect'
772 && ( $subtype ==
'protect' || $subtype ==
'modify' || $subtype ==
'unprotect' )
776 $this->
msg(
'hist' )->escaped(),
779 'action' =>
'history',
780 'offset' => $this->entry->getTimestamp()
784 if ( $this->context->getUser()->isAllowed(
'protect' ) ) {
787 $this->
msg(
'protect_change' )->escaped(),
789 array(
'action' =>
'protect' )
793 return $this->
msg(
'parentheses' )->rawParams(
794 $this->context->getLanguage()->pipeList( $links ) )->escaped();
796 } elseif (
$type ==
'merge' && $subtype ==
'merge' ) {
797 if ( !$this->context->getUser()->isAllowed(
'mergehistory' ) ) {
804 $this->
msg(
'revertmerge' )->escaped(),
808 'dest' =>
$title->getPrefixedDBkey(),
813 return $this->
msg(
'parentheses' )->rawParams(
$revert )->escaped();
823 if ( $this->comment ===
null ) {
827 $params = $this->entry->getParameters();
830 &$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.
static commentBlock( $comment, $title=null, $local=false)
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty strin...
static userToolLinksRedContribs( $userId, $userText, $edits=null)
Alias for userToolLinks( $userId, $userText, true );.
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
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
isLegacy()
Whether the parameters for this log are stored in new or old format.
getTarget()
Get the target page of this action.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
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
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
getType()
The main log type.
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
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 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 "<
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
static actionText( $type, $action, $title=null, $skin=null, $params=array(), $filterWikilinks=false)
Generate text for a log entry.
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
processing should stop and the error should be shown to the user * false
Extends the LogEntryInterface with some basic functionality.
presenting them properly to the user as errors is done by the caller $title
getFullType()
The full logtype in format maintype/subtype.
static getMain()
Static methods.
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
getSubtype()
The log subtype.
Interface for objects which can provide a 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=array(), $contents='')
Returns an HTML element in a string.
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
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
getPerformer()
Get the user for performed this action.