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.
 
 
 
 
 

63 lines
1.8 KiB

  1. <?php
  2. /**
  3. * Class helper_plugin_bureaucracy_fieldusemailtemplate
  4. *
  5. * Adds a template only for use with the mail action
  6. */
  7. class helper_plugin_bureaucracy_fieldusemailtemplate extends helper_plugin_bureaucracy_field {
  8. /**
  9. * Arguments:
  10. * - cmd
  11. * - template
  12. *
  13. * @param array $args The tokenized definition, only split at spaces
  14. */
  15. function initialize($args) {
  16. if(count($args) < 2){
  17. msg(sprintf($this->getLang('e_missingargs'), hsc($args[0]),
  18. hsc($args[1])), -1);
  19. return;
  20. }
  21. // get standard arguments
  22. $this->opt = array_combine(array('cmd', 'template'), $args);
  23. }
  24. /**
  25. * Nothing displayed
  26. *
  27. * @params array $params Additional HTML specific parameters
  28. * @params Doku_Form $form The target Doku_Form object
  29. * @params int $formid unique identifier of the form which contains this field
  30. */
  31. function renderfield($params, Doku_Form $form, $formid) {
  32. }
  33. /**
  34. * Handle a post to the field
  35. *
  36. * @param string $value null
  37. * @param helper_plugin_bureaucracy_field[] $fields (reference) form fields (POST handled upto $this field)
  38. * @param int $index index number of field in form
  39. * @param int $formid unique identifier of the form which contains this field
  40. * @return bool Whether the passed value is valid
  41. */
  42. function handle_post($value, &$fields, $index, $formid) {
  43. return true;
  44. }
  45. /**
  46. * Get an arbitrary parameter
  47. *
  48. * @param string $name
  49. * @return mixed|null
  50. */
  51. function getParam($name) {
  52. return ($name === 'value' ||
  53. (in_array($name, array('template')) && $this->hidden)) ?
  54. null :
  55. parent::getParam($name);
  56. }
  57. }