ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
114 public function getHTML()
115 {
117 $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->postvar);
118 $html = parent::getHTML();
119 $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $_REQUEST["postvar"]);
120 return $html;
121 }
122
126 public function render($a_mode = "property_form")
127 {
129 $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->postvar);
130 return parent::render($a_mode);
131 $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $_REQUEST["postvar"]);
132 }
133}
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.
Explorer for selecting repository items.
$html
Definition: example_001.php:87
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
global $DIC
Definition: saml.php:7