ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
5require_once("./Services/COPage/classes/class.ilPageContent.php");
6
18{
19 public $dom;
20
24 public function init()
25 {
26 $this->setType("tabstab");
27 }
28
32 public function newItemAfter()
33 {
34 $tab = $this->getNode();
35 $new_tab = $this->dom->create_element("Tab");
36 if ($next_tab = $tab->next_sibling()) {
37 $new_tab = $next_tab->insert_before($new_tab, $next_tab);
38 } else {
39 $parent_tabs = $tab->parent_node();
40 $new_tab = $parent_tabs->append_child($new_tab);
41 }
42 }
43
44
48 public function newItemBefore()
49 {
50 $tab = $this->getNode();
51 $new_tab = $this->dom->create_element("Tab");
52 $new_tab = $tab->insert_before($new_tab, $tab);
53 }
54
55
59 public function deleteItem()
60 {
61 $tab = $this->getNode();
62 $tab->unlink($tab);
63 }
64
68 public function moveItemDown()
69 {
70 $tab = $this->getNode();
71 $next = $tab->next_sibling();
72 $next_copy = $next->clone_node(true);
73 $next_copy = $tab->insert_before($next_copy, $tab);
74 $next->unlink($next);
75 }
76
80 public function moveItemUp()
81 {
82 $tab = $this->getNode();
83 $prev = $tab->previous_sibling();
84 $tab_copy = $tab->clone_node(true);
85 $tab_copy = $prev->insert_before($tab_copy, $prev);
86 $tab->unlink($tab);
87 }
88}
An exception for terminatinating execution or to throw for unit testing.
Class ilPCTab.
deleteItem()
delete tab
newItemAfter()
insert new tab item after current one
newItemBefore()
insert new tab item before current one
moveItemUp()
move tab item up
moveItemDown()
move tab item down
init()
Init page content component.
Class ilPageContent.
& getNode()
Get xml node of page content.
setType($a_type)
Set Type.