You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

35 lines
912 B

  1. <?php
  2. /**
  3. * Class helper_plugin_bureaucracy_fieldtextbox
  4. *
  5. * Creates a single line input field
  6. */
  7. class helper_plugin_bureaucracy_fieldtextbox extends helper_plugin_bureaucracy_field {
  8. /**
  9. * Arguments:
  10. * - cmd
  11. * - label
  12. * - =default (optional)
  13. * - ^ (optional)
  14. *
  15. * @param array $args The tokenized definition, only split at spaces
  16. */
  17. function initialize($args) {
  18. parent::initialize($args);
  19. $attr = array();
  20. if(!isset($this->opt['optional'])) {
  21. $attr['required'] = 'required';
  22. }
  23. $this->tpl = form_makeTextField('@@NAME@@', '@@VALUE@@', '@@DISPLAY@@', '@@ID@@', '@@CLASS@@', $attr);
  24. if(isset($this->opt['class'])){
  25. $this->tpl['class'] .= ' '.$this->opt['class'];
  26. }
  27. if(!isset($this->opt['optional'])){
  28. $this->tpl['class'] .= ' required';
  29. }
  30. }
  31. }