77 global
$ilDB, $ilPluginAdmin;
79 $this->obj_data = array();
85 $set = $ilDB->query(
"SELECT * FROM il_object_def");
86 while ($rec = $ilDB->fetchAssoc($set))
88 $this->obj_data[$rec[
"id"]] = array(
90 "class_name" => $rec[
"class_name"],
91 "location" => $rec[
"location"],
92 "checkbox" => $rec[
"checkbox"],
93 "inherit" => $rec[
"inherit"],
94 "component" => $rec[
"component"],
95 "translate" => $rec[
"translate"],
96 "devmode" => $rec[
"devmode"],
97 "allow_link" => $rec[
"allow_link"],
98 "allow_copy" => $rec[
"allow_copy"],
99 "rbac" => $rec[
"rbac"],
100 "group" => $rec[
"grp"],
101 "system" => $rec[
"system"],
102 "default_pos" => $rec[
"default_pos"],
103 "sideblock" => $rec[
"sideblock"],
104 'export' => $rec[
'export']);
105 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
107 $defIds[] = $rec[
"id"];
110 $set2 = $ilDB->query(
"SELECT * FROM il_object_subobj WHERE ".
111 $ilDB->in(
'parent', $defIds,
false,
'text'));
112 while ($rec2 = $ilDB->fetchAssoc($set2))
114 $max = $rec2[
"mmax"];
119 $this->obj_data[$rec2[
"parent"]][
"subobjects"][$rec2[
"subobj"]] = array(
120 "name" => $rec2[
"subobj"],
122 "lng" => $rec2[
"subobj"]
126 $set = $ilDB->query(
"SELECT * FROM il_object_group");
127 $this->obj_group = array();
128 while ($rec = $ilDB->fetchAssoc($set))
130 $this->obj_group[$rec[
"id"]] = $rec;
134 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
135 foreach ($pl_names as $pl_name)
137 include_once(
"./Services/Component/classes/class.ilPlugin.php");
139 if ($pl_id !=
"" && !isset($this->obj_data[$pl_id]))
141 include_once(
"./Services/Repository/classes/class.ilRepositoryObjectPlugin.php");
143 $pl_name).
"/classes";
145 $this->obj_data[$pl_id] = array(
147 "class_name" => $pl_name,
160 "default_pos" =>
"2000",
162 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
164 $this->obj_data[
"crs"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
165 $this->obj_data[
"fold"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
166 $this->obj_data[
"grp"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
167 $this->obj_data[
"cat"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
168 $this->obj_data[
"root"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
187 return $this->obj_data[$a_obj_name][
"class_name"];
199 return $this->obj_data[$a_obj_name][
"location"];
207 return $this->obj_group[$a_id];
215 return $this->obj_data[$a_obj_name][
"group"];
226 return (
bool) $this->obj_data[$a_obj_name][
"checkbox"];
239 if ($a_obj_name ==
"root")
241 if (!isset($this->root_trans_type))
243 $q =
"SELECT count(obj_id) cnt FROM object_translation WHERE obj_id = ".
244 $ilDB->quote(ROOT_FOLDER_ID,
'integer').
" ";
245 $set = $ilDB->query($q);
249 $this->root_trans_type =
"db";
253 $this->root_trans_type = $this->obj_data[$a_obj_name][
"translate"];
256 return $this->root_trans_type;
259 if (isset($this->obj_data[$a_obj_name]))
261 return $this->obj_data[$a_obj_name][
"translate"];
276 return (
bool) $this->obj_data[$a_obj_name][
"inherit"];
287 return (
bool) $this->obj_data[$a_obj_name][
"devmode"];
298 $types = array_keys($this->obj_data);
300 foreach ($types as $type)
308 return $devtypes ? $devtypes : array();
320 return (
bool) $this->obj_data[$a_obj_name][
"rbac"];
332 return (
bool) isset($this->obj_data[$a_obj_name][
"plugin"]);
343 return (substr($a_str, 0, 1) ==
"x");
354 $types = array_keys($this->obj_data);
356 foreach ($types as $type)
360 $rbactypes[] = $type;
364 return $rbactypes ? $rbactypes : array();
375 return array_keys($this->obj_data);
386 return (
bool) $this->obj_data[$a_obj_name][
"allow_link"];
397 return (
bool) $this->obj_data[$a_obj_name][
"allow_copy"];
402 return (
bool) $this->obj_data[$a_obj_name][
'export'];
412 return isset($this->obj_data[$a_obj_type][
'subobjects'][
'rolf']);
429 if ($subobjects = $this->obj_data[$a_obj_type][
"subobjects"])
436 foreach ($subobjects as
$data => $sub)
438 if ($sub[
"module"] !=
"n")
440 if (!($ilSetting->get(
"obj_dis_creation_".$data)))
445 $pos = ($ilSetting->get(
"obj_add_new_pos_".
$data) > 0)
446 ? (
int) $ilSetting->get(
"obj_add_new_pos_".
$data)
447 : (int) $this->obj_data[
$data][
"default_pos"];
448 $subs[
$data][
"pos"] = $pos;
480 $recursivesubs = array();
484 $to_do = array($a_obj_type);
492 while (count($to_do) > 0)
494 $type = array_pop($to_do);
504 if(!$a_add_admin_objects and $type ==
'adm')
512 #vd('xxxxxxxxxxxxx'.$type);
513 foreach ($subs as $subtype =>
$data)
515 #vd('------------------------->'.$subtype);
522 if($subtype ==
'rolf' or $subtype ==
'rolt')
526 if(!$a_add_admin_objects and $subtype ==
'adm')
531 $recursivesubs[$subtype] =
$data;
532 if (! in_array($subtype, $done)
533 && ! in_array($subtype, $to_do))
540 if($a_include_source_obj)
542 if(!isset($recursivesubs[$a_obj_type]))
544 $recursivesubs[$a_obj_type][
'name'] = $a_obj_type;
545 $recursivesubs[$a_obj_type][
'lng'] = $a_obj_type;
546 $recursivesubs[$a_obj_type][
'max'] = 0;
547 $recursivesubs[$a_obj_type][
'pos'] = -1;
566 foreach($this->obj_data[$a_obj_type][
"subobjects"] as $key => $value)
580 #$tmp_subs[] = "root";
582 return $tmp_subs ? $tmp_subs : array();
597 unset($subobjects[
"rolf"]);
598 unset($subobjects[
'rcrs']);
600 $sub_types = array_keys($subobjects);
603 foreach ($sub_types as $type)
608 unset($subobjects[$type]);
625 if (is_array($this->obj_data[$a_obj_type][
"subobjects"]))
627 $data = array_keys($this->obj_data[$a_obj_type][
"subobjects"]);
629 $string =
"'".implode(
"','",
$data).
"'";
645 if(!is_array($this->obj_data[$a_obj_name][
'subobjects']))
649 return count($this->obj_data[$a_obj_name][
'subobjects']) > 1 ?
true :
false;
662 xml_set_object($a_xml_parser,$this);
663 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
664 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
680 $this->parent_tag_name = $a_attribs[
"name"];
683 $this->current_tag =
"property";
684 $this->current_tag_name = $a_attribs[
"name"];
686 $this->obj_data[$this->parent_tag_name][
"properties"][$this->current_tag_name][
"module"] = $a_attribs[
"module"];
712 $this->current_tag =
'';
713 $this->current_tag_name =
'';
719 foreach($subobjects as $type =>
$data)
724 if(!$this->ilias->getSetting(
"chat_active"))
726 unset($subobjects[$type]);
731 if(!$this->ilias->getSetting(
"ilinc_active"))
733 unset($subobjects[$type]);
758 return (
bool) $this->obj_data[$a_obj_name][
"system"];
769 return (
bool) $this->obj_data[$a_obj_name][
"sideblock"];
780 $set = $ilDB->queryF(
"SELECT * FROM il_object_def WHERE component = %s",
781 array(
"text"), array($a_component_type.
"/".$a_component_name));
784 while($rec = $ilDB->fetchAssoc($set))
786 if ($rec[
"system"] != 1)
802 $set = $ilDB->queryF(
"SELECT component FROM il_object_def WHERE id = %s",
803 array(
"text"), array($a_obj_type));
805 if ($rec = $ilDB->fetchAssoc($set))
807 return $rec[
"component"];
818 global
$ilDB, $ilPluginAdmin;
820 $set = $ilDB->query(
"SELECT * FROM il_object_group");
824 $groups[$gr_rec[
"id"]] = $gr_rec;
827 if (!is_array($a_parent_obj_type))
829 $set = $ilDB->queryF(
"SELECT il_object_def.* FROM il_object_def, il_object_subobj ".
830 " WHERE NOT (system = 1) AND NOT (sideblock = 1) AND ".
832 " AND subobj = id ", array(
"text"), array($a_parent_obj_type));
836 $q =
"SELECT DISTINCT (id) as sid, il_object_def.* FROM il_object_def, il_object_subobj ".
837 " WHERE NOT (system = 1) AND NOT (sideblock = 1) AND ".
838 $ilDB->in(
"parent", $a_parent_obj_type,
false,
"text").
840 $set = $ilDB->query($q);
843 $grouped_obj = array();
844 while($rec = $ilDB->fetchAssoc($set))
846 if ($rec[
"grp"] !=
"")
848 $grouped_obj[$rec[
"grp"]][
"pos"] = (int) $groups[$rec[
"grp"]][
"default_pres_pos"];
849 $grouped_obj[$rec[
"grp"]][
"objs"][] = $rec[
"id"];
853 $grouped_obj[$rec[
"id"]][
"pos"] = (int) $rec[
"default_pres_pos"];
854 $grouped_obj[$rec[
"id"]][
"objs"][] = $rec[
"id"];
859 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
860 foreach ($pl_names as $pl_name)
862 include_once(
"./Services/Component/classes/class.ilPlugin.php");
864 if (!isset($grouped_obj[$pl_id]))
866 $grouped_obj[$pl_id] = array(
868 "objs" => array(0 => $pl_id)