ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilCheckboxListOverlayGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11{
12 private $items = array();
13
18 public function __construct($a_id = "")
19 {
20 $this->setId($a_id);
21 }
22
28 function setId($a_val)
29 {
30 $this->id = $a_val;
31 }
32
38 function getId()
39 {
40 return $this->id;
41 }
42
43
49 function setLinkTitle($a_val)
50 {
51 $this->link_title = $a_val;
52 }
53
59 function getLinkTitle()
60 {
61 return $this->link_title;
62 }
63
69 function setItems($a_val)
70 {
71 $this->items = $a_val;
72 }
73
79 function getItems()
80 {
81 return $this->items;
82 }
83
89 function setSelectionHeaderClass($a_selectionheaderclass)
90 {
91 $this->selectionheaderclass = $a_selectionheaderclass;
92 }
93
100 {
101 return $this->selectionheaderclass;
102 }
103
109 function setFormCmd($a_val)
110 {
111 $this->form_cmd = $a_val;
112 }
113
119 function getFormCmd()
120 {
121 return $this->form_cmd;
122 }
123
129 function setFieldVar($a_val)
130 {
131 $this->field_var = $a_val;
132 }
133
139 function getFieldVar()
140 {
141 return $this->field_var;
142 }
143
149 function setHiddenVar($a_val)
150 {
151 $this->hidden_var = $a_val;
152 }
153
159 function getHiddenVar()
160 {
161 return $this->hidden_var;
162 }
166 public function getHTML()
167 {
168 global $lng;
169
170 $items = $this->getItems();
171
172 $tpl = new ilTemplate("tpl.checkbox_list_overlay.html", true, true,
173 "Services/UIComponent/CheckboxListOverlay", "DEFAULT", false, true);
174
175 $tpl->setCurrentBlock("top_img");
176
177 // do not repeat title (accessibility) -> empty alt
178 $tpl->setVariable("TXT_SEL_TOP", $this->getLinkTitle());
179 $tpl->setVariable("ALT_SEL_TOP", "");
180
181 $tpl->parseCurrentBlock();
182
183 reset($items);
184 $cnt = 0;
185 foreach ($items as $k => $v)
186 {
187 $tpl->setCurrentBlock("list_entry");
188 $tpl->setVariable("VAR", $this->getFieldVar());
189 $tpl->setVariable("VAL_ENTRY", $k);
190 $tpl->setVariable("TXT_ENTRY", $v["txt"]);
191 $tpl->setVariable("IDX_ENTRY", ++$cnt);
192 if ($v["selected"])
193 {
194 $tpl->setVariable("CHECKED", "checked='checked'");
195 }
196 $tpl->parseCurrentBlock();
197 }
198
199 $tpl->setVariable("ID", $this->getId());
200 $tpl->setVariable("HIDDEN_VAR", $this->getHiddenVar());
201 $tpl->setVariable("CMD_SUBMIT", $this->getFormCmd());
202 $tpl->setVariable("VAL_SUBMIT", $lng->txt("refresh"));
203 return $tpl->get();
204 }
205}
206?>
global $tpl
Definition: ilias.php:8
User interface class for a checkbox list overlay.
setHiddenVar($a_val)
Set hidden var (used to indicated that checkbox array has been sent in a form)
setSelectionHeaderClass($a_selectionheaderclass)
Set Selection Header Class.
getSelectionHeaderClass()
Get Selection Header Class.
special template class to simplify handling of ITX/PEAR
global $lng
Definition: privfeed.php:40