36 require_once
"./Services/Container/classes/class.ilContainerGUI.php";
37 require_once
"./Modules/Category/classes/class.ilObjCategoryGUI.php";
45 function ilObjRootFolderGUI($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
50 $this->
ilContainerGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
52 $lng->loadLanguageModule(
"cntr");
71 $this->ctrl->returnToParent($this);
96 $this->ctrl->setParameter($this,
"ref_id",$this->ref_id);
98 if ($rbacsystem->checkAccess(
'read',$this->ref_id))
100 $tabs_gui->addTarget(
"view_content",
101 $this->ctrl->getLinkTarget($this,
""),
102 array(
"",
"view",
"render"));
105 if ($rbacsystem->checkAccess(
'write',$this->ref_id))
107 $force_active = (
$_GET[
"cmd"] ==
"edit")
110 $tabs_gui->addTarget(
"edit_properties",
111 $this->ctrl->getLinkTarget($this,
"edit"),
"edit", get_class($this)
112 ,
"", $force_active);
124 $next_class = $this->ctrl->getNextClass($this);
125 $cmd = $this->ctrl->getCmd();
129 case 'ilcontainerlinklistgui':
130 include_once(
"./classes/class.ilContainerLinkListGUI.php");
132 $ret =& $this->ctrl->forwardCommand($link_list_gui);
136 case "ilpageobjectgui":
142 $this->tpl->setContent(
$ret);
156 case 'ilpermissiongui':
158 include_once(
"./classes/class.ilPermissionGUI.php");
160 $ret =& $this->ctrl->forwardCommand($perm_gui);
165 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
166 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
189 global $rbacsystem,
$lng;
191 if (!$rbacsystem->checkAccess(
"write", $this->ref_id))
193 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
196 $this->ctrl->setParameter($this,
"mode",
"edit");
199 include_once
"./Services/MetaData/classes/class.ilMDLanguageItem.php";
205 $this->tpl->setVariable(
"TXT_HIDE_HEADER_ICON_AND_TITLE", $lng->txt(
"cntr_hide_title_and_icon"));
208 $this->tpl->setVariable(
"CHK_HIDE_ICON",
' checked="checked" ');
216 $_GET[
"mode"] =
"session";
221 if ((
$_GET[
"mode"] !=
"session"))
223 $data = $this->
object->getTranslations();
227 elseif (
$_GET[
"entry"] != 0)
229 array_splice(
$_SESSION[
"translation_post"][
"Fobject"],
$_GET[
"entry"],1,array());
231 if (
$_GET[
"entry"] ==
$_SESSION[
"translation_post"][
"default_language"])
233 $_SESSION[
"translation_post"][
"default_language"] =
"";
240 if (!
$_GET[
"entry"] and $array_push)
242 $count = array_push(
$data[
"Fobject"],array(
"title" =>
"",
"desc" =>
""));
246 $count = count(
$data[
"Fobject"]);
250 $strip = isset(
$_SESSION[
"translation_post"]) ?
true :
false;
253 if (count(
$data[
"Fobject"]) == 0)
255 $data[
"Fobject"][0] =
258 "lang" => $lng->getDefaultLanguage()
262 foreach (
$data[
"Fobject"] as $key => $val)
265 if ($key == $count -1)
267 $this->tpl->setCurrentBlock(
"addTranslation");
268 $this->tpl->setVariable(
"TXT_ADD_TRANSLATION",$this->lng->txt(
"add_translation").
" >>");
269 $this->tpl->parseCurrentBlock();
275 $this->tpl->setCurrentBlock(
"removeTranslation");
276 $this->tpl->setVariable(
"TXT_REMOVE_TRANSLATION",$this->lng->txt(
"remove_translation"));
277 $this->ctrl->setParameter($this,
"entry", $key);
278 $this->ctrl->setParameter($this,
"mode",
"edit");
279 $this->tpl->setVariable(
"LINK_REMOVE_TRANSLATION", $this->ctrl->getLinkTarget($this,
"removeTranslation"));
280 $this->tpl->parseCurrentBlock();
284 $this->tpl->addBlockFile(
"SEL_LANGUAGE",
"sel_language",
"tpl.lang_selection.html",
false);
285 $this->tpl->setVariable(
"SEL_NAME",
"Fobject[".$key.
"][lang]");
289 foreach ($languages as $code => $language)
291 $this->tpl->setCurrentBlock(
"lg_option");
292 $this->tpl->setVariable(
"VAL_LG", $code);
293 $this->tpl->setVariable(
"TXT_LG", $language);
295 if ($code == $val[
"lang"])
297 $this->tpl->setVariable(
"SELECTED",
"selected=\"selected\"");
300 $this->tpl->parseCurrentBlock();
304 $this->tpl->setCurrentBlock(
"obj_form");
308 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"repository"));
312 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"translation").
" ".$key);
315 if ($key ==
$data[
"default_language"])
317 $this->tpl->setVariable(
"CHECKED",
"checked=\"checked\"");
320 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
321 $this->tpl->setVariable(
"TXT_DESC", $this->lng->txt(
"title_long"));
322 $this->tpl->setVariable(
"TXT_DEFAULT", $this->lng->txt(
"default"));
323 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"language"));
326 $this->tpl->setVariable(
"NUM", $key);
327 $this->tpl->parseCurrentBlock();
333 $this->tpl->setCurrentBlock(
"adm_content");
334 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
335 $this->tpl->setVariable(
"TARGET", $this->
getTargetFrame(
"update"));
336 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
337 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
338 $this->tpl->setVariable(
"CMD_SUBMIT",
"update");
339 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
350 $this->tpl->setDescription(
"");
351 if ($this->object->getTitle() ==
"ILIAS")
353 $this->tpl->setTitle($lng->txt(
"repository"));
357 if ($this->object->getDescription() !=
"")
359 $this->tpl->setTitle($this->object->getDescription());
372 if (!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
374 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
381 if (!isset(
$data[
"default_language"]))
383 $this->ilias->raiseError($this->lng->txt(
"msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
387 foreach (
$data[
"Fobject"] as $key => $val)
389 $langs[$key] = $val[
"lang"];
392 $langs = array_count_values($langs);
395 if (array_key_exists(
"",$langs) &&
396 (count(
$data[
"Fobject"]) > 1 ||
$data[
"Fobject"][0][
"title"] !=
""))
398 $this->ilias->raiseError($this->lng->txt(
"msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
402 if (array_sum($langs) > count($langs))
404 $this->ilias->raiseError($this->lng->txt(
"msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
408 $_POST[
"Fobject"][
"title"] = $_POST[
"Fobject"][$_POST[
"default_language"]][
"title"];
409 $_POST[
"Fobject"][
"desc"] = $_POST[
"Fobject"][$_POST[
"default_language"]][
"desc"];
412 $this->
object->removeTranslations();
415 foreach (
$data[
"Fobject"] as $key => $val)
417 if ($key ==
$data[
"default_language"])
426 if (trim($val[
"title"]) !=
"")
433 if (trim($_POST[
"Fobject"][
"title"]) ==
"")
435 $_POST[
"Fobject"][
"title"] =
"ILIAS";
443 if ($this->ilias->getSetting(
"custom_icons"))
445 $this->
object->saveIcons($_FILES[
"cont_big_icon"][
'tmp_name'],
446 $_FILES[
"cont_small_icon"][
'tmp_name'], $_FILES[
"cont_tiny_icon"][
'tmp_name']);
449 $this->update = $this->
object->update();
452 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
471 if (!(
$_GET[
"mode"] !=
"create" or
$_GET[
"mode"] !=
"edit"))
473 $message = get_class($this).
"::addTranslationObject(): Missing or wrong parameter! mode: ".
$_GET[
"mode"];
474 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
478 $this->ctrl->setParameter($this,
"entry", 0);
479 $this->ctrl->setParameter($this,
"mode",
"session");
480 $this->ctrl->setParameter($this,
"new_type",
$_GET[
"new_type"]);
491 if (!(
$_GET[
"mode"] !=
"create" or
$_GET[
"mode"] !=
"edit"))
493 $message = get_class($this).
"::removeTranslationObject(): Missing or wrong parameter! mode: ".
$_GET[
"mode"];
494 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
497 $this->ctrl->setParameter($this,
"entry",
$_GET[
"entry"]);
498 $this->ctrl->setParameter($this,
"mode",
"session");
499 $this->ctrl->setParameter($this,
"new_type",
$_GET[
"new_type"]);
512 $this->
object->removeBigIcon();
525 $this->
object->removeSmallIcon();
538 $this->
object->removeTinyIcon();
559 if ($ilAccess->checkAccess(
"read",
"",1))
561 $_GET[
"cmd"] =
"frameset";
563 include(
"repository.php");
566 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
576 $this->tpl->setVariable(
'TXT_SORTING',$this->lng->txt(
'sorting_header'));
577 $this->tpl->setVariable(
'TXT_SORT_TITLE',$this->lng->txt(
'sorting_title_header'));
578 $this->tpl->setVariable(
'INFO_SORT_TITLE',$this->lng->txt(
'sorting_info_title'));
579 $this->tpl->setVariable(
'TXT_SORT_MANUAL',$this->lng->txt(
'sorting_manual_header'));
580 $this->tpl->setVariable(
'INFO_SORT_MANUAL',$this->lng->txt(
'sorting_info_manual'));
582 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');