ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjectDefinition Class Reference

parses the objects.xml it handles the xml-description of all ilias objects More...

+ Collaboration diagram for ilObjectDefinition:

Public Member Functions

 __construct ()
 Constructor. More...
 
 readDefinitionData ()
 Read object definition data. More...
 
 getClassName ($a_obj_name)
 get class name by type More...
 
 getLocation ($a_obj_name)
 get location by type More...
 
 getGroup ($a_id)
 Get Group information. More...
 
 getGroupOfObj ($a_obj_name)
 Get Group of object type. More...
 
 hasCheckbox ($a_obj_name)
 should the object get a checkbox (needed for 'cut','copy' ...) More...
 
 getTranslationType ($a_obj_name)
 get translation type (sys, db or 0)s More...
 
 stopInheritance ($a_obj_name)
 Does object permits stopping inheritance? More...
 
 getDevMode ($a_obj_name)
 get devmode status by type More...
 
 getDevModeAll ()
 get all object types in devmode More...
 
 isRBACObject ($a_obj_name)
 get RBAC status by type returns true if object type is a RBAC object type More...
 
 isPlugin ($a_obj_name)
 get RBAC status by type returns true if object type is an (activated) plugin type More...
 
 isPluginTypeName ($a_str)
 Check if given type is a plugin type name (starts with an "x") More...
 
 isActivePluginType ($type)
 Returns true iff the given type is an active type of a repositoryObject or Organisation Unit Extension plugin. More...
 
 getAllRBACObjects ()
 get all RBAC object types More...
 
 getAllObjects ()
 get all object types More...
 
 allowLink ($a_obj_name)
 checks if linking of an object type is allowed More...
 
 allowCopy ($a_obj_name)
 checks if copying of an object type is allowed More...
 
 allowExport ($a_obj_name)
 
 hasLocalRoles ($a_obj_type)
 Check whether the creation of local roles is allowed Currently disabled for type "root" and "adm". More...
 
 getSubObjects ($a_obj_type, $a_filter=true)
 get all subobjects by type More...
 
 getSubObjectsRecursively ($a_obj_type, $a_include_source_obj=true, $a_add_admin_objects=false)
 Get all subobjects by type. More...
 
 getSubobjectsToFilter ($a_obj_type="adm")
 get all subjects except (rolf) of the adm object This is necessary for filtering these objects in role perm view. More...
 
 getCreatableSubObjects ($a_obj_type, $a_context=self::MODE_REPOSITORY, $a_parent_ref_id=null)
 get only creatable subobjects by type More...
 
 getSubObjectsAsString ($a_obj_type)
 get a string of all subobjects by type More...
 
 isContainer ($a_obj_name)
 Check if object type is container ('crs','fold','grp' ...) More...
 
 setHandlers ($a_xml_parser)
 set event handler More...
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 start tag handler More...
 
 handlerCharacterData ($a_xml_parser, $a_data)
 end tag handler More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 end tag handler More...
 
 __filterObjects (&$subobjects)
 
 isSystemObject ($a_obj_name)
 checks if object type is a system object More...
 
 isSideBlock ($a_obj_name)
 Check, whether object type is a side block. More...
 
 getSideBlockTypes (bool $filter_repository_types=true)
 
 isAllowedInRepository ($a_obj_name)
 checks if object type can be used in repository context More...
 
 getAllRepositoryTypes ($a_incl_adm=false)
 get all RBAC object types More...
 
 isAllowedInWorkspace ($a_obj_name)
 checks if object type can be used in workspace context More...
 
 isAdministrationObject ($a_obj_name)
 Check if administration object. More...
 
 isInactivePlugin ($a_type)
 Check whether type belongs to inactive plugin. More...
 
 getAdvancedMetaDataTypes ()
 Get advanced meta data objects. More...
 
 getOrgUnitPermissionTypes ()
 Get object type with orgunit position permission support. More...
 
 getLTIProviderTypes ()
 Get object types which offer lti provider support. More...
 
 isOrgUnitPermissionType ($a_obj_type)
 Check if object type offers orgunit position support. More...
 
 getPositionByType ($a_type)
 Get Position By Object Type. More...
 
 getPlugins ()
 Get plugin object info. More...
 
 getExplorerContainerTypes ()
 Get all object types which are defined as container in an explorer context. More...
 
 supportsOfflineHandling ($a_obj_type)
 check whether obj_type supports centralised offline handling More...
 

Static Public Member Functions

static getRepositoryObjectTypesForComponent ( $a_component_type, $a_component_name)
 Get all repository object types of component. More...
 
static getComponentForType ($a_obj_type)
 Get component for object type. More...
 
static getGroupedRepositoryObjectTypes ($a_parent_obj_type)
 

Data Fields

 $obj_id
 
 $parent
 
 $obj_data
 
 $sub_types = array()
 
const MODE_REPOSITORY = 1
 
const MODE_WORKSPACE = 2
 
const MODE_ADMINISTRATION = 3
 

Protected Member Functions

 readDefinitionDataFromCache ()
 
 readDefinitionDataFromDB ()
 
 readPluginData ()
 Loads the different plugins into the object definition. More...
 
 parsePluginData ($component, $slotName, $slotId, $isInAdministration)
 loads a single plugin definition into the object definition More...
 

Static Protected Member Functions

static getGroupedPluginObjectTypes ($grouped_obj, $component, $slotName, $slotId)
 

Protected Attributes

 $plugin_admin
 
 $settings
 

Detailed Description

parses the objects.xml it handles the xml-description of all ilias objects

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilObjDefReader on il_object_def, il_object_subobj, il_object_group

Definition at line 15 of file class.ilObjectDefinition.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjectDefinition::__construct ( )

Constructor.

Definition at line 58 of file class.ilObjectDefinition.php.

References $DIC, readDefinitionData(), and settings().

59  {
60  global $DIC;
61 
62  $this->plugin_admin = $DIC["ilPluginAdmin"];
63  $this->settings = $DIC->settings();
64  $this->readDefinitionData();
65  }
settings()
Definition: settings.php:2
global $DIC
Definition: saml.php:7
readDefinitionData()
Read object definition data.
+ Here is the call graph for this function:

Member Function Documentation

◆ __filterObjects()

ilObjectDefinition::__filterObjects ( $subobjects)

Definition at line 791 of file class.ilObjectDefinition.php.

References $data, and $type.

Referenced by getSubObjects().

792  {
793  foreach ($subobjects as $type => $data) {
794  switch ($type) {
795  default:
796  // DO NOTHING
797  }
798  }
799  }
$type
$data
Definition: bench.php:6
+ Here is the caller graph for this function:

◆ allowCopy()

ilObjectDefinition::allowCopy (   $a_obj_name)

checks if copying of an object type is allowed

Parameters
stringobject type public

Definition at line 472 of file class.ilObjectDefinition.php.

473  {
474  return (bool) $this->obj_data[$a_obj_name]["allow_copy"];
475  }

◆ allowExport()

ilObjectDefinition::allowExport (   $a_obj_name)

Definition at line 477 of file class.ilObjectDefinition.php.

478  {
479  return (bool) $this->obj_data[$a_obj_name]['export'];
480  }

◆ allowLink()

ilObjectDefinition::allowLink (   $a_obj_name)

checks if linking of an object type is allowed

Parameters
stringobject type public

Definition at line 461 of file class.ilObjectDefinition.php.

462  {
463  return (bool) $this->obj_data[$a_obj_name]["allow_link"];
464  }

◆ getAdvancedMetaDataTypes()

ilObjectDefinition::getAdvancedMetaDataTypes ( )

Get advanced meta data objects.

Parameters

Definition at line 1013 of file class.ilObjectDefinition.php.

References $sub_types, $t, and $type.

1014  {
1015  $amet = array();
1016  foreach ($this->obj_data as $k => $v) {
1017  if ($v["amet"]) {
1018  $amet[] = array("obj_type" => $k, "sub_type" => "");
1019  }
1020  }
1021 
1022  foreach ($this->sub_types as $type => $sub_types) {
1023  foreach ($sub_types as $t) {
1024  if ($t["amet"]) {
1025  $amet[] = array("obj_type" => $type, "sub_type" => $t["sub_type"]);
1026  }
1027  }
1028  }
1029 
1030  return $amet;
1031  }
$type

◆ getAllObjects()

ilObjectDefinition::getAllObjects ( )

get all object types

public

Returns
array object types

Definition at line 450 of file class.ilObjectDefinition.php.

451  {
452  return array_keys($this->obj_data);
453  }

◆ getAllRBACObjects()

ilObjectDefinition::getAllRBACObjects ( )

get all RBAC object types

public

Returns
array object types set to development

Definition at line 431 of file class.ilObjectDefinition.php.

References $type, and isRBACObject().

432  {
433  $types = array_keys($this->obj_data);
434 
435  foreach ($types as $type) {
436  if ($this->isRBACObject($type)) {
437  $rbactypes[] = $type;
438  }
439  }
440 
441  return $rbactypes ? $rbactypes : array();
442  }
$type
isRBACObject($a_obj_name)
get RBAC status by type returns true if object type is a RBAC object type
+ Here is the call graph for this function:

◆ getAllRepositoryTypes()

ilObjectDefinition::getAllRepositoryTypes (   $a_incl_adm = false)

get all RBAC object types

public

Returns
array object types set to development

Definition at line 956 of file class.ilObjectDefinition.php.

References $type, isAdministrationObject(), and isAllowedInRepository().

957  {
958  $types = array_keys($this->obj_data);
959 
960  foreach ($types as $type) {
961  if ($this->isAllowedInRepository($type) &&
962  (!$this->isAdministrationObject($type) || $a_incl_adm)) {
963  $rbactypes[] = $type;
964  }
965  }
966 
967  return $rbactypes ? $rbactypes : array();
968  }
$type
isAllowedInRepository($a_obj_name)
checks if object type can be used in repository context
isAdministrationObject($a_obj_name)
Check if administration object.
+ Here is the call graph for this function:

◆ getClassName()

ilObjectDefinition::getClassName (   $a_obj_name)

get class name by type

Parameters
stringobject type public

Definition at line 247 of file class.ilObjectDefinition.php.

248  {
249  return $this->obj_data[$a_obj_name]["class_name"];
250  }

◆ getComponentForType()

static ilObjectDefinition::getComponentForType (   $a_obj_type)
static

Get component for object type.

Definition at line 881 of file class.ilObjectDefinition.php.

References $DIC, and $ilDB.

882  {
883  global $DIC;
884 
885  $ilDB = $DIC->database();
886 
887  $set = $ilDB->queryF(
888  "SELECT component FROM il_object_def WHERE id = %s",
889  array("text"),
890  array($a_obj_type)
891  );
892 
893  if ($rec = $ilDB->fetchAssoc($set)) {
894  return $rec["component"];
895  }
896 
897  return "";
898  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ getCreatableSubObjects()

ilObjectDefinition::getCreatableSubObjects (   $a_obj_type,
  $a_context = self::MODE_REPOSITORY,
  $a_parent_ref_id = null 
)

get only creatable subobjects by type

Parameters
stringobject type
integercontext
integerparent_ref_id public
Returns
array list of createable object types

Definition at line 658 of file class.ilObjectDefinition.php.

References $sub_types, $type, ilObjStudyProgramme\getCreatableSubObjects(), getDevMode(), getSubObjects(), isAdministrationObject(), isAllowedInRepository(), isAllowedInWorkspace(), and isSystemObject().

659  {
660  $subobjects = $this->getSubObjects($a_obj_type);
661 
662  // remove role folder object from list
663  unset($subobjects["rolf"]);
664 
665  $sub_types = array_keys($subobjects);
666 
667  // remove object types in development from list
668  foreach ($sub_types as $type) {
669  if ($this->getDevMode($type) || $this->isSystemObject($type)) {
670  unset($subobjects[$type]);
671  }
672  if ($a_context == self::MODE_REPOSITORY && !$this->isAllowedInRepository($type)) {
673  unset($subobjects[$type]);
674  }
675  if ($a_context == self::MODE_WORKSPACE && !$this->isAllowedInWorkspace($type)) {
676  unset($subobjects[$type]);
677  }
678  if ($a_context == self::MODE_ADMINISTRATION && !$this->isAdministrationObject($type)) {
679  unset($subobjects[$type]);
680  }
681  }
682 
683  if ($a_obj_type == "prg") {
684  // ask study program which objects are allowed to create on the concrete node.
685  require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
686  return ilObjStudyProgramme::getCreatableSubObjects($subobjects, $a_parent_ref_id);
687  }
688 
689  return $subobjects;
690  }
$type
isAllowedInRepository($a_obj_name)
checks if object type can be used in repository context
isAdministrationObject($a_obj_name)
Check if administration object.
isSystemObject($a_obj_name)
checks if object type is a system object
getSubObjects($a_obj_type, $a_filter=true)
get all subobjects by type
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...
getDevMode($a_obj_name)
get devmode status by type
isAllowedInWorkspace($a_obj_name)
checks if object type can be used in workspace context
+ Here is the call graph for this function:

◆ getDevMode()

ilObjectDefinition::getDevMode (   $a_obj_name)

get devmode status by type

Parameters
stringobject type public

Definition at line 343 of file class.ilObjectDefinition.php.

Referenced by getCreatableSubObjects(), getDevModeAll(), and getSubObjectsRecursively().

344  {
345  return (bool) $this->obj_data[$a_obj_name]["devmode"];
346  }
+ Here is the caller graph for this function:

◆ getDevModeAll()

ilObjectDefinition::getDevModeAll ( )

get all object types in devmode

public

Returns
array object types set to development

Definition at line 354 of file class.ilObjectDefinition.php.

References $type, and getDevMode().

355  {
356  $types = array_keys($this->obj_data);
357 
358  foreach ($types as $type) {
359  if ($this->getDevMode($type)) {
360  $devtypes[] = $type;
361  }
362  }
363 
364  return $devtypes ? $devtypes : array();
365  }
$type
getDevMode($a_obj_name)
get devmode status by type
+ Here is the call graph for this function:

◆ getExplorerContainerTypes()

ilObjectDefinition::getExplorerContainerTypes ( )

Get all object types which are defined as container in an explorer context.

Returns
array

Definition at line 1108 of file class.ilObjectDefinition.php.

References $res, $type, getGroupOfObj(), getSubObjectsRecursively(), and isContainer().

1109  {
1110  $res = $grp_map = $cnt_grp = array();
1111 
1112  // all repository object types
1113  foreach ($this->getSubObjectsRecursively("root") as $rtype) {
1114  $type = $rtype["name"];
1115 
1116  // obsolete
1117  if ($type == "rolf") {
1118  continue;
1119  }
1120 
1121  // gather group data
1122  $type_grp = $this->getGroupOfObj($type);
1123  if ($type_grp) {
1124  $grp_map[$type_grp][] = $type;
1125  }
1126 
1127  // add basic container types
1128  if ($this->isContainer($type)) {
1129  // add to cnt_grp
1130  if ($type_grp) {
1131  $cnt_grp[] = $type_grp;
1132  }
1133 
1134  $res[] = $type;
1135  }
1136  }
1137 
1138  // add complete groups (cat => rcat, catr; crs => rcrs, crsr; ...)
1139  foreach ($cnt_grp as $grp) {
1140  $res = array_merge($res, $grp_map[$grp]);
1141  }
1142 
1143  // add very special case
1144  // outcommented, see bug #25662
1145  // $res[] = "itgr";
1146 
1147  return array_unique($res);
1148  }
$type
getGroupOfObj($a_obj_name)
Get Group of object type.
foreach($_POST as $key=> $value) $res
getSubObjectsRecursively($a_obj_type, $a_include_source_obj=true, $a_add_admin_objects=false)
Get all subobjects by type.
isContainer($a_obj_name)
Check if object type is container ('crs','fold','grp' ...)
+ Here is the call graph for this function:

◆ getGroup()

ilObjectDefinition::getGroup (   $a_id)

Get Group information.

Definition at line 267 of file class.ilObjectDefinition.php.

268  {
269  return $this->obj_group[$a_id];
270  }

◆ getGroupedPluginObjectTypes()

static ilObjectDefinition::getGroupedPluginObjectTypes (   $grouped_obj,
  $component,
  $slotName,
  $slotId 
)
staticprotected
Parameters
$grouped_obj
$component
$slotName
$slotId
$plugin_id
Returns
mixed

Definition at line 219 of file class.ilObjectDefinition.php.

References $DIC, and ilPlugin\lookupIdForName().

220  {
221  global $DIC;
222 
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");
227  $pl_id = ilPlugin::lookupIdForName($component, $slotName, $slotId, $pl_name);
228  if (!isset($grouped_obj[$pl_id])) {
229  $grouped_obj[$pl_id] = array(
230  "pos" => "99992000", // "unassigned" group
231  "objs" => array(0 => $pl_id)
232  );
233  }
234  }
235  return $grouped_obj;
236  }
global $DIC
Definition: saml.php:7
static lookupIdForName(string $a_ctype, string $a_cname, string $a_slot_id, string $a_plugin_name)
+ Here is the call graph for this function:

◆ getGroupedRepositoryObjectTypes()

static ilObjectDefinition::getGroupedRepositoryObjectTypes (   $a_parent_obj_type)
static
Parameters
$a_parent_obj_type
Returns
array

Definition at line 904 of file class.ilObjectDefinition.php.

References $DIC, $ilDB, $ret, ilDBConstants\FETCHMODE_ASSOC, ilCachedComponentData\getInstance(), IL_COMP_MODULE, IL_COMP_SERVICE, and ilUtil\sortArray().

905  {
906  global $DIC;
907 
908  $ilDB = $DIC->database();
909 
910  $set = $ilDB->query("SELECT * FROM il_object_group");
911  $groups = array();
912  while ($gr_rec = $set->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
913  $groups[$gr_rec["id"]] = $gr_rec;
914  }
915 
916  $global_cache = ilCachedComponentData::getInstance();
917 
918  $recs = $global_cache->lookupGroupedRepObj($a_parent_obj_type);
919 
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"];
925  } else {
926  $grouped_obj[$rec["id"]]["pos"] = (int) $rec["default_pres_pos"];
927  $grouped_obj[$rec["id"]]["objs"][] = $rec["id"];
928  }
929  }
930  // now get objects from repository plugin
931  $grouped_obj = self::getGroupedPluginObjectTypes($grouped_obj, IL_COMP_SERVICE, "Repository", "robj");
932  $grouped_obj = self::getGroupedPluginObjectTypes($grouped_obj, IL_COMP_MODULE, "OrgUnit", "orguext");
933 
934  $ret = ilUtil::sortArray($grouped_obj, "pos", "asc", true, true);
935  return $ret;
936  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
global $DIC
Definition: saml.php:7
const IL_COMP_MODULE
global $ilDB
$ret
Definition: parser.php:6
const IL_COMP_SERVICE
+ Here is the call graph for this function:

◆ getGroupOfObj()

ilObjectDefinition::getGroupOfObj (   $a_obj_name)

Get Group of object type.

Definition at line 275 of file class.ilObjectDefinition.php.

Referenced by getExplorerContainerTypes().

276  {
277  return $this->obj_data[$a_obj_name]["group"];
278  }
+ Here is the caller graph for this function:

◆ getLocation()

ilObjectDefinition::getLocation (   $a_obj_name)

get location by type

Parameters
stringobject type public

Definition at line 259 of file class.ilObjectDefinition.php.

260  {
261  return $this->obj_data[$a_obj_name]["location"];
262  }

◆ getLTIProviderTypes()

ilObjectDefinition::getLTIProviderTypes ( )

Get object types which offer lti provider support.

Returns
string[] $types

Definition at line 1052 of file class.ilObjectDefinition.php.

References $type.

1053  {
1054  $types = [];
1055  foreach ($this->obj_data as $type => $object_info) {
1056  if ($object_info['lti_provider']) {
1057  $types[] = $type;
1058  }
1059  }
1060  return $types;
1061  }
$type

◆ getOrgUnitPermissionTypes()

ilObjectDefinition::getOrgUnitPermissionTypes ( )

Get object type with orgunit position permission support.

Returns
string[] $types

Definition at line 1037 of file class.ilObjectDefinition.php.

References $type.

Referenced by isOrgUnitPermissionType().

1038  {
1039  $types = [];
1040  foreach ($this->obj_data as $type => $object_info) {
1041  if ($object_info['orgunit_permissions']) {
1042  $types[] = $type;
1043  }
1044  }
1045  return $types;
1046  }
$type
+ Here is the caller graph for this function:

◆ getPlugins()

ilObjectDefinition::getPlugins ( )

Get plugin object info.

Returns
type

Definition at line 1092 of file class.ilObjectDefinition.php.

References $type, and isPlugin().

1093  {
1094  $plugins = array();
1095  foreach ((array) $this->obj_data as $type => $pl_data) {
1096  if ($this->isPlugin($type)) {
1097  $plugins[$type] = $pl_data;
1098  }
1099  }
1100  return $plugins;
1101  }
$type
isPlugin($a_obj_name)
get RBAC status by type returns true if object type is an (activated) plugin type ...
+ Here is the call graph for this function:

◆ getPositionByType()

ilObjectDefinition::getPositionByType (   $a_type)

Get Position By Object Type.

Parameters
$a_type
Returns
int

Definition at line 1079 of file class.ilObjectDefinition.php.

References $a_type, $ilSetting, and $settings.

1080  {
1082 
1083  return ($ilSetting->get("obj_add_new_pos_" . $a_type) > 0)
1084  ? (int) $ilSetting->get("obj_add_new_pos_" . $a_type)
1085  : (int) $this->obj_data[$a_type]["default_pos"];
1086  }
$a_type
Definition: workflow.php:92
global $ilSetting
Definition: privfeed.php:17

◆ getRepositoryObjectTypesForComponent()

static ilObjectDefinition::getRepositoryObjectTypesForComponent (   $a_component_type,
  $a_component_name 
)
static

Get all repository object types of component.

Definition at line 854 of file class.ilObjectDefinition.php.

References $DIC, and $ilDB.

857  {
858  global $DIC;
859 
860  $ilDB = $DIC->database();
861 
862  $set = $ilDB->queryF(
863  "SELECT * FROM il_object_def WHERE component = %s",
864  array("text"),
865  array($a_component_type . "/" . $a_component_name)
866  );
867 
868  $types = array();
869  while ($rec = $ilDB->fetchAssoc($set)) {
870  if ($rec["system"] != 1) {
871  $types[] = $rec;
872  }
873  }
874 
875  return $types;
876  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ getSideBlockTypes()

ilObjectDefinition::getSideBlockTypes ( bool  $filter_repository_types = true)
Parameters
bool$filter_repository_types
Returns
string[]

Definition at line 834 of file class.ilObjectDefinition.php.

References $type, isAllowedInRepository(), and isSideBlock().

834  : array
835  {
836  $side_block_types = [];
837  foreach (array_keys($this->obj_data) as $type) {
838  if (
839  $filter_repository_types &&
840  !$this->isAllowedInRepository($type)
841  ) {
842  continue;
843  }
844  if ($this->isSideBlock($type)) {
845  $side_block_types[] = $type;
846  }
847  }
848  return $side_block_types;
849  }
$type
isAllowedInRepository($a_obj_name)
checks if object type can be used in repository context
isSideBlock($a_obj_name)
Check, whether object type is a side block.
+ Here is the call graph for this function:

◆ getSubObjects()

ilObjectDefinition::getSubObjects (   $a_obj_type,
  $a_filter = true 
)

get all subobjects by type

Parameters
stringobject type
booleanfilter disabled objects? (default: true) public
Returns
array list of allowed object types

Definition at line 506 of file class.ilObjectDefinition.php.

References $data, $ilSetting, $settings, __filterObjects(), and ilUtil\sortArray().

Referenced by getCreatableSubObjects(), and getSubObjectsRecursively().

507  {
509 
510  $subs = array();
511 
512  if ($subobjects = $this->obj_data[$a_obj_type]["subobjects"]) {
513  // Filter some objects e.g chat object are creatable if chat is active
514  if ($a_filter) {
515  $this->__filterObjects($subobjects);
516  }
517  foreach ($subobjects as $data => $sub) {
518  if ($sub["module"] != "n") {
519  if (!($ilSetting->get("obj_dis_creation_" . $data))) {
520  $subs[$data] = $sub;
521 
522  // determine position
523  $pos = ($ilSetting->get("obj_add_new_pos_" . $data) > 0)
524  ? (int) $ilSetting->get("obj_add_new_pos_" . $data)
525  : (int) $this->obj_data[$data]["default_pos"];
526  $subs[$data]["pos"] = $pos;
527  }
528  }
529  }
530 
531  $subs2 = ilUtil::sortArray($subs, "pos", 'ASC', true, true);
532 
533  return $subs2;
534  }
535 
536  return $subs;
537  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
global $ilSetting
Definition: privfeed.php:17
$data
Definition: bench.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubObjectsAsString()

ilObjectDefinition::getSubObjectsAsString (   $a_obj_type)

get a string of all subobjects by type

Parameters
stringobject type public

Definition at line 698 of file class.ilObjectDefinition.php.

References $data.

699  {
700  $string = "";
701 
702  if (is_array($this->obj_data[$a_obj_type]["subobjects"])) {
703  $data = array_keys($this->obj_data[$a_obj_type]["subobjects"]);
704 
705  $string = "'" . implode("','", $data) . "'";
706  }
707 
708  return $string;
709  }
$data
Definition: bench.php:6

◆ getSubObjectsRecursively()

ilObjectDefinition::getSubObjectsRecursively (   $a_obj_type,
  $a_include_source_obj = true,
  $a_add_admin_objects = false 
)

Get all subobjects by type.

This function returns all subobjects allowed by the provided object type and all its subobject types recursively.

This function is used to create local role templates. It is important, that we do not filter out any objects here!

Parameters
stringobject type public
Returns
array list of allowed object types

Definition at line 552 of file class.ilObjectDefinition.php.

References $data, $ilSetting, $settings, $type, getDevMode(), getSubObjects(), isRBACObject(), and ilUtil\sortArray().

Referenced by getExplorerContainerTypes().

553  {
555 
556  // This associative array is used to collect all subobject types.
557  // key=>type, value=data
558  $recursivesubs = array();
559 
560  // This array is used to keep track of the object types, we
561  // need to call function getSubobjects() for.
562  $to_do = array($a_obj_type);
563 
564  // This array is used to keep track of the object types, we
565  // have called function getSubobjects() already. This is to
566  // prevent endless loops, for object types that support
567  // themselves as subobject types either directly or indirectly.
568  $done = array();
569 
570  while (count($to_do) > 0) {
571  $type = array_pop($to_do);
572  $done[] = $type;
573 
574  // no recovery folder subitems
575  if ($type == 'recf') {
576  continue;
577  }
578 
579  // Hide administration if desired
580  if (!$a_add_admin_objects and $type == 'adm') {
581  $subs = array();
582  } else {
583  $subs = $this->getSubObjects($type);
584  }
585  #vd('xxxxxxxxxxxxx'.$type);
586  foreach ($subs as $subtype => $data) {
587  #vd('------------------------->'.$subtype);
588 
589  // Hide role templates and folder from view
590  if ($this->getDevMode($subtype) or !$this->isRBACObject($subtype)) {
591  continue;
592  }
593  if ($subtype == 'rolt') {
594  continue;
595  }
596  if (!$a_add_admin_objects and $subtype == 'adm') {
597  continue;
598  }
599 
600  $recursivesubs[$subtype] = $data;
601  if (!in_array($subtype, $done)
602  && !in_array($subtype, $to_do)) {
603  $to_do[] = $subtype;
604  }
605  }
606  }
607 
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;
614  }
615  }
616  return ilUtil::sortArray($recursivesubs, "pos", 'ASC', true, true);
617  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
$type
getSubObjects($a_obj_type, $a_filter=true)
get all subobjects by type
getDevMode($a_obj_name)
get devmode status by type
global $ilSetting
Definition: privfeed.php:17
isRBACObject($a_obj_name)
get RBAC status by type returns true if object type is a RBAC object type
$data
Definition: bench.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubobjectsToFilter()

ilObjectDefinition::getSubobjectsToFilter (   $a_obj_type = "adm")

get all subjects except (rolf) of the adm object This is necessary for filtering these objects in role perm view.

e.g It it not necessary to view/edit role permission for the usrf object since it's not possible to create a new one

Parameters
stringobject type public
Returns
array list of object types to filter

Definition at line 629 of file class.ilObjectDefinition.php.

References $key.

630  {
631  foreach ($this->obj_data[$a_obj_type]["subobjects"] as $key => $value) {
632  switch ($key) {
633  case "rolf":
634  case "orgu":
635  // DO NOTHING
636  break;
637 
638  default:
639  $tmp_subs[] = $key;
640  }
641  }
642  // ADD adm and root object
643  $tmp_subs[] = "adm";
644  #$tmp_subs[] = "root";
645 
646  return $tmp_subs ? $tmp_subs : array();
647  }
$key
Definition: croninfo.php:18

◆ getTranslationType()

ilObjectDefinition::getTranslationType (   $a_obj_name)

get translation type (sys, db or 0)s

Parameters
stringobject type public

Definition at line 297 of file class.ilObjectDefinition.php.

References $DIC, $ilDB, and ilDBConstants\FETCHMODE_ASSOC.

298  {
299  global $DIC;
300 
301  $ilDB = $DIC->database();
302 
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);
308  $rec = $set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
309  if ($rec["cnt"] > 0) {
310  $this->root_trans_type = "db";
311  } else {
312  $this->root_trans_type = $this->obj_data[$a_obj_name]["translate"];
313  }
314  }
315  return $this->root_trans_type;
316  }
317 
318  if (isset($this->obj_data[$a_obj_name])) {
319  return $this->obj_data[$a_obj_name]["translate"];
320  }
321 
322  return "";
323  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ handlerBeginTag()

ilObjectDefinition::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

start tag handler

Parameters
ressouceinternal xml_parser_handler
stringelement tag name
arrayelement attributes private

Definition at line 750 of file class.ilObjectDefinition.php.

751  {
752  switch ($a_name) {
753  case 'object':
754  $this->parent_tag_name = $a_attribs["name"];
755  break;
756  case 'property':
757  $this->current_tag = "property";
758  $this->current_tag_name = $a_attribs["name"];
759 // $this->obj_data[$this->parent_tag_name]["properties"][$this->current_tag_name]["name"] = $a_attribs["name"];
760  $this->obj_data[$this->parent_tag_name]["properties"][$this->current_tag_name]["module"] = $a_attribs["module"];
761 //echo '<br>$this->obj_data["'.$this->parent_tag_name.'"]["properties"]["'.$this->current_tag_name.'"]["module"] = "'.$a_attribs["module"].'";';
762  break;
763  }
764  }

◆ handlerCharacterData()

ilObjectDefinition::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

end tag handler

Parameters
ressouceinternal xml_parser_handler
stringdata private

Definition at line 773 of file class.ilObjectDefinition.php.

774  {
775  }

◆ handlerEndTag()

ilObjectDefinition::handlerEndTag (   $a_xml_parser,
  $a_name 
)

end tag handler

Parameters
ressouceinternal xml_parser_handler
stringelement tag name private

Definition at line 784 of file class.ilObjectDefinition.php.

785  {
786  $this->current_tag = '';
787  $this->current_tag_name = '';
788  }

◆ hasCheckbox()

ilObjectDefinition::hasCheckbox (   $a_obj_name)

should the object get a checkbox (needed for 'cut','copy' ...)

Parameters
stringobject type public

Definition at line 286 of file class.ilObjectDefinition.php.

287  {
288  return (bool) $this->obj_data[$a_obj_name]["checkbox"];
289  }

◆ hasLocalRoles()

ilObjectDefinition::hasLocalRoles (   $a_obj_type)

Check whether the creation of local roles is allowed Currently disabled for type "root" and "adm".

Returns

Definition at line 487 of file class.ilObjectDefinition.php.

488  {
489  switch ($a_obj_type) {
490  case 'root':
491  return false;
492 
493  default:
494  return true;
495  }
496  }

◆ isActivePluginType()

ilObjectDefinition::isActivePluginType (   $type)

Returns true iff the given type is an active type of a repositoryObject or Organisation Unit Extension plugin.

Parameters
$type
Returns
bool

Definition at line 407 of file class.ilObjectDefinition.php.

References $plugin_admin, $type, IL_COMP_MODULE, IL_COMP_SERVICE, and ilPlugin\lookupNameForId().

408  {
409  $ilPluginAdmin = $this->plugin_admin;
410  $isRepoPlugin = $ilPluginAdmin->isActive(
412  "Repository",
413  "robj",
414  ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $type)
415  );
416  $isOrguPlugin = $ilPluginAdmin->isActive(
418  "OrgUnit",
419  "orguext",
420  ilPlugin::lookupNameForId(IL_COMP_MODULE, "OrgUnit", "orguext", $type)
421  );
422  return $isRepoPlugin || $isOrguPlugin;
423  }
$type
static lookupNameForId(string $a_ctype, string $a_cname, string $a_slot_id, string $a_plugin_id)
const IL_COMP_MODULE
const IL_COMP_SERVICE
+ Here is the call graph for this function:

◆ isAdministrationObject()

ilObjectDefinition::isAdministrationObject (   $a_obj_name)

Check if administration object.

Parameters
string$a_obj_name
Returns
bool

Definition at line 988 of file class.ilObjectDefinition.php.

Referenced by getAllRepositoryTypes(), and getCreatableSubObjects().

989  {
990  return (bool) $this->obj_data[$a_obj_name]['administration'];
991  }
+ Here is the caller graph for this function:

◆ isAllowedInRepository()

ilObjectDefinition::isAllowedInRepository (   $a_obj_name)

checks if object type can be used in repository context

Parameters
stringobject type public
Returns
bool

Definition at line 945 of file class.ilObjectDefinition.php.

Referenced by getAllRepositoryTypes(), getCreatableSubObjects(), and getSideBlockTypes().

946  {
947  return (bool) $this->obj_data[$a_obj_name]["repository"];
948  }
+ Here is the caller graph for this function:

◆ isAllowedInWorkspace()

ilObjectDefinition::isAllowedInWorkspace (   $a_obj_name)

checks if object type can be used in workspace context

Parameters
stringobject type public
Returns
bool

Definition at line 978 of file class.ilObjectDefinition.php.

Referenced by getCreatableSubObjects().

979  {
980  return (bool) $this->obj_data[$a_obj_name]["workspace"];
981  }
+ Here is the caller graph for this function:

◆ isContainer()

ilObjectDefinition::isContainer (   $a_obj_name)

Check if object type is container ('crs','fold','grp' ...)

public

Parameters
stringobject type
Returns
bool

Definition at line 719 of file class.ilObjectDefinition.php.

Referenced by getExplorerContainerTypes().

720  {
721  if (!is_array($this->obj_data[$a_obj_name]['subobjects'])) {
722  return false;
723  }
724  return count($this->obj_data[$a_obj_name]['subobjects']) >= 1 ? true : false;
725  }
+ Here is the caller graph for this function:

◆ isInactivePlugin()

ilObjectDefinition::isInactivePlugin (   $a_type)

Check whether type belongs to inactive plugin.

Parameters

Definition at line 999 of file class.ilObjectDefinition.php.

References $a_type, and isPlugin().

1000  {
1001  if (substr($a_type, 0, 1) == "x" && !$this->isPlugin($a_type)) {
1002  return true;
1003  }
1004  return false;
1005  }
$a_type
Definition: workflow.php:92
isPlugin($a_obj_name)
get RBAC status by type returns true if object type is an (activated) plugin type ...
+ Here is the call graph for this function:

◆ isOrgUnitPermissionType()

ilObjectDefinition::isOrgUnitPermissionType (   $a_obj_type)

Check if object type offers orgunit position support.

Parameters
string$obj_type
Returns
bool

Definition at line 1068 of file class.ilObjectDefinition.php.

References getOrgUnitPermissionTypes().

1069  {
1070  return in_array($a_obj_type, $this->getOrgUnitPermissionTypes());
1071  }
getOrgUnitPermissionTypes()
Get object type with orgunit position permission support.
+ Here is the call graph for this function:

◆ isPlugin()

ilObjectDefinition::isPlugin (   $a_obj_name)

get RBAC status by type returns true if object type is an (activated) plugin type

Parameters
stringobject type public

Definition at line 386 of file class.ilObjectDefinition.php.

Referenced by getPlugins(), and isInactivePlugin().

387  {
388  return (bool) isset($this->obj_data[$a_obj_name]["plugin"]);
389  }
+ Here is the caller graph for this function:

◆ isPluginTypeName()

ilObjectDefinition::isPluginTypeName (   $a_str)

Check if given type is a plugin type name (starts with an "x")

Parameters
stringobject type public

Definition at line 397 of file class.ilObjectDefinition.php.

398  {
399  return (substr($a_str, 0, 1) == "x");
400  }

◆ isRBACObject()

ilObjectDefinition::isRBACObject (   $a_obj_name)

get RBAC status by type returns true if object type is a RBAC object type

Parameters
stringobject type public

Definition at line 374 of file class.ilObjectDefinition.php.

Referenced by getAllRBACObjects(), and getSubObjectsRecursively().

375  {
376  return (bool) $this->obj_data[$a_obj_name]["rbac"];
377  }
+ Here is the caller graph for this function:

◆ isSideBlock()

ilObjectDefinition::isSideBlock (   $a_obj_name)

Check, whether object type is a side block.

Parameters
stringobject type
Returns
boolean side block true/false

Definition at line 825 of file class.ilObjectDefinition.php.

Referenced by getSideBlockTypes().

826  {
827  return (bool) $this->obj_data[$a_obj_name]["sideblock"];
828  }
+ Here is the caller graph for this function:

◆ isSystemObject()

ilObjectDefinition::isSystemObject (   $a_obj_name)

checks if object type is a system object

system objects are those object types that are only used for internal purposes and to keep the object type model consistent. Typically they are used in the administation, exist only once and may contain only specific object types. To mark an object type as a system object type, use 'system=1' in the object definition in objects.xml

Parameters
stringobject type public

Definition at line 814 of file class.ilObjectDefinition.php.

Referenced by getCreatableSubObjects().

815  {
816  return (bool) $this->obj_data[$a_obj_name]["system"];
817  }
+ Here is the caller graph for this function:

◆ parsePluginData()

ilObjectDefinition::parsePluginData (   $component,
  $slotName,
  $slotId,
  $isInAdministration 
)
protected

loads a single plugin definition into the object definition

Parameters
$componentThe component e.g. IL_COMP_SERVICE
$slotNameThe Slot name, e.g. Repository
$slotIdthe slot id, e.g. robj
$isInAdministration,canthe object be created in the administration?

Definition at line 1182 of file class.ilObjectDefinition.php.

References $plugin_admin, ilPlugin\_getDirectory(), ilObjectPlugin\getPluginObjectByType(), and ilPlugin\lookupIdForName().

Referenced by readPluginData().

1183  {
1184  $ilPluginAdmin = $this->plugin_admin;
1185  $pl_names = $ilPluginAdmin->getActivePluginsForSlot($component, $slotName, $slotId);
1186  foreach ($pl_names as $pl_name) {
1187  include_once("./Services/Component/classes/class.ilPlugin.php");
1188  $pl_id = ilPlugin::lookupIdForName($component, $slotName, $slotId, $pl_name);
1189  if ($pl_id != "" && !isset($this->obj_data[$pl_id])) {
1190  include_once("./Services/Repository/classes/class.ilRepositoryObjectPlugin.php");
1191  $loc = ilPlugin::_getDirectory($component, $slotName, $slotId, $pl_name) . "/classes";
1192  // The plugin_id is the same as the type_id in repository object plugins.
1194 
1195  $this->obj_data[$pl_id] = array(
1196  "name" => $pl_id,
1197  "class_name" => $pl_name,
1198  "plugin" => "1",
1199  "location" => $loc,
1200  "checkbox" => "1",
1201  "inherit" => "0",
1202  "component" => "",
1203  "translate" => "0",
1204  "devmode" => "0",
1205  "allow_link" => "1",
1206  "allow_copy" => $pl->allowCopy() ? '1' : '0',
1207  "rbac" => "1",
1208  "group" => null,
1209  "system" => "0",
1210  "default_pos" => "99992000", // "unassigned" group
1211  'repository' => '1',
1212  'workspace' => '0',
1213  'administration' => $isInAdministration?'1':'0',
1214  "sideblock" => "0",
1215  'export' => $ilPluginAdmin->supportsExport($component, $slotName, $slotId, $pl_name),
1216  'offline_handling' => '0'
1217  );
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);
1221  }
1222  }
1223  }
1224  }
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)
static _getDirectory(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
Get plugin directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readDefinitionData()

ilObjectDefinition::readDefinitionData ( )

Read object definition data.

Definition at line 201 of file class.ilObjectDefinition.php.

References ilGlobalCache\COMP_COMPONENT, ilGlobalCache\getInstance(), readDefinitionDataFromCache(), and readDefinitionDataFromDB().

Referenced by __construct().

202  {
205  } else {
206  $this->readDefinitionDataFromDB();
207  }
208  }
static getInstance($component)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readDefinitionDataFromCache()

ilObjectDefinition::readDefinitionDataFromCache ( )
protected

Definition at line 68 of file class.ilObjectDefinition.php.

References ilCachedComponentData\getInstance(), and readPluginData().

Referenced by readDefinitionData().

69  {
70  $this->obj_data = array();
71  $defIds = array();
72  $global_cache = ilCachedComponentData::getInstance();
73  foreach ($global_cache->getIlobjectDef() as $rec) {
74  $this->obj_data[$rec["id"]] = array(
75  "name" => $rec["id"],
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), // "unassigned" group
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']
98  );
99  $this->obj_data[$rec["id"]]["subobjects"] = array();
100 
101  $defIds[] = $rec["id"];
102  }
103 
104  $subobj = $global_cache->lookupSubObjForParent($defIds);
105 
106  foreach ($subobj as $rec2) {
107  $max = $rec2["mmax"];
108  if ($max <= 0) {
109  $max = "";
110  }
111  $this->obj_data[$rec2["parent"]]["subobjects"][$rec2["subobj"]] = array(
112  "name" => $rec2["subobj"],
113  "max" => $max,
114  "lng" => $rec2["subobj"]
115  );
116  }
117  $this->obj_group = $global_cache->getIlObjectGroup();
118 
119  $this->readPluginData();
120 
121  $this->sub_types = $global_cache->getIlObjectSubType();
122  }
readPluginData()
Loads the different plugins into the object definition.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readDefinitionDataFromDB()

ilObjectDefinition::readDefinitionDataFromDB ( )
protected

Definition at line 125 of file class.ilObjectDefinition.php.

References $DIC, $ilDB, and readPluginData().

Referenced by readDefinitionData().

126  {
127  global $DIC;
128 
129  $ilDB = $DIC->database();
130 
131  $this->obj_data = array();
132 
133  // Select all object_definitions and collect the definition id's in
134  // this array.
135  $defIds = 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), // "unassigned" group
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']
162  );
163  $this->obj_data[$rec["id"]]["subobjects"] = array();
164 
165  $defIds[] = $rec["id"];
166  }
167 
168  // get all subobject definitions in a single query
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"];
172  if ($max <= 0) { // for backward compliance
173  $max = "";
174  }
175  $this->obj_data[$rec2["parent"]]["subobjects"][$rec2["subobj"]] = array(
176  "name" => $rec2["subobj"],
177  "max" => $max,
178  "lng" => $rec2["subobj"]
179  );
180  }
181 
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;
186  }
187 
188  $this->readPluginData();
189 
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;
194  }
195  }
global $DIC
Definition: saml.php:7
global $ilDB
readPluginData()
Loads the different plugins into the object definition.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readPluginData()

ilObjectDefinition::readPluginData ( )
protected

Loads the different plugins into the object definition.

Definition at line 1169 of file class.ilObjectDefinition.php.

References IL_COMP_MODULE, IL_COMP_SERVICE, and parsePluginData().

Referenced by readDefinitionDataFromCache(), and readDefinitionDataFromDB().

1170  {
1171  $this->parsePluginData(IL_COMP_SERVICE, "Repository", "robj", false);
1172  $this->parsePluginData(IL_COMP_MODULE, "OrgUnit", "orguext", true);
1173  }
const IL_COMP_MODULE
parsePluginData($component, $slotName, $slotId, $isInAdministration)
loads a single plugin definition into the object definition
const IL_COMP_SERVICE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setHandlers()

ilObjectDefinition::setHandlers (   $a_xml_parser)

set event handler

Parameters
ressouceinternal xml_parser_handler private

Definition at line 735 of file class.ilObjectDefinition.php.

736  {
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');
740  }

◆ stopInheritance()

ilObjectDefinition::stopInheritance (   $a_obj_name)

Does object permits stopping inheritance?

Parameters
stringobject type public

Definition at line 332 of file class.ilObjectDefinition.php.

333  {
334  return (bool) $this->obj_data[$a_obj_name]["inherit"];
335  }

◆ supportsOfflineHandling()

ilObjectDefinition::supportsOfflineHandling (   $a_obj_type)

check whether obj_type supports centralised offline handling

Parameters
$a_obj_type
Returns
bool

Definition at line 1156 of file class.ilObjectDefinition.php.

1157  {
1158  return
1159  isset($this->obj_data[$a_obj_type]) &&
1160  (bool) $this->obj_data[$a_obj_type]['offline_handling'];
1161  }

Field Documentation

◆ $obj_data

ilObjectDefinition::$obj_data

Definition at line 47 of file class.ilObjectDefinition.php.

◆ $obj_id

ilObjectDefinition::$obj_id

Definition at line 33 of file class.ilObjectDefinition.php.

◆ $parent

ilObjectDefinition::$parent

Definition at line 40 of file class.ilObjectDefinition.php.

◆ $plugin_admin

ilObjectDefinition::$plugin_admin
protected

Definition at line 20 of file class.ilObjectDefinition.php.

Referenced by isActivePluginType(), and parsePluginData().

◆ $settings

ilObjectDefinition::$settings
protected

◆ $sub_types

ilObjectDefinition::$sub_types = array()

◆ MODE_ADMINISTRATION

const ilObjectDefinition::MODE_ADMINISTRATION = 3

Definition at line 53 of file class.ilObjectDefinition.php.

Referenced by ilObjOrgUnitGUI\showPossibleSubObjects().

◆ MODE_REPOSITORY

const ilObjectDefinition::MODE_REPOSITORY = 1

◆ MODE_WORKSPACE


The documentation for this class was generated from the following file: