ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 setHeaderIcon ($a_headericon)
 Set Header Icon. More...
 
 getHeaderIcon ()
 Get Header Icon. 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...
 

Data Fields

const DOWN_ARROW_LIGHT = "mm_down_arrow.png"
 
const DOWN_ARROW_DARK = "mm_down_arrow_dark.png"
 
const NO_ICON = ""
 

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 DOWN_ARROW_DARK, setHeaderIcon(), 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 164 of file class.ilCheckboxListOverlayGUI.php.

Referenced by getHTML().

165  {
166  return $this->field_var;
167  }
+ Here is the caller graph for this function:

◆ getFormCmd()

ilCheckboxListOverlayGUI::getFormCmd ( )

Get form command.

Returns
string form command

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

Referenced by getHTML().

145  {
146  return $this->form_cmd;
147  }
+ Here is the caller graph for this function:

◆ getHeaderIcon()

ilCheckboxListOverlayGUI::getHeaderIcon ( )

Get Header Icon.

Returns
string Header Icon

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

Referenced by getHTML().

65  {
66  return $this->headericon;
67  }
+ Here is the caller graph for this function:

◆ getHiddenVar()

ilCheckboxListOverlayGUI::getHiddenVar ( )

Get hidden var.

Returns
string hidden var

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

Referenced by getHTML().

185  {
186  return $this->hidden_var;
187  }
+ Here is the caller graph for this function:

◆ getHTML()

ilCheckboxListOverlayGUI::getHTML ( )

Get selection list HTML.

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

References $items, $lng, $tpl, DOWN_ARROW_DARK, DOWN_ARROW_LIGHT, getFieldVar(), getFormCmd(), getHeaderIcon(), getHiddenVar(), getId(), ilUtil\getImagePath(), getItems(), getLinkTitle(), and getSelectionHeaderClass().

192  {
193  global $lng;
194 
195  $items = $this->getItems();
196 
197  include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
198  $overlay = new ilOverlayGUI("ilChkboxListOverlay_".$this->getId());
199  $overlay->setAnchor("ilChkboxListAnchorEl_".$this->getId());
200  $overlay->setTrigger("ilChkboxListTrigger_".$this->getId());
201  $overlay->setAutoHide(false);
202  //$overlay->setSize("300px", "300px");
203  $overlay->add();
204 
205  $tpl = new ilTemplate("tpl.checkbox_list_overlay.html", true, true,
206  "Services/UIComponent/CheckboxListOverlay", "DEFAULT", false, true);
207 
208  $tpl->setCurrentBlock("top_img");
209  switch ($this->getHeaderIcon())
210  {
212  $tpl->setVariable("IMG_DOWN",
214  break;
216  $tpl->setVariable("IMG_DOWN",
218  break;
219  default:
220  $tpl->setVariable("IMG_DOWN", $this->getHeaderIcon());
221  break;
222  }
223  // do not repeat title (accessibility) -> empty alt
224  $tpl->setVariable("TXT_SEL_TOP", $this->getLinkTitle());
225  $tpl->setVariable("ALT_SEL_TOP", "");
226  $tpl->setVariable("CLASS_SEL_TOP", $this->getSelectionHeaderClass());
227  $tpl->parseCurrentBlock();
228 
229  reset($items);
230  foreach ($items as $k => $v)
231  {
232  $tpl->setCurrentBlock("list_entry");
233  $tpl->setVariable("VAR", $this->getFieldVar());
234  $tpl->setVariable("VAL_ENTRY", $k);
235  $tpl->setVariable("TXT_ENTRY", $v["txt"]);
236  if ($v["selected"])
237  {
238  $tpl->setVariable("CHECKED", "checked='checked'");
239  }
240  $tpl->parseCurrentBlock();
241  }
242 
243  $tpl->setVariable("ID", $this->getId());
244  $tpl->setVariable("HIDDEN_VAR", $this->getHiddenVar());
245  $tpl->setVariable("CMD_SUBMIT", $this->getFormCmd());
246  $tpl->setVariable("VAL_SUBMIT", $lng->txt("refresh"));
247  return $tpl->get();
248  }
getSelectionHeaderClass()
Get Selection Header Class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
This is a utility class for the yui overlays.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getId()

ilCheckboxListOverlayGUI::getId ( )

Get id.

Returns
string id

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

Referenced by getHTML().

45  {
46  return $this->id;
47  }
+ Here is the caller graph for this function:

◆ getItems()

ilCheckboxListOverlayGUI::getItems ( )

Get items.

Returns
array items

Definition at line 104 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 84 of file class.ilCheckboxListOverlayGUI.php.

Referenced by getHTML().

85  {
86  return $this->link_title;
87  }
+ Here is the caller graph for this function:

◆ getSelectionHeaderClass()

ilCheckboxListOverlayGUI::getSelectionHeaderClass ( )

Get Selection Header Class.

Returns
string Selection Header Class

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

Referenced by getHTML().

125  {
126  return $this->selectionheaderclass;
127  }
+ Here is the caller graph for this function:

◆ setFieldVar()

ilCheckboxListOverlayGUI::setFieldVar (   $a_val)

Set field var.

Parameters
stringfield var

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

155  {
156  $this->field_var = $a_val;
157  }

◆ setFormCmd()

ilCheckboxListOverlayGUI::setFormCmd (   $a_val)

Set form command.

Parameters
stringform command

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

135  {
136  $this->form_cmd = $a_val;
137  }

◆ setHeaderIcon()

ilCheckboxListOverlayGUI::setHeaderIcon (   $a_headericon)

Set Header Icon.

Parameters
string$a_headericonHeader Icon

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

Referenced by __construct().

55  {
56  $this->headericon = $a_headericon;
57  }
+ Here is the caller graph for this function:

◆ 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 174 of file class.ilCheckboxListOverlayGUI.php.

175  {
176  $this->hidden_var = $a_val;
177  }

◆ setId()

ilCheckboxListOverlayGUI::setId (   $a_val)

Set id.

Parameters
stringid

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

Referenced by __construct().

35  {
36  $this->id = $a_val;
37  }
+ Here is the caller graph for this function:

◆ setItems()

ilCheckboxListOverlayGUI::setItems (   $a_val)

Set items.

Parameters
arrayitems

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

95  {
96  $this->items = $a_val;
97  }

◆ setLinkTitle()

ilCheckboxListOverlayGUI::setLinkTitle (   $a_val)

Set link title.

Parameters
stringlink title

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

75  {
76  $this->link_title = $a_val;
77  }

◆ setSelectionHeaderClass()

ilCheckboxListOverlayGUI::setSelectionHeaderClass (   $a_selectionheaderclass)

Set Selection Header Class.

Parameters
string$a_selectionheaderclassSelection Header Class

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

115  {
116  $this->selectionheaderclass = $a_selectionheaderclass;
117  }

Field Documentation

◆ $items

ilCheckboxListOverlayGUI::$items = array()
private

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

Referenced by getHTML(), and getItems().

◆ DOWN_ARROW_DARK

const ilCheckboxListOverlayGUI::DOWN_ARROW_DARK = "mm_down_arrow_dark.png"

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

Referenced by __construct(), and getHTML().

◆ DOWN_ARROW_LIGHT

const ilCheckboxListOverlayGUI::DOWN_ARROW_LIGHT = "mm_down_arrow.png"

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

Referenced by getHTML().

◆ NO_ICON

const ilCheckboxListOverlayGUI::NO_ICON = ""

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


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