Matmarex has uploaded a new change for review. https://gerrit.wikimedia.org/r/78464
Change subject: Preferences: Show search namespace options in a matrix ...................................................................... Preferences: Show search namespace options in a matrix Use a table with two columns for content and talk namespaces instead of a flat list. Helpful comparison table: Before | After ------------------------------+------------------------------ | Content Talk ✓ (Main) | (Main) ✓ ✓ ✓ Talk | User ✓ ✓ ✓ User | Project ✓ ✓ ✓ User talk | ... ✓ Project | ✓ Project talk | ... | Bug: 37878 Change-Id: Iaffe9ecfe14d5f5cbe6cf9744c97246016765b66 --- M includes/Preferences.php M languages/messages/MessagesEn.php M languages/messages/MessagesQqq.php M maintenance/language/messages.inc 4 files changed, 46 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/64/78464/1 diff --git a/includes/Preferences.php b/includes/Preferences.php index 709f15c..2a0c98f 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1024,23 +1024,42 @@ $defaultPreferences['searcheverything'] = array( 'type' => 'toggle', 'label-message' => 'searcheverything-enable', - 'section' => 'searchoptions/advancedsearchoptions', + 'section' => 'searchoptions/searchnamespaces', ); - $nsOptions = $wgContLang->getFormattedNamespaces(); - $nsOptions[0] = $context->msg( 'blanknamespace' )->text(); - foreach ( $nsOptions as $ns => $name ) { - if ( $ns < 0 ) { - unset( $nsOptions[$ns] ); + $columns = array( + $context->msg( 'preferences-content-namespaces' )->escaped() => 0, + $context->msg( 'preferences-talk-namespaces' )->escaped() => 1, + ); + $rows = array(); + $custom = array(); + foreach ( $wgContLang->getFormattedNamespaces() as $namespaceNumber => $namespace ) { + if ( $namespaceNumber === 0 ) { + $namespace = $context->msg( 'blanknamespace' )->text(); } + + // Skip Special: and Media: + if ( $namespaceNumber < 0 ) { + continue; + } + + // Add a new row when processing a content namespace; + // set up custom field for both content and talk ones. + $isTalk = $namespaceNumber % 2; + $correspondingContentNamespaceNumber = $namespaceNumber - $isTalk; + if ( !$isTalk ) { + $rows[$namespace] = $namespaceNumber; + } + $custom["$isTalk-$correspondingContentNamespaceNumber"] = $namespaceNumber; } $defaultPreferences['searchnamespaces'] = array( - 'type' => 'multiselect', - 'label-message' => 'defaultns', - 'options' => array_flip( $nsOptions ), - 'section' => 'searchoptions/advancedsearchoptions', + 'type' => 'checkmatrix', + 'rows' => $rows, + 'columns' => $columns, + 'custom' => $custom, 'prefix' => 'searchNs', + 'section' => 'searchoptions/searchnamespaces', ); } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 75e3532..074d2d2 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1856,7 +1856,6 @@ 'search-interwiki-more' => '(more)', 'search-relatedarticle' => 'Related', 'mwsuggest-disable' => 'Disable search suggestions', -'searcheverything-enable' => 'Search in all namespaces', 'searchrelated' => 'related', 'searchall' => 'all', 'showingresults' => "Showing below up to {{PLURAL:$1|'''1''' result|'''$1''' results}} starting with #'''$2'''.", @@ -1962,8 +1961,10 @@ 'timezoneregion-pacific' => 'Pacific Ocean', 'allowemail' => 'Enable email from other users', 'prefs-searchoptions' => 'Search', -'prefs-namespaces' => 'Namespaces', -'defaultns' => 'Otherwise search in these namespaces:', +'prefs-searchnamespaces' => 'Search in these namespaces', +'searcheverything-enable' => 'All namespaces (overrides options below)', +'preferences-content-namespaces'=> 'Content', +'preferences-talk-namespaces' => 'Talk', 'default' => 'default', 'prefs-files' => 'Files', 'prefs-custom-css' => 'Custom CSS', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index fa03f4a..ac7088c 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -2511,7 +2511,6 @@ 'search-relatedarticle' => 'This is a search result (and I guess search engine) dependent messages. I do not know how to trigger the feature. The message is displayed if the search result contains information that related pages can also be provided from the search engine. I assume this is "More Like This" functionality. Microsoft glossary defines MLT as "A way to refine search by identifying the right set of documents and then locating similar documents. This allows the searcher to control the direction of the search and focus on the most fruitful lines of inquiry."[http://www.microsoft.com/enterprisesearch/en/us/search-glossary.aspx] {{Identical|Related}}', 'mwsuggest-disable' => "The text of an option on the 'search options' tab of a user's Preferences.", -'searcheverything-enable' => 'Used in [[Special:Preferences]], tab "Search".', 'searchrelated' => 'This is a search result (and I guess search engine) dependent messages. I do not know how to trigger the feature. The message is displayed if the search result contains information that related pages can also be provided from the search engine. I assume this is "More Like This" functionality. Microsoft glossary defines MLT as "A way to refine search by identifying the right set of documents and then locating similar documents. This allows the searcher to control the direction of the search and focus on the most fruitful lines of inquiry."[http://www.microsoft.com/enterprisesearch/en/us/search-glossary.aspx] {{Identical|Related}}', 'searchall' => '{{Identical|All}}', @@ -2670,8 +2669,16 @@ {{Related|Timezoneregion}}', 'allowemail' => 'Used in [[Special:Preferences]] > {{int:prefs-personal}} > {{int:email}}.', 'prefs-searchoptions' => '{{Identical|Search}}', -'prefs-namespaces' => "Shown as legend of the second fieldset of the tab 'Search' in [[Special:Preferences]] +'prefs-searchnamespaces' => "Shown as legend of the second fieldset of the tab 'Search' in [[Special:Preferences]] {{Identical|Namespaces}}", +'searcheverything-enable' => 'Used in [[Special:Preferences]], tab "Search".', +'preferences-content-namespaces' => 'Used in [[Special:Preferences]], tab "Search". +Header of a column with checkboxes for all content (non-talk) namespaces. +See also {{msg-mw|preferences-talk-namespaces}},', +'preferences-talk-namespaces' => 'Used in [[Special:Preferences]], tab "Search". +Header of a column with checkboxes for all talk namespaces. +See also {{msg-mw|preferences-content-namespaces}},', + 'defaultns' => 'Used in [[Special:Preferences]], tab "Search".', 'default' => '{{Identical|Default}}', 'prefs-files' => 'Title of a tab in [[Special:Preferences]]. diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index aa9fa9e..5907916 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -996,7 +996,6 @@ 'search-interwiki-more', 'search-relatedarticle', 'mwsuggest-disable', - 'searcheverything-enable', 'searchrelated', 'searchall', 'showingresults', @@ -1085,10 +1084,11 @@ 'timezoneregion-pacific', 'allowemail', 'prefs-searchoptions', - 'prefs-namespaces', - 'defaultns', + 'prefs-searchnamespaces', + 'searcheverything-enable', + 'preferences-content-namespaces', + 'preferences-talk-namespaces', 'default', - 'defaultns', 'prefs-files', 'prefs-custom-css', 'prefs-custom-js', -- To view, visit https://gerrit.wikimedia.org/r/78464 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaffe9ecfe14d5f5cbe6cf9744c97246016765b66 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Matmarex <matma....@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits