ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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

 $lng
 
 $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 25 of file class.ilChecklistGUI.php.

References $DIC.

26  {
27  global $DIC;
28 
29  $this->lng = $DIC->language();
30  }
global $DIC
Definition: saml.php:7

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 37 of file class.ilChecklistGUI.php.

38  {
39  $this->items[] = array(
40  "txt" => $a_txt,
41  "href" => $a_href,
42  "status" => $a_status,
43  "highlighted" => $a_highlighted,
44  "info" => $a_info_texts
45  );
46  }

◆ getHeading()

ilChecklistGUI::getHeading ( )

Get heading.

Returns
string heading

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

Referenced by getHTML().

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

◆ getHTML()

ilChecklistGUI::getHTML ( )

Get HTML.

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

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

72  {
73  $lng = $this->lng;
74 
75  include_once("./Services/UIComponent/Panel/classes/class.ilPanelGUI.php");
76  $panel = ilPanelGUI::getInstance();
77  $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
78  $panel->setHeadingStyle(ilPanelGUI::HEADING_STYLE_BLOCK);
79  $panel->setHeading($this->getHeading());
80  include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
81  $list = new ilGroupedListGUI();
82  foreach ($this->items as $i) {
83  $item_tpl = new ilTemplate("tpl.checklist_item.html", true, true, "Services/UIComponent/Checklist");
84 
85  if (!is_array($i["info"]) && $i["info"] != "") {
86  $i["info"] = array($i["info"]);
87  }
88  if (is_array($i["info"]) && count($i["info"]) > 0) {
89  foreach ($i["info"] as $info) {
90  $item_tpl->setCurrentBlock("info");
91  $item_tpl->setVariable("INFO_MSG", $info);
92  $item_tpl->parseCurrentBlock();
93  }
94  }
95 
96  $item_tpl->setVariable("TXT_STEP", $i["txt"]);
97  switch ($i["status"]) {
98  case self::STATUS_OK:
99  $item_tpl->setVariable("STATUS_IMG", ilUtil::getImagePath("icon_ok.svg"));
100  $item_tpl->setVariable("STATUS_ALT", $lng->txt("uic_checklist_ok"));
101  break;
102 
103  case self::STATUS_NOT_OK:
104  $item_tpl->setVariable("STATUS_IMG", ilUtil::getImagePath("icon_not_ok.svg"));
105  $item_tpl->setVariable("STATUS_ALT", $lng->txt("uic_checklist_not_ok"));
106  break;
107  }
108  $list->addEntry($item_tpl->get(), $i["href"], "", "", $i["highlighted"] ? "ilHighlighted" : "");
109  }
110  $ch_tpl = new ilTemplate("tpl.checklist.html", true, true, "Services/UIComponent/Checklist");
111  $ch_tpl->setVariable("LIST", $list->getHTML());
112  $panel->setBody($ch_tpl->get());
113  return $panel->getHTML();
114  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
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.
$i
Definition: disco.tpl.php:19
const PANEL_STYLE_SECONDARY
const HEADING_STYLE_BLOCK
$info
Definition: index.php:5
+ Here is the call graph for this function:

◆ setHeading()

ilChecklistGUI::setHeading (   $a_val)

Set heading.

Parameters
string$a_valheading

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

54  {
55  $this->heading = $a_val;
56  }

Field Documentation

◆ $items

ilChecklistGUI::$items = array()
protected

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

◆ $lng

ilChecklistGUI::$lng
protected

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

Referenced by getHTML().

◆ 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: