Index: trunk/extensions/InputBox/InputBox.classes.php |
— | — | @@ -139,17 +139,31 @@ |
140 | 140 | $name = 'Main'; |
141 | 141 | } |
142 | 142 | 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 .= ' ' . Xml::label( $userNamespace, 'mw-inputbox-ns' . $i ); |
| 166 | + $htmlOut .= '</div> '; |
| 167 | + } |
154 | 168 | } |
155 | 169 | } |
156 | 170 | } |
Index: trunk/extensions/InputBox/InputBox.php |
— | — | @@ -32,8 +32,10 @@ |
33 | 33 | $wgExtensionCredits['parserhook'][] = array( |
34 | 34 | 'path' => __FILE__, |
35 | 35 | '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', |
37 | 38 | 'url' => 'http://www.mediawiki.org/wiki/Extension:InputBox', |
| 39 | + 'description' => 'Allow inclusion of predefined HTML forms.', |
38 | 40 | 'descriptionmsg' => 'inputbox-desc', |
39 | 41 | ); |
40 | 42 | |