Victorbarbu has uploaded a new change for review.
https://gerrit.wikimedia.org/r/325121
Change subject: Add DataWidget to generate hidden input
......................................................................
Add DataWidget to generate hidden input
Bug: T152321
Change-Id: I382d1420ae007683b64da9a3f30b57e78252db8a
---
A php/widgets/DataWidget.php
1 file changed, 44 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/21/325121/1
diff --git a/php/widgets/DataWidget.php b/php/widgets/DataWidget.php
new file mode 100644
index 0000000..48c2f82
--- /dev/null
+++ b/php/widgets/DataWidget.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace OOUI;
+
+/**
+ * Data widget intended for creating 'hidden'-type inputs.
+ *
+ * @package OOUI
+ */
+class DataWidget extends Widget {
+
+ /**
+ * @var string
+ */
+ public static $tagName = 'input';
+
+ /**
+ * DataWidget constructor.
+ *
+ * @param array $config
+ * @param string $config['value'] The data the input contains
+ * @param string $config['name'] The name of the hidden input.
+ */
+ public function __construct( array $config ) {
+ // Parent constructor
+ parent::__construct( $config );
+
+ $this->setAttributes( [
+ 'type' => 'hidden',
+ 'value' => $config['value'],
+ 'name' => $config['name'],
+ ] );
+ $this->removeAttributes( [ 'aria-disabled' ] );
+ }
+
+ /**
+ * This is not intended to be infusable
+ * @return bool
+ */
+ public function isInfusable() {
+ return false;
+ }
+
+}
--
To view, visit https://gerrit.wikimedia.org/r/325121
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I382d1420ae007683b64da9a3f30b57e78252db8a
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Victorbarbu <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits