/**
  * Add Tab items
  */
 function saveCaptions($a_captions)
 {
     // iterate all tab nodes
     $tab_nodes = $this->tabs_node->child_nodes();
     for ($i = 0; $i < count($tab_nodes); $i++) {
         if ($tab_nodes[$i]->node_name() == "Tab") {
             $pc_id = $tab_nodes[$i]->get_attribute("PCID");
             $hier_id = $tab_nodes[$i]->get_attribute("HierId");
             $k = $hier_id . ":" . $pc_id;
             // if caption given, set it, otherwise delete caption subitem
             if ($a_captions[$k] != "") {
                 ilDOMUtil::setFirstOptionalElement($this->dom, $tab_nodes[$i], "TabCaption", array(), $a_captions[$k], array());
             } else {
                 ilDOMUtil::deleteAllChildsByName($tab_nodes[$i], array("TabCaption"));
             }
         }
     }
 }
Esempio n. 2
0
 /**
  * set table caption
  */
 function setCaption($a_content, $a_align)
 {
     if ($a_content != "") {
         ilDOMUtil::setFirstOptionalElement($this->dom, $this->tab_node, "Caption", array("Summary", "TableRow"), $a_content, array("Align" => $a_align));
     } else {
         ilDOMUtil::deleteAllChildsByName($this->tab_node, array("Caption"));
     }
 }
 /**
  * Set link of area to an external one
  */
 function setAreaExtLink($a_nr, $a_href)
 {
     $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose, $this->getPcId());
     if (is_object($ma_nodes[$a_nr - 1])) {
         $title = $this->getTitleOfArea($a_nr);
         ilDOMUtil::deleteAllChildsByName($ma_nodes[$a_nr - 1], array("IntLink", "ExtLink"));
         $attributes = array("Href" => $a_href);
         ilDOMUtil::setFirstOptionalElement($this->dom, $ma_nodes[$a_nr - 1], "ExtLink", array(""), $title, $attributes);
     }
 }