ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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

 $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 22 of file class.ilGroupedListGUI.php.

23  {
24  }

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 82 of file class.ilGroupedListGUI.php.

References $a_content, and array.

85  {
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  }
$a_content
Definition: workflow.php:94
Create styles array
The data for the language used.

◆ addGroupHeader()

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

Add group header.

Parameters

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

References $a_content, and array.

54  {
55  $this->items[] = array("type" => "group_head", "content" => $a_content,
56  "add_class" => $a_add_class);
57  }
$a_content
Definition: workflow.php:94
Create styles array
The data for the language used.

◆ addSeparator()

ilGroupedListGUI::addSeparator ( )

Add separator.

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

References array.

63  {
64  $this->items[] = array("type" => "sep");
65  }
Create styles array
The data for the language used.

◆ getAsDropDown()

ilGroupedListGUI::getAsDropDown ( )

Get as drop down.

Returns
bool as drop down menu

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

References $as_dropdown.

Referenced by getHTML().

43  {
44  return $this->as_dropdown;
45  }
+ Here is the caller graph for this function:

◆ getHTML()

ilGroupedListGUI::getHTML ( )

Get HTML.

Parameters

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

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

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

◆ nextColumn()

ilGroupedListGUI::nextColumn ( )

Add separator.

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

References array.

71  {
72  $this->items[] = array("type" => "next_col");
73  $this->multi_column = true;
74  }
Create styles array
The data for the language used.

◆ setAsDropDown()

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

Set as drop down.

Parameters
bool$a_valas drop down menu

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

32  {
33  $this->as_dropdown = $a_val;
34  $this->dd_pullright = $a_pullright;
35  }

Field Documentation

◆ $as_dropdown

ilGroupedListGUI::$as_dropdown = false
protected

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

Referenced by getAsDropDown().

◆ $dd_pullright

ilGroupedListGUI::$dd_pullright = false
protected

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

◆ $items

ilGroupedListGUI::$items = array()
protected

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

◆ $multi_column

ilGroupedListGUI::$multi_column = false
protected

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


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