ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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
Deprecated:
10

Definition at line 26 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 76 of file class.ilGroupedListGUI.php.

Referenced by ilObjectAddNewItemGUI\getHTML().

87  : void {
88  $this->items[] = array("type" => "entry", "content" => $a_content,
89  "href" => $a_href, "target" => $a_target, "onclick" => $a_onclick,
90  "add_class" => $a_add_class, "id" => $a_id, "ttip" => $a_ttip,
91  "tt_my" => $a_tt_my, "tt_at" => $a_tt_at,
92  "tt_use_htmlspecialchars" => $a_tt_use_htmlspecialchars);
93  }
+ Here is the caller graph for this function:

◆ addGroupHeader()

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

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

Referenced by ilObjectAddNewItemGUI\getHTML().

60  : void {
61  $this->items[] = array("type" => "group_head", "content" => $a_content,
62  "add_class" => $a_add_class);
63  }
+ Here is the caller graph for this function:

◆ addSeparator()

ilGroupedListGUI::addSeparator ( )

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

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

◆ getAsDropDown()

ilGroupedListGUI::getAsDropDown ( )

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

References $as_dropdown.

Referenced by getHTML().

52  : bool
53  {
54  return $this->as_dropdown;
55  }
+ Here is the caller graph for this function:

◆ getHTML()

ilGroupedListGUI::getHTML ( )

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

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

Referenced by ilObjectAddNewItemGUI\getHTML().

95  : string
96  {
97  $ilCtrl = $this->ctrl;
98 
99  $tpl = new ilTemplate("tpl.grouped_list.html", true, true, "Services/UIComponent/GroupedList");
100  $tt_calls = "";
101  foreach ($this->items as $i) {
102  switch ($i["type"]) {
103  case "sep":
104  $tpl->touchBlock("sep");
105  $tpl->touchBlock("item");
106  break;
107 
108  case "next_col":
109  $tpl->touchBlock("next_col");
110  $tpl->touchBlock("item");
111  break;
112 
113  case "group_head":
114  $tpl->setCurrentBlock("group_head");
115  if ($i["add_class"] != "") {
116  $tpl->setVariable("ADD_CLASS", $i["add_class"]);
117  }
118  $tpl->setVariable("GROUP_HEAD", $i["content"]);
119  $tpl->parseCurrentBlock();
120  $tpl->touchBlock("item");
121  break;
122 
123  case "entry":
124  if ($i["href"] != "") {
125  $tpl->setCurrentBlock("linked_entry");
126  if ($i["add_class"] != "") {
127  $tpl->setVariable("ADD_CLASS", $i["add_class"]);
128  }
129  $tpl->setVariable("HREF", str_replace('&', '&', ilUtil::secureUrl($i["href"])));
130  $tpl->setVariable("TXT_ENTRY", $i["content"]);
131  if ($i["target"] != "") {
132  $tpl->setVariable("TARGET", 'target="' . $i["target"] . '"');
133  } else {
134  $tpl->setVariable("TARGET", 'target="_top"');
135  }
136  if ($i["onclick"] != "") {
137  $tpl->setVariable("ONCLICK", 'onclick="' . $i["onclick"] . '"');
138  }
139  if ($i["id"] != "") {
140  $tpl->setVariable("ID", 'id="' . $i["id"] . '"');
141  }
142  if ($this->getAsDropDown()) {
143  $tpl->setVariable("ITEM_ROLE", 'role="menuitem"');
144  }
145  $tpl->parseCurrentBlock();
146  $tpl->touchBlock("item");
147  if ($i["ttip"] != "" && $i["id"] != "") {
148  if ($ilCtrl->isAsynch()) {
149  $tt_calls .= " " . ilTooltipGUI::getToolTip(
150  $i["id"],
151  $i["ttip"],
152  "",
153  $i["tt_my"],
154  $i["tt_at"],
155  $i["tt_use_htmlspecialchars"]
156  );
157  } else {
159  $i["id"],
160  $i["ttip"],
161  "",
162  $i["tt_my"],
163  $i["tt_at"],
164  $i["tt_use_htmlspecialchars"]
165  );
166  }
167  }
168  } else {
169  $tpl->setCurrentBlock("unlinked_entry");
170  if ($i["add_class"] != "") {
171  $tpl->setVariable("ADD_CLASS2", $i["add_class"]);
172  }
173  $tpl->setVariable("TXT_ENTRY2", $i["content"]);
174  $tpl->parseCurrentBlock();
175  }
176  break;
177  }
178  }
179 
180  if ($this->multi_column) {
181  $tpl->touchBlock("multi_start");
182  $tpl->touchBlock("multi_end");
183  }
184 
185  if ($tt_calls !== "") {
186  $tpl->setCurrentBlock("script");
187  $tpl->setVariable("TT_CALLS", $tt_calls);
188  $tpl->parseCurrentBlock();
189  }
190 
191  if ($this->id !== "") {
192  $tpl->setCurrentBlock("id");
193  $tpl->setVariable("ID", $this->id);
194  $tpl->parseCurrentBlock();
195  }
196 
197  if ($this->getAsDropDown()) {
198  if ($this->dd_pullright) {
199  $tpl->setVariable("LIST_CLASS", "dropdown-menu pull-right");
200  } else {
201  $tpl->setVariable("LIST_CLASS", "dropdown-menu");
202  }
203  $tpl->setVariable("LIST_ROLE", 'role="menu"');
204  } else {
205  $tpl->setVariable("LIST_CLASS", "");
206  $tpl->setVariable("LIST_ROLE", "");
207  }
208 
209  return $tpl->get();
210  }
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)
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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nextColumn()

ilGroupedListGUI::nextColumn ( )

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

Referenced by ilObjectAddNewItemGUI\getHTML().

70  : void
71  {
72  $this->items[] = array("type" => "next_col");
73  $this->multi_column = true;
74  }
+ Here is the caller graph for this function:

◆ setAsDropDown()

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

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

Referenced by ilObjectAddNewItemGUI\getHTML().

47  : void {
48  $this->as_dropdown = $a_val;
49  $this->dd_pullright = $a_pullright;
50  }
+ Here is the caller graph for this function:

Field Documentation

◆ $as_dropdown

bool ilGroupedListGUI::$as_dropdown = false
protected

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

Referenced by getAsDropDown().

◆ $ctrl

ilCtrl ilGroupedListGUI::$ctrl
protected

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

Referenced by getHTML().

◆ $dd_pullright

bool ilGroupedListGUI::$dd_pullright = false
protected

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

◆ $id

string ilGroupedListGUI::$id
protected

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

◆ $items

array ilGroupedListGUI::$items = array()
protected

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

◆ $multi_column

bool ilGroupedListGUI::$multi_column = false
protected

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


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