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();
722 unset($subobjects[
"rolf"]);
724 $sub_types = array_keys($subobjects);
727 foreach ($sub_types as $type)
731 unset($subobjects[$type]);
735 unset($subobjects[$type]);
739 unset($subobjects[$type]);
743 unset($subobjects[$type]);
747 if ($a_obj_type ==
"prg") {
749 require_once(
"Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
766 if (is_array($this->obj_data[$a_obj_type][
"subobjects"]))
768 $data = array_keys($this->obj_data[$a_obj_type][
"subobjects"]);
770 $string =
"'".implode(
"','",
$data).
"'";
786 if(!is_array($this->obj_data[$a_obj_name][
'subobjects']))
790 return count($this->obj_data[$a_obj_name][
'subobjects']) >= 1 ? true :
false;
803 xml_set_object($a_xml_parser,$this);
804 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
805 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
821 $this->parent_tag_name = $a_attribs[
"name"];
824 $this->current_tag =
"property";
825 $this->current_tag_name = $a_attribs[
"name"];
827 $this->obj_data[$this->parent_tag_name][
"properties"][$this->current_tag_name][
"module"] = $a_attribs[
"module"];
853 $this->current_tag =
'';
854 $this->current_tag_name =
'';
860 foreach($subobjects as $type =>
$data)
885 return (
bool) $this->obj_data[$a_obj_name][
"system"];
896 return (
bool) $this->obj_data[$a_obj_name][
"sideblock"];
907 $set = $ilDB->queryF(
"SELECT * FROM il_object_def WHERE component = %s",
908 array(
"text"), array($a_component_type.
"/".$a_component_name));
911 while($rec = $ilDB->fetchAssoc($set))
913 if ($rec[
"system"] != 1)
929 $set = $ilDB->queryF(
"SELECT component FROM il_object_def WHERE id = %s",
930 array(
"text"), array($a_obj_type));
932 if ($rec = $ilDB->fetchAssoc($set))
934 return $rec[
"component"];
945 global
$ilDB, $ilPluginAdmin;
947 $set = $ilDB->query(
"SELECT * FROM il_object_group");
951 $groups[$gr_rec[
"id"]] = $gr_rec;
973 $recs = $global_cache->lookupGroupedRepObj($a_parent_obj_type);
975 $grouped_obj = array();
977 foreach((array)$recs as $rec)
979 if ($rec[
"grp"] !=
"")
981 $grouped_obj[$rec[
"grp"]][
"pos"] = (int) $groups[$rec[
"grp"]][
"default_pres_pos"];
982 $grouped_obj[$rec[
"grp"]][
"objs"][] = $rec[
"id"];
986 $grouped_obj[$rec[
"id"]][
"pos"] = (int) $rec[
"default_pres_pos"];
987 $grouped_obj[$rec[
"id"]][
"objs"][] = $rec[
"id"];
992 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
993 foreach ($pl_names as $pl_name)
995 include_once(
"./Services/Component/classes/class.ilPlugin.php");
997 if (!isset($grouped_obj[$pl_id]))
999 $grouped_obj[$pl_id] = array(
1000 "pos" =>
"99992000",
1001 "objs" => array(0 => $pl_id)
1022 return (
bool) $this->obj_data[$a_obj_name][
"repository"];
1033 $types = array_keys($this->obj_data);
1035 foreach ($types as $type)
1040 $rbactypes[] = $type;
1044 return $rbactypes ? $rbactypes : array();
1057 return (
bool) $this->obj_data[$a_obj_name][
"workspace"];
1067 return (
bool) $this->obj_data[$a_obj_name][
'administration'];
1078 if (substr($a_type, 0, 1) ==
"x" && !$this->
isPlugin($a_type))
1094 foreach ($this->obj_data as $k => $v)
1098 $amet[] = array(
"obj_type" => $k,
"sub_type" =>
"");
1102 foreach ($this->sub_types as $type => $sub_types)
1104 foreach ($sub_types as
$t)
1108 $amet[] = array(
"obj_type" => $type,
"sub_type" => $t[
"sub_type"]);
1126 return ($ilSetting->get(
"obj_add_new_pos_".$a_type) > 0)
1127 ? (
int) $ilSetting->get(
"obj_add_new_pos_".$a_type)
1128 : (int) $this->obj_data[$a_type][
"default_pos"];
1138 foreach((array) $this->obj_data as $type => $pl_data)
1142 $plugins[$type] = $pl_data;
1155 $res = $grp_map = $cnt_grp = array();
1160 $type = $rtype[
"name"];
1172 $grp_map[$type_grp][] = $type;
1181 $cnt_grp[] = $type_grp;
1189 foreach($cnt_grp as $grp)
1191 $res = array_merge(
$res, $grp_map[$grp]);
1197 return array_unique(
$res);
getPositionByType($a_type)
Get Position By Object Type.
getCreatableSubObjects($a_obj_type, $a_context=self::MODE_REPOSITORY, $a_parent_ref_id=null)
get only creatable subobjects by type
hasCheckbox($a_obj_name)
should the object get a checkbox (needed for 'cut','copy' ...)
getSubObjectsAsString($a_obj_type)
get a string of all subobjects by type
setHandlers($a_xml_parser)
set event handler
ilObjectDefinition()
Constructor.
isAllowedInRepository($a_obj_name)
checks if object type can be used in repository context
static getInstance($component)
readDefinitionData()
Read object definition data.
getAdvancedMetaDataTypes()
Get advanced meta data objects.
handlerCharacterData($a_xml_parser, $a_data)
end tag handler
getLocation($a_obj_name)
get location by type
static getGroupedRepositoryObjectTypes($a_parent_obj_type)
Get grouped repository object types.
isAdministrationObject($a_obj_name)
Check if administration object.
isSystemObject($a_obj_name)
checks if object type is a system object
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getSubObjects($a_obj_type, $a_filter=true)
get all subobjects by type
getGroupOfObj($a_obj_name)
Get Group of object type.
getSubobjectsToFilter($a_obj_type="adm")
get all subjects except (rolf) of the adm object This is neceesary for filtering these objects in rol...
isInactivePlugin($a_type)
Check whether type belongs to inactive plugin.
allowCopy($a_obj_name)
checks if copying of an object type is allowed
parses the objects.xml it handles the xml-description of all ilias objects
static getRepositoryObjectTypesForComponent($a_component_type, $a_component_name)
Get all repository object types of component.
getAllRepositoryTypes($a_incl_adm=false)
get all RBAC object types
lookupIdForName($a_ctype, $a_cname, $a_slot_id, $a_plugin_name)
Lookup id for name.
getGroup($a_id)
Get Group information.
const MODE_ADMINISTRATION
getAllRBACObjects()
get all RBAC object types
stopInheritance($a_obj_name)
Does object permits stopping inheritance?
getTranslationType($a_obj_name)
get translation type (sys, db or 0)s
__filterObjects(&$subobjects)
redirection script todo: (a better solution should control the processing via a xml file) ...
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
start tag handler
isSideBlock($a_obj_name)
Check, whether object type is a side block.
handlerEndTag($a_xml_parser, $a_name)
end tag handler
static getCreatableSubObjects($a_subobjects, $a_ref_id)
Filter the list of possible subobjects for the objects that actually could be created on a concrete n...
allowLink($a_obj_name)
checks if linking of an object type is allowed
getSubObjectsRecursively($a_obj_type, $a_include_source_obj=true, $a_add_admin_objects=false)
Get all subobjects by type.
getAllObjects()
get all object types
isPluginTypeName($a_str)
Check if given type is a plugin type name (starts with an "x")
isPlugin($a_obj_name)
get RBAC status by type returns true if object type is an (activated) plugin type ...
readDefinitionDataFromDB()
getDevMode($a_obj_name)
get devmode status by type
isRBACObject($a_obj_name)
get RBAC status by type returns true if object type is a RBAC object type
hasLocalRoles($a_obj_type)
Check whether the creation of local roles is allowed Currently disabled for type "root" and "adm"...
getClassName($a_obj_name)
get class name by type
isContainer($a_obj_name)
Check if object type is container ('crs','fold','grp' ...)
getExplorerContainerTypes()
Get all object types which are defined as container in an explorer context.
isAllowedInWorkspace($a_obj_name)
checks if object type can be used in workspace context
static getComponentForType($a_obj_type)
Get component for object type.
getDevModeAll()
get all object types in devmode
static _getDirectory($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin directory.
readDefinitionDataFromCache()
getPlugins()
Get plugin object info.