ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
MailMainBarProvider.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Mail\Provider;
22 
27 
33 {
34  public function getStaticTopItems(): array
35  {
36  return [];
37  }
38 
39  public function getStaticSubItems(): array
40  {
41  $dic = $this->dic;
42 
43  $title = $this->dic->language()->txt("mm_mail");
44  $icon = $this->dic->ui()->factory()
45  ->symbol()
46  ->icon()
47  ->standard(Standard::MAIL, $title);
48 
49  return [
50  $this->mainmenu->link($this->if->identifier('mm_pd_mail'))
51  ->withTitle($title)
52  ->withAction('ilias.php?baseClass=ilMailGUI')
53  ->withParent(StandardTopItemsProvider::getInstance()->getCommunicationIdentification())
54  ->withPosition(10)
55  ->withSymbol($icon)
56  ->withNonAvailableReason(
57  $this->dic->ui()->factory()->legacy($this->dic->language()->txt('component_not_active'))
58  )
59  ->withAvailableCallable(
60  static function () use ($dic): bool {
61  return !$dic->user()->isAnonymous() && $dic->user()->getId() !== 0;
62  }
63  )
64  ->withVisibilityCallable(
65  static function () use ($dic): bool {
66  return $dic->rbac()->system()->checkAccess(
67  'internal_mail',
69  );
70  }
71  ),
72  ];
73  }
74 }
user()
Get the current user.
Definition: Container.php:62
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20
language()
Get interface to the i18n service.
Definition: Container.php:86
rbac()
Get interface to get interfaces to all things rbac.
Definition: Container.php:46