56 $this->ilObjOrgUnitGui = $ilObjOrgUnitGUI;
57 $this->ilObjectOrgUnit = $ilObjOrgUnitGUI->object;
62 if (!
$ilAccess->checkAccess(
'write',
'', $this->ilObjectOrgUnit->getRefId())) {
64 $this->ctrl->redirect($this->parent_gui,
"");
70 $cmd = $this->ctrl->getCmd();
77 $this->lng->loadLanguageModule($this->ilObjectOrgUnit->getType());
85 if ($a_get_post_values) {
87 foreach (
$_POST[
"title"] as $k => $v) {
88 $vals[] = array(
"title" => $v,
89 "desc" =>
$_POST[
"desc"][$k],
90 "lang" =>
$_POST[
"lang"][$k],
91 "default" => (
$_POST[
"default"] == $k));
95 $data = $this->ilObjectOrgUnit->getTranslations();
96 foreach (
$data[
"Fobject"] as $k => $v) {
97 $data[
"Fobject"][$k][
"default"] = ($k ==
$data[
"default_language"]);
100 $data[
"Fobject"][++$k][
"title"] =
"";
104 $this->tpl->setContent(
$table->getHTML());
114 if (!isset(
$_POST[
"default"])) {
120 if (array_key_exists(
"",
$_POST[
"lang"])) {
126 if (count(array_unique(
$_POST[
"lang"])) < count(
$_POST[
"lang"])) {
132 $this->ilObjectOrgUnit->removeTranslations();
133 foreach (
$_POST[
"title"] as $k => $v) {
135 $is_default = (
$_POST[
"default"] == $k);
139 $this->ilObjectOrgUnit->update();
142 $this->ilObjectOrgUnit->addTranslation(
150 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
151 $this->ctrl->redirect($this,
"editTranslations");
160 $k = max(array_keys(
$_POST[
"title"]));
174 foreach (
$_POST[
"title"] as $k => $v) {
175 if (
$_POST[
"check"][$k]) {
177 if ($k !=
$_POST[
"default"]) {
178 unset(
$_POST[
"title"][$k]);
179 unset(
$_POST[
"desc"][$k]);
180 unset(
$_POST[
"lang"][$k]);
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
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
TableGUI class for title/description translations.
if(empty($password)) $table