ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ()
 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.

References $DIC, and setId().

24  {
25  global $DIC;
26 
27  $this->lng = $DIC->language();
28  $this->setId($a_id);
29  }
global $DIC
Definition: saml.php:7
+ 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.

Referenced by getHTML().

148  {
149  return $this->field_var;
150  }
+ 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.

Referenced by getHTML().

128  {
129  return $this->form_cmd;
130  }
+ 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.

Referenced by getHTML().

168  {
169  return $this->hidden_var;
170  }
+ Here is the caller graph for this function:

◆ getHTML()

ilCheckboxListOverlayGUI::getHTML ( )

Get selection list HTML.

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

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

175  {
176  $lng = $this->lng;
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  $tpl->setVariable("ALT_SEL_TOP", "");
195 
196  $tpl->parseCurrentBlock();
197 
198  reset($items);
199  $cnt = 0;
200  foreach ($items as $k => $v) {
201  $tpl->setCurrentBlock("list_entry");
202  $tpl->setVariable("VAR", $this->getFieldVar());
203  $tpl->setVariable("VAL_ENTRY", $k);
204  $tpl->setVariable("TXT_ENTRY", $v["txt"]);
205  $tpl->setVariable("IDX_ENTRY", ++$cnt);
206  if ($v["selected"]) {
207  $tpl->setVariable("CHECKED", "checked='checked'");
208  }
209  $tpl->parseCurrentBlock();
210  }
211 
212  $tpl->setVariable("ID", $this->getId());
213  $tpl->setVariable("HIDDEN_VAR", $this->getHiddenVar());
214  $tpl->setVariable("CMD_SUBMIT", $this->getFormCmd());
215  $tpl->setVariable("VAL_SUBMIT", $lng->txt("refresh"));
216  return $tpl->get();
217  }
$tpl
Definition: ilias.php:10
special template class to simplify handling of ITX/PEAR
+ 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.

References $id.

Referenced by getHTML().

47  {
48  return $this->id;
49  }
if(!array_key_exists('StateId', $_REQUEST)) $id
+ 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.

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.

Referenced by getHTML().

68  {
69  return $this->link_title;
70  }
+ 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.

Referenced by __construct().

37  {
38  $this->id = $a_val;
39  }
+ 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: