/** * 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()); }