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

Public Member Functions

 __construct ($filterDefinition)
 
 getDefault ($structuredUI=false)
 
 setDefault ($defaultValue)
 
 getShowHide ()
 
 displaysOnUnstructuredUi ()
 
 isFeatureAvailableOnStructuredUi ()
 
 modifyQuery (IDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds)
 
 getJsData ()
 
 isSelected (FormOptions $opts)
 
 isActive (FormOptions $opts, $isStructuredUI)
 
- Public Member Functions inherited from ChangesListFilter
 __construct (array $filterDefinition)
 
 conflictsWith ($other, $globalKey, $forwardKey, $backwardKey)
 
 setUnidirectionalConflict ($other, $globalDescription, $contextDescription)
 
 setAsSupersetOf (ChangesListFilter $other)
 
 getName ()
 
 getGroup ()
 
 getLabel ()
 
 getDescription ()
 
 displaysOnUnstructuredUi ()
 
 displaysOnStructuredUi ()
 
 isFeatureAvailableOnStructuredUi ()
 
 getPriority ()
 
 applyCssClassIfNeeded (IContextSource $ctx, RecentChange $rc, array &$classes)
 
 getJsData ()
 
 isSelected (FormOptions $opts)
 
 getConflictingGroups ()
 
 getConflictingFilters ()
 
 setDefaultHighlightColor ($defaultHighlightColor)
 

Protected Attributes

 $showHide
 
 $isReplacedInStructuredUi
 
 $defaultValue
 
 $queryCallable
 
 $activeValue
 
- Protected Attributes inherited from ChangesListFilter
 $name
 
 $cssClassSuffix
 
 $isRowApplicableCallable
 
 $group
 
 $label
 
 $description
 
 $conflictingGroups = []
 
 $conflictingFilters = []
 
 $subsetFilters = []
 
 $priority
 
 $defaultHighlightColor
 

Additional Inherited Members

- Public Attributes inherited from ChangesListFilter
const RESERVED_NAME_CHAR = '_'
 
- Protected Member Functions inherited from ChangesListFilter
 getCssClass ()
 
 getSiblings ()
 

Detailed Description

Represents a hide-based boolean filter (used on ChangesListSpecialPage and descendants)

Since
1.29

Constructor & Destructor Documentation

ChangesListBooleanFilter::__construct (   $filterDefinition)

Create a new filter with the specified configuration.

It infers which UI (it can be either or both) to display the filter on based on which messages are provided.

If 'label' is provided, it will be displayed on the structured UI. If 'showHide' is provided, it will be displayed on the unstructured UI. Thus, 'label', 'description', and 'showHide' are optional depending on which UI it's for.

Parameters
array$filterDefinitionChangesListFilter definition
  • $filterDefinition['name'] string Name. Used as URL parameter.
  • $filterDefinition['group'] ChangesListFilterGroup Group. Filter group this belongs to.
  • $filterDefinition['label'] string i18n key of label for structured UI.
  • $filterDefinition['description'] string i18n key of description for structured UI.
  • $filterDefinition['showHide'] string Main i18n key used for unstructured UI.
  • $filterDefinition['isReplacedInStructuredUi'] bool Whether there is an equivalent feature available in the structured UI; this is optional, defaulting to true. It does not need to be set if the exact same filter is simply visible on both.
  • $filterDefinition['default'] bool Default
  • $filterDefinition['activeValue'] bool This filter is considered active when its value is equal to its activeValue. Default is true.
  • $filterDefinition['priority'] int Priority integer. Higher value means higher up in the group's filter list.
  • $filterDefinition['queryCallable'] callable Callable accepting parameters, used to implement filter's DB query modification. Required, except for legacy filters that still use the query hooks directly. Callback parameters:
    • string $specialPageClassName Class name of current special page
    • IContextSource $context Context, for e.g. user
    • IDatabase $dbr Database, for addQuotes, makeList, and similar
    • array &$tables Array of tables; see IDatabase::select $table
    • array &$fields Array of fields; see IDatabase::select $vars
    • array &$conds Array of conditions; see IDatabase::select $conds
    • array &$query_options Array of query options; see IDatabase::select $options
    • array &$join_conds Array of join conditions; see IDatabase::select $join_conds

Member Function Documentation

ChangesListBooleanFilter::displaysOnUnstructuredUi ( )
ChangesListBooleanFilter::getDefault (   $structuredUI = false)

Get the default value

Parameters
bool$structuredUIAre we currently showing the structured UI
Returns
bool|null Default value
ChangesListBooleanFilter::getJsData ( )
ChangesListBooleanFilter::getShowHide ( )
Returns
string Main i18n key for unstructured UI
ChangesListBooleanFilter::isActive ( FormOptions  $opts,
  $isStructuredUI 
)
Parameters
FormOptions$optsQuery parameters merged with defaults
bool$isStructuredUIWhether the structured UI is currently enabled
Returns
bool Whether this filter should be considered active
ChangesListBooleanFilter::isFeatureAvailableOnStructuredUi ( )
ChangesListBooleanFilter::isSelected ( FormOptions  $opts)
ChangesListBooleanFilter::modifyQuery ( IDatabase  $dbr,
ChangesListSpecialPage  $specialPage,
$tables,
$fields,
$conds,
$query_options,
$join_conds 
)

Modifies the query to include the filter. This is only called if the filter is in effect (taking into account the default).

Parameters
IDatabase$dbrDatabase, for addQuotes, makeList, and similar
ChangesListSpecialPage$specialPageCurrent special page
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
ChangesListBooleanFilter::setDefault (   $defaultValue)

Sets default. It must be a boolean.

It will be coerced to boolean.

Parameters
bool$defaultValue

Member Data Documentation

bool ChangesListBooleanFilter::$activeValue
protected

Value that defined when this filter is considered active

bool ChangesListBooleanFilter::$defaultValue
protected

Default

bool ChangesListBooleanFilter::$isReplacedInStructuredUi
protected

Whether there is a feature designed to replace this filter available on the structured UI

callable ChangesListBooleanFilter::$queryCallable
protected

Callable used to do the actual query modification; see constructor

string ChangesListBooleanFilter::$showHide
protected

Main unstructured UI i18n key


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