/**
  * 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 helper_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);
 }
Пример #2
0
 /**
  * Handle a post to the field
  *
  * Accepts and validates a posted value.
  *
  * @param array $value The passed value or array or null if none given
  * @param helper_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 filename is valid
  */
 public function handle_post($value, &$fields, $index, $formid)
 {
     $this->opt['file'] = $value;
     return parent::handle_post($value['name'], $fields, $index, $formid);
 }