ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilHierarchyFormGUI Class Reference

This class represents a hierarchical form. More...

+ Inheritance diagram for ilHierarchyFormGUI:
+ Collaboration diagram for ilHierarchyFormGUI:

Public Member Functions

 __construct ()
 Constructor.
 setId ($a_id)
 Set Id.
 getId ()
 Get Id.
 setTree ($a_tree)
 Set Tree Object.
 getTree ()
 Get Tree Object.
 setCurrentTopNodeId ($a_currenttopnodeid)
 Set Current Top Node ID.
 getCurrentTopNodeId ()
 Get Current Top Node ID.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setIcon ($a_icon)
 Set Icon.
 getIcon ()
 Get Icon.
 setCheckboxName ($a_checkboxname)
 Set Checkbox Name.
 getCheckboxName ()
 Get Checkbox Name.
 setDragIcon ($a_dragicon)
 Set Drag Icon Path.
 getDragIcon ()
 Get Drag Icon Path.
 setMaxDepth ($a_maxdepth)
 Set Maximum Depth.
 getMaxDepth ()
 Get Maximum Depth.
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater.
 addHelpItem ($a_text, $a_image="")
 Get all help items.
 getHelpItems ()
 Get all help items.
 makeDragTarget ($a_id, $a_group, $a_first_child_drop_area=false, $a_as_subitem=false, $a_diss_text="")
 Makes a nodes (following droparea) a drag target.
 makeDragContent ($a_id, $a_group)
 Makes a node a drag content.
 addMultiCommand ($a_txt, $a_cmd)
 Add a multi command (for selection of items)
 addCommand ($a_txt, $a_cmd)
 Add a command.
 getChilds ($a_node_id=false)
 Get all childs of current node.
 getContent ()
 Get Form Content.
 getLevelHTML ($a_par_node, $a_depth, &$a_childs)
 Get Form HTML.
 renderChild ($a_tpl, $a_child, $a_depth, $next_sibling=null)
 Render a single child (including grandchilds)
 getChildIcon ($a_item)
 Get icon path for an item.
 getChildIconAlt ($a_item)
 Get icon alt text for an item.
 getChildCommands ($a_item)
 Get item commands.
 getMenuItems ($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
 Get menu items for drop area of node.
 nodeAllowsChilds ($a_node)
 Checks, whether current nodes allows childs at all.
 manageDragAndDrop ($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
 Makes nodes drag and drop content and targets.
- Public Member Functions inherited from ilFormGUI
 ilFormGUI ()
 Constructor.
 setFormAction ($a_formaction)
 Set FormAction.
 getFormAction ()
 Get FormAction.
 setTarget ($a_target)
 Set Target.
 getTarget ()
 Get Target.
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false.
 getMultipart ()
 Get Enctype Multipart/Formdata true/false.
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open.
 getKeepOpen ()
 Get Keep Form Tag Open.
 getHTML ()
 Get HTML.

Static Public Member Functions

static getPostMulti ()
 Get multi number of _POST input.
static getPostNodeId ()
 Get node ID of _POST input.
static getPostFirstChild ()
 Should node be inserted as first child of target node (true) or as successor (false)

Additional Inherited Members

- Protected Attributes inherited from ilFormGUI
 $formaction
 $multipart = false
 $keepopen = false

Detailed Description

This class represents a hierarchical form.

These forms are used for quick editing, where each node is represented by it's title.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

ilHierarchyFormGUI::__construct ( )

Constructor.

Parameters

Definition at line 41 of file class.ilHierarchyFormGUI.php.

References $lng, $tpl, ilFormGUI\ilFormGUI(), ilYuiUtil\initDragDrop(), and setCheckboxName().

Referenced by ilChapterHierarchyFormGUI\__construct().

{
global $lng, $tpl;
$this->maxdepth = -1;
$this->multi_commands = array();
$this->commands = array();
$this->drag_target[] = array();
$this->drag_content[] = array();
$lng->loadLanguageModule("form");
$this->setCheckboxName("cbox");
$this->help_items = array();
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
$tpl->addJavascript("./Services/Form/js/ServiceFormHierarchyForm.js");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Function Documentation

ilHierarchyFormGUI::addCommand (   $a_txt,
  $a_cmd 
)

Add a command.

Parameters
string$a_txtcommand text
string$a_cmdcommand

Definition at line 305 of file class.ilHierarchyFormGUI.php.

{
$this->commands[] = array("text" => $a_txt, "cmd" => $a_cmd);
}
ilHierarchyFormGUI::addHelpItem (   $a_text,
  $a_image = "" 
)

Get all help items.

Definition at line 235 of file class.ilHierarchyFormGUI.php.

{
$this->help_items[] = array("text" => $a_text,
"image" => $a_image);
}
ilHierarchyFormGUI::addMultiCommand (   $a_txt,
  $a_cmd 
)

Add a multi command (for selection of items)

Parameters
string$a_txtcommand text
string$a_cmdcommand

Definition at line 294 of file class.ilHierarchyFormGUI.php.

{
$this->multi_commands[] = array("text" => $a_txt, "cmd" => $a_cmd);
}
ilHierarchyFormGUI::getCheckboxName ( )

Get Checkbox Name.

Returns
string Checkbox Name

Definition at line 175 of file class.ilHierarchyFormGUI.php.

Referenced by renderChild().

{
return $this->checkboxname;
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getChildCommands (   $a_item)

Get item commands.

Parameters
arrayitem array
Returns
array array of arrays("text", "link")

Reimplemented in ilChapterHierarchyFormGUI.

Definition at line 762 of file class.ilHierarchyFormGUI.php.

Referenced by renderChild().

{
return false;
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getChildIcon (   $a_item)

Get icon path for an item.

Parameters
arrayitem array
Returns
string icon path

Reimplemented in ilChapterHierarchyFormGUI.

Definition at line 738 of file class.ilHierarchyFormGUI.php.

References ilUtil\getImagePath().

Referenced by renderChild().

{
return ilUtil::getImagePath("icon_".$a_item["type"].".gif");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getChildIconAlt (   $a_item)

Get icon alt text for an item.

Parameters
arrayitem array
Returns
string icon alt text

Reimplemented in ilChapterHierarchyFormGUI.

Definition at line 749 of file class.ilHierarchyFormGUI.php.

References $lng.

Referenced by renderChild().

{
global $lng;
return $lng->txt($a_item["type"]);
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getChilds (   $a_node_id = false)

Get all childs of current node.

Standard implementation uses tree object.

Definition at line 314 of file class.ilHierarchyFormGUI.php.

References getCurrentTopNodeId(), and getTree().

Referenced by getLevelHTML().

{
if ($a_node_id == false)
{
$a_node_id = $this->getCurrentTopNodeId();
}
$tree_childs = $this->getTree()->getChilds($a_node_id);
$childs = array();
foreach($tree_childs as $tree_child)
{
$childs[] = array("node_id" => $tree_child["child"],
"title" => $tree_child["title"],
"type" => $tree_child["type"]);
}
return $childs;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getContent ( )

Get Form Content.

Reimplemented from ilFormGUI.

Definition at line 336 of file class.ilHierarchyFormGUI.php.

References $cmd, $lng, getCurrentTopNodeId(), getDragIcon(), getHelpItems(), getIcon(), ilUtil\getImagePath(), getLevelHTML(), getTitle(), and getTree().

{
global $lng;
$ttpl = new ilTemplate("tpl.hierarchy_form.html", true, true, "Services/Form");
$top_node_data = $this->getTree()->getNodeData($this->getCurrentTopNodeId());
$top_node = array("node_id" => $top_node_data["child"],
"title" => $top_node_data["title"],
"type" => $top_node_data["type"]);
$childs = null;
$nodes_html = $this->getLevelHTML($top_node, 0, $childs);
// icon
if ($this->getIcon() != "")
{
$ttpl->setCurrentBlock("icon");
$ttpl->setVariable("SRC_ICON", $this->getIcon());
$ttpl->parseCurrentBlock();
}
// commands
if (count($this->multi_commands) > 0 || count($this->commands) > 0)
{
$single = false;
foreach($this->commands as $cmd)
{
$ttpl->setCurrentBlock("cmd");
$ttpl->setVariable("CMD", $cmd["cmd"]);
$ttpl->setVariable("CMD_TXT", $cmd["text"]);
$ttpl->parseCurrentBlock();
$single = true;
}
if (count($childs) > 0)
{
$multi = false;
foreach($this->multi_commands as $cmd)
{
$ttpl->setCurrentBlock("multi_cmd");
$ttpl->setVariable("MULTI_CMD", $cmd["cmd"]);
$ttpl->setVariable("MULTI_CMD_TXT", $cmd["text"]);
$ttpl->parseCurrentBlock();
$multi = true;
}
if ($multi)
{
$ttpl->setCurrentBlock("multi_cmds");
$ttpl->setVariable("MCMD_ALT", $lng->txt("commands"));
$ttpl->setVariable("MCMD_IMG", ilUtil::getImagePath("arrow_downright.gif"));
$ttpl->parseCurrentBlock();
}
}
if ($single || $multi)
{
$ttpl->setCurrentBlock("commands");
$ttpl->parseCurrentBlock();
}
}
// explorer updater
if ($this->exp_frame != "")
{
$ttpl->setCurrentBlock("updater");
$ttpl->setVariable("UPDATER_FRAME", $this->exp_frame);
$ttpl->setVariable("EXP_ID_UPDATER", $this->exp_id);
$ttpl->setVariable("HREF_UPDATER", $this->exp_target_script);
$ttpl->parseCurrentBlock();
}
// drag and drop initialisation
foreach($this->drag_target as $drag_target)
{
$ttpl->setCurrentBlock("dragtarget");
$ttpl->setVariable("EL_ID", $drag_target["id"]);
$ttpl->setVariable("GROUP", $drag_target["group"]);
$ttpl->parseCurrentBlock();
}
foreach($this->drag_content as $drag_content)
{
$ttpl->setCurrentBlock("dragcontent");
$ttpl->setVariable("EL_ID", $drag_content["id"]);
$ttpl->setVariable("GROUP", $drag_content["group"]);
$ttpl->parseCurrentBlock();
}
// disambiguation menues and "insert as first child" flags
if (is_array($this->diss_menues))
{
foreach($this->diss_menues as $node_id => $d_menu)
{
foreach($d_menu as $group => $menu)
{
if (count($menu) > 1)
{
foreach($menu as $menu_item)
{
$ttpl->setCurrentBlock("dmenu_cmd");
$ttpl->setVariable("SUBITEM", (int) $menu_item["subitem"]);
$ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
$ttpl->parseCurrentBlock();
}
$ttpl->setCurrentBlock("disambiguation_menu");
$ttpl->setVariable("DNODE_ID", $node_id);
$ttpl->setVariable("GRP", $group);
$ttpl->parseCurrentBlock();
}
else if (count($menu) == 1)
{
// set first child flag
$ttpl->setCurrentBlock("as_subitem_flag");
$ttpl->setVariable("SI_NODE_ID", $node_id);
$ttpl->setVariable("SI_GRP", $group);
$ttpl->setVariable("SI_SI", (int) $menu[0]["subitem"]);
$ttpl->parseCurrentBlock();
}
}
}
}
$this->diss_menues[$a_id][$a_group][] = array("type" => $a_type, "text" => $a_diss_text);
// help
$ttpl->setCurrentBlock("help_img");
$ttpl->setVariable("IMG_HELP", ilUtil::getImagePath("streaked_area.gif"));
$ttpl->parseCurrentBlock();
$ttpl->setCurrentBlock("help_section");
$ttpl->setVariable("TXT_HELP",
$lng->txt("form_hierarchy_add_elements"));
$ttpl->parseCurrentBlock();
if ($this->getDragIcon() != "")
{
$ttpl->setCurrentBlock("help_img");
$ttpl->setVariable("IMG_HELP", $this->getDragIcon());
$ttpl->parseCurrentBlock();
$ttpl->setCurrentBlock("help_img");
$ttpl->setVariable("IMG_HELP",
ilUtil::getImagePath("drop_streaked_area.gif"));
$ttpl->parseCurrentBlock();
$ttpl->setCurrentBlock("help_section");
$ttpl->setVariable("TXT_HELP",
$lng->txt("form_hierarchy_drag_drop_help"));
$ttpl->parseCurrentBlock();
}
// additional help items
foreach ($this->getHelpItems() as $help)
{
if ($help["image"] != "")
{
$ttpl->setCurrentBlock("help_img");
$ttpl->setVariable("IMG_HELP", $help["image"]);
$ttpl->parseCurrentBlock();
}
$ttpl->setCurrentBlock("help_section");
$ttpl->setVariable("TXT_HELP", $help["text"]);
$ttpl->parseCurrentBlock();
}
// nodes
$ttpl->setVariable("NODES", $nodes_html);
// title
//echo "<br>".htmlentities($this->getTitle())." --- ".htmlentities(ilUtil::prepareFormOutput($this->getTitle()));
$ttpl->setVariable("TITLE", $this->getTitle());
return $ttpl->get();
}

+ Here is the call graph for this function:

ilHierarchyFormGUI::getCurrentTopNodeId ( )

Get Current Top Node ID.

Returns
string Current Top Node ID

Definition at line 115 of file class.ilHierarchyFormGUI.php.

Referenced by getChilds(), and getContent().

{
return $this->currenttopnodeid;
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getDragIcon ( )

Get Drag Icon Path.

Returns
string Drag Icon Path

Definition at line 195 of file class.ilHierarchyFormGUI.php.

Referenced by getContent().

{
return $this->dragicon;
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getHelpItems ( )

Get all help items.

Definition at line 244 of file class.ilHierarchyFormGUI.php.

Referenced by getContent().

{
return $this->help_items;
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getIcon ( )

Get Icon.

Returns
string Icon

Definition at line 155 of file class.ilHierarchyFormGUI.php.

Referenced by getContent().

{
return $this->icon;
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getId ( )

Get Id.

Returns
string Id

Reimplemented from ilFormGUI.

Definition at line 75 of file class.ilHierarchyFormGUI.php.

{
return "hform";
}
ilHierarchyFormGUI::getLevelHTML (   $a_par_node,
  $a_depth,
$a_childs 
)

Get Form HTML.

Definition at line 511 of file class.ilHierarchyFormGUI.php.

References getChilds(), ilUtil\getImagePath(), getMaxDepth(), getMenuItems(), manageDragAndDrop(), nodeAllowsChilds(), and renderChild().

Referenced by getContent(), and renderChild().

{
if ($this->getMaxDepth() > -1 && $this->getMaxDepth() < $a_depth)
{
return "";
}
$childs = $this->getChilds($a_par_node["node_id"]);
$a_childs = $childs;
//var_dump($a_par_node);
$html = "";
$last_child = null;
$ttpl = new ilTemplate("tpl.hierarchy_form_nodes.html", true, true, "Services/Form");
// prepended drop area
if ($this->nodeAllowsChilds($a_par_node) && (count($childs) > 0 || $a_depth == 0))
{
$ttpl->setCurrentBlock("drop_area");
$ttpl->setVariable("DNODE_ID", $a_par_node["node_id"]."fc"); // fc means "first child"
$ttpl->setVariable("IMG_BLANK", ilUtil::getImagePath("spacer.gif"));
$ttpl->parseCurrentBlock();
$this->manageDragAndDrop($a_par_node, $a_depth, true, null, $childs);
$menu_items = $this->getMenuItems($a_par_node, $a_depth, true, null, $childs);
//var_dump($menu_items);
if (count($menu_items) > 0)
{
// determine maximum of multi add numbers
$max = 1;
foreach($menu_items as $menu_item)
{
if ($menu_item["multi"] > $max)
{
$max = $menu_item["multi"];
}
}
reset($menu_items);
foreach($menu_items as $menu_item)
{
if ($menu_item["multi"] > 1 )
{
for($i = 2; $i <= $menu_item["multi"]; $i++)
{
$ttpl->setCurrentBlock("multi_add");
$ttpl->setVariable("MA_NUM", $i);
$ttpl->setVariable("MENU_CMD", $menu_item["cmd"]);
$ttpl->setVariable("FC", "1");
$ttpl->setVariable("CMD_NODE", $a_par_node["node_id"]);
$ttpl->parseCurrentBlock();
}
}
// buffer td for lower multis
if ($max > $menu_item["multi"])
{
$ttpl->setCurrentBlock("multi_buffer");
$ttpl->setVariable("BUF_SPAN", $max - $menu_item["multi"]);
$ttpl->parseCurrentBlock();
}
$ttpl->setCurrentBlock("menu_cmd");
$ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
$ttpl->setVariable("MENU_CMD", $menu_item["cmd"]);
$ttpl->setVariable("CMD_NODE", $a_par_node["node_id"]);
$ttpl->setVariable("FC", "1");
$ttpl->parseCurrentBlock();
}
$ttpl->setCurrentBlock("drop_area_menu");
$ttpl->setVariable("MNODE_ID", $a_par_node["node_id"]."fc");
$ttpl->parseCurrentBlock();
$ttpl->setCurrentBlock("element");
$ttpl->parseCurrentBlock();
}
}
// insert childs
if (count($childs) > 0)
{
for($i = 0; $i < count($childs); $i++)
{
$next_sibling = ($i < (count($childs) - 1))
? $next_sibling = $childs[$i+1]
: null;
$this->renderChild($ttpl, $childs[$i], $a_depth, $next_sibling);
$last_child = $child;
}
}
$html = $ttpl->get();
unset($ttpl);
return $html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getMaxDepth ( )

Get Maximum Depth.

Returns
int Maximum Depth

Definition at line 215 of file class.ilHierarchyFormGUI.php.

Referenced by getLevelHTML(), ilChapterHierarchyFormGUI\getMenuItems(), and ilChapterHierarchyFormGUI\manageDragAndDrop().

{
return $this->maxdepth;
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getMenuItems (   $a_node,
  $a_depth,
  $a_first_child = false,
  $a_next_sibling = null,
  $a_childs = null 
)

Get menu items for drop area of node.

This function will be most likely overwritten by sub class

Parameters
array$a_childnode array ("title", "node_id", "type")
boolean$a_first_childif false, the menu of the drop area right after the node (same level) is set if true, the menu of the drop area before the first child (if nodes are allowed) of the node is set

Reimplemented in ilChapterHierarchyFormGUI.

Definition at line 779 of file class.ilHierarchyFormGUI.php.

Referenced by getLevelHTML(), and renderChild().

{
return array();
}

+ Here is the caller graph for this function:

static ilHierarchyFormGUI::getPostFirstChild ( )
static

Should node be inserted as first child of target node (true) or as successor (false)

Definition at line 826 of file class.ilHierarchyFormGUI.php.

Referenced by ilStructureObjectGUI\insertChapter(), ilObjContentObjectGUI\insertChapter(), ilStructureObjectGUI\insertChapterClip(), ilObjContentObjectGUI\insertChapterClip(), ilStructureObjectGUI\insertPage(), and ilStructureObjectGUI\insertPageClip().

{
return (((int) $_POST["il_hform_fc"]) == 1);
}

+ Here is the caller graph for this function:

static ilHierarchyFormGUI::getPostMulti ( )
static

Get multi number of _POST input.

Definition at line 808 of file class.ilHierarchyFormGUI.php.

Referenced by ilStructureObjectGUI\insertChapter(), ilObjContentObjectGUI\insertChapter(), and ilStructureObjectGUI\insertPage().

{
return (int) ($_POST["il_hform_multi"] > 1
? $_POST["il_hform_multi"]
: 1);
}

+ Here is the caller graph for this function:

static ilHierarchyFormGUI::getPostNodeId ( )
static
ilHierarchyFormGUI::getTitle ( )

Get Title.

Returns
string Title

Definition at line 135 of file class.ilHierarchyFormGUI.php.

References $title.

Referenced by getContent().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::getTree ( )

Get Tree Object.

Returns
object Tree Object

Definition at line 95 of file class.ilHierarchyFormGUI.php.

Referenced by getChilds(), and getContent().

{
return $this->tree;
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::makeDragContent (   $a_id,
  $a_group 
)

Makes a node a drag content.

Parameters
string$a_idnode ID
string$a_groupdrag and drop group

Definition at line 280 of file class.ilHierarchyFormGUI.php.

Referenced by ilChapterHierarchyFormGUI\manageDragAndDrop().

{
if ($a_id != "")
{
$this->drag_content[] = array("id" => $a_id, "group" => $a_group);
}
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::makeDragTarget (   $a_id,
  $a_group,
  $a_first_child_drop_area = false,
  $a_as_subitem = false,
  $a_diss_text = "" 
)

Makes a nodes (following droparea) a drag target.

Parameters
string$a_idnode ID
string$a_groupdrag and drop group

Definition at line 255 of file class.ilHierarchyFormGUI.php.

Referenced by ilChapterHierarchyFormGUI\manageDragAndDrop().

{
if ($a_first_child_drop_area == true) // first child drop areas only insert as subitems
{
$a_as_subitem = true;
}
if ($a_id != "")
{
if ($a_first_child_drop_area)
{
$a_id.= "fc";
}
$this->drag_target[] = array("id" => $a_id, "group" => $a_group);
$this->diss_menues[$a_id][$a_group][] = array("subitem" => $a_as_subitem, "text" => $a_diss_text);
}
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::manageDragAndDrop (   $a_node,
  $a_depth,
  $a_first_child = false,
  $a_next_sibling = null,
  $a_childs = null 
)

Makes nodes drag and drop content and targets.

Must be overwritten to support drag and drop.

Parameters
object$a_nodenode array

Reimplemented in ilChapterHierarchyFormGUI.

Definition at line 799 of file class.ilHierarchyFormGUI.php.

Referenced by getLevelHTML(), and renderChild().

{
//$this->makeDragTarget($a_node["id"], $a_group);
//$this->makeDragTarget($a_node["id"], $a_group);
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::nodeAllowsChilds (   $a_node)

Checks, whether current nodes allows childs at all.

Should be overwritten.

Reimplemented in ilChapterHierarchyFormGUI.

Definition at line 788 of file class.ilHierarchyFormGUI.php.

Referenced by getLevelHTML().

{
return true;
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::renderChild (   $a_tpl,
  $a_child,
  $a_depth,
  $next_sibling = null 
)

Render a single child (including grandchilds)

Definition at line 610 of file class.ilHierarchyFormGUI.php.

References $command, getCheckboxName(), getChildCommands(), getChildIcon(), getChildIconAlt(), ilUtil\getImagePath(), getLevelHTML(), getMenuItems(), manageDragAndDrop(), and ilUtil\prepareFormOutput().

Referenced by getLevelHTML().

{
// image
$a_tpl->setCurrentBlock("img");
$a_tpl->setVariable("IMGPATH", $this->getChildIcon($a_child));
$a_tpl->setVariable("IMGALT", $this->getChildIconAlt($a_child));
$a_tpl->setVariable("IMG_NODE", $a_child["node_id"]);
$a_tpl->setVariable("TYPE", $a_child["type"]);
$a_tpl->parseCurrentBlock();
// checkbox
$a_tpl->setCurrentBlock("cbox");
$a_tpl->setVariable("CNODE_ID", $a_child["node_id"]);
$a_tpl->setVariable("CBOX_NAME", $this->getCheckboxName());
$a_tpl->parseCurrentBlock();
// commands of child node
$child_commands = $this->getChildCommands($a_child);
if (is_array($child_commands))
{
foreach($child_commands as $command)
{
$a_tpl->setCurrentBlock("node_cmd");
$a_tpl->setVariable("HREF_NODE_CMD", $command["link"]);
$a_tpl->setVariable("TXT_NODE_CMD", $command["text"]);
$a_tpl->parseCurrentBlock();
}
}
// title
$a_tpl->setCurrentBlock("text");
$a_tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_child["title"]));
$a_tpl->setVariable("TNODE_ID", $a_child["node_id"]);
$a_tpl->parseCurrentBlock();
$grandchilds = null;
$grandchilds_html = $this->getLevelHTML($a_child, $a_depth + 1, $grandchilds);
// childs
$a_tpl->setCurrentBlock("list_item");
$a_tpl->setVariable("CHILDS", $grandchilds_html);
$a_tpl->parseCurrentBlock();
$a_tpl->setCurrentBlock("element");
$a_tpl->parseCurrentBlock();
// drop area after child
$a_tpl->setCurrentBlock("drop_area");
$a_tpl->setVariable("DNODE_ID", $a_child["node_id"]);
$a_tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("spacer.gif"));
$a_tpl->parseCurrentBlock();
// manage drag and drop areas
$this->manageDragAndDrop($a_child, $a_depth, false, $next_sibling, $grandchilds);
// drop area menu
$menu_items = $this->getMenuItems($a_child, $a_depth, false, $next_sibling, $grandchilds);
if (count($menu_items) > 0)
{
// determine maximum of multi add numbers
$max = 1;
foreach($menu_items as $menu_item)
{
if ($menu_item["multi"] > $max)
{
$max = $menu_item["multi"];
}
}
reset($menu_items);
foreach($menu_items as $menu_item)
{
if ($menu_item["multi"] > 1 )
{
for($i = 2; $i <= $menu_item["multi"]; $i++)
{
$a_tpl->setCurrentBlock("multi_add");
$a_tpl->setVariable("MA_NUM", $i);
$a_tpl->setVariable("MENU_CMD", $menu_item["cmd"]);
if ($menu_item["as_subitem"])
{
$a_tpl->setVariable("FC", "1");
}
else
{
$a_tpl->setVariable("FC", "0");
}
$a_tpl->setVariable("CMD_NODE", $a_child["node_id"]);
$a_tpl->parseCurrentBlock();
}
}
// buffer td for lower multis
if ($max > $menu_item["multi"])
{
$a_tpl->setCurrentBlock("multi_buffer");
$a_tpl->setVariable("BUF_SPAN", $max - $menu_item["multi"]);
$a_tpl->parseCurrentBlock();
}
$a_tpl->setCurrentBlock("menu_cmd");
$a_tpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
$a_tpl->setVariable("MENU_CMD", $menu_item["cmd"]);
if ($menu_item["as_subitem"])
{
$a_tpl->setVariable("FC", "1");
}
else
{
$a_tpl->setVariable("FC", "0");
}
$a_tpl->setVariable("CMD_NODE", $a_child["node_id"]);
$a_tpl->parseCurrentBlock();
}
$a_tpl->setCurrentBlock("drop_area_menu");
$a_tpl->setVariable("MNODE_ID", $a_child["node_id"]);
$a_tpl->parseCurrentBlock();
}
$a_tpl->setCurrentBlock("element");
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilHierarchyFormGUI::setCheckboxName (   $a_checkboxname)

Set Checkbox Name.

Parameters
string$a_checkboxnameCheckbox Name

Definition at line 165 of file class.ilHierarchyFormGUI.php.

Referenced by ilChapterHierarchyFormGUI\__construct(), and __construct().

{
$this->checkboxname = $a_checkboxname;
}

+ Here is the caller graph for this function:

ilHierarchyFormGUI::setCurrentTopNodeId (   $a_currenttopnodeid)

Set Current Top Node ID.

Parameters
string$a_currenttopnodeidCurrent Top Node ID

Definition at line 105 of file class.ilHierarchyFormGUI.php.

{
$this->currenttopnodeid = $a_currenttopnodeid;
}
ilHierarchyFormGUI::setDragIcon (   $a_dragicon)

Set Drag Icon Path.

Parameters
string$a_dragiconDrag Icon Path

Definition at line 185 of file class.ilHierarchyFormGUI.php.

{
$this->dragicon = $a_dragicon;
}
ilHierarchyFormGUI::setExplorerUpdater (   $a_exp_frame,
  $a_exp_id,
  $a_exp_target_script 
)

Set Explorer Updater.

Parameters
object$a_treeTree Object

Definition at line 225 of file class.ilHierarchyFormGUI.php.

{
$this->exp_frame = $a_exp_frame;
$this->exp_id = $a_exp_id;
$this->exp_target_script = $a_exp_target_script;
}
ilHierarchyFormGUI::setIcon (   $a_icon)

Set Icon.

Parameters
string$a_iconIcon

Definition at line 145 of file class.ilHierarchyFormGUI.php.

{
$this->icon = $a_icon;
}
ilHierarchyFormGUI::setId (   $a_id)

Set Id.

Currently not possible, due to js handling (ID must always be "hform")

Parameters
string$a_idId

Reimplemented from ilFormGUI.

Definition at line 65 of file class.ilHierarchyFormGUI.php.

{
die("ilHierarchyFormGUI does currently not support multiple forms (multiple IDs). ID is always hform.");
}
ilHierarchyFormGUI::setMaxDepth (   $a_maxdepth)

Set Maximum Depth.

Parameters
int$a_maxdepthMaximum Depth

Definition at line 205 of file class.ilHierarchyFormGUI.php.

{
$this->maxdepth = $a_maxdepth;
}
ilHierarchyFormGUI::setTitle (   $a_title)

Set Title.

Parameters
string$a_titleTitle

Definition at line 125 of file class.ilHierarchyFormGUI.php.

{
$this->title = $a_title;
}
ilHierarchyFormGUI::setTree (   $a_tree)

Set Tree Object.

Parameters
object$a_treeTree Object

Definition at line 85 of file class.ilHierarchyFormGUI.php.

{
$this->tree = $a_tree;
}

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