ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
ilChecklistGUI Class Reference
+ Collaboration diagram for ilChecklistGUI:

Public Member Functions

 __construct ()
 
 addEntry ($a_txt, $a_href, $a_status=self::STATUS_NO_STATUS, $a_highlighted=false, $a_info_texts=array())
 Add item. More...
 
 setHeading ($a_val)
 Set heading. More...
 
 getHeading ()
 Get heading. More...
 
 getHTML ()
 Get HTML. More...
 

Data Fields

const STATUS_OK = "ok"
 
const STATUS_NOT_OK = "nok"
 
const STATUS_NO_STATUS = "no_status"
 

Protected Attributes

 $items = array()
 

Detailed Description

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.ilChecklistGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilChecklistGUI::__construct ( )

Definition at line 20 of file class.ilChecklistGUI.php.

21  {
22 
23  }

Member Function Documentation

◆ addEntry()

ilChecklistGUI::addEntry (   $a_txt,
  $a_href,
  $a_status = self::STATUS_NO_STATUS,
  $a_highlighted = false,
  $a_info_texts = array() 
)

Add item.

Parameters
string$a_txttext

Definition at line 30 of file class.ilChecklistGUI.php.

31  {
32  $this->items[] = array(
33  "txt" => $a_txt,
34  "href" => $a_href,
35  "status" => $a_status,
36  "highlighted" => $a_highlighted,
37  "info" => $a_info_texts
38  );
39  }

◆ getHeading()

ilChecklistGUI::getHeading ( )

Get heading.

Returns
string heading

Definition at line 56 of file class.ilChecklistGUI.php.

Referenced by getHTML().

57  {
58  return $this->heading;
59  }
+ Here is the caller graph for this function:

◆ getHTML()

ilChecklistGUI::getHTML ( )

Get HTML.

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

References $info, $lng, getHeading(), ilUtil\getImagePath(), ilPanelGUI\getInstance(), ilPanelGUI\HEADING_STYLE_BLOCK, and ilPanelGUI\PANEL_STYLE_SECONDARY.

65  {
66  global $lng;
67 
68  include_once("./Services/UIComponent/Panel/classes/class.ilPanelGUI.php");
69  $panel = ilPanelGUI::getInstance();
70  $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
71  $panel->setHeadingStyle(ilPanelGUI::HEADING_STYLE_BLOCK);
72  $panel->setHeading($this->getHeading());
73  include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
74  $list = new ilGroupedListGUI();
75  foreach ($this->items as $i)
76  {
77  $item_tpl = new ilTemplate("tpl.checklist_item.html", true, true, "Services/UIComponent/Checklist");
78 
79  if (!is_array($i["info"]) && $i["info"] != "")
80  {
81  $i["info"] = array($i["info"]);
82  }
83  if (is_array($i["info"]) && count($i["info"]) > 0)
84  {
85  foreach ($i["info"] as $info)
86  {
87  $item_tpl->setCurrentBlock("info");
88  $item_tpl->setVariable("INFO_MSG", $info);
89  $item_tpl->parseCurrentBlock();
90  }
91  }
92 
93  $item_tpl->setVariable("TXT_STEP", $i["txt"]);
94  switch ($i["status"])
95  {
96  case self::STATUS_OK:
97  $item_tpl->setVariable("STATUS_IMG", ilUtil::getImagePath("icon_ok.svg"));
98  $item_tpl->setVariable("STATUS_ALT", $lng->txt("uic_checklist_ok"));
99  break;
100 
101  case self::STATUS_NOT_OK:
102  $item_tpl->setVariable("STATUS_IMG", ilUtil::getImagePath("icon_not_ok.svg"));
103  $item_tpl->setVariable("STATUS_ALT", $lng->txt("uic_checklist_not_ok"));
104  break;
105  }
106  $list->addEntry($item_tpl->get(), $i["href"], "", "", $i["highlighted"] ? "ilHighlighted" : "");
107  }
108  $ch_tpl = new ilTemplate("tpl.checklist.html", true, true, "Services/UIComponent/Checklist");
109  $ch_tpl->setVariable("LIST", $list->getHTML());
110  $panel->setBody($ch_tpl->get());
111  return $panel->getHTML();
112  }
$info
Definition: example_052.php:80
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Grouped list GUI class.
special template class to simplify handling of ITX/PEAR
getHeading()
Get heading.
static getInstance()
Get instance.
global $lng
Definition: privfeed.php:40
const PANEL_STYLE_SECONDARY
const HEADING_STYLE_BLOCK
+ Here is the call graph for this function:

◆ setHeading()

ilChecklistGUI::setHeading (   $a_val)

Set heading.

Parameters
string$a_valheading

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

47  {
48  $this->heading = $a_val;
49  }

Field Documentation

◆ $items

ilChecklistGUI::$items = array()
protected

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

◆ STATUS_NO_STATUS

const ilChecklistGUI::STATUS_NO_STATUS = "no_status"

◆ STATUS_NOT_OK

const ilChecklistGUI::STATUS_NOT_OK = "nok"

◆ STATUS_OK

const ilChecklistGUI::STATUS_OK = "ok"

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