ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 getRootNode ()
 Get root node.
 getChildsOfNode ($a_parent_node_id)
 Get childs of node.
 getNodeContent ($a_node)
 Get content of a node.
 getNodeId ($a_node)
 Get id of a node.
 getNodeHref ($a_node)
 Get href for node.
 nodeHasVisibleChilds ($a_node)
 Node has childs?
 sortChilds ($a_childs, $a_parent_node_id)
 Sort childs.
 getNodeIcon ($a_node)
 Get node icon path.
 getNodeIconAlt ($a_node)
 Get node icon alt attribute.
 getNodeTarget ($a_node)
 Get node target (frame) attribute.
 getNodeOnClick ($a_node)
 Get node onclick attribute.
 isNodeVisible ($a_node)
 Is node visible?
 isNodeHighlighted ($a_node)
 Is node highlighted?
 isNodeClickable ($a_node)
 Is node clickable?
 getId ()
 Get id of explorer element.
 setSkipRootNode ($a_val)
 Set skip root node.
 getSkipRootNode ()
 Get skip root node.
 setAjax ($a_val)
 Set ajax.
 getAjax ()
 Get ajax.
 setSecondaryHighlightedNodes ($a_val)
 Set secondary (background) highlighted nodes.
 getSecondaryHighlightedNodes ()
 Get secondary (background) highlighted nodes.
 setNodeOpen ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour)
 setSelectMode ($a_postvar, $a_multi=false)
 Set select mode (to deactivate, pass an empty string as postvar)
 setNodeSelected ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour)
 setOfflineMode ($a_val)
 Set offline mode.
 getOfflineMode ()
 Get offline mode.
 handleCommand ()
 Handle explorer internal command.
 getContainerId ()
 Get container id.
 openNode ()
 Open node.
 closeNode ()
 Close node.
 getNodeAsync ()
 Get node asynchronously.
 beforeRendering ()
 Before rendering.
 getOnLoadCode ()
 Get on load code.
 getHTML ()
 Get HTML.
 renderNode ($a_node, $tpl)
 Render node.
 renderChilds ($a_node_id, $tpl)
 Render childs.
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id.
 getNodeIdForDomNodeId ($a_dom_node_id)
 Get node id for dom node id.
 listItemStart ($tpl, $a_node)
 List item start.
 listItemEnd ($tpl)
 List item end.
 listStart ($tpl)
 List start.
 listEnd ($tpl)
 List end.

Static Public Member Functions

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

Protected Member Functions

 getNodeToggleOnClick ($a_node)
 Get onclick attribute for node toggling.
 getSelectOnClick ($a_node)
 Get onclick attribute for selecting radio/checkbox.

Protected Attributes

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

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"

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

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

Constructor.

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

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

{
$this->id = $a_expl_id;
$this->parent_obj = $a_parent_obj;
$this->parent_cmd = $a_parent_cmd;
// get open nodes
include_once("./Services/Authentication/classes/class.ilSessionIStorage.php");
$this->store = new ilSessionIStorage("expl2");
$open_nodes = $this->store->get("on_".$this->id);
$this->open_nodes = unserialize($open_nodes);
if (!is_array($this->open_nodes))
{
$this->open_nodes = array();
}
}

Member Function Documentation

ilExplorerBaseGUI::beforeRendering ( )

Before rendering.

Reimplemented in ilPublicSectionExplorerGUI, and ilLMExplorerGUI.

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

Referenced by getHTML(), and getNodeAsync().

{
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::closeNode ( )

Close node.

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

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

{
global $ilLog;
$id = $this->getNodeIdForDomNodeId($_GET["node_id"]);
if (in_array($id, $this->open_nodes))
{
$k = array_search($id, $this->open_nodes);
unset($this->open_nodes[$k]);
}
$this->store->set("on_".$this->id, serialize($this->open_nodes));
}

+ Here is the call graph for this function:

static ilExplorerBaseGUI::createHTMLExportDirs (   $a_target_dir)
static

Create html export directories.

Parameters
string$a_target_dirtarget directory

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

References ilUtil\makeDirParents().

Referenced by ilObjContentObject\exportHTML().

{
ilUtil::makeDirParents($a_target_dir."/Services/UIComponent/Explorer2/lib/jstree-v.pre1.0");
ilUtil::makeDirParents($a_target_dir."/Services/UIComponent/Explorer2/js");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getAjax ( )

Get ajax.

Returns
boolean ajax

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

References $ajax.

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

{
return $this->ajax;
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getChildsOfNode (   $a_parent_node_id)
abstract

Get childs of node.

Parameters
string$a_parent_idparent node id
Returns
array childs

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

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

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getContainerId ( )

Get container id.

Parameters
@return

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

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

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

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getDomNodeIdForNodeId (   $a_node_id)

Get DOM node id for node id.

Parameters
@return

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

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

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

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getHTML ( )

Get HTML.

Reimplemented in ilTreeExplorerGUI, and ilBookmarkBlockExplorerGUI.

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

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

{
global $tpl, $ilCtrl;
$this->beforeRendering();
$container_id = $this->getContainerId();
$container_outer_id = "il_expl2_jstree_cont_out_".$this->getId();
$tpl->addOnLoadCode($this->getOnLoadCode());
$etpl = new ilTemplate("tpl.explorer2.html", true, true, "Services/UIComponent/Explorer2");
// render childs
$root_node = $this->getRootNode();
if (!$this->getSkipRootNode() &&
$this->isNodeVisible($this->getRootNode()))
{
$this->listStart($etpl);
$this->renderNode($this->getRootNode(), $etpl);
$this->listEnd($etpl);
}
else
{
$childs = $this->getChildsOfNode($this->getNodeId($root_node));
$childs = $this->sortChilds($childs, $this->getNodeId($root_node));
$any = false;
foreach ($childs as $child_node)
{
if ($this->isNodeVisible($child_node))
{
if (!$any)
{
$this->listStart($etpl);
$any = true;
}
$this->renderNode($child_node, $etpl);
}
}
if ($any)
{
$this->listEnd($etpl);
}
}
$etpl->setVariable("CONTAINER_ID", $container_id);
$etpl->setVariable("CONTAINER_OUTER_ID", $container_outer_id);
return $etpl->get();
}

+ Here is the call graph for this function:

ilExplorerBaseGUI::getId ( )

Get id of explorer element.

Returns
integer id

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

Referenced by getNodeIdForDomNodeId().

{
return $this->id;
}

+ Here is the caller graph for this function:

static ilExplorerBaseGUI::getLocalExplorerJsPath ( )
static

Get local path of explorer js.

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

References $js_expl_path.

Referenced by ilObjContentObject\getSupplyingExportFiles().

{
}

+ Here is the caller graph for this function:

static ilExplorerBaseGUI::getLocalJsTreeJsPath ( )
static

Get local path of jsTree js.

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

References $js_tree_path.

Referenced by ilObjContentObject\getSupplyingExportFiles().

{
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getNodeAsync ( )

Get node asynchronously.

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

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

{
$this->beforeRendering();
if ($_GET["node_id"] != "")
{
$id = $this->getNodeIdForDomNodeId($_GET["node_id"]);
}
else
{
$id = $this->getNodeId($this->getRootNode());
}
$etpl = new ilTemplate("tpl.explorer2.html", true, true, "Services/UIComponent/Explorer2");
$this->renderChilds($id, $etpl);
echo $etpl->get("tag");
}

+ Here is the call graph for this function:

ilExplorerBaseGUI::getNodeIcon (   $a_node)
ilExplorerBaseGUI::getNodeIconAlt (   $a_node)

Get node icon alt attribute.

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

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

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

Referenced by renderNode().

{
return "";
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getNodeId (   $a_node)
abstract

Get id of a node.

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

Reimplemented in ilTreeExplorerGUI, and ilVirtualSkillTreeExplorerGUI.

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

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getNodeIdForDomNodeId (   $a_dom_node_id)

Get node id for dom node id.

Parameters
@return

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

References getId().

Referenced by closeNode(), getNodeAsync(), and openNode().

{
$i = strlen("exp_node_".$this->getId()."_");
return substr($a_dom_node_id, $i);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getNodeOnClick (   $a_node)

Get node onclick attribute.

Parameters
mixed$a_nodenode object/array
Returns
string onclick value

Reimplemented in ilTaxonomyExplorerGUI, ilBookmarkBlockExplorerGUI, ilIntLinkRepItemExplorerGUI, and ilLinkTargetObjectExplorerGUI.

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

References getSelectOnClick().

Referenced by renderNode().

{
if ($this->select_postvar != "")
{
return $this->getSelectOnClick($a_node);
}
return "";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getNodeTarget (   $a_node)

Get node target (frame) attribute.

Parameters
mixed$a_nodenode object/array
Returns
string target

Reimplemented in ilBookmarkBlockExplorerGUI.

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

Referenced by renderNode().

{
return "";
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getNodeToggleOnClick (   $a_node)
finalprotected

Get onclick attribute for node toggling.

Parameters
@return

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

References getDomNodeIdForNodeId(), and getNodeId().

Referenced by ilBookmarkBlockExplorerGUI\getNodeOnClick().

{
return "$('#".$this->getContainerId()."').jstree('toggle_node' , '#".
$this->getDomNodeIdForNodeId($this->getNodeId($a_node))."'); return false;";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getOfflineMode ( )
ilExplorerBaseGUI::getOnLoadCode ( )

Get on load code.

Parameters
@return

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

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

Referenced by getHTML().

{
global $ilCtrl;
$container_id = $this->getContainerId();
$container_outer_id = "il_expl2_jstree_cont_out_".$this->getId();
// collect open nodes
$open_nodes = array($this->getDomNodeIdForNodeId($this->getNodeId($this->getRootNode())));
foreach ($this->open_nodes as $nid)
{
$open_nodes[] = $this->getDomNodeIdForNodeId($nid);
}
foreach ($this->custom_open_nodes as $nid)
{
$dnode = $this->getDomNodeIdForNodeId($nid);
if (!in_array($dnode, $open_nodes))
{
$open_nodes[] = $dnode;
}
}
// ilias config options
$url = "";
if (!$this->getOfflineMode())
{
if (is_object($this->parent_obj))
{
$url = $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd, "", true);
}
else
{
$url = $ilCtrl->getLinkTargetByClass($this->parent_obj, $this->parent_cmd, "", true);
}
}
// secondary highlighted nodes
$shn = array();
foreach ($this->sec_highl_nodes as $sh)
{
$shn[] = $this->getDomNodeIdForNodeId($sh);
}
$config = array(
"container_id" => $container_id,
"container_outer_id" => $container_outer_id,
"url" => $url,
"second_hnodes" => $shn,
"ajax" => $this->getAjax(),
);
// jstree config options
$js_tree_config = array(
"core" => array(
"animation" => 300,
"initially_open" => $open_nodes,
"open_parents" => false,
"strings" => array("loading" => "Loading ...", "new_node" => "New node")
),
"plugins" => array("html_data", "themes"),
"themes" => array("dots" => false, "icons" => false, "theme" => ""),
"html_data" => array()
);
return 'il.Explorer2.init('.json_encode($config).', '.json_encode($js_tree_config).');';
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 ilTreeExplorerGUI, ilRepositoryExplorerGUI, ilVirtualSkillTreeExplorerGUI, ilLMTOCExplorerGUI, ilOrgUnitExplorerGUI, and ilSkillTemplateTreeExplorerGUI.

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

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getSecondaryHighlightedNodes ( )

Get secondary (background) highlighted nodes.

Returns
array array of node ids

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

References $sec_highl_nodes.

ilExplorerBaseGUI::getSelectOnClick (   $a_node)
finalprotected

Get onclick attribute for selecting radio/checkbox.

Parameters
@return

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

References getDomNodeIdForNodeId(), and getNodeId().

Referenced by getNodeOnClick().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getSkipRootNode ( )

Get skip root node.

Returns
boolean skip root node

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

References $skip_root_node.

Referenced by getHTML().

{
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::handleCommand ( )

Handle explorer internal command.

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

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

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

{
if ($_GET["exp_cmd"] != "" &&
$_GET["exp_cont"] == $this->getContainerId())
{
$cmd = $_GET["exp_cmd"];
if (in_array($cmd, array("openNode", "closeNode", "getNodeAsync")))
{
$this->$cmd();
}
return true;
}
return false;
}

+ Here is the call graph for this function:

static ilExplorerBaseGUI::init ( )
static

Init JS.

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

References $tpl, and iljQueryUtil\initjQuery().

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

{
global $tpl;
include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
$tpl->addJavascript(self::getLocalExplorerJsPath());
$tpl->addJavascript(self::getLocalJsTreeJsPath());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExplorerBaseGUI::isNodeClickable (   $a_node)

Is node clickable?

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

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

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

Referenced by renderNode().

{
return true;
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::isNodeHighlighted (   $a_node)

Is node highlighted?

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

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

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

Referenced by renderNode().

{
return false;
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::isNodeVisible (   $a_node)

Is node visible?

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

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

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

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

{
return true;
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::listEnd (   $tpl)

List end.

Parameters
@return

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

References $tpl.

Referenced by getHTML(), and renderChilds().

{
$tpl->touchBlock("list_end");
$tpl->touchBlock("tag");
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::listItemEnd (   $tpl)

List item end.

Parameters
@return

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

References $tpl.

Referenced by renderNode().

{
$tpl->touchBlock("list_item_end");
$tpl->touchBlock("tag");
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::listItemStart (   $tpl,
  $a_node 
)

List item start.

Parameters
@return

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

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

Referenced by renderNode().

{
$tpl->setCurrentBlock("list_item_start");
if ($this->getAjax() && $this->nodeHasVisibleChilds($a_node))
{
$tpl->touchBlock("li_closed");
}
$tpl->setVariable("DOM_NODE_ID",
$this->getDomNodeIdForNodeId($this->getNodeId($a_node)));
$tpl->parseCurrentBlock();
$tpl->touchBlock("tag");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExplorerBaseGUI::listStart (   $tpl)

List start.

Parameters
@return

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

References $tpl.

Referenced by getHTML(), and renderChilds().

{
$tpl->touchBlock("list_start");
$tpl->touchBlock("tag");
}

+ Here is the caller graph for this function:

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 141 of file class.ilExplorerBaseGUI.php.

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

Referenced by listItemStart().

{
$childs = $this->getChildsOfNode($this->getNodeId($a_node));
foreach ($childs as $child)
{
if ($this->isNodeVisible($child))
{
return true;
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExplorerBaseGUI::openNode ( )

Open node.

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

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

{
global $ilLog;
$id = $this->getNodeIdForDomNodeId($_GET["node_id"]);
if (!in_array($id, $this->open_nodes))
{
$this->open_nodes[] = $id;
}
$this->store->set("on_".$this->id, serialize($this->open_nodes));
}

+ Here is the call graph for this function:

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

Render childs.

Parameters
@return

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

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

Referenced by getNodeAsync(), and renderNode().

{
$childs = $this->getChildsOfNode($a_node_id);
$childs = $this->sortChilds($childs, $a_node_id);
if (count($childs) > 0)
{
$any = false;
foreach ($childs as $child)
{
if ($this->isNodeVisible($child))
{
if (!$any)
{
$this->listStart($tpl);
$any = true;
}
$this->renderNode($child, $tpl);
}
}
if ($any)
{
$this->listEnd($tpl);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExplorerBaseGUI::renderNode (   $a_node,
  $tpl 
)

Render node.

Parameters
@return

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

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

Referenced by getHTML(), and renderChilds().

{
$this->listItemStart($tpl, $a_node);
// select mode?
if ($this->select_postvar != "" && $this->isNodeClickable($a_node))
{
if ($this->select_multi)
{
$tpl->setCurrentBlock("cb");
if (in_array($this->getNodeId($a_node), $this->selected_nodes))
{
$tpl->setVariable("CHECKED", 'checked="checked"');
}
$tpl->setVariable("CB_VAL", $this->getNodeId($a_node));
$tpl->setVariable("CB_NAME", $this->select_postvar."[]");
$tpl->parseCurrentBlock();
}
else
{
$tpl->setCurrentBlock("rd");
if (in_array($this->getNodeId($a_node), $this->selected_nodes))
{
$tpl->setVariable("SELECTED", 'checked="checked"');
}
$tpl->setVariable("RD_VAL", $this->getNodeId($a_node));
$tpl->setVariable("RD_NAME", $this->select_postvar);
$tpl->parseCurrentBlock();
}
}
if ($this->isNodeHighlighted($a_node))
{
$tpl->touchBlock("hl");
}
$tpl->setCurrentBlock("content");
if ($this->getNodeIcon($a_node) != "")
{
$tpl->setVariable("ICON", ilUtil::img($this->getNodeIcon($a_node), $this->getNodeIconAlt($a_node))." ");
}
$tpl->setVariable("CONTENT", $this->getNodeContent($a_node));
$tpl->setVariable("HREF", $this->getNodeHref($a_node));
$target = $this->getNodeTarget($a_node);
if ($target != "")
{
$tpl->setVariable("TARGET", 'target="'.$target.'"');
}
if (!$this->isNodeClickable($a_node))
{
$tpl->setVariable("ONCLICK", 'onclick="return false;"');
$tpl->setVariable("A_CLASS", 'class="disabled"');
}
else
{
$onclick = $this->getNodeOnClick($a_node);
if ($onclick != "")
{
$tpl->setVariable("ONCLICK", 'onclick="'.$onclick.'"');
}
}
$tpl->parseCurrentBlock();
$tpl->touchBlock("tag");
if (!$this->getAjax() || in_array($this->getNodeId($a_node), $this->open_nodes)
|| in_array($this->getNodeId($a_node), $this->custom_open_nodes))
{
$this->renderChilds($this->getNodeId($a_node), $tpl);
}
$this->listItemEnd($tpl);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExplorerBaseGUI::setNodeOpen (   $a_id)

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

Parameters
@return

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

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

{
if (!in_array($a_id, $this->custom_open_nodes))
{
$this->custom_open_nodes[] = $a_id;
}
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::setNodeSelected (   $a_id)

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

Parameters
@return

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

Referenced by ilPublicSectionExplorerGUI\beforeRendering().

{
if (!in_array($a_id, $this->selected_nodes))
{
$this->selected_nodes[] = $a_id;
}
}

+ Here is the caller graph for this function:

ilExplorerBaseGUI::setOfflineMode (   $a_val)

Set offline mode.

Parameters
bool$a_valoffline mode

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

{
$this->offline_mode = $a_val;
}
ilExplorerBaseGUI::setSecondaryHighlightedNodes (   $a_val)

Set secondary (background) highlighted nodes.

Parameters
array$a_valarray of node ids

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

Referenced by ilLMTOCExplorerGUI\__construct().

{
$this->sec_highl_nodes = $a_val;
}

+ Here is the caller graph for this function:

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 372 of file class.ilExplorerBaseGUI.php.

Referenced by ilForumMoveTopicsExplorer\__construct().

{
$this->select_postvar = $a_postvar;
$this->select_multi = $a_multi;
}

+ Here is the caller graph for this function:

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 ilRepositoryExplorerGUI, ilRepositorySelectorExplorerGUI, ilAdministrationExplorerGUI, and ilOrgUnitExplorerGUI.

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

Referenced by getHTML(), and renderChilds().

{
return $a_childs;
}

+ Here is the caller graph for this function:

Field Documentation

ilExplorerBaseGUI::$ajax = false
protected

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

Referenced by getAjax().

ilExplorerBaseGUI::$custom_open_nodes = array()
protected

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

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

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

Referenced by getLocalExplorerJsPath().

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

ilExplorerBaseGUI::$offline_mode = false
protected

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

Referenced by getOfflineMode().

ilExplorerBaseGUI::$sec_highl_nodes = array()
protected

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

Referenced by getSecondaryHighlightedNodes().

ilExplorerBaseGUI::$select_postvar = ""
protected

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

ilExplorerBaseGUI::$selected_nodes = array()
protected

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

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: