55 $this->ilias = $ilias;
79 global $ilPluginAdmin;
81 $this->obj_data = array();
84 foreach ($global_cache->getIlobjectDef() as $rec) {
85 $this->obj_data[$rec[
"id"]] = array(
87 "class_name" => $rec[
"class_name"],
88 "location" => $rec[
"location"],
89 "checkbox" => $rec[
"checkbox"],
90 "inherit" => $rec[
"inherit"],
91 "component" => $rec[
"component"],
92 "translate" => $rec[
"translate"],
93 "devmode" => $rec[
"devmode"],
94 "allow_link" => $rec[
"allow_link"],
95 "allow_copy" => $rec[
"allow_copy"],
96 "rbac" => $rec[
"rbac"],
97 "group" => $rec[
"grp"],
98 "system" => $rec[
"system"],
99 "default_pos" =>
"9999" . str_pad($rec[
"default_pos"], 4,
"0", STR_PAD_LEFT),
100 "sideblock" => $rec[
"sideblock"],
101 'export' => $rec[
'export'],
102 'repository' => $rec[
'repository'],
103 'workspace' => $rec[
'workspace'],
104 'administration' => $rec[
'administration'],
105 'amet' => $rec[
'amet']
107 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
109 $defIds[] = $rec[
"id"];
112 $subobj = $global_cache->lookupSubObjForParent($defIds);
114 foreach ($subobj as $rec2) {
116 $max = $rec2[
"mmax"];
120 $this->obj_data[$rec2[
"parent"]][
"subobjects"][$rec2[
"subobj"]] = array(
121 "name" => $rec2[
"subobj"],
123 "lng" => $rec2[
"subobj"]
126 $this->obj_group = $global_cache->getIlObjectGroup();
128 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
129 foreach ($pl_names as $pl_name) {
130 include_once(
"./Services/Component/classes/class.ilPlugin.php");
132 if ($pl_id !=
"" && ! isset($this->obj_data[$pl_id])) {
133 include_once(
"./Services/Repository/classes/class.ilRepositoryObjectPlugin.php");
136 $this->obj_data[$pl_id] = array(
138 "class_name" => $pl_name,
151 "default_pos" =>
"99992000",
154 'administration' =>
'0',
157 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
160 $this->obj_data[
"crs"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true );
161 $this->obj_data[
"fold"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true );
162 $this->obj_data[
"grp"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true );
163 $this->obj_data[
"cat"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true );
164 $this->obj_data[
"root"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true );
168 $this->sub_types = $global_cache->getIlObjectSubType();
173 global
$ilDB, $ilPluginAdmin;
175 $this->obj_data = array();
180 $set = $ilDB->query(
"SELECT * FROM il_object_def");
181 while ($rec = $ilDB->fetchAssoc($set)) {
182 $this->obj_data[$rec[
"id"]] = array(
183 "name" => $rec[
"id"],
184 "class_name" => $rec[
"class_name"],
185 "location" => $rec[
"location"],
186 "checkbox" => $rec[
"checkbox"],
187 "inherit" => $rec[
"inherit"],
188 "component" => $rec[
"component"],
189 "translate" => $rec[
"translate"],
190 "devmode" => $rec[
"devmode"],
191 "allow_link" => $rec[
"allow_link"],
192 "allow_copy" => $rec[
"allow_copy"],
193 "rbac" => $rec[
"rbac"],
194 "group" => $rec[
"grp"],
195 "system" => $rec[
"system"],
196 "default_pos" =>
"9999" . str_pad($rec[
"default_pos"], 4,
"0", STR_PAD_LEFT),
197 "sideblock" => $rec[
"sideblock"],
198 'export' => $rec[
'export'],
199 'repository' => $rec[
'repository'],
200 'workspace' => $rec[
'workspace'],
201 'administration' => $rec[
'administration'],
202 'amet' => $rec[
'amet']
204 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
206 $defIds[] = $rec[
"id"];
210 $set2 = $ilDB->query(
"SELECT * FROM il_object_subobj WHERE " . $ilDB->in(
'parent', $defIds,
false,
'text'));
211 while ($rec2 = $ilDB->fetchAssoc($set2)) {
212 $max = $rec2[
"mmax"];
217 $this->obj_data[$rec2[
"parent"]][
"subobjects"][$rec2[
"subobj"]] = array(
218 "name" => $rec2[
"subobj"],
220 "lng" => $rec2[
"subobj"]
224 $set = $ilDB->query(
"SELECT * FROM il_object_group");
225 $this->obj_group = array();
226 while ($rec = $ilDB->fetchAssoc($set)) {
227 $this->obj_group[$rec[
"id"]] = $rec;
231 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
232 foreach ($pl_names as $pl_name) {
233 include_once(
"./Services/Component/classes/class.ilPlugin.php");
235 if ($pl_id !=
"" && ! isset($this->obj_data[$pl_id])) {
236 include_once(
"./Services/Repository/classes/class.ilRepositoryObjectPlugin.php");
239 $this->obj_data[$pl_id] = array(
241 "class_name" => $pl_name,
254 "default_pos" =>
"99992000",
257 'administration' =>
'0',
260 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
263 $this->obj_data[
"crs"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true );
264 $this->obj_data[
"fold"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true );
265 $this->obj_data[
"grp"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true );
266 $this->obj_data[
"cat"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true );
267 $this->obj_data[
"root"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true );
273 $set = $ilDB->query(
"SELECT * FROM il_object_sub_type ");
274 $this->sub_types = array();
275 while ($rec = $ilDB->fetchAssoc($set)) {
276 $this->sub_types[$rec[
"obj_type"]][] = $rec;
304 return $this->obj_data[$a_obj_name][
"class_name"];
316 return $this->obj_data[$a_obj_name][
"location"];
324 return $this->obj_group[$a_id];
332 return $this->obj_data[$a_obj_name][
"group"];
343 return (
bool) $this->obj_data[$a_obj_name][
"checkbox"];
356 if ($a_obj_name ==
"root")
358 if (!isset($this->root_trans_type))
360 $q =
"SELECT count(obj_id) cnt FROM object_translation WHERE obj_id = ".
361 $ilDB->quote(ROOT_FOLDER_ID,
'integer').
" ";
362 $set = $ilDB->query($q);
366 $this->root_trans_type =
"db";
370 $this->root_trans_type = $this->obj_data[$a_obj_name][
"translate"];
373 return $this->root_trans_type;
376 if (isset($this->obj_data[$a_obj_name]))
378 return $this->obj_data[$a_obj_name][
"translate"];
393 return (
bool) $this->obj_data[$a_obj_name][
"inherit"];
404 return (
bool) $this->obj_data[$a_obj_name][
"devmode"];
415 $types = array_keys($this->obj_data);
417 foreach ($types as $type)
425 return $devtypes ? $devtypes : array();
437 return (
bool) $this->obj_data[$a_obj_name][
"rbac"];
449 return (
bool) isset($this->obj_data[$a_obj_name][
"plugin"]);
460 return (substr($a_str, 0, 1) ==
"x");
471 $types = array_keys($this->obj_data);
473 foreach ($types as $type)
477 $rbactypes[] = $type;
481 return $rbactypes ? $rbactypes : array();
492 return array_keys($this->obj_data);
503 return (
bool) $this->obj_data[$a_obj_name][
"allow_link"];
514 return (
bool) $this->obj_data[$a_obj_name][
"allow_copy"];
519 return (
bool) $this->obj_data[$a_obj_name][
'export'];
553 if ($subobjects = $this->obj_data[$a_obj_type][
"subobjects"])
560 foreach ($subobjects as $data => $sub)
562 if ($sub[
"module"] !=
"n")
564 if (!($ilSetting->get(
"obj_dis_creation_".$data)))
569 $pos = ($ilSetting->get(
"obj_add_new_pos_".$data) > 0)
570 ? (
int) $ilSetting->get(
"obj_add_new_pos_".$data)
571 : (int) $this->obj_data[$data][
"default_pos"];
572 $subs[$data][
"pos"] = $pos;
604 $recursivesubs = array();
608 $to_do = array($a_obj_type);
616 while (count($to_do) > 0)
618 $type = array_pop($to_do);
628 if(!$a_add_admin_objects and $type ==
'adm')
636 #vd('xxxxxxxxxxxxx'.$type);
637 foreach ($subs as $subtype => $data)
639 #vd('------------------------->'.$subtype);
646 if($subtype ==
'rolt')
650 if(!$a_add_admin_objects and $subtype ==
'adm')
655 $recursivesubs[$subtype] = $data;
656 if (! in_array($subtype, $done)
657 && ! in_array($subtype, $to_do))
664 if($a_include_source_obj)
666 if(!isset($recursivesubs[$a_obj_type]))
668 $recursivesubs[$a_obj_type][
'name'] = $a_obj_type;
669 $recursivesubs[$a_obj_type][
'lng'] = $a_obj_type;
670 $recursivesubs[$a_obj_type][
'max'] = 0;
671 $recursivesubs[$a_obj_type][
'pos'] = -1;
689 foreach($this->obj_data[$a_obj_type][
"subobjects"] as $key => $value)
703 #$tmp_subs[] = "root";
705 return $tmp_subs ? $tmp_subs : array();
721 unset($subobjects[
"rolf"]);
730 unset($subobjects[$type]);
734 unset($subobjects[$type]);
738 unset($subobjects[$type]);
742 unset($subobjects[$type]);
745 if(in_array($type, array(
'icrs',
'icla')))
747 unset($subobjects[$type]);
764 if (is_array($this->obj_data[$a_obj_type][
"subobjects"]))
766 $data = array_keys($this->obj_data[$a_obj_type][
"subobjects"]);
768 $string =
"'".implode(
"','", $data).
"'";
784 if(!is_array($this->obj_data[$a_obj_name][
'subobjects']))
788 return count($this->obj_data[$a_obj_name][
'subobjects']) >= 1 ?
true :
false;
801 xml_set_object($a_xml_parser,$this);
802 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
803 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
819 $this->parent_tag_name = $a_attribs[
"name"];
822 $this->current_tag =
"property";
823 $this->current_tag_name = $a_attribs[
"name"];
825 $this->obj_data[$this->parent_tag_name][
"properties"][$this->current_tag_name][
"module"] = $a_attribs[
"module"];
851 $this->current_tag =
'';
852 $this->current_tag_name =
'';
858 foreach($subobjects as $type => $data)
863 if(!$this->ilias->getSetting(
"chat_active"))
865 unset($subobjects[$type]);
870 if(!$this->ilias->getSetting(
"ilinc_active"))
872 unset($subobjects[$type]);
897 return (
bool) $this->obj_data[$a_obj_name][
"system"];
908 return (
bool) $this->obj_data[$a_obj_name][
"sideblock"];
919 $set = $ilDB->queryF(
"SELECT * FROM il_object_def WHERE component = %s",
920 array(
"text"), array($a_component_type.
"/".$a_component_name));
923 while($rec = $ilDB->fetchAssoc($set))
925 if ($rec[
"system"] != 1)
941 $set = $ilDB->queryF(
"SELECT component FROM il_object_def WHERE id = %s",
942 array(
"text"), array($a_obj_type));
944 if ($rec = $ilDB->fetchAssoc($set))
946 return $rec[
"component"];
957 global
$ilDB, $ilPluginAdmin;
959 $set = $ilDB->query(
"SELECT * FROM il_object_group");
963 $groups[$gr_rec[
"id"]] = $gr_rec;
985 $recs = $global_cache->lookupGroupedRepObj($a_parent_obj_type);
987 $grouped_obj = array();
989 foreach((array)$recs as $rec)
991 if ($rec[
"grp"] !=
"")
993 $grouped_obj[$rec[
"grp"]][
"pos"] = (int) $groups[$rec[
"grp"]][
"default_pres_pos"];
994 $grouped_obj[$rec[
"grp"]][
"objs"][] = $rec[
"id"];
998 $grouped_obj[$rec[
"id"]][
"pos"] = (int) $rec[
"default_pres_pos"];
999 $grouped_obj[$rec[
"id"]][
"objs"][] = $rec[
"id"];
1004 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
1005 foreach ($pl_names as $pl_name)
1007 include_once(
"./Services/Component/classes/class.ilPlugin.php");
1009 if (!isset($grouped_obj[$pl_id]))
1011 $grouped_obj[$pl_id] = array(
1012 "pos" =>
"99992000",
1013 "objs" => array(0 => $pl_id)
1034 return (
bool) $this->obj_data[$a_obj_name][
"repository"];
1045 $types = array_keys($this->obj_data);
1047 foreach ($types as $type)
1052 $rbactypes[] = $type;
1056 return $rbactypes ? $rbactypes : array();
1069 return (
bool) $this->obj_data[$a_obj_name][
"workspace"];
1079 return (
bool) $this->obj_data[$a_obj_name][
'administration'];
1090 if (substr($a_type, 0, 1) ==
"x" && !$this->
isPlugin($a_type))
1106 foreach ($this->obj_data as $k => $v)
1110 $amet[] = array(
"obj_type" => $k,
"sub_type" =>
"");
1114 foreach ($this->sub_types as $type =>
$sub_types)
1120 $amet[] = array(
"obj_type" => $type,
"sub_type" => $t[
"sub_type"]);
1138 return ($ilSetting->get(
"obj_add_new_pos_".$a_type) > 0)
1139 ? (
int) $ilSetting->get(
"obj_add_new_pos_".$a_type)
1140 : (int) $this->obj_data[$a_type][
"default_pos"];
1150 foreach((array) $this->obj_data as $type => $pl_data)
1154 $plugins[$type] = $pl_data;