80 global
$ilDB, $ilPluginAdmin;
82 $this->obj_data = array();
88 $set = $ilDB->query(
"SELECT * FROM il_object_def");
89 while ($rec = $ilDB->fetchAssoc($set))
91 $this->obj_data[$rec[
"id"]] = array(
93 "class_name" => $rec[
"class_name"],
94 "location" => $rec[
"location"],
95 "checkbox" => $rec[
"checkbox"],
96 "inherit" => $rec[
"inherit"],
97 "component" => $rec[
"component"],
98 "translate" => $rec[
"translate"],
99 "devmode" => $rec[
"devmode"],
100 "allow_link" => $rec[
"allow_link"],
101 "allow_copy" => $rec[
"allow_copy"],
102 "rbac" => $rec[
"rbac"],
103 "group" => $rec[
"grp"],
104 "system" => $rec[
"system"],
105 "default_pos" => $rec[
"default_pos"],
106 "sideblock" => $rec[
"sideblock"],
107 'export' => $rec[
'export'],
108 'repository' => $rec[
'repository'],
109 'workspace' => $rec[
'workspace'],
110 'administration' => $rec[
'administration']
112 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
114 $defIds[] = $rec[
"id"];
118 $set2 = $ilDB->query(
"SELECT * FROM il_object_subobj WHERE ".
119 $ilDB->in(
'parent', $defIds,
false,
'text'));
120 while ($rec2 = $ilDB->fetchAssoc($set2))
122 $max = $rec2[
"mmax"];
127 $this->obj_data[$rec2[
"parent"]][
"subobjects"][$rec2[
"subobj"]] = array(
128 "name" => $rec2[
"subobj"],
130 "lng" => $rec2[
"subobj"]
134 $set = $ilDB->query(
"SELECT * FROM il_object_group");
135 $this->obj_group = array();
136 while ($rec = $ilDB->fetchAssoc($set))
138 $this->obj_group[$rec[
"id"]] = $rec;
142 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
143 foreach ($pl_names as $pl_name)
145 include_once(
"./Services/Component/classes/class.ilPlugin.php");
147 if ($pl_id !=
"" && !isset($this->obj_data[$pl_id]))
149 include_once(
"./Services/Repository/classes/class.ilRepositoryObjectPlugin.php");
151 $pl_name).
"/classes";
153 $this->obj_data[$pl_id] = array(
155 "class_name" => $pl_name,
168 "default_pos" =>
"2000",
171 'administration' =>
'0',
173 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
175 $this->obj_data[
"crs"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
176 $this->obj_data[
"fold"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
177 $this->obj_data[
"grp"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
178 $this->obj_data[
"cat"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
179 $this->obj_data[
"root"][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id);
198 return $this->obj_data[$a_obj_name][
"class_name"];
210 return $this->obj_data[$a_obj_name][
"location"];
218 return $this->obj_group[$a_id];
226 return $this->obj_data[$a_obj_name][
"group"];
237 return (
bool) $this->obj_data[$a_obj_name][
"checkbox"];
250 if ($a_obj_name ==
"root")
252 if (!isset($this->root_trans_type))
254 $q =
"SELECT count(obj_id) cnt FROM object_translation WHERE obj_id = ".
255 $ilDB->quote(ROOT_FOLDER_ID,
'integer').
" ";
256 $set = $ilDB->query($q);
260 $this->root_trans_type =
"db";
264 $this->root_trans_type = $this->obj_data[$a_obj_name][
"translate"];
267 return $this->root_trans_type;
270 if (isset($this->obj_data[$a_obj_name]))
272 return $this->obj_data[$a_obj_name][
"translate"];
287 return (
bool) $this->obj_data[$a_obj_name][
"inherit"];
298 return (
bool) $this->obj_data[$a_obj_name][
"devmode"];
309 $types = array_keys($this->obj_data);
311 foreach ($types as $type)
319 return $devtypes ? $devtypes : array();
331 return (
bool) $this->obj_data[$a_obj_name][
"rbac"];
343 return (
bool) isset($this->obj_data[$a_obj_name][
"plugin"]);
354 return (substr($a_str, 0, 1) ==
"x");
365 $types = array_keys($this->obj_data);
367 foreach ($types as $type)
371 $rbactypes[] = $type;
375 return $rbactypes ? $rbactypes : array();
386 return array_keys($this->obj_data);
397 return (
bool) $this->obj_data[$a_obj_name][
"allow_link"];
408 return (
bool) $this->obj_data[$a_obj_name][
"allow_copy"];
413 return (
bool) $this->obj_data[$a_obj_name][
'export'];
423 return isset($this->obj_data[$a_obj_type][
'subobjects'][
'rolf']);
440 if ($subobjects = $this->obj_data[$a_obj_type][
"subobjects"])
447 foreach ($subobjects as
$data => $sub)
449 if ($sub[
"module"] !=
"n")
451 if (!($ilSetting->get(
"obj_dis_creation_".$data)))
456 $pos = ($ilSetting->get(
"obj_add_new_pos_".
$data) > 0)
457 ? (
int) $ilSetting->get(
"obj_add_new_pos_".
$data)
458 : (int) $this->obj_data[
$data][
"default_pos"];
459 $subs[
$data][
"pos"] = $pos;
491 $recursivesubs = array();
495 $to_do = array($a_obj_type);
503 while (count($to_do) > 0)
505 $type = array_pop($to_do);
515 if(!$a_add_admin_objects and $type ==
'adm')
523 #vd('xxxxxxxxxxxxx'.$type);
524 foreach ($subs as $subtype =>
$data)
526 #vd('------------------------->'.$subtype);
533 if($subtype ==
'rolf' or $subtype ==
'rolt')
537 if(!$a_add_admin_objects and $subtype ==
'adm')
542 $recursivesubs[$subtype] =
$data;
543 if (! in_array($subtype, $done)
544 && ! in_array($subtype, $to_do))
551 if($a_include_source_obj)
553 if(!isset($recursivesubs[$a_obj_type]))
555 $recursivesubs[$a_obj_type][
'name'] = $a_obj_type;
556 $recursivesubs[$a_obj_type][
'lng'] = $a_obj_type;
557 $recursivesubs[$a_obj_type][
'max'] = 0;
558 $recursivesubs[$a_obj_type][
'pos'] = -1;
576 foreach($this->obj_data[$a_obj_type][
"subobjects"] as $key => $value)
590 #$tmp_subs[] = "root";
592 return $tmp_subs ? $tmp_subs : array();
608 unset($subobjects[
"rolf"]);
609 unset($subobjects[
'rcrs']);
611 $sub_types = array_keys($subobjects);
614 foreach ($sub_types as $type)
618 unset($subobjects[$type]);
622 unset($subobjects[$type]);
626 unset($subobjects[$type]);
643 if (is_array($this->obj_data[$a_obj_type][
"subobjects"]))
645 $data = array_keys($this->obj_data[$a_obj_type][
"subobjects"]);
647 $string =
"'".implode(
"','",
$data).
"'";
663 if(!is_array($this->obj_data[$a_obj_name][
'subobjects']))
667 return count($this->obj_data[$a_obj_name][
'subobjects']) > 1 ?
true :
false;
680 xml_set_object($a_xml_parser,$this);
681 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
682 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
698 $this->parent_tag_name = $a_attribs[
"name"];
701 $this->current_tag =
"property";
702 $this->current_tag_name = $a_attribs[
"name"];
704 $this->obj_data[$this->parent_tag_name][
"properties"][$this->current_tag_name][
"module"] = $a_attribs[
"module"];
730 $this->current_tag =
'';
731 $this->current_tag_name =
'';
737 foreach($subobjects as $type =>
$data)
742 if(!$this->ilias->getSetting(
"chat_active"))
744 unset($subobjects[$type]);
749 if(!$this->ilias->getSetting(
"ilinc_active"))
751 unset($subobjects[$type]);
776 return (
bool) $this->obj_data[$a_obj_name][
"system"];
787 return (
bool) $this->obj_data[$a_obj_name][
"sideblock"];
798 $set = $ilDB->queryF(
"SELECT * FROM il_object_def WHERE component = %s",
799 array(
"text"), array($a_component_type.
"/".$a_component_name));
802 while($rec = $ilDB->fetchAssoc($set))
804 if ($rec[
"system"] != 1)
820 $set = $ilDB->queryF(
"SELECT component FROM il_object_def WHERE id = %s",
821 array(
"text"), array($a_obj_type));
823 if ($rec = $ilDB->fetchAssoc($set))
825 return $rec[
"component"];
836 global
$ilDB, $ilPluginAdmin;
838 $set = $ilDB->query(
"SELECT * FROM il_object_group");
842 $groups[$gr_rec[
"id"]] = $gr_rec;
845 if (!is_array($a_parent_obj_type))
847 $set = $ilDB->queryF(
"SELECT il_object_def.* FROM il_object_def, il_object_subobj ".
848 " WHERE NOT (system = 1) AND NOT (sideblock = 1) AND ".
850 " AND subobj = id ", array(
"text"), array($a_parent_obj_type));
854 $q =
"SELECT DISTINCT (id) as sid, il_object_def.* FROM il_object_def, il_object_subobj ".
855 " WHERE NOT (system = 1) AND NOT (sideblock = 1) AND ".
856 $ilDB->in(
"parent", $a_parent_obj_type,
false,
"text").
858 $set = $ilDB->query($q);
861 $grouped_obj = array();
862 while($rec = $ilDB->fetchAssoc($set))
864 if ($rec[
"grp"] !=
"")
866 $grouped_obj[$rec[
"grp"]][
"pos"] = (int) $groups[$rec[
"grp"]][
"default_pres_pos"];
867 $grouped_obj[$rec[
"grp"]][
"objs"][] = $rec[
"id"];
871 $grouped_obj[$rec[
"id"]][
"pos"] = (int) $rec[
"default_pres_pos"];
872 $grouped_obj[$rec[
"id"]][
"objs"][] = $rec[
"id"];
877 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
878 foreach ($pl_names as $pl_name)
880 include_once(
"./Services/Component/classes/class.ilPlugin.php");
882 if (!isset($grouped_obj[$pl_id]))
884 $grouped_obj[$pl_id] = array(
886 "objs" => array(0 => $pl_id)
907 return (
bool) $this->obj_data[$a_obj_name][
"repository"];
919 return (
bool) $this->obj_data[$a_obj_name][
"workspace"];
929 return (
bool) $this->obj_data[$a_obj_name][
'administration'];
940 if (substr($a_type, 0, 1) ==
"x" && !$this->
isPlugin($a_type))