ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPCTab.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 require_once("./Services/COPage/classes/class.ilPageContent.php");
6 
17 class ilPCTab extends ilPageContent
18 {
19  var $dom;
20 
24  function init()
25  {
26  $this->setType("tabstab");
27  }
28 
32  function newItemAfter()
33  {
34  $tab = $this->getNode();
35  $new_tab =& $this->dom->create_element("Tab");
36  if ($next_tab =& $tab->next_sibling())
37  {
38  $new_tab =& $next_tab->insert_before($new_tab, $next_tab);
39  }
40  else
41  {
42  $parent_tabs = $tab->parent_node();
43  $new_tab =& $parent_tabs->append_child($new_tab);
44  }
45  }
46 
47 
51  function newItemBefore()
52  {
53  $tab = $this->getNode();
54  $new_tab = $this->dom->create_element("Tab");
55  $new_tab = $tab->insert_before($new_tab, $tab);
56  }
57 
58 
62  function deleteItem()
63  {
64  $tab =& $this->getNode();
65  $tab->unlink($tab);
66  }
67 
71  function moveItemDown()
72  {
73  $tab = $this->getNode();
74  $next = $tab->next_sibling();
75  $next_copy = $next->clone_node(true);
76  $next_copy = $tab->insert_before($next_copy, $tab);
77  $next->unlink($next);
78  }
79 
83  function moveItemUp()
84  {
85  $tab = $this->getNode();
86  $prev = $tab->previous_sibling();
87  $tab_copy = $tab->clone_node(true);
88  $tab_copy =& $prev->insert_before($tab_copy, $prev);
89  $tab->unlink($tab);
90  }
91 
92 }
93 ?>