19declare(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;
95 FieldFactory $field_factory,
99 $field_factory->group([
100 'language' => $field_factory->hidden()->
withValue($this->language_code),
101 'title' => $field_factory->text($language->txt(
'title'))
104 'description' => $field_factory->textarea($language->txt(
'description'))
110 static fn(array $vs): self => new self(
114 $vs[
'default'] ===
'1',
126 return $row_builder->buildDataRow(
127 $this->language_code,
129 'language' => $this->getTranslatedLanguageName(
$lng, $this->language_code),
130 'base' => $this->isBase(),
131 'default' => $this->isDefault(),
133 'description' => $this->getDescription()
135 )->withDisabledAction(
TranslationsTable::ACTION_DELETE, $this->isBase() || $this->isDefault())
136 ->withDisabledAction(
TranslationsTable::ACTION_MAKE_DEFAULT, $this->isDefault());
141 string $language_code
getTranslatedLanguageName(SystemLanguage $lng, string $language_code)
toForm(\ilLanguage $language, FieldFactory $field_factory, Refinery $refinery)
__construct(private readonly string $language_code, private string $title, private string $description, private bool $default=false, private bool $base=false)
withDefault(bool $default)
toRow(DataRowBuilder $row_builder, SystemLanguage $lng)
withDescription(string $description)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...