ILIAS  release_7 Revision v7.30-3-g800a261c036
ilGroupedListGUI Class Reference

Grouped list GUI class. More...

+ Inheritance diagram for ilGroupedListGUI:
+ Collaboration diagram for ilGroupedListGUI:

Public Member Functions

 __construct ($id="")
 Constructor. More...
 
 setAsDropDown ($a_val, $a_pullright=false)
 Set as drop down. More...
 
 getAsDropDown ()
 Get as drop down. More...
 
 addGroupHeader ($a_content, $a_add_class="")
 Add group header. More...
 
 addSeparator ()
 Add separator. More...
 
 nextColumn ()
 Add separator. More...
 
 addEntry ( $a_content, $a_href="", $a_target="", $a_onclick="", $a_add_class="", $a_id="", $a_ttip="", $a_tt_my="right center", $a_tt_at="left center", $a_tt_use_htmlspecialchars=true)
 Add entry. More...
 
 getHTML ()
 Get HTML. More...
 

Protected Attributes

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

Detailed Description

Grouped list GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilGroupedListGUI::__construct (   $id = "")

Constructor.

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

29 {
30 global $DIC;
31
32 $this->id = $id;
33 $this->ctrl = $DIC->ctrl();
34 }
global $DIC
Definition: goto.php:24

References $DIC, and $id.

Member Function Documentation

◆ addEntry()

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

Add entry.

Parameters

return

Reimplemented in ilCloudGroupedListGUI.

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

103 {
104 $this->items[] = array("type" => "entry", "content" => $a_content,
105 "href" => $a_href, "target" => $a_target, "onclick" => $a_onclick,
106 "add_class" => $a_add_class, "id" => $a_id, "ttip" => $a_ttip,
107 "tt_my" => $a_tt_my, "tt_at" => $a_tt_at,
108 "tt_use_htmlspecialchars" => $a_tt_use_htmlspecialchars);
109 }

◆ addGroupHeader()

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

Add group header.

Parameters

return

Reimplemented in ilCloudGroupedListGUI.

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

64 {
65 $this->items[] = array("type" => "group_head", "content" => $a_content,
66 "add_class" => $a_add_class);
67 }

◆ addSeparator()

ilGroupedListGUI::addSeparator ( )

Add separator.

Reimplemented in ilCloudGroupedListGUI.

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

73 {
74 $this->items[] = array("type" => "sep");
75 }

◆ getAsDropDown()

ilGroupedListGUI::getAsDropDown ( )

Get as drop down.

Returns
bool as drop down menu

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

References $as_dropdown.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getHTML()

ilGroupedListGUI::getHTML ( )

Get HTML.

Parameters

return

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

119 {
120 $ilCtrl = $this->ctrl;
121
122 $tpl = new ilTemplate("tpl.grouped_list.html", true, true, "Services/UIComponent/GroupedList");
123 $tt_calls = "";
124 foreach ($this->items as $i) {
125 switch ($i["type"]) {
126 case "sep":
127 $tpl->touchBlock("sep");
128 $tpl->touchBlock("item");
129 break;
130
131 case "next_col":
132 $tpl->touchBlock("next_col");
133 $tpl->touchBlock("item");
134 break;
135
136 case "group_head":
137 $tpl->setCurrentBlock("group_head");
138 if ($i["add_class"] != "") {
139 $tpl->setVariable("ADD_CLASS", $i["add_class"]);
140 }
141 $tpl->setVariable("GROUP_HEAD", $i["content"]);
142 $tpl->parseCurrentBlock();
143 $tpl->touchBlock("item");
144 break;
145
146 case "entry":
147 if ($i["href"] != "") {
148 $tpl->setCurrentBlock("linked_entry");
149 if ($i["add_class"] != "") {
150 $tpl->setVariable("ADD_CLASS", $i["add_class"]);
151 }
152 $tpl->setVariable("HREF", str_replace('&', '&', ilUtil::secureUrl($i["href"])));
153 $tpl->setVariable("TXT_ENTRY", $i["content"]);
154 if ($i["target"] != "") {
155 $tpl->setVariable("TARGET", 'target="' . $i["target"] . '"');
156 } else {
157 $tpl->setVariable("TARGET", 'target="_top"');
158 }
159 if ($i["onclick"] != "") {
160 $tpl->setVariable("ONCLICK", 'onclick="' . $i["onclick"] . '"');
161 }
162 if ($i["id"] != "") {
163 $tpl->setVariable("ID", 'id="' . $i["id"] . '"');
164 }
165 $tpl->parseCurrentBlock();
166 $tpl->touchBlock("item");
167 if ($i["ttip"] != "" && $i["id"] != "") {
168 include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
169 if ($ilCtrl->isAsynch()) {
170 $tt_calls .= " " . ilTooltipGUI::getTooltip(
171 $i["id"],
172 $i["ttip"],
173 "",
174 $i["tt_my"],
175 $i["tt_at"],
176 $i["tt_use_htmlspecialchars"]
177 );
178 } else {
180 $i["id"],
181 $i["ttip"],
182 "",
183 $i["tt_my"],
184 $i["tt_at"],
185 $i["tt_use_htmlspecialchars"]
186 );
187 }
188 }
189 } else {
190 $tpl->setCurrentBlock("unlinked_entry");
191 if ($i["add_class"] != "") {
192 $tpl->setVariable("ADD_CLASS2", $i["add_class"]);
193 }
194 $tpl->setVariable("TXT_ENTRY2", $i["content"]);
195 $tpl->parseCurrentBlock();
196 }
197 break;
198 }
199 }
200
201 if ($this->multi_column) {
202 $tpl->touchBlock("multi_start");
203 $tpl->touchBlock("multi_end");
204 }
205
206 if ($tt_calls != "") {
207 $tpl->setCurrentBlock("script");
208 $tpl->setVariable("TT_CALLS", $tt_calls);
209 $tpl->parseCurrentBlock();
210 }
211
212 if ($this->id != "") {
213 $tpl->setCurrentBlock("id");
214 $tpl->setVariable("ID", $this->id);
215 $tpl->parseCurrentBlock();
216 }
217
218 if ($this->getAsDropDown()) {
219 if ($this->dd_pullright) {
220 $tpl->setVariable("LIST_CLASS", "dropdown-menu pull-right");
221 } else {
222 $tpl->setVariable("LIST_CLASS", "dropdown-menu");
223 }
224 $tpl->setVariable("LIST_ROLE", 'role="menu"');
225 } else {
226 $tpl->setVariable("LIST_CLASS", "");
227 $tpl->setVariable("LIST_ROLE", "");
228 }
229
230 return $tpl->get();
231 }
getAsDropDown()
Get as drop down.
special template class to simplify handling of ITX/PEAR
static addTooltip( $a_el_id, $a_text, $a_container="", $a_my="bottom center", $a_at="top center", $a_use_htmlspecialchars=true)
Adds a tooltip to an HTML element.
static secureUrl($url)
Prepare secure href attribute.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$i
Definition: metadata.php:24

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

+ Here is the call graph for this function:

◆ nextColumn()

ilGroupedListGUI::nextColumn ( )

Add separator.

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

81 {
82 $this->items[] = array("type" => "next_col");
83 $this->multi_column = true;
84 }

◆ setAsDropDown()

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

Set as drop down.

Parameters
bool$a_valas drop down menu

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

42 {
43 $this->as_dropdown = $a_val;
44 $this->dd_pullright = $a_pullright;
45 }

Field Documentation

◆ $as_dropdown

ilGroupedListGUI::$as_dropdown = false
protected

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

Referenced by getAsDropDown().

◆ $ctrl

ilGroupedListGUI::$ctrl
protected

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

Referenced by getHTML().

◆ $dd_pullright

ilGroupedListGUI::$dd_pullright = false
protected

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

◆ $id

ilGroupedListGUI::$id
protected

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

Referenced by __construct().

◆ $items

ilGroupedListGUI::$items = array()
protected

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

◆ $multi_column

ilGroupedListGUI::$multi_column = false
protected

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


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