ILIAS  release_8 Revision v8.24
ilGroupedListGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilGroupedListGUI:

Public Member Functions

 setAsDropDown (bool $a_val, bool $a_pullright=false)
 
 getAsDropDown ()
 
 addGroupHeader (string $a_content, string $a_add_class="")
 
 addSeparator ()
 
 nextColumn ()
 
 addEntry (string $a_content, string $a_href="", string $a_target="", string $a_onclick="", string $a_add_class="", string $a_id="", string $a_ttip="", string $a_tt_my="right center", string $a_tt_at="left center", bool $a_tt_use_htmlspecialchars=true)
 
 getHTML ()
 

Protected Attributes

ilCtrl $ctrl
 
bool $multi_column = false
 
array $items = array()
 
bool $as_dropdown = false
 
bool $dd_pullright = false
 
string $id
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Grouped list GUI class

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilGroupedListGUI.php.

Member Function Documentation

◆ addEntry()

ilGroupedListGUI::addEntry ( string  $a_content,
string  $a_href = "",
string  $a_target = "",
string  $a_onclick = "",
string  $a_add_class = "",
string  $a_id = "",
string  $a_ttip = "",
string  $a_tt_my = "right center",
string  $a_tt_at = "left center",
bool  $a_tt_use_htmlspecialchars = true 
)

Definition at line 74 of file class.ilGroupedListGUI.php.

85 : void {
86 $this->items[] = array("type" => "entry", "content" => $a_content,
87 "href" => $a_href, "target" => $a_target, "onclick" => $a_onclick,
88 "add_class" => $a_add_class, "id" => $a_id, "ttip" => $a_ttip,
89 "tt_my" => $a_tt_my, "tt_at" => $a_tt_at,
90 "tt_use_htmlspecialchars" => $a_tt_use_htmlspecialchars);
91 }

Referenced by ilObjectAddNewItemGUI\getHTML().

+ Here is the caller graph for this function:

◆ addGroupHeader()

ilGroupedListGUI::addGroupHeader ( string  $a_content,
string  $a_add_class = "" 
)

Definition at line 55 of file class.ilGroupedListGUI.php.

58 : void {
59 $this->items[] = array("type" => "group_head", "content" => $a_content,
60 "add_class" => $a_add_class);
61 }

Referenced by ilObjectAddNewItemGUI\getHTML().

+ Here is the caller graph for this function:

◆ addSeparator()

ilGroupedListGUI::addSeparator ( )

Definition at line 63 of file class.ilGroupedListGUI.php.

63 : void
64 {
65 $this->items[] = array("type" => "sep");
66 }

◆ getAsDropDown()

ilGroupedListGUI::getAsDropDown ( )

Definition at line 50 of file class.ilGroupedListGUI.php.

50 : bool
51 {
52 return $this->as_dropdown;
53 }

◆ getHTML()

ilGroupedListGUI::getHTML ( )

Definition at line 93 of file class.ilGroupedListGUI.php.

93 : string
94 {
95 $ilCtrl = $this->ctrl;
96
97 $tpl = new ilTemplate("tpl.grouped_list.html", true, true, "Services/UIComponent/GroupedList");
98 $tt_calls = "";
99 foreach ($this->items as $i) {
100 switch ($i["type"]) {
101 case "sep":
102 $tpl->touchBlock("sep");
103 $tpl->touchBlock("item");
104 break;
105
106 case "next_col":
107 $tpl->touchBlock("next_col");
108 $tpl->touchBlock("item");
109 break;
110
111 case "group_head":
112 $tpl->setCurrentBlock("group_head");
113 if ($i["add_class"] != "") {
114 $tpl->setVariable("ADD_CLASS", $i["add_class"]);
115 }
116 $tpl->setVariable("GROUP_HEAD", $i["content"]);
117 $tpl->parseCurrentBlock();
118 $tpl->touchBlock("item");
119 break;
120
121 case "entry":
122 if ($i["href"] != "") {
123 $tpl->setCurrentBlock("linked_entry");
124 if ($i["add_class"] != "") {
125 $tpl->setVariable("ADD_CLASS", $i["add_class"]);
126 }
127 $tpl->setVariable("HREF", str_replace('&', '&', ilUtil::secureUrl($i["href"])));
128 $tpl->setVariable("TXT_ENTRY", $i["content"]);
129 if ($i["target"] != "") {
130 $tpl->setVariable("TARGET", 'target="' . $i["target"] . '"');
131 } else {
132 $tpl->setVariable("TARGET", 'target="_top"');
133 }
134 if ($i["onclick"] != "") {
135 $tpl->setVariable("ONCLICK", 'onclick="' . $i["onclick"] . '"');
136 }
137 if ($i["id"] != "") {
138 $tpl->setVariable("ID", 'id="' . $i["id"] . '"');
139 }
140 if ($this->getAsDropDown()) {
141 $tpl->setVariable("ITEM_ROLE", 'role="menuitem"');
142 }
143 $tpl->parseCurrentBlock();
144 $tpl->touchBlock("item");
145 if ($i["ttip"] != "" && $i["id"] != "") {
146 if ($ilCtrl->isAsynch()) {
147 $tt_calls .= " " . ilTooltipGUI::getToolTip(
148 $i["id"],
149 $i["ttip"],
150 "",
151 $i["tt_my"],
152 $i["tt_at"],
153 $i["tt_use_htmlspecialchars"]
154 );
155 } else {
157 $i["id"],
158 $i["ttip"],
159 "",
160 $i["tt_my"],
161 $i["tt_at"],
162 $i["tt_use_htmlspecialchars"]
163 );
164 }
165 }
166 } else {
167 $tpl->setCurrentBlock("unlinked_entry");
168 if ($i["add_class"] != "") {
169 $tpl->setVariable("ADD_CLASS2", $i["add_class"]);
170 }
171 $tpl->setVariable("TXT_ENTRY2", $i["content"]);
172 $tpl->parseCurrentBlock();
173 }
174 break;
175 }
176 }
177
178 if ($this->multi_column) {
179 $tpl->touchBlock("multi_start");
180 $tpl->touchBlock("multi_end");
181 }
182
183 if ($tt_calls !== "") {
184 $tpl->setCurrentBlock("script");
185 $tpl->setVariable("TT_CALLS", $tt_calls);
186 $tpl->parseCurrentBlock();
187 }
188
189 if ($this->id !== "") {
190 $tpl->setCurrentBlock("id");
191 $tpl->setVariable("ID", $this->id);
192 $tpl->parseCurrentBlock();
193 }
194
195 if ($this->getAsDropDown()) {
196 if ($this->dd_pullright) {
197 $tpl->setVariable("LIST_CLASS", "dropdown-menu pull-right");
198 } else {
199 $tpl->setVariable("LIST_CLASS", "dropdown-menu");
200 }
201 $tpl->setVariable("LIST_ROLE", 'role="menu"');
202 } else {
203 $tpl->setVariable("LIST_CLASS", "");
204 $tpl->setVariable("LIST_ROLE", "");
205 }
206
207 return $tpl->get();
208 }
special template class to simplify handling of ITX/PEAR
static addTooltip(string $a_el_id, string $a_text, string $a_container="", string $a_my="bottom center", string $a_at="top center", bool $a_use_htmlspecialchars=true)
static getToolTip(string $a_el_id, string $a_text, string $a_container="", string $a_my="bottom center", string $a_at="top center", bool $a_use_htmlspecialchars=true)
Get tooltip js code.
static secureUrl(string $url)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$i
Definition: metadata.php:41

References $i, $tpl, ilTooltipGUI\addTooltip(), ilTooltipGUI\getToolTip(), and ilUtil\secureUrl().

Referenced by ilObjectAddNewItemGUI\getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nextColumn()

ilGroupedListGUI::nextColumn ( )

Definition at line 68 of file class.ilGroupedListGUI.php.

68 : void
69 {
70 $this->items[] = array("type" => "next_col");
71 $this->multi_column = true;
72 }

Referenced by ilObjectAddNewItemGUI\getHTML().

+ Here is the caller graph for this function:

◆ setAsDropDown()

ilGroupedListGUI::setAsDropDown ( bool  $a_val,
bool  $a_pullright = false 
)

Definition at line 42 of file class.ilGroupedListGUI.php.

45 : void {
46 $this->as_dropdown = $a_val;
47 $this->dd_pullright = $a_pullright;
48 }

Referenced by ilObjectAddNewItemGUI\getHTML().

+ Here is the caller graph for this function:

Field Documentation

◆ $as_dropdown

bool ilGroupedListGUI::$as_dropdown = false
protected

Definition at line 29 of file class.ilGroupedListGUI.php.

◆ $ctrl

ilCtrl ilGroupedListGUI::$ctrl
protected

Definition at line 26 of file class.ilGroupedListGUI.php.

◆ $dd_pullright

bool ilGroupedListGUI::$dd_pullright = false
protected

Definition at line 30 of file class.ilGroupedListGUI.php.

◆ $id

string ilGroupedListGUI::$id
protected

Definition at line 31 of file class.ilGroupedListGUI.php.

◆ $items

array ilGroupedListGUI::$items = array()
protected

Definition at line 28 of file class.ilGroupedListGUI.php.

◆ $multi_column

bool ilGroupedListGUI::$multi_column = false
protected

Definition at line 27 of file class.ilGroupedListGUI.php.


The documentation for this class was generated from the following file: