ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPCPlugged Class Reference

Class ilPCPlugged Plugged content object (see ILIAS DTD) More...

+ Inheritance diagram for ilPCPlugged:
+ Collaboration diagram for ilPCPlugged:

Public Member Functions

 init ()
 Init page content component.
 setNode (&$a_node)
 Set node.
 create (&$a_pg_obj, $a_hier_id, $a_plugin_name, $a_plugin_version)
 Create plugged node in xml.
 setProperties ($a_properties)
 Set properties of plugged component.
 getProperties ()
 Get properties of plugged component.
 setPluginVersion ($a_version)
 Set version of plugged component.
 getPluginVersion ()
 Get version of plugged component.
 setPluginName ($a_name)
 Set name of plugged component.
 getPluginName ()
 Get name of plugged component.
- 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.
 readHierId ()
 Read PC Id.
 setPcId ($a_pcid)
 Set PC Id.
 getPCId ()
 Get PC Id.
 readPCId ()
 Read PC Id.
 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)

Data Fields

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

Additional Inherited Members

- 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.
- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type.

Detailed Description

Class ilPCPlugged Plugged content object (see ILIAS DTD)

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

Definition at line 35 of file class.ilPCPlugged.php.

Member Function Documentation

ilPCPlugged::create ( $a_pg_obj,
  $a_hier_id,
  $a_plugin_name,
  $a_plugin_version 
)

Create plugged node in xml.

Parameters
object$a_pg_objPage Object
string$a_hier_idHierarchical ID

Definition at line 63 of file class.ilPCPlugged.php.

References ilPageContent\createPageContentNode(), and IL_INSERT_AFTER.

{
$this->node = $this->createPageContentNode();
$a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER);
$this->plug_node =& $this->dom->create_element("Plugged");
$this->plug_node =& $this->node->append_child($this->plug_node);
$this->plug_node->set_attribute("PluginName", $a_plugin_name);
$this->plug_node->set_attribute("PluginVersion", $a_plugin_version);
}

+ Here is the call graph for this function:

ilPCPlugged::getPluginName ( )

Get name of plugged component.

Returns
string name

Definition at line 187 of file class.ilPCPlugged.php.

{
if (is_object($this->plug_node))
{
return $this->plug_node->get_attribute("PluginName");
}
}
ilPCPlugged::getPluginVersion ( )

Get version of plugged component.

Returns
string version

Definition at line 154 of file class.ilPCPlugged.php.

{
if (is_object($this->plug_node))
{
return $this->plug_node->get_attribute("PluginVersion");
}
}
ilPCPlugged::getProperties ( )

Get properties of plugged component.

Returns
string characteristic

Definition at line 108 of file class.ilPCPlugged.php.

{
$properties = array();
if (is_object($this->plug_node))
{
// delete properties
$children = $this->plug_node->child_nodes();
for($i=0; $i<count($children); $i++)
{
if ($children[$i]->node_name() == "PluggedProperty")
{
$properties[$children[$i]->get_attribute("Name")] =
$children[$i]->get_content();
}
}
}
return $properties;
}
ilPCPlugged::init ( )

Init page content component.

Reimplemented from ilPageContent.

Definition at line 43 of file class.ilPCPlugged.php.

References ilPageContent\setType().

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

+ Here is the call graph for this function:

ilPCPlugged::setNode ( $a_node)

Set node.

Reimplemented from ilPageContent.

Definition at line 51 of file class.ilPCPlugged.php.

{
parent::setNode($a_node); // this is the PageContent node
$this->plug_node =& $a_node->first_child(); // this is the Plugged node
}
ilPCPlugged::setPluginName (   $a_name)

Set name of plugged component.

Parameters
string$a_namename

Definition at line 167 of file class.ilPCPlugged.php.

{
if (!empty($a_name))
{
$this->plug_node->set_attribute("PluginName", $a_name);
}
else
{
if ($this->plug_node->has_attribute("PluginName"))
{
$this->plug_node->remove_attribute("PluginName");
}
}
}
ilPCPlugged::setPluginVersion (   $a_version)

Set version of plugged component.

Parameters
string$a_versionversion

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

{
if (!empty($a_version))
{
$this->plug_node->set_attribute("PluginVersion", $a_version);
}
else
{
if ($this->plug_node->has_attribute("PluginVersion"))
{
$this->plug_node->remove_attribute("PluginVersion");
}
}
}
ilPCPlugged::setProperties (   $a_properties)

Set properties of plugged component.

Parameters
array$a_propertiescomponent properties

Definition at line 79 of file class.ilPCPlugged.php.

{
if (!is_object($this->plug_node))
{
return;
}
// delete properties
$children = $this->plug_node->child_nodes();
for($i=0; $i<count($children); $i++)
{
$this->plug_node->remove_child($children[$i]);
}
// set properties
foreach($a_properties as $key => $value)
{
$prop_node = $this->dom->create_element("PluggedProperty");
$prop_node =& $this->node->append_child($this->plug_node);
$prop_node->set_attribute("Name", $key);
$prop_node->set_content($value);
}
}

Field Documentation

ilPCPlugged::$dom

Definition at line 37 of file class.ilPCPlugged.php.

ilPCPlugged::$plug_node

Definition at line 38 of file class.ilPCPlugged.php.


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