ILIAS  release_7 Revision v7.30-3-g800a261c036
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...
 

Protected Attributes

 $lng
 
 $tpl
 
 $ctrl
 
- 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

Reimplemented in ilSCORM2004OrganizationHFormGUI.

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

37 {
38 global $DIC;
39
40 $this->lng = $DIC->language();
41 $this->tpl = $DIC["tpl"];
42 $this->ctrl = $DIC->ctrl();
43 $lng = $DIC->language();
44 $tpl = $DIC["tpl"];
45
46 $this->maxdepth = -1;
47 $this->multi_commands = array();
48 $this->commands = array();
49 $this->drag_target[] = array();
50 $this->drag_content[] = array();
51 $lng->loadLanguageModule("form");
52 $this->setCheckboxName("cbox");
53 $this->help_items = array();
54
55 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
57 $tpl->addJavascript("./Services/Form/js/ServiceFormHierarchyForm.js");
58 }
setCheckboxName($a_checkboxname)
Set Checkbox Name.
static initDragDrop(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Drag and Drop.
global $DIC
Definition: goto.php:24

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

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

343 {
344 $this->commands[] = array("text" => $a_txt, "cmd" => $a_cmd);
345 }

◆ addHelpItem()

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

Get all help items.

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

277 {
278 $this->help_items[] = array("text" => $a_text,
279 "image" => $a_image);
280 }

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

332 {
333 $this->multi_commands[] = array("text" => $a_txt, "cmd" => $a_cmd);
334 }

◆ getCheckboxName()

ilHierarchyFormGUI::getCheckboxName ( )

Get Checkbox Name.

Returns
string Checkbox Name

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

207 {
208 return $this->checkboxname;
209 }

Referenced by renderChild().

+ 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")

Reimplemented in ilChapterHierarchyFormGUI, and ilSCORM2004OrganizationHFormGUI.

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

1017 {
1018 return false;
1019 }

Referenced by renderChild().

+ 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

Reimplemented in ilChapterHierarchyFormGUI.

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

993 {
994 return ilUtil::getImagePath("icon_" . $a_item["type"] . ".svg");
995 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath().

Referenced by renderChild().

+ 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

Reimplemented in ilChapterHierarchyFormGUI, and ilSCORM2004OrganizationHFormGUI.

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

1004 {
1005 $lng = $this->lng;
1006
1007 return $lng->txt($a_item["type"]);
1008 }

References $lng.

Referenced by renderChild().

+ 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

Reimplemented in ilChapterHierarchyFormGUI.

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

1039 {
1040 return "";
1041 }

Referenced by renderChild().

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

489 {
490 if ($a_node_id == false) {
491 $a_node_id = $this->getCurrentTopNodeId();
492 }
493
494 $tree_childs = $this->getTree()->getChilds($a_node_id);
495 $childs = array();
496 foreach ($tree_childs as $tree_child) {
497 if (!is_array($this->white_list) || in_array($tree_child["type"], $this->white_list)) {
498 $childs[] = array("node_id" => $tree_child["child"],
499 "title" => $tree_child["title"],
500 "type" => $tree_child["type"],
501 "depth" => $tree_child["depth"]
502 );
503 }
504 }
505
506 return $childs;
507 }
getCurrentTopNodeId()
Get Current Top Node ID.

References getCurrentTopNodeId(), and getTree().

Referenced by getLevelHTML().

+ 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

Reimplemented in ilChapterHierarchyFormGUI.

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

1028 {
1029 return $a_child["title"];
1030 }

Referenced by renderChild().

+ Here is the caller graph for this function:

◆ getContent()

ilHierarchyFormGUI::getContent ( )

Get Form Content.

Reimplemented from ilFormGUI.

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

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

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

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

147 {
148 return $this->currenttopnodeid;
149 }

Referenced by getChilds(), and getContent().

+ Here is the caller graph for this function:

◆ getDragIcon()

ilHierarchyFormGUI::getDragIcon ( )

Get Drag Icon Path.

Returns
string Drag Icon Path

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

227 {
228 return $this->dragicon;
229 }

Referenced by getLegend().

+ Here is the caller graph for this function:

◆ getExpanded()

ilHierarchyFormGUI::getExpanded ( )

Get expanded array.

Returns
array expanded array

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

423 {
424 return $this->expanded;
425 }

Referenced by renderChild().

+ Here is the caller graph for this function:

◆ getExpandVariable()

ilHierarchyFormGUI::getExpandVariable ( )

Get expand variable.

Returns

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

403 {
404 return $this->expand_variable;
405 }

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

+ Here is the caller graph for this function:

◆ getFocusId()

ilHierarchyFormGUI::getFocusId ( )

Get focus id.

Returns
int node id

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

383 {
384 return $this->focus_id;
385 }

Referenced by renderChild().

+ Here is the caller graph for this function:

◆ getHelpItems()

ilHierarchyFormGUI::getHelpItems ( )

Get all help items.

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

286 {
287 return $this->help_items;
288 }

Referenced by getLegend().

+ Here is the caller graph for this function:

◆ getHighlightedNodes()

ilHierarchyFormGUI::getHighlightedNodes ( )

Get highlighted nodes.

Returns
array highlighted nodes

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

363 {
364 return $this->highlighted_nodes;
365 }

Referenced by renderChild().

+ Here is the caller graph for this function:

◆ getHTML()

ilHierarchyFormGUI::getHTML ( )

Get HTML.

Parameters

return

Reimplemented from ilFormGUI.

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

1114 {
1115 return parent::getHTML() . $this->getLegend();
1116 }

References getLegend().

+ Here is the call graph for this function:

◆ getIcon()

ilHierarchyFormGUI::getIcon ( )

Get Icon.

Returns
string Icon

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

187 {
188 return $this->icon;
189 }

◆ getId()

ilHierarchyFormGUI::getId ( )

Get Id.

Returns
string Id

Reimplemented from ilFormGUI.

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

107 {
108 return "hform";
109 }

◆ getLegend()

ilHierarchyFormGUI::getLegend ( )

Get Legend.

Returns
string legend html

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

680 {
682
683 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
684
685 $ttpl = new ilTemplate("tpl.hierarchy_form_legend.html", true, true, "Services/Form");
686 if ($this->getDragIcon() != "") {
687 $ttpl->setCurrentBlock("help_drag");
688 $ttpl->setVariable("IMG_DRAG", $this->getDragIcon());
689 $ttpl->setVariable(
690 "DRAG_ARROW",
692 );
693 $ttpl->setVariable(
694 "TXT_DRAG",
695 $lng->txt("form_hierarchy_drag_drop_help")
696 );
697 $ttpl->setVariable("PLUS", ilGlyphGUI::get(ilGlyphGUI::ADD));
698 $ttpl->parseCurrentBlock();
699 }
700
701 // additional help items
702 foreach ($this->getHelpItems() as $help) {
703 if ($help["image"] != "") {
704 $ttpl->setCurrentBlock("help_img");
705 $ttpl->setVariable("IMG_HELP", $help["image"]);
706 $ttpl->parseCurrentBlock();
707 }
708 $ttpl->setCurrentBlock("help_item");
709 $ttpl->setVariable("TXT_HELP", $help["text"]);
710 $ttpl->parseCurrentBlock();
711 }
712
713 $ttpl->setVariable(
714 "TXT_ADD_EL",
715 $lng->txt("form_hierarchy_add_elements")
716 );
717 $ttpl->setVariable("PLUS2", ilGlyphGUI::get(ilGlyphGUI::ADD));
718
719 return $ttpl->get();
720 }
static get($a_glyph, $a_text="")
Get glyph html.
getDragIcon()
Get Drag Icon Path.
getHelpItems()
Get all help items.

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

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLevelHTML()

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

Get Form HTML.

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

727 {
729
730 if ($this->getMaxDepth() > -1 && $this->getMaxDepth() < $a_depth) {
731 return "";
732 }
733
734 $childs = $this->getChilds($a_par_node["node_id"]);
735 $a_childs = $childs;
736 $html = "";
737 $last_child = null;
738 $ttpl = new ilTemplate("tpl.hierarchy_form_nodes.html", true, true, "Services/Form");
739
740 // prepended drop area
741 if ($this->nodeAllowsChilds($a_par_node) && (count($childs) > 0 || $a_depth == 0)) {
742 $ttpl->setCurrentBlock("drop_area");
743 $ttpl->setVariable("DNODE_ID", $a_par_node["node_id"] . "fc"); // fc means "first child"
744 $ttpl->setVariable("IMG_BLANK", ilUtil::getImagePath("spacer.png"));
745 if (count($childs) == 0) {
746 $ttpl->setVariable("NO_CONTENT_CLASS", "ilCOPGNoPageContent");
747 $ttpl->setVariable("NO_CONTENT_TXT", " &nbsp;" . $lng->txt("form_hier_click_to_add"));
748 }
749 $ttpl->parseCurrentBlock();
750
751 $this->manageDragAndDrop($a_par_node, $a_depth, true, null, $childs);
752 $menu_items = $this->getMenuItems($a_par_node, $a_depth, true, null, $childs);
753 //var_dump($menu_items);
754 if (count($menu_items) > 0) {
755 // determine maximum of multi add numbers
756 $max = 1;
757 foreach ($menu_items as $menu_item) {
758 if ($menu_item["multi"] > $max) {
759 $max = $menu_item["multi"];
760 }
761 }
762
763 reset($menu_items);
764 $mcnt = 1;
765 foreach ($menu_items as $menu_item) {
766 if ($menu_item["multi"] > 1) {
767 for ($i = 1; $i <= $menu_item["multi"]; $i++) {
768 $ttpl->setCurrentBlock("multi_add");
769 $ttpl->setVariable("MA_NUM", $i);
770 $ttpl->setVariable("MENU_CMD", $menu_item["cmd"]);
771 $ttpl->setVariable("FC", "1");
772 $ttpl->setVariable("CMD_NODE", $a_par_node["node_id"]);
773 $ttpl->setVariable("MCNT", $mcnt . "fc");
774 $ttpl->parseCurrentBlock();
775 }
776 }
777
778 // buffer td for lower multis
779 if ($max > $menu_item["multi"]) {
780 $ttpl->setCurrentBlock("multi_buffer");
781 $ttpl->setVariable("BUF_SPAN", $max - $menu_item["multi"]);
782 $ttpl->parseCurrentBlock();
783 }
784 $ttpl->setCurrentBlock("menu_cmd");
785 $ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
786 $ttpl->setVariable("MENU_CMD", $menu_item["cmd"]);
787 $ttpl->setVariable("CMD_NODE", $a_par_node["node_id"]);
788 $ttpl->setVariable("FC", "1");
789 $ttpl->setVariable("MCNT", $mcnt . "fc");
790 $ttpl->parseCurrentBlock();
791 $mcnt++;
792 }
793 $ttpl->setCurrentBlock("drop_area_menu");
794 $ttpl->setVariable("MNODE_ID", $a_par_node["node_id"] . "fc");
795 $ttpl->parseCurrentBlock();
796
797 $ttpl->setCurrentBlock("element");
798 $ttpl->parseCurrentBlock();
799 }
800 }
801
802 // insert childs
803 if (count($childs) > 0) {
804 for ($i = 0; $i < count($childs); $i++) {
805 $next_sibling = ($i < (count($childs) - 1))
806 ? $next_sibling = $childs[$i + 1]
807 : null;
808
809 $this->renderChild($ttpl, $childs[$i], $a_depth, $next_sibling);
810 $last_child = $child;
811 }
812 }
813
814 $html = $ttpl->get();
815 unset($ttpl);
816
817 return $html;
818 }
getMaxDepth()
Get Maximum Depth.
nodeAllowsChilds($a_node)
Checks, whether current nodes allows childs at all.
getMenuItems($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
Get menu items for drop area of node.
getChilds($a_node_id=false)
Get all childs of current node.
renderChild($a_tpl, $a_child, $a_depth, $next_sibling=null)
Render a single child (including grandchilds)
manageDragAndDrop($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
Makes nodes drag and drop content and targets.
$i
Definition: metadata.php:24

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

Referenced by getContent(), and renderChild().

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

247 {
248 return $this->maxdepth;
249 }

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

+ 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

Reimplemented in ilChapterHierarchyFormGUI, and ilSCORM2004OrganizationHFormGUI.

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

1056 {
1057 return array();
1058 }

Referenced by getLevelHTML(), and renderChild().

+ Here is the caller graph for this function:

◆ getParentCommand()

ilHierarchyFormGUI::getParentCommand ( )

Get parent command.

Returns
string parent command

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

87 {
88 return $this->parent_cmd;
89 }

◆ getParentObject()

ilHierarchyFormGUI::getParentObject ( )

Get Parent object.

Returns
object parent gui object

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

77 {
78 return $this->parent_obj;
79 }

Referenced by renderChild().

+ Here is the caller graph for this function:

◆ getPostFields()

static ilHierarchyFormGUI::getPostFields ( )
static

Get all post fields.

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

1122 {
1123 return array(
1124 "il_hform_node" => $_POST["il_hform_node"],
1125 "il_hform_fc" => $_POST["il_hform_fc"],
1126 "il_hform_as_subitem" => $_POST["il_hform_as_subitem"],
1127 "il_hform_multi" => $_POST["il_hform_multi"],
1128 "il_hform_source_id" => $_POST["il_hform_source_id"],
1129 "il_hform_target_id" => $_POST["il_hform_target_id"]
1130 );
1131 }
$_POST["username"]

References $_POST.

Referenced by ilObjSCORM2004LearningModuleGUI\insertLMChapterClip().

+ Here is the caller graph for this function:

◆ getPostFirstChild()

◆ getPostMulti()

static ilHierarchyFormGUI::getPostMulti ( )
static

◆ getPostNodeId()

◆ getTitle()

ilHierarchyFormGUI::getTitle ( )

Get Title.

Returns
string Title

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

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

Referenced by getContent().

+ Here is the caller graph for this function:

◆ getTree()

ilHierarchyFormGUI::getTree ( )

Get Tree Object.

Returns
object Tree Object

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

127 {
128 return $this->tree;
129 }

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

+ Here is the caller graph for this function:

◆ getTypeWhiteList()

ilHierarchyFormGUI::getTypeWhiteList ( )

Get type whitelist.

Returns
array white list of types

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

480 {
481 return $this->white_list;
482 }

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

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

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

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

297 {
298 if ($a_first_child_drop_area == true) { // first child drop areas only insert as subitems
299 $a_as_subitem = true;
300 }
301
302 if ($a_id != "") {
303 if ($a_first_child_drop_area) {
304 $a_id .= "fc";
305 }
306
307 $this->drag_target[] = array("id" => $a_id, "group" => $a_group);
308 $this->diss_menues[$a_id][$a_group][] = array("subitem" => $a_as_subitem, "text" => $a_diss_text);
309 }
310 }

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

+ 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

Reimplemented in ilChapterHierarchyFormGUI, and ilSCORM2004OrganizationHFormGUI.

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

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

Referenced by getLevelHTML(), and renderChild().

+ Here is the caller graph for this function:

◆ nodeAllowsChilds()

ilHierarchyFormGUI::nodeAllowsChilds (   $a_node)

Checks, whether current nodes allows childs at all.

Should be overwritten.

Reimplemented in ilChapterHierarchyFormGUI, and ilSCORM2004OrganizationHFormGUI.

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

1065 {
1066 return true;
1067 }

Referenced by getLevelHTML().

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

824 {
825 $ilCtrl = $this->ctrl;
826
827 // image
828 $a_tpl->setCurrentBlock("img");
829 $a_tpl->setVariable("IMGPATH", $this->getChildIcon($a_child));
830 $a_tpl->setVariable("IMGALT", $this->getChildIconAlt($a_child));
831 $a_tpl->setVariable("IMG_NODE", $a_child["node_id"]);
832 $a_tpl->setVariable("NODE_ID", $a_child["node_id"]);
833 $a_tpl->setVariable("TYPE", $a_child["type"]);
834 $a_tpl->parseCurrentBlock();
835
836 // checkbox
837 $a_tpl->setCurrentBlock("cbox");
838 $a_tpl->setVariable("CNODE_ID", $a_child["node_id"]);
839 $a_tpl->setVariable("CBOX_NAME", $this->getCheckboxName());
840 $a_tpl->parseCurrentBlock();
841
842 // node info
843 if (($info = $this->getChildInfo($a_child)) != "") {
844 $a_tpl->setCurrentBlock("node_info");
845 $a_tpl->setVariable("NODE_INFO", $info);
846 $a_tpl->parseCurrentBlock();
847 }
848
849 // commands of child node
850 $child_commands = $this->getChildCommands($a_child);
851 if (is_array($child_commands)) {
852 foreach ($child_commands as $command) {
853 $a_tpl->setCurrentBlock("node_cmd");
854 $a_tpl->setVariable("HREF_NODE_CMD", $command["link"]);
855 $a_tpl->setVariable("TXT_NODE_CMD", $command["text"]);
856 $a_tpl->parseCurrentBlock();
857 }
858 }
859
860 // title
861 $a_tpl->setCurrentBlock("text");
862 $hl = $this->getHighlightedNodes();
863 if (is_array($hl) && in_array($a_child["node_id"], $hl)) {
864 $a_tpl->setVariable("CLASS", ' class="ilHFormHighlighted" ');
865 }
866 $a_tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($this->getChildTitle($a_child)));
867 $a_tpl->setVariable("TNODE_ID", $a_child["node_id"]);
868 $a_tpl->parseCurrentBlock();
869 $grandchilds = null;
870 $grandchilds_html = $this->getLevelHTML($a_child, $a_depth + 1, $grandchilds);
871
872 // focus
873 if ($this->getFocusId() == $a_child["node_id"]) {
874 $a_tpl->setCurrentBlock("focus");
875 $a_tpl->setVariable("FNODE_ID", $a_child["node_id"]);
876 $a_tpl->parseCurrentBlock();
877 }
878
879 // expander
880 if ($this->getExpandVariable() != "") {
881 $a_tpl->setCurrentBlock("expand_icon");
882 if (!is_null($grandchilds) && count($grandchilds) > 0) {
883 if (!in_array($a_child["node_id"], $this->getExpanded())) {
884 $ilCtrl->setParameter($this->getParentObject(), $this->getExpandVariable(), $a_child["node_id"]);
885 $a_tpl->setVariable("IMG_EXPAND", ilUtil::getImagePath("browser/plus.png"));
886 $a_tpl->setVariable("HREF_NAME", "n" . $a_child["node_id"]);
887 $a_tpl->setVariable(
888 "HREF_EXPAND",
889 $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCommand(), "n" . $a_child["node_id"])
890 );
891 $grandchilds_html = "";
892 } else {
893 $ilCtrl->setParameter($this->getParentObject(), $this->getExpandVariable(), -$a_child["node_id"]);
894 $a_tpl->setVariable("IMG_EXPAND", ilUtil::getImagePath("browser/minus.png"));
895 $a_tpl->setVariable("HREF_NAME", "n" . $a_child["node_id"]);
896 $a_tpl->setVariable(
897 "HREF_EXPAND",
898 $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCommand(), "n" . $a_child["node_id"])
899 );
900 }
901 $ilCtrl->setParameter($this->getParentObject(), $this->getExpandVariable(), "");
902 } else {
903 $a_tpl->setVariable("IMG_EXPAND", ilUtil::getImagePath("spacer.png"));
904 }
905 $a_tpl->parseCurrentBlock();
906 }
907
908 // childs
909 $a_tpl->setCurrentBlock("list_item");
910 $a_tpl->setVariable("CHILDS", $grandchilds_html);
911 $a_tpl->parseCurrentBlock();
912
913 $a_tpl->setCurrentBlock("element");
914 $a_tpl->parseCurrentBlock();
915
916 // drop area after child
917 $a_tpl->setCurrentBlock("drop_area");
918 $a_tpl->setVariable("DNODE_ID", $a_child["node_id"]);
919 $a_tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("spacer.png"));
920 $a_tpl->parseCurrentBlock();
921
922 // manage drag and drop areas
923 $this->manageDragAndDrop($a_child, $a_depth, false, $next_sibling, $grandchilds);
924
925 // drop area menu
926 $menu_items = $this->getMenuItems($a_child, $a_depth, false, $next_sibling, $grandchilds);
927 if (count($menu_items) > 0) {
928 // determine maximum of multi add numbers
929 $max = 1;
930 foreach ($menu_items as $menu_item) {
931 if ($menu_item["multi"] > $max) {
932 $max = $menu_item["multi"];
933 }
934 }
935
936 reset($menu_items);
937 $mcnt = 1;
938 foreach ($menu_items as $menu_item) {
939 if ($menu_item["multi"] > 1) {
940 for ($i = 1; $i <= $menu_item["multi"]; $i++) {
941 $a_tpl->setCurrentBlock("multi_add");
942 $a_tpl->setVariable("MA_NUM", $i);
943 $a_tpl->setVariable("MENU_CMD", $menu_item["cmd"]);
944 if ($menu_item["as_subitem"]) {
945 $a_tpl->setVariable("FC", "1");
946 $a_tpl->setVariable("MCNT", $mcnt . "fc");
947 } else {
948 $a_tpl->setVariable("FC", "0");
949 $a_tpl->setVariable("MCNT", $mcnt);
950 }
951 $a_tpl->setVariable("CMD_NODE", $a_child["node_id"]);
952 $a_tpl->parseCurrentBlock();
953 }
954 }
955
956 // buffer td for lower multis
957 if ($max > $menu_item["multi"]) {
958 $a_tpl->setCurrentBlock("multi_buffer");
959 $a_tpl->setVariable("BUF_SPAN", $max - $menu_item["multi"]);
960 $a_tpl->parseCurrentBlock();
961 }
962
963 $a_tpl->setCurrentBlock("menu_cmd");
964 $a_tpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
965 $a_tpl->setVariable("MENU_CMD", $menu_item["cmd"]);
966 if ($menu_item["as_subitem"]) {
967 $a_tpl->setVariable("FC", "1");
968 $a_tpl->setVariable("MCNT", $mcnt . "fc");
969 } else {
970 $a_tpl->setVariable("FC", "0");
971 $a_tpl->setVariable("MCNT", $mcnt);
972 }
973 $a_tpl->setVariable("CMD_NODE", $a_child["node_id"]);
974 $a_tpl->parseCurrentBlock();
975 $mcnt++;
976 }
977 $a_tpl->setCurrentBlock("drop_area_menu");
978 $a_tpl->setVariable("MNODE_ID", $a_child["node_id"]);
979 $a_tpl->parseCurrentBlock();
980 }
981
982 $a_tpl->setCurrentBlock("element");
983 $a_tpl->parseCurrentBlock();
984 }
getHighlightedNodes()
Get highlighted nodes.
getChildInfo($a_child)
Get child info.
getCheckboxName()
Get Checkbox Name.
getChildIcon($a_item)
Get icon path for an item.
getExpanded()
Get expanded array.
getChildIconAlt($a_item)
Get icon alt text for an item.
getChildCommands($a_item)
Get item commands.
getParentObject()
Get Parent object.
getChildTitle($a_child)
Get child title.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

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

Referenced by getLevelHTML().

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

197 {
198 $this->checkboxname = $a_checkboxname;
199 }

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

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

137 {
138 $this->currenttopnodeid = $a_currenttopnodeid;
139 }

◆ setDragIcon()

ilHierarchyFormGUI::setDragIcon (   $a_dragicon)

Set Drag Icon Path.

Parameters
string$a_dragiconDrag Icon Path

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

217 {
218 $this->dragicon = $a_dragicon;
219 }

◆ setExpanded()

ilHierarchyFormGUI::setExpanded (   $a_val)

Set expanded Array.

Parameters
arrayexpanded array

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

413 {
414 $this->expanded = $a_val;
415 }

Referenced by updateExpanded().

+ Here is the caller graph for this function:

◆ setExpandVariable()

ilHierarchyFormGUI::setExpandVariable (   $a_val)

Set expand variable.

Parameters

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

393 {
394 $this->expand_variable = $a_val;
395 }

Referenced by ilSCORM2004OrganizationHFormGUI\__construct().

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

257 {
258 $this->exp_frame = $a_exp_frame;
259 $this->exp_id = $a_exp_id;
260 $this->exp_target_script = $a_exp_target_script;
261 }

◆ setFocusId()

ilHierarchyFormGUI::setFocusId (   $a_val)

Set focus if.

Parameters
intnode id

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

373 {
374 $this->focus_id = $a_val;
375 }

◆ setHighlightedNodes()

ilHierarchyFormGUI::setHighlightedNodes (   $a_val)

Set highlighted nodes.

Parameters
arrayhighlighted nodes

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

353 {
354 $this->highlighted_nodes = $a_val;
355 }

◆ setIcon()

ilHierarchyFormGUI::setIcon (   $a_icon)

Set Icon.

Parameters
string$a_iconIcon

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

177 {
178 $this->icon = $a_icon;
179 }

◆ setId()

ilHierarchyFormGUI::setId (   $a_id)

Set Id.

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

Parameters
string$a_idId

Reimplemented from ilFormGUI.

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

97 {
98 die("ilHierarchyFormGUI does currently not support multiple forms (multiple IDs). ID is always hform.");
99 }

◆ setMaxDepth()

ilHierarchyFormGUI::setMaxDepth (   $a_maxdepth)

Set Maximum Depth.

Parameters
int$a_maxdepthMaximum Depth

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

237 {
238 $this->maxdepth = $a_maxdepth;
239 }

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

66 {
67 $this->parent_obj = $a_parent_obj;
68 $this->parent_cmd = $a_parent_cmd;
69 }

◆ setTitle()

ilHierarchyFormGUI::setTitle (   $a_title)

Set Title.

Parameters
string$a_titleTitle

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

157 {
158 $this->title = $a_title;
159 }

◆ setTree()

ilHierarchyFormGUI::setTree (   $a_tree)

Set Tree Object.

Parameters
object$a_treeTree Object

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

117 {
118 $this->tree = $a_tree;
119 }

◆ setTriggeredUpdateCommand()

ilHierarchyFormGUI::setTriggeredUpdateCommand (   $a_triggered_update_command)

Set Explorer Updater.

Parameters
object$a_treeTree Object

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

269 {
270 $this->triggered_update_command = $a_triggered_update_command;
271 }

◆ setTypeWhiteList()

ilHierarchyFormGUI::setTypeWhiteList (   $a_val)

Set type whitelist.

Parameters
array$a_valwhite list of types

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

470 {
471 $this->white_list = $a_val;
472 }

◆ updateExpanded()

ilHierarchyFormGUI::updateExpanded ( )

Update expand information in session.

Parameters
stringnode id

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

433 {
434 $ev = $this->getExpandVariable();
435
436 if ($ev == "") {
437 return;
438 }
439
440 // init empty session
441 if (!is_array($_SESSION[$ev])) {
442 $_SESSION[$ev] = array($this->getTree()->getRootId());
443 }
444
445 if ($_POST["il_hform_expand"] != "") {
446 $node_id = $_POST["il_hform_expand"];
447 }
448 if ($_GET[$ev] != "") {
449 $node_id = $_GET[$ev];
450 }
451
452 // if positive => expand this node
453 if ($node_id > 0 && !in_array($node_id, $_SESSION[$ev])) {
454 array_push($_SESSION[$ev], $node_id);
455 }
456 // if negative => compress this node
457 if ($node_id < 0) {
458 $key = array_keys($_SESSION[$ev], -(int) $node_id);
459 unset($_SESSION[$ev][$key[0]]);
460 }
461 $this->setExpanded($_SESSION[$ev]);
462 }
$_GET["client_id"]
$_SESSION["AccountId"]
setExpanded($a_val)
Set expanded Array.

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

Referenced by getContent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

◆ $lng

◆ $tpl

ilHierarchyFormGUI::$tpl
protected

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

Referenced by __construct().


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