Ejemplo n.º 1
0
 /**
  * Render the field as XHTML
  *
  * @params array     $params Additional HTML specific parameters
  * @params Doku_Form $form   The target Doku_Form object
  */
 public function renderfield($params, Doku_Form $form)
 {
     if (!isset($this->opt['display'])) {
         $this->opt['display'] = $this->opt['label'];
     }
     parent::renderfield($params, $form);
 }
Ejemplo n.º 2
0
 function handle_post($value)
 {
     if (is_array($value)) {
         $value = join(', ', $value);
     }
     return parent::handle_post($value);
 }
 function render($params, $form)
 {
     $id = 'bureaucracy__' . md5(rand());
     $params = array_merge(array('value' => false), $this->opt, $params);
     $check = $params['value'] ? 'checked="checked"' : '';
     $this->tpl = '<label class="@@CLASS@@" for="' . $id . '"><span>@@LABEL@@</span>' . '<input type="hidden" name="@@NAME@@" value="0" />' . '<input type="checkbox" name="@@NAME@@" value="1" id="' . $id . '" ' . $check . ' /></label>';
     parent::render($params, $form);
 }
Ejemplo n.º 4
0
 /**
  * Arguments:
  *  - cmd
  *  - label
  *  - =default (optional)
  *
  * @param array $args The tokenized definition, only split at spaces
  */
 function __construct($args)
 {
     parent::__construct($args);
     $this->tpl = form_makeTextField('@@NAME@@', '@@VALUE@@', '@@DISPLAY@@', '', '@@CLASS@@');
     if (isset($this->opt['class'])) {
         $this->tpl['class'] .= ' ' . $this->opt['class'];
     }
 }
 function render($params, $form)
 {
     if (isset($this->tpl)) {
         parent::render($params, $form);
     } else {
         $this->_handlePreload();
         if (!$form->_infieldset) {
             $form->startFieldset('');
         }
         if ($this->error) {
             $params['class'] = 'bureaucracy_error';
         }
         $params = array_merge($this->opt, $params);
         $form->addElement(call_user_func_array('form_makeListboxField', $this->_parse_tpl(array('@@NAME@@', $params['args'], '@@VALUE|' . $params['args'][0] . '@@', '@@LABEL@@', '', '@@CLASS@@', $this->additional), $params)));
     }
 }
Ejemplo n.º 6
0
 /**
  * Get an arbitrary parameter
  *
  * @param string $name
  * @return mixed|null
  */
 public function getParam($name)
 {
     return $name === 'value' ? null : parent::getParam($name);
 }
 function getParam($name)
 {
     return $name === 'value' || in_array($name, array('page_tpl', 'page_tgt')) && $this->hidden ? null : parent::getParam($name);
 }
 function syntax_plugin_bureaucracy_field_textbox($args)
 {
     parent::__construct($args);
     $this->tpl = form_makeTextField('@@NAME@@', '@@VALUE@@', '@@LABEL@@', '', '@@CLASS@@');
 }
 /**
  * Handle a post to the field
  *
  * Accepts and validates a posted value.
  *
  * @param string $value The passed value or array or null if none given
  * @param syntax_plugin_bureaucracy_field[] $fields (reference) form fields (POST handled upto $this field)
  * @param int    $index  index number of field in form
  * @param int    $formid unique identifier of the form which contains this field
  * @return bool Whether the passed value is valid
  */
 public function handle_post($value, &$fields, $index, $formid)
 {
     if (is_array($value)) {
         $value = join(', ', $value);
     }
     return parent::handle_post($value, $fields, $index, $formid);
 }
 function syntax_plugin_bureaucracy_field_password($args)
 {
     parent::__construct($args);
     $this->tpl = form_makePasswordField('@@NAME@@', '@@LABEL@@', '', '@@CLASS@@');
 }
Ejemplo n.º 11
0
 /**
  * Arguments:
  *  - cmd
  *  - label
  *
  * @param array $args The tokenized definition, only split at spaces
  */
 function __construct($args)
 {
     parent::__construct($args);
     $this->tpl = form_makePasswordField('@@NAME@@', '@@DISPLAY@@', '', '@@CLASS@@');
 }