From 15f6e36ffbb50698844a38b6d574832bc319c305 Mon Sep 17 00:00:00 2001 From: Danny B Date: Thu, 22 Jan 2009 23:31:31 +0000 Subject: [PATCH] * Added optional alternative Search form look - Go button & Advanced search link instead of Go button & Search button --- RELEASE-NOTES | 22 +++++++++++++--------- includes/DefaultSettings.php | 17 ++++++++++++----- includes/Skin.php | 14 ++++++++++---- skins/CologneBlue.php | 12 +++++++++--- skins/Modern.php | 8 ++++++-- skins/MonoBook.php | 8 ++++++-- skins/modern/main.css | 4 ++++ skins/monobook/main.css | 5 ++++- 8 files changed, 64 insertions(+), 26 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0f010615a0..2950d81caf 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -22,6 +22,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Added $wgNewPasswordExpiry, to specify an expiry time (in seconds) to temporary passwords +* Added $wgUseTwoButtonsSearchForm to choose the Search form behavior/look === New features in 1.15 === @@ -48,20 +49,23 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bugs 16957/16969) Add show/hide to preferences for RC patrol options on specialpages * (bug 11443) Auto-noindex user/user talk pages for blocked user -* (bug 11644) Add $wgMaxRedirects variable to control how many redirects are recursed - through until the "destination" page is reached. -* Add $wgInvalidRedirectTargets variable to prevent redirects to certain special pages. +* (bug 11644) Add $wgMaxRedirects variable to control how many redirects are + recursed through until the "destination" page is reached. +* Add $wgInvalidRedirectTargets variable to prevent redirects to certain + special pages. * Use HTML5 rel attributes for some links, where appropriate +* Added optional alternative Search form look - Go button & Advanced search + link instead of Go button & Search button === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. -* (bug 17000) Special:RevisionDelete now checks if the database is locked before - trying to delete the edit. +* (bug 17000) Special:RevisionDelete now checks if the database is locked + before trying to delete the edit. * (bug 16852) padleft and padright now handle multibyte characters correctly * (bug 17010) maintenance/namespaceDupes.php now add the suffix recursively if the destination page exists -* (bug 17035) Special:Upload now fails gracefully if PHP's file_uploads has been - disabled +* (bug 17035) Special:Upload now fails gracefully if PHP's file_uploads has + been disabled * Fixing the caching issue by using -{T|xxx}- syntax (only applies on wiki with LanguageConverter class) * Improving the efficiency by using -{A|xxx}- syntax (only applies on wiki with @@ -70,8 +74,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 11527) Diff on page with one revision shows "Next" link to same diff * (bug 15936) New page's patrol button should always be visible * (bug 8065) Fix summary forcing for new pages -* (bug 10569) redirects to Special:Mypage and Special:Mytalk are no longer allowed - by default. Change $wgInvalidRedirectTargets to re-enable. +* (bug 10569) redirects to Special:Mypage and Special:Mytalk are no longer + allowed by default. Change $wgInvalidRedirectTargets to re-enable. == API changes in 1.15 == * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index ab60b06d91..cf12b37ce4 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1455,7 +1455,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '198'; +$wgStyleVersion = '199'; # Server-side caching: @@ -3657,10 +3657,10 @@ $wgPasswordAttemptThrottle = array( 'count' => 5, 'seconds' => 300 ); $wgEdititis = false; /** -* Enable the UniversalEditButton for browsers that support it -* (currently only Firefox with an extension) -* See http://universaleditbutton.org for more background information -*/ + * Enable the UniversalEditButton for browsers that support it + * (currently only Firefox with an extension) + * See http://universaleditbutton.org for more background information + */ $wgUniversalEditButton = true; /** @@ -3669,3 +3669,10 @@ $wgUniversalEditButton = true; * and the functionality will be enabled universally. */ $wgEnforceHtmlIds = true; + +/** + * Search form behavior + * true = use Go & Search buttons + * false = use Go button & Advanced search link + */ +$wgUseTwoButtonsSearchForm = true; diff --git a/includes/Skin.php b/includes/Skin.php index 9d7584bb76..40b480d90e 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1140,16 +1140,22 @@ END; } function searchForm() { - global $wgRequest; + global $wgRequest, $wgUseTwoButtonsSearchForm; $search = $wgRequest->getText( 'search' ); $s = '
\n" . '\n" - . ' ' - . '\n
"; - + . ''; + + if ($wgUseTwoButtonsSearchForm) + $s .= ' \n"; + else + $s .= ' \n"; + + $s .= ''; + // Ensure unique id's for search boxes made after the first $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1; diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 9cd41e8d0f..b784c55e06 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -289,7 +289,7 @@ class SkinCologneBlue extends Skin { function searchForm( $label = "" ) { - global $wgRequest; + global $wgRequest, $wgUseTwoButtonsSearchForm; $search = $wgRequest->getText( 'search' ); $action = $this->escapeSearchLink(); @@ -298,8 +298,14 @@ class SkinCologneBlue extends Skin { $s .= "searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\"" . htmlspecialchars(substr($search,0,256)) . "\" />
" - . "searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" />" - . "searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" />"; + . "searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" />"; + + if ($wgUseTwoButtonsSearchForm) + $s .= "searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" />\n"; + else + $s .= '
\n"; + + $s .= ''; // Ensure unique id's for search boxes made after the first $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1; diff --git a/skins/Modern.php b/skins/Modern.php index cb24bafaef..c91d0e1cae 100644 --- a/skins/Modern.php +++ b/skins/Modern.php @@ -245,6 +245,7 @@ class ModernTemplate extends QuickTemplate { /*************************************************************************************************/ function searchBox() { + global $wgUseTwoButtonsSearchForm; ?> diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 8afc4982e3..bc405e8d13 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -249,6 +249,7 @@ class MonoBookTemplate extends QuickTemplate { /*************************************************************************************************/ function searchBox() { + global $wgUseTwoButtonsSearchForm; ?> diff --git a/skins/modern/main.css b/skins/modern/main.css index d9537c18e0..80ef008c5b 100644 --- a/skins/modern/main.css +++ b/skins/modern/main.css @@ -158,6 +158,10 @@ textarea { margin-right: auto; } +#p-search #searchform div div { + margin-top: .4em; +} + .portlet h5 { padding: 0.1em 0 0.3em 1em; margin: 0 0 0 0; diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 7e5809b55a..63ce572cc7 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -715,7 +715,10 @@ input.searchButton { padding: .5em .4em .4em .4em; text-align: center; } - +#p-search #searchform div div { + margin-top: .4em; + font-size: 95%; +} /* ** the personal toolbar */ -- 2.20.1