/** * Constructor */ function __construct($a_parent_obj, $a_parent_cmd, $a_tax_node) { global $ilCtrl, $lng; $this->glossary = $a_parent_obj->object; $this->setId("glotl" . $this->glossary->getId()); $this->tax_node = $a_tax_node; $this->selectable_cols = array(); include_once "./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php"; $adv_ad = new ilGlossaryAdvMetaDataAdapter($this->glossary->getId()); $this->adv_fields = $adv_ad->getAllFields(); foreach ($this->adv_fields as $f) { $this->selectable_cols["md_" . $f["id"]] = array("txt" => $f["title"], "default" => false); } // selectable columns $this->selectable_cols["language"] = array("txt" => $lng->txt("language"), "default" => true); $this->selectable_cols["usage"] = array("txt" => $lng->txt("cont_usage"), "default" => true); // selectable columns of advanced metadata parent::__construct($a_parent_obj, $a_parent_cmd); $this->setTitle($lng->txt("cont_terms")); $this->addColumn("", "", "1", true); //$this->addColumn($this->lng->txt("cont_term")); include_once "./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php"; $adv_ap = new ilGlossaryAdvMetaDataAdapter($this->glossary->getId()); $this->adv_cols_order = $adv_ap->getColumnOrder(); $this->selected_cols = $this->getSelectedColumns(); foreach ($this->adv_cols_order as $c) { if ($c["id"] == 0) { $this->addColumn($lng->txt("cont_term"), "term"); } else { if (in_array("md_" . $c["id"], $this->selected_cols)) { $this->addColumn($c["text"], "md_" . $c["id"]); } } } foreach (array("language", "usage") as $c) { if (in_array($c, $this->selected_cols)) { $this->addColumn($this->selectable_cols[$c]["txt"]); } } $this->setDefaultOrderDirection("asc"); $this->setDefaultOrderField("term"); $this->addColumn($this->lng->txt("cont_definitions")); if (in_array($this->glossary->getVirtualMode(), array("level", "subtree"))) { $this->addColumn($this->lng->txt("obj_glo")); } $this->addColumn("", "", "1"); $this->setEnableHeader(true); $this->setFormAction($ilCtrl->getFormAction($a_parent_obj)); $this->setRowTemplate("tpl.term_tbl_row.html", "Modules/Glossary"); $this->setEnableTitle(true); $this->addMultiCommand("confirmTermDeletion", $lng->txt("delete")); //$this->addMultiCommand("addDefinition", $lng->txt("cont_add_definition")); $this->setShowRowsSelector(true); $this->initFilter(); $this->setData($this->glossary->getTermList($this->filter["term"], "", $this->filter["definition"], $this->tax_node, true, true)); }
/** * Constructor */ function __construct($a_parent_obj, $a_parent_cmd, $a_glossary, $a_offline, $a_tax_node, $a_tax_id = 0) { global $ilCtrl, $lng, $ilAccess, $lng; $this->glossary = $a_glossary; $this->offline = $a_offline; $this->tax_node = $a_tax_node; $this->tax_id = $a_tax_id; $this->setId("glopr" . $this->glossary->getId()); include_once "./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php"; $adv_ad = new ilGlossaryAdvMetaDataAdapter($this->glossary->getId()); $this->adv_fields = $adv_ad->getAllFields(); parent::__construct($a_parent_obj, $a_parent_cmd); //$this->setTitle($lng->txt("cont_terms")); if ($this->glossary->getPresentationMode() == "full_def") { $this->addColumn($lng->txt("cont_terms")); } else { include_once "./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php"; $adv_ap = new ilGlossaryAdvMetaDataAdapter($this->glossary->getId()); $this->adv_cols_order = $adv_ap->getColumnOrder(); foreach ($this->adv_cols_order as $c) { if ($c["id"] == 0) { $this->addColumn($lng->txt("cont_term"), "term"); } else { $this->addColumn($c["text"], "md_" . $c["id"]); } } $this->addColumn($lng->txt("cont_definitions")); if ($this->glossary->isVirtual()) { $this->addColumn($lng->txt("obj_glo")); } } $this->setEnableHeader(true); if (!$this->offline) { $this->setFormAction($ilCtrl->getFormAction($this->parent_obj)); } else { $this->disable("footer"); } $this->setRowTemplate("tpl.term_tbl_pres_row.html", "Modules/Glossary"); $this->setEnableTitle(true); if (!$this->offline) { $this->initFilter(); $this->setFilterCommand("applyFilter"); $this->setShowRowsSelector(true); } // advanced metadata include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php'; $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_FILTER, 'glo', $this->glossary->getId(), 'term'); $this->record_gui->setSelectedOnly(true); $this->record_gui->setTableGUI($this); $this->record_gui->parse(); //$this->setDefaultOrderField("login"); //$this->setDefaultOrderDirection("asc"); $this->setData($this->glossary->getTermList($this->filter["term"], $_GET["letter"], $this->filter["definition"], $this->tax_node, false, true, $this->record_gui->getFilterElements())); // $this->setData(array()); }
/** * save properties */ function saveProperties() { global $tpl; $this->initSettingsForm(); if ($this->form->checkInput()) { $this->object->setTitle($_POST['title']); $this->object->setDescription($_POST['description']); $this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"])); $this->object->setVirtualMode($_POST["glo_mode"]); // $this->object->setActiveGlossaryMenu(ilUtil::yn2tf($_POST["glo_act_menu"])); $this->object->setActiveDownloads(ilUtil::yn2tf($_POST["glo_act_downloads"])); $this->object->setPresentationMode($_POST["pres_mode"]); $this->object->setSnippetLength($_POST["snippet_length"]); $this->object->setShowTaxonomy($_POST["show_tax"]); $this->object->update(); // field order of advanced metadata include_once "./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php"; $adv_ap = new ilGlossaryAdvMetaDataAdapter($this->object->getId()); $cols = $adv_ap->getColumnOrder(); if (count($cols) > 1) { $adv_ap->saveColumnOrder($_POST["field_order"]); } // set definition short texts dirty include_once "./Modules/Glossary/classes/class.ilGlossaryDefinition.php"; ilGlossaryDefinition::setShortTextsDirty($this->object->getId()); // update metadata record selection include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php'; $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_REC_SELECTION, 'glo', $this->object->getId(), "term"); $record_gui->saveSelection(); // Update ecs export settings include_once 'Modules/Glossary/classes/class.ilECSGlossarySettings.php'; $ecs = new ilECSGlossarySettings($this->object); if ($ecs->handleSettingsUpdate()) { ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true); $this->ctrl->redirect($this, "properties"); } } $this->form->setValuesByPost(); $tpl->setContent($this->form->getHTML()); }