ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilObjectDefinition.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
29 {
30  public const MODE_REPOSITORY = 1;
31  public const MODE_WORKSPACE = 2;
32  public const MODE_ADMINISTRATION = 3;
33 
34  protected ilSetting $settings;
36 
37  protected array $obj_data = [];
38  protected array $obj_group = [];
39  protected array $sub_types = [];
40  protected string $parent_tag_name;
41  protected string $current_tag;
42  protected string $current_tag_name;
43  protected ?string $root_trans_type = null;
44 
45  public function __construct()
46  {
47  global $DIC;
48 
49  $this->component_repository = $DIC["component.repository"];
50  $this->settings = $DIC->settings();
51  $this->readDefinitionData();
52  }
53 
57  public function readDefinitionData(): void
58  {
59  $global_cache = ilCachedObjectDefinition::getInstance();
60  foreach ($global_cache->getIlObjectDef() as $rec) {
61  $this->obj_data[$rec["id"]] = [
62  "name" => $rec["id"],
63  "class_name" => $rec["class_name"],
64  "location" => $rec["location"],
65  "checkbox" => $rec["checkbox"],
66  "inherit" => $rec["inherit"],
67  "component" => $rec["component"],
68  "translate" => $rec["translate"],
69  "devmode" => $rec["devmode"],
70  "allow_link" => $rec["allow_link"],
71  "allow_copy" => $rec["allow_copy"],
72  "rbac" => $rec["rbac"],
73  "group" => $rec["grp"],
74  "system" => $rec["system"],
75  "default_pos" => "9999" . str_pad((string) $rec["default_pos"], 4, "0", STR_PAD_LEFT), // "unassigned" group
76  "sideblock" => $rec["sideblock"],
77  'export' => $rec['export'],
78  'repository' => $rec['repository'],
79  'workspace' => $rec['workspace'],
80  'administration' => $rec['administration'],
81  'amet' => $rec['amet'],
82  'orgunit_permissions' => $rec['orgunit_permissions'],
83  'lti_provider' => $rec['lti_provider'],
84  'offline_handling' => $rec['offline_handling']
85  ];
86  $this->obj_data[$rec["id"]]["subobjects"] = [];
87 
88  $defIds[] = $rec["id"];
89  }
90 
91  $subobj = $global_cache->lookupSubObjForParent($defIds);
92 
93  foreach ($subobj as $rec2) {
94  $max = $rec2["mmax"];
95  if ($max <= 0) {
96  $max = "";
97  }
98  $this->obj_data[$rec2["parent"]]["subobjects"][$rec2["subobj"]] = [
99  "name" => $rec2["subobj"],
100  "max" => $max,
101  "lng" => $rec2["subobj"]
102  ];
103  }
104 
105  $this->obj_group = $global_cache->getIlObjectGroup();
106  $this->readPluginData();
107  $this->sub_types = $global_cache->getIlObjectSubType();
108  }
109 
110  protected static function getGroupedPluginObjectTypes(array $grouped_obj, string $slotId): array
111  {
112  global $DIC;
113 
114  $component_repository = $DIC["component.repository"];
115  $plugins = $component_repository->getPluginSlotById($slotId)->getActivePlugins();
116  foreach ($plugins as $plugin) {
117  $pl_id = $plugin->getId();
118  if (!isset($grouped_obj[$pl_id])) {
119  $grouped_obj[$pl_id] = [
120  "pos" => "99992000", // "unassigned" group
121  "objs" => [0 => $pl_id]
122  ];
123  }
124  }
125  return $grouped_obj;
126  }
127 
128  public function getClassName(string $obj_name): string
129  {
130  return $this->obj_data[$obj_name]["class_name"] ?? '';
131  }
132 
133  public function getLocation(string $obj_name): string
134  {
135  return $this->obj_data[$obj_name]["location"] ?? '';
136  }
137 
141  public function getGroup(string $id): array
142  {
143  return $this->obj_group[$id];
144  }
145 
149  public function getGroupOfObj(string $obj_name): ?string
150  {
151  return $this->obj_data[$obj_name]["group"] ?? null;
152  }
153 
157  public function hasCheckbox(string $obj_name): bool
158  {
159  return (bool) ($this->obj_data[$obj_name]["checkbox"] ?? false);
160  }
161 
165  public function getTranslationType(string $obj_name): ?string
166  {
167  global $DIC;
168  $ilDB = $DIC->database();
169 
170  if ($obj_name == "root") {
171  if (!isset($this->root_trans_type)) {
172  $sql =
173  "SELECT count(obj_id) cnt" . PHP_EOL
174  . "FROM object_translation" . PHP_EOL
175  . "WHERE obj_id = " . $ilDB->quote(ROOT_FOLDER_ID, 'integer') . PHP_EOL
176  ;
177  $set = $ilDB->query($sql);
178  $rec = $set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
179  if ($rec["cnt"] > 0) {
180  $this->root_trans_type = "db";
181  } else {
182  $this->root_trans_type = $this->obj_data[$obj_name]["translate"];
183  }
184  }
185  return $this->root_trans_type;
186  }
187 
188  if (isset($this->obj_data[$obj_name])) {
189  return $this->obj_data[$obj_name]["translate"];
190  }
191 
192  return "";
193  }
194 
198  public function stopInheritance(string $obj_name): bool
199  {
200  return (bool) $this->obj_data[$obj_name]["inherit"];
201  }
202 
206  public function getDevMode(string $obj_name): bool
207  {
208  return (bool) ($this->obj_data[$obj_name]["devmode"] ?? false);
209  }
210 
216  public function getDevModeAll(): array
217  {
218  $types = array_keys($this->obj_data);
219 
220  $dev_types = [];
221  foreach ($types as $type) {
222  if ($this->getDevMode($type)) {
223  $dev_types[] = $type;
224  }
225  }
226 
227  return $dev_types;
228  }
229 
234  public function isRBACObject(string $obj_name): bool
235  {
236  return (bool) ($this->obj_data[$obj_name]["rbac"] ?? false);
237  }
238 
243  public function isPlugin(string $obj_name): bool
244  {
245  return isset($this->obj_data[$obj_name]["plugin"]);
246  }
247 
251  public function isPluginTypeName(string $str): bool
252  {
253  return (substr($str, 0, 1) == "x");
254  }
255 
259  public function isActivePluginType(string $type): bool
260  {
261  if (!$this->component_repository->hasPluginId($type)) {
262  return false;
263  }
264  $plugin_slot = $this->component_repository->getPluginById($type)->getPluginSlot();
265  return $plugin_slot->getId() === "robj" || $plugin_slot->getId() === "orguext";
266  }
267 
268  public function getAllRBACObjects(): array
269  {
270  $types = array_keys($this->obj_data);
271 
272  $rbac_types = [];
273  foreach ($types as $type) {
274  if ($this->isRBACObject($type)) {
275  $rbac_types[] = $type;
276  }
277  }
278 
279  return $rbac_types;
280  }
281 
285  public function getAllObjects(): array
286  {
287  return array_keys($this->obj_data);
288  }
289 
293  public function allowLink(string $obj_name): bool
294  {
295  return (bool) $this->obj_data[$obj_name]["allow_link"];
296  }
297 
301  public function allowCopy(string $obj_name): bool
302  {
303  return (bool) $this->obj_data[$obj_name]["allow_copy"];
304  }
305 
306  public function allowExport(string $obj_name): bool
307  {
308  return (bool) $this->obj_data[$obj_name]['export'];
309  }
310 
315  public function hasLocalRoles(string $obj_type): bool
316  {
317  switch ($obj_type) {
318  case 'root':
319  return false;
320 
321  default:
322  return true;
323  }
324  }
325 
329  public function getSubObjects(string $obj_type, bool $filter = true): array
330  {
331  $subs = [];
332  if ($subobjects = ($this->obj_data[$obj_type]["subobjects"] ?? false)) {
333  // Filter some objects e.g. chat object are creatable if chat is active
334  if ($filter) {
335  $this->__filterObjects($subobjects);
336  }
337  foreach ($subobjects as $data => $sub) {
338  if (!isset($sub["module"]) || $sub["module"] != "n") {
339  if (!($this->settings->get("obj_dis_creation_" . $data))) {
340  $subs[$data] = $sub;
341 
342  // determine position
343  $pos = (int) $this->obj_data[$data]["default_pos"];
344  if ($this->settings->get("obj_add_new_pos_" . $data) > 0) {
345  $pos = (int) $this->settings->get("obj_add_new_pos_" . $data);
346  }
347  $subs[$data]["pos"] = $pos;
348  }
349  }
350  }
351 
352  return ilArrayUtil::sortArray($subs, "pos", 'ASC', true, true);
353  }
354 
355  return $subs;
356  }
357 
366  public function getSubObjectsRecursively(
367  string $obj_type,
368  bool $include_source_obj = true,
369  bool $add_admin_objects = false
370  ): array {
371  // This associative array is used to collect all sub object types.
372  // key=>type, value=data
373  $recursive_subs = [];
374 
375  // This array is used to keep track of the object types, we
376  // need to call function getSubobjects() for.
377  $to_do = [$obj_type];
378 
379  // This array is used to keep track of the object types, we
380  // have called function getSubobjects() already. This is to
381  // prevent endless loops, for object types that support
382  // themselves as subobject types either directly or indirectly.
383  $done = [];
384 
385  while (count($to_do) > 0) {
386  $type = array_pop($to_do);
387  $done[] = $type;
388 
389  // no recovery folder subitems
390  if ($type == 'recf') {
391  continue;
392  }
393 
394  // Hide administration if desired
395  if (!$add_admin_objects and $type == 'adm') {
396  $subs = [];
397  } else {
398  $subs = $this->getSubObjects($type);
399  }
400  foreach ($subs as $subtype => $data) {
401  // Hide role templates and folder from view
402  if ($this->getDevMode($subtype) or !$this->isRBACObject($subtype)) {
403  continue;
404  }
405  if ($subtype == 'rolt') {
406  continue;
407  }
408  if (!$add_admin_objects and $subtype == 'adm') {
409  continue;
410  }
411 
412  $recursive_subs[$subtype] = $data;
413  if (!in_array($subtype, $done) && !in_array($subtype, $to_do)) {
414  $to_do[] = $subtype;
415  }
416  }
417  }
418 
419  if ($include_source_obj) {
420  if (!isset($recursive_subs[$obj_type])) {
421  $recursive_subs[$obj_type]['name'] = $obj_type;
422  $recursive_subs[$obj_type]['lng'] = $obj_type;
423  $recursive_subs[$obj_type]['max'] = 0;
424  $recursive_subs[$obj_type]['pos'] = -1;
425  }
426  }
427  return ilArrayUtil::sortArray($recursive_subs, "pos", 'ASC', true, true);
428  }
429 
430 
436  public function getSubobjectsToFilter(string $obj_type = "adm"): array
437  {
438  foreach ($this->obj_data[$obj_type]["subobjects"] as $key => $value) {
439  switch ($key) {
440  case "rolf":
441  case "orgu":
442  // DO NOTHING
443  break;
444 
445  default:
446  $tmp_subs[] = $key;
447  }
448  }
449  $tmp_subs[] = "adm";
450 
451  return $tmp_subs;
452  }
453 
454  public function getCreatableSubObjects(
455  string $obj_type,
456  int $context = self::MODE_REPOSITORY,
457  int $parent_ref_id = null
458  ): array {
459  $sub_objects = $this->getSubObjects($obj_type);
460 
461  // remove role folder object from list
462  unset($sub_objects["rolf"]);
463 
464  $sub_types = array_keys($sub_objects);
465 
466  // remove object types in development from list
467  foreach ($sub_types as $type) {
468  if ($this->getDevMode($type) || $this->isSystemObject($type)) {
469  unset($sub_objects[$type]);
470  }
471  if ($context == self::MODE_REPOSITORY && !$this->isAllowedInRepository($type)) {
472  unset($sub_objects[$type]);
473  }
474  if ($context == self::MODE_WORKSPACE && !$this->isAllowedInWorkspace($type)) {
475  unset($sub_objects[$type]);
476  }
477  if ($context == self::MODE_ADMINISTRATION && !$this->isAdministrationObject($type)) {
478  unset($sub_objects[$type]);
479  }
480  }
481 
482  if ($obj_type == "prg") {
483  // ask study program which objects are allowed to create on the concrete node.
484  return ilObjStudyProgramme::getCreatableSubObjects($sub_objects, $parent_ref_id);
485  }
486 
487  return $sub_objects;
488  }
489 
493  public function getSubObjectsAsString(string $obj_type): string
494  {
495  $string = "";
496  if (is_array($this->obj_data[$obj_type]["subobjects"])) {
497  $data = array_keys($this->obj_data[$obj_type]["subobjects"]);
498  $string = "'" . implode("','", $data) . "'";
499  }
500 
501  return $string;
502  }
503 
507  public function isContainer(string $obj_name): bool
508  {
509  return (bool) ($this->obj_data[$obj_name]['subobjects'] ?? false);
510  }
511 
512  public function setHandlers($xml_parser): void
513  {
514  xml_set_object($xml_parser, $this);
515  xml_set_element_handler($xml_parser, 'handlerBeginTag', 'handlerEndTag');
516  xml_set_character_data_handler($xml_parser, 'handlerCharacterData');
517  }
518 
519  public function handlerBeginTag($xml_parser, string $name, array $attribs): void
520  {
521  switch ($name) {
522  case 'object':
523  $this->parent_tag_name = $attribs["name"];
524  break;
525  case 'property':
526  $this->current_tag = "property";
527  $this->current_tag_name = $attribs["name"];
528  $this->obj_data[$this->parent_tag_name]["properties"][$this->current_tag_name]["module"] = $attribs["module"];
529  break;
530  }
531  }
532 
533  public function handlerCharacterData($xml_parser, string $data): void
534  {
535  }
536 
537  public function handlerEndTag($xml_parser, string $name): void
538  {
539  $this->current_tag = '';
540  $this->current_tag_name = '';
541  }
542 
543  public function __filterObjects(array &$sub_objects): void
544  {
545  // DO NOTHING
546  }
547 
558  public function isSystemObject(string $obj_name): bool
559  {
560  return (bool) ($this->obj_data[$obj_name]["system"] ?? false);
561  }
562 
566  public function isSideBlock(string $obj_name): bool
567  {
568  return (bool) ($this->obj_data[$obj_name]["sideblock"] ?? false);
569  }
570 
571  public function getSideBlockTypes(bool $filter_repository_types = true): array
572  {
573  $side_block_types = [];
574  foreach (array_keys($this->obj_data) as $type) {
575  if (
576  $filter_repository_types &&
577  !$this->isAllowedInRepository($type)
578  ) {
579  continue;
580  }
581  if ($this->isSideBlock($type)) {
582  $side_block_types[] = $type;
583  }
584  }
585  return $side_block_types;
586  }
587 
596  public static function getRepositoryObjectTypesForComponent(string $component_type, string $component_name): array
597  {
598  global $DIC;
599  $ilDB = $DIC->database();
600 
601  $sql =
602  "SELECT id, class_name, component, location, checkbox, inherit, translate, devmode, allow_link," . PHP_EOL
603  . "allow_copy, rbac, `system`, sideblock, default_pos, grp, default_pres_pos, `export`, repository," . PHP_EOL
604  . "workspace, administration, amet, orgunit_permissions, lti_provider, offline_handling" . PHP_EOL
605  . "FROM il_object_def" . PHP_EOL
606  . "WHERE component = %s" . PHP_EOL
607  ;
608  $result = $ilDB->queryF($sql, ["text"], [$component_type . "/" . $component_name]);
609 
610  $types = [];
611  while ($rec = $ilDB->fetchAssoc($result)) {
612  if ($rec["system"] != 1) {
613  $types[] = $rec;
614  }
615  }
616 
617  return $types;
618  }
619 
623  public static function getComponentForType(string $obj_type): string
624  {
625  global $DIC;
626  $ilDB = $DIC->database();
627 
628  $result = $ilDB->queryF("SELECT component FROM il_object_def WHERE id = %s", ["text"], [$obj_type]);
629 
630  if ($rec = $ilDB->fetchAssoc($result)) {
631  return $rec["component"];
632  }
633 
634  return "";
635  }
636 
640  public static function getGroupedRepositoryObjectTypes($parent_obj_type): array
641  {
642  global $DIC;
643  $ilDB = $DIC->database();
644 
645  $set = $ilDB->query("SELECT * FROM il_object_group");
646  $groups = [];
647  while ($gr_rec = $set->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
648  $groups[$gr_rec["id"]] = $gr_rec;
649  }
650 
651  $global_cache = ilCachedObjectDefinition::getInstance();
652 
653  $recs = $global_cache->lookupGroupedRepObj($parent_obj_type);
654 
655  $grouped_obj = [];
656  foreach ((array) $recs as $rec) {
657  if ($rec["grp"] != "") {
658  $grouped_obj[$rec["grp"]]["pos"] = (int) $groups[$rec["grp"]]["default_pres_pos"];
659  $grouped_obj[$rec["grp"]]["objs"][] = $rec["id"];
660  } else {
661  $grouped_obj[$rec["id"]]["pos"] = (int) $rec["default_pres_pos"];
662  $grouped_obj[$rec["id"]]["objs"][] = $rec["id"];
663  }
664  }
665  // now get objects from repository plugin
666  $grouped_obj = self::getGroupedPluginObjectTypes($grouped_obj, "robj");
667  $grouped_obj = self::getGroupedPluginObjectTypes($grouped_obj, "orguext");
668 
669  return ilArrayUtil::sortArray($grouped_obj, "pos", "asc", true, true);
670  }
671 
675  public function isAllowedInRepository(string $obj_name): bool
676  {
677  return (bool) ($this->obj_data[$obj_name]["repository"] ?? false);
678  }
679 
683  public function getAllRepositoryTypes(bool $incl_adm = false): array
684  {
685  $types = array_keys($this->obj_data);
686 
687  $rbac_types = [];
688  foreach ($types as $type) {
689  if ($this->isAllowedInRepository($type) && (!$this->isAdministrationObject($type) || $incl_adm)) {
690  $rbac_types[] = $type;
691  }
692  }
693 
694  return $rbac_types;
695  }
696 
700  public function isAllowedInWorkspace(string $obj_name): bool
701  {
702  return (bool) ($this->obj_data[$obj_name]["workspace"] ?? false);
703  }
704 
708  public function isAdministrationObject(string $obj_name): bool
709  {
710  return (bool) ($this->obj_data[$obj_name]['administration'] ?? false);
711  }
712 
716  public function isInactivePlugin(string $type): bool
717  {
718  if (substr($type, 0, 1) == "x" && !$this->isPlugin($type)) {
719  return true;
720  }
721  return false;
722  }
723 
727  public function getAdvancedMetaDataTypes(): array
728  {
729  $amet = [];
730  foreach ($this->obj_data as $k => $v) {
731  if ($v["amet"] ?? false) {
732  $amet[] = ["obj_type" => $k, "sub_type" => ""];
733  }
734  }
735 
736  foreach ($this->sub_types as $type => $sub_types) {
737  foreach ($sub_types as $t) {
738  if ($t["amet"]) {
739  $amet[] = ["obj_type" => $type, "sub_type" => $t["sub_type"]];
740  }
741  }
742  }
743 
744  return $amet;
745  }
746 
752  public function getOrgUnitPermissionTypes(): array
753  {
754  $types = [];
755  foreach ($this->obj_data as $type => $object_info) {
756  if ($object_info['orgunit_permissions']) {
757  $types[] = $type;
758  }
759  }
760  return $types;
761  }
762 
767  public function getLTIProviderTypes(): array
768  {
769  $types = [];
770  foreach ($this->obj_data as $type => $object_info) {
771  if (array_key_exists('lti_provider', $object_info) && $object_info['lti_provider']) {
772  $types[] = $type;
773  }
774  }
775  return $types;
776  }
777 
781  public function isOrgUnitPermissionType(string $obj_type): bool
782  {
783  return in_array($obj_type, $this->getOrgUnitPermissionTypes());
784  }
785 
789  public function getPositionByType(string $type): int
790  {
791  if ($this->settings->get("obj_add_new_pos_" . $type) > 0) {
792  return (int) $this->settings->get("obj_add_new_pos_" . $type);
793  }
794  return (int) $this->obj_data[$type]["default_pos"];
795  }
796 
800  public function getPlugins(): array
801  {
802  $plugins = [];
803  foreach ($this->obj_data as $type => $pl_data) {
804  if ($this->isPlugin($type)) {
805  $plugins[$type] = $pl_data;
806  }
807  }
808  return $plugins;
809  }
810 
814  public function getExplorerContainerTypes(): array
815  {
816  $res = $grp_map = $cnt_grp = [];
817 
818  // all repository object types
819  foreach ($this->getSubObjectsRecursively("root") as $rtype) {
820  $type = $rtype["name"];
821 
822  if ($type == "rolf") {
823  continue;
824  }
825 
826  // gather group data
827  $type_grp = $this->getGroupOfObj($type);
828  if ($type_grp) {
829  $grp_map[$type_grp][] = $type;
830  }
831 
832  // add basic container types
833  if ($this->isContainer($type)) {
834  if ($type_grp) {
835  $cnt_grp[] = $type_grp;
836  }
837 
838  $res[] = $type;
839  }
840  }
841 
842  // add complete groups (cat => rcat, catr; crs => rcrs, crsr; ...)
843  foreach ($cnt_grp as $grp) {
844  $res = array_merge($res, $grp_map[$grp]);
845  }
846  $res[] = "itgr";
847 
848  return array_unique($res);
849  }
850 
854  public function supportsOfflineHandling(string $obj_type): bool
855  {
856  return (bool) ($this->obj_data[$obj_type]['offline_handling'] ?? false);
857  }
858 
859 
864  protected function readPluginData(): void
865  {
866  $this->parsePluginData("robj", false);
867  $this->parsePluginData("orguext", true);
868  }
869 
875  protected function parsePluginData(string $slotId, bool $isInAdministration): void
876  {
877  $plugins = $this->component_repository->getPluginSlotById($slotId)->getActivePlugins();
878  foreach ($plugins as $plugin) {
879  $pl_id = $plugin->getId();
880  if ($pl_id != "" && !isset($this->obj_data[$pl_id])) {
881  $loc = $plugin->getPath() . "/classes";
882  // The plugin_id is the same as the type_id in repository object plugins.
884 
885  $this->obj_data[$pl_id] = [
886  "name" => $pl_id,
887  "class_name" => $pl->getPluginName(),
888  "plugin" => "1",
889  "location" => $loc,
890  "checkbox" => "1",
891  "inherit" => "0",
892  "component" => "",
893  "translate" => "0",
894  "devmode" => "0",
895  "allow_link" => "1",
896  "allow_copy" => $pl->allowCopy() ? '1' : '0',
897  "rbac" => "1",
898  "group" => null,
899  "system" => "0",
900  "default_pos" => "99992000", // "unassigned" group
901  'repository' => '1',
902  'workspace' => '0',
903  'administration' => $isInAdministration ? '1' : '0',
904  "sideblock" => "0",
905  'export' => $plugin->supportsExport(),
906  'offline_handling' => '0',
907  'orgunit_permissions' => $pl->useOrguPermissions() ? '1' : '0'
908  ];
909 
910  $parent_types = $pl->getParentTypes();
911  foreach ($parent_types as $parent_type) {
912  $this->obj_data[$parent_type]["subobjects"][$pl_id] = [
913  "name" => $pl_id,
914  "max" => "",
915  "lng" => $pl_id,
916  "plugin" => true
917  ];
918  }
919  }
920  }
921  }
922 }
getSubObjects(string $obj_type, bool $filter=true)
get all sub objects by type
$res
Definition: ltiservices.php:69
static getComponentForType(string $obj_type)
Get component for object type.
Readable part of repository interface to ilComponentDataDB.
static getGroupedPluginObjectTypes(array $grouped_obj, string $slotId)
$context
Definition: webdav.php:31
getSubobjectsToFilter(string $obj_type="adm")
get all subjects except (rolf) of the adm object This is necessary for filtering these objects in rol...
isSystemObject(string $obj_name)
checks if object type is a system object
isActivePluginType(string $type)
Returns true if the given type is an active type of repositoryObject or Organisation Unit Extension p...
const ROOT_FOLDER_ID
Definition: constants.php:32
isAdministrationObject(string $obj_name)
Check if administration object.
readDefinitionData()
Read object definition data.
isOrgUnitPermissionType(string $obj_type)
Check if object type offers org unit position support.
allowLink(string $obj_name)
checks if linking of an object type is allowed
getAdvancedMetaDataTypes()
Get advanced meta data objects.
isContainer(string $obj_name)
Check if object type is container (&#39;crs&#39;,&#39;fold&#39;,&#39;grp&#39; ...)
getPositionByType(string $type)
Get Position By Object Type.
getOrgUnitPermissionTypes()
Get object type with org unit position permission support.
getGroupOfObj(string $obj_name)
Get Group of object type.
isRBACObject(string $obj_name)
get RBAC status by type returns true if object type is a RBAC object type
static getCreatableSubObjects(array $subobjects, $ref_id)
Filter the list of possible subobjects for the objects that actually could be created on a concrete n...
getSideBlockTypes(bool $filter_repository_types=true)
allowCopy(string $obj_name)
checks if copying of an object type is allowed
stopInheritance(string $obj_name)
Does object permits stopping inheritance?
getAllRepositoryTypes(bool $incl_adm=false)
get all RBAC object types
getCreatableSubObjects(string $obj_type, int $context=self::MODE_REPOSITORY, int $parent_ref_id=null)
isAllowedInWorkspace(string $obj_name)
checks if object type can be used in workspace context
hasCheckbox(string $obj_name)
should the object get a checkbox (needed for &#39;cut&#39;,&#39;copy&#39; ...)
ilComponentRepository $component_repository
handlerCharacterData($xml_parser, string $data)
global $DIC
Definition: feed.php:28
parses the objects.xml it handles the xml-description of all ilias objects
getDevMode(string $obj_name)
get dev mode status by type
handlerEndTag($xml_parser, string $name)
isAllowedInRepository(string $obj_name)
checks if object type can be used in repository context
getPluginSlotById(string $id)
Get pluginslot by id.
isPluginTypeName(string $str)
Check if given type is a plugin type name (starts with an "x")
string $key
Consumer key/client ID value.
Definition: System.php:193
handlerBeginTag($xml_parser, string $name, array $attribs)
getClassName(string $obj_name)
isSideBlock(string $obj_name)
Check, whether object type is a side block.
supportsOfflineHandling(string $obj_type)
check whether obj_type supports centralised offline handling
getSubObjectsRecursively(string $obj_type, bool $include_source_obj=true, bool $add_admin_objects=false)
Get all sub objects by type.
getTranslationType(string $obj_name)
get translation type (sys, db or null)
isInactivePlugin(string $type)
Check whether type belongs to inactive plugin.
static getPluginObjectByType(string $type)
Return either a repoObject plugin or a orgunit extension plugin or null if the type is not a plugin...
getAllObjects()
get all object types
static getGroupedRepositoryObjectTypes($parent_obj_type)
parsePluginData(string $slotId, bool $isInAdministration)
loads a single plugin definition into the object definition
getSubObjectsAsString(string $obj_type)
get a string of all sub objects by type
getLTIProviderTypes()
Get object types which offer lti provider support.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
getGroup(string $id)
Get Group information.
hasLocalRoles(string $obj_type)
Check whether the creation of local roles is allowed Currently disabled for type "root" and "adm"...
isPlugin(string $obj_name)
get RBAC status by type returns true if object type is an (activated) plugin type ...
static getRepositoryObjectTypesForComponent(string $component_type, string $component_name)
Get all repository object types of component.
readPluginData()
Loads the different plugins into the object definition.
getExplorerContainerTypes()
Get all object types which are defined as container in an explorer context.
getDevModeAll()
get all object types in dev mode
__filterObjects(array &$sub_objects)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
getPlugins()
Get plugin object info.