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");
70 $this->ctrl->returnToParent($this);
93 global $rbacsystem,
$lng;
95 $this->ctrl->setParameter($this,
"ref_id",$this->ref_id);
97 if ($rbacsystem->checkAccess(
'read',$this->ref_id))
99 $tabs_gui->addTab(
'view_content', $lng->txt(
"content"),
100 $this->ctrl->getLinkTarget($this,
""));
103 if ($rbacsystem->checkAccess(
'write',$this->ref_id))
105 $force_active = (
$_GET[
"cmd"] ==
"edit")
108 $tabs_gui->addTarget(
"settings",
109 $this->ctrl->getLinkTarget($this,
"edit"),
"edit", get_class($this)
110 ,
"", $force_active);
122 $next_class = $this->ctrl->getNextClass($this);
123 $cmd = $this->ctrl->getCmd();
127 case 'ilcontainerlinklistgui':
128 include_once(
"./classes/class.ilContainerLinkListGUI.php");
130 $ret =& $this->ctrl->forwardCommand($link_list_gui);
134 case "ilpageobjectgui":
139 $this->tpl->setContent(
$ret);
143 case 'ilpermissiongui':
145 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
147 $ret =& $this->ctrl->forwardCommand($perm_gui);
153 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
154 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
159 case 'ilobjectcopygui':
161 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
163 $cp->setType(
'root');
164 $this->ctrl->forwardCommand($cp);
167 case "ilobjstylesheetgui":
173 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
174 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
197 $ilTabs->activateTab(
"view_content");
210 global $rbacsystem,
$lng;
212 if (!$rbacsystem->checkAccess(
"write", $this->ref_id))
214 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
217 $this->ctrl->setParameter($this,
"mode",
"edit");
220 include_once
"./Services/MetaData/classes/class.ilMDLanguageItem.php";
226 $this->tpl->setVariable(
"TXT_HIDE_HEADER_ICON_AND_TITLE", $lng->txt(
"cntr_hide_title_and_icon"));
229 $this->tpl->setVariable(
"CHK_HIDE_ICON",
' checked="checked" ');
237 $_GET[
"mode"] =
"session";
242 if ((
$_GET[
"mode"] !=
"session"))
244 $data = $this->
object->getTranslations();
248 elseif (
$_GET[
"entry"] != 0)
250 array_splice(
$_SESSION[
"translation_post"][
"Fobject"],
$_GET[
"entry"],1,array());
252 if (
$_GET[
"entry"] ==
$_SESSION[
"translation_post"][
"default_language"])
254 $_SESSION[
"translation_post"][
"default_language"] =
"";
261 if (!
$_GET[
"entry"] and $array_push)
263 $count = array_push(
$data[
"Fobject"],array(
"title" =>
"",
"desc" =>
""));
267 $count = count(
$data[
"Fobject"]);
271 $strip = isset(
$_SESSION[
"translation_post"]) ?
true :
false;
274 if (count(
$data[
"Fobject"]) == 0)
276 $data[
"Fobject"][0] =
279 "lang" => $lng->getDefaultLanguage()
283 foreach (
$data[
"Fobject"] as $key => $val)
286 if ($key == $count -1)
288 $this->tpl->setCurrentBlock(
"addTranslation");
289 $this->tpl->setVariable(
"TXT_ADD_TRANSLATION",$this->lng->txt(
"add_translation").
" >>");
290 $this->tpl->parseCurrentBlock();
296 $this->tpl->setCurrentBlock(
"removeTranslation");
297 $this->tpl->setVariable(
"TXT_REMOVE_TRANSLATION",$this->lng->txt(
"remove_translation"));
298 $this->ctrl->setParameter($this,
"entry", $key);
299 $this->ctrl->setParameter($this,
"mode",
"edit");
300 $this->tpl->setVariable(
"LINK_REMOVE_TRANSLATION", $this->ctrl->getLinkTarget($this,
"removeTranslation"));
301 $this->tpl->parseCurrentBlock();
305 $this->tpl->addBlockFile(
"SEL_LANGUAGE",
"sel_language",
"tpl.lang_selection.html",
false);
306 $this->tpl->setVariable(
"SEL_NAME",
"Fobject[".$key.
"][lang]");
310 foreach ($languages as $code => $language)
312 $this->tpl->setCurrentBlock(
"lg_option");
313 $this->tpl->setVariable(
"VAL_LG", $code);
314 $this->tpl->setVariable(
"TXT_LG", $language);
316 if ($code == $val[
"lang"])
318 $this->tpl->setVariable(
"SELECTED",
"selected=\"selected\"");
321 $this->tpl->parseCurrentBlock();
325 $this->tpl->setCurrentBlock(
"obj_form");
329 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"repository"));
333 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"translation").
" ".$key);
336 if ($key ==
$data[
"default_language"])
338 $this->tpl->setVariable(
"CHECKED",
"checked=\"checked\"");
341 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
342 $this->tpl->setVariable(
"TXT_DESC", $this->lng->txt(
"title_long"));
343 $this->tpl->setVariable(
"TXT_DEFAULT", $this->lng->txt(
"default"));
344 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"language"));
347 $this->tpl->setVariable(
"NUM", $key);
348 $this->tpl->parseCurrentBlock();
354 $this->tpl->setCurrentBlock(
"adm_content");
355 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
356 $this->tpl->setVariable(
"TARGET", $this->
getTargetFrame(
"update"));
357 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
358 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
359 $this->tpl->setVariable(
"CMD_SUBMIT",
"update");
360 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
371 $this->tpl->setDescription(
"");
374 if ($this->object->getTitle() ==
"ILIAS")
376 $this->tpl->setTitle($lng->txt(
"repository"));
380 if ($this->object->getDescription() !=
"")
382 $this->tpl->setTitle($this->object->getDescription());
396 if (!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
398 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
405 if (!isset(
$data[
"default_language"]))
407 $this->ilias->raiseError($this->lng->txt(
"msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
411 foreach (
$data[
"Fobject"] as $key => $val)
413 $langs[$key] = $val[
"lang"];
416 $langs = array_count_values($langs);
419 if (array_key_exists(
"",$langs) &&
420 (count(
$data[
"Fobject"]) > 1 ||
$data[
"Fobject"][0][
"title"] !=
""))
422 $this->ilias->raiseError($this->lng->txt(
"msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
426 if (array_sum($langs) > count($langs))
428 $this->ilias->raiseError($this->lng->txt(
"msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
433 $_POST[
"Fobject"][
"desc"] = $_POST[
"Fobject"][$_POST[
"default_language"]][
"desc"];
436 $this->
object->removeTranslations();
439 foreach (
$data[
"Fobject"] as $key => $val)
441 if ($key ==
$data[
"default_language"])
450 if (trim($val[
"title"]) !=
"")
457 if (trim($_POST[
"Fobject"][
"title"]) ==
"")
459 $_POST[
"Fobject"][
"title"] =
"ILIAS";
467 if ($this->ilias->getSetting(
"custom_icons"))
469 $this->
object->saveIcons($_FILES[
"cont_big_icon"][
'tmp_name'],
470 $_FILES[
"cont_small_icon"][
'tmp_name'], $_FILES[
"cont_tiny_icon"][
'tmp_name']);
473 $this->update = $this->
object->update();
476 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
495 if (!(
$_GET[
"mode"] !=
"create" or
$_GET[
"mode"] !=
"edit"))
497 $message = get_class($this).
"::addTranslationObject(): Missing or wrong parameter! mode: ".
$_GET[
"mode"];
498 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
502 $this->ctrl->setParameter($this,
"entry", 0);
503 $this->ctrl->setParameter($this,
"mode",
"session");
504 $this->ctrl->setParameter($this,
"new_type",
$_GET[
"new_type"]);
515 if (!(
$_GET[
"mode"] !=
"create" or
$_GET[
"mode"] !=
"edit"))
517 $message = get_class($this).
"::removeTranslationObject(): Missing or wrong parameter! mode: ".
$_GET[
"mode"];
518 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
521 $this->ctrl->setParameter($this,
"entry",
$_GET[
"entry"]);
522 $this->ctrl->setParameter($this,
"mode",
"session");
523 $this->ctrl->setParameter($this,
"new_type",
$_GET[
"new_type"]);
536 $this->
object->removeBigIcon();
537 $this->ctrl->redirect($this,
$_GET[
"mode"]);
549 $this->
object->removeSmallIcon();
550 $this->ctrl->redirect($this,
$_GET[
"mode"]);
562 $this->
object->removeTinyIcon();
563 $this->ctrl->redirect($this,
$_GET[
"mode"]);
573 if ($ilAccess->checkAccess(
"read",
"",1))
575 $_GET[
"cmd"] =
"frameset";
577 include(
"repository.php");
580 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
590 $this->tpl->setVariable(
'TXT_SORTING',$this->lng->txt(
'sorting_header'));
591 $this->tpl->setVariable(
'TXT_SORT_TITLE',$this->lng->txt(
'sorting_title_header'));
592 $this->tpl->setVariable(
'INFO_SORT_TITLE',$this->lng->txt(
'sorting_info_title'));
593 $this->tpl->setVariable(
'TXT_SORT_MANUAL',$this->lng->txt(
'sorting_manual_header'));
594 $this->tpl->setVariable(
'INFO_SORT_MANUAL',$this->lng->txt(
'sorting_info_manual'));
596 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');