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

Class ilPCTabs. More...

+ Inheritance diagram for ilPCTabs:
+ Collaboration diagram for ilPCTabs:

Public Member Functions

 init ()
 Init page content component.
 setNode (&$a_node)
 Set content node.
 create (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create new Tabs node.
 addItems ($a_nr)
 Add Tab items.
 setTabType ($a_type="HorizontalTabs")
 Set type of tabs.
 getTabType ()
 Get type of tabs.
 setCaptions ($a_captions)
 Add Tab items.
 getCaptions ()
 Get captions.
- 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

 $tabs_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 ilPCTabs.

Tabbed contents (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 36 of file class.ilPCTabs.php.

Member Function Documentation

ilPCTabs::addItems (   $a_nr)

Add Tab items.

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

{
for ($i=1; $i<=$a_nr; $i++)
{
$new_item =& $this->dom->create_element("Tab");
$new_item =& $this->tabs_node->append_child($new_item);
}
}
ilPCTabs::create ( $a_pg_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Create new Tabs node.

Definition at line 60 of file class.ilPCTabs.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->tabs_node =& $this->dom->create_element("Tabs");
$this->tabs_node =& $this->node->append_child($this->tabs_node);
}

+ Here is the call graph for this function:

ilPCTabs::getCaptions ( )

Get captions.

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

{
$captions = array();
$tab_nodes = $this->tabs_node->child_nodes();
for($i = 0; $i < count($tab_nodes); $i++)
{
if ($tab_nodes[$i]->node_name() == "Tab")
{
$tab_node_childs = $tab_nodes[$i]->child_nodes();
$current_caption = "";
for($j = 0; $j < count($tab_node_childs); $j++)
{
if ($tab_node_childs[$j]->node_name() == "TabCaption")
{
$current_caption = $tab_node_childs[$j]->get_content();
}
}
$captions[] = $current_caption;
}
}
return $captions;
}
ilPCTabs::getTabType ( )

Get type of tabs.

Definition at line 99 of file class.ilPCTabs.php.

{
return $this->tabs_node->get_attribute("Type");
}
ilPCTabs::init ( )

Init page content component.

Reimplemented from ilPageContent.

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

References ilPageContent\setType().

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

+ Here is the call graph for this function:

ilPCTabs::setCaptions (   $a_captions)

Add Tab items.

Definition at line 107 of file class.ilPCTabs.php.

References ilDOMUtil\deleteAllChildsByName(), and ilDOMUtil\setFirstOptionalElement().

{
// iterate all tab nodes
$j = 0;
$tab_nodes = $this->tabs_node->child_nodes();
for($i = 0; $i < count($tab_nodes); $i++)
{
if ($tab_nodes[$i]->node_name() == "Tab")
{
// if caption given, set it, otherwise delete caption subitem
if ($a_captions[$j] != "")
{
ilDOMUtil::setFirstOptionalElement($this->dom, $tab_nodes[$i], "TabCaption",
array("PageContent"), $a_captions[$j], array());
}
else
{
ilDOMUtil::deleteAllChildsByName($tab_nodes[$i], array("TabCaption"));
}
$j++;
}
}
}

+ Here is the call graph for this function:

ilPCTabs::setNode ( $a_node)

Set content node.

Reimplemented from ilPageContent.

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

{
parent::setNode($a_node); // this is the PageContent node
$this->tabs_node =& $a_node->first_child(); // this is the Tabs node
}
ilPCTabs::setTabType (   $a_type = "HorizontalTabs")

Set type of tabs.

Parameters
string$a_type("HorizontalTabs" | "Accordion")

Definition at line 85 of file class.ilPCTabs.php.

{
switch ($a_type)
{
case "HorizontalTabs":
case "Accordion":
$this->tabs_node->set_attribute("Type", $a_type);
break;
}
}

Field Documentation

ilPCTabs::$tabs_node

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


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