/** * Save input * * @param * @return */ function saveInput($a_component_id, $a_item_type, $a_item_id) { include_once "./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php"; $tax_node_ass = new ilTaxNodeAssignment($a_component_id, $a_item_type, $this->getTaxonomyId()); $tax_node_ass->deleteAssignmentsOfItem($a_item_id); $post = $_POST[$this->getPostVar()]; //var_dump($_POST); //var_dump($post); if ($this->getMulti()) { foreach ($post as $p) { $tax_node_ass->addAssignment(ilUtil::stripSlashes($p), $a_item_id); } } else { $tax_node_ass->addAssignment(ilUtil::stripSlashes($post), $a_item_id); } }
/** * update term */ function updateTerm() { // update term $this->term->setTerm(ilUtil::stripSlashes($_POST["term"])); $this->term->setLanguage($_POST["term_language"]); $this->term->update(); // update taxonomy assignment if ($this->glossary->getTaxonomyId() > 0) { include_once "./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php"; $ta = new ilTaxNodeAssignment("glo", $this->glossary->getId(), "term", $this->glossary->getTaxonomyId()); $ta->deleteAssignmentsOfItem($this->term->getId()); if (is_array($_POST["tax_node"])) { foreach ($_POST["tax_node"] as $node_id) { $ta->addAssignment($node_id, $this->term->getId()); } } } // advanced metadata include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php'; $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'glo', $this->glossary->getId(), 'term', $this->term->getId()); // :TODO: proper validation $form = $this->getEditTermForm(); $form->checkInput(); if ($this->record_gui->importEditFormPostValues()) { $this->record_gui->writeEditForm(); } ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true); $this->ctrl->redirect($this, "editTerm"); }