24 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
56 parent::setNode($a_node);
57 $this->tabs_node = $a_node->first_child();
63 function create(&$a_pg_obj, $a_hier_id, $a_pc_id =
"")
67 $this->tabs_node = $this->dom->create_element(
"Tabs");
68 $this->tabs_node = $this->node->append_child($this->tabs_node);
81 $this->tabs_node->set_attribute($a_attr, $a_value);
85 if ($this->tabs_node->has_attribute($a_attr))
87 $this->tabs_node->remove_attribute($a_attr);
104 $this->tabs_node->set_attribute(
"Type",
$a_type);
114 return $this->tabs_node->get_attribute(
"Type");
134 return $this->tabs_node->get_attribute(
"ContentWidth");
154 return $this->tabs_node->get_attribute(
"ContentHeight");
174 return $this->tabs_node->get_attribute(
"HorizontalAlign");
194 return $this->tabs_node->get_attribute(
"Behavior");
203 $tab_nodes = $this->tabs_node->child_nodes();
205 for($i = 0; $i < count($tab_nodes); $i++)
207 if ($tab_nodes[$i]->node_name() ==
"Tab")
209 $pc_id = $tab_nodes[$i]->get_attribute(
"PCID");
210 $hier_id = $tab_nodes[$i]->get_attribute(
"HierId");
212 $tab_node_childs = $tab_nodes[$i]->child_nodes();
213 $current_caption =
"";
214 for($j = 0; $j < count($tab_node_childs); $j++)
216 if ($tab_node_childs[$j]->node_name() ==
"TabCaption")
218 $current_caption = $tab_node_childs[$j]->get_content();
221 $captions[] =
array(
"pos" => $k,
222 "caption" => $current_caption,
"pc_id" => $pc_id,
"hier_id" =>
$hier_id);
236 $tab_nodes = $this->tabs_node->child_nodes();
238 for($i = 0; $i < count($tab_nodes); $i++)
240 if ($tab_nodes[$i]->node_name() ==
"Tab")
242 if ($a_pc_id == $tab_nodes[$i]->get_attribute(
"PCID") &&
243 ($a_hier_id == $tab_nodes[$i]->get_attribute(
"HierId")))
245 $tab_node_childs = $tab_nodes[$i]->child_nodes();
246 for($j = 0; $j < count($tab_node_childs); $j++)
248 if ($tab_node_childs[$j]->node_name() ==
"TabCaption")
250 return $tab_node_childs[$j]->get_content();
268 $childs = $this->tabs_node->child_nodes();
270 for ($i=0; $i<count($childs); $i++)
272 if ($childs[$i]->node_name() ==
"Tab")
274 $pc_id = $childs[$i]->get_attribute(
"PCID");
275 $hier_id = $childs[$i]->get_attribute(
"HierId");
276 $nodes[
$hier_id.
":".$pc_id] = $childs[$i];
277 $childs[$i]->unlink($childs[$i]);
281 foreach($a_pos as $k => $v)
283 if (is_object($nodes[$k]))
285 $nodes[$k] = $this->tabs_node->append_child($nodes[$k]);
296 $tab_nodes = $this->tabs_node->child_nodes();
297 for($i = 0; $i < count($tab_nodes); $i++)
299 if ($tab_nodes[$i]->node_name() ==
"Tab")
301 $pc_id = $tab_nodes[$i]->get_attribute(
"PCID");
302 $hier_id = $tab_nodes[$i]->get_attribute(
"HierId");
305 if ($a_captions[$k] !=
"")
324 $childs = $this->tabs_node->child_nodes();
326 for ($i=0; $i<count($childs); $i++)
328 if ($childs[$i]->node_name() ==
"Tab")
330 if ($a_pc_id == $childs[$i]->get_attribute(
"PCID") &&
331 $a_hier_id == $childs[$i]->get_attribute(
"HierId"))
333 $childs[$i]->unlink($childs[$i]);
344 $new_item = $this->dom->create_element(
"Tab");
345 $new_item = $this->tabs_node->append_child($new_item);
367 return $this->tabs_node->get_attribute(
"Template");
376 return array(
"pc_vacc",
"pc_hacc",
"pc_carousel");
397 return $this->tabs_node->get_attribute(
"AutoAnimWait");
417 return $this->tabs_node->get_attribute(
"RandomStart");
425 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
434 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
static getLocalCssFiles()
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.
setRandomStart($a_val)
Set random start.
init()
Init page content component.
setBehavior($a_val)
Set behavior.
static deleteAllChildsByName($a_parent, $a_node_names)
delete all childs of a node by names in $a_node_names
setType($a_type)
Set Type.
getTemplate()
Get template.
setTemplate($a_template)
Set template.
getCaption($a_hier_id, $a_pc_id)
Get caption.
static getLocalJavascriptFiles()
getCssFiles($a_mode)
Get Javascript files.
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.
static 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...
setTabsAttribute($a_attr, $a_value)
Set attribute of tabs tag.
setAutoTime($a_val)
Set auto animation waiting time.
setNode($a_node)
Set content node.
Create styles array
The data for the language used.
getAutoTime()
Get auto animation waiting time.
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.
getJavascriptFiles($a_mode)
Get Javascript files.
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.
getRandomStart()
Get random start.