4 require_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'],
97 'offline_handling' => $rec[
'offline_handling']
99 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
101 $defIds[] = $rec[
"id"];
104 $subobj = $global_cache->lookupSubObjForParent($defIds);
106 foreach ($subobj as $rec2) {
107 $max = $rec2[
"mmax"];
111 $this->obj_data[$rec2[
"parent"]][
"subobjects"][$rec2[
"subobj"]] = array(
112 "name" => $rec2[
"subobj"],
114 "lng" => $rec2[
"subobj"]
117 $this->obj_group = $global_cache->getIlObjectGroup();
121 $this->sub_types = $global_cache->getIlObjectSubType();
129 $ilDB = $DIC->database();
131 $this->obj_data = array();
136 $set =
$ilDB->query(
"SELECT * FROM il_object_def");
137 while ($rec =
$ilDB->fetchAssoc($set)) {
138 $this->obj_data[$rec[
"id"]] = array(
139 "name" => $rec[
"id"],
140 "class_name" => $rec[
"class_name"],
141 "location" => $rec[
"location"],
142 "checkbox" => $rec[
"checkbox"],
143 "inherit" => $rec[
"inherit"],
144 "component" => $rec[
"component"],
145 "translate" => $rec[
"translate"],
146 "devmode" => $rec[
"devmode"],
147 "allow_link" => $rec[
"allow_link"],
148 "allow_copy" => $rec[
"allow_copy"],
149 "rbac" => $rec[
"rbac"],
150 "group" => $rec[
"grp"],
151 "system" => $rec[
"system"],
152 "default_pos" =>
"9999" . str_pad($rec[
"default_pos"], 4,
"0", STR_PAD_LEFT),
153 "sideblock" => $rec[
"sideblock"],
154 'export' => $rec[
'export'],
155 'repository' => $rec[
'repository'],
156 'workspace' => $rec[
'workspace'],
157 'administration' => $rec[
'administration'],
158 'amet' => $rec[
'amet'],
159 'orgunit_permissions' => $rec[
'orgunit_permissions'],
160 'lti_provider' => $rec[
'lti_provider'],
161 'offline_handling' => $rec[
'offline_handling']
163 $this->obj_data[$rec[
"id"]][
"subobjects"] = array();
165 $defIds[] = $rec[
"id"];
169 $set2 =
$ilDB->query(
"SELECT * FROM il_object_subobj WHERE " .
$ilDB->in(
'parent', $defIds,
false,
'text'));
170 while ($rec2 =
$ilDB->fetchAssoc($set2)) {
171 $max = $rec2[
"mmax"];
175 $this->obj_data[$rec2[
"parent"]][
"subobjects"][$rec2[
"subobj"]] = array(
176 "name" => $rec2[
"subobj"],
178 "lng" => $rec2[
"subobj"]
182 $set =
$ilDB->query(
"SELECT * FROM il_object_group");
183 $this->obj_group = array();
184 while ($rec =
$ilDB->fetchAssoc($set)) {
185 $this->obj_group[$rec[
"id"]] = $rec;
190 $set =
$ilDB->query(
"SELECT * FROM il_object_sub_type ");
191 $this->sub_types = array();
192 while ($rec =
$ilDB->fetchAssoc($set)) {
193 $this->sub_types[$rec[
"obj_type"]][] = $rec;
223 $ilPluginAdmin = $DIC[
"ilPluginAdmin"];
224 $pl_names = $ilPluginAdmin->getActivePluginsForSlot($component, $slotName, $slotId);
225 foreach ($pl_names as $pl_name) {
226 include_once(
"./Services/Component/classes/class.ilPlugin.php");
228 if (!isset($grouped_obj[$pl_id])) {
229 $grouped_obj[$pl_id] = array(
231 "objs" => array(0 => $pl_id)
249 return $this->obj_data[$a_obj_name][
"class_name"];
261 return $this->obj_data[$a_obj_name][
"location"];
269 return $this->obj_group[$a_id];
277 return $this->obj_data[$a_obj_name][
"group"];
288 return (
bool) $this->obj_data[$a_obj_name][
"checkbox"];
301 $ilDB = $DIC->database();
303 if ($a_obj_name ==
"root") {
304 if (!isset($this->root_trans_type)) {
305 $q =
"SELECT count(obj_id) cnt FROM object_translation WHERE obj_id = " .
306 $ilDB->quote(ROOT_FOLDER_ID,
'integer') .
" ";
307 $set =
$ilDB->query($q);
309 if ($rec[
"cnt"] > 0) {
310 $this->root_trans_type =
"db";
312 $this->root_trans_type = $this->obj_data[$a_obj_name][
"translate"];
315 return $this->root_trans_type;
318 if (isset($this->obj_data[$a_obj_name])) {
319 return $this->obj_data[$a_obj_name][
"translate"];
334 return (
bool) $this->obj_data[$a_obj_name][
"inherit"];
345 return (
bool) $this->obj_data[$a_obj_name][
"devmode"];
356 $types = array_keys($this->obj_data);
358 foreach ($types as
$type) {
364 return $devtypes ? $devtypes : array();
376 return (
bool) $this->obj_data[$a_obj_name][
"rbac"];
388 return (
bool) isset($this->obj_data[$a_obj_name][
"plugin"]);
399 return (substr($a_str, 0, 1) ==
"x");
410 $isRepoPlugin = $ilPluginAdmin->isActive(
416 $isOrguPlugin = $ilPluginAdmin->isActive(
422 return $isRepoPlugin || $isOrguPlugin;
433 $types = array_keys($this->obj_data);
435 foreach ($types as
$type) {
437 $rbactypes[] =
$type;
441 return $rbactypes ? $rbactypes : array();
452 return array_keys($this->obj_data);
463 return (
bool) $this->obj_data[$a_obj_name][
"allow_link"];
474 return (
bool) $this->obj_data[$a_obj_name][
"allow_copy"];
479 return (
bool) $this->obj_data[$a_obj_name][
'export'];
489 switch ($a_obj_type) {
512 if ($subobjects = $this->obj_data[$a_obj_type][
"subobjects"]) {
517 foreach ($subobjects as
$data => $sub) {
518 if ($sub[
"module"] !=
"n") {
525 : (int) $this->obj_data[
$data][
"default_pos"];
526 $subs[
$data][
"pos"] = $pos;
558 $recursivesubs = array();
562 $to_do = array($a_obj_type);
570 while (count($to_do) > 0) {
571 $type = array_pop($to_do);
575 if (
$type ==
'recf') {
580 if (!$a_add_admin_objects
and $type ==
'adm') {
585 #vd('xxxxxxxxxxxxx'.$type); 586 foreach ($subs as $subtype =>
$data) {
587 #vd('------------------------->'.$subtype); 593 if ($subtype ==
'rolt') {
596 if (!$a_add_admin_objects
and $subtype ==
'adm') {
600 $recursivesubs[$subtype] =
$data;
601 if (!in_array($subtype, $done)
602 && !in_array($subtype, $to_do)) {
608 if ($a_include_source_obj) {
609 if (!isset($recursivesubs[$a_obj_type])) {
610 $recursivesubs[$a_obj_type][
'name'] = $a_obj_type;
611 $recursivesubs[$a_obj_type][
'lng'] = $a_obj_type;
612 $recursivesubs[$a_obj_type][
'max'] = 0;
613 $recursivesubs[$a_obj_type][
'pos'] = -1;
631 foreach ($this->obj_data[$a_obj_type][
"subobjects"] as
$key => $value) {
644 #$tmp_subs[] = "root"; 646 return $tmp_subs ? $tmp_subs : array();
663 unset($subobjects[
"rolf"]);
670 unset($subobjects[$type]);
673 unset($subobjects[$type]);
676 unset($subobjects[$type]);
679 unset($subobjects[$type]);
683 if ($a_obj_type ==
"prg") {
685 require_once(
"Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
702 if (is_array($this->obj_data[$a_obj_type][
"subobjects"])) {
703 $data = array_keys($this->obj_data[$a_obj_type][
"subobjects"]);
705 $string =
"'" . implode(
"','",
$data) .
"'";
721 if (!is_array($this->obj_data[$a_obj_name][
'subobjects'])) {
724 return count($this->obj_data[$a_obj_name][
'subobjects']) >= 1 ? true :
false;
737 xml_set_object($a_xml_parser, $this);
738 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
739 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
754 $this->parent_tag_name = $a_attribs[
"name"];
757 $this->current_tag =
"property";
758 $this->current_tag_name = $a_attribs[
"name"];
760 $this->obj_data[$this->parent_tag_name][
"properties"][$this->current_tag_name][
"module"] = $a_attribs[
"module"];
786 $this->current_tag =
'';
787 $this->current_tag_name =
'';
816 return (
bool) $this->obj_data[$a_obj_name][
"system"];
827 return (
bool) $this->obj_data[$a_obj_name][
"sideblock"];
836 $side_block_types = [];
837 foreach (array_keys($this->obj_data) as
$type) {
839 $filter_repository_types &&
845 $side_block_types[] =
$type;
848 return $side_block_types;
860 $ilDB = $DIC->database();
862 $set =
$ilDB->queryF(
863 "SELECT * FROM il_object_def WHERE component = %s",
865 array($a_component_type .
"/" . $a_component_name)
869 while ($rec =
$ilDB->fetchAssoc($set)) {
870 if ($rec[
"system"] != 1) {
885 $ilDB = $DIC->database();
887 $set =
$ilDB->queryF(
888 "SELECT component FROM il_object_def WHERE id = %s",
893 if ($rec =
$ilDB->fetchAssoc($set)) {
894 return $rec[
"component"];
908 $ilDB = $DIC->database();
910 $set =
$ilDB->query(
"SELECT * FROM il_object_group");
913 $groups[$gr_rec[
"id"]] = $gr_rec;
918 $recs = $global_cache->lookupGroupedRepObj($a_parent_obj_type);
920 $grouped_obj = array();
921 foreach ((array) $recs as $rec) {
922 if ($rec[
"grp"] !=
"") {
923 $grouped_obj[$rec[
"grp"]][
"pos"] = (int) $groups[$rec[
"grp"]][
"default_pres_pos"];
924 $grouped_obj[$rec[
"grp"]][
"objs"][] = $rec[
"id"];
926 $grouped_obj[$rec[
"id"]][
"pos"] = (int) $rec[
"default_pres_pos"];
927 $grouped_obj[$rec[
"id"]][
"objs"][] = $rec[
"id"];
931 $grouped_obj = self::getGroupedPluginObjectTypes($grouped_obj,
IL_COMP_SERVICE,
"Repository",
"robj");
932 $grouped_obj = self::getGroupedPluginObjectTypes($grouped_obj,
IL_COMP_MODULE,
"OrgUnit",
"orguext");
947 return (
bool) $this->obj_data[$a_obj_name][
"repository"];
958 $types = array_keys($this->obj_data);
960 foreach ($types as
$type) {
963 $rbactypes[] =
$type;
967 return $rbactypes ? $rbactypes : array();
980 return (
bool) $this->obj_data[$a_obj_name][
"workspace"];
990 return (
bool) $this->obj_data[$a_obj_name][
'administration'];
1016 foreach ($this->obj_data as $k => $v) {
1018 $amet[] = array(
"obj_type" => $k,
"sub_type" =>
"");
1025 $amet[] = array(
"obj_type" =>
$type,
"sub_type" => $t[
"sub_type"]);
1040 foreach ($this->obj_data as
$type => $object_info) {
1041 if ($object_info[
'orgunit_permissions']) {
1055 foreach ($this->obj_data as
$type => $object_info) {
1056 if ($object_info[
'lti_provider']) {
1085 : (int) $this->obj_data[
$a_type][
"default_pos"];
1095 foreach ((array) $this->obj_data as
$type => $pl_data) {
1097 $plugins[
$type] = $pl_data;
1110 $res = $grp_map = $cnt_grp = array();
1114 $type = $rtype[
"name"];
1117 if (
$type ==
"rolf") {
1124 $grp_map[$type_grp][] =
$type;
1131 $cnt_grp[] = $type_grp;
1139 foreach ($cnt_grp as $grp) {
1140 $res = array_merge(
$res, $grp_map[$grp]);
1147 return array_unique(
$res);
1159 isset($this->obj_data[$a_obj_type]) &&
1160 (bool) $this->obj_data[$a_obj_type][
'offline_handling'];
1185 $pl_names = $ilPluginAdmin->getActivePluginsForSlot($component, $slotName, $slotId);
1186 foreach ($pl_names as $pl_name) {
1187 include_once(
"./Services/Component/classes/class.ilPlugin.php");
1189 if ($pl_id !=
"" && !isset($this->obj_data[$pl_id])) {
1190 include_once(
"./Services/Repository/classes/class.ilRepositoryObjectPlugin.php");
1195 $this->obj_data[$pl_id] = array(
1197 "class_name" => $pl_name,
1205 "allow_link" =>
"1",
1206 "allow_copy" => $pl->allowCopy() ?
'1' :
'0',
1210 "default_pos" =>
"99992000",
1211 'repository' =>
'1',
1213 'administration' => $isInAdministration?
'1':
'0',
1215 'export' => $ilPluginAdmin->supportsExport($component, $slotName, $slotId, $pl_name),
1216 'offline_handling' =>
'0' 1218 $parent_types = $pl->getParentTypes();
1219 foreach ($parent_types as $parent_type) {
1220 $this->obj_data[$parent_type][
"subobjects"][$pl_id] = array(
"name" => $pl_id,
"max" =>
"",
"lng" => $pl_id,
"plugin" =>
true);
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
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
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
getOrgUnitPermissionTypes()
Get object type with orgunit position permission support.
getLocation($a_obj_name)
get location by type
static getGroupedRepositoryObjectTypes($a_parent_obj_type)
isAdministrationObject($a_obj_name)
Check if administration object.
isSystemObject($a_obj_name)
checks if object type is a system object
getSideBlockTypes(bool $filter_repository_types=true)
getSubObjects($a_obj_type, $a_filter=true)
get all subobjects by type
isActivePluginType($type)
Returns true iff the given type is an active type of a repositoryObject or Organisation Unit Extensio...
getGroupOfObj($a_obj_name)
Get Group of object type.
static getPluginObjectByType($type)
Return either a repoObject plugin or a orgunit extension plugin or null if the type is not a plugin...
static lookupIdForName(string $a_ctype, string $a_cname, string $a_slot_id, string $a_plugin_name)
getSubobjectsToFilter($a_obj_type="adm")
get all subjects except (rolf) of the adm object This is necessary for filtering these objects in rol...
isInactivePlugin($a_type)
Check whether type belongs to inactive plugin.
static lookupNameForId(string $a_ctype, string $a_cname, string $a_slot_id, string $a_plugin_id)
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
getAllRepositoryTypes($a_incl_adm=false)
get all RBAC object types
isOrgUnitPermissionType($a_obj_type)
Check if object type offers orgunit position support.
foreach($_POST as $key=> $value) $res
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)
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
start tag handler
parsePluginData($component, $slotName, $slotId, $isInAdministration)
loads a single plugin definition into the object definition
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.
static getGroupedPluginObjectTypes($grouped_obj, $component, $slotName, $slotId)
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"...
getLTIProviderTypes()
Get object types which offer lti provider support.
static _getDirectory(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
Get plugin directory.
static getRepositoryObjectTypesForComponent( $a_component_type, $a_component_name)
Get all repository object types of component.
getClassName($a_obj_name)
get class name by type
isContainer($a_obj_name)
Check if object type is container ('crs','fold','grp' ...)
supportsOfflineHandling($a_obj_type)
check whether obj_type supports centralised offline handling
readPluginData()
Loads the different plugins into the object definition.
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.
__construct()
Constructor.
getDevModeAll()
get all object types in devmode
readDefinitionDataFromCache()
getPlugins()
Get plugin object info.