ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilGroupedListGUI Class Reference

Grouped list GUI class. More...

+ Inheritance diagram for ilGroupedListGUI:
+ Collaboration diagram for ilGroupedListGUI:

Public Member Functions

 __construct ()
 Constructor.
 setAsDropDown ($a_val, $a_pullright=false)
 Set as drop down.
 getAsDropDown ()
 Get as drop down.
 addGroupHeader ($a_content, $a_add_class="")
 Add group header.
 addSeparator ()
 Add separator.
 nextColumn ()
 Add separator.
 addEntry ($a_content, $a_href="", $a_target="", $a_onclick="", $a_add_class="", $a_id="", $a_ttip="", $a_tt_my="right center", $a_tt_at="left center", $a_tt_use_htmlspecialchars=true)
 Add entry.
 getHTML ()
 Get HTML.

Protected Attributes

 $multi_column = false
 $items = array()
 $as_dropdown = false
 $dd_pullright = false

Detailed Description

Grouped list GUI class.

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

Constructor & Destructor Documentation

ilGroupedListGUI::__construct ( )

Constructor.

Definition at line 22 of file class.ilGroupedListGUI.php.

{
}

Member Function Documentation

ilGroupedListGUI::addEntry (   $a_content,
  $a_href = "",
  $a_target = "",
  $a_onclick = "",
  $a_add_class = "",
  $a_id = "",
  $a_ttip = "",
  $a_tt_my = "right center",
  $a_tt_at = "left center",
  $a_tt_use_htmlspecialchars = true 
)

Add entry.

Parameters
@return

Reimplemented in ilCloudGroupedListGUI.

Definition at line 82 of file class.ilGroupedListGUI.php.

{
$this->items[] = array("type" => "entry", "content" => $a_content,
"href" => $a_href, "target" => $a_target, "onclick" => $a_onclick,
"add_class" => $a_add_class, "id" => $a_id, "ttip" => $a_ttip,
"tt_my" => $a_tt_my, "tt_at" => $a_tt_at,
"tt_use_htmlspecialchars" => $a_tt_use_htmlspecialchars);
}
ilGroupedListGUI::addGroupHeader (   $a_content,
  $a_add_class = "" 
)

Add group header.

Parameters
@return

Reimplemented in ilCloudGroupedListGUI.

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

{
$this->items[] = array("type" => "group_head", "content" => $a_content,
"add_class" => $a_add_class);
}
ilGroupedListGUI::addSeparator ( )

Add separator.

Reimplemented in ilCloudGroupedListGUI.

Definition at line 62 of file class.ilGroupedListGUI.php.

{
$this->items[] = array("type" => "sep");
}
ilGroupedListGUI::getAsDropDown ( )

Get as drop down.

Returns
bool as drop down menu

Definition at line 42 of file class.ilGroupedListGUI.php.

References $as_dropdown.

Referenced by getHTML().

{
}

+ Here is the caller graph for this function:

ilGroupedListGUI::getHTML ( )

Get HTML.

Parameters
@return

Definition at line 100 of file class.ilGroupedListGUI.php.

References $ilCtrl, $tpl, ilTooltipGUI\addTooltip(), and getAsDropDown().

{
global $ilCtrl;
$tpl = new ilTemplate("tpl.grouped_list.html", true, true, "Services/UIComponent/GroupedList");
$tt_calls = "";
foreach ($this->items as $i)
{
switch($i["type"])
{
case "sep":
$tpl->touchBlock("sep");
$tpl->touchBlock("item");
break;
case "next_col":
$tpl->touchBlock("next_col");
$tpl->touchBlock("item");
break;
case "group_head":
$tpl->setCurrentBlock("group_head");
if ($i["add_class"] != "")
{
$tpl->setVariable("ADD_CLASS", $i["add_class"]);
}
$tpl->setVariable("GROUP_HEAD", $i["content"]);
$tpl->parseCurrentBlock();
$tpl->touchBlock("item");
break;
case "entry":
if ($i["href"] != "")
{
$tpl->setCurrentBlock("linked_entry");
if ($i["add_class"] != "")
{
$tpl->setVariable("ADD_CLASS", $i["add_class"]);
}
$tpl->setVariable("HREF", $i["href"]);
$tpl->setVariable("TXT_ENTRY", $i["content"]);
if ($i["target"] != "")
{
$tpl->setVariable("TARGET", 'target="'.$i["target"].'"');
}
else
{
$tpl->setVariable("TARGET", 'target="_top"');
}
if ($i["onclick"] != "")
{
$tpl->setVariable("ONCLICK", 'onclick="'.$i["onclick"].'"');
}
if ($i["id"] != "")
{
$tpl->setVariable("ID", 'id="'.$i["id"].'"');
}
$tpl->parseCurrentBlock();
$tpl->touchBlock("item");
if ($i["ttip"] != "" && $i["id"] != "")
{
include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
if ($ilCtrl->isAsynch())
{
$tt_calls.= " ".ilTooltipGUI::getTooltip($i["id"], $i["ttip"],
"", $i["tt_my"], $i["tt_at"], $i["tt_use_htmlspecialchars"]);
}
else
{
ilTooltipGUI::addTooltip($i["id"], $i["ttip"],
"", $i["tt_my"], $i["tt_at"], $i["tt_use_htmlspecialchars"]);
}
}
}
else
{
$tpl->setCurrentBlock("unlinked_entry");
if ($i["add_class"] != "")
{
$tpl->setVariable("ADD_CLASS2", $i["add_class"]);
}
$tpl->setVariable("TXT_ENTRY2", $i["content"]);
$tpl->parseCurrentBlock();
}
break;
}
}
if ($this->multi_column)
{
$tpl->touchBlock("multi_start");
$tpl->touchBlock("multi_end");
}
if ($tt_calls != "")
{
$tpl->setCurrentBlock("script");
$tpl->setVariable("TT_CALLS", $tt_calls);
$tpl->parseCurrentBlock();
}
if ($this->getAsDropDown())
{
if ($this->dd_pullright)
{
$tpl->setVariable("LIST_CLASS", "dropdown-menu pull-right");
}
else
{
$tpl->setVariable("LIST_CLASS", "dropdown-menu");
}
$tpl->setVariable("LIST_ROLE", "menu");
}
else
{
$tpl->setVariable("LIST_CLASS", "");
$tpl->setVariable("LIST_ROLE", "");
}
return $tpl->get();
}

+ Here is the call graph for this function:

ilGroupedListGUI::nextColumn ( )

Add separator.

Definition at line 70 of file class.ilGroupedListGUI.php.

{
$this->items[] = array("type" => "next_col");
$this->multi_column = true;
}
ilGroupedListGUI::setAsDropDown (   $a_val,
  $a_pullright = false 
)

Set as drop down.

Parameters
bool$a_valas drop down menu

Definition at line 31 of file class.ilGroupedListGUI.php.

{
$this->as_dropdown = $a_val;
$this->dd_pullright = $a_pullright;
}

Field Documentation

ilGroupedListGUI::$as_dropdown = false
protected

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

Referenced by getAsDropDown().

ilGroupedListGUI::$dd_pullright = false
protected

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

ilGroupedListGUI::$items = array()
protected

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

ilGroupedListGUI::$multi_column = false
protected

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


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