BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
ChangesListSpecialPage Class Reference
Inheritance diagram for ChangesListSpecialPage:
Collaboration diagram for ChangesListSpecialPage:

Public Member Functions

 __construct ($name, $restriction)
 
 execute ($subpage)
 
 getRows ()
 
 getOptions ()
 
 setup ($parameters)
 
 registerFilterGroup (ChangesListFilterGroup $group)
 
 getFilterGroup ($groupName)
 
 getStructuredFilterJsData ()
 
 parseParameters ($par, FormOptions $opts)
 
 validateOptions (FormOptions $opts)
 
 replaceOldOptions (FormOptions $opts)
 
 webOutput ($rows, $opts)
 
 outputFeedLinks ()
 
 outputChangesList ($rows, $opts)
 
 doHeader ($opts, $numRows)
 
 setTopText (FormOptions $opts)
 
 setBottomText (FormOptions $opts)
 
 getExtraOptions ($opts)
 
 makeLegend ()
 
 filterOnUserExperienceLevel ($specialPageClassName, $context, $dbr, &$tables, &$fields, &$conds, &$query_options, &$join_conds, $selectedExpLevels, $now=0)
 
 isStructuredFilterUiEnabled ()
 
 isStructuredFilterUiEnabledByDefault ()
 
 getDefaultLimit ()
 
 getDefaultDays ()
 
- Public Member Functions inherited from SpecialPage
 __construct ($name= '', $restriction= '', $listed=true, $function=false, $file= '', $includable=false)
 
 getName ()
 
 getRestriction ()
 
 isListed ()
 
 setListed ($listed)
 
 listed ($x=null)
 
 isIncludable ()
 
 maxIncludeCacheTime ()
 
 including ($x=null)
 
 getLocalName ()
 
 isExpensive ()
 
 isCached ()
 
 isRestricted ()
 
 userCanExecute (User $user)
 
 displayRestrictionError ()
 
 checkPermissions ()
 
 checkReadOnly ()
 
 requireLogin ($reasonMsg= 'exception-nologin-text', $titleMsg= 'exception-nologin')
 
 prefixSearchSubpages ($search, $limit, $offset)
 
 setHeaders ()
 
 run ($subPage)
 
 execute ($subPage)
 
 outputHeader ($summaryMessageKey= '')
 
 getDescription ()
 
 getTitle ($subpage=false)
 
 getPageTitle ($subpage=false)
 
 setContext ($context)
 
 getContext ()
 
 getRequest ()
 
 getOutput ()
 
 getUser ()
 
 getSkin ()
 
 getLanguage ()
 
 getConfig ()
 
 getFullTitle ()
 
 msg ($key)
 
 addHelpLink ($to, $overrideBaseUrl=false)
 
 getFinalGroupName ()
 
 doesWrites ()
 
 getLinkRenderer ()
 
 setLinkRenderer (LinkRenderer $linkRenderer)
 

Static Public Member Functions

static checkStructuredFilterUiEnabled (Config $config, User $user)
 
- Static Public Member Functions inherited from SpecialPage
static getTitleFor ($name, $subpage=false, $fragment= '')
 
static getTitleValueFor ($name, $subpage=false, $fragment= '')
 
static getSafeTitleFor ($name, $subpage=false)
 

Public Attributes

const TAG_DESC_CHARACTER_LIMIT = 120
 

Protected Member Functions

 considerActionsForDefaultSavedQuery ($subpage)
 
 includeRcFiltersApp ()
 
 getChangeTagList ()
 
 outputNoResults ()
 
 outputTimeout ()
 
 registerFilters ()
 
 transformFilterDefinition (array $filterDefinition)
 
 registerFiltersFromDefinitions (array $definition)
 
 getFilterGroupDefinitionFromLegacyCustomFilters (array $customFilters)
 
 getLegacyShowHideFilters ()
 
 getFilterGroups ()
 
 getCustomFilters ()
 
 fetchOptionsFromRequest ($opts)
 
 convertParamsForLink ($params)
 
 doMainQuery ($tables, $fields, $conds, $query_options, $join_conds, FormOptions $opts)
 
 runMainQueryHook (&$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts)
 
 getDB ()
 
 addModules ()
 
 getGroupName ()
 
- Protected Member Functions inherited from SpecialPage
 getCacheTTL ()
 
 getLoginSecurityLevel ()
 
 checkLoginSecurityLevel ($level=null)
 
 getSubpagesForPrefixSearch ()
 
 prefixSearchString ($search, $limit, $offset)
 
 beforeExecute ($subPage)
 
 afterExecute ($subPage)
 
 getRobotPolicy ()
 
 addFeedLinks ($params)
 
 getGroupName ()
 
 useTransactionalTimeLimit ()
 

Protected Attributes

 $rcSubpage
 
 $rcOptions
 
 $customFilters
 
 $filterGroups = []
 
- Protected Attributes inherited from SpecialPage
 $mName
 
 $mRestriction
 
 $mIncluding
 
 $mIncludable
 
 $mContext
 

Static Protected Attributes

static $savedQueriesPreferenceName
 
static $daysPreferenceName
 
static $limitPreferenceName
 

Additional Inherited Members

- Static Protected Member Functions inherited from SpecialPage
static prefixSearchArray ($search, $limit, array $subpages, $offset)
 

Detailed Description

Special page which uses a ChangesList to show query results.

Todo:
Way too many public functions, most of them should be protected

Member Function Documentation

ChangesListSpecialPage::addModules ( )
protected

Add page-specific modules.

static ChangesListSpecialPage::checkStructuredFilterUiEnabled ( Config  $config,
User  $user 
)
static

Static method to check whether StructuredFilter UI is enabled for the given user

Since
1.31
Parameters
Config$config
User$user
Returns
bool
ChangesListSpecialPage::considerActionsForDefaultSavedQuery (   $subpage)
protected

Check whether or not the page should load defaults, and if so, whether a default saved query is relevant to be redirected to. If it is relevant, redirect properly with all necessary query parameters.

Parameters
string$subpage
ChangesListSpecialPage::convertParamsForLink (   $params)
protected

Convert parameters values from true/false to 1/0 so they are not omitted by wfArrayToCgi() Bug 36524

Parameters
array$params
Returns
array
ChangesListSpecialPage::doHeader (   $opts,
  $numRows 
)

Set the text to be displayed above the changes

Parameters
FormOptions$opts
int$numRowsNumber of rows in the result to show after this header
ChangesListSpecialPage::doMainQuery (   $tables,
  $fields,
  $conds,
  $query_options,
  $join_conds,
FormOptions  $opts 
)
protected

Process the query

Parameters
array$tablesArray of tables; see IDatabase::select $table
array$fieldsArray of fields; see IDatabase::select $vars
array$condsArray of conditions; see IDatabase::select $conds
array$query_optionsArray of query options; see IDatabase::select $options
array$join_condsArray of join conditions; see IDatabase::select $join_conds
FormOptions$opts
Returns
bool|IResultWrapper Result or false
ChangesListSpecialPage::execute (   $subpage)

Main execution point

Parameters
string$subpage
ChangesListSpecialPage::fetchOptionsFromRequest (   $opts)
protected

Fetch values for a FormOptions object from the WebRequest associated with this instance.

Intended for subclassing, e.g. to add a backwards-compatibility layer.

Parameters
FormOptions$opts
Returns
FormOptions
ChangesListSpecialPage::filterOnUserExperienceLevel (   $specialPageClassName,
  $context,
  $dbr,
$tables,
$fields,
$conds,
$query_options,
$join_conds,
  $selectedExpLevels,
  $now = 0 
)

Filter on users' experience levels; this will not be called if nothing is selected.

Parameters
string$specialPageClassNameClass name of current special page
IContextSource$contextContext, for e.g. user
IDatabase$dbrDatabase, for addQuotes, makeList, and similar
array&$tablesArray of tables; see IDatabase::select $table
array&$fieldsArray of fields; see IDatabase::select $vars
array&$condsArray of conditions; see IDatabase::select $conds
array&$query_optionsArray of query options; see IDatabase::select $options
array&$join_condsArray of join conditions; see IDatabase::select $join_conds
array$selectedExpLevelsThe allowed active values, sorted
int$nowNumber of seconds since the UNIX epoch, or 0 if not given (optional)
ChangesListSpecialPage::getChangeTagList ( )
protected

Fetch the change tags list for the front end

Returns
Array Tag data
ChangesListSpecialPage::getCustomFilters ( )
protected

Get custom show/hide filters using deprecated ChangesListSpecialPageFilters hook.

Returns
array Map of filter URL param names to properties (msg/default)
ChangesListSpecialPage::getDB ( )
protected

Return a IDatabase object for reading

Returns
IDatabase
ChangesListSpecialPage::getDefaultDays ( )

Get the default value of the number of days to display when loading the result set. Supports fractional values, and should be cast to a float.

Since
1.30
Returns
float
ChangesListSpecialPage::getDefaultLimit ( )

Get the default value of the number of changes to display when loading the result set.

Since
1.30
Returns
int
ChangesListSpecialPage::getExtraOptions (   $opts)

Get options to be displayed in a form

Todo:

This should handle options returned by getDefaultOptions().

Not called by anything in this class (but is in subclasses), should be called by something… doHeader() maybe?

Parameters
FormOptions$opts
Returns
array
ChangesListSpecialPage::getFilterGroup (   $groupName)

Gets a specified ChangesListFilterGroup by name

Parameters
string$groupNameName of group
Returns
ChangesListFilterGroup|null Group, or null if not registered
ChangesListSpecialPage::getFilterGroupDefinitionFromLegacyCustomFilters ( array  $customFilters)
protected

Get filter group definition from legacy custom filters

Parameters
array$customFiltersCustom filters from legacy hooks
Returns
array Group definition
ChangesListSpecialPage::getFilterGroups ( )
protected

Gets the currently registered filters groups

Returns
array Associative array of ChangesListFilterGroup objects, with group name as key
ChangesListSpecialPage::getLegacyShowHideFilters ( )
protected
Returns
array The legacy show/hide toggle filters
ChangesListSpecialPage::getOptions ( )

Get the current FormOptions for this request

Returns
FormOptions
ChangesListSpecialPage::getRows ( )

Get the database result for this special page instance. Used by ApiFeedRecentChanges.

Returns
bool|IResultWrapper Result or false
ChangesListSpecialPage::getStructuredFilterJsData ( )

Gets structured filter information needed by JS

Returns
array Associative array
  • array $return['groups'] Group data
  • array $return['messageKeys'] Array of message keys
ChangesListSpecialPage::includeRcFiltersApp ( )
protected

Include the modules and configuration for the RCFilters app. Conditional on the user having the feature enabled.

If it is disabled, add a <body> class marking that

ChangesListSpecialPage::isStructuredFilterUiEnabled ( )

Check whether the structured filter UI is enabled

Returns
bool
ChangesListSpecialPage::isStructuredFilterUiEnabledByDefault ( )

Check whether the structured filter UI is enabled by default (regardless of this particular user's setting)

Returns
bool
ChangesListSpecialPage::makeLegend ( )

Return the legend displayed within the fieldset

Returns
string
ChangesListSpecialPage::outputChangesList (   $rows,
  $opts 
)
abstract

Build and output the actual changes list.

Parameters
IResultWrapper$rowsDatabase rows
FormOptions$opts
ChangesListSpecialPage::outputFeedLinks ( )

Output feed links.

ChangesListSpecialPage::outputNoResults ( )
protected

Add the "no results" message to the output

ChangesListSpecialPage::outputTimeout ( )
protected

Add the "timeout" message to the output

ChangesListSpecialPage::parseParameters (   $par,
FormOptions  $opts 
)

Process $par and put options found in $opts. Used when including the page.

Parameters
string$par
FormOptions$opts
ChangesListSpecialPage::registerFilterGroup ( ChangesListFilterGroup  $group)

Register a structured changes list filter group

Parameters
ChangesListFilterGroup$group
ChangesListSpecialPage::registerFilters ( )
protected

Register all filters and their groups (including those from hooks), plus handle conflicts and defaults.

You might want to customize these in the same method, in subclasses. You can call getFilterGroup to access a group, and (on the group) getFilter to access a filter, then make necessary modfications to the filter or group (e.g. with setDefault).

ChangesListSpecialPage::registerFiltersFromDefinitions ( array  $definition)
protected

Register filters from a definition object

Array specifying groups and their filters; see Filter and ChangesListFilterGroup constructors.

There is light processing to simplify core maintenance.

Parameters
array$definition
ChangesListSpecialPage::replaceOldOptions ( FormOptions  $opts)

Replace old options with their structured UI equivalents

Parameters
FormOptions$opts
Returns
bool True if the change was made
ChangesListSpecialPage::setBottomText ( FormOptions  $opts)

Send the text to be displayed after the options. Should use $this->getOutput()->addWikiText() or similar methods to print the text.

Parameters
FormOptions$opts
ChangesListSpecialPage::setTopText ( FormOptions  $opts)

Send the text to be displayed before the options. Should use $this->getOutput()->addWikiText() or similar methods to print the text.

Parameters
FormOptions$opts
ChangesListSpecialPage::setup (   $parameters)

Register all the filters, including legacy hook-driven ones. Then create a FormOptions object with options as specified by the user

Parameters
array$parameters
Returns
FormOptions
ChangesListSpecialPage::transformFilterDefinition ( array  $filterDefinition)
protected

Transforms filter definition to prepare it for constructor.

See overrides of this method as well.

Parameters
array$filterDefinitionOriginal filter definition
Returns
array Transformed definition
ChangesListSpecialPage::validateOptions ( FormOptions  $opts)

Validate a FormOptions object generated by getDefaultOptions() with values already populated.

Parameters
FormOptions$opts
ChangesListSpecialPage::webOutput (   $rows,
  $opts 
)

Send output to the OutputPage object, only called if not used feeds

Parameters
IResultWrapper$rowsDatabase rows
FormOptions$opts

Member Data Documentation

array ChangesListSpecialPage::$filterGroups = []
protected

Filter groups, and their contained filters This is an associative array (with group name as key) of ChangesListFilterGroup objects.

const ChangesListSpecialPage::TAG_DESC_CHARACTER_LIMIT = 120

Maximum length of a tag description in UTF-8 characters. Longer descriptions will be truncated.


The documentation for this class was generated from the following file: