* @author Matthew Flaschen
*/
+use Wikimedia\Rdbms\IDatabase;
+
/**
* An individual filter in a boolean group
*
* to true. It does not need to be set if the exact same filter is simply visible
* on both.
* $filterDefinition['default'] bool Default
- * $filterDefinition['isAllowedCallable'] callable Callable taking two parameters,
- * the class name of the special page and an IContextSource, and returning true
- * if and only if the current user is permitted to use this filter on the current
- * wiki. If it returns false, it will both hide the UI (in all UIs) and prevent
- * the DB query modification from taking effect. (optional, defaults to allowed)
* $filterDefinition['priority'] int Priority integer. Higher value means higher
* up in the group's filter list.
* $filterDefinition['queryCallable'] callable Callable accepting parameters, used
}
/**
+ * Get the default value
+ *
+ * @param bool $structuredUI Are we currently showing the structured UI
* @return bool|null Default value
*/
- public function getDefault() {
- return $this->defaultValue;
+ public function getDefault( $structuredUI = false ) {
+ return $this->isReplacedInStructuredUi && $structuredUI ?
+ false :
+ $this->defaultValue;
}
/**
/**
* @inheritdoc
*/
- public function displaysOnUnstructuredUi( ChangesListSpecialPage $specialPage ) {
- return $this->showHide &&
- $this->isAllowed( $specialPage );
+ public function displaysOnUnstructuredUi() {
+ return !!$this->showHide;
}
/**
* @inheritdoc
*/
- public function isFeatureAvailableOnStructuredUi( ChangesListSpecialPage $specialPage ) {
+ public function isFeatureAvailableOnStructuredUi() {
return $this->isReplacedInStructuredUi ||
- parent::isFeatureAvailableOnStructuredUi( $specialPage );
+ parent::isFeatureAvailableOnStructuredUi();
}
/**