Exemplo n.º 1
0
 protected function populateTaxonomyFormSection(ilPropertyFormGUI $form)
 {
     if (count($this->getTaxonomyIds())) {
         $sectHeader = new ilFormSectionHeaderGUI();
         $sectHeader->setTitle($this->lng->txt('qpl_qst_edit_form_taxonomy_section'));
         $form->addItem($sectHeader);
         require_once 'Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php';
         foreach ($this->getTaxonomyIds() as $taxonomyId) {
             $taxonomy = new ilObjTaxonomy($taxonomyId);
             $label = sprintf($this->lng->txt('qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
             $postvar = "tax_node_assign_{$taxonomyId}";
             $taxNodeAssign = new ilTaxAssignInputGUI($taxonomy->getId(), true, $label, $postvar);
             // TODO: determine tst/qpl when tax assigns become maintainable within tests
             $taxNodeAssign->setCurrentValues('qpl', $this->object->getObjId(), 'quest', $this->object->getId());
             $form->addItem($taxNodeAssign);
         }
     }
 }
 /**
  * Edit term
  */
 function editTerm()
 {
     global $ilTabs;
     $this->getTemplate();
     $this->displayLocator();
     $this->setTabs();
     $ilTabs->activateTab("properties");
     $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
     $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png"));
     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.ilTaxAssignInputGUI.php";
         $tax_node_assign = new ilTaxAssignInputGUI($this->glossary->getTaxonomyId());
         $tax_node_assign->setCurrentValues("glo", "term", $this->term->getId());
         $form->addItem($tax_node_assign);
     }
     $form->addCommandButton("updateTerm", $this->lng->txt("save"));
     $this->tpl->setContent($form->getHTML());
     $this->quickList();
 }