ILIAS  Release_4_1_x_branch Revision 61804
 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)
 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.
- 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
- 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 29200 2011-05-23 13:13:26Z smeyer

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

References $data.

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

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

Definition at line 400 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 384 of file class.ilObjectDefinition.php.

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

get all object types

public

Returns
array object types

Definition at line 373 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 352 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::getClassName (   $a_obj_name)

get class name by type

Parameters
stringobject type public

Definition at line 185 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 798 of file class.ilObjectDefinition.php.

References $ilDB.

{
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)

get only creatable subobjects by type

Parameters
stringobject type public
Returns
array list of createable object types

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

References getDevMode(), getSubObjects(), and isSystemObject().

{
$subobjects = $this->getSubObjects($a_obj_type);
// remove role folder object from list
unset($subobjects["rolf"]);
unset($subobjects['rcrs']);
$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]);
}
}
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 285 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 296 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 205 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 816 of file class.ilObjectDefinition.php.

References $ilDB, $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" => 2000,
"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 213 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 197 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 775 of file class.ilObjectDefinition.php.

References $ilDB.

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

References $data, $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 621 of file class.ilObjectDefinition.php.

References $data.

{
$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 474 of file class.ilObjectDefinition.php.

References $data, $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 564 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 235 of file class.ilObjectDefinition.php.

References $ilDB, and 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 675 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 699 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 710 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 224 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 410 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 44 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::isContainer (   $a_obj_name)

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

public

Parameters
stringobject type
Returns
bool

Definition at line 643 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::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 330 of file class.ilObjectDefinition.php.

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

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

Parameters
stringobject type public

Definition at line 341 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 318 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 767 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 756 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 75 of file class.ilObjectDefinition.php.

References $ilDB, 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" => $rec["default_pos"],
"sideblock" => $rec["sideblock"],
'export' => $rec['export']);
$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" => "2000",
"sideblock" => "0");
$this->obj_data[$rec["id"]]["subobjects"] = array();
$this->obj_data["crs"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id);
$this->obj_data["fold"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id);
$this->obj_data["grp"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id);
$this->obj_data["cat"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id);
$this->obj_data["root"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id);
}
}
//var_dump($this->obj_data["root"]["subobjects"]);
//var_dump($this->obj_data2["root"]);
}

+ 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 660 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 274 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.


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