r91413 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91412‎ | r91413 | r91414 >
Date:17:01, 4 July 2011
Author:mah
Status:deferred (Comments)
Tags:
Comment:
Bug 17504 - Inputbox extension should have single namespace search option

Apply patch from DaSch
Modified paths:
  • /trunk/extensions/InputBox/InputBox.classes.php (modified) (history)
  • /trunk/extensions/InputBox/InputBox.php (modified) (history)

Diff [purge]

Index: trunk/extensions/InputBox/InputBox.classes.php
@@ -139,17 +139,31 @@
140140 $name = 'Main';
141141 }
142142 if ( $userNamespace == $name ) {
143 - // Checkbox
144 - $htmlOut .= Xml::element( 'input',
145 - array(
146 - 'type' => 'checkbox',
147 - 'name' => 'ns' . $i,
148 - 'value' => 1,
149 - 'id' => 'mw-inputbox-ns' . $i
150 - ) + $checked
151 - );
152 - // Label
153 - $htmlOut .= ' ' . Xml::label( $userNamespace, 'mw-inputbox-ns' . $i );
 143+ if ( count( $namespacesArray ) == 1 ) {
 144+ // Checkbox
 145+ $htmlOut .= Xml::element( 'input',
 146+ array(
 147+ 'type' => 'hidden',
 148+ 'name' => 'ns' . $i,
 149+ 'value' => 1,
 150+ 'id' => 'mw-inputbox-ns' . $i
 151+ ) + $checked
 152+ );
 153+ } else {
 154+ // Checkbox
 155+ $htmlOut .= ' <div class="inputbox-element" style="display: inline; white-space: nowrap;">';
 156+ $htmlOut .= Xml::element( 'input',
 157+ array(
 158+ 'type' => 'checkbox',
 159+ 'name' => 'ns' . $i,
 160+ 'value' => 1,
 161+ 'id' => 'mw-inputbox-ns' . $i
 162+ ) + $checked
 163+ );
 164+ // Label
 165+ $htmlOut .= '&#160;' . Xml::label( $userNamespace, 'mw-inputbox-ns' . $i );
 166+ $htmlOut .= '</div> ';
 167+ }
154168 }
155169 }
156170 }
Index: trunk/extensions/InputBox/InputBox.php
@@ -32,8 +32,10 @@
3333 $wgExtensionCredits['parserhook'][] = array(
3434 'path' => __FILE__,
3535 'name' => 'InputBox',
36 - 'author' => array( 'Erik Moeller', 'Leonardo Pimenta', 'Rob Church', 'Trevor Parscal' ),
 36+ 'author' => array( 'Erik Moeller', 'Leonardo Pimenta', 'Rob Church', 'Trevor Parscal', 'DaSch' ),
 37+ 'version' => '0.1.3',
3738 'url' => 'http://www.mediawiki.org/wiki/Extension:InputBox',
 39+ 'description' => 'Allow inclusion of predefined HTML forms.',
3840 'descriptionmsg' => 'inputbox-desc',
3941 );
4042

Comments

#Comment by Raymond (talk | contribs)   17:05, 4 July 2011

'description' is not needed because we have 'descriptionmsg'.

+	'description'    => 'Allow inclusion of predefined HTML forms.',
 	'descriptionmsg' => 'inputbox-desc',

Status & tagging log