/**
  * Init print view selection form.
  */
 public function initPrintViewSelectionForm()
 {
     global $lng, $ilCtrl;
     $terms = $this->glossary->getTermList();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setTarget("print_view");
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     // selection type
     $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
     $radg->setValue("glossary");
     // current term
     if ((int) $this->term_id > 0) {
         $op1 = new ilRadioOption($lng->txt("cont_current_term"), "term");
         $radg->addOption($op1);
         $radg->setValue("term");
     }
     // whole glossary
     $op2 = new ilRadioOption($lng->txt("cont_whole_glossary") . " (" . $lng->txt("cont_terms") . ": " . count($terms) . ")", "glossary");
     $radg->addOption($op2);
     // selected topic
     if (($t_id = $this->glossary->getTaxonomyId()) > 0 && $this->glossary->getShowTaxonomy()) {
         $op4 = new ilRadioOption($lng->txt("cont_selected_topic"), "sel_topic");
         $radg->addOption($op4);
         // topic drop down
         include_once "./Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php";
         $si = new ilTaxAssignInputGUI($t_id, false, $lng->txt("cont_topic"), "topic", false);
         if ($this->tax_node > 0) {
             $si->setValue((int) $this->tax_node);
         }
         $op4->addSubItem($si);
     }
     // selected terms
     $op3 = new ilRadioOption($lng->txt("cont_selected_terms"), "selection");
     $radg->addOption($op3);
     include_once "./Services/Form/classes/class.ilNestedListInputGUI.php";
     $nl = new ilNestedListInputGUI("", "obj_id");
     $op3->addSubItem($nl);
     //var_dump($terms);
     foreach ($terms as $t) {
         $nl->addListNode($t["id"], $t["term"], 0, false, false);
     }
     $this->form->addItem($radg);
     $this->form->addCommandButton("printView", $lng->txt("cont_show_print_view"));
     $this->form->setTitle($lng->txt("cont_print_selection"));
 }
Пример #2
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);
         }
     }
 }
 /**
  * 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.ilTaxAssignInputGUI.php";
         $tax_node_assign = new ilTaxAssignInputGUI($this->glossary->getTaxonomyId());
         $tax_node_assign->saveInput("glo", "term", $this->term->getId());
     }
     ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
     $this->ctrl->redirect($this, "editTerm");
 }