46 $this->rcSubpage = $subpage;
54 if ( $rows ===
false ) {
64 foreach ( $rows
as $row ) {
67 $batch->add( $row->rc_namespace, $row->rc_title );
70 foreach ( $formatter->getPreloadTitles()
as $title ) {
100 if ( $this->rcOptions === null ) {
101 $this->rcOptions = $this->
setup( $this->rcSubpage );
114 public function setup( $parameters ) {
117 $opts->add( $key,
$params[
'default'] );
123 if ( $parameters !== null ) {
142 $opts->add(
'hideminor',
false );
143 $opts->add(
'hidebots',
false );
144 $opts->add(
'hideanons',
false );
145 $opts->add(
'hideliu',
false );
146 $opts->add(
'hidepatrolled',
false );
147 $opts->add(
'hidemyself',
false );
149 if ( $config->get(
'RCWatchCategoryMembership' ) ) {
150 $opts->add(
'hidecategorization',
false );
154 $opts->add(
'invert',
false );
155 $opts->add(
'associated',
false );
166 if ( $this->customFilters === null ) {
167 $this->customFilters = [];
168 Hooks::run(
'ChangesListSpecialPageFilters', [ $this, &$this->customFilters ] );
183 $opts->fetchValuesFromRequest( $this->
getRequest() );
221 $hideanons = $opts[
'hideanons'];
222 if ( $opts[
'hideanons'] && $opts[
'hideliu'] ) {
223 if ( $opts[
'hidebots'] ) {
231 if ( $opts[
'hideminor'] ) {
232 $conds[
'rc_minor'] = 0;
234 if ( $opts[
'hidebots'] ) {
235 $conds[
'rc_bot'] = 0;
237 if (
$user->useRCPatrol() && $opts[
'hidepatrolled'] ) {
238 $conds[
'rc_patrolled'] = 0;
241 $conds[
'rc_bot'] = 1;
243 if ( $opts[
'hideliu'] ) {
244 $conds[] =
'rc_user = 0';
247 $conds[] =
'rc_user != 0';
250 if ( $opts[
'hidemyself'] ) {
251 if (
$user->getId() ) {
252 $conds[] =
'rc_user != ' .
$dbr->addQuotes(
$user->getId() );
254 $conds[] =
'rc_user_text != ' .
$dbr->addQuotes(
$user->getName() );
257 if ( $this->
getConfig()->get(
'RCWatchCategoryMembership' )
258 && $opts[
'hidecategorization'] ===
true
264 if ( $opts[
'namespace'] !==
'' ) {
265 $selectedNS =
$dbr->addQuotes( $opts[
'namespace'] );
266 $operator = $opts[
'invert'] ?
'!=' :
'=';
267 $boolean = $opts[
'invert'] ?
'AND' :
'OR';
270 if ( !$opts[
'associated'] ) {
271 $condition =
"rc_namespace $operator $selectedNS";
274 $associatedNS =
$dbr->addQuotes(
277 $condition =
"(rc_namespace $operator $selectedNS "
279 .
" rc_namespace $operator $associatedNS)";
282 $conds[] = $condition;
329 &$query_options, &$join_conds, $opts
332 'ChangesListSpecialPageQuery',
333 [ $this->
getName(), &
$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ]
355 $this->
doHeader( $opts, $rows->numRows() );
430 # The legend showing what the letters and stuff mean
432 # Iterates through them and gets the messages for both letter and tooltip
433 $legendItems =
$context->getConfig()->get(
'RecentChangesFlags' );
434 if ( !(
$user->useRCPatrol() ||
$user->useNPPatrol() ) ) {
435 unset( $legendItems[
'unpatrolled'] );
437 foreach ( $legendItems
as $key => $item ) { # generate items
of the legend
438 $label = isset( $item[
'legend'] ) ? $item[
'legend'] : $item[
'title'];
439 $letter = $item[
'letter'];
440 $cssClass = isset( $item[
'class'] ) ? $item[
'class'] : $key;
443 [
'class' => $cssClass ],
$context->msg( $letter )->text()
452 [
'class' =>
'mw-plusminus-pos' ],
453 $context->msg(
'recentchanges-legend-plusminus' )->parse()
457 [
'class' =>
'mw-changeslist-legend-plusminus' ],
458 $context->msg(
'recentchanges-label-plusminus' )->text()
464 '<div class="mw-changeslist-legend">' .
465 $context->msg(
'recentchanges-legend-heading' )->parse() .
466 '<div class="mw-collapsible-content">' . $legend .
'</div>' .
478 $out->addModuleStyles( [
479 'mediawiki.special.changeslist.legend',
480 'mediawiki.special.changeslist',
482 $out->addModules(
'mediawiki.special.changeslist.legend.js' );
webOutput($rows, $opts)
Send output to the OutputPage object, only called if not used feeds.
#define the
table suitable for use with IDatabase::select()
static closeElement($element)
Returns "$element>".
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
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 $out
getContext()
Gets the context this SpecialPage is executed in.
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
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
database rows
outputFeedLinks()
Output feed links.
static escapeClass($class)
Given a value, escape it so that it can be used as a CSS class and return it.
including($x=null)
Whether the special page is being evaluated via transclusion.
getOutput()
Get the OutputPage being used for this instance.
setTopText(FormOptions $opts)
Send the text to be displayed before the options.
buildMainQueryConds(FormOptions $opts)
Return an array of conditions depending of options set in $opts.
getOptions()
Get the current FormOptions for this request.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist & $tables
setup($parameters)
Create a FormOptions object with options as specified by the user.
outputHeader($summaryMessageKey= '')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
getExtraOptions($opts)
Get options to be displayed in a form.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
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 true
Parent class for all special pages.
static openElement($element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
getCustomFilters()
Get custom show/hide filters.
getDefaultOptions()
Get a FormOptions object containing the default options.
getDB()
Return a IDatabase object for reading.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes! ...
namespace and then decline to actually register it file or subcat img or subcat $title
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
setBottomText(FormOptions $opts)
Send the text to be displayed after the options.
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 selectFields()
Return the list of recentchanges fields that should be selected to create a new recentchanges object...
outputChangesList($rows, $opts)
Build and output the actual changes list.
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 local account $user
execute($subpage)
Main execution point.
validateOptions(FormOptions $opts)
Validate a FormOptions object generated by getDefaultOptions() with values already populated...
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
getRows()
Get the database result for this special page instance.
getName()
Get the name of this Special Page.
Special page which uses a ChangesList to show query results.
getUser()
Shortcut to get the User executing this instance.
doMainQuery($conds, $opts)
Process the query.
getConfig()
Shortcut to get main config object.
runMainQueryHook(&$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts)
doHeader($opts, $numRows)
Set the text to be displayed above the changes.
getRequest()
Get the WebRequest being used for this instance.
parseParameters($par, FormOptions $opts)
Process $par and put options found in $opts.
makeLegend()
Return the legend displayed within the fieldset.
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static getAssociated($index)
Get the associated namespace.
fetchOptionsFromRequest($opts)
Fetch values for a FormOptions object from the WebRequest associated with this instance.
addModules()
Add page-specific modules.