The value of the 'section' parameter is used to generate some ID
attributes on Special:Preferences. Awkwardly, only the second part
(after the slash) is used, so have to ensure these are unique.
It is also used for the default localisation message for the title of
the section. Override this so that we don't have to rename and
duplicate the messages.
Bug: T198875
Change-Id: I0f22aafc8b2ad860dd42c5373eafdf88e848e3ad
if ( $this->config->get( 'StructuredChangeFiltersShowPreference' ) ) {
$defaultPreferences['rcenhancedfilters-disable'] = [
'type' => 'toggle',
if ( $this->config->get( 'StructuredChangeFiltersShowPreference' ) ) {
$defaultPreferences['rcenhancedfilters-disable'] = [
'type' => 'toggle',
- 'section' => 'rc/opt-out',
+ 'section' => 'rc/optoutrc',
'label-message' => 'rcfilters-preference-label',
'help-message' => 'rcfilters-preference-help',
];
'label-message' => 'rcfilters-preference-label',
'help-message' => 'rcfilters-preference-help',
];
if ( $this->config->get( 'StructuredChangeFiltersShowWatchlistPreference' ) ) {
$defaultPreferences['wlenhancedfilters-disable'] = [
'type' => 'toggle',
if ( $this->config->get( 'StructuredChangeFiltersShowWatchlistPreference' ) ) {
$defaultPreferences['wlenhancedfilters-disable'] = [
'type' => 'toggle',
- 'section' => 'watchlist/opt-out',
+ 'section' => 'watchlist/optoutwatchlist',
'label-message' => 'rcfilters-watchlist-preference-label',
'help-message' => 'rcfilters-watchlist-preference-help',
];
'label-message' => 'rcfilters-watchlist-preference-label',
'help-message' => 'rcfilters-watchlist-preference-help',
];
* @return string
*/
function getLegend( $key ) {
* @return string
*/
function getLegend( $key ) {
- $legend = parent::getLegend( $key );
+ $aliasKey = ( $key === 'optoutwatchlist' || $key === 'optoutrc' ) ? 'opt-out' : $key;
+ $legend = parent::getLegend( $aliasKey );
Hooks::run( 'PreferencesGetLegend', [ $this, $key, &$legend ] );
return $legend;
}
Hooks::run( 'PreferencesGetLegend', [ $this, $key, &$legend ] );
return $legend;
}
* @return string
*/
function getLegend( $key ) {
* @return string
*/
function getLegend( $key ) {
- $legend = parent::getLegend( $key );
+ $aliasKey = ( $key === 'optoutwatchlist' || $key === 'optoutrc' ) ? 'opt-out' : $key;
+ $legend = parent::getLegend( $aliasKey );
Hooks::run( 'PreferencesGetLegend', [ $this, $key, &$legend ] );
return $legend;
}
Hooks::run( 'PreferencesGetLegend', [ $this, $key, &$legend ] );
return $legend;
}