ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilGroupedListGUI Class Reference

Grouped list GUI class. More...

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

Public Member Functions

 __construct ()
 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
 

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 ( )

Constructor.

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

References $DIC.

28  {
29  global $DIC;
30 
31  $this->ctrl = $DIC->ctrl();
32  }
global $DIC
Definition: saml.php:7

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

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

References $a_content.

Referenced by ilMMTopParentItemRenderer\addEntry().

101  {
102  $this->items[] = array("type" => "entry", "content" => $a_content,
103  "href" => $a_href, "target" => $a_target, "onclick" => $a_onclick,
104  "add_class" => $a_add_class, "id" => $a_id, "ttip" => $a_ttip,
105  "tt_my" => $a_tt_my, "tt_at" => $a_tt_at,
106  "tt_use_htmlspecialchars" => $a_tt_use_htmlspecialchars);
107  }
$a_content
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ addGroupHeader()

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

Add group header.

Parameters

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

References $a_content.

62  {
63  $this->items[] = array("type" => "group_head", "content" => $a_content,
64  "add_class" => $a_add_class);
65  }
$a_content
Definition: workflow.php:93

◆ addSeparator()

ilGroupedListGUI::addSeparator ( )

Add separator.

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

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

◆ getAsDropDown()

ilGroupedListGUI::getAsDropDown ( )

Get as drop down.

Returns
bool as drop down menu

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

References $as_dropdown.

Referenced by getHTML().

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

◆ getHTML()

ilGroupedListGUI::getHTML ( )

Get HTML.

Parameters

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

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

117  {
119 
120  $tpl = new ilTemplate("tpl.grouped_list.html", true, true, "Services/UIComponent/GroupedList");
121  $tt_calls = "";
122  foreach ($this->items as $i) {
123  switch ($i["type"]) {
124  case "sep":
125  $tpl->touchBlock("sep");
126  $tpl->touchBlock("item");
127  break;
128 
129  case "next_col":
130  $tpl->touchBlock("next_col");
131  $tpl->touchBlock("item");
132  break;
133 
134  case "group_head":
135  $tpl->setCurrentBlock("group_head");
136  if ($i["add_class"] != "") {
137  $tpl->setVariable("ADD_CLASS", $i["add_class"]);
138  }
139  $tpl->setVariable("GROUP_HEAD", $i["content"]);
140  $tpl->parseCurrentBlock();
141  $tpl->touchBlock("item");
142  break;
143 
144  case "entry":
145  if ($i["href"] != "") {
146  $tpl->setCurrentBlock("linked_entry");
147  if ($i["add_class"] != "") {
148  $tpl->setVariable("ADD_CLASS", $i["add_class"]);
149  }
150  $tpl->setVariable("HREF", str_replace('&', '&', ilUtil::secureUrl($i["href"])));
151  $tpl->setVariable("TXT_ENTRY", $i["content"]);
152  if ($i["target"] != "") {
153  $tpl->setVariable("TARGET", 'target="' . $i["target"] . '"');
154  } else {
155  $tpl->setVariable("TARGET", 'target="_top"');
156  }
157  if ($i["onclick"] != "") {
158  $tpl->setVariable("ONCLICK", 'onclick="' . $i["onclick"] . '"');
159  }
160  if ($i["id"] != "") {
161  $tpl->setVariable("ID", 'id="' . $i["id"] . '"');
162  }
163  $tpl->parseCurrentBlock();
164  $tpl->touchBlock("item");
165  if ($i["ttip"] != "" && $i["id"] != "") {
166  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
167  if ($ilCtrl->isAsynch()) {
168  $tt_calls .= " " . ilTooltipGUI::getTooltip(
169  $i["id"],
170  $i["ttip"],
171  "",
172  $i["tt_my"],
173  $i["tt_at"],
174  $i["tt_use_htmlspecialchars"]
175  );
176  } else {
178  $i["id"],
179  $i["ttip"],
180  "",
181  $i["tt_my"],
182  $i["tt_at"],
183  $i["tt_use_htmlspecialchars"]
184  );
185  }
186  }
187  } else {
188  $tpl->setCurrentBlock("unlinked_entry");
189  if ($i["add_class"] != "") {
190  $tpl->setVariable("ADD_CLASS2", $i["add_class"]);
191  }
192  $tpl->setVariable("TXT_ENTRY2", $i["content"]);
193  $tpl->parseCurrentBlock();
194  }
195  break;
196  }
197  }
198 
199  if ($this->multi_column) {
200  $tpl->touchBlock("multi_start");
201  $tpl->touchBlock("multi_end");
202  }
203 
204  if ($tt_calls != "") {
205  $tpl->setCurrentBlock("script");
206  $tpl->setVariable("TT_CALLS", $tt_calls);
207  $tpl->parseCurrentBlock();
208  }
209 
210  if ($this->getAsDropDown()) {
211  if ($this->dd_pullright) {
212  $tpl->setVariable("LIST_CLASS", "dropdown-menu pull-right");
213  } else {
214  $tpl->setVariable("LIST_CLASS", "dropdown-menu");
215  }
216  $tpl->setVariable("LIST_ROLE", "menu");
217  } else {
218  $tpl->setVariable("LIST_CLASS", "");
219  $tpl->setVariable("LIST_ROLE", "");
220  }
221 
222  return $tpl->get();
223  }
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.
$tpl
Definition: ilias.php:10
getAsDropDown()
Get as drop down.
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
static secureUrl($url)
Prepare secure href attribute.
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ nextColumn()

ilGroupedListGUI::nextColumn ( )

Add separator.

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

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

◆ setAsDropDown()

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

Set as drop down.

Parameters
bool$a_valas drop down menu

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

40  {
41  $this->as_dropdown = $a_val;
42  $this->dd_pullright = $a_pullright;
43  }

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.

◆ $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: