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/fieldtextbox.php | |
parent | 46377a425154286e3072880d55667a18b4518df1 (diff) |
add plugins: wrap, bureaucracy, phpwikify
Diffstat (limited to 'platform/www/lib/plugins/bureaucracy/helper/fieldtextbox.php')
-rw-r--r-- | platform/www/lib/plugins/bureaucracy/helper/fieldtextbox.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/platform/www/lib/plugins/bureaucracy/helper/fieldtextbox.php b/platform/www/lib/plugins/bureaucracy/helper/fieldtextbox.php new file mode 100644 index 0000000..430cc2d --- /dev/null +++ b/platform/www/lib/plugins/bureaucracy/helper/fieldtextbox.php @@ -0,0 +1,34 @@ +<?php +/** + * Class helper_plugin_bureaucracy_fieldtextbox + * + * Creates a single line input field + */ +class helper_plugin_bureaucracy_fieldtextbox extends helper_plugin_bureaucracy_field { + + /** + * Arguments: + * - cmd + * - label + * - =default (optional) + * - ^ (optional) + * + * @param array $args The tokenized definition, only split at spaces + */ + function initialize($args) { + parent::initialize($args); + + $attr = array(); + if(!isset($this->opt['optional'])) { + $attr['required'] = 'required'; + } + + $this->tpl = form_makeTextField('@@NAME@@', '@@VALUE@@', '@@DISPLAY@@', '@@ID@@', '@@CLASS@@', $attr); + if(isset($this->opt['class'])){ + $this->tpl['class'] .= ' '.$this->opt['class']; + } + if(!isset($this->opt['optional'])){ + $this->tpl['class'] .= ' required'; + } + } +} |