/** * Add taxonomy selector to MD (quick edit) form * * @param ilPropertyFormGUI $a_form */ public function addToMDForm(ilPropertyFormGUI $a_form) { $tax_ids = $this->getSelectableTaxonomies(); if (is_array($tax_ids)) { include_once "Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php"; foreach ($tax_ids as $tax_id) { // get existing assignments $node_ids = array(); $ta = $this->initTaxNodeAssignment($tax_id); foreach ($ta->getAssignmentsOfItem($this->md_obj_id) as $ass) { $node_ids[] = $ass["node_id"]; } $tax_sel = new ilTaxSelectInputGUI($tax_id, "md_tax_" . $tax_id, true); $tax_sel->setValue($node_ids); $a_form->addItem($tax_sel); } } }
/** * Get edit term form * * @param * @return */ function getEditTermForm() { global $ilTabs, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm")); $form->setTitle($this->lng->txt("cont_edit_term")); $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term"); $term->setRequired(true); $term->setValue($this->term->getTerm()); $form->addItem($term); $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language"); $lang->setRequired(true); $lang->setOptions(ilMDLanguageItem::_getLanguages()); $lang->setValue($this->term->getLanguage()); $form->addItem($lang); // taxonomy if ($this->glossary->getTaxonomyId() > 0) { include_once "./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php"; $tax_node_assign = new ilTaxSelectInputGUI($this->glossary->getTaxonomyId(), "tax_node", true); include_once "./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php"; $ta = new ilTaxNodeAssignment("glo", $this->glossary->getId(), "term", $this->glossary->getTaxonomyId()); $assgnmts = $ta->getAssignmentsOfItem($this->term->getId()); $node_ids = array(); foreach ($assgnmts as $a) { $node_ids[] = $a["node_id"]; } $tax_node_assign->setValue($node_ids); $form->addItem($tax_node_assign); } // advanced metadata include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php'; $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'glo', $this->glossary->getId(), 'term', $this->term->getId()); $this->record_gui->setPropertyForm($form); $this->record_gui->setSelectedOnly(true); $this->record_gui->parse(); $form->addCommandButton("updateTerm", $this->lng->txt("save")); return $form; }