125 $this->obj_data = array();
131 $set = $ilDB->query(
"SELECT * FROM il_object_def");
134 $this->obj_data[$rec[
"id"]] = array(
135 "name" => $rec[
"id"],
136 "class_name" => $rec[
"class_name"],
137 "location" => $rec[
"location"],
138 "checkbox" => $rec[
"checkbox"],
139 "inherit" => $rec[
"inherit"],
140 "component" => $rec[
"component"],
141 "translate" => $rec[
"translate"],
142 "devmode" => $rec[
"devmode"],
143 "allow_link" => $rec[
"allow_link"],
144 "allow_copy" => $rec[
"allow_copy"],
145 "rbac" => $rec[
"rbac"],
146 "group" => $rec[
"grp"],
147 "system" => $rec[
"system"],
148 "default_pos" => $rec[
"default_pos"],
149 "sideblock" => $rec[
"sideblock"]);
150 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
152 $defIds[] = $rec[
"id"];
155 $set2 = $ilDB->query(
"SELECT * FROM il_object_subobj WHERE ".
156 "parent IN ('".implode(
"','",$defIds).
"')");
164 $this->obj_data[$rec2[
"parent"]][
"subobjects"][$rec2[
"subobj"]] = array(
165 "name" => $rec2[
"subobj"],
167 "lng" => $rec2[
"subobj"]
171 $set = $ilDB->query(
"SELECT * FROM il_object_group");
172 $this->obj_group = array();
175 $this->obj_group[$rec[
"id"]] = $rec;
207 return $this->obj_data[$a_obj_name][
"class_name"];
219 return $this->obj_data[$a_obj_name][
"location"];
241 return $this->obj_group[$a_id];
249 return $this->obj_data[$a_obj_name][
"group"];
260 return (
bool) $this->obj_data[$a_obj_name][
"checkbox"];
273 if ($a_obj_name ==
"root")
275 if (!isset($this->root_trans_type))
277 $q =
"SELECT count(*) as cnt FROM object_translation WHERE obj_id = ".
278 $ilDB->quote(ROOT_FOLDER_ID);
279 $set = $ilDB->query($q);
283 $this->root_trans_type =
"db";
287 $this->root_trans_type = $this->obj_data[$a_obj_name][
"translate"];
290 return $this->root_trans_type;
293 return $this->obj_data[$a_obj_name][
"translate"];
305 return (
bool) $this->obj_data[$a_obj_name][
"inherit"];
360 return (
bool) $this->obj_data[$a_obj_name][
"devmode"];
371 $types = array_keys($this->obj_data);
373 foreach ($types as $type)
381 return $devtypes ? $devtypes : array();
393 return (
bool) $this->obj_data[$a_obj_name][
"rbac"];
404 $types = array_keys($this->obj_data);
406 foreach ($types as $type)
410 $rbactypes[] = $type;
414 return $rbactypes ? $rbactypes : array();
425 return array_keys($this->obj_data);
436 return (
bool) $this->obj_data[$a_obj_name][
"allow_link"];
447 return (
bool) $this->obj_data[$a_obj_name][
"allow_copy"];
459 if(isset($this->obj_data[$a_obj_name][
'sorting']))
461 return $this->obj_data[$a_obj_name][
'sorting'][
'modes'] ? $this->obj_data[$a_obj_name][
'sorting'][
'modes'] : array();
481 if ($subobjects = $this->obj_data[$a_obj_type][
"subobjects"])
489 foreach ($subobjects as
$data => $sub)
491 if ($sub[
"module"] !=
"n")
493 if (!($ilSetting->get(
"obj_dis_creation_".$data)))
498 $pos = ($ilSetting->get(
"obj_add_new_pos_".
$data) > 0)
499 ? (
int) $ilSetting->get(
"obj_add_new_pos_".
$data)
500 : (int) $this->obj_data[
$data][
"default_pos"];
501 $subs[
$data][
"pos"] = $pos;
531 $recursivesubs = array();
535 $to_do = array($a_obj_type);
543 while (count($to_do) > 0)
545 $type = array_pop($to_do);
548 foreach ($subs as $subtype =>
$data)
550 $recursivesubs[$subtype] =
$data;
551 if (! in_array($subtype, $done)
552 && ! in_array($subtype, $to_do))
559 return $recursivesubs;
573 foreach($this->obj_data[$a_obj_type][
"subobjects"] as $key => $value)
587 #$tmp_subs[] = "root";
589 return $tmp_subs ? $tmp_subs : array();
604 unset($subobjects[
"rolf"]);
605 unset($subobjects[
'rcrs']);
607 $sub_types = array_keys($subobjects);
610 foreach ($sub_types as $type)
615 unset($subobjects[$type]);
703 if (is_array($this->obj_data[$a_obj_type][
"subobjects"]))
705 $data = array_keys($this->obj_data[$a_obj_type][
"subobjects"]);
707 $string =
"'".implode(
"','",
$data).
"'";
749 if(!is_array($this->obj_data[$a_obj_name][
'subobjects']))
753 return count($this->obj_data[$a_obj_name][
'subobjects']) > 1 ?
true :
false;
766 xml_set_object($a_xml_parser,$this);
767 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
768 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
784 $this->parent_tag_name = $a_attribs[
"name"];
787 $this->current_tag =
"property";
788 $this->current_tag_name = $a_attribs[
"name"];
790 $this->obj_data[$this->parent_tag_name][
"properties"][$this->current_tag_name][
"module"] = $a_attribs[
"module"];
816 $this->current_tag =
'';
817 $this->current_tag_name =
'';
823 foreach($subobjects as $type =>
$data)
828 if(!$this->ilias->getSetting(
"chat_active"))
830 unset($subobjects[$type]);
835 if(!$this->ilias->getSetting(
"ilinc_active"))
837 unset($subobjects[$type]);
862 return (
bool) $this->obj_data[$a_obj_name][
"system"];
873 return (
bool) $this->obj_data[$a_obj_name][
"sideblock"];
884 $set = $ilDB->query(
"SELECT * FROM il_object_def WHERE component = ".
885 $ilDB->quote($a_component_type.
"/".$a_component_name));
890 if ($rec[
"system"] != 1)
906 $set = $ilDB->query(
"SELECT * FROM il_object_group");
910 $groups[$gr_rec[
"id"]] = $gr_rec;
913 if (!is_array($a_parent_obj_type))
915 $set = $ilDB->query(
"SELECT il_object_def.* FROM il_object_def, il_object_subobj ".
916 " WHERE NOT (system = 1) AND NOT (sideblock = 1) AND ".
917 " parent = ".$ilDB->quote($a_parent_obj_type).
918 " AND subobj = id ");
922 $set = $ilDB->query(
"SELECT DISTINCT (id) as sid, il_object_def.* FROM il_object_def, il_object_subobj ".
923 " WHERE NOT (system = 1) AND NOT (sideblock = 1) AND ".
925 " AND subobj = id ");
928 $grouped_obj = array();
931 if ($rec[
"grp"] !=
"")
933 $grouped_obj[$rec[
"grp"]][
"pos"] = (int) $groups[$rec[
"grp"]][
"default_pres_pos"];
934 $grouped_obj[$rec[
"grp"]][
"objs"][] = $rec[
"id"];
938 $grouped_obj[$rec[
"id"]][
"pos"] = (int) $rec[
"default_pres_pos"];
939 $grouped_obj[$rec[
"id"]][
"objs"][] = $rec[
"id"];