ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  public function __construct($a_taxonomy_id, $a_postvar, $a_multi = false)
26  {
27  global $DIC;
28 
29  $this->lng = $DIC->language();
30  $this->ctrl = $DIC->ctrl();
31  $lng = $DIC->language();
32  $ilCtrl = $DIC->ctrl();
33 
34  $lng->loadLanguageModule("tax");
35  $this->multi_nodes = $a_multi;
36  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
37  $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $a_postvar);
38  $this->explorer_gui = new ilTaxonomyExplorerGUI(
39  array("ilformpropertydispatchgui", "iltaxselectinputgui"),
40  $this->getExplHandleCmd(),
41  $a_taxonomy_id,
42  "",
43  "",
44  "tax_expl_" . $a_postvar
45  );
46  $this->explorer_gui->setSelectMode($a_postvar . "_sel", $this->multi_nodes);
47  $this->explorer_gui->setSkipRootNode(true);
48 
49  parent::__construct(ilObject::_lookupTitle($a_taxonomy_id), $a_postvar, $this->explorer_gui, $this->multi_nodes);
50  $this->setType("tax_select");
51 
52  if ((int) $a_taxonomy_id == 0) {
53  throw new ilTaxonomyExceptions("No taxonomy ID passed to ilTaxSelectInputGUI.");
54  }
55 
56  $this->setTaxonomyId((int) $a_taxonomy_id);
57  $this->tax = new ilObjTaxonomy($this->getTaxonomyId());
58  }
59 
65  public function setTaxonomyId($a_val)
66  {
67  $this->taxononmy_id = $a_val;
68  }
69 
75  public function getTaxonomyId()
76  {
77  return $this->taxononmy_id;
78  }
79 
86  public function getTitleForNodeId($a_id)
87  {
88  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
89  return ilTaxonomyNode::_lookupTitle($a_id);
90  }
91 }
__construct($a_taxonomy_id, $a_postvar, $a_multi=false)
Constructor.
Select taxonomy nodes input GUI.
global $DIC
Definition: saml.php:7
getTaxonomyId()
Get taxonomy id.
Taxonomy explorer GUI class.
setTaxonomyId($a_val)
Set taxonomy id.
static _lookupTitle($a_id)
lookup object title
static _lookupTitle($a_obj_id)
Lookup Title.
global $ilCtrl
Definition: ilias.php:18
setType($a_type)
Set Type.
getExplHandleCmd()
Get explorer handle command function.
Select explorer tree nodes input GUI.
getTitleForNodeId($a_id)
Get title for node id (needs to be overwritten, if explorer is not a tree eplorer.