ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPCResources Class Reference

Class ilPCResources. More...

+ Inheritance diagram for ilPCResources:
+ Collaboration diagram for ilPCResources:

Public Member Functions

 init ()
 Init page content component.
 setNode (&$a_node)
 Set node.
 create (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create resources node in xml.
 setResourceListType ($a_type)
 Set Type of Resource List (currently only one)
 setItemGroupRefId ($a_ref_id)
 Set Item Group Ref Id.
 getResourceListType ()
 Get Resource Lis Type.
 getItemGroupRefId ()
 Get item group ref id.
 getMainType ()
 Get main type.
- Public Member Functions inherited from ilPageContent
 __construct ($a_dom)
 Constructor.
 getType ()
 Get type of page content.
getNode ()
 Get xml node of page content.
 setHierId ($a_hier_id)
 Set hierarchical ID in xml structure.
 getHierId ()
 Get hierarchical id.
 lookupHierId ()
 Get hierarchical id from dom.
 readHierId ()
 Read PC Id.
 setPcId ($a_pcid)
 Set PC Id.
 getPCId ()
 Get PC Id.
 readPCId ()
 Read PC Id.
 writePCId ($a_pc_id)
 Write pc id.
 isGreaterHierId ($a, $b)
 Check whether Hier ID $a is greater than Hier ID $b.
 setEnabled ($value)
 Set Enabled value for page content component.
 enable ()
 Enable page content.
 disable ()
 Disable page content.
 isEnabled ()
 Check whether page content is enabled.
 createPageContentNode ($a_set_this_node=true)
 Create page content node (always use this method first when adding a new element)

Static Public Member Functions

static modifyItemGroupRefIdsByMapping ($a_page, $mappings)
 Modify ref ids by mapping.
- Static Public Member Functions inherited from ilPageContent
static incEdId ($ed_id)
 Increases an hierarchical editing id at lowest level (last number)
static decEdId ($ed_id)
 Decreases an hierarchical editing id at lowest level (last number)
static haveSameContainer ($ed_id1, $ed_id2)
 Check, if two ids are in same container.
static sortHierIds ($a_array)
 Sort an array of Hier IDS in ascending order.

Data Fields

 $dom
 $res_node
- Data Fields inherited from ilPageContent
 $hier_id
 $node
 $dom

Additional Inherited Members

- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type.

Detailed Description

Class ilPCResources.

Resources content object (see ILIAS DTD). Inserts Repository Resources of a Container Object,

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

Definition at line 17 of file class.ilPCResources.php.

Member Function Documentation

ilPCResources::create ( $a_pg_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Create resources node in xml.

Parameters
object$a_pg_objPage Object
string$a_hier_idHierarchical ID

Definition at line 45 of file class.ilPCResources.php.

References ilPageContent\createPageContentNode(), and IL_INSERT_AFTER.

{
$this->node = $this->createPageContentNode();
$a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
$this->res_node =& $this->dom->create_element("Resources");
$this->res_node =& $this->node->append_child($this->res_node);
}

+ Here is the call graph for this function:

ilPCResources::getItemGroupRefId ( )

Get item group ref id.

Returns
int ref id

Definition at line 116 of file class.ilPCResources.php.

{
if (is_object($this->res_node))
{
$children = $this->res_node->child_nodes();
if (is_object($children[0]) && $children[0]->node_name() == "ItemGroup")
{
return (int) $children[0]->get_attribute("RefId");
}
}
return false;
}
ilPCResources::getMainType ( )

Get main type.

Returns
int ref id

Definition at line 134 of file class.ilPCResources.php.

{
if (is_object($this->res_node))
{
$children = $this->res_node->child_nodes();
if (is_object($children[0]))
{
return $children[0]->node_name();
}
}
return false;
}
ilPCResources::getResourceListType ( )

Get Resource Lis Type.

Returns
string resource type group

Definition at line 98 of file class.ilPCResources.php.

{
if (is_object($this->res_node))
{
$children = $this->res_node->child_nodes();
if (is_object($children[0]) && $children[0]->node_name() == "ResourceList")
{
return $children[0]->get_attribute("Type");
}
}
return false;
}
ilPCResources::init ( )

Init page content component.

Reimplemented from ilPageContent.

Definition at line 25 of file class.ilPCResources.php.

References ilPageContent\setType().

{
$this->setType("repobj");
}

+ Here is the call graph for this function:

static ilPCResources::modifyItemGroupRefIdsByMapping (   $a_page,
  $mappings 
)
static

Modify ref ids by mapping.

Parameters
@return

Definition at line 153 of file class.ilPCResources.php.

References $dom, and $ref_id.

Referenced by ilObjItemGroup\fixContainerItemGroupRefsAfterCloning().

{
$dom = $a_page->getDom();
if ($dom instanceof php4DOMDocument)
{
$dom = $dom->myDOMDocument;
}
$xpath_temp = new DOMXPath($dom);
$igs = $xpath_temp->query("//Resources/ItemGroup");
foreach ($igs as $ig_node)
{
$ref_id = $ig_node->getAttribute("RefId");
if ($mappings[$ref_id] > 0)
{
$ig_node->setAttribute("RefId", $mappings[$ref_id]);
}
}
}

+ Here is the caller graph for this function:

ilPCResources::setItemGroupRefId (   $a_ref_id)

Set Item Group Ref Id.

Parameters
int$a_ref_iditem group ref id

Definition at line 78 of file class.ilPCResources.php.

{
if (!empty($a_ref_id))
{
$children = $this->res_node->child_nodes();
for ($i=0; $i<count($children); $i++)
{
$this->res_node->remove_child($children[$i]);
}
$list_node =& $this->dom->create_element("ItemGroup");
$list_node =& $this->res_node->append_child($list_node);
$list_node->set_attribute("RefId", $a_ref_id);
}
}
ilPCResources::setNode ( $a_node)

Set node.

Reimplemented from ilPageContent.

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

{
parent::setNode($a_node); // this is the PageContent node
$this->res_node =& $a_node->first_child(); // this is the Resources node
}
ilPCResources::setResourceListType (   $a_type)

Set Type of Resource List (currently only one)

Parameters
string$a_typeResource Type Group

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

{
if (!empty($a_type))
{
$children = $this->res_node->child_nodes();
for ($i=0; $i<count($children); $i++)
{
$this->res_node->remove_child($children[$i]);
}
$list_node =& $this->dom->create_element("ResourceList");
$list_node =& $this->res_node->append_child($list_node);
$list_node->set_attribute("Type", $a_type);
}
}

Field Documentation

ilPCResources::$dom

Definition at line 19 of file class.ilPCResources.php.

Referenced by modifyItemGroupRefIdsByMapping().

ilPCResources::$res_node

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


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