]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/htmlform/fields/HTMLSubmitField.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / includes / htmlform / fields / HTMLSubmitField.php
diff --git a/includes/htmlform/fields/HTMLSubmitField.php b/includes/htmlform/fields/HTMLSubmitField.php
new file mode 100644 (file)
index 0000000..0c33ad9
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * Add a submit button inline in the form (as opposed to
+ * HTMLForm::addButton(), which will add it at the end).
+ */
+class HTMLSubmitField extends HTMLButtonField {
+       protected $buttonType = 'submit';
+
+       protected $mFlags = [ 'primary', 'progressive' ];
+
+       public function skipLoadData( $request ) {
+               return !$request->getCheck( $this->mName );
+       }
+
+       public function loadDataFromRequest( $request ) {
+               return $request->getCheck( $this->mName );
+       }
+}