ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilHierarchyFormGUI Class Reference

This class represents a hierarchical form. More...

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

Public Member Functions

 __construct ()
 Constructor. More...
 
 setParentCommand ($a_parent_obj, $a_parent_cmd)
 Set parent gui object/cmd. More...
 
 getParentObject ()
 Get Parent object. More...
 
 getParentCommand ()
 Get parent command. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setTree ($a_tree)
 Set Tree Object. More...
 
 getTree ()
 Get Tree Object. More...
 
 setCurrentTopNodeId ($a_currenttopnodeid)
 Set Current Top Node ID. More...
 
 getCurrentTopNodeId ()
 Get Current Top Node ID. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setIcon ($a_icon)
 Set Icon. More...
 
 getIcon ()
 Get Icon. More...
 
 setCheckboxName ($a_checkboxname)
 Set Checkbox Name. More...
 
 getCheckboxName ()
 Get Checkbox Name. More...
 
 setDragIcon ($a_dragicon)
 Set Drag Icon Path. More...
 
 getDragIcon ()
 Get Drag Icon Path. More...
 
 setMaxDepth ($a_maxdepth)
 Set Maximum Depth. More...
 
 getMaxDepth ()
 Get Maximum Depth. More...
 
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater. More...
 
 setTriggeredUpdateCommand ($a_triggered_update_command)
 Set Explorer Updater. More...
 
 addHelpItem ($a_text, $a_image="")
 Get all help items. More...
 
 getHelpItems ()
 Get all help items. More...
 
 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. More...
 
 makeDragContent ($a_id, $a_group)
 Makes a node a drag content. More...
 
 addMultiCommand ($a_txt, $a_cmd)
 Add a multi command (for selection of items) More...
 
 addCommand ($a_txt, $a_cmd)
 Add a command. More...
 
 setHighlightedNodes ($a_val)
 Set highlighted nodes. More...
 
 getHighlightedNodes ()
 Get highlighted nodes. More...
 
 setFocusId ($a_val)
 Set focus if. More...
 
 getFocusId ()
 Get focus id. More...
 
 setExpandVariable ($a_val)
 Set expand variable. More...
 
 getExpandVariable ()
 Get expand variable. More...
 
 setExpanded ($a_val)
 Set expanded Array. More...
 
 getExpanded ()
 Get expanded array. More...
 
 updateExpanded ()
 Update expand information in session. More...
 
 setTypeWhiteList ($a_val)
 Set type whitelist. More...
 
 getTypeWhiteList ()
 Get type whitelist. More...
 
 getChilds ($a_node_id=false)
 Get all childs of current node. More...
 
 getContent ()
 Get Form Content. More...
 
 getLegend ()
 Get Legend. More...
 
 getLevelHTML ($a_par_node, $a_depth, &$a_childs)
 Get Form HTML. More...
 
 renderChild ($a_tpl, $a_child, $a_depth, $next_sibling=null)
 Render a single child (including grandchilds) More...
 
 getChildIcon ($a_item)
 Get icon path for an item. More...
 
 getChildIconAlt ($a_item)
 Get icon alt text for an item. More...
 
 getChildCommands ($a_item)
 Get item commands. More...
 
 getChildTitle ($a_child)
 Get child title. More...
 
 getChildInfo ($a_child)
 Get child info. More...
 
 getMenuItems ($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
 Get menu items for drop area of node. More...
 
 nodeAllowsChilds ($a_node)
 Checks, whether current nodes allows childs at all. More...
 
 manageDragAndDrop ($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
 Makes nodes drag and drop content and targets. More...
 
 getHTML ()
 Get HTML. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction ($a_formaction)
 Set FormAction. More...
 
 getFormAction ()
 Get FormAction. More...
 
 setTarget ($a_target)
 Set Target. More...
 
 getTarget ()
 Get Target. More...
 
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false. More...
 
 getMultipart ()
 Get Enctype Multipart/Formdata true/false. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setName ($a_name)
 Set Name. More...
 
 getName ()
 Get Name. More...
 
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open. More...
 
 getKeepOpen ()
 Get Keep Form Tag Open. More...
 
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag. More...
 
 getOpenTag ()
 Get Open Form Tag Enabled. More...
 
 setCloseTag ($a_val)
 Set close tag. More...
 
 getCloseTag ()
 Get close tag. More...
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 getHTML ()
 Get HTML. More...
 
 getContent ()
 Get Content. More...
 

Static Public Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 
 $prevent_double_submission = 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 14 of file class.ilHierarchyFormGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilHierarchyFormGUI::__construct ( )

Constructor.

Parameters

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

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

22  {
23  global $lng, $tpl;
24 
25  $this->maxdepth = -1;
26  $this->multi_commands = array();
27  $this->commands = array();
28  $this->drag_target[] = array();
29  $this->drag_content[] = array();
30  $lng->loadLanguageModule("form");
31  $this->setCheckboxName("cbox");
32  $this->help_items = array();
33 
34  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
36  $tpl->addJavascript("./Services/Form/js/ServiceFormHierarchyForm.js");
37  }
setCheckboxName($a_checkboxname)
Set Checkbox Name.
global $tpl
Definition: ilias.php:8
Create styles array
The data for the language used.
static initDragDrop()
Init YUI Drag and Drop.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

Member Function Documentation

◆ addCommand()

ilHierarchyFormGUI::addCommand (   $a_txt,
  $a_cmd 
)

Add a command.

Parameters
string$a_txtcommand text
string$a_cmdcommand

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

References array.

326  {
327  $this->commands[] = array("text" => $a_txt, "cmd" => $a_cmd);
328  }
Create styles array
The data for the language used.

◆ addHelpItem()

ilHierarchyFormGUI::addHelpItem (   $a_text,
  $a_image = "" 
)

Get all help items.

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

References array.

256  {
257  $this->help_items[] = array("text" => $a_text,
258  "image" => $a_image);
259  }
Create styles array
The data for the language used.

◆ addMultiCommand()

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 314 of file class.ilHierarchyFormGUI.php.

References array.

315  {
316  $this->multi_commands[] = array("text" => $a_txt, "cmd" => $a_cmd);
317  }
Create styles array
The data for the language used.

◆ getCheckboxName()

ilHierarchyFormGUI::getCheckboxName ( )

Get Checkbox Name.

Returns
string Checkbox Name

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

Referenced by renderChild().

186  {
187  return $this->checkboxname;
188  }
+ Here is the caller graph for this function:

◆ getChildCommands()

ilHierarchyFormGUI::getChildCommands (   $a_item)

Get item commands.

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

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

Referenced by renderChild().

1071  {
1072  return false;
1073  }
+ Here is the caller graph for this function:

◆ getChildIcon()

ilHierarchyFormGUI::getChildIcon (   $a_item)

Get icon path for an item.

Parameters
arrayitem array
Returns
string icon path

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

References ilUtil\getImagePath().

Referenced by renderChild().

1047  {
1048  return ilUtil::getImagePath("icon_".$a_item["type"].".svg");
1049  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChildIconAlt()

ilHierarchyFormGUI::getChildIconAlt (   $a_item)

Get icon alt text for an item.

Parameters
arrayitem array
Returns
string icon alt text

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

References $lng.

Referenced by renderChild().

1058  {
1059  global $lng;
1060 
1061  return $lng->txt($a_item["type"]);
1062  }
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ getChildInfo()

ilHierarchyFormGUI::getChildInfo (   $a_child)

Get child info.

Parameters
array$a_childnode array
Returns
string node title

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

Referenced by renderChild().

1093  {
1094  return "";
1095  }
+ Here is the caller graph for this function:

◆ getChilds()

ilHierarchyFormGUI::getChilds (   $a_node_id = false)

Get all childs of current node.

Standard implementation uses tree object.

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

References array, getCurrentTopNodeId(), and getTree().

Referenced by getLevelHTML().

478  {
479  if ($a_node_id == false)
480  {
481  $a_node_id = $this->getCurrentTopNodeId();
482  }
483 
484  $tree_childs = $this->getTree()->getChilds($a_node_id);
485  $childs = array();
486  foreach($tree_childs as $tree_child)
487  {
488 
489  if (!is_array($this->white_list) || in_array($tree_child["type"], $this->white_list))
490  {
491  $childs[] = array("node_id" => $tree_child["child"],
492  "title" => $tree_child["title"],
493  "type" => $tree_child["type"],
494  "depth" => $tree_child["depth"]
495  );
496  }
497  }
498 
499  return $childs;
500  }
Create styles array
The data for the language used.
getCurrentTopNodeId()
Get Current Top Node ID.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChildTitle()

ilHierarchyFormGUI::getChildTitle (   $a_child)

Get child title.

Parameters
array$a_childnode array
Returns
string node title

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

Referenced by renderChild().

1082  {
1083  return $a_child["title"];
1084  }
+ Here is the caller graph for this function:

◆ getContent()

ilHierarchyFormGUI::getContent ( )

Get Form Content.

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

References $a_type, $cmd, $lng, array, getCurrentTopNodeId(), getExpandVariable(), ilUtil\getImagePath(), getLevelHTML(), getTitle(), getTree(), and updateExpanded().

506  {
507  global $lng;
508 
509  if ($this->getExpandVariable() != "")
510  {
511  $this->updateExpanded();
512  }
513 
514  $ttpl = new ilTemplate("tpl.hierarchy_form.html", true, true, "Services/Form");
515  $ttpl->setVariable("TXT_SAVING", $lng->txt("saving"));
516  $top_node_data = $this->getTree()->getNodeData($this->getCurrentTopNodeId());
517  $top_node = array("node_id" => $top_node_data["child"],
518  "title" => $top_node_data["title"],
519  "type" => $top_node_data["type"]);
520 
521  $childs = null;
522  $nodes_html = $this->getLevelHTML($top_node, 0, $childs);
523 
524 
525  // commands
526  $secs = array("1", "2");
527  foreach ($secs as $sec)
528  {
529  reset($this->commands);
530  reset($this->multi_commands);
531  if (count($this->multi_commands) > 0 || count($this->commands) > 0)
532  {
533  if (count($childs) > 0)
534  {
535  $single = false;
536  foreach($this->commands as $cmd)
537  {
538  $ttpl->setCurrentBlock("cmd".$sec);
539  $ttpl->setVariable("CMD", $cmd["cmd"]);
540  $ttpl->setVariable("CMD_TXT", $cmd["text"]);
541  $ttpl->parseCurrentBlock();
542  $single = true;
543  }
544 
545  $multi = false;
546  foreach($this->multi_commands as $cmd)
547  {
548  $ttpl->setCurrentBlock("multi_cmd".$sec);
549  $ttpl->setVariable("MULTI_CMD", $cmd["cmd"]);
550  $ttpl->setVariable("MULTI_CMD_TXT", $cmd["text"]);
551  $ttpl->parseCurrentBlock();
552  $multi = true;
553  }
554  if ($multi)
555  {
556  $ttpl->setCurrentBlock("multi_cmds".$sec);
557  $ttpl->setVariable("MCMD_ALT", $lng->txt("commands"));
558  if ($sec == "1")
559  {
560  $ttpl->setVariable("MCMD_IMG", ilUtil::getImagePath("arrow_downright.svg"));
561  }
562  else
563  {
564  $ttpl->setVariable("MCMD_IMG", ilUtil::getImagePath("arrow_upright.svg"));
565  }
566  $ttpl->parseCurrentBlock();
567  }
568  }
569 
570  if ($single || $multi)
571  {
572  $ttpl->setCurrentBlock("commands".$sec);
573  $ttpl->parseCurrentBlock();
574  }
575  $single = true;
576  }
577  }
578 
579  // explorer updater
580  if ($this->exp_frame != "")
581  {
582  $ttpl->setCurrentBlock("updater");
583  $ttpl->setVariable("UPDATER_FRAME", $this->exp_frame);
584  $ttpl->setVariable("EXP_ID_UPDATER", $this->exp_id);
585  $ttpl->setVariable("HREF_UPDATER", $this->exp_target_script);
586  $ttpl->parseCurrentBlock();
587  }
588 
589  // drag and drop initialisation
590  foreach($this->drag_target as $drag_target)
591  {
592  $ttpl->setCurrentBlock("dragtarget");
593  $ttpl->setVariable("EL_ID", $drag_target["id"]);
594  $ttpl->setVariable("GROUP", $drag_target["group"]);
595  $ttpl->parseCurrentBlock();
596  }
597  foreach($this->drag_content as $drag_content)
598  {
599  $ttpl->setCurrentBlock("dragcontent");
600  $ttpl->setVariable("EL_ID", $drag_content["id"]);
601  $ttpl->setVariable("GROUP", $drag_content["group"]);
602  $ttpl->parseCurrentBlock();
603  }
604 
605  // disambiguation menues and "insert as first child" flags
606  if (is_array($this->diss_menues))
607  {
608  foreach($this->diss_menues as $node_id => $d_menu)
609  {
610  foreach($d_menu as $group => $menu)
611  {
612  if (count($menu) > 1)
613  {
614  foreach($menu as $menu_item)
615  {
616  $ttpl->setCurrentBlock("dmenu_cmd");
617  $ttpl->setVariable("SUBITEM", (int) $menu_item["subitem"]);
618  $ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
619  $ttpl->parseCurrentBlock();
620  }
621 
622  $ttpl->setCurrentBlock("disambiguation_menu");
623  $ttpl->setVariable("DNODE_ID", $node_id);
624  $ttpl->setVariable("GRP", $group);
625  $ttpl->parseCurrentBlock();
626  }
627  else if (count($menu) == 1)
628  {
629  // set first child flag
630  $ttpl->setCurrentBlock("as_subitem_flag");
631  $ttpl->setVariable("SI_NODE_ID", $node_id);
632  $ttpl->setVariable("SI_GRP", $group);
633  $ttpl->setVariable("SI_SI", (int) $menu[0]["subitem"]);
634  $ttpl->parseCurrentBlock();
635 
636  }
637  }
638  }
639  }
640  $this->diss_menues[$a_id][$a_group][] = array("type" => $a_type, "text" => $a_diss_text);
641 
642 
643  if ($this->triggered_update_command != "")
644  {
645  $ttpl->setCurrentBlock("tr_update");
646  $ttpl->setVariable("UPDATE_CMD", $this->triggered_update_command);
647  $ttpl->parseCurrentBlock();
648  }
649 
650  // disambiguation menues and "insert as first child" flags
651  if (is_array($this->diss_menues))
652  {
653  foreach($this->diss_menues as $node_id => $d_menu)
654  {
655  foreach($d_menu as $group => $menu)
656  {
657  if (count($menu) > 1)
658  {
659  foreach($menu as $menu_item)
660  {
661  $ttpl->setCurrentBlock("dmenu_cmd");
662  $ttpl->setVariable("SUBITEM", (int) $menu_item["subitem"]);
663  $ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
664  $ttpl->parseCurrentBlock();
665  }
666 
667  $ttpl->setCurrentBlock("disambiguation_menu");
668  $ttpl->setVariable("DNODE_ID", $node_id);
669  $ttpl->setVariable("GRP", $group);
670  $ttpl->parseCurrentBlock();
671  }
672  else if (count($menu) == 1)
673  {
674  // set first child flag
675  $ttpl->setCurrentBlock("as_subitem_flag");
676  $ttpl->setVariable("SI_NODE_ID", $node_id);
677  $ttpl->setVariable("SI_GRP", $group);
678  $ttpl->setVariable("SI_SI", (int) $menu[0]["subitem"]);
679  $ttpl->parseCurrentBlock();
680 
681  }
682  }
683  }
684  }
685  $this->diss_menues[$a_id][$a_group][] = array("type" => $a_type, "text" => $a_diss_text);
686 
687  // nodes
688  $ttpl->setVariable("NODES", $nodes_html);
689 
690  // title
691 //echo "<br>".htmlentities($this->getTitle())." --- ".htmlentities(ilUtil::prepareFormOutput($this->getTitle()));
692  $ttpl->setVariable("TITLE", $this->getTitle());
693 
694 
695  return $ttpl->get();
696  }
$cmd
Definition: sahs_server.php:35
$a_type
Definition: workflow.php:93
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
getCurrentTopNodeId()
Get Current Top Node ID.
updateExpanded()
Update expand information in session.
getExpandVariable()
Get expand variable.
global $lng
Definition: privfeed.php:17
getLevelHTML($a_par_node, $a_depth, &$a_childs)
Get Form HTML.
+ Here is the call graph for this function:

◆ getCurrentTopNodeId()

ilHierarchyFormGUI::getCurrentTopNodeId ( )

Get Current Top Node ID.

Returns
string Current Top Node ID

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

Referenced by getChilds(), and getContent().

126  {
127  return $this->currenttopnodeid;
128  }
+ Here is the caller graph for this function:

◆ getDragIcon()

ilHierarchyFormGUI::getDragIcon ( )

Get Drag Icon Path.

Returns
string Drag Icon Path

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

Referenced by getLegend().

206  {
207  return $this->dragicon;
208  }
+ Here is the caller graph for this function:

◆ getExpanded()

ilHierarchyFormGUI::getExpanded ( )

Get expanded array.

Returns
array expanded array

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

Referenced by renderChild().

406  {
407  return $this->expanded;
408  }
+ Here is the caller graph for this function:

◆ getExpandVariable()

ilHierarchyFormGUI::getExpandVariable ( )

Get expand variable.

Returns

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

Referenced by getContent(), renderChild(), and updateExpanded().

386  {
387  return $this->expand_variable;
388  }
+ Here is the caller graph for this function:

◆ getFocusId()

ilHierarchyFormGUI::getFocusId ( )

Get focus id.

Returns
int node id

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

Referenced by renderChild().

366  {
367  return $this->focus_id;
368  }
+ Here is the caller graph for this function:

◆ getHelpItems()

ilHierarchyFormGUI::getHelpItems ( )

Get all help items.

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

Referenced by getLegend().

265  {
266  return $this->help_items;
267  }
+ Here is the caller graph for this function:

◆ getHighlightedNodes()

ilHierarchyFormGUI::getHighlightedNodes ( )

Get highlighted nodes.

Returns
array highlighted nodes

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

Referenced by renderChild().

346  {
347  return $this->highlighted_nodes;
348  }
+ Here is the caller graph for this function:

◆ getHTML()

ilHierarchyFormGUI::getHTML ( )

Get HTML.

Parameters

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

1168  {
1169  return parent::getHTML().$this->getLegend();
1170  }

◆ getIcon()

ilHierarchyFormGUI::getIcon ( )

Get Icon.

Returns
string Icon

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

166  {
167  return $this->icon;
168  }

◆ getId()

ilHierarchyFormGUI::getId ( )

Get Id.

Returns
string Id

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

86  {
87  return "hform";
88  }

◆ getLegend()

ilHierarchyFormGUI::getLegend ( )

Get Legend.

Returns
string legend html

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

References $lng, ilGlyphGUI\ADD, ilGlyphGUI\DRAG, ilGlyphGUI\get(), getDragIcon(), and getHelpItems().

704  {
705  global $lng;
706 
707  include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
708 
709  $ttpl = new ilTemplate("tpl.hierarchy_form_legend.html", true, true, "Services/Form");
710  if ($this->getDragIcon() != "")
711  {
712  $ttpl->setCurrentBlock("help_drag");
713  $ttpl->setVariable("IMG_DRAG", $this->getDragIcon());
714  $ttpl->setVariable("DRAG_ARROW",
716  $ttpl->setVariable("TXT_DRAG",
717  $lng->txt("form_hierarchy_drag_drop_help"));
718  $ttpl->setVariable("PLUS", ilGlyphGUI::get(ilGlyphGUI::ADD));
719  $ttpl->parseCurrentBlock();
720  }
721 
722  // additional help items
723  foreach ($this->getHelpItems() as $help)
724  {
725  if ($help["image"] != "")
726  {
727  $ttpl->setCurrentBlock("help_img");
728  $ttpl->setVariable("IMG_HELP", $help["image"]);
729  $ttpl->parseCurrentBlock();
730  }
731  $ttpl->setCurrentBlock("help_item");
732  $ttpl->setVariable("TXT_HELP", $help["text"]);
733  $ttpl->parseCurrentBlock();
734  }
735 
736  $ttpl->setVariable("TXT_ADD_EL",
737  $lng->txt("form_hierarchy_add_elements"));
738  $ttpl->setVariable("PLUS2", ilGlyphGUI::get(ilGlyphGUI::ADD));
739 
740  return $ttpl->get();
741  }
static get($a_glyph, $a_text="")
Get glyph html.
getHelpItems()
Get all help items.
getDragIcon()
Get Drag Icon Path.
special template class to simplify handling of ITX/PEAR
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ getLevelHTML()

ilHierarchyFormGUI::getLevelHTML (   $a_par_node,
  $a_depth,
$a_childs 
)

Get Form HTML.

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

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

Referenced by getContent(), and renderChild().

748  {
749  global $lng;
750 
751  if ($this->getMaxDepth() > -1 && $this->getMaxDepth() < $a_depth)
752  {
753  return "";
754  }
755 
756  $childs = $this->getChilds($a_par_node["node_id"]);
757  $a_childs = $childs;
758  $html = "";
759  $last_child = null;
760  $ttpl = new ilTemplate("tpl.hierarchy_form_nodes.html", true, true, "Services/Form");
761 
762  // prepended drop area
763  if ($this->nodeAllowsChilds($a_par_node) && (count($childs) > 0 || $a_depth == 0))
764  {
765  $ttpl->setCurrentBlock("drop_area");
766  $ttpl->setVariable("DNODE_ID", $a_par_node["node_id"]."fc"); // fc means "first child"
767  $ttpl->setVariable("IMG_BLANK", ilUtil::getImagePath("spacer.png"));
768  if (count($childs) == 0)
769  {
770  $ttpl->setVariable("NO_CONTENT_CLASS", "ilCOPGNoPageContent");
771  $ttpl->setVariable("NO_CONTENT_TXT", " &nbsp;".$lng->txt("form_hier_click_to_add"));
772  }
773  $ttpl->parseCurrentBlock();
774 
775  $this->manageDragAndDrop($a_par_node, $a_depth, true, null, $childs);
776  $menu_items = $this->getMenuItems($a_par_node, $a_depth, true, null, $childs);
777 //var_dump($menu_items);
778  if (count($menu_items) > 0)
779  {
780  // determine maximum of multi add numbers
781  $max = 1;
782  foreach($menu_items as $menu_item)
783  {
784  if ($menu_item["multi"] > $max)
785  {
786  $max = $menu_item["multi"];
787  }
788  }
789 
790  reset($menu_items);
791  $mcnt = 1;
792  foreach($menu_items as $menu_item)
793  {
794  if ($menu_item["multi"] > 1)
795  {
796  for($i = 1; $i <= $menu_item["multi"]; $i++)
797  {
798  $ttpl->setCurrentBlock("multi_add");
799  $ttpl->setVariable("MA_NUM", $i);
800  $ttpl->setVariable("MENU_CMD", $menu_item["cmd"]);
801  $ttpl->setVariable("FC", "1");
802  $ttpl->setVariable("CMD_NODE", $a_par_node["node_id"]);
803  $ttpl->setVariable("MCNT", $mcnt."fc");
804  $ttpl->parseCurrentBlock();
805  }
806  }
807 
808  // buffer td for lower multis
809  if ($max > $menu_item["multi"])
810  {
811  $ttpl->setCurrentBlock("multi_buffer");
812  $ttpl->setVariable("BUF_SPAN", $max - $menu_item["multi"]);
813  $ttpl->parseCurrentBlock();
814  }
815  $ttpl->setCurrentBlock("menu_cmd");
816  $ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
817  $ttpl->setVariable("MENU_CMD", $menu_item["cmd"]);
818  $ttpl->setVariable("CMD_NODE", $a_par_node["node_id"]);
819  $ttpl->setVariable("FC", "1");
820  $ttpl->setVariable("MCNT", $mcnt."fc");
821  $ttpl->parseCurrentBlock();
822  $mcnt++;
823  }
824  $ttpl->setCurrentBlock("drop_area_menu");
825  $ttpl->setVariable("MNODE_ID", $a_par_node["node_id"]."fc");
826  $ttpl->parseCurrentBlock();
827 
828  $ttpl->setCurrentBlock("element");
829  $ttpl->parseCurrentBlock();
830  }
831  }
832 
833  // insert childs
834  if (count($childs) > 0)
835  {
836  for($i = 0; $i < count($childs); $i++)
837  {
838  $next_sibling = ($i < (count($childs) - 1))
839  ? $next_sibling = $childs[$i+1]
840  : null;
841 
842  $this->renderChild($ttpl, $childs[$i], $a_depth, $next_sibling);
843  $last_child = $child;
844  }
845  }
846 
847  $html = $ttpl->get();
848  unset($ttpl);
849 
850  return $html;
851  }
getChilds($a_node_id=false)
Get all childs of current node.
manageDragAndDrop($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
Makes nodes drag and drop content and targets.
getMaxDepth()
Get Maximum Depth.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
getMenuItems($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
Get menu items for drop area of node.
renderChild($a_tpl, $a_child, $a_depth, $next_sibling=null)
Render a single child (including grandchilds)
global $lng
Definition: privfeed.php:17
$html
Definition: example_001.php:87
nodeAllowsChilds($a_node)
Checks, whether current nodes allows childs at all.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMaxDepth()

ilHierarchyFormGUI::getMaxDepth ( )

Get Maximum Depth.

Returns
int Maximum Depth

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

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

226  {
227  return $this->maxdepth;
228  }
+ Here is the caller graph for this function:

◆ getMenuItems()

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

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

References array.

Referenced by getLevelHTML(), and renderChild().

1110  {
1111  return array();
1112  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getParentCommand()

ilHierarchyFormGUI::getParentCommand ( )

Get parent command.

Returns
string parent command

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

Referenced by renderChild().

66  {
67  return $this->parent_cmd;
68  }
+ Here is the caller graph for this function:

◆ getParentObject()

ilHierarchyFormGUI::getParentObject ( )

Get Parent object.

Returns
object parent gui object

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

Referenced by renderChild().

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

◆ getPostFields()

static ilHierarchyFormGUI::getPostFields ( )
static

Get all post fields.

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

References $_POST, and array.

Referenced by ilObjSCORM2004LearningModuleGUI\insertLMChapterClip().

1176  {
1177  return array (
1178  "il_hform_node" => $_POST["il_hform_node"],
1179  "il_hform_fc" => $_POST["il_hform_fc"],
1180  "il_hform_as_subitem" => $_POST["il_hform_as_subitem"],
1181  "il_hform_multi" => $_POST["il_hform_multi"],
1182  "il_hform_source_id" => $_POST["il_hform_source_id"],
1183  "il_hform_target_id" => $_POST["il_hform_target_id"]
1184  );
1185  }
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the caller graph for this function:

◆ getPostFirstChild()

◆ getPostMulti()

static ilHierarchyFormGUI::getPostMulti ( )
static

Get multi number of _POST input.

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

References $_POST.

Referenced by ilObjSCORM2004LearningModuleGUI\insertAsset(), ilStructureObjectGUI\insertChapter(), ilObjSCORM2004LearningModuleGUI\insertChapter(), ilObjContentObjectGUI\insertChapter(), ilStructureObjectGUI\insertPage(), ilObjSCORM2004LearningModuleGUI\insertPage(), ilObjSCORM2004LearningModuleGUI\insertSco(), and ilObjSCORM2004LearningModuleGUI\insertTemplateGUI().

1139  {
1140  return (int) ($_POST["il_hform_multi"] > 1
1141  ? $_POST["il_hform_multi"]
1142  : 1);
1143  }
$_POST["username"]
+ Here is the caller graph for this function:

◆ getPostNodeId()

◆ getTitle()

ilHierarchyFormGUI::getTitle ( )

Get Title.

Returns
string Title

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

References $title.

Referenced by getContent().

146  {
147  return $this->title;
148  }
+ Here is the caller graph for this function:

◆ getTree()

ilHierarchyFormGUI::getTree ( )

Get Tree Object.

Returns
object Tree Object

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

Referenced by getChilds(), getContent(), and updateExpanded().

106  {
107  return $this->tree;
108  }
+ Here is the caller graph for this function:

◆ getTypeWhiteList()

ilHierarchyFormGUI::getTypeWhiteList ( )

Get type whitelist.

Returns
array white list of types

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

469  {
470  return $this->white_list;
471  }

◆ makeDragContent()

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 300 of file class.ilHierarchyFormGUI.php.

References array.

Referenced by ilChapterHierarchyFormGUI\manageDragAndDrop(), and ilSCORM2004OrganizationHFormGUI\manageDragAndDrop().

301  {
302  if ($a_id != "")
303  {
304  $this->drag_content[] = array("id" => $a_id, "group" => $a_group);
305  }
306  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ makeDragTarget()

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 275 of file class.ilHierarchyFormGUI.php.

References array.

Referenced by ilChapterHierarchyFormGUI\manageDragAndDrop(), and ilSCORM2004OrganizationHFormGUI\manageDragAndDrop().

276  {
277  if ($a_first_child_drop_area == true) // first child drop areas only insert as subitems
278  {
279  $a_as_subitem = true;
280  }
281 
282  if ($a_id != "")
283  {
284  if ($a_first_child_drop_area)
285  {
286  $a_id.= "fc";
287  }
288 
289  $this->drag_target[] = array("id" => $a_id, "group" => $a_group);
290  $this->diss_menues[$a_id][$a_group][] = array("subitem" => $a_as_subitem, "text" => $a_diss_text);
291  }
292  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ manageDragAndDrop()

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

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

Referenced by getLevelHTML(), and renderChild().

1130  {
1131  //$this->makeDragTarget($a_node["id"], $a_group);
1132  //$this->makeDragTarget($a_node["id"], $a_group);
1133  }
+ Here is the caller graph for this function:

◆ nodeAllowsChilds()

ilHierarchyFormGUI::nodeAllowsChilds (   $a_node)

Checks, whether current nodes allows childs at all.

Should be overwritten.

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

Referenced by getLevelHTML().

1119  {
1120  return true;
1121  }
+ Here is the caller graph for this function:

◆ renderChild()

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

Render a single child (including grandchilds)

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

References $ilCtrl, $info, getCheckboxName(), getChildCommands(), getChildIcon(), getChildIconAlt(), getChildInfo(), getChildTitle(), getExpanded(), getExpandVariable(), getFocusId(), getHighlightedNodes(), ilUtil\getImagePath(), getLevelHTML(), getMenuItems(), getParentCommand(), getParentObject(), manageDragAndDrop(), and ilUtil\prepareFormOutput().

Referenced by getLevelHTML().

857  {
858  global $ilCtrl;
859 
860  // image
861  $a_tpl->setCurrentBlock("img");
862  $a_tpl->setVariable("IMGPATH", $this->getChildIcon($a_child));
863  $a_tpl->setVariable("IMGALT", $this->getChildIconAlt($a_child));
864  $a_tpl->setVariable("IMG_NODE", $a_child["node_id"]);
865  $a_tpl->setVariable("NODE_ID", $a_child["node_id"]);
866  $a_tpl->setVariable("TYPE", $a_child["type"]);
867  $a_tpl->parseCurrentBlock();
868 
869  // checkbox
870  $a_tpl->setCurrentBlock("cbox");
871  $a_tpl->setVariable("CNODE_ID", $a_child["node_id"]);
872  $a_tpl->setVariable("CBOX_NAME", $this->getCheckboxName());
873  $a_tpl->parseCurrentBlock();
874 
875  // node info
876  if (($info = $this->getChildInfo($a_child)) != "")
877  {
878  $a_tpl->setCurrentBlock("node_info");
879  $a_tpl->setVariable("NODE_INFO", $info);
880  $a_tpl->parseCurrentBlock();
881  }
882 
883  // commands of child node
884  $child_commands = $this->getChildCommands($a_child);
885  if (is_array($child_commands))
886  {
887  foreach($child_commands as $command)
888  {
889  $a_tpl->setCurrentBlock("node_cmd");
890  $a_tpl->setVariable("HREF_NODE_CMD", $command["link"]);
891  $a_tpl->setVariable("TXT_NODE_CMD", $command["text"]);
892  $a_tpl->parseCurrentBlock();
893  }
894  }
895 
896  // title
897  $a_tpl->setCurrentBlock("text");
898  $hl = $this->getHighlightedNodes();
899  if (is_array($hl) && in_array($a_child["node_id"], $hl))
900  {
901  $a_tpl->setVariable("CLASS", ' class="ilHFormHighlighted" ');
902  }
903  $a_tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($this->getChildTitle($a_child)));
904  $a_tpl->setVariable("TNODE_ID", $a_child["node_id"]);
905  $a_tpl->parseCurrentBlock();
906  $grandchilds = null;
907  $grandchilds_html = $this->getLevelHTML($a_child, $a_depth + 1, $grandchilds);
908 
909  // focus
910  if ($this->getFocusId() == $a_child["node_id"])
911  {
912  $a_tpl->setCurrentBlock("focus");
913  $a_tpl->setVariable("FNODE_ID", $a_child["node_id"]);
914  $a_tpl->parseCurrentBlock();
915  }
916 
917  // expander
918  if ($this->getExpandVariable() != "")
919  {
920  $a_tpl->setCurrentBlock("expand_icon");
921  if (!is_null($grandchilds) && count($grandchilds) > 0)
922  {
923  if (!in_array($a_child["node_id"],$this->getExpanded()))
924  {
925  $ilCtrl->setParameter($this->getParentObject(), $this->getExpandVariable(), $a_child["node_id"]);
926  $a_tpl->setVariable("IMG_EXPAND", ilUtil::getImagePath("browser/plus.png"));
927  $a_tpl->setVariable("HREF_NAME", "n".$a_child["node_id"]);
928  $a_tpl->setVariable("HREF_EXPAND",
929  $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCommand(), "n".$a_child["node_id"]));
930  $grandchilds_html = "";
931  }
932  else
933  {
934  $ilCtrl->setParameter($this->getParentObject(), $this->getExpandVariable(), -$a_child["node_id"]);
935  $a_tpl->setVariable("IMG_EXPAND", ilUtil::getImagePath("browser/minus.png"));
936  $a_tpl->setVariable("HREF_NAME", "n".$a_child["node_id"]);
937  $a_tpl->setVariable("HREF_EXPAND",
938  $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCommand(), "n".$a_child["node_id"]));
939  }
940  $ilCtrl->setParameter($this->getParentObject(), $this->getExpandVariable(), "");
941  }
942  else
943  {
944  $a_tpl->setVariable("IMG_EXPAND", ilUtil::getImagePath("spacer.png"));
945  }
946  $a_tpl->parseCurrentBlock();
947  }
948 
949  // childs
950  $a_tpl->setCurrentBlock("list_item");
951  $a_tpl->setVariable("CHILDS", $grandchilds_html);
952  $a_tpl->parseCurrentBlock();
953 
954  $a_tpl->setCurrentBlock("element");
955  $a_tpl->parseCurrentBlock();
956 
957  // drop area after child
958  $a_tpl->setCurrentBlock("drop_area");
959  $a_tpl->setVariable("DNODE_ID", $a_child["node_id"]);
960  $a_tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("spacer.png"));
961  $a_tpl->parseCurrentBlock();
962 
963  // manage drag and drop areas
964  $this->manageDragAndDrop($a_child, $a_depth, false, $next_sibling, $grandchilds);
965 
966  // drop area menu
967  $menu_items = $this->getMenuItems($a_child, $a_depth, false, $next_sibling, $grandchilds);
968  if (count($menu_items) > 0)
969  {
970  // determine maximum of multi add numbers
971  $max = 1;
972  foreach($menu_items as $menu_item)
973  {
974  if ($menu_item["multi"] > $max)
975  {
976  $max = $menu_item["multi"];
977  }
978  }
979 
980  reset($menu_items);
981  $mcnt = 1;
982  foreach($menu_items as $menu_item)
983  {
984  if ($menu_item["multi"] > 1 )
985  {
986  for($i = 1; $i <= $menu_item["multi"]; $i++)
987  {
988  $a_tpl->setCurrentBlock("multi_add");
989  $a_tpl->setVariable("MA_NUM", $i);
990  $a_tpl->setVariable("MENU_CMD", $menu_item["cmd"]);
991  if ($menu_item["as_subitem"])
992  {
993  $a_tpl->setVariable("FC", "1");
994  $a_tpl->setVariable("MCNT", $mcnt."fc");
995  }
996  else
997  {
998  $a_tpl->setVariable("FC", "0");
999  $a_tpl->setVariable("MCNT", $mcnt);
1000  }
1001  $a_tpl->setVariable("CMD_NODE", $a_child["node_id"]);
1002  $a_tpl->parseCurrentBlock();
1003  }
1004  }
1005 
1006  // buffer td for lower multis
1007  if ($max > $menu_item["multi"])
1008  {
1009  $a_tpl->setCurrentBlock("multi_buffer");
1010  $a_tpl->setVariable("BUF_SPAN", $max - $menu_item["multi"]);
1011  $a_tpl->parseCurrentBlock();
1012  }
1013 
1014  $a_tpl->setCurrentBlock("menu_cmd");
1015  $a_tpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
1016  $a_tpl->setVariable("MENU_CMD", $menu_item["cmd"]);
1017  if ($menu_item["as_subitem"])
1018  {
1019  $a_tpl->setVariable("FC", "1");
1020  $a_tpl->setVariable("MCNT", $mcnt."fc");
1021  }
1022  else
1023  {
1024  $a_tpl->setVariable("FC", "0");
1025  $a_tpl->setVariable("MCNT", $mcnt);
1026  }
1027  $a_tpl->setVariable("CMD_NODE", $a_child["node_id"]);
1028  $a_tpl->parseCurrentBlock();
1029  $mcnt++;
1030  }
1031  $a_tpl->setCurrentBlock("drop_area_menu");
1032  $a_tpl->setVariable("MNODE_ID", $a_child["node_id"]);
1033  $a_tpl->parseCurrentBlock();
1034  }
1035 
1036  $a_tpl->setCurrentBlock("element");
1037  $a_tpl->parseCurrentBlock();
1038  }
getChildCommands($a_item)
Get item commands.
getCheckboxName()
Get Checkbox Name.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getExpanded()
Get expanded array.
getChildIcon($a_item)
Get icon path for an item.
getHighlightedNodes()
Get highlighted nodes.
getParentCommand()
Get parent command.
global $ilCtrl
Definition: ilias.php:18
$info
Definition: example_052.php:80
manageDragAndDrop($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
Makes nodes drag and drop content and targets.
getParentObject()
Get Parent object.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getChildInfo($a_child)
Get child info.
getMenuItems($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
Get menu items for drop area of node.
getChildIconAlt($a_item)
Get icon alt text for an item.
getExpandVariable()
Get expand variable.
getLevelHTML($a_par_node, $a_depth, &$a_childs)
Get Form HTML.
getChildTitle($a_child)
Get child title.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCheckboxName()

ilHierarchyFormGUI::setCheckboxName (   $a_checkboxname)

Set Checkbox Name.

Parameters
string$a_checkboxnameCheckbox Name

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

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

176  {
177  $this->checkboxname = $a_checkboxname;
178  }
+ Here is the caller graph for this function:

◆ setCurrentTopNodeId()

ilHierarchyFormGUI::setCurrentTopNodeId (   $a_currenttopnodeid)

Set Current Top Node ID.

Parameters
string$a_currenttopnodeidCurrent Top Node ID

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

116  {
117  $this->currenttopnodeid = $a_currenttopnodeid;
118  }

◆ setDragIcon()

ilHierarchyFormGUI::setDragIcon (   $a_dragicon)

Set Drag Icon Path.

Parameters
string$a_dragiconDrag Icon Path

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

196  {
197  $this->dragicon = $a_dragicon;
198  }

◆ setExpanded()

ilHierarchyFormGUI::setExpanded (   $a_val)

Set expanded Array.

Parameters
arrayexpanded array

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

Referenced by updateExpanded().

396  {
397  $this->expanded = $a_val;
398  }
+ Here is the caller graph for this function:

◆ setExpandVariable()

ilHierarchyFormGUI::setExpandVariable (   $a_val)

Set expand variable.

Parameters

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

Referenced by ilSCORM2004OrganizationHFormGUI\__construct().

376  {
377  $this->expand_variable = $a_val;
378  }
+ Here is the caller graph for this function:

◆ setExplorerUpdater()

ilHierarchyFormGUI::setExplorerUpdater (   $a_exp_frame,
  $a_exp_id,
  $a_exp_target_script 
)

Set Explorer Updater.

Parameters
object$a_treeTree Object

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

236  {
237  $this->exp_frame = $a_exp_frame;
238  $this->exp_id = $a_exp_id;
239  $this->exp_target_script = $a_exp_target_script;
240  }

◆ setFocusId()

ilHierarchyFormGUI::setFocusId (   $a_val)

Set focus if.

Parameters
intnode id

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

356  {
357  $this->focus_id = $a_val;
358  }

◆ setHighlightedNodes()

ilHierarchyFormGUI::setHighlightedNodes (   $a_val)

Set highlighted nodes.

Parameters
arrayhighlighted nodes

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

336  {
337  $this->highlighted_nodes = $a_val;
338  }

◆ setIcon()

ilHierarchyFormGUI::setIcon (   $a_icon)

Set Icon.

Parameters
string$a_iconIcon

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

156  {
157  $this->icon = $a_icon;
158  }

◆ setId()

ilHierarchyFormGUI::setId (   $a_id)

Set Id.

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

Parameters
string$a_idId

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

76  {
77  die("ilHierarchyFormGUI does currently not support multiple forms (multiple IDs). ID is always hform.");
78  }

◆ setMaxDepth()

ilHierarchyFormGUI::setMaxDepth (   $a_maxdepth)

Set Maximum Depth.

Parameters
int$a_maxdepthMaximum Depth

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

216  {
217  $this->maxdepth = $a_maxdepth;
218  }

◆ setParentCommand()

ilHierarchyFormGUI::setParentCommand (   $a_parent_obj,
  $a_parent_cmd 
)

Set parent gui object/cmd.

This is needed, if the expand feature is used.

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

45  {
46  $this->parent_obj = $a_parent_obj;
47  $this->parent_cmd = $a_parent_cmd;
48  }

◆ setTitle()

ilHierarchyFormGUI::setTitle (   $a_title)

Set Title.

Parameters
string$a_titleTitle

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

136  {
137  $this->title = $a_title;
138  }

◆ setTree()

ilHierarchyFormGUI::setTree (   $a_tree)

Set Tree Object.

Parameters
object$a_treeTree Object

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

96  {
97  $this->tree = $a_tree;
98  }

◆ setTriggeredUpdateCommand()

ilHierarchyFormGUI::setTriggeredUpdateCommand (   $a_triggered_update_command)

Set Explorer Updater.

Parameters
object$a_treeTree Object

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

248  {
249  $this->triggered_update_command = $a_triggered_update_command;
250  }

◆ setTypeWhiteList()

ilHierarchyFormGUI::setTypeWhiteList (   $a_val)

Set type whitelist.

Parameters
array$a_valwhite list of types

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

459  {
460  $this->white_list = $a_val;
461  }

◆ updateExpanded()

ilHierarchyFormGUI::updateExpanded ( )

Update expand information in session.

Parameters
stringnode id

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

References $_GET, $_POST, $_SESSION, array, getExpandVariable(), getTree(), and setExpanded().

Referenced by getContent().

416  {
417  $ev = $this->getExpandVariable();
418 
419  if ($ev == "")
420  {
421  return;
422  }
423 
424  // init empty session
425  if (!is_array($_SESSION[$ev]))
426  {
427  $_SESSION[$ev] = array($this->getTree()->getRootId());
428  }
429 
430  if ($_POST["il_hform_expand"] != "")
431  {
432  $node_id = $_POST["il_hform_expand"];
433  }
434  if ($_GET[$ev] != "")
435  {
436  $node_id = $_GET[$ev];
437  }
438 
439  // if positive => expand this node
440  if ($node_id > 0 && !in_array($node_id,$_SESSION[$ev]))
441  {
442  array_push($_SESSION[$ev], $node_id);
443  }
444  // if negative => compress this node
445  if ($node_id < 0)
446  {
447  $key = array_keys($_SESSION[$ev],-(int) $node_id);
448  unset($_SESSION[$ev][$key[0]]);
449  }
450  $this->setExpanded($_SESSION[$ev]);
451  }
$_SESSION["AccountId"]
setExpanded($a_val)
Set expanded Array.
$_GET["client_id"]
Create styles array
The data for the language used.
getExpandVariable()
Get expand variable.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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