19 require_once
"./Services/Container/classes/class.ilContainerGUI.php";
20 require_once
"./Modules/Category/classes/class.ilObjCategoryGUI.php";
28 function ilObjRootFolderGUI($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
33 $this->
ilContainerGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
35 $lng->loadLanguageModule(
"cntr");
36 $lng->loadLanguageModule(
"obj");
54 $this->ctrl->returnToParent($this);
77 global $rbacsystem,
$lng, $ilHelp;
79 $ilHelp->setScreenIdComponent(
"root");
81 $this->ctrl->setParameter($this,
"ref_id",$this->ref_id);
83 if ($rbacsystem->checkAccess(
'read',$this->ref_id))
85 $tabs_gui->addTab(
'view_content', $lng->txt(
"content"),
86 $this->ctrl->getLinkTarget($this,
""));
89 if ($rbacsystem->checkAccess(
'write',$this->ref_id))
91 $force_active = (
$_GET[
"cmd"] ==
"edit")
94 $tabs_gui->addTarget(
"settings",
95 $this->ctrl->getLinkTarget($this,
"edit"),
"edit", get_class($this)
108 $next_class = $this->ctrl->getNextClass($this);
109 $cmd = $this->ctrl->getCmd();
116 case 'ilcontainerlinklistgui':
117 include_once(
"Services/Container/classes/class.ilContainerLinkListGUI.php");
119 $ret =& $this->ctrl->forwardCommand($link_list_gui);
123 case "ilcontainerpagegui":
128 $this->tpl->setContent(
$ret);
132 case 'ilpermissiongui':
134 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
136 $ret =& $this->ctrl->forwardCommand($perm_gui);
142 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
143 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
148 case 'ilobjectcopygui':
150 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
152 $cp->setType(
'root');
153 $this->ctrl->forwardCommand($cp);
156 case "ilobjstylesheetgui":
160 case "ilcommonactiondispatchergui":
161 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
163 $this->ctrl->forwardCommand($gui);
166 case 'ilobjecttranslationgui':
171 include_once(
"./Services/Object/classes/class.ilObjectTranslationGUI.php");
173 $this->ctrl->forwardCommand($transgui);
179 if (
$cmd ==
"infoScreen")
188 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
189 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
212 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
213 ilObjectListGUI::prepareJSLinks(
"",
214 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
215 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
217 $ilTabs->activateTab(
"view_content");
231 $this->tpl->setDescription(
"");
234 if ($this->object->getTitle() ==
"ILIAS")
236 $this->tpl->setTitle($lng->txt(
"repository"));
240 if ($this->object->getDescription() !=
"")
242 $this->tpl->setDescription($this->object->getDescription());
250 $this->tabs_gui->addSubTab(
"settings_misc",
251 $this->lng->txt(
"settings"),
252 $this->ctrl->getLinkTarget($this,
"edit"));
258 $this->tabs_gui->addSubTab(
"settings_trans",
259 $this->lng->txt(
"obj_multilinguality"),
260 $this->ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
""));
263 $this->tabs_gui->activateTab(
"settings");
264 $this->tabs_gui->activateSubTab($active_tab);
271 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
273 $form->setFormAction($this->ctrl->getFormAction($this));
274 $form->setTitle($this->lng->txt(
"repository"));
282 ilcontainer::SORT_MANUAL
290 $hide =
new ilCheckboxInputGUI($this->lng->txt(
"cntr_hide_title_and_icon"),
"hide_header_icon_and_title");
292 $form->addItem($hide);
295 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
296 $form->addCommandButton(
"addTranslation", $this->lng->txt(
"add_translation"));
317 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
322 if($form->checkInput())
328 if ($ilSetting->get(
"custom_icons"))
330 if(
$_POST[
"cont_icon_delete"])
332 $this->
object->removeCustomIcon();
334 $this->
object->saveIcons($_FILES[
"cont_icon"][
'tmp_name']);
339 "hide_header_icon_and_title",
340 $form->getInput(
"hide_header_icon_and_title"));
344 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
350 $this->ctrl->redirect($this,
"edit");
355 $form->setValuesByPost();
356 $this->tpl->setContent($form->getHTML());
368 $this->ctrl->redirectByClass(
"ilobjecttranslationgui",
"");
370 $this->lng->loadLanguageModule($this->object->getType());
373 include_once(
"./Services/Object/classes/class.ilObjectTranslationTableGUI.php");
376 if ($a_get_post_values)
379 foreach(
$_POST[
"title"] as $k => $v)
381 $vals[] = array(
"title" => $v,
382 "desc" =>
$_POST[
"desc"][$k],
383 "lang" =>
$_POST[
"lang"][$k],
384 "default" => (
$_POST[
"default"] == $k));
386 $table->setData($vals);
390 $data = $this->
object->getTranslations();
391 foreach(
$data[
"Fobject"] as $k => $v)
393 $data[
"Fobject"][$k][
"default"] = ($k ==
$data[
"default_language"]);
395 $table->setData(
$data[
"Fobject"]);
397 $tpl->setContent($table->getHTML());
407 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
411 if (!isset(
$_POST[
"default"]) && count(
$_POST[
"lang"]) > 0)
418 if (array_key_exists(
"",
$_POST[
"lang"]))
425 if (count(array_unique(
$_POST[
"lang"])) < count(
$_POST[
"lang"]))
432 $this->
object->removeTranslations();
434 if(
sizeof(
$_POST[
"title"]))
436 foreach(
$_POST[
"title"] as $k => $v)
439 $is_default = (
$_POST[
"default"] == $k);
444 $this->
object->update();
447 $this->
object->addTranslation(
457 $this->
object->setTitle(
"ILIAS");
458 $this->
object->setDescription(
"");
459 $this->
object->update();
463 $this->ctrl->redirect($this,
"editTranslations");
471 if(
sizeof(
$_POST[
"title"]))
473 $k = max(array_keys(
$_POST[
"title"]))+1;
489 foreach(
$_POST[
"title"] as $k => $v)
493 unset(
$_POST[
"title"][$k]);
494 unset(
$_POST[
"desc"][$k]);
495 unset(
$_POST[
"lang"][$k]);
496 if(
$_POST[
"default"] == $k)
503 if($del_default &&
sizeof(
$_POST[
"title"]))
505 $_POST[
"default"] = array_shift(array_keys(
$_POST[
"title"]));
513 public static function _goto($a_target)