ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilMailExplorer.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once("./Services/UIComponent/Explorer2/classes/class.ilTreeExplorerGUI.php");
5
14{
15 public function __construct($a_parent_obj, $a_parent_cmd, $a_user_id)
16 {
17 $this->tree = new ilTree($a_user_id);
18 $this->tree->setTableNames('mail_tree','mail_obj_data');
19
20 parent::__construct("mail_exp", $a_parent_obj, $a_parent_cmd, $this->tree);
21
22 $this->setSkipRootNode(false);
23 $this->setAjax(false);
24 $this->setOrderField("title,m_type");
25 }
26
27 function getNodeContent($a_node)
28 {
29 global $lng;
30
31 if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
32 {
33 return $lng->txt("mail_folders");
34 }
35
36 if($a_node["depth"] < 3)
37 {
38 return $lng->txt("mail_".$a_node["title"]);
39 }
40
41 return $a_node["title"];
42 }
43
44 function getNodeIcon($a_node)
45 {
46 if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
47 {
48 return ilUtil::getImagePath("icon_mail.svg");
49 }
50 else
51 {
52 $icon_type = ($a_node["m_type"] == "user_folder")
53 ? "local"
54 : $a_node["m_type"];
55 return ilUtil::getImagePath("icon_".$icon_type.".svg");
56 }
57 }
58
59 function getNodeIconAlt($a_node)
60 {
61 global $lng;
62
63 if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
64 {
65 return $lng->txt("icon")." ".$lng->txt("mail_folders");
66 }
67 else
68 {
69 return $lng->txt("icon")." ".$lng->txt($a_node["m_type"]);
70 }
71 }
72
73 function getNodeHref($a_node)
74 {
75 global $ilCtrl;
76
77 if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
78 {
79 $a_node["child"] = 0;
80 }
81
82 $ilCtrl->setParameter($this->parent_obj, "mobj_id", $a_node["child"]);
83 $href = $ilCtrl->getLinkTargetByClass("ilMailFolderGUI");
84 $ilCtrl->setParameter($this->parent_obj, "mobj_id", $_GET["mobj_id"]);
85
86 return $href;
87 }
88
89 function isNodeHighlighted($a_node)
90 {
91 if ($a_node["child"] == $_GET["mobj_id"] ||
92 ($_GET["mobj_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode())))
93 {
94 return true;
95 }
96 return false;
97 }
98} // END class.ilMailExplorer
99
100?>
$_GET["client_id"]
setSkipRootNode($a_val)
Set skip root node.
Class Mail Explorer class for explorer view for mailboxes.
getNodeHref($a_node)
Get href for node.
__construct($a_parent_obj, $a_parent_cmd, $a_user_id)
Constructor.
getNodeIcon($a_node)
Get node icon path.
getNodeContent($a_node)
Get content of a node.
getNodeIconAlt($a_node)
Get node icon alt attribute.
isNodeHighlighted($a_node)
Is node highlighted?
Explorer class that works on tree objects (Services/Tree)
getNodeId($a_node)
Get id for node.
setOrderField($a_val, $a_numeric=false)
Set order field.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40