ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 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...
 
- 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...
 
 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...
 

Additional Inherited Members

- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 

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.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 1064 of file class.ilHierarchyFormGUI.php.

Referenced by renderChild().

1065  {
1066  return false;
1067  }
+ 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 1040 of file class.ilHierarchyFormGUI.php.

References ilUtil\getImagePath().

Referenced by renderChild().

1041  {
1042  return ilUtil::getImagePath("icon_".$a_item["type"].".png");
1043  }
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 1051 of file class.ilHierarchyFormGUI.php.

References $lng.

Referenced by renderChild().

1052  {
1053  global $lng;
1054 
1055  return $lng->txt($a_item["type"]);
1056  }
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 1086 of file class.ilHierarchyFormGUI.php.

Referenced by renderChild().

1087  {
1088  return "";
1089  }
+ 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 1075 of file class.ilHierarchyFormGUI.php.

Referenced by renderChild().

1076  {
1077  return $a_child["title"];
1078  }
+ 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(), getDragIcon(), getExpandVariable(), getHelpItems(), getIcon(), 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  // icon
526  if ($this->getIcon() != "")
527  {
528  $ttpl->setCurrentBlock("icon");
529  $ttpl->setVariable("SRC_ICON", $this->getIcon());
530  $ttpl->parseCurrentBlock();
531  }
532 
533  // commands
534  $secs = array("1", "2");
535  foreach ($secs as $sec)
536  {
537  reset($this->commands);
538  reset($this->multi_commands);
539  if (count($this->multi_commands) > 0 || count($this->commands) > 0)
540  {
541  if (count($childs) > 0)
542  {
543  $single = false;
544  foreach($this->commands as $cmd)
545  {
546  $ttpl->setCurrentBlock("cmd".$sec);
547  $ttpl->setVariable("CMD", $cmd["cmd"]);
548  $ttpl->setVariable("CMD_TXT", $cmd["text"]);
549  $ttpl->parseCurrentBlock();
550  $single = true;
551  }
552 
553  $multi = false;
554  foreach($this->multi_commands as $cmd)
555  {
556  $ttpl->setCurrentBlock("multi_cmd".$sec);
557  $ttpl->setVariable("MULTI_CMD", $cmd["cmd"]);
558  $ttpl->setVariable("MULTI_CMD_TXT", $cmd["text"]);
559  $ttpl->parseCurrentBlock();
560  $multi = true;
561  }
562  if ($multi)
563  {
564  $ttpl->setCurrentBlock("multi_cmds".$sec);
565  $ttpl->setVariable("MCMD_ALT", $lng->txt("commands"));
566  if ($sec == "1")
567  {
568  $ttpl->setVariable("MCMD_IMG", ilUtil::getImagePath("arrow_downright.png"));
569  }
570  else
571  {
572  $ttpl->setVariable("MCMD_IMG", ilUtil::getImagePath("arrow_upright.png"));
573  }
574  $ttpl->parseCurrentBlock();
575  }
576  }
577 
578  if ($single || $multi)
579  {
580  $ttpl->setCurrentBlock("commands".$sec);
581  $ttpl->parseCurrentBlock();
582  }
583  $single = true;
584  }
585  }
586 
587  // explorer updater
588  if ($this->exp_frame != "")
589  {
590  $ttpl->setCurrentBlock("updater");
591  $ttpl->setVariable("UPDATER_FRAME", $this->exp_frame);
592  $ttpl->setVariable("EXP_ID_UPDATER", $this->exp_id);
593  $ttpl->setVariable("HREF_UPDATER", $this->exp_target_script);
594  $ttpl->parseCurrentBlock();
595  }
596 
597  // drag and drop initialisation
598  foreach($this->drag_target as $drag_target)
599  {
600  $ttpl->setCurrentBlock("dragtarget");
601  $ttpl->setVariable("EL_ID", $drag_target["id"]);
602  $ttpl->setVariable("GROUP", $drag_target["group"]);
603  $ttpl->parseCurrentBlock();
604  }
605  foreach($this->drag_content as $drag_content)
606  {
607  $ttpl->setCurrentBlock("dragcontent");
608  $ttpl->setVariable("EL_ID", $drag_content["id"]);
609  $ttpl->setVariable("GROUP", $drag_content["group"]);
610  $ttpl->parseCurrentBlock();
611  }
612 
613  // disambiguation menues and "insert as first child" flags
614  if (is_array($this->diss_menues))
615  {
616  foreach($this->diss_menues as $node_id => $d_menu)
617  {
618  foreach($d_menu as $group => $menu)
619  {
620  if (count($menu) > 1)
621  {
622  foreach($menu as $menu_item)
623  {
624  $ttpl->setCurrentBlock("dmenu_cmd");
625  $ttpl->setVariable("SUBITEM", (int) $menu_item["subitem"]);
626  $ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
627  $ttpl->parseCurrentBlock();
628  }
629 
630  $ttpl->setCurrentBlock("disambiguation_menu");
631  $ttpl->setVariable("DNODE_ID", $node_id);
632  $ttpl->setVariable("GRP", $group);
633  $ttpl->parseCurrentBlock();
634  }
635  else if (count($menu) == 1)
636  {
637  // set first child flag
638  $ttpl->setCurrentBlock("as_subitem_flag");
639  $ttpl->setVariable("SI_NODE_ID", $node_id);
640  $ttpl->setVariable("SI_GRP", $group);
641  $ttpl->setVariable("SI_SI", (int) $menu[0]["subitem"]);
642  $ttpl->parseCurrentBlock();
643 
644  }
645  }
646  }
647  }
648  $this->diss_menues[$a_id][$a_group][] = array("type" => $a_type, "text" => $a_diss_text);
649 
650  // help
651  $ttpl->setCurrentBlock("help_img");
652  $ttpl->setVariable("IMG_HELP", ilUtil::getImagePath("streaked_area.png"));
653  $ttpl->parseCurrentBlock();
654  $ttpl->setCurrentBlock("help_section");
655  $ttpl->setVariable("TXT_HELP",
656  $lng->txt("form_hierarchy_add_elements"));
657  $ttpl->parseCurrentBlock();
658 
659  if ($this->getDragIcon() != "")
660  {
661  $ttpl->setCurrentBlock("help_img");
662  $ttpl->setVariable("IMG_HELP", $this->getDragIcon());
663  $ttpl->parseCurrentBlock();
664  $ttpl->setCurrentBlock("help_img");
665  $ttpl->setVariable("IMG_HELP",
666  ilUtil::getImagePath("drop_streaked_area.png"));
667  $ttpl->parseCurrentBlock();
668  $ttpl->setCurrentBlock("help_section");
669  $ttpl->setVariable("TXT_HELP",
670  $lng->txt("form_hierarchy_drag_drop_help"));
671  $ttpl->parseCurrentBlock();
672  }
673 
674  // additional help items
675  foreach ($this->getHelpItems() as $help)
676  {
677  if ($help["image"] != "")
678  {
679  $ttpl->setCurrentBlock("help_img");
680  $ttpl->setVariable("IMG_HELP", $help["image"]);
681  $ttpl->parseCurrentBlock();
682  }
683  $ttpl->setCurrentBlock("help_section");
684  $ttpl->setVariable("TXT_HELP", $help["text"]);
685  $ttpl->parseCurrentBlock();
686  }
687 
688  if ($this->triggered_update_command != "")
689  {
690  $ttpl->setCurrentBlock("tr_update");
691  $ttpl->setVariable("UPDATE_CMD", $this->triggered_update_command);
692  $ttpl->parseCurrentBlock();
693  }
694 
695  // disambiguation menues and "insert as first child" flags
696  if (is_array($this->diss_menues))
697  {
698  foreach($this->diss_menues as $node_id => $d_menu)
699  {
700  foreach($d_menu as $group => $menu)
701  {
702  if (count($menu) > 1)
703  {
704  foreach($menu as $menu_item)
705  {
706  $ttpl->setCurrentBlock("dmenu_cmd");
707  $ttpl->setVariable("SUBITEM", (int) $menu_item["subitem"]);
708  $ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
709  $ttpl->parseCurrentBlock();
710  }
711 
712  $ttpl->setCurrentBlock("disambiguation_menu");
713  $ttpl->setVariable("DNODE_ID", $node_id);
714  $ttpl->setVariable("GRP", $group);
715  $ttpl->parseCurrentBlock();
716  }
717  else if (count($menu) == 1)
718  {
719  // set first child flag
720  $ttpl->setCurrentBlock("as_subitem_flag");
721  $ttpl->setVariable("SI_NODE_ID", $node_id);
722  $ttpl->setVariable("SI_GRP", $group);
723  $ttpl->setVariable("SI_SI", (int) $menu[0]["subitem"]);
724  $ttpl->parseCurrentBlock();
725 
726  }
727  }
728  }
729  }
730  $this->diss_menues[$a_id][$a_group][] = array("type" => $a_type, "text" => $a_diss_text);
731 
732  // nodes
733  $ttpl->setVariable("NODES", $nodes_html);
734 
735  // title
736 //echo "<br>".htmlentities($this->getTitle())." --- ".htmlentities(ilUtil::prepareFormOutput($this->getTitle()));
737  $ttpl->setVariable("TITLE", $this->getTitle());
738 
739 
740  return $ttpl->get();
741  }
$cmd
Definition: sahs_server.php:35
getHelpItems()
Get all help items.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getDragIcon()
Get Drag Icon Path.
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 getContent().

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 getContent().

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:

◆ getIcon()

ilHierarchyFormGUI::getIcon ( )

Get Icon.

Returns
string Icon

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

Referenced by getContent().

167  {
168  return $this->icon;
169  }
+ Here is the caller graph for this function:

◆ getId()

ilHierarchyFormGUI::getId ( )

Get Id.

Returns
string Id

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

87  {
88  return "hform";
89  }

◆ getLevelHTML()

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

Get Form HTML.

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

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

Referenced by getContent(), and renderChild().

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

Referenced by getLevelHTML(), and renderChild().

1104  {
1105  return array();
1106  }
+ 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:

◆ getPostFirstChild()

◆ getPostMulti()

static ilHierarchyFormGUI::getPostMulti ( )
static

Get multi number of _POST input.

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

1133  {
1134  return (int) ($_POST["il_hform_multi"] > 1
1135  ? $_POST["il_hform_multi"]
1136  : 1);
1137  }
$_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 1123 of file class.ilHierarchyFormGUI.php.

Referenced by getLevelHTML(), and renderChild().

1124  {
1125  //$this->makeDragTarget($a_node["id"], $a_group);
1126  //$this->makeDragTarget($a_node["id"], $a_group);
1127  }
+ 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 1112 of file class.ilHierarchyFormGUI.php.

Referenced by getLevelHTML().

1113  {
1114  return true;
1115  }
+ 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 850 of file class.ilHierarchyFormGUI.php.

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

Referenced by getLevelHTML().

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