29 protected ?
string $id =
"";
37 protected array
$css = array();
49 $this->
lng = $DIC->language();
58 abstract public static function getInstance():
self;
64 protected function setType(
int $a_value): void
66 $this->type = $a_value;
74 public function setId(?
string $a_value): void
79 public function getId(): ?string
84 public function setCaption(
string $a_value,
bool $a_is_lng_id =
true): void
86 $this->caption = $a_value;
87 $this->caption_is_lng_id = $a_is_lng_id;
90 public function getCaption(
bool $a_translate =
true): string
96 if ($this->caption_is_lng_id &&
98 $caption = $lng->
txt($caption);
106 $this->primary = $a_value;
119 $this->omit_prevent_double_submission = $a_value;
129 $this->onclick = trim($a_value);
149 $this->css[] = $a_value;
167 $css[] =
"btn-primary";
170 $css[] =
"omitPreventDoubleSubmission";
173 return implode(
" ", $css);
180 foreach ($a_attr as $id => $value) {
182 $res[] = strtolower(trim($id)) .
'="' . $value .
'"';
187 return " " . implode(
" ",
$res);
198 $attr[
"id"] = $this->
getId();
203 $attr[
"disabled"] =
"disabled";
206 if (count($a_additional_attr)) {
207 $attr = array_merge($attr, $a_additional_attr);
223 if (null === $apply_default_css) {
231 abstract public function render(): string;
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...