/**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng;
     $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
     $this->tpl->setVariable("PAGE_ID", $a_set["obj_id"]);
     $screen_ids = ilHelpMapping::getScreenIdsOfChapter($a_set["obj_id"]);
     $this->tpl->setVariable("SCREEN_IDS", ilUtil::prepareFormOutput(implode($screen_ids, "\n")));
 }
 /**
  * Delete Chapter
  */
 function delete($a_delete_meta_data = true)
 {
     // only relevant for online help authoring
     include_once "./Services/Help/classes/class.ilHelpMapping.php";
     ilHelpMapping::removeScreenIdsOfChapter($this->getId());
     $this->tree = new ilTree($this->getLmId());
     $this->tree->setTableNames('lm_tree', 'lm_data');
     $this->tree->setTreeTablePK("lm_id");
     $node_data = $this->tree->getNodeData($this->getId());
     $this->delete_rec($this->tree, $a_delete_meta_data);
     $this->tree->deleteTree($node_data);
 }
 /**
  * Save help mapping
  *
  * @param
  * @return
  */
 function saveHelpMapping()
 {
     global $lng, $ilCtrl;
     include_once "./Services/Help/classes/class.ilHelpMapping.php";
     if (is_array($_POST["screen_ids"])) {
         foreach ($_POST["screen_ids"] as $chap => $ids) {
             $ids = explode("\n", $ids);
             ilHelpMapping::saveScreenIdsForChapter($chap, $ids);
         }
     }
     ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
     $ilCtrl->redirect($this, "showExportIdsOverview");
 }
 /**
  * Show online help
  */
 function showHelp()
 {
     global $ilHelp, $lng, $ilSetting;
     if ($_GET["help_screen_id"] != "") {
         ilSession::set("help_screen_id", $_GET["help_screen_id"]);
         $help_screen_id = $_GET["help_screen_id"];
     } else {
         $help_screen_id = ilSession::get("help_screen_id");
     }
     $this->resetCurrentPage();
     $id_arr = explode(".", $help_screen_id);
     include_once "./Services/Help/classes/class.ilHelpMapping.php";
     $help_arr = ilHelpMapping::getHelpSectionsForId($id_arr[0], $id_arr[1]);
     $hm = (int) $ilSetting->get("help_module");
     if ((OH_REF_ID > 0 || $hm > 0) && count($help_arr) > 0) {
         if (OH_REF_ID > 0) {
             $oh_lm_id = ilObject::_lookupObjId(OH_REF_ID);
         } else {
             include_once "./Services/Help/classes/class.ilObjHelpSettings.php";
             $oh_lm_id = ilObjHelpSettings::lookupModuleLmId($hm);
         }
         include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
         $acc = new ilAccordionGUI();
         $acc->setId("oh_acc");
         $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
         foreach ($help_arr as $h_id) {
             include_once "./Modules/LearningModule/classes/class.ilLMObject.php";
             $st_id = $h_id;
             if (!ilLMObject::_exists($st_id)) {
                 continue;
             }
             $pages = ilLMObject::getPagesOfChapter($oh_lm_id, $st_id);
             include_once "./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php";
             $grp_list = new ilGroupedListGUI();
             foreach ($pages as $pg) {
                 $grp_list->addEntry(ilLMObject::_lookupTitle($pg["child"]), "#", "", "return il.Help.showPage(" . $pg["child"] . ");");
             }
             $acc->addItem(ilLMObject::_lookupTitle($st_id), $grp_list->getHTML());
         }
         $h_tpl = new ilTemplate("tpl.help.html", true, true, "Services/Help");
         $h_tpl->setVariable("HEAD", $lng->txt("help"));
         $h_tpl->setVariable("CONTENT", $acc->getHTML());
         $h_tpl->setVariable("CLOSE_IMG", ilUtil::img(ilUtil::getImagePath("icon_close2_s.png")));
         echo $h_tpl->get();
     }
     exit;
 }
Example #5
0
 /**
  * Import record
  *
  * @param
  * @return
  */
 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 {
     switch ($a_entity) {
         case "help_map":
             include_once "./Services/Help/classes/class.ilHelpMapping.php";
             // without module ID we do nothing
             $module_id = $a_mapping->getMapping('Services/Help', 'help_module', 0);
             if ($module_id) {
                 $new_chap = $a_mapping->getMapping('Services/Help', 'help_chap', $a_rec["Chap"]);
                 if ($new_chap > 0) {
                     ilHelpMapping::saveMappingEntry($new_chap, $a_rec["Component"], $a_rec["ScreenId"], $a_rec["ScreenSubId"], $a_rec["Perm"], $module_id);
                 }
             }
             break;
         case "help_tooltip":
             include_once "./Services/Help/classes/class.ilHelp.php";
             // without module ID we do nothing
             $module_id = $a_mapping->getMapping('Services/Help', 'help_module', 0);
             if ($module_id) {
                 ilHelp::addTooltip($a_rec["TtId"], $a_rec["TtText"], $module_id);
             }
             break;
     }
 }
 /**
  * Delete module
  *
  * @param
  * @return
  */
 function deleteModule($a_id)
 {
     global $ilDB, $ilSetting;
     // if this is the currently activated one, deactivate it first
     if ($a_id == (int) $ilSetting->get("help_module")) {
         $ilSetting->set("help_module", "");
     }
     $set = $ilDB->query("SELECT * FROM help_module " . " WHERE id = " . $ilDB->quote($a_id, "integer"));
     $rec = $ilDB->fetchAssoc($set);
     // delete learning module
     if (ilObject::_lookupType($rec["lm_id"]) == "lm") {
         include_once "./Modules/LearningModule/classes/class.ilObjLearningModule.php";
         $lm = new ilObjLearningModule($rec["lm_id"], false);
         $lm->delete();
     }
     // delete mappings
     include_once "./Services/Help/classes/class.ilHelpMapping.php";
     ilHelpMapping::deleteEntriesOfModule($a_id);
     // delete tooltips
     include_once "./Services/Help/classes/class.ilHelp.php";
     ilHelp::deleteTooltipsOfModule($a_id);
     // delete help module record
     $ilDB->manipulate("DELETE FROM help_module WHERE " . " id = " . $ilDB->quote($a_id, "integer"));
 }