jenkins-bot has submitted this change and it was merged.
Change subject: Add support for preloadparams[]
......................................................................
Add support for preloadparams[]
Bug: 70493
Change-Id: Ice61fd0581b3ef8220b6a603b52463c973fb770b
---
M InputBox.classes.php
M InputBox.php
2 files changed, 28 insertions(+), 2 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/InputBox.classes.php b/InputBox.classes.php
index a9a920f..0a74271 100644
--- a/InputBox.classes.php
+++ b/InputBox.classes.php
@@ -15,6 +15,7 @@
private $mType = '';
private $mWidth = 50;
private $mPreload = '';
+ private $mPreloadparams = array();
private $mEditIntro = '';
private $mSummary = '';
private $mNosummary = '';
@@ -367,6 +368,15 @@
'value' => $this->mPreload,
)
);
+ foreach ( $this->mPreloadparams as $preloadparams ) {
+ $htmlOut .= Xml::openElement( 'input',
+ array(
+ 'type' => 'hidden',
+ 'name' => 'preloadparams[]',
+ 'value' => $preloadparams,
+ )
+ );
+ }
$htmlOut .= Xml::openElement( 'input',
array(
'type' => 'hidden',
@@ -551,6 +561,15 @@
'value' => $this->mPreload,
)
);
+ foreach ( $this->mPreloadparams as $preloadparams ) {
+ $htmlOut .= Xml::openElement( 'input',
+ array(
+ 'type' => 'hidden',
+ 'name' => 'preloadparams[]',
+ 'value' => $preloadparams,
+ )
+ );
+ }
$htmlOut .= Xml::openElement( 'input',
array(
'type' => 'hidden',
@@ -613,7 +632,14 @@
if ( strpos( $line, '=' ) === false )
continue;
list( $name, $value ) = explode( '=', $line, 2 );
- $values[ strtolower( trim( $name ) ) ] =
Sanitizer::decodeCharReferences( trim( $value ) );
+ $name = strtolower( trim( $name ) );
+ $value = Sanitizer::decodeCharReferences( trim( $value
) );
+ if ( $name == 'preloadparams[]' ) {
+ // We have to special-case this one because
it's valid for it to appear more than once.
+ $this->mPreloadparams[] = $value;
+ } else {
+ $values[ $name ] = $value;
+ }
}
// Validate the dir value.
diff --git a/InputBox.php b/InputBox.php
index d5215ef..7b31423 100644
--- a/InputBox.php
+++ b/InputBox.php
@@ -33,7 +33,7 @@
'path' => __FILE__,
'name' => 'InputBox',
'author' => array( 'Erik Moeller', 'Leonardo Pimenta', 'Rob
Church', 'Trevor Parscal', 'DaSch' ),
- 'version' => '0.2.0',
+ 'version' => '0.3.0',
'url' => 'https://www.mediawiki.org/wiki/Extension:InputBox',
'description' => 'Allow inclusion of predefined HTML forms.',
'descriptionmsg' => 'inputbox-desc',
--
To view, visit https://gerrit.wikimedia.org/r/158906
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ice61fd0581b3ef8220b6a603b52463c973fb770b
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/InputBox
Gerrit-Branch: master
Gerrit-Owner: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Brian Wolff <[email protected]>
Gerrit-Reviewer: Gryllida <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Kghbln <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits