24 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
55 parent::setNode($a_node);
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");
getBehavior()
Get behavior.
setContentWidth($a_val)
Set content width.
getCaptions()
Get captions.
getContentWidth()
Get content width.
getContentHeight()
Get content height.
static getLangVars()
Get lang vars needed for editing.
init()
Init page content component.
setBehavior($a_val)
Set behavior.
setType($a_type)
Set Type.
getTemplate()
Get template.
setTemplate($a_template)
Set template.
setNode(&$a_node)
Set content node.
getCaption($a_hier_id, $a_pc_id)
Get caption.
savePositions($a_pos)
Save positions of tabs.
setHorizontalAlign($a_val)
Set horizontal align.
setContentHeight($a_val)
Set content height.
addTab($a_caption)
Add a tab.
getTabType()
Get type of tabs.
setTabsAttribute($a_attr, $a_value)
Set attribute of tabs tag.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
getHorizontalAlign()
Get horizontal align.
saveCaptions($a_captions)
Add Tab items.
deleteAllChildsByName(&$a_parent, $a_node_names)
delete all childs of a node by names in $a_node_names
setFirstOptionalElement(&$doc, &$parent_node, $a_node_name, $a_successors, $a_content, $a_attributes, $a_remove_childs=true)
searches for an element $a_node_name within the childs of $parent_node if no node is found...
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create new Tabs node.
deleteTab($a_hier_id, $a_pc_id)
Save positions of tabs.
setTabType($a_type="HorizontalTabs")
Set type of tabs.