protected function convertAttr($attributes) { if (!count($attributes) || is_string($attributes)) { return ''; } return html_convertAttribute($attributes); }
protected function convertAttr($attr = false) { if (!$attr) { $attr = $this->attributes; } return html_convertAttribute($attr); }
protected static function convertAttr($attr) { return html_convertAttribute($attr); }
/** * Fügt das Formular zusammen und speichert es, falls nötig * * @return string * */ public function show() { extension::get('FORM_BEFORE_ACTION', $this); foreach ($this->getParams() as $key => $value) { $param = $this->addHiddenField($key, $value); $param->setSave(false); } if ($this->isSubmit(true)) { $this->saveForm(); if (!$this->isSaveEdit() && is_null($this->errorMessage)) { $this->redirect(); } if (!is_null($this->errorMessage)) { echo message::danger($this->errorMessage); } elseif (!is_null($this->successMessage)) { echo message::success($this->successMessage); } } $return = []; $buttons = []; $hidden = []; $x = 1; $return[] = '<form' . html_convertAttribute($this->formAttributes) . '>' . PHP_EOL; foreach ($this->return as $ausgabe) { if ($ausgabe->getAttribute('type') == 'hidden') { $hidden[] = $ausgabe->get(); continue; } if (!$ausgabe->hasAttribute('id')) { $ausgabe->addAttribute('id', 'form_' . $x); } $return[] = '<div class="form-group">'; $return[] = '<label for="' . $ausgabe->getAttribute('id') . '">' . $ausgabe->fieldName . '</label>'; $return[] = '<div class="form-wrap-input">' . $ausgabe->prefix . $ausgabe->get() . $ausgabe->suffix . '</div>'; $return[] = '</div>'; $x++; } foreach ($this->buttons as $button) { $buttons[] = $button->get(); } $return[] = implode(PHP_EOL, $hidden); $return[] = '<div class="form-group">'; $return[] = '<div class="form-submit-area col-sm-10 btn-group">' . implode(PHP_EOL, $buttons) . '</div>'; $return[] = '</div>'; $return[] = '</form>'; $return = extension::get('FORM_BEFORE_SHOW', implode(PHP_EOL, $return)); return $return; }