97 global
$ilDB, $ilPluginAdmin;
99 $this->obj_data = array();
105 $set = $ilDB->query(
"SELECT * FROM il_object_def");
106 while ($rec = $ilDB->fetchAssoc($set))
108 $this->obj_data[$rec[
"id"]] = array(
109 "name" => $rec[
"id"],
110 "class_name" => $rec[
"class_name"],
111 "location" => $rec[
"location"],
112 "checkbox" => $rec[
"checkbox"],
113 "inherit" => $rec[
"inherit"],
114 "component" => $rec[
"component"],
115 "translate" => $rec[
"translate"],
116 "devmode" => $rec[
"devmode"],
117 "allow_link" => $rec[
"allow_link"],
118 "allow_copy" => $rec[
"allow_copy"],
119 "rbac" => $rec[
"rbac"],
120 "group" => $rec[
"grp"],
121 "system" => $rec[
"system"],
122 "default_pos" => $rec[
"default_pos"],
123 "sideblock" => $rec[
"sideblock"]);
124 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
126 $defIds[] = $rec[
"id"];
129 $set2 = $ilDB->query(
"SELECT * FROM il_object_subobj WHERE ".
130 $ilDB->in(
'parent', $defIds,
false,
'text'));
131 while ($rec2 = $ilDB->fetchAssoc($set2))
133 $max = $rec2[
"mmax"];
138 $this->obj_data[$rec2[
"parent"]][
"subobjects"][$rec2[
"subobj"]] = array(
139 "name" => $rec2[
"subobj"],
141 "lng" => $rec2[
"subobj"]
145 $set = $ilDB->query(
"SELECT * FROM il_object_group");
146 $this->obj_group = array();
147 while ($rec = $ilDB->fetchAssoc($set))
149 $this->obj_group[$rec[
"id"]] = $rec;
153 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
154 foreach ($pl_names as $pl_name)
156 include_once(
"./Services/Component/classes/class.ilPlugin.php");
158 if ($pl_id !=
"" && !isset($this->obj_data[$pl_id]))
160 include_once(
"./Services/Repository/classes/class.ilRepositoryObjectPlugin.php");
162 $pl_name).
"/classes";
164 $this->obj_data[$pl_id] = array(
166 "class_name" => $pl_name,
179 "default_pos" =>
"2000",
181 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
183 $this->obj_data[
"crs"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
184 $this->obj_data[
"grp"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
185 $this->obj_data[
"cat"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
186 $this->obj_data[
"root"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
205 return $this->obj_data[$a_obj_name][
"class_name"];
217 return $this->obj_data[$a_obj_name][
"location"];
225 return $this->obj_group[$a_id];
233 return $this->obj_data[$a_obj_name][
"group"];
244 return (
bool) $this->obj_data[$a_obj_name][
"checkbox"];
257 if ($a_obj_name ==
"root")
259 if (!isset($this->root_trans_type))
261 $q =
"SELECT count(obj_id) cnt FROM object_translation WHERE obj_id = ".
262 $ilDB->quote(ROOT_FOLDER_ID,
'integer').
" ";
263 $set = $ilDB->query(
$q);
267 $this->root_trans_type =
"db";
271 $this->root_trans_type = $this->obj_data[$a_obj_name][
"translate"];
274 return $this->root_trans_type;
277 return $this->obj_data[$a_obj_name][
"translate"];
289 return (
bool) $this->obj_data[$a_obj_name][
"inherit"];
300 return (
bool) $this->obj_data[$a_obj_name][
"devmode"];
311 $types = array_keys($this->obj_data);
313 foreach ($types as
$type)
321 return $devtypes ? $devtypes : array();
333 return (
bool) $this->obj_data[$a_obj_name][
"rbac"];
345 return (
bool) $this->obj_data[$a_obj_name][
"plugin"];
356 $types = array_keys($this->obj_data);
358 foreach ($types as
$type)
362 $rbactypes[] =
$type;
366 return $rbactypes ? $rbactypes : array();
377 return array_keys($this->obj_data);
388 return (
bool) $this->obj_data[$a_obj_name][
"allow_link"];
399 return (
bool) $this->obj_data[$a_obj_name][
"allow_copy"];
416 if ($subobjects = $this->obj_data[$a_obj_type][
"subobjects"])
424 foreach ($subobjects as
$data => $sub)
426 if ($sub[
"module"] !=
"n")
428 if (!($ilSetting->get(
"obj_dis_creation_".$data)))
433 $pos = ($ilSetting->get(
"obj_add_new_pos_".
$data) > 0)
434 ? (
int) $ilSetting->get(
"obj_add_new_pos_".
$data)
435 : (int) $this->obj_data[
$data][
"default_pos"];
436 $subs[
$data][
"pos"] = $pos;
466 $recursivesubs = array();
470 $to_do = array($a_obj_type);
478 while (count($to_do) > 0)
480 $type = array_pop($to_do);
483 foreach ($subs as $subtype =>
$data)
485 $recursivesubs[$subtype] =
$data;
486 if (! in_array($subtype, $done)
487 && ! in_array($subtype, $to_do))
494 return $recursivesubs;
508 foreach($this->obj_data[$a_obj_type][
"subobjects"] as
$key => $value)
522 #$tmp_subs[] = "root";
524 return $tmp_subs ? $tmp_subs : array();
539 unset($subobjects[
"rolf"]);
540 unset($subobjects[
'rcrs']);
542 $sub_types = array_keys($subobjects);
545 foreach ($sub_types as
$type)
550 unset($subobjects[$type]);
567 if (is_array($this->obj_data[$a_obj_type][
"subobjects"]))
569 $data = array_keys($this->obj_data[$a_obj_type][
"subobjects"]);
571 $string =
"'".implode(
"','",
$data).
"'";
587 if(!is_array($this->obj_data[$a_obj_name][
'subobjects']))
591 return count($this->obj_data[$a_obj_name][
'subobjects']) > 1 ?
true :
false;
604 xml_set_object($a_xml_parser,$this);
605 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
606 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
622 $this->parent_tag_name = $a_attribs[
"name"];
625 $this->current_tag =
"property";
626 $this->current_tag_name = $a_attribs[
"name"];
628 $this->obj_data[$this->parent_tag_name][
"properties"][$this->current_tag_name][
"module"] = $a_attribs[
"module"];
654 $this->current_tag =
'';
655 $this->current_tag_name =
'';
666 if(!$this->ilias->getSetting(
"chat_active"))
668 unset($subobjects[
$type]);
673 if(!$this->ilias->getSetting(
"ilinc_active"))
675 unset($subobjects[
$type]);
700 return (
bool) $this->obj_data[$a_obj_name][
"system"];
711 return (
bool) $this->obj_data[$a_obj_name][
"sideblock"];
722 $set = $ilDB->queryF(
"SELECT * FROM il_object_def WHERE component = %s",
723 array(
"text"), array($a_component_type.
"/".$a_component_name));
726 while($rec = $ilDB->fetchAssoc($set))
728 if ($rec[
"system"] != 1)
742 global
$ilDB, $ilPluginAdmin;
744 $set = $ilDB->query(
"SELECT * FROM il_object_group");
748 $groups[$gr_rec[
"id"]] = $gr_rec;
751 if (!is_array($a_parent_obj_type))
753 $set = $ilDB->queryF(
"SELECT il_object_def.* FROM il_object_def, il_object_subobj ".
754 " WHERE NOT (system = 1) AND NOT (sideblock = 1) AND ".
756 " AND subobj = id ", array(
"text"), array($a_parent_obj_type));
760 $q =
"SELECT DISTINCT (id) as sid, il_object_def.* FROM il_object_def, il_object_subobj ".
761 " WHERE NOT (system = 1) AND NOT (sideblock = 1) AND ".
762 $ilDB->in(
"parent", $a_parent_obj_type,
false,
"text").
764 $set = $ilDB->query(
$q);
767 $grouped_obj = array();
768 while($rec = $ilDB->fetchAssoc($set))
770 if ($rec[
"grp"] !=
"")
772 $grouped_obj[$rec[
"grp"]][
"pos"] = (int) $groups[$rec[
"grp"]][
"default_pres_pos"];
773 $grouped_obj[$rec[
"grp"]][
"objs"][] = $rec[
"id"];
777 $grouped_obj[$rec[
"id"]][
"pos"] = (int) $rec[
"default_pres_pos"];
778 $grouped_obj[$rec[
"id"]][
"objs"][] = $rec[
"id"];
783 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
784 foreach ($pl_names as $pl_name)
786 include_once(
"./Services/Component/classes/class.ilPlugin.php");
788 if (!isset($grouped_obj[$pl_id]))
790 $grouped_obj[$pl_id] = array(
792 "objs" => array(0 => $pl_id)