19 declare(strict_types=1);
32 private readonly
string $language_code,
33 private string $title,
34 private string $description,
35 private bool $default =
false,
36 private bool $base =
false 42 return $this->language_code;
53 $clone->title = $title;
59 return $this->description;
65 $clone->description = $description;
71 return $this->default;
77 $clone->default = $default;
99 $field_factory->group([
100 'language' => $field_factory->hidden()->withValue($this->language_code),
101 'title' => $field_factory->text($language->
txt(
'title'))
103 ->withValue($this->title),
104 'description' => $field_factory->textarea($language->
txt(
'description'))
106 'default' => $field_factory->hidden()->withValue($this->
isDefault()),
107 'base' => $field_factory->hidden()->withValue($this->
isBase()),
109 $refinery->custom()->transformation(
110 static fn(array $vs):
self =>
new self(
114 $vs[
'default'] ===
'1',
127 $this->language_code,
130 'base' => $this->
isBase(),
141 string $language_code
143 return $lng->txt(
"meta_l_{$language_code}");
__construct(private readonly string $language_code, private string $title, private string $description, private bool $default=false, private bool $base=false)
toForm(\ilLanguage $language, FieldFactory $field_factory, Refinery $refinery)
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...
const ACTION_MAKE_DEFAULT
withDefault(bool $default)
buildDataRow(string $id, array $record)
getTranslatedLanguageName(SystemLanguage $lng, string $language_code)
withDescription(string $description)
toRow(DataRowBuilder $row_builder, SystemLanguage $lng)