Go to the documentation of this file.
44 parent::__construct(
'Log' );
54 $opts->
add(
'type',
'' );
55 $opts->add(
'user',
'' );
56 $opts->add(
'page',
'' );
57 $opts->add(
'pattern',
false );
60 $opts->add(
'tagfilter',
'' );
61 $opts->add(
'offset',
'' );
62 $opts->add(
'dir',
'' );
63 $opts->add(
'offender',
'' );
66 $opts->fetchValuesFromRequest( $this->
getRequest() );
67 if ( $par !==
null ) {
71 # Don't let the user get stuck with a certain date
72 if ( $opts->getValue(
'offset' ) || $opts->getValue(
'dir' ) ==
'prev' ) {
73 $opts->setValue(
'year',
'' );
74 $opts->setValue(
'month',
'' );
80 $type = $opts->getValue(
'type' );
82 $opts->setValue(
'type',
'' );
83 } elseif ( isset( $wgLogRestrictions[
$type] ) && !$this->
getUser()->isAllowed( $wgLogRestrictions[
$type] ) ) {
87 # Handle type-specific inputs
89 if ( $opts->getValue(
'type' ) ==
'suppress' ) {
91 if ( $offender && $offender->getId() > 0 ) {
92 $qc =
array(
'ls_field' =>
'target_author_id',
'ls_value' => $offender->getId() );
94 $qc =
array(
'ls_field' =>
'target_author_ip',
'ls_value' => $offender->getName() );
98 # Some log types are only for a 'User:' title but we might have been given
99 # only the username instead of the full title 'User:username'. This part try
100 # to lookup for a user by that name and eventually fix user input. See bug 1697.
103 # ok we have a type of log which expect a user title.
105 if ( $target && $target->getNamespace() ===
NS_MAIN ) {
106 # User forgot to add 'User:', we are adding it for him
107 $opts->setValue(
'page',
113 $this->
show( $opts, $qc );
120 $parms = explode(
'/', ( $par = ( $par !==
null ) ? $par :
'' ) );
121 $symsForAll =
array(
'*',
'all' );
122 if ( $parms[0] !=
'' &&
123 ( in_array( $par, $wgLogTypes ) || in_array( $par, $symsForAll ) )
126 } elseif ( count( $parms ) == 2 ) {
127 $opts->
setValue(
'type', $parms[0] );
128 $opts->
setValue(
'user', $parms[1] );
129 } elseif ( $par !=
'' ) {
135 # Create a LogPager item to get the results and a LogEventsList item to format them...
156 if ( $pager->getPerformer() ) {
161 $loglist->showOptions(
165 $pager->getPattern(),
168 $pager->getFilterParams(),
173 $logBody = $pager->getBody();
176 $pager->getNavigationBar() .
178 $loglist->beginLogEventsList() .
180 $loglist->endLogEventsList()
182 $pager->getNavigationBar()
185 $this->
getOutput()->addWikiMsg(
'logempty' );
190 # If the user doesn't have the ability to delete log entries,
191 # don't bother showing them the button.
192 if ( !$this->
getUser()->isAllowedAll(
'deletedhistory',
'deletelogentry' ) ) {
193 return $formcontents;
196 # Show button to hide log entries
200 array(
'action' => $wgScript,
'id' =>
'mw-log-deleterevision-submit' )
209 'class' =>
"deleterevision-log-submit mw-log-deleterevision-button"
211 $this->
msg(
'showhideselectedlogentries' )->
text()
213 $s .= $button . $formcontents . $button;
226 $this->
getOutput()->setPageTitle( $page->getName()->text() );
227 $this->
getOutput()->addHTML( $page->getDescription()->parseAsBlock() );
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
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
parseParams(FormOptions $opts, $par)
getOutput()
Get the OutputPage being used for this instance.
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
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.
getSkin()
Shortcut to get the skin being used for this instance.
static hidden( $name, $value, $attribs=array())
Convenience function to produce an input element with type=hidden.
Show an error when a user tries to do something they do not have the necessary permissions for.
static closeElement( $element)
Returns "</$element>", except if $wgWellFormedXml is off, in which case it returns the empty string w...
static openElement( $element, $attribs=array())
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
getRevisionButton( $formcontents)
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static isLogType( $type)
Is $type a valid log type.
Class to simplify the use of log pages.
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.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
when a variable name is used in a it is silently declared as a new masking the global
processing should stop and the error should be shown to the user * false
getContext()
Gets the context this SpecialPage is executed in.
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
msg()
Wrapper around wfMessage that sets the current context.
Parent class for all special pages.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getRequest()
Get the WebRequest being used for this instance.
const USE_REVDEL_CHECKBOXES
show(FormOptions $opts, array $extraConds)
A special page that lists log entries.
$typeOnUser
List log type for which the target is a user Thus if the given target is in NS_MAIN we can alter it t...
execute( $par)
Default execute method Checks user permissions, calls the function given in mFunction.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
static isIPAddress( $ip)
Determine if a string is as valid IP address or network (CIDR prefix).
addHeader( $type)
Set page title and show header for this log type.