ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPCSection.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 require_once("./Services/COPage/classes/class.ilPageContent.php");
25 
37 {
38  var $dom;
39  var $sec_node;
40 
44  function init()
45  {
46  $this->setType("sec");
47  }
48 
52  function setNode(&$a_node)
53  {
54  parent::setNode($a_node); // this is the PageContent node
55  $this->sec_node =& $a_node->first_child(); // this is the Section node
56  }
57 
64  function create(&$a_pg_obj, $a_hier_id, $a_pc_id = "")
65  {
66  $this->node = $this->createPageContentNode();
67  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
68  $this->sec_node =& $this->dom->create_element("Section");
69  $this->sec_node =& $this->node->append_child($this->sec_node);
70  $this->sec_node->set_attribute("Characteristic", "Block");
71  }
72 
78  function setCharacteristic($a_char)
79  {
80  if (!empty($a_char))
81  {
82  $this->sec_node->set_attribute("Characteristic", $a_char);
83  }
84  else
85  {
86  if ($this->sec_node->has_attribute("Characteristic"))
87  {
88  $this->sec_node->remove_attribute("Characteristic");
89  }
90  }
91  }
92 
98  function getCharacteristic()
99  {
100  if (is_object($this->sec_node))
101  {
102  $char = $this->sec_node->get_attribute("Characteristic");
103  if (substr($char, 0, 4) == "ilc_")
104  {
105  $char = substr($char, 4);
106  }
107  return $char;
108  }
109  }
110 }
111 
112 ?>