ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
MailGlobalScreenToolProvider.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 
4 
11 {
12  const SHOW_MAIL_FOLDERS_TOOL = 'show_mail_folders_tool';
13 
14 
18  public function isInterestedInContexts() : \ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection
19  {
20  return $this->context_collection->main()->repository()->administration();
21  }
22 
23 
27  public function getToolsForContextStack(\ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts $called_contexts) : array
28  {
29  $identification = function ($id) {
30  return $this->identification_provider->contextAwareIdentifier($id);
31  };
32 
33  $tools = [];
34 
35  $additional_data = $called_contexts->getLast()->getAdditionalData();
36  if ($additional_data->exists(self::SHOW_MAIL_FOLDERS_TOOL) && $additional_data->get(self::SHOW_MAIL_FOLDERS_TOOL) === true) {
37  $title = $this->dic->language()->txt('mail_folders');
38  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('mail', $title)->withIsOutlined(true);
39 
40  $tools[] = $this->factory
41  ->tool($identification('mail_folders_tree'))
42  ->withTitle($title)
43  ->withSymbol($icon)
44  ->withContentWrapper(function () {
45  $exp = new ilMailExplorer(new ilMailGUI(), $this->dic->user()->getId());
46 
47  return $this->dic->ui()->factory()->legacy($exp->getHTML(true));
48  });
49  }
50 
51  return $tools;
52  }
53 }
Class ChatMainBarProvider .
Class Mail Explorer class for explorer view for mailboxes.
getToolsForContextStack(\ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts $called_contexts)
Class MailGlobalScreenToolProvider.