diff options
author | Yaco <franco@reevo.org> | 2022-03-12 03:48:42 +0000 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2022-03-12 03:48:42 +0000 |
commit | 5a2b689265654f704d06eb2ea9ee1b21078edcfc (patch) | |
tree | b52e9ce5c8236d2ecf660950238c2dd3d42ad5d2 /platform/www/lib/plugins/bureaucracy/helper/fieldhidden.php | |
parent | 46377a425154286e3072880d55667a18b4518df1 (diff) |
add plugins: wrap, bureaucracy, phpwikify
Diffstat (limited to 'platform/www/lib/plugins/bureaucracy/helper/fieldhidden.php')
-rw-r--r-- | platform/www/lib/plugins/bureaucracy/helper/fieldhidden.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/platform/www/lib/plugins/bureaucracy/helper/fieldhidden.php b/platform/www/lib/plugins/bureaucracy/helper/fieldhidden.php new file mode 100644 index 0000000..dd63753 --- /dev/null +++ b/platform/www/lib/plugins/bureaucracy/helper/fieldhidden.php @@ -0,0 +1,47 @@ +<?php +/** + * Class helper_plugin_bureaucracy_fieldhidden + * + * Creates an invisible field with static data + */ +class helper_plugin_bureaucracy_fieldhidden extends helper_plugin_bureaucracy_field { + + /** + * Arguments: + * - cmd + * - label + * - =default value + */ + + /** + * 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 int $formid unique identifier of the form which contains this field + */ + function renderfield($params, Doku_Form $form, $formid) { + $this->_handlePreload(); + $form->addHidden($params['name'], $this->getParam('value') . ''); + } + + /** + * Get an arbitrary parameter + * + * @param string $name + * @return mixed|null + */ + function getParam($name) { + if (!isset($this->opt[$name]) || in_array($name, array('pagename', 'value')) && $this->hidden) { + return null; + } + if ($name === 'pagename') { + // If $this->opt['pagename'] is set, return the value of the field, + // UNESCAPED. + $name = 'value'; + } + return $this->opt[$name]; + } +} |