ILIAS  release_8 Revision v8.19
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 ()
 
 setParentCommand (object $a_parent_obj, string $a_parent_cmd)
 
 getParentObject ()
 
 getParentCommand ()
 
 setId (string $a_id)
 
 getId ()
 
 setTree (ilTree $a_tree)
 
 getTree ()
 
 setCurrentTopNodeId (int $a_currenttopnodeid)
 
 getCurrentTopNodeId ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setIcon (string $a_icon)
 
 getIcon ()
 
 setCheckboxName (string $a_checkboxname)
 
 getCheckboxName ()
 
 setDragIcon (string $a_dragicon)
 
 getDragIcon ()
 
 setMaxDepth (int $a_maxdepth)
 
 getMaxDepth ()
 
 setExplorerUpdater (string $a_exp_frame, string $a_exp_id, string $a_exp_target_script)
 
 setTriggeredUpdateCommand (string $a_triggered_update_command)
 
 addHelpItem (string $a_text, string $a_image="")
 
 getHelpItems ()
 
 makeDragTarget (string $a_id, string $a_group, bool $a_first_child_drop_area=false, bool $a_as_subitem=false, string $a_diss_text="")
 
 makeDragContent (string $a_id, string $a_group)
 
 addMultiCommand (string $a_txt, string $a_cmd)
 
 addCommand (string $a_txt, string $a_cmd)
 
 setHighlightedNodes (array $a_val)
 
 getHighlightedNodes ()
 
 setFocusId (string $a_val)
 
 getFocusId ()
 
 setExpandVariable (string $a_val)
 
 getExpandVariable ()
 
 setExpanded (array $a_val)
 
 getExpanded ()
 
 updateExpanded ()
 
 setTypeWhiteList (array $a_val)
 
 getTypeWhiteList ()
 
 getChilds (?int $a_node_id=null)
 Get all childs of current node. More...
 
 getContent ()
 
 getLegend ()
 
 getLevelHTML (array $a_par_node, int $a_depth, array &$a_childs)
 
 renderChild (ilTemplate $a_tpl, array $a_child, int $a_depth, ?array $next_sibling=null)
 Render a single child (including grandchilds) More...
 
 getChildIcon (array $a_item)
 
 getChildIconAlt (array $a_item)
 
 getChildCommands (array $a_item)
 
 getChildTitle (array $a_child)
 
 getChildInfo (array $a_child)
 
 getMenuItems (array $a_node, int $a_depth, bool $a_first_child=false, ?array $a_next_sibling=null, ?array $a_childs=null)
 Get menu items for drop area of node. More...
 
 nodeAllowsChilds (array $a_node)
 Checks, whether current nodes allows childs at all. More...
 
 manageDragAndDrop (array $a_node, int $a_depth, bool $a_first_child=false, ?array $a_next_sibling=null, ?array $a_childs=null)
 Makes nodes drag and drop content and targets. More...
 
 getHTML ()
 
- Public Member Functions inherited from ilFormGUI
 setFormAction (string $a_formaction)
 
 getFormAction ()
 
 setTarget (string $a_target)
 
 getTarget ()
 
 setMultipart (bool $a_multipart)
 
 getMultipart ()
 
 setId (string $a_id)
 
 getId ()
 
 setName (string $a_name)
 
 getName ()
 
 setKeepOpen (bool $a_keepopen)
 
 getKeepOpen ()
 
 setOpenTag (bool $a_open)
 
 getOpenTag ()
 
 setCloseTag (bool $a_val)
 
 getCloseTag ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 getHTML ()
 
 getContent ()
 

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

Protected Member Functions

 str ($key)
 

Static Protected Member Functions

static _str ($key)
 

Protected Attributes

ilGlobalTemplateInterface $main_tpl
 
string $exp_target_script = ""
 
string $icon = ""
 
string $exp_id = ""
 
ilLanguage $lng
 
ilCtrl $ctrl
 
string $expand_variable = ""
 
array $white_list = null
 
array $highlighted_nodes = []
 
string $focus_id = ""
 
string $exp_frame = ""
 
string $triggered_update_command = ""
 
array $drag_target = []
 
array $drag_content = []
 
object $parent_obj
 
string $parent_cmd = ""
 
ilTree $tree
 
int $currenttopnodeid = 0
 
string $title = ""
 
string $checkboxname = ""
 
string $dragicon = ""
 
int $maxdepth = 0
 
array $help_items = []
 
array $diss_menues = []
 
array $multi_commands = []
 
array $commands = []
 
array $expanded = []
 
HTTP Services $http
 
Refinery Factory $refinery
 
- Protected Attributes inherited from ilFormGUI
string $formaction = ""
 
bool $multipart = false
 
bool $keepopen = false
 
bool $opentag = true
 
string $id = ''
 
string $name = ''
 
string $target = ''
 
bool $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
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilHierarchyFormGUI::__construct ( )

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

References $DIC, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ilYuiUtil\initDragDrop(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\refinery(), and setCheckboxName().

64  {
65  global $DIC;
66 
67  $this->lng = $DIC->language();
68  $this->ctrl = $DIC->ctrl();
69  $lng = $DIC->language();
70  $this->main_tpl = $DIC->ui()->mainTemplate();
71 
72  $this->maxdepth = -1;
73  $this->multi_commands = array();
74  $this->commands = array();
75  $this->drag_target[] = array();
76  $this->drag_content[] = array();
77  $lng->loadLanguageModule("form");
78  $this->setCheckboxName("cbox");
79  $this->help_items = array();
80 
82  $this->main_tpl->addJavascript("./Services/Form/js/ServiceFormHierarchyForm.js");
83 
84 
85  $this->http = $DIC->http();
86  $this->refinery = $DIC->refinery();
87  }
setCheckboxName(string $a_checkboxname)
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
static initDragDrop(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Drag and Drop used in Modules/Survey, Services/Calendar, Services/COPage, Services/Form (Jan 2022)
+ Here is the call graph for this function:

Member Function Documentation

◆ _str()

static ilHierarchyFormGUI::_str (   $key)
staticprotected

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

References $DIC, ILIAS\LTI\ToolProvider\$key, and ilUtil\stripSlashes().

312  : string
313  {
314  global $DIC;
315 
316  $w = $DIC->http()->wrapper();
317  $t = $DIC->refinery()->kindlyTo()->string();
318 
319  if (!$w->post()->has($key) && !$w->query()->has($key)) {
320  return "";
321  }
322 
323  $val = (string) ($w->post()->retrieve($key, $t) ?? "");
324 
325  if ($val == "") {
326  $val = (string) ($w->query()->retrieve($key, $t) ?? "");
327  }
328  return ilUtil::stripSlashes($val);
329  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
global $DIC
Definition: feed.php:28
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ addCommand()

ilHierarchyFormGUI::addCommand ( string  $a_txt,
string  $a_cmd 
)

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

262  : void {
263  $this->commands[] = array("text" => $a_txt, "cmd" => $a_cmd);
264  }

◆ addHelpItem()

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

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

209  : void {
210  $this->help_items[] = array("text" => $a_text,
211  "image" => $a_image);
212  }

◆ addMultiCommand()

ilHierarchyFormGUI::addMultiCommand ( string  $a_txt,
string  $a_cmd 
)

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

255  : void {
256  $this->multi_commands[] = array("text" => $a_txt, "cmd" => $a_cmd);
257  }

◆ getCheckboxName()

ilHierarchyFormGUI::getCheckboxName ( )

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

References $checkboxname.

Referenced by renderChild().

165  : string
166  {
167  return $this->checkboxname;
168  }
+ Here is the caller graph for this function:

◆ getChildCommands()

ilHierarchyFormGUI::getChildCommands ( array  $a_item)

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

Referenced by renderChild().

871  : array
872  {
873  return [];
874  }
+ Here is the caller graph for this function:

◆ getChildIcon()

ilHierarchyFormGUI::getChildIcon ( array  $a_item)

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

References ilUtil\getImagePath().

Referenced by renderChild().

859  : string
860  {
861  return ilUtil::getImagePath("icon_" . $a_item["type"] . ".svg");
862  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $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 ( array  $a_item)

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

References $lng, and ilLanguage\txt().

Referenced by renderChild().

864  : string
865  {
866  $lng = $this->lng;
867 
868  return $lng->txt($a_item["type"]);
869  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChildInfo()

ilHierarchyFormGUI::getChildInfo ( array  $a_child)

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

Referenced by renderChild().

881  : string
882  {
883  return "";
884  }
+ Here is the caller graph for this function:

◆ getChilds()

ilHierarchyFormGUI::getChilds ( ?int  $a_node_id = null)

Get all childs of current node.

Standard implementation uses tree object.

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

References getCurrentTopNodeId(), and getTree().

Referenced by getLevelHTML().

382  : array
383  {
384  if ($a_node_id == null) {
385  $a_node_id = $this->getCurrentTopNodeId();
386  }
387 
388  $tree_childs = $this->getTree()->getChilds($a_node_id);
389  $childs = array();
390  foreach ($tree_childs as $tree_child) {
391  if (!isset($this->white_list) || !is_array($this->white_list) || in_array($tree_child["type"], $this->white_list)) {
392  $childs[] = array("node_id" => $tree_child["child"],
393  "title" => $tree_child["title"],
394  "type" => $tree_child["type"],
395  "depth" => $tree_child["depth"]
396  );
397  }
398  }
399 
400  return $childs;
401  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChildTitle()

ilHierarchyFormGUI::getChildTitle ( array  $a_child)

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

Referenced by renderChild().

876  : string
877  {
878  return $a_child["title"];
879  }
+ Here is the caller graph for this function:

◆ getContent()

ilHierarchyFormGUI::getContent ( )

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

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

403  : string
404  {
405  $lng = $this->lng;
406  $single = false;
407  $multi = false;
408 
409  if ($this->getExpandVariable() != "") {
410  $this->updateExpanded();
411  }
412 
413  $ttpl = new ilTemplate("tpl.hierarchy_form.html", true, true, "Services/Form");
414  $ttpl->setVariable("TXT_SAVING", $lng->txt("saving"));
415  $top_node_data = $this->getTree()->getNodeData($this->getCurrentTopNodeId());
416  $top_node = array("node_id" => $top_node_data["child"] ?? 0,
417  "title" => $top_node_data["title"] ?? "",
418  "type" => $top_node_data["type"] ?? "");
419 
420  $childs = [];
421  $nodes_html = $this->getLevelHTML($top_node, 0, $childs);
422 
423 
424  // commands
425  $secs = array("1", "2");
426  foreach ($secs as $sec) {
427  reset($this->commands);
428  reset($this->multi_commands);
429  if (count($this->multi_commands) > 0 || count($this->commands) > 0) {
430  if (count($childs) > 0) {
431  $single = false;
432  foreach ($this->commands as $cmd) {
433  $ttpl->setCurrentBlock("cmd" . $sec);
434  $ttpl->setVariable("CMD", $cmd["cmd"]);
435  $ttpl->setVariable("CMD_TXT", $cmd["text"]);
436  $ttpl->parseCurrentBlock();
437  $single = true;
438  }
439 
440  $multi = false;
441  foreach ($this->multi_commands as $cmd) {
442  $ttpl->setCurrentBlock("multi_cmd" . $sec);
443  $ttpl->setVariable("MULTI_CMD", $cmd["cmd"]);
444  $ttpl->setVariable("MULTI_CMD_TXT", $cmd["text"]);
445  $ttpl->parseCurrentBlock();
446  $multi = true;
447  }
448  if ($multi) {
449  $ttpl->setCurrentBlock("multi_cmds" . $sec);
450  $ttpl->setVariable("MCMD_ALT", $lng->txt("commands"));
451  if ($sec == "1") {
452  $ttpl->setVariable("MCMD_IMG", ilUtil::getImagePath("arrow_downright.svg"));
453  } else {
454  $ttpl->setVariable("MCMD_IMG", ilUtil::getImagePath("arrow_upright.svg"));
455  }
456  $ttpl->parseCurrentBlock();
457  }
458  }
459 
460  if ($single || $multi) {
461  $ttpl->setCurrentBlock("commands" . $sec);
462  $ttpl->parseCurrentBlock();
463  }
464  $single = true;
465  }
466  }
467 
468  // explorer updater
469  /*
470  if ($this->exp_frame != "") {
471  $ttpl->setCurrentBlock("updater");
472  $ttpl->setVariable("UPDATER_FRAME", $this->exp_frame);
473  $ttpl->setVariable("EXP_ID_UPDATER", $this->exp_id);
474  $ttpl->setVariable("HREF_UPDATER", $this->exp_target_script);
475  $ttpl->parseCurrentBlock();
476  }*/
477 
478  // drag and drop initialisation
479  foreach ($this->drag_target as $drag_target) {
480  $this->main_tpl->addOnLoadCode('d = new ilDragTarget("droparea_" + "'.($drag_target["id"] ?? "").
481  '", "'.($drag_target["group"] ?? "").'");');
482  }
483  foreach ($this->drag_content as $drag_content) {
484  $this->main_tpl->addOnLoadCode('d = new ilDragContent("il_img_" + "'.($drag_content["id"] ?? "").
485  '", "'.($drag_content["group"] ?? "").'");');
486  }
487 
488  // disambiguation menues and "insert as first child" flags
489  if (is_array($this->diss_menues)) {
490  foreach ($this->diss_menues as $node_id => $d_menu) {
491  foreach ($d_menu as $group => $menu) {
492  if (count($menu) > 1) {
493  foreach ($menu as $menu_item) {
494  $ttpl->setCurrentBlock("dmenu_cmd");
495  $ttpl->setVariable("SUBITEM", (int) $menu_item["subitem"]);
496  $ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
497  $ttpl->parseCurrentBlock();
498  }
499 
500  $ttpl->setCurrentBlock("disambiguation_menu");
501  $ttpl->setVariable("DNODE_ID", $node_id);
502  $ttpl->setVariable("GRP", $group);
503  $ttpl->parseCurrentBlock();
504  } elseif (count($menu) == 1) {
505  // set first child flag
506  $this->main_tpl->addOnLoadCode('as_subitem["'.$node_id.'" + "_" + "'.$group.'"] = "'.(int) $menu[0]["subitem"].'";');
507  }
508  }
509  }
510  }
511 // $this->diss_menues[$a_id][$a_group][] = array("type" => $a_type, "text" => $a_diss_text);
512 
513 
514  if ($this->triggered_update_command != "") {
515  $ttpl->setCurrentBlock("tr_update");
516  $ttpl->setVariable("UPDATE_CMD", $this->triggered_update_command);
517  $ttpl->parseCurrentBlock();
518  }
519 
520  // disambiguation menues and "insert as first child" flags
521  if (is_array($this->diss_menues)) {
522  foreach ($this->diss_menues as $node_id => $d_menu) {
523  foreach ($d_menu as $group => $menu) {
524  if (count($menu) > 1) {
525  foreach ($menu as $menu_item) {
526  $ttpl->setCurrentBlock("dmenu_cmd");
527  $ttpl->setVariable("SUBITEM", (int) $menu_item["subitem"]);
528  $ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
529  $ttpl->parseCurrentBlock();
530  }
531 
532  $ttpl->setCurrentBlock("disambiguation_menu");
533  $ttpl->setVariable("DNODE_ID", $node_id);
534  $ttpl->setVariable("GRP", $group);
535  $ttpl->parseCurrentBlock();
536  } elseif (count($menu) == 1) {
537  // set first child flag
538  $this->main_tpl->addOnLoadCode('as_subitem["'.$node_id.'" + "_" + "'.$group.'"] = "'.(int) $menu[0]["subitem"].'";');
539  }
540  }
541  }
542  }
543  //$this->diss_menues[$a_id][$a_group][] = array("type" => $a_type, "text" => $a_diss_text);
544 
545  // nodes
546  $ttpl->setVariable("NODES", $nodes_html);
547 
548  // title
549  //echo "<br>".htmlentities($this->getTitle())." --- ".htmlentities(ilUtil::prepareFormOutput($this->getTitle()));
550  $ttpl->setVariable("TITLE", $this->getTitle());
551 
552 
553  return $ttpl->get();
554  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getLevelHTML(array $a_par_node, int $a_depth, array &$a_childs)
+ Here is the call graph for this function:

◆ getCurrentTopNodeId()

ilHierarchyFormGUI::getCurrentTopNodeId ( )

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

References $currenttopnodeid.

Referenced by getChilds(), and getContent().

135  : int
136  {
138  }
+ Here is the caller graph for this function:

◆ getDragIcon()

ilHierarchyFormGUI::getDragIcon ( )

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

References $dragicon.

Referenced by getLegend().

175  : string
176  {
177  return $this->dragicon;
178  }
+ Here is the caller graph for this function:

◆ getExpanded()

ilHierarchyFormGUI::getExpanded ( )

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

References $expanded.

Referenced by renderChild().

302  : array
303  {
304  return $this->expanded;
305  }
+ Here is the caller graph for this function:

◆ getExpandVariable()

ilHierarchyFormGUI::getExpandVariable ( )

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

References $expand_variable.

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

292  : string
293  {
294  return $this->expand_variable;
295  }
+ Here is the caller graph for this function:

◆ getFocusId()

ilHierarchyFormGUI::getFocusId ( )

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

References $focus_id.

Referenced by renderChild().

282  : string
283  {
284  return $this->focus_id;
285  }
+ Here is the caller graph for this function:

◆ getHelpItems()

ilHierarchyFormGUI::getHelpItems ( )

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

References $help_items.

Referenced by getLegend().

214  : array
215  {
216  return $this->help_items;
217  }
+ Here is the caller graph for this function:

◆ getHighlightedNodes()

ilHierarchyFormGUI::getHighlightedNodes ( )

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

References $highlighted_nodes.

Referenced by renderChild().

272  : array
273  {
275  }
+ Here is the caller graph for this function:

◆ getHTML()

ilHierarchyFormGUI::getHTML ( )

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

References getLegend().

955  : string
956  {
957  return parent::getHTML() . $this->getLegend();
958  }
+ Here is the call graph for this function:

◆ getIcon()

ilHierarchyFormGUI::getIcon ( )

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

References $icon.

155  : string
156  {
157  return $this->icon;
158  }

◆ getId()

ilHierarchyFormGUI::getId ( )

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

115  : string
116  {
117  return "hform";
118  }

◆ getLegend()

ilHierarchyFormGUI::getLegend ( )

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

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

Referenced by getHTML().

556  : string
557  {
558  $lng = $this->lng;
559 
560  $ttpl = new ilTemplate("tpl.hierarchy_form_legend.html", true, true, "Services/Form");
561  if ($this->getDragIcon() != "") {
562  $ttpl->setCurrentBlock("help_drag");
563  $ttpl->setVariable("IMG_DRAG", $this->getDragIcon());
564  $ttpl->setVariable(
565  "DRAG_ARROW",
567  );
568  $ttpl->setVariable(
569  "TXT_DRAG",
570  $lng->txt("form_hierarchy_drag_drop_help")
571  );
572  $ttpl->setVariable("PLUS", ilGlyphGUI::get(ilGlyphGUI::ADD));
573  $ttpl->parseCurrentBlock();
574  }
575 
576  // additional help items
577  foreach ($this->getHelpItems() as $help) {
578  if ($help["image"] != "") {
579  $ttpl->setCurrentBlock("help_img");
580  $ttpl->setVariable("IMG_HELP", $help["image"]);
581  $ttpl->parseCurrentBlock();
582  }
583  $ttpl->setCurrentBlock("help_item");
584  $ttpl->setVariable("TXT_HELP", $help["text"]);
585  $ttpl->parseCurrentBlock();
586  }
587 
588  $ttpl->setVariable(
589  "TXT_ADD_EL",
590  $lng->txt("form_hierarchy_add_elements")
591  );
592  $ttpl->setVariable("PLUS2", ilGlyphGUI::get(ilGlyphGUI::ADD));
593 
594  return $ttpl->get();
595  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static get(string $a_glyph, string $a_text="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLevelHTML()

ilHierarchyFormGUI::getLevelHTML ( array  $a_par_node,
int  $a_depth,
array &  $a_childs 
)

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

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

Referenced by getContent(), and renderChild().

601  : string {
602  $lng = $this->lng;
603 
604  if ($this->getMaxDepth() > -1 && $this->getMaxDepth() < $a_depth) {
605  return "";
606  }
607 
608  $childs = $this->getChilds((int) $a_par_node["node_id"]);
609  $a_childs = $childs;
610  $ttpl = new ilTemplate("tpl.hierarchy_form_nodes.html", true, true, "Services/Form");
611 
612  // prepended drop area
613  if ($this->nodeAllowsChilds($a_par_node) && (count($childs) > 0 || $a_depth == 0)) {
614  $ttpl->setCurrentBlock("drop_area");
615  $ttpl->setVariable("DNODE_ID", $a_par_node["node_id"] . "fc"); // fc means "first child"
616  $ttpl->setVariable("IMG_BLANK", ilUtil::getImagePath("spacer.png"));
617  if (count($childs) == 0) {
618  $ttpl->setVariable("NO_CONTENT_CLASS", "ilCOPGNoPageContent");
619  $ttpl->setVariable("NO_CONTENT_TXT", " &nbsp;" . $lng->txt("form_hier_click_to_add"));
620  }
621  $ttpl->parseCurrentBlock();
622 
623  $this->manageDragAndDrop($a_par_node, $a_depth, true, null, $childs);
624  $menu_items = $this->getMenuItems($a_par_node, $a_depth, true, null, $childs);
625  //var_dump($menu_items);
626  if (count($menu_items) > 0) {
627  // determine maximum of multi add numbers
628  $max = 1;
629  foreach ($menu_items as $menu_item) {
630  if ($menu_item["multi"] > $max) {
631  $max = $menu_item["multi"];
632  }
633  }
634 
635  reset($menu_items);
636  $mcnt = 1;
637  foreach ($menu_items as $menu_item) {
638  if ($menu_item["multi"] > 1) {
639  for ($i = 1; $i <= $menu_item["multi"]; $i++) {
640  $ttpl->setCurrentBlock("multi_add");
641  $ttpl->setVariable("MA_NUM", $i);
642  $ttpl->setVariable("MENU_CMD", $menu_item["cmd"]);
643  $ttpl->setVariable("FC", "1");
644  $ttpl->setVariable("CMD_NODE", $a_par_node["node_id"]);
645  $ttpl->setVariable("MCNT", $mcnt . "fc");
646  $ttpl->parseCurrentBlock();
647  }
648  }
649 
650  // buffer td for lower multis
651  if ($max > $menu_item["multi"]) {
652  $ttpl->setCurrentBlock("multi_buffer");
653  $ttpl->setVariable("BUF_SPAN", $max - $menu_item["multi"]);
654  $ttpl->parseCurrentBlock();
655  }
656  $ttpl->setCurrentBlock("menu_cmd");
657  $ttpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
658  $ttpl->setVariable("MENU_CMD", $menu_item["cmd"]);
659  $ttpl->setVariable("CMD_NODE", $a_par_node["node_id"]);
660  $ttpl->setVariable("FC", "1");
661  $ttpl->setVariable("MCNT", $mcnt . "fc");
662  $ttpl->parseCurrentBlock();
663  $mcnt++;
664  }
665  $ttpl->setCurrentBlock("drop_area_menu");
666  $ttpl->setVariable("MNODE_ID", $a_par_node["node_id"] . "fc");
667  $ttpl->parseCurrentBlock();
668 
669  $ttpl->setCurrentBlock("element");
670  $ttpl->parseCurrentBlock();
671  }
672  }
673 
674  // insert childs
675  if (count($childs) > 0) {
676  for ($i = 0, $iMax = count($childs); $i < $iMax; $i++) {
677  $next_sibling = ($i < (count($childs) - 1))
678  ? $childs[$i + 1]
679  : null;
680 
681  $this->renderChild($ttpl, $childs[$i], $a_depth, $next_sibling);
682  }
683  }
684 
685  $html = $ttpl->get();
686  unset($ttpl);
687 
688  return $html;
689  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
manageDragAndDrop(array $a_node, int $a_depth, bool $a_first_child=false, ?array $a_next_sibling=null, ?array $a_childs=null)
Makes nodes drag and drop content and targets.
renderChild(ilTemplate $a_tpl, array $a_child, int $a_depth, ?array $next_sibling=null)
Render a single child (including grandchilds)
getMenuItems(array $a_node, int $a_depth, bool $a_first_child=false, ?array $a_next_sibling=null, ?array $a_childs=null)
Get menu items for drop area of node.
getChilds(?int $a_node_id=null)
Get all childs of current node.
nodeAllowsChilds(array $a_node)
Checks, whether current nodes allows childs at all.
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMaxDepth()

ilHierarchyFormGUI::getMaxDepth ( )

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

References $maxdepth.

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

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

◆ getMenuItems()

ilHierarchyFormGUI::getMenuItems ( array  $a_node,
int  $a_depth,
bool  $a_first_child = false,
?array  $a_next_sibling = null,
?array  $a_childs = null 
)

Get menu items for drop area of node.

This function will be most likely overwritten by sub class

Parameters
array$a_nodenode array ("title", "node_id", "type")
bool$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 896 of file class.ilHierarchyFormGUI.php.

Referenced by getLevelHTML(), and renderChild().

902  : array {
903  return array();
904  }
+ Here is the caller graph for this function:

◆ getParentCommand()

ilHierarchyFormGUI::getParentCommand ( )

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

References $parent_cmd.

Referenced by renderChild().

102  : string
103  {
104  return $this->parent_cmd;
105  }
+ Here is the caller graph for this function:

◆ getParentObject()

ilHierarchyFormGUI::getParentObject ( )

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

References $parent_obj.

Referenced by renderChild().

97  : object
98  {
99  return $this->parent_obj;
100  }
+ Here is the caller graph for this function:

◆ getPostFields()

static ilHierarchyFormGUI::getPostFields ( )
static

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

960  : array
961  {
962  return array(
963  "il_hform_node" => self::_str("il_hform_node"),
964  "il_hform_fc" => self::_str("il_hform_fc"),
965  "il_hform_as_subitem" => self::_str("il_hform_as_subitem"),
966  "il_hform_multi" => self::_str("il_hform_multi"),
967  "il_hform_source_id" => self::_str("il_hform_source_id"),
968  "il_hform_target_id" => self::_str("il_hform_target_id")
969  );
970  }

◆ getPostFirstChild()

static ilHierarchyFormGUI::getPostFirstChild ( )
static

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

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

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

950  : bool
951  {
952  return ((int) self::_str("il_hform_fc") == 1);
953  }
+ Here is the caller graph for this function:

◆ getPostMulti()

static ilHierarchyFormGUI::getPostMulti ( )
static

Get multi number of _POST input.

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

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

934  : int
935  {
936  return max(1, (int) self::_str("il_hform_multi"));
937  }
+ Here is the caller graph for this function:

◆ getPostNodeId()

static ilHierarchyFormGUI::getPostNodeId ( )
static

Get node ID of _POST input.

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

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

942  : string
943  {
944  return self::_str("il_hform_node");
945  }
+ Here is the caller graph for this function:

◆ getTitle()

ilHierarchyFormGUI::getTitle ( )

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

References $title.

Referenced by getContent().

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

◆ getTree()

ilHierarchyFormGUI::getTree ( )

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

References $tree.

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

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

◆ getTypeWhiteList()

ilHierarchyFormGUI::getTypeWhiteList ( )

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

References $white_list.

373  : array
374  {
375  return $this->white_list;
376  }

◆ makeDragContent()

ilHierarchyFormGUI::makeDragContent ( string  $a_id,
string  $a_group 
)

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

Referenced by ilChapterHierarchyFormGUI\manageDragAndDrop().

245  : void {
246  if ($a_id != "") {
247  $this->drag_content[] = array("id" => $a_id, "group" => $a_group);
248  }
249  }
+ Here is the caller graph for this function:

◆ makeDragTarget()

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

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

Referenced by ilChapterHierarchyFormGUI\manageDragAndDrop().

226  : void {
227  if ($a_first_child_drop_area == true) { // first child drop areas only insert as subitems
228  $a_as_subitem = true;
229  }
230 
231  if ($a_id != "") {
232  if ($a_first_child_drop_area) {
233  $a_id .= "fc";
234  }
235 
236  $this->drag_target[] = array("id" => $a_id, "group" => $a_group);
237  $this->diss_menues[$a_id][$a_group][] = array("subitem" => $a_as_subitem, "text" => $a_diss_text);
238  }
239  }
+ Here is the caller graph for this function:

◆ manageDragAndDrop()

ilHierarchyFormGUI::manageDragAndDrop ( array  $a_node,
int  $a_depth,
bool  $a_first_child = false,
?array  $a_next_sibling = null,
?array  $a_childs = null 
)

Makes nodes drag and drop content and targets.

Must be overwritten to support drag and drop.

Parameters
array$a_nodenode array

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

Referenced by getLevelHTML(), and renderChild().

926  : void {
927  //$this->makeDragTarget($a_node["id"], $a_group);
928  //$this->makeDragTarget($a_node["id"], $a_group);
929  }
+ Here is the caller graph for this function:

◆ nodeAllowsChilds()

ilHierarchyFormGUI::nodeAllowsChilds ( array  $a_node)

Checks, whether current nodes allows childs at all.

Should be overwritten.

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

Referenced by getLevelHTML().

910  : bool
911  {
912  return true;
913  }
+ Here is the caller graph for this function:

◆ renderChild()

ilHierarchyFormGUI::renderChild ( ilTemplate  $a_tpl,
array  $a_child,
int  $a_depth,
?array  $next_sibling = null 
)

Render a single child (including grandchilds)

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

References $ctrl, $i, getCheckboxName(), getChildCommands(), getChildIcon(), getChildIconAlt(), getChildInfo(), getChildTitle(), getExpanded(), getExpandVariable(), getFocusId(), getHighlightedNodes(), ilUtil\getImagePath(), getLevelHTML(), getMenuItems(), getParentCommand(), getParentObject(), manageDragAndDrop(), ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by getLevelHTML().

699  {
700  $ilCtrl = $this->ctrl;
701 
702  // image
703  $a_tpl->setCurrentBlock("img");
704  $a_tpl->setVariable("IMGPATH", $this->getChildIcon($a_child));
705  $a_tpl->setVariable("IMGALT", $this->getChildIconAlt($a_child));
706  $a_tpl->setVariable("IMG_NODE", $a_child["node_id"]);
707  $a_tpl->setVariable("NODE_ID", $a_child["node_id"]);
708  $a_tpl->setVariable("TYPE", $a_child["type"]);
709  $a_tpl->parseCurrentBlock();
710 
711  // checkbox
712  $a_tpl->setCurrentBlock("cbox");
713  $a_tpl->setVariable("CNODE_ID", $a_child["node_id"]);
714  $a_tpl->setVariable("CBOX_NAME", $this->getCheckboxName());
715  $a_tpl->parseCurrentBlock();
716 
717  // node info
718  if (($info = $this->getChildInfo($a_child)) != "") {
719  $a_tpl->setCurrentBlock("node_info");
720  $a_tpl->setVariable("NODE_INFO", $info);
721  $a_tpl->parseCurrentBlock();
722  }
723 
724  // commands of child node
725  $child_commands = $this->getChildCommands($a_child);
726  if (is_array($child_commands)) {
727  foreach ($child_commands as $command) {
728  $a_tpl->setCurrentBlock("node_cmd");
729  $a_tpl->setVariable("HREF_NODE_CMD", $command["link"]);
730  $a_tpl->setVariable("TXT_NODE_CMD", $command["text"]);
731  $a_tpl->parseCurrentBlock();
732  }
733  }
734 
735  // title
736  $a_tpl->setCurrentBlock("text");
737  $hl = $this->getHighlightedNodes();
738  if (is_array($hl) && in_array($a_child["node_id"], $hl)) {
739  $a_tpl->setVariable("CLASS", ' class="ilHFormHighlighted" ');
740  }
741  $a_tpl->setVariable("VAL_TITLE", ilLegacyFormElementsUtil::prepareFormOutput($this->getChildTitle($a_child)));
742  $a_tpl->setVariable("TNODE_ID", $a_child["node_id"]);
743  $a_tpl->parseCurrentBlock();
744  $grandchilds = [];
745  $grandchilds_html = $this->getLevelHTML($a_child, $a_depth + 1, $grandchilds);
746 
747  // focus
748  if ($this->getFocusId() == $a_child["node_id"]) {
749  $this->main_tpl->addOnLoadCode('document.getElementById("inp'.$a_child["node_id"].'").focus();');
750  }
751 
752  // expander
753  if ($this->getExpandVariable() != "") {
754  $a_tpl->setCurrentBlock("expand_icon");
755  if (!is_null($grandchilds) && count($grandchilds) > 0) {
756  if (!in_array($a_child["node_id"], $this->getExpanded())) {
757  $ilCtrl->setParameter($this->getParentObject(), $this->getExpandVariable(), $a_child["node_id"]);
758  $a_tpl->setVariable("IMG_EXPAND", ilUtil::getImagePath("browser/plus.png"));
759  $a_tpl->setVariable("HREF_NAME", "n" . $a_child["node_id"]);
760  $a_tpl->setVariable(
761  "HREF_EXPAND",
762  $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCommand(), "n" . $a_child["node_id"])
763  );
764  $grandchilds_html = "";
765  } else {
766  $ilCtrl->setParameter($this->getParentObject(), $this->getExpandVariable(), -$a_child["node_id"]);
767  $a_tpl->setVariable("IMG_EXPAND", ilUtil::getImagePath("browser/minus.png"));
768  $a_tpl->setVariable("HREF_NAME", "n" . $a_child["node_id"]);
769  $a_tpl->setVariable(
770  "HREF_EXPAND",
771  $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCommand(), "n" . $a_child["node_id"])
772  );
773  }
774  $ilCtrl->setParameter($this->getParentObject(), $this->getExpandVariable(), "");
775  } else {
776  $a_tpl->setVariable("IMG_EXPAND", ilUtil::getImagePath("spacer.png"));
777  }
778  $a_tpl->parseCurrentBlock();
779  }
780 
781  // childs
782  $a_tpl->setCurrentBlock("list_item");
783  $a_tpl->setVariable("CHILDS", $grandchilds_html);
784  $a_tpl->parseCurrentBlock();
785 
786  $a_tpl->setCurrentBlock("element");
787  $a_tpl->parseCurrentBlock();
788 
789  // drop area after child
790  $a_tpl->setCurrentBlock("drop_area");
791  $a_tpl->setVariable("DNODE_ID", $a_child["node_id"]);
792  $a_tpl->setVariable("IMG_BLANK", ilUtil::getImagePath("spacer.png"));
793  $a_tpl->parseCurrentBlock();
794 
795  // manage drag and drop areas
796  $this->manageDragAndDrop($a_child, $a_depth, false, $next_sibling, $grandchilds);
797 
798  // drop area menu
799  $menu_items = $this->getMenuItems($a_child, $a_depth, false, $next_sibling, $grandchilds);
800  if (count($menu_items) > 0) {
801  // determine maximum of multi add numbers
802  $max = 1;
803  foreach ($menu_items as $menu_item) {
804  if ($menu_item["multi"] > $max) {
805  $max = $menu_item["multi"];
806  }
807  }
808 
809  reset($menu_items);
810  $mcnt = 1;
811  foreach ($menu_items as $menu_item) {
812  if ($menu_item["multi"] > 1) {
813  for ($i = 1; $i <= $menu_item["multi"]; $i++) {
814  $a_tpl->setCurrentBlock("multi_add");
815  $a_tpl->setVariable("MA_NUM", $i);
816  $a_tpl->setVariable("MENU_CMD", $menu_item["cmd"]);
817  if ($menu_item["as_subitem"] ?? false) {
818  $a_tpl->setVariable("FC", "1");
819  $a_tpl->setVariable("MCNT", $mcnt . "fc");
820  } else {
821  $a_tpl->setVariable("FC", "0");
822  $a_tpl->setVariable("MCNT", $mcnt);
823  }
824  $a_tpl->setVariable("CMD_NODE", $a_child["node_id"]);
825  $a_tpl->parseCurrentBlock();
826  }
827  }
828 
829  // buffer td for lower multis
830  if ($max > $menu_item["multi"]) {
831  $a_tpl->setCurrentBlock("multi_buffer");
832  $a_tpl->setVariable("BUF_SPAN", $max - $menu_item["multi"]);
833  $a_tpl->parseCurrentBlock();
834  }
835 
836  $a_tpl->setCurrentBlock("menu_cmd");
837  $a_tpl->setVariable("TXT_MENU_CMD", $menu_item["text"]);
838  $a_tpl->setVariable("MENU_CMD", $menu_item["cmd"]);
839  if ($menu_item["as_subitem"] ?? false) {
840  $a_tpl->setVariable("FC", "1");
841  $a_tpl->setVariable("MCNT", $mcnt . "fc");
842  } else {
843  $a_tpl->setVariable("FC", "0");
844  $a_tpl->setVariable("MCNT", $mcnt);
845  }
846  $a_tpl->setVariable("CMD_NODE", $a_child["node_id"]);
847  $a_tpl->parseCurrentBlock();
848  $mcnt++;
849  }
850  $a_tpl->setCurrentBlock("drop_area_menu");
851  $a_tpl->setVariable("MNODE_ID", $a_child["node_id"]);
852  $a_tpl->parseCurrentBlock();
853  }
854 
855  $a_tpl->setCurrentBlock("element");
856  $a_tpl->parseCurrentBlock();
857  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
manageDragAndDrop(array $a_node, int $a_depth, bool $a_first_child=false, ?array $a_next_sibling=null, ?array $a_childs=null)
Makes nodes drag and drop content and targets.
getLevelHTML(array $a_par_node, int $a_depth, array &$a_childs)
static prepareFormOutput($a_str, bool $a_strip=false)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
getMenuItems(array $a_node, int $a_depth, bool $a_first_child=false, ?array $a_next_sibling=null, ?array $a_childs=null)
Get menu items for drop area of node.
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCheckboxName()

ilHierarchyFormGUI::setCheckboxName ( string  $a_checkboxname)

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

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

160  : void
161  {
162  $this->checkboxname = $a_checkboxname;
163  }
+ Here is the caller graph for this function:

◆ setCurrentTopNodeId()

ilHierarchyFormGUI::setCurrentTopNodeId ( int  $a_currenttopnodeid)

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

130  : void
131  {
132  $this->currenttopnodeid = $a_currenttopnodeid;
133  }

◆ setDragIcon()

ilHierarchyFormGUI::setDragIcon ( string  $a_dragicon)

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

170  : void
171  {
172  $this->dragicon = $a_dragicon;
173  }

◆ setExpanded()

ilHierarchyFormGUI::setExpanded ( array  $a_val)

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

Referenced by updateExpanded().

297  : void
298  {
299  $this->expanded = $a_val;
300  }
+ Here is the caller graph for this function:

◆ setExpandVariable()

ilHierarchyFormGUI::setExpandVariable ( string  $a_val)

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

287  : void
288  {
289  $this->expand_variable = $a_val;
290  }

◆ setExplorerUpdater()

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

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

194  : void {
195  $this->exp_frame = $a_exp_frame;
196  $this->exp_id = $a_exp_id;
197  $this->exp_target_script = $a_exp_target_script;
198  }

◆ setFocusId()

ilHierarchyFormGUI::setFocusId ( string  $a_val)

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

277  : void
278  {
279  $this->focus_id = $a_val;
280  }

◆ setHighlightedNodes()

ilHierarchyFormGUI::setHighlightedNodes ( array  $a_val)

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

268  : void {
269  $this->highlighted_nodes = $a_val;
270  }

◆ setIcon()

ilHierarchyFormGUI::setIcon ( string  $a_icon)

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

150  : void
151  {
152  $this->icon = $a_icon;
153  }

◆ setId()

ilHierarchyFormGUI::setId ( string  $a_id)
Exceptions
ilException

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

110  : void
111  {
112  throw new ilException("ilHierarchyFormGUI does currently not support multiple forms (multiple IDs). ID is always hform.");
113  }

◆ setMaxDepth()

ilHierarchyFormGUI::setMaxDepth ( int  $a_maxdepth)

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

180  : void
181  {
182  $this->maxdepth = $a_maxdepth;
183  }

◆ setParentCommand()

ilHierarchyFormGUI::setParentCommand ( object  $a_parent_obj,
string  $a_parent_cmd 
)

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

92  : void {
93  $this->parent_obj = $a_parent_obj;
94  $this->parent_cmd = $a_parent_cmd;
95  }

◆ setTitle()

ilHierarchyFormGUI::setTitle ( string  $a_title)

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

140  : void
141  {
142  $this->title = $a_title;
143  }

◆ setTree()

ilHierarchyFormGUI::setTree ( ilTree  $a_tree)

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

120  : void
121  {
122  $this->tree = $a_tree;
123  }

◆ setTriggeredUpdateCommand()

ilHierarchyFormGUI::setTriggeredUpdateCommand ( string  $a_triggered_update_command)

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

202  : void {
203  $this->triggered_update_command = $a_triggered_update_command;
204  }

◆ setTypeWhiteList()

ilHierarchyFormGUI::setTypeWhiteList ( array  $a_val)

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

368  : void
369  {
370  $this->white_list = $a_val;
371  }

◆ str()

ilHierarchyFormGUI::str (   $key)
protected

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

References ILIAS\LTI\ToolProvider\$key.

Referenced by updateExpanded().

307  : string
308  {
309  return self::_str($key);
310  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the caller graph for this function:

◆ updateExpanded()

ilHierarchyFormGUI::updateExpanded ( )

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

References ILIAS\LTI\ToolProvider\$key, ilSession\get(), getExpandVariable(), getTree(), ilSession\set(), setExpanded(), and str().

Referenced by getContent().

332  : void
333  {
334  $ev = $this->getExpandVariable();
335  $node_id = 0;
336  if ($ev == "") {
337  return;
338  }
339 
340  // init empty session
341  if (!is_array(ilSession::get($ev))) {
342  ilSession::set($ev, array($this->getTree()->getRootId()));
343  }
344 
345  if ($this->str("il_hform_expand") != "") {
346  $node_id = $this->str("il_hform_expand");
347  }
348  if ($this->str($ev) != "") {
349  $node_id = $this->str($ev);
350  }
351 
352  // if positive => expand this node
353  if ($node_id > 0 && !in_array($node_id, ilSession::get($ev))) {
354  $nodes = ilSession::get($ev);
355  $nodes[] = $node_id;
356  ilSession::set($ev, $nodes);
357  }
358  // if negative => compress this node
359  if ($node_id < 0) {
360  $key = array_keys(ilSession::get($ev), -(int) $node_id);
361  $nodes = ilSession::get($ev);
362  unset($nodes[$ev][$key[0]]);
363  ilSession::set($ev, $nodes);
364  }
365  $this->setExpanded(ilSession::get($ev));
366  }
static get(string $a_var)
string $key
Consumer key/client ID value.
Definition: System.php:193
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $checkboxname

string ilHierarchyFormGUI::$checkboxname = ""
protected

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

Referenced by getCheckboxName().

◆ $commands

array ilHierarchyFormGUI::$commands = []
protected

◆ $ctrl

ilCtrl ilHierarchyFormGUI::$ctrl
protected

◆ $currenttopnodeid

int ilHierarchyFormGUI::$currenttopnodeid = 0
protected

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

Referenced by getCurrentTopNodeId().

◆ $diss_menues

array ilHierarchyFormGUI::$diss_menues = []
protected

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

◆ $drag_content

array ilHierarchyFormGUI::$drag_content = []
protected

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

◆ $drag_target

array ilHierarchyFormGUI::$drag_target = []
protected

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

◆ $dragicon

string ilHierarchyFormGUI::$dragicon = ""
protected

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

Referenced by getDragIcon().

◆ $exp_frame

string ilHierarchyFormGUI::$exp_frame = ""
protected

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

◆ $exp_id

string ilHierarchyFormGUI::$exp_id = ""
protected

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

◆ $exp_target_script

string ilHierarchyFormGUI::$exp_target_script = ""
protected

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

◆ $expand_variable

string ilHierarchyFormGUI::$expand_variable = ""
protected

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

Referenced by getExpandVariable().

◆ $expanded

array ilHierarchyFormGUI::$expanded = []
protected

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

Referenced by getExpanded().

◆ $focus_id

string ilHierarchyFormGUI::$focus_id = ""
protected

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

Referenced by getFocusId().

◆ $help_items

array ilHierarchyFormGUI::$help_items = []
protected

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

Referenced by getHelpItems().

◆ $highlighted_nodes

array ilHierarchyFormGUI::$highlighted_nodes = []
protected

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

Referenced by getHighlightedNodes().

◆ $http

HTTP Services ilHierarchyFormGUI::$http
protected

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

◆ $icon

string ilHierarchyFormGUI::$icon = ""
protected

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

Referenced by getIcon().

◆ $lng

◆ $main_tpl

ilGlobalTemplateInterface ilHierarchyFormGUI::$main_tpl
protected

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

◆ $maxdepth

int ilHierarchyFormGUI::$maxdepth = 0
protected

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

Referenced by getMaxDepth().

◆ $multi_commands

array ilHierarchyFormGUI::$multi_commands = []
protected

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

◆ $parent_cmd

string ilHierarchyFormGUI::$parent_cmd = ""
protected

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

Referenced by getParentCommand().

◆ $parent_obj

object ilHierarchyFormGUI::$parent_obj
protected

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

Referenced by getParentObject().

◆ $refinery

Refinery Factory ilHierarchyFormGUI::$refinery
protected

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

◆ $title

string ilHierarchyFormGUI::$title = ""
protected

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

Referenced by getTitle().

◆ $tree

ilTree ilHierarchyFormGUI::$tree
protected

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

Referenced by getTree().

◆ $triggered_update_command

string ilHierarchyFormGUI::$triggered_update_command = ""
protected

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

◆ $white_list

array ilHierarchyFormGUI::$white_list = null
protected

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

Referenced by getTypeWhiteList().


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