ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 setHeading ($a_val)
 Set heading.
 getHeading ()
 Get heading.
 getHTML ()
 Get HTML.

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

ilChecklistGUI::__construct ( )

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

{
}

Member Function Documentation

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.

{
$this->items[] = array(
"txt" => $a_txt,
"href" => $a_href,
"status" => $a_status,
"highlighted" => $a_highlighted,
"info" => $a_info_texts
);
}
ilChecklistGUI::getHeading ( )

Get heading.

Returns
string heading

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

Referenced by getHTML().

{
return $this->heading;
}

+ Here is the caller graph for this function:

ilChecklistGUI::getHTML ( )

Get HTML.

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

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

{
global $lng;
include_once("./Services/UIComponent/Panel/classes/class.ilPanelGUI.php");
$panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
$panel->setHeadingStyle(ilPanelGUI::HEADING_STYLE_BLOCK);
$panel->setHeading($this->getHeading());
include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
$list = new ilGroupedListGUI();
foreach ($this->items as $i)
{
$item_tpl = new ilTemplate("tpl.checklist_item.html", true, true, "Services/UIComponent/Checklist");
if (!is_array($i["info"]) && $i["info"] != "")
{
$i["info"] = array($i["info"]);
}
if (is_array($i["info"]) && count($i["info"]) > 0)
{
foreach ($i["info"] as $info)
{
$item_tpl->setCurrentBlock("info");
$item_tpl->setVariable("INFO_MSG", $info);
$item_tpl->parseCurrentBlock();
}
}
$item_tpl->setVariable("TXT_STEP", $i["txt"]);
switch ($i["status"])
{
case self::STATUS_OK:
$item_tpl->setVariable("STATUS_IMG", ilUtil::getImagePath("icon_ok.svg"));
$item_tpl->setVariable("STATUS_ALT", $lng->txt("uic_checklist_ok"));
break;
case self::STATUS_NOT_OK:
$item_tpl->setVariable("STATUS_IMG", ilUtil::getImagePath("icon_not_ok.svg"));
$item_tpl->setVariable("STATUS_ALT", $lng->txt("uic_checklist_not_ok"));
break;
}
$list->addEntry($item_tpl->get(), $i["href"], "", "", $i["highlighted"] ? "ilHighlighted" : "");
}
$ch_tpl = new ilTemplate("tpl.checklist.html", true, true, "Services/UIComponent/Checklist");
$ch_tpl->setVariable("LIST", $list->getHTML());
$panel->setBody($ch_tpl->get());
return $panel->getHTML();
}

+ Here is the call graph for this function:

ilChecklistGUI::setHeading (   $a_val)

Set heading.

Parameters
string$a_valheading

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

{
$this->heading = $a_val;
}

Field Documentation

ilChecklistGUI::$items = array()
protected

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

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

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