ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilRepositorySelector2InputGUI.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
5include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerSelectInputGUI.php");
6include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
7
17{
21 protected $title_modifier = null;
22
30 public function __construct($a_title, $a_postvar, $a_multi = false, $form = ilPropertyFormGUI::class)
31 {
32 global $DIC;
33
34 $this->ctrl = $DIC->ctrl();
35 $ilCtrl = $DIC->ctrl();
36 $this->multi_nodes = $a_multi;
37 $this->postvar = $a_postvar;
38
39 include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
40 $this->explorer_gui = new ilRepositorySelectorExplorerGUI(
41 [$form, ilFormPropertyDispatchGUI::class, ilRepositorySelector2InputGUI::class],
42 $this->getExplHandleCmd(),
43 $this,
44 "selectRepositoryItem",
45 "root_id",
46 "rep_exp_sel_" . $a_postvar
47 );
48 // $this->explorer_gui->setTypeWhiteList($this->getVisibleTypes());
49 // $this->explorer_gui->setClickableTypes($this->getClickableTypes());
50 $this->explorer_gui->setSelectMode($a_postvar . "_sel", $this->multi_nodes);
51 //$this->explorer_gui = new ilTaxonomyExplorerGUI(array("ilformpropertydispatchgui", "iltaxselectinputgui"), $this->getExplHandleCmd(), $a_taxonomy_id, "", "",
52 // "tax_expl_".$a_postvar);
53
54 parent::__construct($a_title, $a_postvar, $this->explorer_gui, $this->multi_nodes);
55 $this->setType("rep_select");
56 }
57
63 public function setTitleModifier(callable $a_val)
64 {
65 $this->title_modifier = $a_val;
66 if ($a_val != null) {
67 $this->explorer_gui->setNodeContentModifier(function ($a_node) use ($a_val) {
68 return $a_val($a_node["child"]);
69 });
70 } else {
71 $this->explorer_gui->setNodeContentModifier(null);
72 }
73 }
74
80 public function getTitleModifier()
81 {
83 }
84
91 public function getTitleForNodeId($a_id)
92 {
93 $c = $this->getTitleModifier();
94 if (is_callable($c)) {
95 return $c($a_id);
96 }
98 }
99
103 public function getExplorerGUI()
104 {
105 return $this->explorer_gui;
106 }
107
112 {
113 $this->explorer_gui = $explorer;
114 }
115
122 public function getHTML()
123 {
124 $ilCtrl = $this->ctrl;
125 $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->postvar);
126 $html = parent::getHTML();
127 $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $_REQUEST["postvar"]);
128 return $html;
129 }
130
134 public function render($a_mode = "property_form")
135 {
136 $ilCtrl = $this->ctrl;
137 $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->postvar);
138 return parent::render($a_mode);
139 $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $_REQUEST["postvar"]);
140 }
141}
An exception for terminatinating execution or to throw for unit testing.
Select explorer tree nodes input GUI.
getExplHandleCmd()
Get explorer handle command function.
setType($a_type)
Set Type.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
setTitleModifier(callable $a_val)
Set title modifier.
render($a_mode="property_form")
Render item.
getTitleForNodeId($a_id)
Get title for node id (needs to be overwritten, if explorer is not a tree eplorer.
__construct($a_title, $a_postvar, $a_multi=false, $form=ilPropertyFormGUI::class)
Constructor.
setExplorerGUI(\ilRepositorySelectorExplorerGUI $explorer)
Explorer for selecting repository items.
$c
Definition: cli.php:37
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc