ILIAS  release_7 Revision v7.30-3-g800a261c036
ilMailExplorer Class Reference

Class Mail Explorer class for explorer view for mailboxes. More...

+ Inheritance diagram for ilMailExplorer:
+ Collaboration diagram for ilMailExplorer:

Public Member Functions

 __construct ($parentObject, $userId)
 ilMailExplorer constructor. More...
 
 getTreeLabel ()
 
 getTreeComponent ()
 
 build (Factory $factory, $record, $environment=null)
 
 getNodeContent ($node)
 
 getNodeIconAlt ($a_node)
 
 getNodeIcon ($node)
 
 getNodeHref ($node)
 
- Public Member Functions inherited from ilTreeExplorerGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd, $a_tree)
 Constructor. More...
 
 getTree ()
 Get tree. More...
 
 setOrderField ($a_val, $a_numeric=false)
 Set order field. More...
 
 getOrderField ()
 Get order field. More...
 
 setTypeWhiteList ($a_val)
 Set type white list. More...
 
 getTypeWhiteList ()
 Get type white list. More...
 
 setTypeBlackList ($a_val)
 Set type black list. More...
 
 getTypeBlackList ()
 Get type black list. More...
 
 setPreloadChilds ($a_val)
 Set preload childs. More...
 
 getPreloadChilds ()
 Get preload childs. More...
 
 getSuccessorNode ($a_node_id, $a_type="")
 Get successor node (currently only(!) based on lft/rgt tree values) More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 getNodeId ($a_node)
 Get id for node. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getRootNode ()
 Get root node. More...
 
 setRootId ($a_root)
 
 setPathOpen ($a_id)
 Set node path to be opened. More...
 
 getHTML ($new=false)
 Get HTML. More...
 
 getChildren ($node, $environment=null)
 Get a list of records (that list can also be empty).Each record will be relayed to $this->build to retrieve a Node. Also, each record will be asked for Sub-Nodes using this function.
Returns
array
More...
 
 build (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
 
 getTreeLabel ()
 
 getTreeComponent ()
 Get Tree UI. More...
 
 toggleExplorerNodeState ()
 Should be called by an ilCtrl-enabled command class if a tree node toggle action should be processed. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd)
 Constructor. More...
 
 setChildLimit ($a_val)
 Set child limit. More...
 
 getChildLimit ()
 Get child limit. More...
 
 setSearchTerm ($a_val)
 Set search term. More...
 
 getSearchTerm ()
 Get search term. More...
 
 setMainTemplate ($a_main_tpl=null)
 Set main template (that is responsible for adding js/css) 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...
 
- Public Member Functions inherited from ILIAS\UI\Component\Tree\TreeRecursion
 build (Node\Factory $factory, $record, $environment=null)
 Build and return a Node. More...
 

Protected Member Functions

 initFolder ()
 
 getNodeStateToggleCmdClasses ($record)
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 Preload childs. More...
 
 matches ($node)
 Does a node match a search term (or is search term empty) More...
 
 getRootId ()
 
 createNode (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record)
 Creates at tree node, can be overwritten in derivatives if another node type should be used. More...
 
 getNodeStateToggleCmdClasses ($record)
 Should return an array of ilCtrl-enabled command classes which should be used to build the URL for the expand/collapse actions applied on a tree node. More...
 
 render ()
 Render tree. More...
 
- Protected Member Functions inherited from ilExplorerBaseGUI
 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...
 
 isNodeOpen ($node_id)
 Get all open nodes. More...
 
 getJSTreePlugins ()
 

Protected Attributes

 $currentFolderId = 0
 
- Protected Attributes inherited from ilTreeExplorerGUI
 $lng
 
 $httpRequest
 
 $tree = null
 
 $tree_label = ""
 
 $order_field = ""
 
 $order_field_numeric = false
 
 $type_white_list = array()
 
 $type_black_list = array()
 
 $childs = array()
 
 $preloaded = false
 
 $preload_childs = false
 
 $root_node_data = null
 
 $all_childs = array()
 
 $ui
 
- Protected Attributes inherited from ilExplorerBaseGUI
 $log
 
 $ctrl
 
 $tpl
 
 $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
 
 $search_term = ""
 
 $open_nodes = []
 
 $store
 
 $parent_obj
 
 $child_limit = 0
 
 $parent_cmd = ''
 

Private Attributes

 $parentObject
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 Get local path of explorer js. More...
 
static getLocalJsTreeJsPath ()
 Get local path of jsTree js. More...
 
static getLocalJsTreeCssPath ()
 Get local path of jsTree js. More...
 
static createHTMLExportDirs ($a_target_dir)
 Create html export directories. More...
 
static init ($a_main_tpl=null)
 Init JS. More...
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static $js_tree_path = "./node_modules/jstree/dist/jstree.js"
 
static $js_tree_path_css = "./node_modules/jstree/dist/themes/default/style.min.css"
 
static $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

Detailed Description

Class Mail Explorer class for explorer view for mailboxes.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de

Definition at line 14 of file class.ilMailExplorer.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailExplorer::__construct (   $parentObject,
  $userId 
)

ilMailExplorer constructor.

Parameters
$parentObject
$userId

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

References $parentObject, ILIAS\GlobalScreen\Provider\__construct(), initFolder(), ilExplorerBaseGUI\setAjax(), ilTreeExplorerGUI\setOrderField(), and ilExplorerBaseGUI\setSkipRootNode().

28  {
29  $this->parentObject = $parentObject;
30 
31  $this->tree = new ilTree($userId);
32  $this->tree->setTableNames('mail_tree', 'mail_obj_data');
33 
34  parent::__construct('mail_exp', $parentObject, '', $this->tree);
35 
36  $this->initFolder();
37 
38  $this->setSkipRootNode(true);
39  $this->setAjax(false);
40  $this->setOrderField('title,m_type');
41  }
setSkipRootNode($a_val)
Set skip root node.
__construct(Container $dic, ilPlugin $plugin)
setOrderField($a_val, $a_numeric=false)
Set order field.
+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ilMailExplorer::build ( Factory  $factory,
  $record,
  $environment = null 
)

Definition at line 82 of file class.ilMailExplorer.php.

86  : Node {
87  $node = parent::build($factory, $record, $environment);
88 
89  return $node->withHighlighted($this->currentFolderId === (int) $record['child']);
90  }
This describes a Tree Node.
Definition: Node.php:15

◆ getNodeContent()

ilMailExplorer::getNodeContent (   $node)

Definition at line 105 of file class.ilMailExplorer.php.

References ilTreeExplorerGUI\getNodeId(), and ilTreeExplorerGUI\getRootNode().

106  {
107  $content = $node['title'];
108 
109  if ($node['child'] == $this->getNodeId($this->getRootNode())) {
110  $content = $this->lng->txt('mail_folders');
111  } elseif ($node['depth'] < 3) {
112  $content = $this->lng->txt('mail_' . $node['title']);
113  }
114 
115  return $content;
116  }
getNodeId($a_node)
Get id for node.
getRootNode()
Get root node.
+ Here is the call graph for this function:

◆ getNodeHref()

ilMailExplorer::getNodeHref (   $node)

Definition at line 153 of file class.ilMailExplorer.php.

References ilTreeExplorerGUI\getNodeId(), and ilTreeExplorerGUI\getRootNode().

154  {
155  if ($node['child'] == $this->getNodeId($this->getRootNode())) {
156  $node['child'] = 0;
157  }
158 
159  $this->ctrl->setParameterByClass('ilMailFolderGUI', 'mobj_id', $node['child']);
160  $href = $this->ctrl->getLinkTargetByClass(['ilMailGUI', 'ilMailFolderGUI'], '', '', false, false);
161  $this->ctrl->clearParametersByClass('ilMailFolderGUI');
162 
163  return $href;
164  }
getNodeId($a_node)
Get id for node.
getRootNode()
Get root node.
+ Here is the call graph for this function:

◆ getNodeIcon()

ilMailExplorer::getNodeIcon (   $node)

Definition at line 134 of file class.ilMailExplorer.php.

References ilUtil\getImagePath(), ilTreeExplorerGUI\getNodeId(), and ilTreeExplorerGUI\getRootNode().

135  {
136  if ($node['child'] == $this->getNodeId($this->getRootNode())) {
137  $icon = ilUtil::getImagePath('icon_mail.svg');
138  } else {
139  $iconType = $node['m_type'];
140  if ($node['m_type'] === 'user_folder') {
141  $iconType = 'local';
142  }
143 
144  $icon = ilUtil::getImagePath('icon_' . $iconType . '.svg');
145  }
146 
147  return $icon;
148  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getNodeId($a_node)
Get id for node.
getRootNode()
Get root node.
+ Here is the call graph for this function:

◆ getNodeIconAlt()

ilMailExplorer::getNodeIconAlt (   $a_node)

Definition at line 118 of file class.ilMailExplorer.php.

References ilTreeExplorerGUI\getNodeId(), ilTreeExplorerGUI\getRootNode(), and ilUtil\prepareFormOutput().

119  {
120  $content = ilUtil::prepareFormOutput($a_node['title']);
121 
122  if ($a_node['child'] == $this->getNodeId($this->getRootNode())) {
123  $content = $this->lng->txt('mail_folders');
124  } elseif ($a_node['depth'] < 3) {
125  $content = $this->lng->txt('mail_' . $a_node['title']);
126  }
127 
128  return $content;
129  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getNodeId($a_node)
Get id for node.
getRootNode()
Get root node.
+ Here is the call graph for this function:

◆ getNodeStateToggleCmdClasses()

ilMailExplorer::getNodeStateToggleCmdClasses (   $record)
protected

Definition at line 95 of file class.ilMailExplorer.php.

95  : array
96  {
97  return [
98  'ilMailGUI',
99  ];
100  }

◆ getTreeComponent()

ilMailExplorer::getTreeComponent ( )

Definition at line 67 of file class.ilMailExplorer.php.

References Vendor\Package\$f, ilTreeExplorerGUI\$tree, getTreeLabel(), and ui().

67  : Tree
68  {
69  $f = $this->ui->factory();
70 
71  $tree = $f->tree()
72  ->expandable($this->getTreeLabel(), $this)
73  ->withData($this->tree->getChilds((int) $this->tree->readRootId()))
74  ->withHighlightOnNodeClick(false);
75 
76  return $tree;
77  }
ui()
Definition: ui.php:5
This describes a Tree Control.
Definition: Tree.php:13
+ Here is the call graph for this function:

◆ getTreeLabel()

ilMailExplorer::getTreeLabel ( )
Returns
string

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

Referenced by getTreeComponent().

60  {
61  return $this->lng->txt("mail_folders");
62  }
+ Here is the caller graph for this function:

◆ initFolder()

ilMailExplorer::initFolder ( )
protected

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

Referenced by __construct().

46  : void
47  {
48  $folderId = (int) ($this->httpRequest->getParsedBody()['mobj_id'] ?? 0);
49  if (0 === $folderId) {
50  $folderId = (int) ($this->httpRequest->getQueryParams()['mobj_id'] ?? 0);
51  }
52 
53  $this->currentFolderId = (int) $folderId;
54  }
+ Here is the caller graph for this function:

Field Documentation

◆ $currentFolderId

ilMailExplorer::$currentFolderId = 0
protected

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

◆ $parentObject

ilMailExplorer::$parentObject
private

Definition at line 17 of file class.ilMailExplorer.php.

Referenced by __construct().


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