3 require_once(
"./Services/Object/classes/class.ilObjectTranslationTableGUI.php");
51 $this->ilObjOrgUnitGui = $ilObjOrgUnitGUI;
52 $this->ilObjectOrgUnit = $ilObjOrgUnitGUI->object;
57 if(!$ilAccess->checkAccess(
'write',
'',$this->ilObjectOrgUnit->getRefId()))
60 $this->ctrl->redirect($this->parent_gui,
"");
66 $cmd = $this->ctrl->getCmd();
73 $this->lng->loadLanguageModule($this->ilObjectOrgUnit->getType());
77 if ($a_get_post_values)
80 foreach(
$_POST[
"title"] as $k => $v)
82 $vals[] = array(
"title" => $v,
83 "desc" =>
$_POST[
"desc"][$k],
84 "lang" =>
$_POST[
"lang"][$k],
85 "default" => (
$_POST[
"default"] == $k));
87 $table->setData($vals);
91 $data = $this->ilObjectOrgUnit->getTranslations();
92 foreach($data[
"Fobject"] as $k => $v)
94 $data[
"Fobject"][$k][
"default"] = ($k == $data[
"default_language"]);
98 $data[
"Fobject"][++$k][
"title"] =
"";
100 $table->setData($data[
"Fobject"]);
102 $this->tpl->setContent($table->getHTML());
112 if (!isset(
$_POST[
"default"]))
119 if (array_key_exists(
"",
$_POST[
"lang"]))
126 if (count(array_unique(
$_POST[
"lang"])) < count(
$_POST[
"lang"]))
133 $this->ilObjectOrgUnit->removeTranslations();
134 foreach(
$_POST[
"title"] as $k => $v)
137 $is_default = (
$_POST[
"default"] == $k);
142 $this->ilObjectOrgUnit->update();
145 $this->ilObjectOrgUnit->addTranslation(
153 $this->ctrl->redirect($this,
"editTranslations");
164 $k = max(array_keys(
$_POST[
"title"]));
180 foreach(
$_POST[
"title"] as $k => $v)
185 if($k !=
$_POST[
"default"])
187 unset(
$_POST[
"title"][$k]);
188 unset(
$_POST[
"desc"][$k]);
189 unset(
$_POST[
"lang"][$k]);