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

Class ilPageContent. More...

+ Inheritance diagram for ilPageContent:
+ Collaboration diagram for ilPageContent:

Public Member Functions

 __construct ($a_dom)
 Constructor.
 init ()
 Init object.
 getType ()
 Get type of page content.
 setNode (&$a_node)
 Set xml node 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)

Static Public Member Functions

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.

Data Fields

 $hier_id
 $node
 $dom

Protected Member Functions

 setType ($a_type)
 Set Type.

Detailed Description

Class ilPageContent.

Content object of ilPageObject (see ILIAS DTD). Every concrete object should be an instance of a class derived from ilPageContent (e.g. ilParagraph, ilMediaObject, ...)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilPageContent.php 17399 2008-09-15 21:26:52Z akill

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

Constructor & Destructor Documentation

ilPageContent::__construct (   $a_dom)
final

Constructor.

All initialisation in derived classes should go to the init() function

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

References getType(), and init().

{
$this->dom = $a_dom;
$this->init();
if ($this->getType() == "")
{
die ("Error: ilPageContent::init() did not set type");
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilPageContent::createPageContentNode (   $a_set_this_node = true)

Create page content node (always use this method first when adding a new element)

Definition at line 283 of file class.ilPageContent.php.

References $node.

Referenced by ilPCTable\addCell(), ilPCList\create(), ilPCFileList\create(), ilPCTable\create(), ilPCDataTable\create(), ilPCTabs\create(), ilPCPlugged\create(), ilPCMap\create(), ilPCSection\create(), ilPCResources\create(), ilPCMediaObject\create(), ilPCParagraph\createAfter(), ilPCParagraph\createAtNode(), and ilPCDataTable\getCellNode().

{
$node = $this->dom->create_element("PageContent");
if ($a_set_this_node)
{
$this->node = $node;
}
return $node;
}

+ Here is the caller graph for this function:

static ilPageContent::decEdId (   $ed_id)
staticfinal

Decreases an hierarchical editing id at lowest level (last number)

Parameters
string$ed_idhierarchical ID
Returns
string hierarchical ID (decreased)

Definition at line 195 of file class.ilPageContent.php.

{
$id = explode("_", $ed_id);
$id[count($id) - 1]--;
return implode($id, "_");
}
ilPageContent::disable ( )

Disable page content.

Definition at line 256 of file class.ilPageContent.php.

References setEnabled().

{
$this->setEnabled("False");
}

+ Here is the call graph for this function:

ilPageContent::enable ( )

Enable page content.

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

References setEnabled().

{
$this->setEnabled("True");
}

+ Here is the call graph for this function:

ilPageContent::getHierId ( )
ilPageContent::getPCId ( )

Get PC Id.

Returns
string PC Id

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

{
return $this->pcid;
}
ilPageContent::getType ( )

Get type of page content.

Returns
string Type as defined by the page content component

Reimplemented in ilPCParagraph.

Definition at line 81 of file class.ilPageContent.php.

Referenced by __construct().

{
return $this->type;
}

+ Here is the caller graph for this function:

static ilPageContent::haveSameContainer (   $ed_id1,
  $ed_id2 
)
staticfinal

Check, if two ids are in same container.

Parameters
string$ed_id1hierachical ID 1
string$ed_id2hierachical ID 2
Returns
boolean true/false

Definition at line 211 of file class.ilPageContent.php.

{
$id1 = explode("_", $ed_id1);
$id2 = explode("_", $ed_id1);
if(count($id1) == count($id2))
{
array_pop($id1);
array_pop($id2);
foreach ($id1 as $key => $id)
{
if($id != $id2[$key])
{
return false;
}
}
return true;
}
return false;
}
static ilPageContent::incEdId (   $ed_id)
staticfinal

Increases an hierarchical editing id at lowest level (last number)

Parameters
string$ed_idhierarchical ID
Returns
string hierarchical ID (increased)

Definition at line 180 of file class.ilPageContent.php.

Referenced by ilPageObject\addHierIDs().

{
$id = explode("_", $ed_id);
$id[count($id) - 1]++;
return implode($id, "_");
}

+ Here is the caller graph for this function:

ilPageContent::init ( )
abstract

Init object.

This function must be overwritten and at least set the content type.

Reimplemented in ilPCDataTable, ilPCParagraph, ilPCResources, ilPCTable, ilPCMap, ilPCMediaObject, ilPCQuestion, ilPCSection, ilPCFileItem, ilPCFileList, ilPCList, ilPCListItem, ilPCPlugged, ilPCTab, ilPCTableData, and ilPCTabs.

Referenced by __construct().

+ Here is the caller graph for this function:

ilPageContent::isEnabled ( )
final

Check whether page content is enabled.

Returns
boolean true/false

Definition at line 266 of file class.ilPageContent.php.

{
if (is_object($this->node) && $this->node->has_attribute("Enabled"))
{
$compare = $this->node->get_attribute("Enabled");
}
else
{
$compare = "True";
}
return strcasecmp($compare,"true") == 0;
}
ilPageContent::readHierId ( )

Read PC Id.

Returns
string PC Id

Definition at line 131 of file class.ilPageContent.php.

{
if (is_object($this->node))
{
return $this->node->get_attribute("HierId");
}
}
ilPageContent::readPCId ( )

Read PC Id.

Returns
string PC Id

Definition at line 165 of file class.ilPageContent.php.

{
if (is_object($this->node))
{
return $this->node->get_attribute("PCID");
}
}
ilPageContent::setEnabled (   $value)

Set Enabled value for page content component.

Parameters
string$value"True" | "False"

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

Referenced by disable(), and enable().

{
if (is_object($this->node))
{
$this->node->set_attribute("Enabled", $value);
}
}

+ Here is the caller graph for this function:

ilPageContent::setHierId (   $a_hier_id)

Set hierarchical ID in xml structure.

Parameters
string$a_hier_idHierarchical ID.

Reimplemented in ilPCMediaObject.

Definition at line 113 of file class.ilPageContent.php.

{
$this->hier_id = $a_hier_id;
}
ilPageContent::setNode ( $a_node)

Set xml node of page content.

Parameters
object$a_nodenode object

Reimplemented in ilPCMediaObject, ilPCParagraph, ilPCResources, ilPCMap, ilPCSection, ilPCDataTable, ilPCPlugged, ilPCTabs, ilPCTable, ilPCQuestion, ilPCFileList, and ilPCList.

Definition at line 91 of file class.ilPageContent.php.

{
$this->node =& $a_node;
}
ilPageContent::setPcId (   $a_pcid)

Set PC Id.

Parameters
string$a_pcidPC Id

Definition at line 144 of file class.ilPageContent.php.

{
$this->pcid = $a_pcid;
}
ilPageContent::setType (   $a_type)
finalprotected

Set Type.

Must be called in constructor.

Parameters
string$a_typetype of page content component

Definition at line 71 of file class.ilPageContent.php.

Referenced by ilPCFileItem\init(), ilPCList\init(), ilPCPlugged\init(), ilPCTabs\init(), ilPCListItem\init(), ilPCFileList\init(), ilPCTab\init(), ilPCTableData\init(), ilPCMap\init(), ilPCMediaObject\init(), ilPCQuestion\init(), ilPCSection\init(), ilPCResources\init(), ilPCParagraph\init(), ilPCTable\init(), and ilPCDataTable\init().

{
$this->type = $a_type;
}

+ Here is the caller graph for this function:

Field Documentation

ilPageContent::$dom

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


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