35 $ilCtrl = $DIC[
'ilCtrl'];
37 $ilUser = $DIC[
'ilUser'];
42 $this->
ctrl = $ilCtrl;
44 $this->
user = $ilUser;
57 $this->obj_orgu->update();
66 private function initForm():
void 72 $item->setRequired(
true);
73 $item->setValue($this->obj_orgu->getTitle());
77 $item->
setValue($this->obj_orgu->getDescription());
81 $item->setTitle($this->
lng->txt(
'orgu_type'));
84 $options = array(0 =>
'');
86 foreach ($types as $type) {
87 $options[$type->getId()] = $type->getTitle();
92 $item->setValue($this->obj_orgu->getOrgUnitTypeId());
96 $item->setTitle($this->
lng->txt(
'ext_id'));
100 $item->setValue($this->obj_orgu->getImportId());
116 $this->obj_orgu->setOrgUnitTypeId($this->
getInput(
'orgu_type'));
117 $this->obj_orgu->setImportId($this->
getInput(
'ext_id'));
118 $this->obj_orgu->setTitle($this->
getInput(
'title'));
119 $this->obj_orgu->setDescription($this->
getInput(
'description'));
129 $translations = $this->obj_orgu->getTranslations();
130 $lang_code_default =
'';
131 $lang_codes = array();
132 foreach ($translations as $translation) {
133 if ($translation[
'default']) {
134 $lang_code_default = $translation[
'lang'];
136 $lang_codes[] = $translation[
'lang'];
138 $lang_code = (in_array($this->
user->getLanguage(), $lang_codes,
true)) ? $this->
user->getLanguage() : $lang_code_default;
139 $this->obj_orgu->updateTranslation($this->
getInput(
'title'), $this->
getInput(
'description'), $lang_code, 0);
static getAllTypes()
Get array of all instances of ilOrgUnitType objects.
setValue(string $a_value)
Class ilObjectGUI Basic methods of all Output classes.
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.