3 require_once(
"./Services/Object/classes/class.ilObjectTranslationTableGUI.php");
56 $this->ilObjOrgUnitGui = $ilObjOrgUnitGUI;
57 $this->ilObjectOrgUnit = $ilObjOrgUnitGUI->object;
62 if(!
$ilAccess->checkAccess(
'write',
'',$this->ilObjectOrgUnit->getRefId()))
65 $this->ctrl->redirect($this->parent_gui,
"");
71 $cmd = $this->ctrl->getCmd();
78 $this->lng->loadLanguageModule($this->ilObjectOrgUnit->getType());
82 if ($a_get_post_values)
85 foreach(
$_POST[
"title"] as $k => $v)
87 $vals[] =
array(
"title" => $v,
88 "desc" =>
$_POST[
"desc"][$k],
89 "lang" =>
$_POST[
"lang"][$k],
90 "default" => (
$_POST[
"default"] == $k));
92 $table->setData($vals);
96 $data = $this->ilObjectOrgUnit->getTranslations();
97 foreach(
$data[
"Fobject"] as $k => $v)
99 $data[
"Fobject"][$k][
"default"] = ($k ==
$data[
"default_language"]);
103 $data[
"Fobject"][++$k][
"title"] =
"";
105 $table->setData(
$data[
"Fobject"]);
107 $this->tpl->setContent($table->getHTML());
117 if (!isset(
$_POST[
"default"]))
124 if (array_key_exists(
"",
$_POST[
"lang"]))
131 if (count(array_unique(
$_POST[
"lang"])) < count(
$_POST[
"lang"]))
138 $this->ilObjectOrgUnit->removeTranslations();
139 foreach(
$_POST[
"title"] as $k => $v)
142 $is_default = (
$_POST[
"default"] == $k);
147 $this->ilObjectOrgUnit->update();
150 $this->ilObjectOrgUnit->addTranslation(
158 $this->ctrl->redirect($this,
"editTranslations");
169 $k = max(array_keys(
$_POST[
"title"]));
185 foreach(
$_POST[
"title"] as $k => $v)
190 if($k !=
$_POST[
"default"])
192 unset(
$_POST[
"title"][$k]);
193 unset(
$_POST[
"desc"][$k]);
194 unset(
$_POST[
"lang"][$k]);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
saveTranslations()
Save title and translations.
editTranslations($a_get_post_values=false, $a_add=false)
Class ilObjOrgUnit GUI class.
deleteTranslations()
Remove translation.
addTranslation()
Add a translation.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
TableGUI class for title/description translations.