Example #1
0
 public function formatValue($name, $value, model_editor $editor, model_editor_field $field)
 {
     if (is_null($value) || !count($value)) {
         return null;
     }
     if ($this->formatRenderer) {
         foreach ($value as $id => $label) {
             $value[$id] = call_user_func($this->formatRenderer, $id, $label);
         }
     }
     $classes = implode(' ', array_filter(array($this->class, 'related')));
     if ($this->maxCount > 1) {
         return markup::bullets($value, $classes);
     }
     return markup::inline(array_shift($value), $classes);
 }
Example #2
0
 public function renderStatic(html_form $form, $name, $input, $label, model_editor $editor, model_editor_field $field)
 {
     $classes = implode(' ', array_filter(array($this->class, 'texteditor')));
     $form->setRow($name, $label, markup::inline($input, 'static'), $this->isMandatory, null, null, $classes);
     return $this;
 }
Example #3
0
 public function renderStatic(html_form $form, $name, $input, $label, model_editor $editor, model_editor_field $field)
 {
     $classes = implode(' ', array_filter(array($this->class, 'option')));
     $form->setRow($name, $label, markup::inline($input ? \de\toxa\txf\_L('yes') : \de\toxa\txf\_L('no'), 'static'), null, null, $classes);
     return $this;
 }