Go to the documentation of this file.
139 if ( isset( $filterDefinition[
'group'] ) ) {
140 $this->
group = $filterDefinition[
'group'];
142 throw new MWException(
'You must use \'group\' to specify the ' .
143 'ChangesListFilterGroup this filter belongs to' );
146 if ( strpos( $filterDefinition[
'name'], self::RESERVED_NAME_CHAR ) !==
false ) {
147 throw new MWException(
'Filter names may not contain \'' .
148 self::RESERVED_NAME_CHAR .
149 '\'. Use the naming convention: \
'lowercase\''
153 if ( $this->
group->getFilter( $filterDefinition[
'name'] ) ) {
154 throw new MWException(
'Two filters in a group cannot have the ' .
155 "same name: '{$filterDefinition['name']}'" );
158 $this->
name = $filterDefinition[
'name'];
160 if ( isset( $filterDefinition[
'cssClassSuffix'] ) ) {
161 $this->cssClassSuffix = $filterDefinition[
'cssClassSuffix'];
162 $this->isRowApplicableCallable = $filterDefinition[
'isRowApplicableCallable'];
165 if ( isset( $filterDefinition[
'label'] ) ) {
166 $this->label = $filterDefinition[
'label'];
167 $this->description = $filterDefinition[
'description'];
170 $this->priority = $filterDefinition[
'priority'];
172 $this->
group->registerFilter( $this );
193 if ( $globalKey ===
null || $forwardKey ===
null ||
194 $backwardKey ===
null ) {
196 throw new MWException(
'All messages must be specified' );
205 $other->setUnidirectionalConflict(
225 $contextDescription ) {
228 $this->conflictingGroups[] = [
229 'group' => $other->getName(),
230 'groupObject' => $other,
231 'globalDescription' => $globalDescription,
232 'contextDescription' => $contextDescription,
235 $this->conflictingFilters[] = [
236 'group' => $other->getGroup()->getName(),
237 'filter' => $other->getName(),
238 'filterObject' => $other,
239 'globalDescription' => $globalDescription,
240 'contextDescription' => $contextDescription,
243 throw new MWException(
'You can only pass in a ChangesListFilterGroup or a ChangesListFilter' );
258 throw new MWException(
'Supersets can only be defined for filters in the same group' );
261 $this->subsetFilters[] = [
264 'group' => $other->
getGroup()->getName(),
311 return $this->label !==
null;
337 if ( $this->cssClassSuffix !==
null ) {
352 if ( $this->isRowApplicableCallable ===
null ) {
356 if ( call_user_func( $this->isRowApplicableCallable, $ctx, $rc ) ) {
384 $conflicts = array_merge(
385 $this->conflictingGroups,
386 $this->conflictingFilters
389 foreach ( $conflicts
as $conflictInfo ) {
390 unset( $conflictInfo[
'filterObject'] );
391 unset( $conflictInfo[
'groupObject'] );
392 $output[
'conflicts'][] = $conflictInfo;
395 $conflictInfo[
'globalDescription'],
396 $conflictInfo[
'contextDescription']
418 function ( $conflictDesc ) {
419 return $conflictDesc[
'groupObject' ];
432 function ( $conflictDesc ) {
433 return $conflictDesc[
'filterObject' ];
450 if ( $siblingFilter->isSelected( $opts ) && !$siblingFilter->hasConflictWithGroup(
$group ) ) {
471 if ( $this->
isSelected( $opts ) && $filter->isSelected( $opts ) ) {
475 $siblingFilter->isSelected( $opts ) &&
476 !$siblingFilter->hasConflictWithFilter( $filter )
498 function ( $filter ) {
499 return $filter !== $this;
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.
hasConflictWithFilter(ChangeslistFilter $filter)
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.
activelyInConflictWithFilter(ChangeslistFilter $filter, FormOptions $opts)
Check if the conflict with a filter is currently "active".
$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.
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.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object & $output
getCssClass()
Gets the CSS class.
Interface for objects which can provide a MediaWiki context on request.
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
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
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at name
__construct(array $filterDefinition)
Creates a new filter with the specified configuration, and registers it to the specified group.
no text was provided for refs named< code > blankwithnoreference</code ></span ></li ></ol ></div > ! 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
getConflictingFilters()
Get filters conflicting with this filter.
the array() calling protocol came about after MediaWiki 1.4rc1.