ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTaxSelectInputGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerSelectInputGUI.php");
6 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
7 
18 {
25  function __construct($a_taxonomy_id, $a_postvar, $a_multi = false)
26  {
27  global $lng, $ilCtrl;
28 
29  $lng->loadLanguageModule("tax");
30  $this->multi_nodes = $a_multi;
31  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
32  $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $a_postvar);
33  $this->explorer_gui = new ilTaxonomyExplorerGUI(array("ilformpropertydispatchgui", "iltaxselectinputgui"), $this->getExplHandleCmd(), $a_taxonomy_id, "", "",
34  "tax_expl_".$a_postvar);
35  $this->explorer_gui->setSelectMode($a_postvar."_sel", $this->multi_nodes);
36  $this->explorer_gui->setSkipRootNode(true);
37 
38  parent::__construct(ilObject::_lookupTitle($a_taxonomy_id), $a_postvar, $this->explorer_gui, $this->multi_nodes);
39  $this->setType("tax_select");
40 
41  if ((int) $a_taxonomy_id == 0)
42  {
43  throw new ilTaxonomyExceptions("No taxonomy ID passed to ilTaxSelectInputGUI.");
44  }
45 
46  $this->setTaxonomyId((int) $a_taxonomy_id);
47  $this->tax = new ilObjTaxonomy($this->getTaxonomyId());
48  }
49 
55  function setTaxonomyId($a_val)
56  {
57  $this->taxononmy_id = $a_val;
58  }
59 
65  function getTaxonomyId()
66  {
67  return $this->taxononmy_id;
68  }
69 
76  function getTitleForNodeId($a_id)
77  {
78  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
79  return ilTaxonomyNode::_lookupTitle($a_id);
80  }
81 }