ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
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
 ilFormGUI ()
 Constructor. More...
 
 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, 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  parent::ilFormGUI();
33  $this->help_items = array();
34 
35  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
37  $tpl->addJavascript("./Services/Form/js/ServiceFormHierarchyForm.js");
38  }
setCheckboxName($a_checkboxname)
Set Checkbox Name.
global $tpl
Definition: ilias.php:8
static initDragDrop()
Init YUI Drag and Drop.
global $lng
Definition: privfeed.php:40
+ 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 326 of file class.ilHierarchyFormGUI.php.

327  {
328  $this->commands[] = array("text" => $a_txt, "cmd" => $a_cmd);
329  }

◆ addHelpItem()

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

Get all help items.

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

257  {
258  $this->help_items[] = array("text" => $a_text,
259  "image" => $a_image);
260  }

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

316  {
317  $this->multi_commands[] = array("text" => $a_txt, "cmd" => $a_cmd);
318  }

◆ getCheckboxName()

ilHierarchyFormGUI::getCheckboxName ( )

Get Checkbox Name.

Returns
string Checkbox Name

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

Referenced by renderChild().

187  {
188  return $this->checkboxname;
189  }
+ 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 1071 of file class.ilHierarchyFormGUI.php.

Referenced by renderChild().

1072  {
1073  return false;
1074  }
+ 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 1047 of file class.ilHierarchyFormGUI.php.

References ilUtil\getImagePath().

Referenced by renderChild().

1048  {
1049  return ilUtil::getImagePath("icon_".$a_item["type"].".svg");
1050  }
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 1058 of file class.ilHierarchyFormGUI.php.

References $lng.

Referenced by renderChild().

1059  {
1060  global $lng;
1061 
1062  return $lng->txt($a_item["type"]);
1063  }
global $lng
Definition: privfeed.php:40
+ 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 1093 of file class.ilHierarchyFormGUI.php.

Referenced by renderChild().

1094  {
1095  return "";
1096  }
+ 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 478 of file class.ilHierarchyFormGUI.php.

References getCurrentTopNodeId(), and getTree().

Referenced by getLevelHTML().

479  {
480  if ($a_node_id == false)
481  {
482  $a_node_id = $this->getCurrentTopNodeId();
483  }
484 
485  $tree_childs = $this->getTree()->getChilds($a_node_id);
486  $childs = array();
487  foreach($tree_childs as $tree_child)
488  {
489 
490  if (!is_array($this->white_list) || in_array($tree_child["type"], $this->white_list))
491  {
492  $childs[] = array("node_id" => $tree_child["child"],
493  "title" => $tree_child["title"],
494  "type" => $tree_child["type"],
495  "depth" => $tree_child["depth"]
496  );
497  }
498  }
499 
500  return $childs;
501  }
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 1082 of file class.ilHierarchyFormGUI.php.

Referenced by renderChild().

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

◆ getContent()

ilHierarchyFormGUI::getContent ( )

Get Form Content.

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

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

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

Referenced by getChilds(), and getContent().

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

◆ getDragIcon()

ilHierarchyFormGUI::getDragIcon ( )

Get Drag Icon Path.

Returns
string Drag Icon Path

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

Referenced by getLegend().

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

◆ getExpanded()

ilHierarchyFormGUI::getExpanded ( )

Get expanded array.

Returns
array expanded array

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

Referenced by renderChild().

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

◆ getExpandVariable()

ilHierarchyFormGUI::getExpandVariable ( )

Get expand variable.

Returns

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

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

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

◆ getFocusId()

ilHierarchyFormGUI::getFocusId ( )

Get focus id.

Returns
int node id

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

Referenced by renderChild().

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

◆ getHelpItems()

ilHierarchyFormGUI::getHelpItems ( )

Get all help items.

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

Referenced by getLegend().

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

◆ getHighlightedNodes()

ilHierarchyFormGUI::getHighlightedNodes ( )

Get highlighted nodes.

Returns
array highlighted nodes

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

Referenced by renderChild().

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

◆ getHTML()

ilHierarchyFormGUI::getHTML ( )

Get HTML.

Parameters

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

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

◆ getIcon()

ilHierarchyFormGUI::getIcon ( )

Get Icon.

Returns
string Icon

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

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

◆ getId()

ilHierarchyFormGUI::getId ( )

Get Id.

Returns
string Id

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

87  {
88  return "hform";
89  }

◆ getLegend()

ilHierarchyFormGUI::getLegend ( )

Get Legend.

Returns
string legend html

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

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

705  {
706  global $lng;
707 
708  include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
709 
710  $ttpl = new ilTemplate("tpl.hierarchy_form_legend.html", true, true, "Services/Form");
711  if ($this->getDragIcon() != "")
712  {
713  $ttpl->setCurrentBlock("help_drag");
714  $ttpl->setVariable("IMG_DRAG", $this->getDragIcon());
715  $ttpl->setVariable("DRAG_ARROW",
717  $ttpl->setVariable("TXT_DRAG",
718  $lng->txt("form_hierarchy_drag_drop_help"));
719  $ttpl->setVariable("PLUS", ilGlyphGUI::get(ilGlyphGUI::ADD));
720  $ttpl->parseCurrentBlock();
721  }
722 
723  // additional help items
724  foreach ($this->getHelpItems() as $help)
725  {
726  if ($help["image"] != "")
727  {
728  $ttpl->setCurrentBlock("help_img");
729  $ttpl->setVariable("IMG_HELP", $help["image"]);
730  $ttpl->parseCurrentBlock();
731  }
732  $ttpl->setCurrentBlock("help_item");
733  $ttpl->setVariable("TXT_HELP", $help["text"]);
734  $ttpl->parseCurrentBlock();
735  }
736 
737  $ttpl->setVariable("TXT_ADD_EL",
738  $lng->txt("form_hierarchy_add_elements"));
739  $ttpl->setVariable("PLUS2", ilGlyphGUI::get(ilGlyphGUI::ADD));
740 
741  return $ttpl->get();
742  }
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:40
+ Here is the call graph for this function:

◆ getLevelHTML()

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

Get Form HTML.

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

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

Referenced by getContent(), and renderChild().

749  {
750  global $lng;
751 
752  if ($this->getMaxDepth() > -1 && $this->getMaxDepth() < $a_depth)
753  {
754  return "";
755  }
756 
757  $childs = $this->getChilds($a_par_node["node_id"]);
758  $a_childs = $childs;
759  $html = "";
760  $last_child = null;
761  $ttpl = new ilTemplate("tpl.hierarchy_form_nodes.html", true, true, "Services/Form");
762 
763  // prepended drop area
764  if ($this->nodeAllowsChilds($a_par_node) && (count($childs) > 0 || $a_depth == 0))
765  {
766  $ttpl->setCurrentBlock("drop_area");
767  $ttpl->setVariable("DNODE_ID", $a_par_node["node_id"]."fc"); // fc means "first child"
768  $ttpl->setVariable("IMG_BLANK", ilUtil::getImagePath("spacer.png"));
769  if (count($childs) == 0)
770  {
771  $ttpl->setVariable("NO_CONTENT_CLASS", "ilCOPGNoPageContent");
772  $ttpl->setVariable("NO_CONTENT_TXT", " &nbsp;".$lng->txt("form_hier_click_to_add"));
773  }
774  $ttpl->parseCurrentBlock();
775 
776  $this->manageDragAndDrop($a_par_node, $a_depth, true, null, $childs);
777  $menu_items = $this->getMenuItems($a_par_node, $a_depth, true, null, $childs);
778 //var_dump($menu_items);
779  if (count($menu_items) > 0)
780  {
781  // determine maximum of multi add numbers
782  $max = 1;
783  foreach($menu_items as $menu_item)
784  {
785  if ($menu_item["multi"] > $max)
786  {
787  $max = $menu_item["multi"];
788  }
789  }
790 
791  reset($menu_items);
792  $mcnt = 1;
793  foreach($menu_items as $menu_item)
794  {
795  if ($menu_item["multi"] > 1)
796  {
797  for($i = 1; $i <= $menu_item["multi"]; $i++)
798  {
799  $ttpl->setCurrentBlock("multi_add");
800  $ttpl->setVariable("MA_NUM", $i);
801  $ttpl->setVariable("MENU_CMD", $menu_item["cmd"]);
802  $ttpl->setVariable("FC", "1");
803  $ttpl->setVariable("CMD_NODE", $a_par_node["node_id"]);
804  $ttpl->setVariable("MCNT", $mcnt."fc");
805  $ttpl->parseCurrentBlock();
806  }
807  }
808 
809  // buffer td for lower multis
810  if ($max > $menu_item["multi"])
811  {
812  $ttpl->setCurrentBlock("multi_buffer");
813  $ttpl->setVariable("BUF_SPAN", $max - $menu_item["multi"]);
814  $ttpl->parseCurrentBlock();
815  }
816  $ttpl->setCurrentBlock("menu_cmd");
817  $ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
818  $ttpl->setVariable("MENU_CMD", $menu_item["cmd"]);
819  $ttpl->setVariable("CMD_NODE", $a_par_node["node_id"]);
820  $ttpl->setVariable("FC", "1");
821  $ttpl->setVariable("MCNT", $mcnt."fc");
822  $ttpl->parseCurrentBlock();
823  $mcnt++;
824  }
825  $ttpl->setCurrentBlock("drop_area_menu");
826  $ttpl->setVariable("MNODE_ID", $a_par_node["node_id"]."fc");
827  $ttpl->parseCurrentBlock();
828 
829  $ttpl->setCurrentBlock("element");
830  $ttpl->parseCurrentBlock();
831  }
832  }
833 
834  // insert childs
835  if (count($childs) > 0)
836  {
837  for($i = 0; $i < count($childs); $i++)
838  {
839  $next_sibling = ($i < (count($childs) - 1))
840  ? $next_sibling = $childs[$i+1]
841  : null;
842 
843  $this->renderChild($ttpl, $childs[$i], $a_depth, $next_sibling);
844  $last_child = $child;
845  }
846  }
847 
848  $html = $ttpl->get();
849  unset($ttpl);
850 
851  return $html;
852  }
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:40
$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 226 of file class.ilHierarchyFormGUI.php.

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

227  {
228  return $this->maxdepth;
229  }
+ 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 1110 of file class.ilHierarchyFormGUI.php.

Referenced by getLevelHTML(), and renderChild().

1111  {
1112  return array();
1113  }
+ Here is the caller graph for this function:

◆ getParentCommand()

ilHierarchyFormGUI::getParentCommand ( )

Get parent command.

Returns
string parent command

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

Referenced by renderChild().

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

◆ getParentObject()

ilHierarchyFormGUI::getParentObject ( )

Get Parent object.

Returns
object parent gui object

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

Referenced by renderChild().

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

◆ getPostFields()

static ilHierarchyFormGUI::getPostFields ( )
static

Get all post fields.

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

References $_POST.

Referenced by ilObjSCORM2004LearningModuleGUI\insertLMChapterClip().

1177  {
1178  return array (
1179  "il_hform_node" => $_POST["il_hform_node"],
1180  "il_hform_fc" => $_POST["il_hform_fc"],
1181  "il_hform_as_subitem" => $_POST["il_hform_as_subitem"],
1182  "il_hform_multi" => $_POST["il_hform_multi"],
1183  "il_hform_source_id" => $_POST["il_hform_source_id"],
1184  "il_hform_target_id" => $_POST["il_hform_target_id"]
1185  );
1186  }
$_POST['username']
Definition: cron.php:12
+ Here is the caller graph for this function:

◆ getPostFirstChild()

◆ getPostMulti()

static ilHierarchyFormGUI::getPostMulti ( )
static

Get multi number of _POST input.

Definition at line 1139 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().

1140  {
1141  return (int) ($_POST["il_hform_multi"] > 1
1142  ? $_POST["il_hform_multi"]
1143  : 1);
1144  }
$_POST['username']
Definition: cron.php:12
+ Here is the caller graph for this function:

◆ getPostNodeId()

◆ getTitle()

ilHierarchyFormGUI::getTitle ( )

Get Title.

Returns
string Title

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

Referenced by getContent().

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

◆ getTree()

ilHierarchyFormGUI::getTree ( )

Get Tree Object.

Returns
object Tree Object

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

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

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

◆ getTypeWhiteList()

ilHierarchyFormGUI::getTypeWhiteList ( )

Get type whitelist.

Returns
array white list of types

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

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

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

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

302  {
303  if ($a_id != "")
304  {
305  $this->drag_content[] = array("id" => $a_id, "group" => $a_group);
306  }
307  }
+ 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 276 of file class.ilHierarchyFormGUI.php.

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

277  {
278  if ($a_first_child_drop_area == true) // first child drop areas only insert as subitems
279  {
280  $a_as_subitem = true;
281  }
282 
283  if ($a_id != "")
284  {
285  if ($a_first_child_drop_area)
286  {
287  $a_id.= "fc";
288  }
289 
290  $this->drag_target[] = array("id" => $a_id, "group" => $a_group);
291  $this->diss_menues[$a_id][$a_group][] = array("subitem" => $a_as_subitem, "text" => $a_diss_text);
292  }
293  }
+ 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 1130 of file class.ilHierarchyFormGUI.php.

Referenced by getLevelHTML(), and renderChild().

1131  {
1132  //$this->makeDragTarget($a_node["id"], $a_group);
1133  //$this->makeDragTarget($a_node["id"], $a_group);
1134  }
+ 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 1119 of file class.ilHierarchyFormGUI.php.

Referenced by getLevelHTML().

1120  {
1121  return true;
1122  }
+ 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 857 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().

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

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

177  {
178  $this->checkboxname = $a_checkboxname;
179  }
+ 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 116 of file class.ilHierarchyFormGUI.php.

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

◆ setDragIcon()

ilHierarchyFormGUI::setDragIcon (   $a_dragicon)

Set Drag Icon Path.

Parameters
string$a_dragiconDrag Icon Path

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

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

◆ setExpanded()

ilHierarchyFormGUI::setExpanded (   $a_val)

Set expanded Array.

Parameters
arrayexpanded array

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

Referenced by updateExpanded().

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

◆ setExpandVariable()

ilHierarchyFormGUI::setExpandVariable (   $a_val)

Set expand variable.

Parameters

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

Referenced by ilSCORM2004OrganizationHFormGUI\__construct().

377  {
378  $this->expand_variable = $a_val;
379  }
+ 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 236 of file class.ilHierarchyFormGUI.php.

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

◆ setFocusId()

ilHierarchyFormGUI::setFocusId (   $a_val)

Set focus if.

Parameters
intnode id

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

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

◆ setHighlightedNodes()

ilHierarchyFormGUI::setHighlightedNodes (   $a_val)

Set highlighted nodes.

Parameters
arrayhighlighted nodes

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

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

◆ setIcon()

ilHierarchyFormGUI::setIcon (   $a_icon)

Set Icon.

Parameters
string$a_iconIcon

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

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

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

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

◆ setMaxDepth()

ilHierarchyFormGUI::setMaxDepth (   $a_maxdepth)

Set Maximum Depth.

Parameters
int$a_maxdepthMaximum Depth

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

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

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

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

◆ setTitle()

ilHierarchyFormGUI::setTitle (   $a_title)

Set Title.

Parameters
string$a_titleTitle

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

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

◆ setTree()

ilHierarchyFormGUI::setTree (   $a_tree)

Set Tree Object.

Parameters
object$a_treeTree Object

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

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

◆ setTriggeredUpdateCommand()

ilHierarchyFormGUI::setTriggeredUpdateCommand (   $a_triggered_update_command)

Set Explorer Updater.

Parameters
object$a_treeTree Object

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

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

◆ setTypeWhiteList()

ilHierarchyFormGUI::setTypeWhiteList (   $a_val)

Set type whitelist.

Parameters
array$a_valwhite list of types

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

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

◆ updateExpanded()

ilHierarchyFormGUI::updateExpanded ( )

Update expand information in session.

Parameters
stringnode id

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

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

Referenced by getContent().

417  {
418  $ev = $this->getExpandVariable();
419 
420  if ($ev == "")
421  {
422  return;
423  }
424 
425  // init empty session
426  if (!is_array($_SESSION[$ev]))
427  {
428  $_SESSION[$ev] = array($this->getTree()->getRootId());
429  }
430 
431  if ($_POST["il_hform_expand"] != "")
432  {
433  $node_id = $_POST["il_hform_expand"];
434  }
435  if ($_GET[$ev] != "")
436  {
437  $node_id = $_GET[$ev];
438  }
439 
440  // if positive => expand this node
441  if ($node_id > 0 && !in_array($node_id,$_SESSION[$ev]))
442  {
443  array_push($_SESSION[$ev], $node_id);
444  }
445  // if negative => compress this node
446  if ($node_id < 0)
447  {
448  $key = array_keys($_SESSION[$ev],-(int) $node_id);
449  unset($_SESSION[$ev][$key[0]]);
450  }
451  $this->setExpanded($_SESSION[$ev]);
452  }
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]
setExpanded($a_val)
Set expanded Array.
$_GET["client_id"]
getExpandVariable()
Get expand variable.
+ 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: