ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
5 require_once("./Services/COPage/classes/class.ilPageContent.php");
6 
18 {
19  var $dom;
20  var $sec_node;
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 
79  function getCharacteristic()
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 ?>