5 require_once
"./Services/Container/classes/class.ilContainerGUI.php";
28 function ilObjCategoryGUI($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
37 $this->
ilContainerGUI($a_data,(
int) $a_id,$a_call_by_reference,
false);
42 global $rbacsystem, $ilNavigationHistory, $ilAccess,
$ilCtrl,$ilTabs;
44 $next_class = $this->ctrl->getNextClass($this);
45 $cmd = $this->ctrl->getCmd();
49 include_once(
'./Services/User/classes/class.ilObjUserGUI.php');
51 $this->tabs_gui->setTabActive(
'administrate_users');
55 $this->gui_obj->setCreationMode($this->creation_mode);
56 $ret =& $this->ctrl->forwardCommand($this->gui_obj);
61 $this->gui_obj->setCreationMode($this->creation_mode);
62 $ret =& $this->ctrl->forwardCommand($this->gui_obj);
65 $ilTabs->clearTargets();
66 $ilTabs->setBackTarget($this->lng->txt(
'backto_lua'), $this->ctrl->getLinkTarget($this,
'listUsers'));
69 case "ilobjuserfoldergui":
70 include_once(
'./Services/User/classes/class.ilObjUserFolderGUI.php');
72 $this->tabs_gui->setTabActive(
'administrate_users');
74 $this->gui_obj->setUserOwnerId((
int) $_GET[
'ref_id']);
75 $this->gui_obj->setCreationMode($this->creation_mode);
76 $ret =& $this->ctrl->forwardCommand($this->gui_obj);
82 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
83 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
88 case 'ilpermissiongui':
90 $this->tabs_gui->setTabActive(
'perm_settings');
91 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
93 $ret =& $this->ctrl->forwardCommand($perm_gui);
96 case 'ilinfoscreengui':
101 case 'ilcontainerlinklistgui':
102 include_once(
"./classes/class.ilContainerLinkListGUI.php");
104 $ret =& $this->ctrl->forwardCommand($link_list_gui);
108 case "ilpageobjectgui":
113 $this->tpl->setContent(
$ret);
117 case 'ilobjectcopygui':
120 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
123 $this->ctrl->forwardCommand($cp);
126 case "ilobjstylesheetgui":
130 case 'ilusertablegui':
131 include_once
'./Services/User/classes/class.ilUserTableGUI.php';
133 $u_table->initFilter();
134 $this->ctrl->setReturn($this,
'listUsers');
135 $this->ctrl->forwardCommand($u_table);
139 if (
$cmd ==
"infoScreen")
150 $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
152 $ilNavigationHistory->addItem($_GET[
"ref_id"],
153 "repository.php?cmd=frameset&ref_id=".$_GET[
"ref_id"],
"cat");
157 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
158 if (is_object($this->
object))
160 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
182 global $rbacsystem,
$lng;
184 if ($this->ctrl->getCmd() ==
"editPageContent")
188 #$this->ctrl->setParameter($this,"ref_id",$this->ref_id);
190 if ($rbacsystem->checkAccess(
'read',$this->ref_id))
192 $force_active = (
$_GET[
"cmd"] ==
"" ||
$_GET[
"cmd"] ==
"render")
195 $tabs_gui->addTab(
"view_content", $lng->txt(
"content"),
196 $this->ctrl->getLinkTarget($this,
""));
199 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui"
200 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
203 $tabs_gui->addTarget(
"info_short",
204 $this->ctrl->getLinkTargetByClass(
205 array(
"ilobjcategorygui",
"ilinfoscreengui"),
"showSummary"),
206 array(
"showSummary",
"",
"infoScreen"),
207 "",
"", $force_active);
211 if ($rbacsystem->checkAccess(
'write',$this->ref_id))
213 $force_active = (
$_GET[
"cmd"] ==
"edit")
216 $tabs_gui->addTarget(
"settings",
217 $this->ctrl->getLinkTarget($this,
"edit"),
"edit", get_class($this)
218 ,
"", $force_active);
221 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
224 $rbacsystem->checkAccess(
'cat_administrate_users',$this->ref_id))
226 $tabs_gui->addTarget(
"administrate_users",
227 $this->ctrl->getLinkTarget($this,
"listUsers"),
"listUsers", get_class($this));
242 $ilTabs->activateTab(
"view_content");
259 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
261 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
266 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
272 $this->tpl->setCurrentBlock(
"btn_cell");
273 $this->tpl->setVariable(
"BTN_LINK",
274 $this->ctrl->getLinkTarget($this,
"importCategoriesForm"));
275 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"import_categories"));
276 $this->tpl->parseCurrentBlock();
290 if ((
$_GET[
"mode"] !=
"session"))
294 elseif (
$_GET[
"entry"] != 0)
296 array_splice(
$_SESSION[
"translation_post"][
"Fobject"],
$_GET[
"entry"],1,array());
298 if (
$_GET[
"entry"] ==
$_SESSION[
"translation_post"][
"default_language"])
300 $_SESSION[
"translation_post"][
"default_language"] =
"";
305 $strip = isset(
$_SESSION[
"translation_post"]) ?
true :
false;
309 if (!is_array(
$data[
"Fobject"]))
311 $data[
"Fobject"] = array();
315 if (!
$_GET[
"entry"] and $array_push)
317 $count = array_push(
$data[
"Fobject"],array(
"title" =>
"",
"desc" =>
""));
321 $count = count(
$data[
"Fobject"]);
324 foreach (
$data[
"Fobject"] as $key => $val)
327 if ($key == $count -1)
329 $this->tpl->setCurrentBlock(
"addTranslation");
330 $this->tpl->setVariable(
"TXT_ADD_TRANSLATION",$this->lng->txt(
"add_translation").
" >>");
331 $this->tpl->parseCurrentBlock();
337 $this->tpl->setCurrentBlock(
"removeTranslation");
338 $this->tpl->setVariable(
"TXT_REMOVE_TRANSLATION",$this->lng->txt(
"remove_translation"));
339 $this->ctrl->setParameter($this,
"entry", $key);
340 $this->ctrl->setParameter($this,
"new_type", $new_type);
341 $this->ctrl->setParameter($this,
"mode",
"create");
342 $this->tpl->setVariable(
"LINK_REMOVE_TRANSLATION", $this->ctrl->getLinkTarget($this,
"removeTranslation"));
344 $this->tpl->parseCurrentBlock();
348 $this->tpl->addBlockFile(
"SEL_LANGUAGE",
"sel_language",
"tpl.lang_selection.html",
false);
349 $this->tpl->setVariable(
"SEL_NAME",
"Fobject[".$key.
"][lang]");
351 include_once(
'Services/MetaData/classes/class.ilMDLanguageItem.php');
354 foreach($languages as $code => $language)
356 $this->tpl->setCurrentBlock(
"lg_option");
357 $this->tpl->setVariable(
"VAL_LG", $code);
358 $this->tpl->setVariable(
"TXT_LG", $language);
360 if ($count == 1 AND $code == $this->ilias->account->getPref(
"language") AND !isset(
$_SESSION[
"translation_post"]))
362 $this->tpl->setVariable(
"SELECTED",
"selected=\"selected\"");
364 elseif ($code == $val[
"lang"])
366 $this->tpl->setVariable(
"SELECTED",
"selected=\"selected\"");
369 $this->tpl->parseCurrentBlock();
374 $this->tpl->setCurrentBlock(
"type_image");
375 $this->tpl->setVariable(
"TYPE_IMG",
377 $this->tpl->parseCurrentBlock();
381 $this->tpl->setCurrentBlock(
"obj_form");
385 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
389 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"translation").
" ".$key);
392 if ($key ==
$data[
"default_language"])
394 $this->tpl->setVariable(
"CHECKED",
"checked=\"checked\"");
397 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
398 $this->tpl->setVariable(
"TXT_DESC", $this->lng->txt(
"desc"));
399 $this->tpl->setVariable(
"TXT_DEFAULT", $this->lng->txt(
"default"));
400 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"language"));
403 $this->tpl->setVariable(
"NUM", $key);
404 $this->tpl->parseCurrentBlock();
408 $this->ctrl->setParameter($this,
"mode",
"create");
409 $this->ctrl->setParameter($this,
"new_type", $new_type);
410 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"save"));
411 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
412 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
413 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
414 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
433 if (!isset(
$data[
"default_language"]))
435 $this->ilias->raiseError($this->lng->txt(
"msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
439 if(!
$_POST[
'Fobject'][
$_POST[
'default_language']][
'title'])
447 foreach (
$data[
"Fobject"] as $key => $val)
449 $langs[$key] = $val[
"lang"];
452 $langs = array_count_values($langs);
455 if (array_key_exists(
"",$langs))
457 $this->ilias->raiseError($this->lng->txt(
"msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
461 if (array_sum($langs) > count($langs))
463 $this->ilias->raiseError($this->lng->txt(
"msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
467 $_POST[
"Fobject"][
"title"] = $_POST[
"Fobject"][$_POST[
"default_language"]][
"title"];
468 $_POST[
"Fobject"][
"desc"] = $_POST[
"Fobject"][$_POST[
"default_language"]][
"desc"];
474 foreach (
$data[
"Fobject"] as $key => $val)
476 if ($key ==
$data[
"default_language"])
488 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
499 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
516 $this->ctrl->setCmd(
"showSummary");
517 $this->ctrl->setCmdClass(
"ilinfoscreengui");
528 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
530 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
533 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
536 $info->enablePrivateNotes();
538 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
544 $info->enableNewsEditing(
false);
545 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
548 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
550 if ($enable_internal_rss)
552 $info->setBlockProperty(
"news",
"settings",
true);
553 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
557 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
560 $record_gui->parse();
564 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
567 if ($ilCtrl->getNextClass() ==
"ilinfoscreengui")
569 $ilCtrl->forwardCommand($info);
573 return $ilCtrl->getHTML($info);
586 $this->tabs_gui->setTabActive(
'edit_properties');
587 $this->tabs_gui->setSubTabActive(
'edit_cat_settings');
590 $this->tpl->setContent($this->form->getHTML());
601 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
603 'crs',$this->object->getId());
605 $record_gui->saveValues();
620 if(is_object($this->form))
625 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
627 $this->form->setFormAction($this->ctrl->getFormAction($this));
628 $this->form->setTitle($this->lng->txt(
'ext_cat_settings'));
629 $this->form->addCommandButton(
'updateInfo',$this->lng->txt(
'save'));
630 $this->form->addCommandButton(
'editInfo',$this->lng->txt(
'cancel'));
632 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
635 $record_gui->parse();
650 if (!$rbacsystem->checkAccess(
"write", $this->ref_id))
652 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
656 $this->ctrl->setParameter($this,
"mode",
"edit");
659 include_once
"./Services/MetaData/classes/class.ilMDLanguageItem.php";
668 $_GET[
"mode"] =
"session";
673 if ((
$_GET[
"mode"] !=
"session"))
675 $data = $this->
object->getTranslations();
679 elseif (
$_GET[
"entry"] != 0)
681 array_splice(
$_SESSION[
"translation_post"][
"Fobject"],
$_GET[
"entry"],1,array());
683 if (
$_GET[
"entry"] ==
$_SESSION[
"translation_post"][
"default_language"])
685 $_SESSION[
"translation_post"][
"default_language"] =
"";
692 if (!
$_GET[
"entry"] and $array_push)
694 $count = array_push(
$data[
"Fobject"],array(
"title" =>
"",
"desc" =>
""));
698 $count = count(
$data[
"Fobject"]);
702 $strip = isset(
$_SESSION[
"translation_post"]) ?
true :
false;
704 foreach ((array)
$data[
"Fobject"] as $key => $val)
707 if ($key == $count -1)
709 $this->tpl->setCurrentBlock(
"addTranslation");
710 $this->tpl->setVariable(
"TXT_ADD_TRANSLATION",$this->lng->txt(
"add_translation").
" >>");
711 $this->tpl->parseCurrentBlock();
717 $this->tpl->setCurrentBlock(
"removeTranslation");
718 $this->tpl->setVariable(
"TXT_REMOVE_TRANSLATION",$this->lng->txt(
"remove_translation"));
719 $this->ctrl->setParameter($this,
"entry", $key);
720 $this->ctrl->setParameter($this,
"mode",
"edit");
721 $this->tpl->setVariable(
"LINK_REMOVE_TRANSLATION", $this->ctrl->getLinkTarget($this,
"removeTranslation"));
722 $this->tpl->parseCurrentBlock();
726 $this->tpl->addBlockFile(
"SEL_LANGUAGE",
"sel_language",
"tpl.lang_selection.html",
false);
727 $this->tpl->setVariable(
"SEL_NAME",
"Fobject[".$key.
"][lang]");
731 foreach ($languages as $code => $language)
733 $this->tpl->setCurrentBlock(
"lg_option");
734 $this->tpl->setVariable(
"VAL_LG", $code);
735 $this->tpl->setVariable(
"TXT_LG", $language);
737 if ($code == $val[
"lang"])
739 $this->tpl->setVariable(
"SELECTED",
"selected=\"selected\"");
742 $this->tpl->parseCurrentBlock();
746 $this->tpl->setCurrentBlock(
"obj_form");
750 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($this->object->getType().
"_edit"));
754 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"translation").
" ".$key);
757 if ($key ==
$data[
"default_language"])
759 $this->tpl->setVariable(
"CHECKED",
"checked=\"checked\"");
762 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
763 $this->tpl->setVariable(
"TXT_DESC", $this->lng->txt(
"desc"));
764 $this->tpl->setVariable(
"TXT_DEFAULT", $this->lng->txt(
"default"));
765 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"language"));
768 $this->tpl->setVariable(
"NUM", $key);
769 $this->tpl->parseCurrentBlock();
775 $this->tpl->setCurrentBlock(
"adm_content");
776 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"update"));
777 $this->tpl->setVariable(
"TARGET", $this->
getTargetFrame(
"update"));
778 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
779 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
780 $this->tpl->setVariable(
"CMD_SUBMIT",
"update");
781 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
793 if (!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
795 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
802 if (!isset(
$data[
"default_language"]))
804 $this->ilias->raiseError($this->lng->txt(
"msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
808 foreach (
$data[
"Fobject"] as $key => $val)
810 $langs[$key] = $val[
"lang"];
813 $langs = array_count_values($langs);
816 if (array_key_exists(
"",$langs))
818 $this->ilias->raiseError($this->lng->txt(
"msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
822 if (array_sum($langs) > count($langs))
824 $this->ilias->raiseError($this->lng->txt(
"msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
829 $_POST[
"Fobject"][
"desc"] = $_POST[
"Fobject"][$_POST[
"default_language"]][
"desc"];
832 if (trim($_POST[
"Fobject"][
"title"]) ==
"")
835 $ilCtrl->redirect($this,
"edit");
839 $this->
object->removeTranslations();
842 foreach (
$data[
"Fobject"] as $key => $val)
844 if ($key ==
$data[
"default_language"])
861 if ($this->ilias->getSetting(
"custom_icons"))
863 $this->
object->saveIcons($_FILES[
"cont_big_icon"][
'tmp_name'],
864 $_FILES[
"cont_small_icon"][
'tmp_name'], $_FILES[
"cont_tiny_icon"][
'tmp_name']);
867 $this->update = $this->
object->update();
870 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
877 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
898 if (!(
$_GET[
"mode"] !=
"create" or
$_GET[
"mode"] !=
"edit"))
900 $message = get_class($this).
"::addTranslationObject(): Missing or wrong parameter! mode: ".
$_GET[
"mode"];
901 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
904 $this->ctrl->setParameter($this,
"entry", 0);
905 $this->ctrl->setParameter($this,
"mode",
"session");
906 $this->ctrl->setParameter($this,
"new_type",
$_GET[
"new_type"]);
919 if (!(
$_GET[
"mode"] !=
"create" or
$_GET[
"mode"] !=
"edit"))
921 $message = get_class($this).
"::removeTranslationObject(): Missing or wrong parameter! mode: ".
$_GET[
"mode"];
922 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
925 $this->ctrl->setParameter($this,
"entry",
$_GET[
"entry"]);
926 $this->ctrl->setParameter($this,
"mode",
"session");
927 $this->ctrl->setParameter($this,
"new_type",
$_GET[
"new_type"]);
941 $this->
object->removeBigIcon();
942 $this->ctrl->redirect($this,
$_GET[
"mode"]);
954 $this->
object->removeSmallIcon();
955 $this->ctrl->redirect($this,
$_GET[
"mode"]);
967 $this->
object->removeTinyIcon();
968 $this->ctrl->redirect($this,
$_GET[
"mode"]);
984 global
$lng, $rbacreview;
986 $a_tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.cat_import_form.html",
989 $a_tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
991 $a_tpl->setVariable(
"TXT_IMPORT_CATEGORIES", $lng->txt(
"import_categories"));
992 $a_tpl->setVariable(
"TXT_HIERARCHY_OPTION", $lng->txt(
"import_cat_localrol"));
993 $a_tpl->setVariable(
"TXT_IMPORT_FILE", $lng->txt(
"import_file"));
994 $a_tpl->setVariable(
"TXT_IMPORT_TABLE", $lng->txt(
"import_cat_table"));
996 $a_tpl->setVariable(
"BTN_IMPORT", $lng->txt(
"import"));
997 $a_tpl->setVariable(
"BTN_CANCEL", $lng->txt(
"cancel"));
1000 $parent_role_ids = $rbacreview->getParentRoleIds($a_ref_id,
true);
1003 ksort($parent_role_ids);
1005 foreach ($parent_role_ids as $key => $par)
1007 if ($par[
"obj_id"] != SYSTEM_ROLE_ID)
1010 $output[
"adopt"][$key][
"css_row_adopt"] =
ilUtil::switchColor($key,
"tblrow1",
"tblrow2");
1011 $output[
"adopt"][$key][
"check_adopt"] = $check;
1012 $output[
"adopt"][$key][
"role_id"] = $par[
"obj_id"];
1013 $output[
"adopt"][$key][
"type"] = ($par[
"type"] ==
'role' ?
'Role' :
'Template');
1014 $output[
"adopt"][$key][
"role_name"] = $par[
"title"];
1021 foreach ($output[
"adopt"] as $key => $value)
1023 $a_tpl->setCurrentBlock(
"ADOPT_PERM_ROW");
1024 $a_tpl->setVariable(
"CSS_ROW_ADOPT",$value[
"css_row_adopt"]);
1025 $a_tpl->setVariable(
"CHECK_ADOPT",$value[
"check_adopt"]);
1026 $a_tpl->setVariable(
"LABEL_ID",$value[
"role_id"]);
1027 $a_tpl->setVariable(
"TYPE",$value[
"type"]);
1028 $a_tpl->setVariable(
"ROLE_NAME",$value[
"role_name"]);
1029 $a_tpl->parseCurrentBlock();
1041 $this->ctrl->redirect($this);
1081 require_once(
"./Modules/Category/classes/class.ilCategoryImportParser.php");
1086 if (!@is_dir($import_dir))
1098 $this->ctrl->redirect($this);
1109 $subdir = basename($parts[
"basename"],
".".$parts[
"extension"]);
1110 $xml_file = $import_dir.
"/".$subdir.
"/".$subdir.
".xml";
1114 $importParser->startParsing();
1117 $this->ctrl->redirect($this);
1126 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
1128 $utab->resetOffset();
1129 $utab->resetFilter();
1143 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
1145 $utab->resetOffset();
1146 $utab->writeFilterToSession();
1153 global $ilUser,$rbacreview, $ilToolbar;
1155 include_once
'./Services/User/classes/class.ilLocalUser.php';
1156 include_once
'./Services/User/classes/class.ilObjUserGUI.php';
1158 global $rbacsystem,$rbacreview;
1160 if(!$rbacsystem->checkAccess(
"cat_administrate_users",$this->object->getRefId()))
1162 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_admin_users"),$this->ilias->error_obj->MESSAGE);
1164 $this->tabs_gui->setTabActive(
'administrate_users');
1168 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.cat_admin_users.html',
1169 "Modules/Category");
1171 if(count($rbacreview->getGlobalAssignableRoles()) or in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
1173 $ilToolbar->addButton(
1174 $this->lng->txt(
'add_user'),
1175 $this->ctrl->getLinkTargetByClass(
'ilobjusergui',
'create')
1178 $ilToolbar->addButton(
1179 $this->lng->txt(
'import_users'),
1180 $this->ctrl->getLinkTargetByClass(
'ilobjuserfoldergui',
'importUserForm')
1190 $this->tpl->setCurrentBlock(
"confirm_delete");
1191 $this->tpl->setVariable(
"CONFIRM_FORMACTION",$this->ctrl->getFormAction($this));
1192 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
1193 $this->tpl->setVariable(
"CONFIRM_CMD",
'performDeleteUsers');
1194 $this->tpl->setVariable(
"TXT_CONFIRM",$this->lng->txt(
'delete'));
1195 $this->tpl->parseCurrentBlock();
1198 $this->lng->loadLanguageModule(
'user');
1200 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
1202 $this->tpl->setVariable(
'USERS_TABLE',$utab->getHTML());
1209 include_once
'./Services/User/classes/class.ilLocalUser.php';
1212 foreach(
$_POST[
'user_ids'] as $user_id)
1216 die(
'user id not valid');
1241 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
1243 $confirm->setFormAction($this->ctrl->getFormAction($this));
1244 $confirm->setHeaderText($this->lng->txt(
'sure_delete_selected_users'));
1245 $confirm->setConfirm($this->lng->txt(
'delete'),
'performDeleteUsers');
1246 $confirm->setCancel($this->lng->txt(
'cancel'),
'listUsers');
1248 foreach(
$_POST[
'id'] as $user)
1258 $this->tpl->setContent($confirm->getHTML());
1263 global $rbacreview,$ilTabs;
1267 include_once
'./Services/User/classes/class.ilLocalUser.php';
1269 if(!isset(
$_GET[
'obj_id']))
1277 $ilTabs->clearTargets();
1278 $ilTabs->setBackTarget($this->lng->txt(
'backto_lua'), $this->ctrl->getLinkTarget($this,
'listUsers'));
1284 #ilUtil::sendInfo($this->lng->txt('no_roles_user_can_be_assigned_to'));
1285 #$this->listUsersObject();
1290 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.cat_role_assignment.html',
1291 "Modules/Category");
1293 $ass_roles = $rbacreview->assignedRoles(
$_GET[
'obj_id']);
1296 foreach($roles as $role)
1305 $f_result[$counter][] = $role_obj->getTitle();
1306 $f_result[$counter][] = $role_obj->getDescription();
1307 $f_result[$counter][] = $role[
'role_type'] ==
'global' ?
1308 $this->lng->txt(
'global') :
1309 $this->lng->txt(
'local');
1319 global $rbacreview,$rbacadmin;
1322 include_once
'./Services/User/classes/class.ilLocalUser.php';
1342 $new_role_ids =
$_POST[
'role_ids'] ?
$_POST[
'role_ids'] : array();
1343 $assigned_roles = $rbacreview->assignedRoles((
int)
$_REQUEST[
'obj_id']);
1344 foreach($roles as $role)
1346 if(in_array($role[
'obj_id'],$new_role_ids) and !in_array($role[
'obj_id'],$assigned_roles))
1348 $rbacadmin->assignUser($role[
'obj_id'],(
int) $_REQUEST[
'obj_id']);
1350 if(in_array($role[
'obj_id'],$assigned_roles) and !in_array($role[
'obj_id'],$new_role_ids))
1352 $rbacadmin->deassignUser($role[
'obj_id'],(
int) $_REQUEST[
'obj_id']);
1364 global $rbacreview,$ilUser;
1369 if(in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
1371 $global_roles = $rbacreview->getGlobalRolesArray();
1373 elseif($tmp_obj->getTimeLimitOwner() == $this->
object->getRefId())
1375 $global_roles = $rbacreview->getGlobalAssignableRoles();
1379 $global_roles = array();
1381 return $roles = array_merge($global_roles,
1382 $rbacreview->getAssignableChildRoles($this->object->getRefId()));
1387 global $rbacreview,$ilUser;
1393 if($tmp_obj->getTimeLimitOwner() != $this->
object->getRefId() and
1394 !in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
1400 $new_assigned = $new_assigned ? $new_assigned : array();
1401 $assigned = $rbacreview->assignedRoles((
int)
$_GET[
'obj_id']);
1404 if(!in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
1406 $ga = $rbacreview->getGlobalAssignableRoles();
1410 $ga = $rbacreview->getGlobalRolesArray();
1412 $global_assignable = array();
1413 foreach($ga as $role)
1415 $global_assignable[] = $role[
'obj_id'];
1418 $new_visible_assigned_roles = array_intersect($new_assigned,$global_assignable);
1419 $all_assigned_roles = array_intersect($assigned,$rbacreview->getGlobalRoles());
1420 $main_assigned_roles = array_diff($all_assigned_roles,$global_assignable);
1422 if(!count($new_visible_assigned_roles) and !count($main_assigned_roles))
1435 $tpl =& $tbl->getTemplateObject();
1438 $tpl->setCurrentBlock(
"tbl_form_header");
1440 $this->ctrl->setParameter($this,
'obj_id',
$_GET[
'obj_id']);
1441 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1442 $tpl->parseCurrentBlock();
1445 $tpl->setVariable(
"COLUMN_COUNTS",4);
1448 $tpl->setCurrentBlock(
"tbl_action_button");
1449 $tpl->setVariable(
"BTN_NAME",
"assignSave");
1450 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"change_assignment"));
1451 $tpl->parseCurrentBlock();
1453 $tpl->setCurrentBlock(
"tbl_action_row");
1454 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
1455 $tpl->parseCurrentBlock();
1458 $title = $this->lng->txt(
'role_assignment').
' ('.$tmp_obj->getFullname().
')';
1460 $tbl->setTitle(
$title,
"icon_role.gif",$this->lng->txt(
"role_assignment"));
1461 $tbl->setHeaderNames(array(
'',
1462 $this->lng->txt(
"title"),
1463 $this->lng->txt(
'description'),
1464 $this->lng->txt(
"type")));
1465 $tbl->setHeaderVars(array(
"",
1469 array(
"ref_id" => $this->object->getRefId(),
1470 "cmd" =>
"assignRoles",
1471 "obj_id" =>
$_GET[
'obj_id'],
1472 "cmdClass" =>
"ilobjcategorygui",
1473 "cmdNode" =>
$_GET[
"cmdNode"]));
1474 $tbl->setColumnWidth(array(
"4%",
"35%",
"45%",
"16%"));
1476 $this->set_unlimited =
true;
1480 $this->tpl->setVariable(
"ROLES_TABLE",$tbl->tpl->get());
1490 $tpl =& $tbl->getTemplateObject();
1493 $tpl->setCurrentBlock(
"tbl_form_header");
1495 $this->ctrl->setParameter($this,
'sort_by',
$_GET[
'sort_by']);
1496 $this->ctrl->setParameter($this,
'sort_order',
$_GET[
'sort_order']);
1497 $this->ctrl->setParameter($this,
'offset',
$_GET[
'offset']);
1498 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1499 $tpl->parseCurrentBlock();
1505 $tpl->setVariable(
"COLUMN_COUNTS",6);
1508 $tpl->setCurrentBlock(
"tbl_action_button");
1509 $tpl->setVariable(
"BTN_NAME",
"deleteUser");
1510 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"delete"));
1511 $tpl->parseCurrentBlock();
1513 $tpl->setCurrentBlock(
"tbl_action_row");
1514 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
1515 $tpl->parseCurrentBlock();
1517 $tbl->setFormName(
'cmd');
1518 $tbl->enable(
'select_all');
1521 $tbl->setTitle($this->lng->txt(
"users"),
"icon_usr.gif",$this->lng->txt(
"users"));
1522 $tbl->setHeaderNames(array(
'',
1523 $this->lng->txt(
"username"),
1524 $this->lng->txt(
"firstname"),
1525 $this->lng->txt(
"lastname"),
1526 $this->lng->txt(
'context'),
1527 $this->lng->txt(
'role_assignment')));
1528 $tbl->setHeaderVars(array(
"",
1534 array(
"ref_id" => $this->object->getRefId(),
1535 "cmd" =>
"listUsers",
1536 "cmdClass" =>
"ilobjcategorygui",
1537 "cmdNode" =>
$_GET[
"cmdNode"]));
1538 $tbl->setColumnWidth(array(
"1px",
"20%",
"20%",
"20%",
"20%",
"20%"));
1539 $tbl->setSelectAllCheckbox(
'user_ids');
1544 $this->tpl->setVariable(
"USERS_TABLE",$tbl->tpl->get());
1555 case "listUsersObject":
1556 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
1557 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1558 $tbl->setOffset(
$_GET[
"offset"]);
1559 $tbl->setMaxCount($this->all_users_count);
1560 $tbl->setLimit($ilUser->getPref(
'hits_per_page'));
1561 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1562 $tbl->setData($result_set);
1563 $tbl->disable(
'auto_sort');
1568 case "assignRolesObject":
1569 $offset =
$_GET[
"offset"];
1571 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"]))
1573 $_GET[
"sort_by"] =
"login";
1575 $order =
$_GET[
"sort_by"];
1576 $direction =
$_GET[
"sort_order"];
1579 case "clipboardObject":
1580 $offset =
$_GET[
"offset"];
1581 $order =
$_GET[
"sort_by"];
1582 $direction =
$_GET[
"sort_order"];
1583 $tbl->disable(
"footer");
1587 $offset =
$_GET[
"offset"];
1588 $order =
$_GET[
"sort_by"];
1589 $direction =
$_GET[
"sort_order"];
1593 $tbl->setOrderColumn($order);
1594 $tbl->setOrderDirection($direction);
1595 $tbl->setOffset($offset);
1596 if($this->set_unlimited)
1598 $tbl->setLimit(
$_GET[
"limit"]*100);
1602 $tbl->setLimit(
$_GET[
'limit']);
1604 $tbl->setMaxCount(count($result_set));
1608 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1612 $tbl->disable(
'footer');
1614 $tbl->setData($result_set);
1619 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1626 $action[0] = $this->lng->txt(
'all_users');
1627 $action[$this->
object->getRefId()] = $this->lng->txt(
'users').
1630 foreach($a_parent_ids as $parent)
1632 if($parent == $this->object->getRefId())
1656 if ($ilAccess->checkAccess(
"read",
"", $a_target))
1658 $_GET[
"cmd"] =
"frameset";
1659 $_GET[
"ref_id"] = $a_target;
1660 include(
"repository.php");
1663 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1665 $_GET[
"cmd"] =
"frameset";
1666 $_GET[
"target"] =
"";
1667 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
1670 include(
"repository.php");
1674 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1687 $this->tpl->setVariable(
'TXT_SORTING',$this->lng->txt(
'sorting_header'));
1688 $this->tpl->setVariable(
'TXT_SORT_TITLE',$this->lng->txt(
'sorting_title_header'));
1689 $this->tpl->setVariable(
'INFO_SORT_TITLE',$this->lng->txt(
'sorting_info_title'));
1690 $this->tpl->setVariable(
'TXT_SORT_MANUAL',$this->lng->txt(
'sorting_manual_header'));
1691 $this->tpl->setVariable(
'INFO_SORT_MANUAL',$this->lng->txt(
'sorting_info_manual'));
1693 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
1724 $this->tabs_gui->addSubTabTarget(
"edit_properties",
1725 $this->ctrl->getLinkTarget($this,
'edit'),
1726 "edit", get_class($this));
1728 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1731 $this->tabs_gui->addSubTabTarget(
"edit_cat_settings",
1732 $this->ctrl->getLinkTarget($this,
'editInfo'),
1733 "editInfo", get_class($this));