4require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
62 $this->plugin_admin =
$DIC[
"ilPluginAdmin"];
70 $this->obj_data = array();
73 foreach ($global_cache->getIlobjectDef() as $rec) {
74 $this->obj_data[$rec[
"id"]] = array(
76 "class_name" => $rec[
"class_name"],
77 "location" => $rec[
"location"],
78 "checkbox" => $rec[
"checkbox"],
79 "inherit" => $rec[
"inherit"],
80 "component" => $rec[
"component"],
81 "translate" => $rec[
"translate"],
82 "devmode" => $rec[
"devmode"],
83 "allow_link" => $rec[
"allow_link"],
84 "allow_copy" => $rec[
"allow_copy"],
85 "rbac" => $rec[
"rbac"],
86 "group" => $rec[
"grp"],
87 "system" => $rec[
"system"],
88 "default_pos" =>
"9999" . str_pad($rec[
"default_pos"], 4,
"0", STR_PAD_LEFT),
89 "sideblock" => $rec[
"sideblock"],
90 'export' => $rec[
'export'],
91 'repository' => $rec[
'repository'],
92 'workspace' => $rec[
'workspace'],
93 'administration' => $rec[
'administration'],
94 'amet' => $rec[
'amet'],
95 'orgunit_permissions' => $rec[
'orgunit_permissions'],
96 'lti_provider' => $rec[
'lti_provider']
98 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
100 $defIds[] = $rec[
"id"];
103 $subobj = $global_cache->lookupSubObjForParent($defIds);
105 foreach ($subobj as $rec2) {
106 $max = $rec2[
"mmax"];
110 $this->obj_data[$rec2[
"parent"]][
"subobjects"][$rec2[
"subobj"]] = array(
111 "name" => $rec2[
"subobj"],
113 "lng" => $rec2[
"subobj"]
116 $this->obj_group = $global_cache->getIlObjectGroup();
120 $this->sub_types = $global_cache->getIlObjectSubType();
130 $this->obj_data = array();
135 $set =
$ilDB->query(
"SELECT * FROM il_object_def");
136 while ($rec =
$ilDB->fetchAssoc($set)) {
137 $this->obj_data[$rec[
"id"]] = array(
138 "name" => $rec[
"id"],
139 "class_name" => $rec[
"class_name"],
140 "location" => $rec[
"location"],
141 "checkbox" => $rec[
"checkbox"],
142 "inherit" => $rec[
"inherit"],
143 "component" => $rec[
"component"],
144 "translate" => $rec[
"translate"],
145 "devmode" => $rec[
"devmode"],
146 "allow_link" => $rec[
"allow_link"],
147 "allow_copy" => $rec[
"allow_copy"],
148 "rbac" => $rec[
"rbac"],
149 "group" => $rec[
"grp"],
150 "system" => $rec[
"system"],
151 "default_pos" =>
"9999" . str_pad($rec[
"default_pos"], 4,
"0", STR_PAD_LEFT),
152 "sideblock" => $rec[
"sideblock"],
153 'export' => $rec[
'export'],
154 'repository' => $rec[
'repository'],
155 'workspace' => $rec[
'workspace'],
156 'administration' => $rec[
'administration'],
157 'amet' => $rec[
'amet'],
158 'orgunit_permissions' => $rec[
'orgunit_permissions'],
159 'lti_provider' => $rec[
'lti_provider']
161 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
163 $defIds[] = $rec[
"id"];
167 $set2 =
$ilDB->query(
"SELECT * FROM il_object_subobj WHERE " .
$ilDB->in(
'parent', $defIds,
false,
'text'));
168 while ($rec2 =
$ilDB->fetchAssoc($set2)) {
169 $max = $rec2[
"mmax"];
173 $this->obj_data[$rec2[
"parent"]][
"subobjects"][$rec2[
"subobj"]] = array(
174 "name" => $rec2[
"subobj"],
176 "lng" => $rec2[
"subobj"]
180 $set =
$ilDB->query(
"SELECT * FROM il_object_group");
181 $this->obj_group = array();
182 while ($rec =
$ilDB->fetchAssoc($set)) {
183 $this->obj_group[$rec[
"id"]] = $rec;
188 $set =
$ilDB->query(
"SELECT * FROM il_object_sub_type ");
189 $this->sub_types = array();
190 while ($rec =
$ilDB->fetchAssoc($set)) {
191 $this->sub_types[$rec[
"obj_type"]][] = $rec;
221 $ilPluginAdmin =
$DIC[
"ilPluginAdmin"];
222 $pl_names = $ilPluginAdmin->getActivePluginsForSlot($component, $slotName, $slotId);
223 foreach ($pl_names as $pl_name) {
224 include_once(
"./Services/Component/classes/class.ilPlugin.php");
226 if (!isset($grouped_obj[$pl_id])) {
227 $grouped_obj[$pl_id] = array(
229 "objs" => array(0 => $pl_id)
247 return $this->obj_data[$a_obj_name][
"class_name"];
259 return $this->obj_data[$a_obj_name][
"location"];
267 return $this->obj_group[$a_id];
275 return $this->obj_data[$a_obj_name][
"group"];
286 return (
bool) $this->obj_data[$a_obj_name][
"checkbox"];
301 if ($a_obj_name ==
"root") {
302 if (!isset($this->root_trans_type)) {
303 $q =
"SELECT count(obj_id) cnt FROM object_translation WHERE obj_id = " .
304 $ilDB->quote(ROOT_FOLDER_ID,
'integer') .
" ";
305 $set =
$ilDB->query($q);
307 if ($rec[
"cnt"] > 0) {
308 $this->root_trans_type =
"db";
310 $this->root_trans_type = $this->obj_data[$a_obj_name][
"translate"];
313 return $this->root_trans_type;
316 if (isset($this->obj_data[$a_obj_name])) {
317 return $this->obj_data[$a_obj_name][
"translate"];
332 return (
bool) $this->obj_data[$a_obj_name][
"inherit"];
343 return (
bool) $this->obj_data[$a_obj_name][
"devmode"];
354 $types = array_keys($this->obj_data);
356 foreach ($types as
$type) {
362 return $devtypes ? $devtypes : array();
374 return (
bool) $this->obj_data[$a_obj_name][
"rbac"];
386 return (
bool) isset($this->obj_data[$a_obj_name][
"plugin"]);
397 return (substr($a_str, 0, 1) ==
"x");
408 $isRepoPlugin = $ilPluginAdmin->isActive(
414 $isOrguPlugin = $ilPluginAdmin->isActive(
420 return $isRepoPlugin || $isOrguPlugin;
431 $types = array_keys($this->obj_data);
433 foreach ($types as
$type) {
435 $rbactypes[] =
$type;
439 return $rbactypes ? $rbactypes : array();
450 return array_keys($this->obj_data);
461 return (
bool) $this->obj_data[$a_obj_name][
"allow_link"];
472 return (
bool) $this->obj_data[$a_obj_name][
"allow_copy"];
477 return (
bool) $this->obj_data[$a_obj_name][
'export'];
487 switch ($a_obj_type) {
510 if ($subobjects = $this->obj_data[$a_obj_type][
"subobjects"]) {
515 foreach ($subobjects as
$data => $sub) {
516 if ($sub[
"module"] !=
"n") {
523 : (int) $this->obj_data[
$data][
"default_pos"];
524 $subs[
$data][
"pos"] = $pos;
556 $recursivesubs = array();
560 $to_do = array($a_obj_type);
568 while (count($to_do) > 0) {
569 $type = array_pop($to_do);
573 if (
$type ==
'recf') {
578 if (!$a_add_admin_objects and
$type ==
'adm') {
583 #vd('xxxxxxxxxxxxx'.$type);
584 foreach ($subs as $subtype =>
$data) {
585 #vd('------------------------->'.$subtype);
591 if ($subtype ==
'rolt') {
594 if (!$a_add_admin_objects and $subtype ==
'adm') {
598 $recursivesubs[$subtype] =
$data;
599 if (!in_array($subtype, $done)
600 && !in_array($subtype, $to_do)) {
606 if ($a_include_source_obj) {
607 if (!isset($recursivesubs[$a_obj_type])) {
608 $recursivesubs[$a_obj_type][
'name'] = $a_obj_type;
609 $recursivesubs[$a_obj_type][
'lng'] = $a_obj_type;
610 $recursivesubs[$a_obj_type][
'max'] = 0;
611 $recursivesubs[$a_obj_type][
'pos'] = -1;
629 foreach ($this->obj_data[$a_obj_type][
"subobjects"] as
$key => $value) {
642 #$tmp_subs[] = "root";
644 return $tmp_subs ? $tmp_subs : array();
661 unset($subobjects[
"rolf"]);
668 unset($subobjects[
$type]);
671 unset($subobjects[
$type]);
674 unset($subobjects[
$type]);
677 unset($subobjects[
$type]);
681 if ($a_obj_type ==
"prg") {
683 require_once(
"Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
700 if (is_array($this->obj_data[$a_obj_type][
"subobjects"])) {
701 $data = array_keys($this->obj_data[$a_obj_type][
"subobjects"]);
703 $string =
"'" . implode(
"','",
$data) .
"'";
719 if (!is_array($this->obj_data[$a_obj_name][
'subobjects'])) {
722 return count($this->obj_data[$a_obj_name][
'subobjects']) >= 1 ? true :
false;
735 xml_set_object($a_xml_parser, $this);
736 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
737 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
752 $this->parent_tag_name = $a_attribs[
"name"];
755 $this->current_tag =
"property";
756 $this->current_tag_name = $a_attribs[
"name"];
758 $this->obj_data[$this->parent_tag_name][
"properties"][$this->current_tag_name][
"module"] = $a_attribs[
"module"];
784 $this->current_tag =
'';
785 $this->current_tag_name =
'';
814 return (
bool) $this->obj_data[$a_obj_name][
"system"];
825 return (
bool) $this->obj_data[$a_obj_name][
"sideblock"];
839 $set =
$ilDB->queryF(
840 "SELECT * FROM il_object_def WHERE component = %s",
842 array($a_component_type .
"/" . $a_component_name)
846 while ($rec =
$ilDB->fetchAssoc($set)) {
847 if ($rec[
"system"] != 1) {
864 $set =
$ilDB->queryF(
865 "SELECT component FROM il_object_def WHERE id = %s",
870 if ($rec =
$ilDB->fetchAssoc($set)) {
871 return $rec[
"component"];
887 $set =
$ilDB->query(
"SELECT * FROM il_object_group");
890 $groups[$gr_rec[
"id"]] = $gr_rec;
895 $recs = $global_cache->lookupGroupedRepObj($a_parent_obj_type);
897 $grouped_obj = array();
898 foreach ((array) $recs as $rec) {
899 if ($rec[
"grp"] !=
"") {
900 $grouped_obj[$rec[
"grp"]][
"pos"] = (int) $groups[$rec[
"grp"]][
"default_pres_pos"];
901 $grouped_obj[$rec[
"grp"]][
"objs"][] = $rec[
"id"];
903 $grouped_obj[$rec[
"id"]][
"pos"] = (int) $rec[
"default_pres_pos"];
904 $grouped_obj[$rec[
"id"]][
"objs"][] = $rec[
"id"];
924 return (
bool) $this->obj_data[$a_obj_name][
"repository"];
935 $types = array_keys($this->obj_data);
937 foreach ($types as
$type) {
940 $rbactypes[] =
$type;
944 return $rbactypes ? $rbactypes : array();
957 return (
bool) $this->obj_data[$a_obj_name][
"workspace"];
967 return (
bool) $this->obj_data[$a_obj_name][
'administration'];
993 foreach ($this->obj_data as $k => $v) {
995 $amet[] = array(
"obj_type" => $k,
"sub_type" =>
"");
1002 $amet[] = array(
"obj_type" =>
$type,
"sub_type" =>
$t[
"sub_type"]);
1017 foreach ($this->obj_data as
$type => $object_info) {
1018 if ($object_info[
'orgunit_permissions']) {
1032 foreach ($this->obj_data as
$type => $object_info) {
1033 if ($object_info[
'lti_provider']) {
1062 : (int) $this->obj_data[
$a_type][
"default_pos"];
1072 foreach ((array) $this->obj_data as
$type => $pl_data) {
1074 $plugins[
$type] = $pl_data;
1087 $res = $grp_map = $cnt_grp = array();
1091 $type = $rtype[
"name"];
1094 if (
$type ==
"rolf") {
1101 $grp_map[$type_grp][] =
$type;
1108 $cnt_grp[] = $type_grp;
1116 foreach ($cnt_grp as $grp) {
1117 $res = array_merge(
$res, $grp_map[$grp]);
1124 return array_unique(
$res);
1148 $pl_names = $ilPluginAdmin->getActivePluginsForSlot($component, $slotName, $slotId);
1149 foreach ($pl_names as $pl_name) {
1150 include_once(
"./Services/Component/classes/class.ilPlugin.php");
1152 if ($pl_id !=
"" && !isset($this->obj_data[$pl_id])) {
1153 include_once(
"./Services/Repository/classes/class.ilRepositoryObjectPlugin.php");
1158 $this->obj_data[$pl_id] = array(
1160 "class_name" => $pl_name,
1168 "allow_link" =>
"1",
1169 "allow_copy" => $pl->allowCopy() ?
'1' :
'0',
1173 "default_pos" =>
"99992000",
1174 'repository' =>
'1',
1176 'administration' => $isInAdministration?
'1':
'0',
1178 'export' => $ilPluginAdmin->supportsExport($component, $slotName, $slotId, $pl_name)
1180 $parent_types = $pl->getParentTypes();
1181 foreach ($parent_types as $parent_type) {
1182 $this->obj_data[$parent_type][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true);
An exception for terminatinating execution or to throw for unit testing.
static getInstance($component)
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...
parses the objects.xml it handles the xml-description of all ilias objects
getTranslationType($a_obj_name)
get translation type (sys, db or 0)s
getSubobjectsToFilter($a_obj_type="adm")
get all subjects except (rolf) of the adm object This is necessary for filtering these objects in rol...
getSubObjectsRecursively($a_obj_type, $a_include_source_obj=true, $a_add_admin_objects=false)
Get all subobjects by type.
getCreatableSubObjects($a_obj_type, $a_context=self::MODE_REPOSITORY, $a_parent_ref_id=null)
get only creatable subobjects by type
static getComponentForType($a_obj_type)
Get component for object type.
getAllRepositoryTypes($a_incl_adm=false)
get all RBAC object types
getOrgUnitPermissionTypes()
Get object type with orgunit position permission support.
getAllRBACObjects()
get all RBAC object types
isPlugin($a_obj_name)
get RBAC status by type returns true if object type is an (activated) plugin type
getGroupOfObj($a_obj_name)
Get Group of object type.
readDefinitionData()
Read object definition data.
getDevModeAll()
get all object types in devmode
handlerCharacterData($a_xml_parser, $a_data)
end tag handler
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
start tag handler
getDevMode($a_obj_name)
get devmode status by type
__construct()
Constructor.
static getGroupedRepositoryObjectTypes($a_parent_obj_type)
hasLocalRoles($a_obj_type)
Check whether the creation of local roles is allowed Currently disabled for type "root" and "adm".
getLocation($a_obj_name)
get location by type
isAllowedInRepository($a_obj_name)
checks if object type can be used in repository context
readDefinitionDataFromCache()
isActivePluginType($type)
Returns true iff the given type is an active type of a repositoryObject or Organisation Unit Extensio...
allowLink($a_obj_name)
checks if linking of an object type is allowed
isOrgUnitPermissionType($a_obj_type)
Check if object type offers orgunit position support.
getLTIProviderTypes()
Get object types which offer lti provider support.
__filterObjects(&$subobjects)
stopInheritance($a_obj_name)
Does object permits stopping inheritance?
readPluginData()
Loads the different plugins into the object definition.
allowCopy($a_obj_name)
checks if copying of an object type is allowed
isSystemObject($a_obj_name)
checks if object type is a system object
isAllowedInWorkspace($a_obj_name)
checks if object type can be used in workspace context
isInactivePlugin($a_type)
Check whether type belongs to inactive plugin.
readDefinitionDataFromDB()
isSideBlock($a_obj_name)
Check, whether object type is a side block.
static getRepositoryObjectTypesForComponent( $a_component_type, $a_component_name)
Get all repository object types of component.
getClassName($a_obj_name)
get class name by type
parsePluginData($component, $slotName, $slotId, $isInAdministration)
loads a single plugin definition into the object definition
getSubObjectsAsString($a_obj_type)
get a string of all subobjects by type
getPlugins()
Get plugin object info.
getAdvancedMetaDataTypes()
Get advanced meta data objects.
getAllObjects()
get all object types
getGroup($a_id)
Get Group information.
getSubObjects($a_obj_type, $a_filter=true)
get all subobjects by type
getExplorerContainerTypes()
Get all object types which are defined as container in an explorer context.
isPluginTypeName($a_str)
Check if given type is a plugin type name (starts with an "x")
hasCheckbox($a_obj_name)
should the object get a checkbox (needed for 'cut','copy' ...)
isContainer($a_obj_name)
Check if object type is container ('crs','fold','grp' ...)
setHandlers($a_xml_parser)
set event handler
isAdministrationObject($a_obj_name)
Check if administration object.
const MODE_ADMINISTRATION
getPositionByType($a_type)
Get Position By Object Type.
handlerEndTag($a_xml_parser, $a_name)
end tag handler
static getGroupedPluginObjectTypes($grouped_obj, $component, $slotName, $slotId)
isRBACObject($a_obj_name)
get RBAC status by type returns true if object type is a RBAC object type
static getRepoPluginObjectByType($type)
Return either a repoObject plugin or a orgunit extension plugin or null if the type is not a plugin.
static lookupIdForName($a_ctype, $a_cname, $a_slot_id, $a_plugin_name)
Lookup id for name.
static lookupNameForId($a_ctype, $a_cname, $a_slot_id, $a_plugin_id)
Lookup name for id.
static _getDirectory($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin directory.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
foreach($_POST as $key=> $value) $res