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

User interface class for a checkbox list overlay. More...

+ Collaboration diagram for ilCheckboxListOverlayGUI:

Public Member Functions

 __construct ($a_id="")
 Constructor. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get id. More...
 
 setLinkTitle ($a_val)
 Set link title. More...
 
 getLinkTitle ()
 Get link title. More...
 
 setItems ($a_val)
 Set items. More...
 
 getItems ()
 Get items. More...
 
 setSelectionHeaderClass ($a_selectionheaderclass)
 Set Selection Header Class. More...
 
 getSelectionHeaderClass ()
 Get Selection Header Class. More...
 
 setFormCmd ($a_val)
 Set form command. More...
 
 getFormCmd ()
 Get form command. More...
 
 setFieldVar ($a_val)
 Set field var. More...
 
 getFieldVar ()
 Get field var. More...
 
 setHiddenVar ($a_val)
 Set hidden var (used to indicated that checkbox array has been sent in a form) More...
 
 getHiddenVar ()
 Get hidden var. More...
 
 getHTML ($pull_right=true)
 Get selection list HTML. More...
 

Protected Attributes

 $lng
 

Private Attributes

 $items = array()
 

Detailed Description

User interface class for a checkbox list overlay.

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

Definition at line 10 of file class.ilCheckboxListOverlayGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilCheckboxListOverlayGUI::__construct (   $a_id = "")

Constructor.

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

24 {
25 global $DIC;
26
27 $this->lng = $DIC->language();
28 $this->setId($a_id);
29 }
global $DIC
Definition: goto.php:24

References $DIC, and setId().

+ Here is the call graph for this function:

Member Function Documentation

◆ getFieldVar()

ilCheckboxListOverlayGUI::getFieldVar ( )

Get field var.

Returns
string field var

Definition at line 147 of file class.ilCheckboxListOverlayGUI.php.

148 {
149 return $this->field_var;
150 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getFormCmd()

ilCheckboxListOverlayGUI::getFormCmd ( )

Get form command.

Returns
string form command

Definition at line 127 of file class.ilCheckboxListOverlayGUI.php.

128 {
129 return $this->form_cmd;
130 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getHiddenVar()

ilCheckboxListOverlayGUI::getHiddenVar ( )

Get hidden var.

Returns
string hidden var

Definition at line 167 of file class.ilCheckboxListOverlayGUI.php.

168 {
169 return $this->hidden_var;
170 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getHTML()

ilCheckboxListOverlayGUI::getHTML (   $pull_right = true)

Get selection list HTML.

Definition at line 174 of file class.ilCheckboxListOverlayGUI.php.

175 {
177
178 $items = $this->getItems();
179
180 $tpl = new ilTemplate(
181 "tpl.checkbox_list_overlay.html",
182 true,
183 true,
184 "Services/UIComponent/CheckboxListOverlay",
185 "DEFAULT",
186 false,
187 true
188 );
189
190 $tpl->setCurrentBlock("top_img");
191
192 // do not repeat title (accessibility) -> empty alt
193 $tpl->setVariable("TXT_SEL_TOP", $this->getLinkTitle());
194
195 $tpl->parseCurrentBlock();
196
197 reset($items);
198 $cnt = 0;
199 foreach ($items as $k => $v) {
200 $tpl->setCurrentBlock("list_entry");
201 $tpl->setVariable("VAR", $this->getFieldVar());
202 $tpl->setVariable("VAL_ENTRY", $k);
203 $tpl->setVariable("TXT_ENTRY", $v["txt"]);
204 $tpl->setVariable("IDX_ENTRY", ++$cnt);
205 if ($v["selected"]) {
206 $tpl->setVariable("CHECKED", "checked='checked'");
207 }
208 $tpl->parseCurrentBlock();
209 }
210
211 if ($pull_right) {
212 $tpl->touchBlock("pr");
213 }
214
215 $tpl->setVariable("ID", $this->getId());
216 $tpl->setVariable("HIDDEN_VAR", $this->getHiddenVar());
217 $tpl->setVariable("CMD_SUBMIT", $this->getFormCmd());
218 $tpl->setVariable("VAL_SUBMIT", $lng->txt("refresh"));
219 return $tpl->get();
220 }
special template class to simplify handling of ITX/PEAR
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

References $items, $lng, $tpl, getFieldVar(), getFormCmd(), getHiddenVar(), getId(), getItems(), and getLinkTitle().

+ Here is the call graph for this function:

◆ getId()

ilCheckboxListOverlayGUI::getId ( )

Get id.

Returns
string id

Definition at line 46 of file class.ilCheckboxListOverlayGUI.php.

47 {
48 return $this->id;
49 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getItems()

ilCheckboxListOverlayGUI::getItems ( )

Get items.

Returns
array items

Definition at line 87 of file class.ilCheckboxListOverlayGUI.php.

88 {
89 return $this->items;
90 }

References $items.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getLinkTitle()

ilCheckboxListOverlayGUI::getLinkTitle ( )

Get link title.

Returns
string link title

Definition at line 67 of file class.ilCheckboxListOverlayGUI.php.

68 {
69 return $this->link_title;
70 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getSelectionHeaderClass()

ilCheckboxListOverlayGUI::getSelectionHeaderClass ( )

Get Selection Header Class.

Returns
string Selection Header Class

Definition at line 107 of file class.ilCheckboxListOverlayGUI.php.

108 {
109 return $this->selectionheaderclass;
110 }

◆ setFieldVar()

ilCheckboxListOverlayGUI::setFieldVar (   $a_val)

Set field var.

Parameters
stringfield var

Definition at line 137 of file class.ilCheckboxListOverlayGUI.php.

138 {
139 $this->field_var = $a_val;
140 }

◆ setFormCmd()

ilCheckboxListOverlayGUI::setFormCmd (   $a_val)

Set form command.

Parameters
stringform command

Definition at line 117 of file class.ilCheckboxListOverlayGUI.php.

118 {
119 $this->form_cmd = $a_val;
120 }

◆ setHiddenVar()

ilCheckboxListOverlayGUI::setHiddenVar (   $a_val)

Set hidden var (used to indicated that checkbox array has been sent in a form)

Parameters
stringhidden var

Definition at line 157 of file class.ilCheckboxListOverlayGUI.php.

158 {
159 $this->hidden_var = $a_val;
160 }

◆ setId()

ilCheckboxListOverlayGUI::setId (   $a_val)

Set id.

Parameters
stringid

Definition at line 36 of file class.ilCheckboxListOverlayGUI.php.

37 {
38 $this->id = $a_val;
39 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setItems()

ilCheckboxListOverlayGUI::setItems (   $a_val)

Set items.

Parameters
arrayitems

Definition at line 77 of file class.ilCheckboxListOverlayGUI.php.

78 {
79 $this->items = $a_val;
80 }

◆ setLinkTitle()

ilCheckboxListOverlayGUI::setLinkTitle (   $a_val)

Set link title.

Parameters
stringlink title

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

58 {
59 $this->link_title = $a_val;
60 }

◆ setSelectionHeaderClass()

ilCheckboxListOverlayGUI::setSelectionHeaderClass (   $a_selectionheaderclass)

Set Selection Header Class.

Parameters
string$a_selectionheaderclassSelection Header Class

Definition at line 97 of file class.ilCheckboxListOverlayGUI.php.

98 {
99 $this->selectionheaderclass = $a_selectionheaderclass;
100 }

Field Documentation

◆ $items

ilCheckboxListOverlayGUI::$items = array()
private

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

Referenced by getHTML(), and getItems().

◆ $lng

ilCheckboxListOverlayGUI::$lng
protected

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

Referenced by getHTML().


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