Go to the documentation of this file.
45 public function execute( $subpage ) {
46 $this->rcSubpage = $subpage;
54 if ( $rows ===
false ) {
63 foreach ( $rows
as $row ) {
66 $batch->add( $row->rc_namespace, $row->rc_title );
93 if ( $this->rcOptions ===
null ) {
94 $this->rcOptions = $this->
setup( $this->rcSubpage );
107 public function setup( $parameters ) {
110 $opts->add( $key,
$params[
'default'] );
116 if ( $parameters !==
null ) {
134 $opts->add(
'hideminor',
false );
135 $opts->add(
'hidebots',
false );
136 $opts->add(
'hideanons',
false );
137 $opts->add(
'hideliu',
false );
138 $opts->add(
'hidepatrolled',
false );
139 $opts->add(
'hidemyself',
false );
142 $opts->add(
'invert',
false );
143 $opts->add(
'associated',
false );
154 if ( $this->customFilters ===
null ) {
155 $this->customFilters =
array();
156 wfRunHooks(
'ChangesListSpecialPageFilters',
array( $this, &$this->customFilters ) );
171 $opts->fetchValuesFromRequest( $this->
getRequest() );
209 $hideanons = $opts[
'hideanons'];
210 if ( $opts[
'hideanons'] && $opts[
'hideliu'] ) {
211 if ( $opts[
'hidebots'] ) {
219 if ( $opts[
'hideminor'] ) {
220 $conds[
'rc_minor'] = 0;
222 if ( $opts[
'hidebots'] ) {
223 $conds[
'rc_bot'] = 0;
225 if (
$user->useRCPatrol() && $opts[
'hidepatrolled'] ) {
226 $conds[
'rc_patrolled'] = 0;
229 $conds[
'rc_bot'] = 1;
231 if ( $opts[
'hideliu'] ) {
232 $conds[] =
'rc_user = 0';
235 $conds[] =
'rc_user != 0';
238 if ( $opts[
'hidemyself'] ) {
239 if (
$user->getId() ) {
240 $conds[] =
'rc_user != ' .
$dbr->addQuotes(
$user->getId() );
242 $conds[] =
'rc_user_text != ' .
$dbr->addQuotes(
$user->getName() );
247 if ( $opts[
'namespace'] !==
'' ) {
248 $selectedNS =
$dbr->addQuotes( $opts[
'namespace'] );
249 $operator = $opts[
'invert'] ?
'!=' :
'=';
250 $boolean = $opts[
'invert'] ?
'AND' :
'OR';
253 if ( !$opts[
'associated'] ) {
254 $condition =
"rc_namespace $operator $selectedNS";
257 $associatedNS =
$dbr->addQuotes(
260 $condition =
"(rc_namespace $operator $selectedNS "
262 .
" rc_namespace $operator $associatedNS)";
265 $conds[] = $condition;
281 $query_options =
array();
282 $join_conds =
array();
293 if ( !
wfRunHooks(
'ChangesListSpecialPageQuery',
294 array( $this->
getName(), &
$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) )
316 protected function getDB() {
326 public function webOutput( $rows, $opts ) {
329 $this->
doHeader( $opts, $rows->numRows() );
356 public function doHeader( $opts, $numRows ) {
405 global $wgRecentChangesFlags;
407 # The legend showing what the letters and stuff mean
409 # Iterates through them and gets the messages for both letter and tooltip
410 $legendItems = $wgRecentChangesFlags;
411 if ( !
$user->useRCPatrol() ) {
412 unset( $legendItems[
'unpatrolled'] );
414 foreach ( $legendItems
as $key => $legendInfo ) { # generate items
of the legend
415 $label = $legendInfo[
'title'];
416 $letter = $legendInfo[
'letter'];
417 $cssClass = isset( $legendInfo[
'class'] ) ? $legendInfo[
'class'] : $key;
420 array(
'class' => $cssClass ), $context->
msg( $letter )->text()
422 if ( $key ===
'newpage' ) {
424 $legend .= $context->
msg( $label )->escaped();
425 $legend .=
' ' . $context->
msg(
'recentchanges-legend-newpage' )->parse();
429 $context->
msg( $label )->text()
435 array(
'class' =>
'mw-plusminus-pos' ),
436 $context->
msg(
'recentchanges-legend-plusminus' )->parse()
440 array(
'class' =>
'mw-changeslist-legend-plusminus' ),
441 $context->
msg(
'recentchanges-label-plusminus' )->text()
447 '<div class="mw-changeslist-legend">' .
448 $context->
msg(
'recentchanges-legend-heading' )->parse() .
449 '<div class="mw-collapsible-content">' . $legend .
'</div>' .
461 $out->addModuleStyles(
'mediawiki.special.changeslist.legend' );
462 $out->addModules(
'mediawiki.special.changeslist.legend.js' );
getExtraOptions( $opts)
Get options to be displayed in a form.
globals txt Globals are evil The original MediaWiki code relied on globals for processing context far too often MediaWiki development since then has been a story of slowly moving context out of global variables and into objects Storing processing context in object member variables allows those objects to be reused in a much more flexible way Consider the elegance of
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
Class representing a list of titles The execute() method checks them all for existence and adds them ...
static tags( $element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
namespace and then decline to actually register it RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist & $tables
getOutput()
Get the OutputPage being used for this instance.
execute( $subpage)
Main execution point.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
parseParameters( $par, FormOptions $opts)
Process $par and put options found in $opts.
Special page which uses a ChangesList to show query results.
msg()
Get a Message object with context set.
fetchOptionsFromRequest( $opts)
Fetch values for a FormOptions object from the WebRequest associated with this instance.
getName()
Get the name of this Special Page.
static openElement( $element, $attribs=null)
This opens an XML element.
doHeader( $opts, $numRows)
Set the text to be displayed above the changes.
static makeLegend(IContextSource $context)
Return the legend displayed within the fieldset.
webOutput( $rows, $opts)
Send output to the OutputPage object, only called if not used feeds.
doMainQuery( $conds, $opts)
Process the query.
getRows()
Get the database result for this special page instance.
outputFeedLinks()
Output feed links.
outputChangesList( $rows, $opts)
Build and output the actual changes list.
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
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
buildMainQueryConds(FormOptions $opts)
Return an array of conditions depending of options set in $opts.
Parent class for all special pages.
setup( $parameters)
Create a FormOptions object with options as specified by the user.
getRequest()
Get the WebRequest being used for this instance.
getUser()
Get the User object.
getCustomFilters()
Get custom show/hide filters.
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
addModules()
Add page-specific modules.
Interface for objects which can provide a context on request.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getDefaultOptions()
Get a FormOptions object containing the default options.
static selectFields()
Return the list of recentchanges fields that should be selected to create a new recentchanges object.
static closeElement( $element)
Shortcut to close an XML element.
getDB()
Return a DatabaseBase object for reading.
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
setBottomText(FormOptions $opts)
Send the text to be displayed after the options.
validateOptions(FormOptions $opts)
Validate a FormOptions object generated by getDefaultOptions() with values already populated.
getOptions()
Get the current FormOptions for this request.
static getAssociated( $index)
Get the associated namespace.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
including( $x=null)
Whether the special page is being evaluated via transclusion.
setTopText(FormOptions $opts)
Send the text to be displayed before the options.