r46042 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46041‎ | r46042 | r46043 >
Date:23:31, 22 January 2009
Author:danny_b
Status:ok
Tags:
Comment:
* Added optional alternative Search form look - Go button & Advanced search link instead of Go button & Search button
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/skins/CologneBlue.php (modified) (history)
  • /trunk/phase3/skins/Modern.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/modern/main.css (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/monobook/main.css
@@ -715,7 +715,10 @@
716716 padding: .5em .4em .4em .4em;
717717 text-align: center;
718718 }
719 -
 719+#p-search #searchform div div {
 720+ margin-top: .4em;
 721+ font-size: 95%;
 722+}
720723 /*
721724 ** the personal toolbar
722725 */
Index: trunk/phase3/skins/modern/main.css
@@ -158,6 +158,10 @@
159159 margin-right: auto;
160160 }
161161
 162+#p-search #searchform div div {
 163+ margin-top: .4em;
 164+}
 165+
162166 .portlet h5 {
163167 padding: 0.1em 0 0.3em 1em;
164168 margin: 0 0 0 0;
Index: trunk/phase3/skins/CologneBlue.php
@@ -289,7 +289,7 @@
290290
291291 function searchForm( $label = "" )
292292 {
293 - global $wgRequest;
 293+ global $wgRequest, $wgUseTwoButtonsSearchForm;
294294
295295 $search = $wgRequest->getText( 'search' );
296296 $action = $this->escapeSearchLink();
@@ -298,9 +298,15 @@
299299
300300 $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
301301 . htmlspecialchars(substr($search,0,256)) . "\" /><br />"
302 - . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" />"
303 - . "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" /></form>";
 302+ . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" />";
304303
 304+ if ($wgUseTwoButtonsSearchForm)
 305+ $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" />\n";
 306+ else
 307+ $s .= '<div><a href="$action" rel="search">' . wfMsg ('powersearch-legend') . "</a></div>\n";
 308+
 309+ $s .= '</form>';
 310+
305311 // Ensure unique id's for search boxes made after the first
306312 $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1;
307313
Index: trunk/phase3/skins/MonoBook.php
@@ -249,6 +249,7 @@
250250
251251 /*************************************************************************************************/
252252 function searchBox() {
 253+ global $wgUseTwoButtonsSearchForm;
253254 ?>
254255 <div id="p-search" class="portlet">
255256 <h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
@@ -257,8 +258,11 @@
258259 <input id="searchInput" name="search" type="text"<?php echo $this->skin->tooltipAndAccesskey('search');
259260 if( isset( $this->data['search'] ) ) {
260261 ?> value="<?php $this->text('search') ?>"<?php } ?> />
261 - <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> />&nbsp;
262 - <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
 262+ <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> /><?php if ($wgUseTwoButtonsSearchForm) { ?>&nbsp;
 263+ <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /><?php } else { ?>
 264+
 265+ <div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php } ?>
 266+
263267 </div></form>
264268 </div>
265269 </div>
Index: trunk/phase3/skins/Modern.php
@@ -245,6 +245,7 @@
246246
247247 /*************************************************************************************************/
248248 function searchBox() {
 249+ global $wgUseTwoButtonsSearchForm;
249250 ?>
250251 <!-- search -->
251252 <div id="p-search" class="portlet">
@@ -254,8 +255,11 @@
255256 <input id="searchInput" name="search" type="text"<?php echo $this->skin->tooltipAndAccesskey('search');
256257 if( isset( $this->data['search'] ) ) {
257258 ?> value="<?php $this->text('search') ?>"<?php } ?> />
258 - <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> />&nbsp;
259 - <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
 259+ <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> /><?php if ($wgUseTwoButtonsSearchForm) { ?>&nbsp;
 260+ <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /><?php } else { ?>
 261+
 262+ <div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php } ?>
 263+
260264 </div></form>
261265 </div><!-- pBody -->
262266 </div><!-- portlet -->
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1455,7 +1455,7 @@
14561456 * to ensure that client-side caches don't keep obsolete copies of global
14571457 * styles.
14581458 */
1459 -$wgStyleVersion = '198';
 1459+$wgStyleVersion = '199';
14601460
14611461
14621462 # Server-side caching:
@@ -3657,10 +3657,10 @@
36583658 $wgEdititis = false;
36593659
36603660 /**
3661 -* Enable the UniversalEditButton for browsers that support it
3662 -* (currently only Firefox with an extension)
3663 -* See http://universaleditbutton.org for more background information
3664 -*/
 3661+ * Enable the UniversalEditButton for browsers that support it
 3662+ * (currently only Firefox with an extension)
 3663+ * See http://universaleditbutton.org for more background information
 3664+ */
36653665 $wgUniversalEditButton = true;
36663666
36673667 /**
@@ -3669,3 +3669,10 @@
36703670 * and the functionality will be enabled universally.
36713671 */
36723672 $wgEnforceHtmlIds = true;
 3673+
 3674+/**
 3675+ * Search form behavior
 3676+ * true = use Go & Search buttons
 3677+ * false = use Go button & Advanced search link
 3678+ */
 3679+$wgUseTwoButtonsSearchForm = true;
Index: trunk/phase3/includes/Skin.php
@@ -1140,16 +1140,22 @@
11411141 }
11421142
11431143 function searchForm() {
1144 - global $wgRequest;
 1144+ global $wgRequest, $wgUseTwoButtonsSearchForm;
11451145 $search = $wgRequest->getText( 'search' );
11461146
11471147 $s = '<form id="searchform'.$this->searchboxes.'" name="search" class="inline" method="post" action="'
11481148 . $this->escapeSearchLink() . "\">\n"
11491149 . '<input type="text" id="searchInput'.$this->searchboxes.'" name="search" size="19" value="'
11501150 . htmlspecialchars(substr($search,0,256)) . "\" />\n"
1151 - . '<input type="submit" name="go" value="' . wfMsg ('searcharticle') . '" />&nbsp;'
1152 - . '<input type="submit" name="fulltext" value="' . wfMsg ('searchbutton') . "\" />\n</form>";
1153 -
 1151+ . '<input type="submit" name="go" value="' . wfMsg ('searcharticle') . '" />';
 1152+
 1153+ if ($wgUseTwoButtonsSearchForm)
 1154+ $s .= '&nbsp;<input type="submit" name="fulltext" value="' . wfMsg ('searchbutton') . "\" />\n";
 1155+ else
 1156+ $s .= ' <a href="' . $this->escapeSearchLink() . '" rel="search">' . wfMsg ('powersearch-legend') . "</a>\n";
 1157+
 1158+ $s .= '</form>';
 1159+
11541160 // Ensure unique id's for search boxes made after the first
11551161 $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1;
11561162
Index: trunk/phase3/RELEASE-NOTES
@@ -22,6 +22,7 @@
2323
2424 * Added $wgNewPasswordExpiry, to specify an expiry time (in seconds) to
2525 temporary passwords
 26+* Added $wgUseTwoButtonsSearchForm to choose the Search form behavior/look
2627
2728 === New features in 1.15 ===
2829
@@ -48,20 +49,23 @@
4950 * (bugs 16957/16969) Add show/hide to preferences for RC patrol options on
5051 specialpages
5152 * (bug 11443) Auto-noindex user/user talk pages for blocked user
52 -* (bug 11644) Add $wgMaxRedirects variable to control how many redirects are recursed
53 - through until the "destination" page is reached.
54 -* Add $wgInvalidRedirectTargets variable to prevent redirects to certain special pages.
 53+* (bug 11644) Add $wgMaxRedirects variable to control how many redirects are
 54+ recursed through until the "destination" page is reached.
 55+* Add $wgInvalidRedirectTargets variable to prevent redirects to certain
 56+ special pages.
5557 * Use HTML5 rel attributes for some links, where appropriate
 58+* Added optional alternative Search form look - Go button & Advanced search
 59+ link instead of Go button & Search button
5660
5761 === Bug fixes in 1.15 ===
5862 * (bug 16968) Special:Upload no longer throws useless warnings.
59 -* (bug 17000) Special:RevisionDelete now checks if the database is locked before
60 - trying to delete the edit.
 63+* (bug 17000) Special:RevisionDelete now checks if the database is locked
 64+ before trying to delete the edit.
6165 * (bug 16852) padleft and padright now handle multibyte characters correctly
6266 * (bug 17010) maintenance/namespaceDupes.php now add the suffix recursively if
6367 the destination page exists
64 -* (bug 17035) Special:Upload now fails gracefully if PHP's file_uploads has been
65 - disabled
 68+* (bug 17035) Special:Upload now fails gracefully if PHP's file_uploads has
 69+ been disabled
6670 * Fixing the caching issue by using -{T|xxx}- syntax (only applies on wiki with
6771 LanguageConverter class)
6872 * Improving the efficiency by using -{A|xxx}- syntax (only applies on wiki with
@@ -70,8 +74,8 @@
7175 * (bug 11527) Diff on page with one revision shows "Next" link to same diff
7276 * (bug 15936) New page's patrol button should always be visible
7377 * (bug 8065) Fix summary forcing for new pages
74 -* (bug 10569) redirects to Special:Mypage and Special:Mytalk are no longer allowed
75 - by default. Change $wgInvalidRedirectTargets to re-enable.
 78+* (bug 10569) redirects to Special:Mypage and Special:Mytalk are no longer
 79+ allowed by default. Change $wgInvalidRedirectTargets to re-enable.
7680
7781 == API changes in 1.15 ==
7882 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions

Status & tagging log