Пример #1
0
 public function __construct($form)
 {
     $fields = $form->fields;
     $this->presets = $form->presets;
     $this->data = $form->data;
     foreach ($fields as $name => $field) {
         $this->fields[$name] = $field;
         $this->fields[$name]['editor'] = Wikidot_Form_Field::field($field);
     }
 }
Пример #2
0
 /**
  *
  * Renders a token into text matching the requested format.
  *
  * @access public
  *
  * @param array $options The "options" portion of the token (second
  * element).
  *
  * @return string The text rendered from the token options.
  *
  */
 function token($options)
 {
     if (isset($options['begin'])) {
         return '<table class="form-view">';
     }
     if (isset($options['end'])) {
         return '</table>';
     }
     $field = Wikidot_Form_Field::field($options['field']);
     $h_label = htmlspecialchars($options['field']['label']);
     $h_value = $field->renderView();
     $output = '<tr class="form-view-field">';
     $output .= "<td class=\"form-view-field-label\">{$h_label}:</td>";
     $output .= "<td class=\"form-view-field-value\">{$h_value}</td>";
     $output .= '</tr>';
     return $output;
 }