24require_once(
"./Services/COPage/classes/class.ilPageContent.php");
 
   56        parent::setNode($a_node);               
 
   57        $this->tabs_node = $a_node->first_child();              
 
   63    public 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);
 
   79        if (!empty($a_value)) {
 
   80            $this->tabs_node->set_attribute($a_attr, $a_value);
 
   82            if ($this->tabs_node->has_attribute($a_attr)) {
 
   83                $this->tabs_node->remove_attribute($a_attr);
 
   99                $this->tabs_node->set_attribute(
"Type", 
$a_type);
 
  109        return $this->tabs_node->get_attribute(
"Type");
 
  129        return $this->tabs_node->get_attribute(
"ContentWidth");
 
  149        return $this->tabs_node->get_attribute(
"ContentHeight");
 
  169        return $this->tabs_node->get_attribute(
"HorizontalAlign");
 
  189        return $this->tabs_node->get_attribute(
"Behavior");
 
  198        $tab_nodes = $this->tabs_node->child_nodes();
 
  200        for (
$i = 0; 
$i < count($tab_nodes); 
$i++) {
 
  201            if ($tab_nodes[
$i]->node_name() == 
"Tab") {
 
  202                $pc_id = $tab_nodes[
$i]->get_attribute(
"PCID");
 
  203                $hier_id = $tab_nodes[
$i]->get_attribute(
"HierId");
 
  205                $tab_node_childs = $tab_nodes[
$i]->child_nodes();
 
  206                $current_caption = 
"";
 
  207                for ($j = 0; $j < count($tab_node_childs); $j++) {
 
  208                    if ($tab_node_childs[$j]->node_name() == 
"TabCaption") {
 
  209                        $current_caption = $tab_node_childs[$j]->get_content();
 
  212                $captions[] = array(
"pos" => $k,
 
  213                    "caption" => $current_caption, 
"pc_id" => $pc_id, 
"hier_id" => 
$hier_id);
 
  227        $tab_nodes = $this->tabs_node->child_nodes();
 
  229        for (
$i = 0; 
$i < count($tab_nodes); 
$i++) {
 
  230            if ($tab_nodes[
$i]->node_name() == 
"Tab") {
 
  231                if ($a_pc_id == $tab_nodes[
$i]->get_attribute(
"PCID") &&
 
  232                    ($a_hier_id == $tab_nodes[
$i]->get_attribute(
"HierId"))) {
 
  233                    $tab_node_childs = $tab_nodes[
$i]->child_nodes();
 
  234                    for ($j = 0; $j < count($tab_node_childs); $j++) {
 
  235                        if ($tab_node_childs[$j]->node_name() == 
"TabCaption") {
 
  236                            return $tab_node_childs[$j]->get_content();
 
  254        $childs = $this->tabs_node->child_nodes();
 
  256        for (
$i=0; 
$i<count($childs); 
$i++) {
 
  257            if ($childs[
$i]->node_name() == 
"Tab") {
 
  258                $pc_id = $childs[
$i]->get_attribute(
"PCID");
 
  259                $hier_id = $childs[
$i]->get_attribute(
"HierId");
 
  260                $nodes[
$hier_id . 
":" . $pc_id] = $childs[
$i];
 
  261                $childs[
$i]->unlink($childs[
$i]);
 
  265        foreach ($a_pos as $k => $v) {
 
  266            if (is_object($nodes[$k])) {
 
  267                $nodes[$k] = $this->tabs_node->append_child($nodes[$k]);
 
  278        $tab_nodes = $this->tabs_node->child_nodes();
 
  279        for (
$i = 0; 
$i < count($tab_nodes); 
$i++) {
 
  280            if ($tab_nodes[
$i]->node_name() == 
"Tab") {
 
  281                $pc_id = $tab_nodes[
$i]->get_attribute(
"PCID");
 
  282                $hier_id = $tab_nodes[
$i]->get_attribute(
"HierId");
 
  285                if ($a_captions[$k] != 
"") {
 
  307        $childs = $this->tabs_node->child_nodes();
 
  309        for (
$i=0; 
$i<count($childs); 
$i++) {
 
  310            if ($childs[
$i]->node_name() == 
"Tab") {
 
  311                if ($a_pc_id == $childs[
$i]->get_attribute(
"PCID") &&
 
  312                    $a_hier_id == $childs[
$i]->get_attribute(
"HierId")) {
 
  313                    $childs[
$i]->unlink($childs[
$i]);
 
  324        $new_item = $this->dom->create_element(
"Tab");
 
  325        $new_item = $this->tabs_node->append_child($new_item);
 
  353        return $this->tabs_node->get_attribute(
"Template");
 
  362        return array(
"pc_vacc", 
"pc_hacc", 
"pc_carousel");
 
  383        return $this->tabs_node->get_attribute(
"AutoAnimWait");
 
  403        return $this->tabs_node->get_attribute(
"RandomStart");
 
  411        include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
 
  420        include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
 
An exception for terminatinating execution or to throw for unit testing.
static getLocalJavascriptFiles()
static getLocalCssFiles()
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,...
static deleteAllChildsByName($a_parent, $a_node_names)
delete all childs of a node by names in $a_node_names
deleteTab($a_hier_id, $a_pc_id)
Save positions of tabs.
getTemplate()
Get template.
savePositions($a_pos)
Save positions of tabs.
getContentHeight()
Get content height.
setNode($a_node)
Set content node.
saveCaptions($a_captions)
Add Tab items.
getAutoTime()
Get auto animation waiting time.
getBehavior()
Get behavior.
getContentWidth()
Get content width.
static getLangVars()
Get lang vars needed for editing.
setAutoTime($a_val)
Set auto animation waiting time.
getTabType()
Get type of tabs.
getJavascriptFiles($a_mode)
Get Javascript files.
setBehavior($a_val)
Set behavior.
init()
Init page content component.
setTabType($a_type="HorizontalTabs")
Set type of tabs.
getHorizontalAlign()
Get horizontal align.
getCaptions()
Get captions.
setTemplate($a_template)
Set template.
getCssFiles($a_mode)
Get Javascript files.
getRandomStart()
Get random start.
setContentWidth($a_val)
Set content width.
getCaption($a_hier_id, $a_pc_id)
Get caption.
setHorizontalAlign($a_val)
Set horizontal align.
setContentHeight($a_val)
Set content height.
setTabsAttribute($a_attr, $a_value)
Set attribute of tabs tag.
setRandomStart($a_val)
Set random start.
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create new Tabs node.
addTab($a_caption)
Add a tab.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element)
setType($a_type)
Set Type.