19 declare(strict_types=1);
39 $this->
http = $DIC->http();
42 $this->tree =
new ilTree($userId);
43 $this->tree->setTableNames(
'mail_tree',
'mail_obj_data');
45 $this->root_folder_id = (
new ilMailbox($userId))->getRooFolder();
46 $this->root_node_id = $this->tree->readRootId();
48 if ($this->root_folder_id !== $this->root_node_id) {
49 $DIC->logger()->mail()->error(
50 'Root folder id {root_folder_id} does not match root node id {root_node_id} for user {usr_id}',
52 'root_folder_id' => $this->root_folder_id,
53 'root_node_id' => $this->root_node_id,
70 if ($this->
http->wrapper()->post()->has(
'mobj_id')) {
71 $folderId = $this->
http->wrapper()->post()->retrieve(
'mobj_id', $this->
refinery->kindlyTo()->int());
72 } elseif ($this->
http->wrapper()->query()->has(
'mobj_id')) {
73 $folderId = $this->
http->wrapper()->query()->retrieve(
'mobj_id', $this->
refinery->kindlyTo()->int());
75 $folderId = $this->
refinery->byTrying([
77 $this->
refinery->always($this->currentFolderId),
81 $this->currentFolderId = $folderId;
91 if (!isset($root[
'child']) && $this->root_node_id !== $this->root_folder_id) {
96 $root[
'title'] =
'a_root';
97 $root[
'm_type'] =
'root';
99 $root[
'rgt'] = PHP_INT_MAX;
100 $root[
'user_id'] = $this->tree->getTreeId();
108 return $this->
lng->txt(
"mail_folders");
113 $f = $this->
ui->factory();
117 ->withData($this->tree->getChilds($this->root_node_id))
118 ->withHighlightOnNodeClick(
false);
126 return parent::build($factory, $record, $environment)
128 $this->currentFolderId === (
int) $record[
'child']
149 $content = $this->
lng->txt(
'mail_folders');
150 } elseif ($a_node[
'depth'] < 3) {
151 $content = $this->
lng->txt(
'mail_' . $a_node[
'title']);
167 $iconType = $a_node[
'm_type'];
168 if ($a_node[
'm_type'] ===
'user_folder') {
181 $a_node[
'child'] = 0;
184 $this->
ctrl->setParameterByClass(ilMailFolderGUI::class,
'mobj_id', $a_node[
'child']);
185 $href = $this->
ctrl->getLinkTargetByClass([ilMailGUI::class, ilMailFolderGUI::class]);
186 $this->
ctrl->clearParametersByClass(ilMailFolderGUI::class);
static get(string $a_var)
setSkipRootNode(bool $a_val)
This describes a Tree Node.
build(Factory $factory, $record, $environment=null)
__construct(ilMailGUI $parentObject, int $userId)
withHighlighted(bool $expanded)
Set $highlighted to true to have this node highlighted on loading.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
readonly GlobalHttpState $http
static http()
Fetches the global http state from ILIAS.
Mail Box class Base class for creating and handling mail boxes.
readonly int $root_folder_id
readonly Refinery $refinery
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getNodeId($a_node)
Get id for node.
getNodeStateToggleCmdClasses($record)
This describes a Tree Control.
repairRootNode(array $root)
Workaround for: https://mantis.ilias.de/view.php?id=40716.
Explorer class that works on tree objects (Services/Tree)
__construct(Container $dic, ilPlugin $plugin)
setOrderField(string $a_val, bool $a_numeric=false)