Page MenuHomePhabricator

inputbox.patch

Authored By
bzimport
Nov 21 2014, 10:30 PM
Size
2 KB
Referenced Files
None
Subscribers
None

inputbox.patch

Index: InputBox/InputBox.classes.php
===================================================================
--- InputBox/InputBox.classes.php (Revision 91350)
+++ InputBox/InputBox.classes.php (Arbeitskopie)
@@ -139,17 +139,31 @@
$name = 'Main';
}
if ( $userNamespace == $name ) {
- // Checkbox
- $htmlOut .= Xml::element( 'input',
- array(
- 'type' => 'checkbox',
- 'name' => 'ns' . $i,
- 'value' => 1,
- 'id' => 'mw-inputbox-ns' . $i
- ) + $checked
- );
- // Label
- $htmlOut .= ' ' . Xml::label( $userNamespace, 'mw-inputbox-ns' . $i );
+ if ( count( $namespacesArray ) == 1 ) {
+ // Checkbox
+ $htmlOut .= Xml::element( 'input',
+ array(
+ 'type' => 'hidden',
+ 'name' => 'ns' . $i,
+ 'value' => 1,
+ 'id' => 'mw-inputbox-ns' . $i
+ ) + $checked
+ );
+ } else {
+ // Checkbox
+ $htmlOut .= ' <div class="inputbox-element" style="display: inline; white-space: nowrap;">';
+ $htmlOut .= Xml::element( 'input',
+ array(
+ 'type' => 'checkbox',
+ 'name' => 'ns' . $i,
+ 'value' => 1,
+ 'id' => 'mw-inputbox-ns' . $i
+ ) + $checked
+ );
+ // Label
+ $htmlOut .= '&#160;' . Xml::label( $userNamespace, 'mw-inputbox-ns' . $i );
+ $htmlOut .= '</div> ';
+ }
}
}
}
@@ -539,4 +553,4 @@
REGEX;
return (bool) preg_match( $regex, $color );
}
-}
+}
\ No newline at end of file
Index: InputBox/InputBox.php
===================================================================
--- InputBox/InputBox.php (Revision 91350)
+++ InputBox/InputBox.php (Arbeitskopie)
@@ -32,8 +32,10 @@
$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'InputBox',
- 'author' => array( 'Erik Moeller', 'Leonardo Pimenta', 'Rob Church', 'Trevor Parscal' ),
+ 'author' => array( 'Erik Moeller', 'Leonardo Pimenta', 'Rob Church', 'Trevor Parscal', 'DaSch' ),
+ 'version' => '0.1.3',
'url' => 'http://www.mediawiki.org/wiki/Extension:InputBox',
+ 'description' => 'Allow inclusion of predefined HTML forms.',
'descriptionmsg' => 'inputbox-desc',
);

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5006
Default Alt Text
inputbox.patch (2 KB)

Event Timeline