ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilExplorerBaseGUI Class Reference

Explorer base GUI class. More...

+ Inheritance diagram for ilExplorerBaseGUI:
+ Collaboration diagram for ilExplorerBaseGUI:

Public Member Functions

 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd)
 Constructor. More...
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 nodeHasVisibleChilds ($a_node)
 Node has childs? More...
 
 sortChilds ($a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getNodeTarget ($a_node)
 Get node target (frame) attribute. More...
 
 getNodeOnClick ($a_node)
 Get node onclick attribute. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 getId ()
 Get id of explorer element. More...
 
 setSkipRootNode ($a_val)
 Set skip root node. More...
 
 getSkipRootNode ()
 Get skip root node. More...
 
 setAjax ($a_val)
 Set ajax. More...
 
 getAjax ()
 Get ajax. More...
 
 setSecondaryHighlightedNodes ($a_val)
 Set secondary (background) highlighted nodes. More...
 
 getSecondaryHighlightedNodes ()
 Get secondary (background) highlighted nodes. More...
 
 setNodeOpen ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setSelectMode ($a_postvar, $a_multi=false)
 Set select mode (to deactivate, pass an empty string as postvar) More...
 
 setNodeSelected ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setOfflineMode ($a_val)
 Set offline mode. More...
 
 getOfflineMode ()
 Get offline mode. More...
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 Get container id. More...
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 Get HTML. More...
 
 renderNode ($a_node, $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId ($a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart ($tpl, $a_node)
 List item start. More...
 
 listItemEnd ($tpl)
 List item end. More...
 
 listStart ($tpl)
 List start. More...
 
 listEnd ($tpl)
 List end. More...
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled ($nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd ($enable_dnd)
 Enable Drag & Drop functionality. More...
 

Static Public Member Functions

static getLocalExplorerJsPath ()
 Get local path of explorer js. More...
 
static getLocalJsTreeJsPath ()
 Get local path of jsTree js. More...
 
static createHTMLExportDirs ($a_target_dir)
 Create html export directories. More...
 
static init ()
 Init JS. More...
 

Protected Member Functions

 isNodeSelectable ($a_node)
 Is node selectable? More...
 
 getNodeToggleOnClick ($a_node)
 Get onclick attribute for node toggling. More...
 
 getSelectOnClick ($a_node)
 Get onclick attribute for selecting radio/checkbox. More...
 
 getJSTreePlugins ()
 

Protected Attributes

 $skip_root_node = false
 
 $ajax = false
 
 $custom_open_nodes = array()
 
 $selected_nodes = array()
 
 $select_postvar = ""
 
 $offline_mode = false
 
 $sec_highl_nodes = array()
 
 $enable_dnd = false
 

Static Protected Attributes

static $js_tree_path = "./Services/UIComponent/Explorer2/lib/jstree-v.pre1.0/jquery.jstree.js"
 
static $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

Private Attributes

 $nodeOnclickEnabled
 

Detailed Description

Explorer base GUI class.

The class is supposed to work on a hierarchie of nodes that are identified by IDs. Whether nodes are represented by associative arrays or objects is not defined by this abstract class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 16 of file class.ilExplorerBaseGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExplorerBaseGUI::__construct (   $a_expl_id,
  $a_parent_obj,
  $a_parent_cmd 
)

Constructor.

Reimplemented in ilVirtualSkillTreeExplorerGUI, ilPublicSectionExplorerGUI, ilMediaPoolExplorerGUI, ilMaterialExplorer, ilSCORM2004EditorExplorerGUI, ilMailExplorer, ilBookmarkBlockExplorerGUI, and ilBookmarkExplorerGUI.

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

35 {
36 $this->id = $a_expl_id;
37 $this->parent_obj = $a_parent_obj;
38 $this->parent_cmd = $a_parent_cmd;
39
40 // get open nodes
41 include_once("./Services/Authentication/classes/class.ilSessionIStorage.php");
42 $this->store = new ilSessionIStorage("expl2");
43 $open_nodes = $this->store->get("on_".$this->id);
44 $this->open_nodes = unserialize($open_nodes);
45 if (!is_array($this->open_nodes))
46 {
47 $this->open_nodes = array();
48 }
49
50 $this->nodeOnclickEnabled = true;
51 }
Session based immediate storage.

Member Function Documentation

◆ beforeRendering()

ilExplorerBaseGUI::beforeRendering ( )

Before rendering.

Reimplemented in ilLMExplorerGUI, and ilPublicSectionExplorerGUI.

Definition at line 521 of file class.ilExplorerBaseGUI.php.

522 {
523
524 }

Referenced by getHTML(), and getNodeAsync().

+ Here is the caller graph for this function:

◆ closeNode()

ilExplorerBaseGUI::closeNode ( )

Close node.

Definition at line 482 of file class.ilExplorerBaseGUI.php.

483 {
484 global $ilLog;
485
486 $id = $this->getNodeIdForDomNodeId($_GET["node_id"]);
487 if (in_array($id, $this->open_nodes))
488 {
489 $k = array_search($id, $this->open_nodes);
490 unset($this->open_nodes[$k]);
491 }
492 $this->store->set("on_".$this->id, serialize($this->open_nodes));
493 exit;
494 }
$_GET["client_id"]
getNodeIdForDomNodeId($a_dom_node_id)
Get node id for dom node id.
exit
Definition: login.php:54

References $_GET, $ilLog, exit, and getNodeIdForDomNodeId().

+ Here is the call graph for this function:

◆ createHTMLExportDirs()

static ilExplorerBaseGUI::createHTMLExportDirs (   $a_target_dir)
static

Create html export directories.

Parameters
string$a_target_dirtarget directory

Definition at line 74 of file class.ilExplorerBaseGUI.php.

75 {
76 ilUtil::makeDirParents($a_target_dir."/Services/UIComponent/Explorer2/lib/jstree-v.pre1.0");
77 ilUtil::makeDirParents($a_target_dir."/Services/UIComponent/Explorer2/js");
78 }
static makeDirParents($a_dir)
Create a new directory and all parent directories.

References ilUtil\makeDirParents().

Referenced by ilObjContentObject\exportHTML().

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

◆ getAjax()

ilExplorerBaseGUI::getAjax ( )

Get ajax.

Returns
boolean ajax

Definition at line 316 of file class.ilExplorerBaseGUI.php.

317 {
318 return $this->ajax;
319 }

References $ajax.

Referenced by getOnLoadCode(), ilObjStudyProgrammeTreeExplorerGUI\listItemStart(), listItemStart(), and renderNode().

+ Here is the caller graph for this function:

◆ getChildsOfNode()

ilExplorerBaseGUI::getChildsOfNode (   $a_parent_node_id)
abstract

Get childs of node.

Parameters
string$a_parent_idparent node id
Returns
array childs

Reimplemented in ilPersonalSkillExplorerGUI, ilSkillTemplateTreeExplorerGUI, ilVirtualSkillTreeExplorerGUI, ilOrgUnitExplorerGUI, ilObjStudyProgrammeTreeExplorerGUI, ilAdministrationExplorerGUI, ilRepositoryExplorerGUI, ilRepositorySelectorExplorerGUI, and ilTreeExplorerGUI.

Referenced by getHTML(), nodeHasVisibleChilds(), and renderChilds().

+ Here is the caller graph for this function:

◆ getContainerId()

ilExplorerBaseGUI::getContainerId ( )

Get container id.

Parameters

return

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

459 {
460 return "il_expl2_jstree_cont_".$this->getId();
461 }

Referenced by ilObjStudyProgrammeTreeExplorerGUI\getHTML(), getHTML(), getOnLoadCode(), and handleCommand().

+ Here is the caller graph for this function:

◆ getDomNodeIdForNodeId()

ilExplorerBaseGUI::getDomNodeIdForNodeId (   $a_node_id)

Get DOM node id for node id.

Parameters

return

Definition at line 816 of file class.ilExplorerBaseGUI.php.

817 {
818 return "exp_node_".$this->getId()."_".$a_node_id;
819 }

Referenced by getNodeToggleOnClick(), getOnLoadCode(), getSelectOnClick(), ilObjStudyProgrammeTreeExplorerGUI\listItemStart(), and listItemStart().

+ Here is the caller graph for this function:

◆ getHTML()

ilExplorerBaseGUI::getHTML ( )

Get HTML.

Reimplemented in ilObjStudyProgrammeTreeExplorerGUI, and ilTreeExplorerGUI.

Definition at line 627 of file class.ilExplorerBaseGUI.php.

628 {
629 global $tpl, $ilCtrl;
630
631 $this->beforeRendering();
632
633 self::init();
634 $container_id = $this->getContainerId();
635 $container_outer_id = "il_expl2_jstree_cont_out_".$this->getId();
636
637 if (!$ilCtrl->isAsynch())
638 {
639 $tpl->addOnLoadCode($this->getOnLoadCode());
640 }
641
642 $etpl = new ilTemplate("tpl.explorer2.html", true, true, "Services/UIComponent/Explorer2");
643
644 // render childs
645 $root_node = $this->getRootNode();
646
647 if (!$this->getSkipRootNode() &&
648 $this->isNodeVisible($this->getRootNode()))
649 {
650 $this->listStart($etpl);
651 $this->renderNode($this->getRootNode(), $etpl);
652 $this->listEnd($etpl);
653 }
654 else
655 {
656 $childs = $this->getChildsOfNode($this->getNodeId($root_node));
657 $childs = $this->sortChilds($childs, $this->getNodeId($root_node));
658 $any = false;
659 foreach ($childs as $child_node)
660 {
661 if ($this->isNodeVisible($child_node))
662 {
663 if (!$any)
664 {
665 $this->listStart($etpl);
666 $any = true;
667 }
668 $this->renderNode($child_node, $etpl);
669 }
670 }
671 if ($any)
672 {
673 $this->listEnd($etpl);
674 }
675 }
676
677 $etpl->setVariable("CONTAINER_ID", $container_id);
678 $etpl->setVariable("CONTAINER_OUTER_ID", $container_outer_id);
679
680 $add = "";
681 if ($ilCtrl->isAsynch())
682 {
683 $add = "<script>".$this->getOnLoadCode()."</script>";
684 }
685
686 return $etpl->get().$add;
687 }
global $tpl
Definition: ilias.php:8
getContainerId()
Get container id.
beforeRendering()
Before rendering.
getOnLoadCode()
Get on load code.
renderNode($a_node, $tpl)
Render node.
getChildsOfNode($a_parent_node_id)
Get childs of node.
sortChilds($a_childs, $a_parent_node_id)
Sort childs.
getNodeId($a_node)
Get id of a node.
getSkipRootNode()
Get skip root node.
getRootNode()
Get root node.
isNodeVisible($a_node)
Is node visible?
special template class to simplify handling of ITX/PEAR
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, $tpl, beforeRendering(), getChildsOfNode(), getContainerId(), getNodeId(), getOnLoadCode(), getRootNode(), getSkipRootNode(), init(), isNodeVisible(), listEnd(), listStart(), renderNode(), and sortChilds().

+ Here is the call graph for this function:

◆ getId()

ilExplorerBaseGUI::getId ( )

Get id of explorer element.

Returns
integer id

Definition at line 274 of file class.ilExplorerBaseGUI.php.

275 {
276 return $this->id;
277 }

Referenced by getNodeIdForDomNodeId().

+ Here is the caller graph for this function:

◆ getJSTreePlugins()

ilExplorerBaseGUI::getJSTreePlugins ( )
protected

Definition at line 599 of file class.ilExplorerBaseGUI.php.

599 {
600 $plugins = array("html_data", "themes", "json_data");
601 if($this->isEnableDnd()) {
602 $plugins[] = "crrm";
603 $plugins[] = "dnd";
604 }
605 return $plugins;
606 }

References isEnableDnd().

Referenced by getOnLoadCode().

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

◆ getLocalExplorerJsPath()

static ilExplorerBaseGUI::getLocalExplorerJsPath ( )
static

Get local path of explorer js.

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

57 {
59 }

References $js_expl_path.

Referenced by ilObjContentObject\getSupplyingExportFiles().

+ Here is the caller graph for this function:

◆ getLocalJsTreeJsPath()

static ilExplorerBaseGUI::getLocalJsTreeJsPath ( )
static

Get local path of jsTree js.

Definition at line 64 of file class.ilExplorerBaseGUI.php.

65 {
67 }

References $js_tree_path.

Referenced by ilObjContentObject\getSupplyingExportFiles().

+ Here is the caller graph for this function:

◆ getNodeAsync()

ilExplorerBaseGUI::getNodeAsync ( )

Get node asynchronously.

Definition at line 499 of file class.ilExplorerBaseGUI.php.

500 {
501 $this->beforeRendering();
502
503 if ($_GET["node_id"] != "")
504 {
505 $id = $this->getNodeIdForDomNodeId($_GET["node_id"]);
506 }
507 else
508 {
509 $id = $this->getNodeId($this->getRootNode());
510 }
511
512 $etpl = new ilTemplate("tpl.explorer2.html", true, true, "Services/UIComponent/Explorer2");
513 $this->renderChilds($id, $etpl);
514 echo $etpl->get("tag");
515 exit;
516 }
renderChilds($a_node_id, $tpl)
Render childs.

References $_GET, beforeRendering(), exit, getNodeId(), getNodeIdForDomNodeId(), getRootNode(), and renderChilds().

+ Here is the call graph for this function:

◆ getNodeContent()

◆ getNodeHref()

◆ getNodeIcon()

◆ getNodeIconAlt()

ilExplorerBaseGUI::getNodeIconAlt (   $a_node)

Get node icon alt attribute.

Parameters
mixed$a_nodenode object/array
Returns
string image alt attribute

Reimplemented in ilLMEditorExplorerGUI, ilLMTOCExplorerGUI, ilSCORM2004EditorExplorerGUI, ilAdministrationExplorerGUI, ilBookmarkExplorerGUI, ilMailExplorer, ilRepositoryExplorerGUI, ilRepositorySelectorExplorerGUI, and ilTreeExplorerGUI.

Definition at line 189 of file class.ilExplorerBaseGUI.php.

190 {
191 return "";
192 }

Referenced by renderNode().

+ Here is the caller graph for this function:

◆ getNodeId()

ilExplorerBaseGUI::getNodeId (   $a_node)
abstract

Get id of a node.

Parameters
mixed$a_nodenode array or object
Returns
string id of node

Reimplemented in ilObjStudyProgrammeTreeExplorerGUI, ilVirtualSkillTreeExplorerGUI, and ilTreeExplorerGUI.

Referenced by getHTML(), getNodeAsync(), getNodeToggleOnClick(), getOnLoadCode(), getSelectOnClick(), listItemStart(), nodeHasVisibleChilds(), and renderNode().

+ Here is the caller graph for this function:

◆ getNodeIdForDomNodeId()

ilExplorerBaseGUI::getNodeIdForDomNodeId (   $a_dom_node_id)

Get node id for dom node id.

Parameters

return

Definition at line 827 of file class.ilExplorerBaseGUI.php.

828 {
829 $i = strlen("exp_node_".$this->getId()."_");
830 return substr($a_dom_node_id, $i);
831 }
getId()
Get id of explorer element.

References getId().

Referenced by closeNode(), getNodeAsync(), ilObjStudyProgrammeTreeExplorerGUI\openCertainNode(), and openNode().

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

◆ getNodeOnClick()

ilExplorerBaseGUI::getNodeOnClick (   $a_node)

Get node onclick attribute.

Parameters
mixed$a_nodenode object/array
Returns
string onclick value

Reimplemented in ilBookmarkBlockExplorerGUI, ilIntLinkRepItemExplorerGUI, ilLinkTargetObjectExplorerGUI, and ilTaxonomyExplorerGUI.

Definition at line 211 of file class.ilExplorerBaseGUI.php.

212 {
213 if ($this->select_postvar != "")
214 {
215 return $this->getSelectOnClick($a_node);
216 }
217 return "";
218 }
getSelectOnClick($a_node)
Get onclick attribute for selecting radio/checkbox.

References getSelectOnClick().

Referenced by renderNode().

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

◆ getNodeTarget()

ilExplorerBaseGUI::getNodeTarget (   $a_node)

Get node target (frame) attribute.

Parameters
mixed$a_nodenode object/array
Returns
string target

Reimplemented in ilBookmarkBlockExplorerGUI.

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

201 {
202 return "";
203 }

Referenced by renderNode().

+ Here is the caller graph for this function:

◆ getNodeToggleOnClick()

ilExplorerBaseGUI::getNodeToggleOnClick (   $a_node)
finalprotected

Get onclick attribute for node toggling.

Parameters

return

Definition at line 361 of file class.ilExplorerBaseGUI.php.

362 {
363 return "$('#".$this->getContainerId()."').jstree('toggle_node' , '#".
364 $this->getDomNodeIdForNodeId($this->getNodeId($a_node))."'); return false;";
365 }
getDomNodeIdForNodeId($a_node_id)
Get DOM node id for node id.

References getDomNodeIdForNodeId(), and getNodeId().

Referenced by ilBookmarkBlockExplorerGUI\getNodeOnClick().

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

◆ getOfflineMode()

ilExplorerBaseGUI::getOfflineMode ( )

◆ getOnLoadCode()

ilExplorerBaseGUI::getOnLoadCode ( )

Get on load code.

Parameters

return

Definition at line 532 of file class.ilExplorerBaseGUI.php.

533 {
534 global $ilCtrl;
535
536 $container_id = $this->getContainerId();
537 $container_outer_id = "il_expl2_jstree_cont_out_".$this->getId();
538
539 // collect open nodes
540 $open_nodes = array($this->getDomNodeIdForNodeId($this->getNodeId($this->getRootNode())));
541 foreach ($this->open_nodes as $nid)
542 {
543 $open_nodes[] = $this->getDomNodeIdForNodeId($nid);
544 }
545 foreach ($this->custom_open_nodes as $nid)
546 {
547 $dnode = $this->getDomNodeIdForNodeId($nid);
548 if (!in_array($dnode, $open_nodes))
549 {
550 $open_nodes[] = $dnode;
551 }
552 }
553
554 // ilias config options
555 $url = "";
556 if (!$this->getOfflineMode())
557 {
558 if (is_object($this->parent_obj))
559 {
560 $url = $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd, "", true);
561 }
562 else
563 {
564 $url = $ilCtrl->getLinkTargetByClass($this->parent_obj, $this->parent_cmd, "", true);
565 }
566 }
567
568 // secondary highlighted nodes
569 $shn = array();
570 foreach ($this->sec_highl_nodes as $sh)
571 {
572 $shn[] = $this->getDomNodeIdForNodeId($sh);
573 }
574 $config = array(
575 "container_id" => $container_id,
576 "container_outer_id" => $container_outer_id,
577 "url" => $url,
578 "second_hnodes" => $shn,
579 "ajax" => $this->getAjax(),
580 );
581
582
583 // jstree config options
584 $js_tree_config = array(
585 "core" => array(
586 "animation" => 300,
587 "initially_open" => $open_nodes,
588 "open_parents" => false,
589 "strings" => array("loading" => "Loading ...", "new_node" => "New node")
590 ),
591 "plugins" => $this->getJSTreePlugins(),
592 "themes" => array("dots" => false, "icons" => false, "theme" => ""),
593 "html_data" => array()
594 );
595
596 return 'il.Explorer2.init('.json_encode($config).', '.json_encode($js_tree_config).');';
597 }
getOfflineMode()
Get offline mode.
$url
Definition: shib_logout.php:72

References $ilCtrl, $url, getAjax(), getContainerId(), getDomNodeIdForNodeId(), getJSTreePlugins(), getNodeId(), getOfflineMode(), and getRootNode().

Referenced by getHTML().

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

◆ getRootNode()

ilExplorerBaseGUI::getRootNode ( )
abstract

Get root node.

Please note that the class does not make any requirements how nodes are represented (array or object)

Returns
mixed root node object/array

Reimplemented in ilLMTOCExplorerGUI, ilOrgUnitExplorerGUI, ilObjStudyProgrammeTreeExplorerGUI, ilRepositoryExplorerGUI, ilSkillTemplateTreeExplorerGUI, ilVirtualSkillTreeExplorerGUI, and ilTreeExplorerGUI.

Referenced by getHTML(), getNodeAsync(), and getOnLoadCode().

+ Here is the caller graph for this function:

◆ getSecondaryHighlightedNodes()

ilExplorerBaseGUI::getSecondaryHighlightedNodes ( )

Get secondary (background) highlighted nodes.

Returns
array array of node ids

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

References $sec_highl_nodes.

◆ getSelectOnClick()

ilExplorerBaseGUI::getSelectOnClick (   $a_node)
finalprotected

Get onclick attribute for selecting radio/checkbox.

Parameters

return

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

374 {
375 $dn_id = $this->getDomNodeIdForNodeId($this->getNodeId($a_node));
376 $oc = "il.Explorer2.selectOnClick('".$dn_id."'); return false;";
377 return $oc;
378 }

References getDomNodeIdForNodeId(), and getNodeId().

Referenced by getNodeOnClick().

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

◆ getSkipRootNode()

ilExplorerBaseGUI::getSkipRootNode ( )

Get skip root node.

Returns
boolean skip root node

Definition at line 296 of file class.ilExplorerBaseGUI.php.

References $skip_root_node.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ handleCommand()

ilExplorerBaseGUI::handleCommand ( )

Handle explorer internal command.

Returns
boolean true, if an internal command has been performed.

Definition at line 436 of file class.ilExplorerBaseGUI.php.

437 {
438 if ($_GET["exp_cmd"] != "" &&
439 $_GET["exp_cont"] == $this->getContainerId())
440 {
441 $cmd = $_GET["exp_cmd"];
442 if (in_array($cmd, array("openNode", "closeNode", "getNodeAsync")))
443 {
444 $this->$cmd();
445 }
446
447 return true;
448 }
449 return false;
450 }
$cmd
Definition: sahs_server.php:35

References $_GET, $cmd, and getContainerId().

+ Here is the call graph for this function:

◆ init()

static ilExplorerBaseGUI::init ( )
static

Init JS.

Definition at line 612 of file class.ilExplorerBaseGUI.php.

613 {
614 global $tpl;
615
616 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
618
619 $tpl->addJavascript(self::getLocalExplorerJsPath());
620 $tpl->addJavascript(self::getLocalJsTreeJsPath());
621 }
static initjQuery($a_tpl=null)
Init jQuery.

References $tpl, and iljQueryUtil\initjQuery().

Referenced by getHTML(), and ilInternalLinkGUI\getInitHTML().

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

◆ isEnableDnd()

ilExplorerBaseGUI::isEnableDnd ( )

Definition at line 904 of file class.ilExplorerBaseGUI.php.

References $enable_dnd.

Referenced by getJSTreePlugins().

+ Here is the caller graph for this function:

◆ isNodeClickable()

ilExplorerBaseGUI::isNodeClickable (   $a_node)

Is node clickable?

Parameters
mixed$a_nodenode object/array
Returns
boolean node clickable true/false

Reimplemented in ilLMTOCExplorerGUI, ilPublicSectionExplorerGUI, ilOrgUnitExplorerGUI, ilObjStudyProgrammeTreeExplorerGUI, ilMaterialExplorer, ilConditionSelector, ilAdministrationExplorerGUI, ilLinkTargetObjectExplorerGUI, ilRepositoryExplorerGUI, ilRepositorySelectorExplorerGUI, ilPersonalSkillExplorerGUI, ilSkillSelectorGUI, ilSkillTreeExplorerGUI, ilVirtualSkillTreeExplorerGUI, and ilPaymentObjectSelector.

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

249 {
250 return true;
251 }

Referenced by renderNode().

+ Here is the caller graph for this function:

◆ isNodeHighlighted()

ilExplorerBaseGUI::isNodeHighlighted (   $a_node)

Is node highlighted?

Parameters
mixed$a_nodenode object/array
Returns
boolean node highlighted true/false

Reimplemented in ilLMExplorerGUI, ilLMTOCExplorerGUI, ilMediaPoolExplorerGUI, ilSCORM2004EditorExplorerGUI, ilConditionSelector, ilAdministrationExplorerGUI, ilBookmarkBlockExplorerGUI, ilBookmarkExplorerGUI, ilBookmarkMoveExplorerGUI, ilMailExplorer, ilRepositoryExplorerGUI, ilRepositorySelectorExplorerGUI, ilSkillTemplateTreeExplorerGUI, ilSkillTreeExplorerGUI, and ilTaxonomyExplorerGUI.

Definition at line 237 of file class.ilExplorerBaseGUI.php.

238 {
239 return false;
240 }

Referenced by renderNode().

+ Here is the caller graph for this function:

◆ isNodeOnclickEnabled()

ilExplorerBaseGUI::isNodeOnclickEnabled ( )
Returns
boolean

Definition at line 891 of file class.ilExplorerBaseGUI.php.

References $nodeOnclickEnabled.

Referenced by renderNode().

+ Here is the caller graph for this function:

◆ isNodeSelectable()

ilExplorerBaseGUI::isNodeSelectable (   $a_node)
protected

Is node selectable?

Parameters
mixed$a_nodenode object/array
Returns
boolean node selectable true/false

Reimplemented in ilSkillSelectorGUI.

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

260 {
261 return true;
262 }

Referenced by renderNode().

+ Here is the caller graph for this function:

◆ isNodeVisible()

ilExplorerBaseGUI::isNodeVisible (   $a_node)

Is node visible?

Parameters
mixed$a_nodenode object/array
Returns
boolean node visible true/false

Reimplemented in ilForumMoveTopicsExplorer, ilLMTOCExplorerGUI, ilConditionSelector, ilAdministrationExplorerGUI, ilPoolSelectorGUI, ilRepositoryExplorerGUI, and ilRepositorySelectorExplorerGUI.

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

227 {
228 return true;
229 }

Referenced by getHTML(), nodeHasVisibleChilds(), and renderChilds().

+ Here is the caller graph for this function:

◆ listEnd()

ilExplorerBaseGUI::listEnd (   $tpl)

List end.

Parameters

return

Definition at line 882 of file class.ilExplorerBaseGUI.php.

883 {
884 $tpl->touchBlock("list_end");
885 $tpl->touchBlock("tag");
886 }

References $tpl.

Referenced by getHTML(), and renderChilds().

+ Here is the caller graph for this function:

◆ listItemEnd()

ilExplorerBaseGUI::listItemEnd (   $tpl)

List item end.

Parameters

return

Definition at line 858 of file class.ilExplorerBaseGUI.php.

859 {
860 $tpl->touchBlock("list_item_end");
861 $tpl->touchBlock("tag");
862 }

References $tpl.

Referenced by renderNode().

+ Here is the caller graph for this function:

◆ listItemStart()

ilExplorerBaseGUI::listItemStart (   $tpl,
  $a_node 
)

List item start.

Parameters

return

Reimplemented in ilObjStudyProgrammeTreeExplorerGUI.

Definition at line 839 of file class.ilExplorerBaseGUI.php.

840 {
841 $tpl->setCurrentBlock("list_item_start");
842 if ($this->getAjax() && $this->nodeHasVisibleChilds($a_node))
843 {
844 $tpl->touchBlock("li_closed");
845 }
846 $tpl->setVariable("DOM_NODE_ID",
847 $this->getDomNodeIdForNodeId($this->getNodeId($a_node)));
848 $tpl->parseCurrentBlock();
849 $tpl->touchBlock("tag");
850 }
nodeHasVisibleChilds($a_node)
Node has childs?

References $tpl, getAjax(), getDomNodeIdForNodeId(), getNodeId(), and nodeHasVisibleChilds().

Referenced by renderNode().

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

◆ listStart()

ilExplorerBaseGUI::listStart (   $tpl)

List start.

Parameters

return

Definition at line 870 of file class.ilExplorerBaseGUI.php.

871 {
872 $tpl->touchBlock("list_start");
873 $tpl->touchBlock("tag");
874 }

References $tpl.

Referenced by getHTML(), and renderChilds().

+ Here is the caller graph for this function:

◆ nodeHasVisibleChilds()

ilExplorerBaseGUI::nodeHasVisibleChilds (   $a_node)

Node has childs?

Please note that this standard method may not be optimal depending on what a derived class does in isNodeVisible.

Parameters

return

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

146 {
147 $childs = $this->getChildsOfNode($this->getNodeId($a_node));
148
149 foreach ($childs as $child)
150 {
151 if ($this->isNodeVisible($child))
152 {
153 return true;
154 }
155 }
156 return false;
157 }

References getChildsOfNode(), getNodeId(), and isNodeVisible().

Referenced by ilObjStudyProgrammeTreeExplorerGUI\listItemStart(), and listItemStart().

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

◆ openNode()

ilExplorerBaseGUI::openNode ( )

Open node.

Definition at line 466 of file class.ilExplorerBaseGUI.php.

467 {
468 global $ilLog;
469
470 $id = $this->getNodeIdForDomNodeId($_GET["node_id"]);
471 if (!in_array($id, $this->open_nodes))
472 {
473 $this->open_nodes[] = $id;
474 }
475 $this->store->set("on_".$this->id, serialize($this->open_nodes));
476 exit;
477 }

References $_GET, $ilLog, exit, and getNodeIdForDomNodeId().

+ Here is the call graph for this function:

◆ renderChilds()

ilExplorerBaseGUI::renderChilds (   $a_node_id,
  $tpl 
)
final

Render childs.

Parameters

return

Definition at line 783 of file class.ilExplorerBaseGUI.php.

784 {
785 $childs = $this->getChildsOfNode($a_node_id);
786 $childs = $this->sortChilds($childs, $a_node_id);
787
788 if (count($childs) > 0)
789 {
790 $any = false;
791 foreach ($childs as $child)
792 {
793 if ($this->isNodeVisible($child))
794 {
795 if (!$any)
796 {
797 $this->listStart($tpl);
798 $any = true;
799 }
800 $this->renderNode($child, $tpl);
801 }
802 }
803 if ($any)
804 {
805 $this->listEnd($tpl);
806 }
807 }
808 }

References $tpl, getChildsOfNode(), isNodeVisible(), listEnd(), listStart(), renderNode(), and sortChilds().

Referenced by getNodeAsync(), and renderNode().

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

◆ renderNode()

ilExplorerBaseGUI::renderNode (   $a_node,
  $tpl 
)

Render node.

Parameters

return

Definition at line 695 of file class.ilExplorerBaseGUI.php.

696 {
697 $this->listItemStart($tpl, $a_node);
698
699 // select mode?
700 if ($this->select_postvar != "" && $this->isNodeSelectable($a_node))
701 {
702 if ($this->select_multi)
703 {
704 $tpl->setCurrentBlock("cb");
705 if (in_array($this->getNodeId($a_node), $this->selected_nodes))
706 {
707 $tpl->setVariable("CHECKED", 'checked="checked"');
708 }
709 $tpl->setVariable("CB_VAL", $this->getNodeId($a_node));
710 $tpl->setVariable("CB_NAME", $this->select_postvar."[]");
711 $tpl->parseCurrentBlock();
712 }
713 else
714 {
715 $tpl->setCurrentBlock("rd");
716 if (in_array($this->getNodeId($a_node), $this->selected_nodes))
717 {
718 $tpl->setVariable("SELECTED", 'checked="checked"');
719 }
720 $tpl->setVariable("RD_VAL", $this->getNodeId($a_node));
721 $tpl->setVariable("RD_NAME", $this->select_postvar);
722 $tpl->parseCurrentBlock();
723 }
724 }
725
726
727 if ($this->isNodeHighlighted($a_node))
728 {
729 $tpl->touchBlock("hl");
730 }
731 $tpl->setCurrentBlock("content");
732 if ($this->getNodeIcon($a_node) != "")
733 {
734 $tpl->setVariable("ICON", ilUtil::img($this->getNodeIcon($a_node), $this->getNodeIconAlt($a_node))." ");
735 }
736 $tpl->setVariable("CONTENT", $this->getNodeContent($a_node));
737 $tpl->setVariable("HREF", $this->getNodeHref($a_node));
738 $target = $this->getNodeTarget($a_node);
739 if ($target != "")
740 {
741 $targetRelatedParams = array(
742 'target="' . $target . '"'
743 );
744
745 if ('_blank' === $target) {
746 $targetRelatedParams[] = 'rel="noopener"';
747 }
748
749 $tpl->setVariable('TARGET', implode(' ', $targetRelatedParams));
750 }
751 if (!$this->isNodeOnclickEnabled() || !$this->isNodeClickable($a_node))
752 {
753 $tpl->setVariable("ONCLICK", 'onclick="return false;"');
754 $tpl->setVariable("A_CLASS", 'class="disabled"');
755 }
756 else
757 {
758 $onclick = $this->getNodeOnClick($a_node);
759 if ($onclick != "")
760 {
761 $tpl->setVariable("ONCLICK", 'onclick="'.$onclick.'"');
762 }
763 }
764 $tpl->parseCurrentBlock();
765
766 $tpl->touchBlock("tag");
767
768 if (!$this->getAjax() || in_array($this->getNodeId($a_node), $this->open_nodes)
769 || in_array($this->getNodeId($a_node), $this->custom_open_nodes))
770 {
771 $this->renderChilds($this->getNodeId($a_node), $tpl);
772 }
773
774 $this->listItemEnd($tpl);
775 }
getNodeIcon($a_node)
Get node icon path.
getNodeContent($a_node)
Get content of a node.
isNodeSelectable($a_node)
Is node selectable?
getNodeIconAlt($a_node)
Get node icon alt attribute.
getNodeOnClick($a_node)
Get node onclick attribute.
isNodeClickable($a_node)
Is node clickable?
getNodeTarget($a_node)
Get node target (frame) attribute.
getNodeHref($a_node)
Get href for node.
isNodeHighlighted($a_node)
Is node highlighted?
listItemEnd($tpl)
List item end.
listItemStart($tpl, $a_node)
List item start.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.

References $tpl, getAjax(), getNodeContent(), getNodeHref(), getNodeIcon(), getNodeIconAlt(), getNodeId(), getNodeOnClick(), getNodeTarget(), ilUtil\img(), isNodeClickable(), isNodeHighlighted(), isNodeOnclickEnabled(), isNodeSelectable(), listItemEnd(), listItemStart(), and renderChilds().

Referenced by getHTML(), and renderChilds().

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

◆ setAjax()

◆ setEnableDnd()

ilExplorerBaseGUI::setEnableDnd (   $enable_dnd)

Enable Drag & Drop functionality.

Parameters
boolean$enable_dnd

Definition at line 912 of file class.ilExplorerBaseGUI.php.

912 {
913 $this->enable_dnd = $enable_dnd;
914 }

References $enable_dnd.

Referenced by ilObjStudyProgrammeTreeExplorerGUI\__construct().

+ Here is the caller graph for this function:

◆ setNodeOnclickEnabled()

ilExplorerBaseGUI::setNodeOnclickEnabled (   $nodeOnclickEnabled)
Parameters
boolean$nodeOnclickEnabled

Definition at line 899 of file class.ilExplorerBaseGUI.php.

900 {
901 $this->nodeOnclickEnabled = $nodeOnclickEnabled;
902 }

References $nodeOnclickEnabled.

◆ setNodeOpen()

ilExplorerBaseGUI::setNodeOpen (   $a_id)

Set node to be opened (additional custom opened node, not standard expand behaviour)

Parameters

return

Definition at line 347 of file class.ilExplorerBaseGUI.php.

348 {
349 if (!in_array($a_id, $this->custom_open_nodes))
350 {
351 $this->custom_open_nodes[] = $a_id;
352 }
353 }

Referenced by ilLMTableOfContentsExplorerGUI\__construct(), ilPublicSectionExplorerGUI\beforeRendering(), and ilTreeExplorerGUI\setPathOpen().

+ Here is the caller graph for this function:

◆ setNodeSelected()

ilExplorerBaseGUI::setNodeSelected (   $a_id)

Set node to be opened (additional custom opened node, not standard expand behaviour)

Parameters

return

Definition at line 399 of file class.ilExplorerBaseGUI.php.

400 {
401 if (!in_array($a_id, $this->selected_nodes))
402 {
403 $this->selected_nodes[] = $a_id;
404 }
405 }

Referenced by ilPublicSectionExplorerGUI\beforeRendering(), and ilSkillSelectorGUI\setSkillSelected().

+ Here is the caller graph for this function:

◆ setOfflineMode()

ilExplorerBaseGUI::setOfflineMode (   $a_val)

Set offline mode.

Parameters
bool$a_valoffline mode

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

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

◆ setSecondaryHighlightedNodes()

ilExplorerBaseGUI::setSecondaryHighlightedNodes (   $a_val)

Set secondary (background) highlighted nodes.

Parameters
array$a_valarray of node ids

Definition at line 326 of file class.ilExplorerBaseGUI.php.

327 {
328 $this->sec_highl_nodes = $a_val;
329 }

Referenced by ilLMTOCExplorerGUI\__construct().

+ Here is the caller graph for this function:

◆ setSelectMode()

ilExplorerBaseGUI::setSelectMode (   $a_postvar,
  $a_multi = false 
)

Set select mode (to deactivate, pass an empty string as postvar)

Parameters
string$a_postvarvariable used for post, a "[]" is added automatically
boolean$a_multimulti select (checkboxes) or not (radio)
Returns

Definition at line 387 of file class.ilExplorerBaseGUI.php.

388 {
389 $this->select_postvar = $a_postvar;
390 $this->select_multi = $a_multi;
391 }

Referenced by ilForumMoveTopicsExplorer\__construct().

+ Here is the caller graph for this function:

◆ setSkipRootNode()

◆ sortChilds()

ilExplorerBaseGUI::sortChilds (   $a_childs,
  $a_parent_node_id 
)

Sort childs.

Parameters
array$a_childsarray of child nodes
mixed$a_parent_nodeparent node
Returns
array array of childs nodes

Reimplemented in ilOrgUnitExplorerGUI, ilAdministrationExplorerGUI, ilRepositoryExplorerGUI, and ilRepositorySelectorExplorerGUI.

Definition at line 167 of file class.ilExplorerBaseGUI.php.

168 {
169 return $a_childs;
170 }

Referenced by getHTML(), and renderChilds().

+ Here is the caller graph for this function:

Field Documentation

◆ $ajax

ilExplorerBaseGUI::$ajax = false
protected

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

Referenced by getAjax().

◆ $custom_open_nodes

ilExplorerBaseGUI::$custom_open_nodes = array()
protected

Definition at line 22 of file class.ilExplorerBaseGUI.php.

◆ $enable_dnd

ilExplorerBaseGUI::$enable_dnd = false
protected

Definition at line 27 of file class.ilExplorerBaseGUI.php.

Referenced by isEnableDnd(), and setEnableDnd().

◆ $js_expl_path

ilExplorerBaseGUI::$js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
staticprotected

Definition at line 19 of file class.ilExplorerBaseGUI.php.

Referenced by getLocalExplorerJsPath().

◆ $js_tree_path

ilExplorerBaseGUI::$js_tree_path = "./Services/UIComponent/Explorer2/lib/jstree-v.pre1.0/jquery.jstree.js"
staticprotected

Definition at line 18 of file class.ilExplorerBaseGUI.php.

Referenced by getLocalJsTreeJsPath().

◆ $nodeOnclickEnabled

ilExplorerBaseGUI::$nodeOnclickEnabled
private

Definition at line 29 of file class.ilExplorerBaseGUI.php.

Referenced by isNodeOnclickEnabled(), and setNodeOnclickEnabled().

◆ $offline_mode

ilExplorerBaseGUI::$offline_mode = false
protected

Definition at line 25 of file class.ilExplorerBaseGUI.php.

Referenced by getOfflineMode().

◆ $sec_highl_nodes

ilExplorerBaseGUI::$sec_highl_nodes = array()
protected

Definition at line 26 of file class.ilExplorerBaseGUI.php.

Referenced by getSecondaryHighlightedNodes().

◆ $select_postvar

ilExplorerBaseGUI::$select_postvar = ""
protected

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

Referenced by ilSkillSelectorGUI\getSelectedSkills().

◆ $selected_nodes

ilExplorerBaseGUI::$selected_nodes = array()
protected

Definition at line 23 of file class.ilExplorerBaseGUI.php.

◆ $skip_root_node

ilExplorerBaseGUI::$skip_root_node = false
protected

Definition at line 20 of file class.ilExplorerBaseGUI.php.

Referenced by getSkipRootNode().


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