ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjectDefinition Class Reference

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

+ Inheritance diagram for ilObjectDefinition:
+ Collaboration diagram for ilObjectDefinition:

Public Member Functions

 ilObjectDefinition ()
 Constructor.
 readDefinitionData ()
 Read object definition data.
 getClassName ($a_obj_name)
 get class name by type
 getLocation ($a_obj_name)
 get location by type
 getGroup ($a_id)
 Get Group information.
 getGroupOfObj ($a_obj_name)
 Get Group of object type.
 hasCheckbox ($a_obj_name)
 should the object get a checkbox (needed for 'cut','copy' ...)
 getTranslationType ($a_obj_name)
 get translation type (sys, db or 0)s
 stopInheritance ($a_obj_name)
 Does object permits stopping inheritance?
 getDevMode ($a_obj_name)
 get devmode status by type
 getDevModeAll ()
 get all object types in devmode
 isRBACObject ($a_obj_name)
 get RBAC status by type returns true if object type is a RBAC object type
 isPlugin ($a_obj_name)
 get RBAC status by type returns true if object type is an (activated) plugin type
 isPluginTypeName ($a_str)
 Check if given type is a plugin type name (starts with an "x")
 getAllRBACObjects ()
 get all RBAC object types
 getAllObjects ()
 get all object types
 allowLink ($a_obj_name)
 checks if linking of an object type is allowed
 allowCopy ($a_obj_name)
 checks if copying of an object type is allowed
 allowExport ($a_obj_name)
 hasLocalRoles ($a_obj_type)
 Check whether the creation of local roles is allowed Currently disabled for type "root" and "adm".
 getSubObjects ($a_obj_type, $a_filter=true)
 get all subobjects by type
 getSubObjectsRecursively ($a_obj_type, $a_include_source_obj=true, $a_add_admin_objects=false)
 Get all subobjects by type.
 getSubobjectsToFilter ($a_obj_type="adm")
 get all subjects except (rolf) of the adm object This is neceesary for filtering these objects in role perm view.
 getCreatableSubObjects ($a_obj_type, $a_context=self::MODE_REPOSITORY)
 get only creatable subobjects by type
 getSubObjectsAsString ($a_obj_type)
 get a string of all subobjects by type
 isContainer ($a_obj_name)
 Check if object type is container ('crs','fold','grp' ...)
 setHandlers ($a_xml_parser)
 set event handler
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 start tag handler
 handlerCharacterData ($a_xml_parser, $a_data)
 end tag handler
 handlerEndTag ($a_xml_parser, $a_name)
 end tag handler
 __filterObjects (&$subobjects)
 isSystemObject ($a_obj_name)
 checks if object type is a system object
 isSideBlock ($a_obj_name)
 Check, whether object type is a side block.
 isAllowedInRepository ($a_obj_name)
 checks if object type can be used in repository context
 getAllRepositoryTypes ($a_incl_adm=false)
 get all RBAC object types
 isAllowedInWorkspace ($a_obj_name)
 checks if object type can be used in workspace context
 isAdministrationObject ($a_obj_name)
 Check if administration object.
 isInactivePlugin ($a_type)
 Check whether type belongs to inactive plugin.
 getAdvancedMetaDataTypes ()
 Get advanced meta data objects.
- Public Member Functions inherited from ilSaxParser
 ilSaxParser ($a_xml_file= '', $throwException=false)
 Constructor setup ILIAS global object public.
 setXMLContent ($a_xml_content)
 getXMLContent ()
 getInputType ()
 startParsing ()
 stores xml data in array
 createParser ()
 create parser
 setOptions ($a_xml_parser)
 set parser options
 openXMLFile ()
 open xml file
 parse ($a_xml_parser, $a_fp=null)
 parse xml file
 freeParser ($a_xml_parser)
 free xml parser handle
 setThrowException ($throwException)
 set error handling
- Public Member Functions inherited from PEAR
 PEAR ($error_class=null)
 Constructor.
 _PEAR ()
 Destructor (the emulated type of...).
getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them.
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes.
 isError ($data, $code=null)
 Tell whether a value is a PEAR error.
 setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled.
 expectError ($code= '*')
 This method is used to tell which errors you expect to get.
 popExpect ()
 This method pops one element off the expected error codes stack.
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available.
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack.
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied.
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options.
 staticPushErrorHandling ($mode, $options=null)
 staticPopErrorHandling ()
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack.
 popErrorHandling ()
 Pop the last error handler used.
 loadExtension ($ext)
 OS independant PHP extension load.

Static Public Member Functions

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

Data Fields

 $obj_id
 $parent
 $obj_data
 $sub_types = array()
const MODE_REPOSITORY = 1
const MODE_WORKSPACE = 2
const MODE_ADMINISTRATION = 3
- Data Fields inherited from ilSaxParser
 $input_type = null
 $xml_content = ''
 $ilias
 $lng
 $xml_file
 $throwException = false
- Data Fields inherited from PEAR
 $_debug = false
 $_default_error_mode = null
 $_default_error_options = null
 $_default_error_handler = ''
 $_error_class = 'PEAR_Error'
 $_expected_errors = array()

Additional Inherited Members

- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle

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:
class.ilObjectDefinition.php 46220 2013-11-14 20:35:27Z akill

ilObjDefReader on il_object_def, il_object_subobj, il_object_group

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

Member Function Documentation

ilObjectDefinition::__filterObjects ( $subobjects)

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

Referenced by getSubObjects().

{
foreach($subobjects as $type => $data)
{
switch($type)
{
case "chat":
if(!$this->ilias->getSetting("chat_active"))
{
unset($subobjects[$type]);
}
break;
case "icrs":
if(!$this->ilias->getSetting("ilinc_active"))
{
unset($subobjects[$type]);
}
break;
default:
// DO NOTHING
}
}
}

+ Here is the caller graph for this function:

ilObjectDefinition::allowCopy (   $a_obj_name)

checks if copying of an object type is allowed

Parameters
stringobject type public

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

{
return (bool) $this->obj_data[$a_obj_name]["allow_copy"];
}
ilObjectDefinition::allowExport (   $a_obj_name)

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

{
return (bool) $this->obj_data[$a_obj_name]['export'];
}
ilObjectDefinition::allowLink (   $a_obj_name)

checks if linking of an object type is allowed

Parameters
stringobject type public

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

{
return (bool) $this->obj_data[$a_obj_name]["allow_link"];
}
ilObjectDefinition::getAdvancedMetaDataTypes ( )

Get advanced meta data objects.

Parameters
@return

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

References $sub_types, and $t.

{
$amet = array();
foreach ($this->obj_data as $k => $v)
{
if ($v["amet"])
{
$amet[] = array("obj_type" => $k, "sub_type" => "");
}
}
foreach ($this->sub_types as $type => $sub_types)
{
foreach ($sub_types as $t)
{
if ($t["amet"])
{
$amet[] = array("obj_type" => $type, "sub_type" => $t["sub_type"]);
}
}
}
return $amet;
}
ilObjectDefinition::getAllObjects ( )

get all object types

public

Returns
array object types

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

{
return array_keys($this->obj_data);
}
ilObjectDefinition::getAllRBACObjects ( )

get all RBAC object types

public

Returns
array object types set to development

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

References isRBACObject().

{
$types = array_keys($this->obj_data);
foreach ($types as $type)
{
if ($this->isRBACObject($type))
{
$rbactypes[] = $type;
}
}
return $rbactypes ? $rbactypes : array();
}

+ Here is the call graph for this function:

ilObjectDefinition::getAllRepositoryTypes (   $a_incl_adm = false)

get all RBAC object types

public

Returns
array object types set to development

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

References isAdministrationObject(), and isAllowedInRepository().

{
$types = array_keys($this->obj_data);
foreach ($types as $type)
{
if ($this->isAllowedInRepository($type) &&
(!$this->isAdministrationObject($type) || $a_incl_adm))
{
$rbactypes[] = $type;
}
}
return $rbactypes ? $rbactypes : array();
}

+ Here is the call graph for this function:

ilObjectDefinition::getClassName (   $a_obj_name)

get class name by type

Parameters
stringobject type public

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

{
return $this->obj_data[$a_obj_name]["class_name"];
}
static ilObjectDefinition::getComponentForType (   $a_obj_type)
static

Get component for object type.

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

{
global $ilDB;
$set = $ilDB->queryF("SELECT component FROM il_object_def WHERE id = %s",
array("text"), array($a_obj_type));
if ($rec = $ilDB->fetchAssoc($set))
{
return $rec["component"];
}
return "";
}
ilObjectDefinition::getCreatableSubObjects (   $a_obj_type,
  $a_context = self::MODE_REPOSITORY 
)

get only creatable subobjects by type

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

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

References $sub_types, getDevMode(), getSubObjects(), isAdministrationObject(), isAllowedInRepository(), isAllowedInWorkspace(), and isSystemObject().

{
$subobjects = $this->getSubObjects($a_obj_type);
// remove role folder object from list
unset($subobjects["rolf"]);
$sub_types = array_keys($subobjects);
// remove object types in development from list
foreach ($sub_types as $type)
{
if ($this->getDevMode($type) || $this->isSystemObject($type))
{
unset($subobjects[$type]);
}
if ($a_context == self::MODE_REPOSITORY && !$this->isAllowedInRepository($type))
{
unset($subobjects[$type]);
}
if ($a_context == self::MODE_WORKSPACE && !$this->isAllowedInWorkspace($type))
{
unset($subobjects[$type]);
}
if ($a_context == self::MODE_ADMINISTRATION && !$this->isAdministrationObject($type))
{
unset($subobjects[$type]);
}
// Filter for iLinc: Delete the following lines after we completely removed the iLinc object in ILIAS 4.5.x
if(in_array($type, array('icrs', 'icla')))
{
unset($subobjects[$type]);
}
}
return $subobjects;
}

+ Here is the call graph for this function:

ilObjectDefinition::getDevMode (   $a_obj_name)

get devmode status by type

Parameters
stringobject type public

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

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

{
return (bool) $this->obj_data[$a_obj_name]["devmode"];
}

+ Here is the caller graph for this function:

ilObjectDefinition::getDevModeAll ( )

get all object types in devmode

public

Returns
array object types set to development

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

References getDevMode().

{
$types = array_keys($this->obj_data);
foreach ($types as $type)
{
if ($this->getDevMode($type))
{
$devtypes[] = $type;
}
}
return $devtypes ? $devtypes : array();
}

+ Here is the call graph for this function:

ilObjectDefinition::getGroup (   $a_id)

Get Group information.

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

{
return $this->obj_group[$a_id];
}
static ilObjectDefinition::getGroupedRepositoryObjectTypes (   $a_parent_obj_type)
static

Get grouped repository object types.

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

References $ret, DB_FETCHMODE_ASSOC, IL_COMP_SERVICE, ilPlugin\lookupIdForName(), and ilUtil\sortArray().

{
global $ilDB, $ilPluginAdmin;
$set = $ilDB->query("SELECT * FROM il_object_group");
$groups = array();
while ($gr_rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
$groups[$gr_rec["id"]] = $gr_rec;
}
if (!is_array($a_parent_obj_type))
{
$set = $ilDB->queryF("SELECT il_object_def.* FROM il_object_def, il_object_subobj ".
" WHERE NOT (system = 1) AND NOT (sideblock = 1) AND ".
" parent = %s ".
" AND subobj = id ", array("text"), array($a_parent_obj_type));
}
else
{
$q = "SELECT DISTINCT (id) as sid, il_object_def.* FROM il_object_def, il_object_subobj ".
" WHERE NOT (system = 1) AND NOT (sideblock = 1) AND ".
$ilDB->in("parent", $a_parent_obj_type, false, "text").
" AND subobj = id ";
$set = $ilDB->query($q);
}
$grouped_obj = array();
while($rec = $ilDB->fetchAssoc($set))
{
if ($rec["grp"] != "")
{
$grouped_obj[$rec["grp"]]["pos"] = (int) $groups[$rec["grp"]]["default_pres_pos"];
$grouped_obj[$rec["grp"]]["objs"][] = $rec["id"];
}
else
{
$grouped_obj[$rec["id"]]["pos"] = (int) $rec["default_pres_pos"];
$grouped_obj[$rec["id"]]["objs"][] = $rec["id"];
}
}
//var_dump($grouped_obj);
// now get objects from repository plugin
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Repository", "robj");
foreach ($pl_names as $pl_name)
{
include_once("./Services/Component/classes/class.ilPlugin.php");
$pl_id = ilPlugin::lookupIdForName(IL_COMP_SERVICE, "Repository", "robj", $pl_name);
if (!isset($grouped_obj[$pl_id]))
{
$grouped_obj[$pl_id] = array(
"pos" => "99992000", // "unassigned" group
"objs" => array(0 => $pl_id)
);
}
}
//var_dump($grouped_obj);
$ret = ilUtil::sortArray($grouped_obj, "pos", "asc", true, true);
//var_dump($ret);
return $ret;
}

+ Here is the call graph for this function:

ilObjectDefinition::getGroupOfObj (   $a_obj_name)

Get Group of object type.

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

{
return $this->obj_data[$a_obj_name]["group"];
}
ilObjectDefinition::getLocation (   $a_obj_name)

get location by type

Parameters
stringobject type public

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

{
return $this->obj_data[$a_obj_name]["location"];
}
static ilObjectDefinition::getRepositoryObjectTypesForComponent (   $a_component_type,
  $a_component_name 
)
static

Get all repository object types of component.

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

{
global $ilDB;
$set = $ilDB->queryF("SELECT * FROM il_object_def WHERE component = %s",
array("text"), array($a_component_type."/".$a_component_name));
$types = array();
while($rec = $ilDB->fetchAssoc($set))
{
if ($rec["system"] != 1)
{
$types[] = $rec;
}
}
return $types;
}
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 447 of file class.ilObjectDefinition.php.

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

Referenced by getCreatableSubObjects(), and getSubObjectsRecursively().

{
global $ilSetting;
$subs = array();
if ($subobjects = $this->obj_data[$a_obj_type]["subobjects"])
{
// Filter some objects e.g chat object are creatable if chat is active
if ($a_filter)
{
$this->__filterObjects($subobjects);
}
foreach ($subobjects as $data => $sub)
{
if ($sub["module"] != "n")
{
if (!($ilSetting->get("obj_dis_creation_".$data)))
{
$subs[$data] = $sub;
// determine position
$pos = ($ilSetting->get("obj_add_new_pos_".$data) > 0)
? (int) $ilSetting->get("obj_add_new_pos_".$data)
: (int) $this->obj_data[$data]["default_pos"];
$subs[$data]["pos"] = $pos;
}
}
}
$subs2 = ilUtil::sortArray($subs, "pos", ASC, true, true);
return $subs2;
}
return $subs;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjectDefinition::getSubObjectsAsString (   $a_obj_type)

get a string of all subobjects by type

Parameters
stringobject type public

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

{
$string = "";
if (is_array($this->obj_data[$a_obj_type]["subobjects"]))
{
$data = array_keys($this->obj_data[$a_obj_type]["subobjects"]);
$string = "'".implode("','", $data)."'";
}
return $string;
}
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 498 of file class.ilObjectDefinition.php.

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

{
global $ilSetting;
// This associative array is used to collect all subobject types.
// key=>type, value=data
$recursivesubs = array();
// This array is used to keep track of the object types, we
// need to call function getSubobjects() for.
$to_do = array($a_obj_type);
// This array is used to keep track of the object types, we
// have called function getSubobjects() already. This is to
// prevent endless loops, for object types that support
// themselves as subobject types either directly or indirectly.
$done = array();
while (count($to_do) > 0)
{
$type = array_pop($to_do);
$done[] = $type;
// no recovery folder subitems
if($type == 'recf')
{
continue;
}
// Hide administration if desired
if(!$a_add_admin_objects and $type == 'adm')
{
$subs = array();
}
else
{
$subs = $this->getSubObjects($type);
}
#vd('xxxxxxxxxxxxx'.$type);
foreach ($subs as $subtype => $data)
{
#vd('------------------------->'.$subtype);
// Hide role templates and folder from view
if($this->getDevMode($subtype) or !$this->isRBACObject($subtype))
{
continue;
}
if($subtype == 'rolf' or $subtype == 'rolt')
{
continue;
}
if(!$a_add_admin_objects and $subtype == 'adm')
{
continue;
}
$recursivesubs[$subtype] = $data;
if (! in_array($subtype, $done)
&& ! in_array($subtype, $to_do))
{
$to_do[] = $subtype;
}
}
}
if($a_include_source_obj)
{
if(!isset($recursivesubs[$a_obj_type]))
{
$recursivesubs[$a_obj_type]['name'] = $a_obj_type;
$recursivesubs[$a_obj_type]['lng'] = $a_obj_type;
$recursivesubs[$a_obj_type]['max'] = 0;
$recursivesubs[$a_obj_type]['pos'] = -1;
}
}
return ilUtil::sortArray($recursivesubs, "pos", ASC, true, true);
}

+ Here is the call graph for this function:

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

get all subjects except (rolf) of the adm object This is neceesary 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 587 of file class.ilObjectDefinition.php.

{
foreach($this->obj_data[$a_obj_type]["subobjects"] as $key => $value)
{
switch($key)
{
case "rolf":
// DO NOTHING
break;
default:
$tmp_subs[] = $key;
}
}
// ADD adm and root object
$tmp_subs[] = "adm";
#$tmp_subs[] = "root";
return $tmp_subs ? $tmp_subs : array();
}
ilObjectDefinition::getTranslationType (   $a_obj_name)

get translation type (sys, db or 0)s

Parameters
stringobject type public

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

References DB_FETCHMODE_ASSOC.

{
global $ilDB;
if ($a_obj_name == "root")
{
if (!isset($this->root_trans_type))
{
$q = "SELECT count(obj_id) cnt FROM object_translation WHERE obj_id = ".
$ilDB->quote(ROOT_FOLDER_ID,'integer')." ";
$set = $ilDB->query($q);
$rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
if($rec["cnt"] > 0)
{
$this->root_trans_type = "db";
}
else
{
$this->root_trans_type = $this->obj_data[$a_obj_name]["translate"];
}
}
return $this->root_trans_type;
}
if (isset($this->obj_data[$a_obj_name]))
{
return $this->obj_data[$a_obj_name]["translate"];
}
return "";
}
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 714 of file class.ilObjectDefinition.php.

{
switch ($a_name)
{
case 'object':
$this->parent_tag_name = $a_attribs["name"];
break;
case 'property':
$this->current_tag = "property";
$this->current_tag_name = $a_attribs["name"];
// $this->obj_data[$this->parent_tag_name]["properties"][$this->current_tag_name]["name"] = $a_attribs["name"];
$this->obj_data[$this->parent_tag_name]["properties"][$this->current_tag_name]["module"] = $a_attribs["module"];
//echo '<br>$this->obj_data["'.$this->parent_tag_name.'"]["properties"]["'.$this->current_tag_name.'"]["module"] = "'.$a_attribs["module"].'";';
break;
}
}
ilObjectDefinition::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

end tag handler

Parameters
ressouceinternal xml_parser_handler
stringdata private

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

{
}
ilObjectDefinition::handlerEndTag (   $a_xml_parser,
  $a_name 
)

end tag handler

Parameters
ressouceinternal xml_parser_handler
stringelement tag name private

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

{
$this->current_tag = '';
$this->current_tag_name = '';
}
ilObjectDefinition::hasCheckbox (   $a_obj_name)

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

Parameters
stringobject type public

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

{
return (bool) $this->obj_data[$a_obj_name]["checkbox"];
}
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 434 of file class.ilObjectDefinition.php.

{
return isset($this->obj_data[$a_obj_type]['subobjects']['rolf']);
}
ilObjectDefinition::ilObjectDefinition ( )

Constructor.

setup ILIAS global object public

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

References ilSaxParser\$ilias, ILIAS_ABSOLUTE_PATH, ilSaxParser\ilSaxParser(), and readDefinitionData().

{
global $ilias;
$this->ilias = $ilias;
// removing this line leads to segmentation faults in
// learning module editor with
// - PHP 5.2.1, libxml 2.6.22, libxslt 1.1.15 (MacOsX)
// - PHP 5.2.1, libxml 2.6.31, libxslt 1.1.22 (MacOsX)
// - PHP 5.2.5, libxml 2.6.31, libxslt 1.1.22 (MacOsX)
// - PHP 5.2.0-8+etch7, libxml 2.6.27, libxslt 1.1.19
// - PHP 5.2.0, libxml, libxml 2.6.26, libxslt 1.1.17 (OpenSuse 10.2)
// (needs further investigation)
// OK with:
// - PHP 5.1.2, libxml 2.6.24, libxslt 1.1.15
//
// Replacing all "=&" with "=" in xml5compliance seems to solve the problem
//
// $this->startParsing();
}

+ Here is the call graph for this function:

ilObjectDefinition::isAdministrationObject (   $a_obj_name)

Check if administration object.

Parameters
string$a_obj_name
Returns
bool

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

Referenced by getAllRepositoryTypes(), and getCreatableSubObjects().

{
return (bool) $this->obj_data[$a_obj_name]['administration'];
}

+ Here is the caller graph for this function:

ilObjectDefinition::isAllowedInRepository (   $a_obj_name)

checks if object type can be used in repository context

Parameters
stringobject type public
Returns
bool

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

Referenced by getAllRepositoryTypes(), and getCreatableSubObjects().

{
return (bool) $this->obj_data[$a_obj_name]["repository"];
}

+ Here is the caller graph for this function:

ilObjectDefinition::isAllowedInWorkspace (   $a_obj_name)

checks if object type can be used in workspace context

Parameters
stringobject type public
Returns
bool

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

Referenced by getCreatableSubObjects().

{
return (bool) $this->obj_data[$a_obj_name]["workspace"];
}

+ Here is the caller graph for this function:

ilObjectDefinition::isContainer (   $a_obj_name)

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

public

Parameters
stringobject type
Returns
bool

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

{
if(!is_array($this->obj_data[$a_obj_name]['subobjects']))
{
return false;
}
return count($this->obj_data[$a_obj_name]['subobjects']) > 1 ? true : false;
}
ilObjectDefinition::isInactivePlugin (   $a_type)

Check whether type belongs to inactive plugin.

Parameters
@return

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

References isPlugin().

{
if (substr($a_type, 0, 1) == "x" && !$this->isPlugin($a_type))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

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 354 of file class.ilObjectDefinition.php.

Referenced by isInactivePlugin().

{
return (bool) isset($this->obj_data[$a_obj_name]["plugin"]);
}

+ Here is the caller graph for this function:

ilObjectDefinition::isPluginTypeName (   $a_str)

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

Parameters
stringobject type public

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

{
return (substr($a_str, 0, 1) == "x");
}
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 342 of file class.ilObjectDefinition.php.

Referenced by getAllRBACObjects(), and getSubObjectsRecursively().

{
return (bool) $this->obj_data[$a_obj_name]["rbac"];
}

+ Here is the caller graph for this function:

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 806 of file class.ilObjectDefinition.php.

{
return (bool) $this->obj_data[$a_obj_name]["sideblock"];
}
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 795 of file class.ilObjectDefinition.php.

Referenced by getCreatableSubObjects().

{
return (bool) $this->obj_data[$a_obj_name]["system"];
}

+ Here is the caller graph for this function:

ilObjectDefinition::readDefinitionData ( )

Read object definition data.

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

References ilPlugin\_getDirectory(), IL_COMP_SERVICE, and ilPlugin\lookupIdForName().

Referenced by ilObjectDefinition().

{
global $ilDB, $ilPluginAdmin;
$this->obj_data = array();
// Select all object_definitions and collect the definition id's in
// this array.
$defIds = array();
$set = $ilDB->query("SELECT * FROM il_object_def");
while ($rec = $ilDB->fetchAssoc($set))
{
$this->obj_data[$rec["id"]] = array(
"name" => $rec["id"],
"class_name" => $rec["class_name"],
"location" => $rec["location"],
"checkbox" => $rec["checkbox"],
"inherit" => $rec["inherit"],
"component" => $rec["component"],
"translate" => $rec["translate"],
"devmode" => $rec["devmode"],
"allow_link" => $rec["allow_link"],
"allow_copy" => $rec["allow_copy"],
"rbac" => $rec["rbac"],
"group" => $rec["grp"],
"system" => $rec["system"],
"default_pos" => "9999".str_pad($rec["default_pos"], 4, "0", STR_PAD_LEFT), // "unassigned" group
"sideblock" => $rec["sideblock"],
'export' => $rec['export'],
'repository' => $rec['repository'],
'workspace' => $rec['workspace'],
'administration' => $rec['administration'],
'amet' => $rec['amet']
);
$this->obj_data[$rec["id"]]["subobjects"] = array();
$defIds[] = $rec["id"];
}
// get all subobject definitions in a single query
$set2 = $ilDB->query("SELECT * FROM il_object_subobj WHERE ".
$ilDB->in('parent', $defIds, false, 'text'));
while ($rec2 = $ilDB->fetchAssoc($set2))
{
$max = $rec2["mmax"];
if ($max <= 0) // for backward compliance
{
$max = "";
}
$this->obj_data[$rec2["parent"]]["subobjects"][$rec2["subobj"]] = array(
"name" => $rec2["subobj"],
"max" => $max,
"lng" => $rec2["subobj"]
);
}
$set = $ilDB->query("SELECT * FROM il_object_group");
$this->obj_group = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$this->obj_group[$rec["id"]] = $rec;
}
// now get objects from repository plugin
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Repository", "robj");
foreach ($pl_names as $pl_name)
{
include_once("./Services/Component/classes/class.ilPlugin.php");
$pl_id = ilPlugin::lookupIdForName(IL_COMP_SERVICE, "Repository", "robj", $pl_name);
if ($pl_id != "" && !isset($this->obj_data[$pl_id]))
{
include_once("./Services/Repository/classes/class.ilRepositoryObjectPlugin.php");
$loc = ilPlugin::_getDirectory(IL_COMP_SERVICE, "Repository", "robj",
$pl_name)."/classes";
$this->obj_data[$pl_id] = array(
"name" => $pl_id,
"class_name" => $pl_name,
"plugin" => "1",
"location" => $loc,
"checkbox" => "1",
"inherit" => "0",
"component" => "",
"translate" => "0",
"devmode" => "0",
"allow_link" => "1",
"allow_copy" => "0",
"rbac" => "1",
"group" => null,
"system" => "0",
"default_pos" => "99992000", // "unassigned" group
'repository' => '1',
'workspace' => '0',
'administration' => '0',
"sideblock" => "0");
$this->obj_data[$rec["id"]]["subobjects"] = array();
// plugins have to be marked as such - see ilContainerGUI::showPossibleSubObjects()
$this->obj_data["crs"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id, "plugin" => true);
$this->obj_data["fold"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id, "plugin" => true);
$this->obj_data["grp"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id, "plugin" => true);
$this->obj_data["cat"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id, "plugin" => true);
$this->obj_data["root"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id, "plugin" => true);
}
}
//var_dump($this->obj_data["root"]["subobjects"]);
//var_dump($this->obj_data2["root"]);
$set = $ilDB->query("SELECT * FROM il_object_sub_type ");
$this->sub_types = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$this->sub_types[$rec["obj_type"]][] = $rec;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjectDefinition::setHandlers (   $a_xml_parser)

set event handler

Parameters
ressouceinternal xml_parser_handler private

Reimplemented from ilSaxParser.

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

{
xml_set_object($a_xml_parser,$this);
xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
}
ilObjectDefinition::stopInheritance (   $a_obj_name)

Does object permits stopping inheritance?

Parameters
stringobject type public

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

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

Field Documentation

ilObjectDefinition::$obj_data

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

ilObjectDefinition::$obj_id

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

ilObjectDefinition::$parent

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

ilObjectDefinition::$sub_types = array()
const ilObjectDefinition::MODE_ADMINISTRATION = 3

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

Referenced by ilObjOrgUnitGUI\showPossibleSubObjects().

const ilObjectDefinition::MODE_REPOSITORY = 1

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