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"));
279 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
283 $sort_title =
new ilRadioOption($this->lng->txt(
'sorting_title_header'),
285 $sort_title->
setInfo($this->lng->txt(
'sorting_info_title'));
286 $sort->addOption($sort_title);
288 $sort_manual =
new ilRadioOption($this->lng->txt(
'sorting_manual_header'),
290 $sort_manual->
setInfo($this->lng->txt(
'sorting_info_manual'));
291 $sort->addOption($sort_manual);
293 $sort->setValue($settings->getSortMode());
294 $form->addItem($sort);
300 $hide =
new ilCheckboxInputGUI($this->lng->txt(
"cntr_hide_title_and_icon"),
"hide_header_icon_and_title");
302 $form->addItem($hide);
305 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
306 $form->addCommandButton(
"addTranslation", $this->lng->txt(
"add_translation"));
325 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
330 if($form->checkInput())
332 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
334 $settings->
setSortMode($form->getInput(
"sorting"));
338 if ($this->ilias->getSetting(
"custom_icons"))
340 if($form->getItemByPostVar(
"cont_big_icon")->getDeletionFlag())
342 $this->
object->removeBigIcon();
344 if($form->getItemByPostVar(
"cont_tiny_icon")->getDeletionFlag())
346 $this->
object->removeTinyIcon();
349 $this->
object->saveIcons($_FILES[
"cont_big_icon"][
'tmp_name'],
350 null, $_FILES[
"cont_tiny_icon"][
'tmp_name']);
355 "hide_header_icon_and_title",
356 $form->getInput(
"hide_header_icon_and_title"));
360 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
366 $this->ctrl->redirect($this,
"edit");
371 $form->setValuesByPost();
372 $this->tpl->setContent($form->getHTML());
384 $this->ctrl->redirectByClass(
"ilobjecttranslationgui",
"");
386 $this->lng->loadLanguageModule($this->object->getType());
389 include_once(
"./Services/Object/classes/class.ilObjectTranslationTableGUI.php");
392 if ($a_get_post_values)
395 foreach(
$_POST[
"title"] as $k => $v)
397 $vals[] = array(
"title" => $v,
398 "desc" =>
$_POST[
"desc"][$k],
399 "lang" =>
$_POST[
"lang"][$k],
400 "default" => (
$_POST[
"default"] == $k));
402 $table->setData($vals);
406 $data = $this->
object->getTranslations();
407 foreach(
$data[
"Fobject"] as $k => $v)
409 $data[
"Fobject"][$k][
"default"] = ($k ==
$data[
"default_language"]);
411 $table->setData(
$data[
"Fobject"]);
413 $tpl->setContent($table->getHTML());
423 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
427 if (!isset(
$_POST[
"default"]) && count(
$_POST[
"lang"]) > 0)
434 if (array_key_exists(
"",
$_POST[
"lang"]))
441 if (count(array_unique(
$_POST[
"lang"])) < count(
$_POST[
"lang"]))
448 $this->
object->removeTranslations();
450 if(
sizeof(
$_POST[
"title"]))
452 foreach(
$_POST[
"title"] as $k => $v)
455 $is_default = (
$_POST[
"default"] == $k);
460 $this->
object->update();
463 $this->
object->addTranslation(
473 $this->
object->setTitle(
"ILIAS");
474 $this->
object->setDescription(
"");
475 $this->
object->update();
479 $this->ctrl->redirect($this,
"editTranslations");
487 if(
sizeof(
$_POST[
"title"]))
489 $k = max(array_keys(
$_POST[
"title"]))+1;
505 foreach(
$_POST[
"title"] as $k => $v)
509 unset(
$_POST[
"title"][$k]);
510 unset(
$_POST[
"desc"][$k]);
511 unset(
$_POST[
"lang"][$k]);
512 if(
$_POST[
"default"] == $k)
519 if($del_default &&
sizeof(
$_POST[
"title"]))
521 $_POST[
"default"] = array_shift(array_keys(
$_POST[
"title"]));
543 $this->tpl->setVariable(
'TXT_SORTING',$this->lng->txt(
'sorting_header'));
544 $this->tpl->setVariable(
'TXT_SORT_TITLE',$this->lng->txt(
'sorting_title_header'));
545 $this->tpl->setVariable(
'INFO_SORT_TITLE',$this->lng->txt(
'sorting_info_title'));
546 $this->tpl->setVariable(
'TXT_SORT_MANUAL',$this->lng->txt(
'sorting_manual_header'));
547 $this->tpl->setVariable(
'INFO_SORT_MANUAL',$this->lng->txt(
'sorting_info_manual'));
549 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');