Go to the documentation of this file.
143 if ( isset( $filterDefinition[
'group'] ) ) {
144 $this->
group = $filterDefinition[
'group'];
146 throw new MWException(
'You must use \'group\' to specify the ' .
147 'ChangesListFilterGroup this filter belongs to' );
150 if ( strpos( $filterDefinition[
'name'], self::RESERVED_NAME_CHAR ) !==
false ) {
151 throw new MWException(
'Filter names may not contain \'' .
152 self::RESERVED_NAME_CHAR .
153 '\'. Use the naming convention: \
'lowercase\''
157 if ( $this->
group->getFilter( $filterDefinition[
'name'] ) ) {
158 throw new MWException(
'Two filters in a group cannot have the ' .
159 "same name: '{$filterDefinition['name']}'" );
162 $this->
name = $filterDefinition[
'name'];
164 if ( isset( $filterDefinition[
'cssClassSuffix'] ) ) {
165 $this->cssClassSuffix = $filterDefinition[
'cssClassSuffix'];
166 $this->isRowApplicableCallable = $filterDefinition[
'isRowApplicableCallable'];
169 if ( isset( $filterDefinition[
'label'] ) ) {
170 $this->label = $filterDefinition[
'label'];
171 $this->description = $filterDefinition[
'description'];
174 $this->priority = $filterDefinition[
'priority'];
176 $this->
group->registerFilter( $this );
193 public function conflictsWith( $other, $globalKey, $forwardKey, $backwardKey ) {
194 if ( $globalKey ===
null || $forwardKey ===
null || $backwardKey ===
null ) {
195 throw new MWException(
'All messages must be specified' );
204 $other->setUnidirectionalConflict(
224 $this->conflictingGroups[] = [
225 'group' => $other->getName(),
226 'groupObject' => $other,
227 'globalDescription' => $globalDescription,
228 'contextDescription' => $contextDescription,
231 $this->conflictingFilters[] = [
232 'group' => $other->getGroup()->getName(),
233 'filter' => $other->getName(),
234 'filterObject' => $other,
235 'globalDescription' => $globalDescription,
236 'contextDescription' => $contextDescription,
239 throw new MWException(
'You can only pass in a ChangesListFilterGroup or a ChangesListFilter' );
254 throw new MWException(
'Supersets can only be defined for filters in the same group' );
257 $this->subsetFilters[] = [
260 'group' => $other->
getGroup()->getName(),
307 return $this->label !==
null;
334 if ( $this->cssClassSuffix !==
null ) {
349 if ( $this->isRowApplicableCallable ===
null ) {
353 if ( call_user_func( $this->isRowApplicableCallable, $ctx, $rc ) ) {
382 $conflicts = array_merge(
383 $this->conflictingGroups,
384 $this->conflictingFilters
387 foreach ( $conflicts
as $conflictInfo ) {
388 unset( $conflictInfo[
'filterObject'] );
389 unset( $conflictInfo[
'groupObject'] );
390 $output[
'conflicts'][] = $conflictInfo;
393 $conflictInfo[
'globalDescription'],
394 $conflictInfo[
'contextDescription']
416 function ( $conflictDesc ) {
417 return $conflictDesc[
'groupObject' ];
430 function ( $conflictDesc ) {
431 return $conflictDesc[
'filterObject' ];
448 if ( $siblingFilter->isSelected( $opts ) && !$siblingFilter->hasConflictWithGroup(
$group ) ) {
473 $siblingFilter->isSelected( $opts ) &&
474 !$siblingFilter->hasConflictWithFilter(
$filter )
activelyInConflictWithGroup(ChangesListFilterGroup $group, FormOptions $opts)
Check if the conflict with a group is currently "active".
isSelected(FormOptions $opts)
Checks whether this filter is selected in the provided options.
$subsetFilters
Array of associative arrays with subset information.
Utility class for creating new RC entries.
displaysOnUnstructuredUi()
Checks whether the filter should display on the unstructured UI.
setAsSupersetOf(ChangesListFilter $other)
Marks that the current instance is (also) a superset of the filter passed in.
$priority
Priority integer.
displaysOnStructuredUi()
Checks whether the filter should display on the structured UI This refers to the exact filter.
$isRowApplicableCallable
Callable that returns true if and only if a row is attributed to this filter.
Represents a filter group (used on ChangesListSpecialPage and descendants)
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
$cssClassSuffix
CSS class suffix used for attribution, e.g.
conflictsWith( $other, $globalKey, $forwardKey, $backwardKey)
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object.
hasConflictWithFilter(ChangesListFilter $filter)
and how to run hooks for an and one after Each event has a name
hasConflictWithGroup(ChangesListFilterGroup $group)
$label
i18n key of label for structured UI
getSiblings()
Get filters in the same group.
getConflictingGroups()
Get groups conflicting with this filter.
getJsData()
Gets the JS data required by the front-end of the structured UI.
applyCssClassIfNeeded(IContextSource $ctx, RecentChange $rc, array &$classes)
Add CSS class if needed.
isFeatureAvailableOnStructuredUi()
Checks whether an equivalent feature for this filter is available on the structured UI.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
getCssClass()
Gets the CSS class.
setDefaultHighlightColor( $defaultHighlightColor)
invalid e g too many</span ></p > ! end ! test with< references/> in group ! wikitext Wikipedia rocks< ref > Proceeds of vol XXI</ref > Wikipedia rocks< ref group="note"> Proceeds of vol XXI</ref >< references/>< references group="note"/> ! html< p > Wikipedia rocks< sup id="cite_ref-1" class="reference">< a href="#cite_note-1"> &Wikipedia rocks< sup id="cite_ref-2" class="reference">< a href="#cite_note-2"> &</p >< div class="mw-references-wrap">< ol class="references">< li id="cite_note-1">< span class="mw-cite-backlink">< a href="#cite_ref-1"> ↑</a ></span >< span class="reference-text"> Proceeds of vol XXI</span ></li ></ol ></div >< div class="mw-references-wrap">< ol class="references">< li id="cite_note-2">< span class="mw-cite-backlink">< a href="#cite_ref-2"> ↑</a ></span >< span class="reference-text"> Proceeds of vol XXI</span ></li ></ol ></div > ! end ! test with< references/> in group
Interface for objects which can provide a MediaWiki context on request.
$conflictingGroups
Array of associative arrays with conflict information.
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
activelyInConflictWithFilter(ChangesListFilter $filter, FormOptions $opts)
Check if the conflict with a filter is currently "active".
setUnidirectionalConflict( $other, $globalDescription, $contextDescription)
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object.
Represents a filter (used on ChangesListSpecialPage and descendants)
$description
i18n key of description for structured UI
$conflictingFilters
Array of associative arrays with conflict information.
__construct(array $filterDefinition)
Creates a new filter with the specified configuration, and registers it to the specified group.
getConflictingFilters()
Get filters conflicting with this filter.