From: glaisher Date: Tue, 20 Jan 2015 17:00:21 +0000 (+0500) Subject: Add links to Special:EditWatchlist in Preferences' Watchlist tab X-Git-Tag: 1.31.0-rc.0~12602^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=7719ea4b3ef97013121de14ce892bef5e9544ae2 Add links to Special:EditWatchlist in Preferences' Watchlist tab This adds a new "Edit watchlist" section to Watchlist tab with links to Special:EditWatchlist, EditWatchlist/raw and EditWatchlist/clear. Bug: T26632 Change-Id: Id31fba4f7aadaa3e427becece3837a8d00b7718f --- diff --git a/includes/Preferences.php b/includes/Preferences.php index 9e0a255634..84d4189524 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -919,6 +919,30 @@ class Preferences { $watchlistdaysMax = ceil( $config->get( 'RCMaxAge' ) / ( 3600 * 24 ) ); ## Watchlist ##################################### + if ( $user->isAllowed( 'editmywatchlist' ) ) { + $editWatchlistLinks = array(); + $editWatchlistModes = array( + 'edit' => array( 'EditWatchlist', false ), + 'raw' => array( 'EditWatchlist', 'raw' ), + 'clear' => array( 'EditWatchlist', 'clear' ), + ); + foreach ( $editWatchlistModes as $editWatchlistMode => $mode ) { + // Messages: prefs-editwatchlist-edit, prefs-editwatchlist-raw, prefs-editwatchlist-clear + $editWatchlistLinks[] = Linker::linkKnown( + SpecialPage::getTitleFor( $mode[0], $mode[1] ), + $context->msg( "prefs-editwatchlist-{$editWatchlistMode}" )->parse() + ); + } + + $defaultPreferences['editwatchlist'] = array( + 'type' => 'info', + 'raw' => true, + 'default' => $context->getLanguage()->pipeList( $editWatchlistLinks ), + 'label-message' => 'prefs-editwatchlist-label', + 'section' => 'watchlist/editwatchlist', + ); + } + $defaultPreferences['watchlistdays'] = array( 'type' => 'float', 'min' => 0, diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 56a2ee4f23..e70113779a 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -932,6 +932,11 @@ "prefs-personal": "User profile", "prefs-rc": "Recent changes", "prefs-watchlist": "Watchlist", + "prefs-editwatchlist": "Edit watchlist", + "prefs-editwatchlist-label": "Edit entries on your watchlist:", + "prefs-editwatchlist-edit": "View and remove titles on your watchlist", + "prefs-editwatchlist-raw": "Edit raw watchlist", + "prefs-editwatchlist-clear": "Clear your watchlist", "prefs-watchlist-days": "Days to show in watchlist:", "prefs-watchlist-days-max": "Maximum $1 {{PLURAL:$1|day|days}}", "prefs-watchlist-edits": "Maximum number of changes to show in expanded watchlist:", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 14345bf8c6..20fe0d6369 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -1101,6 +1101,11 @@ "prefs-watchlist-edits": "Used in [[Special:Preferences]], tab \"Watchlist\".", "prefs-watchlist-edits-max": "Shown as hint in [[Special:Preferences]], tab \"Watchlist\"", "prefs-watchlist-token": "Used in [[Special:Preferences]], tab Watchlist.", + "prefs-editwatchlist": "Used in [[Special:Preferences]], tab \"Watchlist\".", + "prefs-editwatchlist-label": "Used in [[Special:Preferences]], tab \"Watchlist\".", + "prefs-editwatchlist-edit": "Used in [[Special:Preferences]], tab \"Watchlist\". Link to [[Special:EditWatchlist]]\n\nSee also:\n* {{msg-mw|prefs-editwatchlist-clear}}\n* {{msg-mw|prefs-editwatchlist-raw}}", + "prefs-editwatchlist-raw": "Used in [[Special:Preferences]], tab \"Watchlist\". Link to [[Special:EditWatchlist/raw]].\n\nSee also:\n* {{msg-mw|prefs-editwatchlist-edit}}\n* {{msg-mw|prefs-editwatchlist-clear}}\n{{Identical|Edit raw watchlist}}", + "prefs-editwatchlist-clear": "Used in [[Special:Preferences]], tab \"Watchlist\". Link to [[Special:EditWatchlist/clear]].\n\nSee also:\n* {{msg-mw|prefs-editwatchlist-edit}}\n* {{msg-mw|prefs-editwatchlist-raw}}\n{{Identical|Clear watchlist}}", "prefs-misc": "Tab used on the [[Special:Preferences|user preferences]] special page.", "prefs-resetpass": "Button on user data tab in user preferences. When you click the button you go to the special page [[Special:ResetPass]].\n\n{{Identical|Change password}}", "prefs-changeemail": "Link on [[Special:Preferences]] to [[Special:ChangeEmail]].\n\nSee also:\n* {{msg-mw|prefs-help-email-required|help}}\n* {{msg-mw|prefs-help-email|help}}\n* {{msg-mw|prefs-help-email-others|help}}\n* {{msg-mw|prefs-setemail|link title}}",