summaryrefslogtreecommitdiff
path: root/platform/www/lib/plugins/bureaucracy/helper/fieldhiddenautoinc.php
diff options
context:
space:
mode:
authorYaco <franco@reevo.org>2022-03-12 03:48:42 +0000
committerYaco <franco@reevo.org>2022-03-12 03:48:42 +0000
commit5a2b689265654f704d06eb2ea9ee1b21078edcfc (patch)
treeb52e9ce5c8236d2ecf660950238c2dd3d42ad5d2 /platform/www/lib/plugins/bureaucracy/helper/fieldhiddenautoinc.php
parent46377a425154286e3072880d55667a18b4518df1 (diff)
add plugins: wrap, bureaucracy, phpwikify
Diffstat (limited to 'platform/www/lib/plugins/bureaucracy/helper/fieldhiddenautoinc.php')
-rw-r--r--platform/www/lib/plugins/bureaucracy/helper/fieldhiddenautoinc.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/platform/www/lib/plugins/bureaucracy/helper/fieldhiddenautoinc.php b/platform/www/lib/plugins/bureaucracy/helper/fieldhiddenautoinc.php
new file mode 100644
index 0000000..787e081
--- /dev/null
+++ b/platform/www/lib/plugins/bureaucracy/helper/fieldhiddenautoinc.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Class helper_plugin_bureaucracy_fieldhiddenautoinc
+ *
+ * Creates an invisible field with a number that increases by 1 on each form submit
+ */
+class helper_plugin_bureaucracy_fieldhiddenautoinc extends helper_plugin_bureaucracy_fieldnumber {
+
+ /**
+ * Arguments:
+ * - cmd
+ * - label
+ *
+ * @param array $args The tokenized definition, only split at spaces
+ */
+ function initialize($args) {
+ $args[] = '++';
+ parent::initialize($args);
+ }
+
+ /**
+ * Render the field as XHTML
+ *
+ * Outputs the represented field using the passed Doku_Form object.
+ *
+ * @param array $params Additional HTML specific parameters
+ * @param Doku_Form $form The target Doku_Form object
+ * @param $formid
+ */
+ function renderfield($params, Doku_Form $form, $formid) {
+ $this->_handlePreload();
+ $form->addHidden($params['name'], $this->getParam('value') . '');
+ }
+
+}