ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilPCSection.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5require_once("./Services/COPage/classes/class.ilPageContent.php");
6
18{
19 var $dom;
21
25 function init()
26 {
27 $this->setType("sec");
28 }
29
33 function setNode(&$a_node)
34 {
35 parent::setNode($a_node); // this is the PageContent node
36 $this->sec_node =& $a_node->first_child(); // this is the Section node
37 }
38
45 function create(&$a_pg_obj, $a_hier_id, $a_pc_id = "")
46 {
47 $this->node = $this->createPageContentNode();
48 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
49 $this->sec_node =& $this->dom->create_element("Section");
50 $this->sec_node =& $this->node->append_child($this->sec_node);
51 $this->sec_node->set_attribute("Characteristic", "Block");
52 }
53
59 function setCharacteristic($a_char)
60 {
61 if (!empty($a_char))
62 {
63 $this->sec_node->set_attribute("Characteristic", $a_char);
64 }
65 else
66 {
67 if ($this->sec_node->has_attribute("Characteristic"))
68 {
69 $this->sec_node->remove_attribute("Characteristic");
70 }
71 }
72 }
73
80 {
81 if (is_object($this->sec_node))
82 {
83 $char = $this->sec_node->get_attribute("Characteristic");
84 if (substr($char, 0, 4) == "ilc_")
85 {
86 $char = substr($char, 4);
87 }
88 return $char;
89 }
90 }
91
96 static function getLangVars()
97 {
98 return array("ed_insert_section");
99 }
100
101}
102
103?>
const IL_INSERT_AFTER
Class ilPCSection.
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create section node in xml.
setCharacteristic($a_char)
Set Characteristic of section.
init()
Init page content component.
getCharacteristic()
Get characteristic of section.
static getLangVars()
Get lang vars needed for editing.
setNode(&$a_node)
Set node.
Class ilPageContent.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element)
setType($a_type)
Set Type.