/** * Init tax node form * * @param int $a_mode Edit Mode */ public function initTaxNodeForm($a_mode = "edit") { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // title $ti = new ilTextInputGUI($this->lng->txt("title"), "title"); $this->form->addItem($ti); // order nr $tax = $this->getCurrentTaxonomy(); if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL) { $or = new ilTextInputGUI($this->lng->txt("tax_order_nr"), "order_nr"); $or->setMaxLength(5); $or->setSize(5); $this->form->addItem($or); } if ($a_mode == "edit") { $node = new ilTaxonomyNode((int) $_GET["tax_node"]); $ti->setValue($node->getTitle()); $or->setValue($node->getOrderNr()); } // save and cancel commands if ($a_mode == "create") { $this->form->addCommandButton("saveTaxNode", $lng->txt("save")); $this->form->addCommandButton("listNodes", $lng->txt("cancel")); $this->form->setTitle($lng->txt("tax_new_tax_node")); } else { $this->form->addCommandButton("updateTaxNode", $lng->txt("save")); $this->form->addCommandButton("listNodes", $lng->txt("cancel")); $this->form->setTitle($lng->txt("tax_edit_tax_node")); } $this->form->setFormAction($ilCtrl->getFormAction($this)); }