24 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
56 $this->tabs_node =& $a_node->first_child();
62 function create(&$a_pg_obj, $a_hier_id, $a_pc_id =
"")
66 $this->tabs_node =& $this->dom->create_element(
"Tabs");
67 $this->tabs_node =& $this->node->append_child($this->tabs_node);
80 $this->tabs_node->set_attribute($a_attr, $a_value);
84 if ($this->tabs_node->has_attribute($a_attr))
86 $this->tabs_node->remove_attribute($a_attr);
102 $this->tabs_node->set_attribute(
"Type", $a_type);
112 return $this->tabs_node->get_attribute(
"Type");
132 return $this->tabs_node->get_attribute(
"ContentWidth");
152 return $this->tabs_node->get_attribute(
"ContentHeight");
172 return $this->tabs_node->get_attribute(
"HorizontalAlign");
192 return $this->tabs_node->get_attribute(
"Behavior");
201 $tab_nodes = $this->tabs_node->child_nodes();
203 for($i = 0; $i < count($tab_nodes); $i++)
205 if ($tab_nodes[$i]->node_name() ==
"Tab")
207 $pc_id = $tab_nodes[$i]->get_attribute(
"PCID");
208 $hier_id = $tab_nodes[$i]->get_attribute(
"HierId");
210 $tab_node_childs = $tab_nodes[$i]->child_nodes();
211 $current_caption =
"";
212 for($j = 0; $j < count($tab_node_childs); $j++)
214 if ($tab_node_childs[$j]->node_name() ==
"TabCaption")
216 $current_caption = $tab_node_childs[$j]->get_content();
219 $captions[] = array(
"pos" => $k,
220 "caption" => $current_caption,
"pc_id" => $pc_id,
"hier_id" =>
$hier_id);
234 $tab_nodes = $this->tabs_node->child_nodes();
236 for($i = 0; $i < count($tab_nodes); $i++)
238 if ($tab_nodes[$i]->node_name() ==
"Tab")
240 if ($a_pc_id == $tab_nodes[$i]->get_attribute(
"PCID") &&
241 ($a_hier_id == $tab_nodes[$i]->get_attribute(
"HierId")))
243 $tab_node_childs = $tab_nodes[$i]->child_nodes();
244 for($j = 0; $j < count($tab_node_childs); $j++)
246 if ($tab_node_childs[$j]->node_name() ==
"TabCaption")
248 return $tab_node_childs[$j]->get_content();
266 $childs = $this->tabs_node->child_nodes();
268 for ($i=0; $i<count($childs); $i++)
270 if ($childs[$i]->node_name() ==
"Tab")
272 $pc_id = $childs[$i]->get_attribute(
"PCID");
273 $hier_id = $childs[$i]->get_attribute(
"HierId");
274 $nodes[
$hier_id.
":".$pc_id] = $childs[$i];
275 $childs[$i]->unlink($childs[$i]);
279 foreach($a_pos as $k => $v)
281 if (is_object($nodes[$k]))
283 $nodes[$k] = $this->tabs_node->append_child($nodes[$k]);
294 $tab_nodes = $this->tabs_node->child_nodes();
295 for($i = 0; $i < count($tab_nodes); $i++)
297 if ($tab_nodes[$i]->node_name() ==
"Tab")
299 $pc_id = $tab_nodes[$i]->get_attribute(
"PCID");
300 $hier_id = $tab_nodes[$i]->get_attribute(
"HierId");
303 if ($a_captions[$k] !=
"")
306 array(), $a_captions[$k], array());
322 $childs = $this->tabs_node->child_nodes();
324 for ($i=0; $i<count($childs); $i++)
326 if ($childs[$i]->node_name() ==
"Tab")
328 if ($a_pc_id == $childs[$i]->get_attribute(
"PCID") &&
329 $a_hier_id == $childs[$i]->get_attribute(
"HierId"))
331 $childs[$i]->unlink($childs[$i]);
342 $new_item = $this->dom->create_element(
"Tab");
343 $new_item = $this->tabs_node->append_child($new_item);
345 array(), $a_caption, array());
365 return $this->tabs_node->get_attribute(
"Template");
374 return array(
"pc_vacc",
"pc_hacc");