ILIAS  Release_4_4_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.
 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.
 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.

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

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 ilVirtualSkillTreeExplorerGUI, ilBookmarkBlockExplorerGUI, ilMediaPoolExplorerGUI, ilSCORM2004EditorExplorerGUI, ilBookmarkExplorerGUI, and ilMailExplorer.

Definition at line 30 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 ilLMExplorerGUI.

Definition at line 485 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 446 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 69 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 300 of file class.ilExplorerBaseGUI.php.

References $ajax.

Referenced by getHTML(), 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, ilPersonalSkillExplorerGUI, ilVirtualSkillTreeExplorerGUI, ilOrgUnitExplorerGUI, 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 422 of file class.ilExplorerBaseGUI.php.

Referenced by getHTML(), 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 716 of file class.ilExplorerBaseGUI.php.

Referenced by getHTML(), getNodeToggleOnClick(), 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.

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

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

{
global $tpl, $ilCtrl;
$this->beforeRendering();
$tpl->addJavascript(self::getLocalExplorerJsPath());
$tpl->addJavascript(self::getLocalJsTreeJsPath());
$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);
}
}
$config = array(
"container_id" => $container_id,
"container_outer_id" => $container_outer_id,
"url" => $url,
"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()
);
$tpl->addOnLoadCode('il.Explorer2.init('.json_encode($config).', '.json_encode($js_tree_config).');');
$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 258 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 51 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 59 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 463 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::getNodeContent (   $a_node)
abstract
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 ilTreeExplorerGUI, ilLMTOCExplorerGUI, ilRepositoryExplorerGUI, ilRepositorySelectorExplorerGUI, ilAdministrationExplorerGUI, ilSCORM2004EditorExplorerGUI, ilBookmarkExplorerGUI, ilLMEditorExplorerGUI, and ilMailExplorer.

Definition at line 184 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(), 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 727 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 ilBookmarkBlockExplorerGUI.

Definition at line 206 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 195 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 325 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 ( )

Get offline mode.

Returns
bool offline mode

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

References $offline_mode.

Referenced by ilLMExplorerGUI\__construct(), ilLMExplorerGUI\beforeRendering(), getHTML(), ilLMTOCExplorerGUI\getNodeHref(), ilLMTOCExplorerGUI\getNodeIcon(), and ilLMTOCExplorerGUI\isNodeClickable().

{
}

+ 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, ilSkillTemplateTreeExplorerGUI, and ilOrgUnitExplorerGUI.

Referenced by getHTML(), and getNodeAsync().

+ Here is the caller graph for this function:

ilExplorerBaseGUI::getSelectOnClick (   $a_node)
finalprotected

Get onclick attribute for selecting radio/checkbox.

Parameters
@return

Definition at line 337 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 280 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 400 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:

ilExplorerBaseGUI::isNodeClickable (   $a_node)

Is node clickable?

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

Reimplemented in ilRepositoryExplorerGUI, ilRepositorySelectorExplorerGUI, ilAdministrationExplorerGUI, ilVirtualSkillTreeExplorerGUI, ilSkillTreeExplorerGUI, ilPersonalSkillExplorerGUI, ilLMTOCExplorerGUI, ilOrgUnitExplorerGUI, and ilSkillSelectorGUI.

Definition at line 243 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, ilLMExplorerGUI, ilTaxonomyExplorerGUI, ilSCORM2004EditorExplorerGUI, ilBookmarkExplorerGUI, ilMailExplorer, ilMediaPoolExplorerGUI, ilLMTOCExplorerGUI, ilBookmarkBlockExplorerGUI, and ilBookmarkMoveExplorerGUI.

Definition at line 232 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, and ilForumMoveTopicsExplorer.

Definition at line 221 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 782 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 758 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 739 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 770 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 140 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 430 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 683 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

Reimplemented in ilForumMoveTopicsExplorer.

Definition at line 603 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 != "")
{
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 311 of file class.ilExplorerBaseGUI.php.

Referenced by 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 363 of file class.ilExplorerBaseGUI.php.

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

Set offline mode.

Parameters
bool$a_valoffline mode

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

{
$this->offline_mode = $a_val;
}
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 351 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 162 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::$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: