ILIAS  release_8 Revision v8.24
MailMainBarProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Mail\Provider;
22
27
33{
34 public function getStaticTopItems(): array
35 {
36 return [];
37 }
38
39 public function getStaticSubItems(): array
40 {
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
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
Class for global mail information (e.g.
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
This describes the specific behavior of an ILIAS standard icon.
Definition: Standard.php:27