Пример #1
0
 /**
  * Update Advanced Metadata
  */
 protected function updateAdvancedSettings()
 {
     if (!$this->ilAccess->checkAccess("write", "", $this->ref_id)) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
         $this->ctrl->redirect($this);
     }
     $form = $this->initAdvancedSettingsForm();
     $gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'orgu', $this->object->getId(), 'orgu_type', $this->object->getOrgUnitTypeId());
     $gui->setPropertyForm($form);
     $gui->setSelectedOnly(true);
     $form->checkInput();
     $gui->parse();
     if ($gui->importEditFormPostValues()) {
         $gui->writeEditForm();
         ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
         $this->ctrl->redirect($this, 'editAdvancedSettings');
     } else {
         $this->tpl->setContent($form->getHTML());
     }
 }
 /**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $rbacreview, $ilUser, $ilDB;
     // term
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($lng->txt("cont_term"), "term");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $ti->setSubmitFormOnEnter(true);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["term"] = $ti->getValue();
     // definition
     if ($ilDB->getDBType() != "oracle") {
         include_once "./Services/Form/classes/class.ilTextInputGUI.php";
         $ti = new ilTextInputGUI($lng->txt("cont_definition"), "defintion");
         $ti->setMaxLength(64);
         $ti->setSize(20);
         $ti->setSubmitFormOnEnter(true);
         $this->addFilterItem($ti);
         $ti->readFromSession();
         $this->filter["definition"] = $ti->getValue();
     }
     // advanced metadata
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_FILTER, 'glo', $this->glossary->getId(), 'term');
     $record_gui->setSelectedOnly(true);
     $record_gui->setTableGUI($this);
     $record_gui->parse();
 }
 /**
  * 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';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'glo', $this->glossary->getId(), 'term', $this->term->getId());
     $record_gui->setPropertyForm($form);
     $record_gui->setSelectedOnly(true);
     $record_gui->parse();
     $form->addCommandButton("updateTerm", $this->lng->txt("save"));
     return $form;
 }