ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\GlobalScreen\Provider\Provider\ChatMainBarProvider Class Reference
+ Inheritance diagram for ILIAS\GlobalScreen\Provider\Provider\ChatMainBarProvider:
+ Collaboration diagram for ILIAS\GlobalScreen\Provider\Provider\ChatMainBarProvider:

Public Member Functions

 getStaticTopItems ()
 
 getStaticSubItems ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider
 __construct (Container $dic)
 
 getAllIdentifications ()
 
 provideTypeInformation ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (protected Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider
Container $dic
 
IdentificationProviderInterface $if
 
MainMenuItemFactory $mainmenu
 

Detailed Description

Definition at line 36 of file ChatMainBarProvider.php.

Member Function Documentation

◆ getStaticSubItems()

ILIAS\GlobalScreen\Provider\Provider\ChatMainBarProvider::getStaticSubItems ( )
Returns
isItem[] These are Entries which will be available for configuration.

Implements ILIAS\GlobalScreen\Scope\MainMenu\Provider\StaticMainMenuProvider.

Definition at line 43 of file ChatMainBarProvider.php.

References ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider\$dic, ilObjChatroom\_getPublicRefId(), ILIAS\UI\Component\Symbol\Icon\Standard\CHTA, ILIAS\MainMenu\Provider\StandardTopItemsProvider\getInstance(), if, ILIAS\Repository\int(), ILIAS\DI\Container\rbac(), ILIAS\DI\Container\ui(), ILIAS\DI\Container\user(), ILIAS\GlobalScreen\Scope\Footer\Factory\withAction(), and ILIAS\GlobalScreen\Scope\Footer\Factory\withTitle().

43  : array
44  {
45  $dic = $this->dic;
46 
47  $publicChatRefId = ilObjChatroom::_getPublicRefId();
48  $publicChatObjId = (int) $dic['ilObjDataCache']->lookupObjId($publicChatRefId);
49 
50  $icon = $this->dic->ui()->factory()
51  ->symbol()
52  ->icon()
53  ->standard(Standard::CHTA, $this->dic->language()->txt('public_room'));
54 
55  $this->dic->ctrl()->setParameterByClass(ilObjChatroomGUI::class, 'ref_id', $publicChatRefId);
56  $chatUrl = $this->dic->ctrl()->getLinkTargetByClass(
57  [
58  ilRepositoryGUI::class,
59  ilObjChatroomGUI::class
60  ],
61  'view'
62  );
63 
64  return [
65  $this->mainmenu->link($this->if->identifier('mm_public_chat'))
66  ->withTitle($this->dic->language()->txt('public_room'))
67  ->withAction($chatUrl)
68  ->withParent(StandardTopItemsProvider::getInstance()->getCommunicationIdentification())
69  ->withPosition(30)
70  ->withSymbol($icon)
71  ->withNonAvailableReason(
72  $this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active'))
73  )
74  ->withAvailableCallable(
75  static fn(): bool => $publicChatObjId > 0
76  )
77  ->withVisibilityCallable(
78  static function () use ($dic, $publicChatRefId): bool {
79  if (0 === $dic->user()->getId() || $dic->user()->isAnonymous()) {
80  return false;
81  }
82 
83  $hasPublicChatRoomAccess = $dic
84  ->rbac()
85  ->system()
86  ->checkAccessOfUser($dic->user()->getId(), 'read', $publicChatRefId);
87 
88  return (
89  (new ilSetting('chatroom'))->get('chat_enabled', '0') &&
90  $hasPublicChatRoomAccess
91  );
92  }
93  ),
94  ];
95  }
user()
Get the current user.
Definition: Container.php:71
withAction(URI|Signal|string $action)
if(!file_exists('../ilias.ini.php'))
rbac()
Get interface to get interfaces to all things rbac.
Definition: Container.php:55
ui()
Get the interface to get services from UI framework.
Definition: Container.php:127
+ Here is the call graph for this function:

◆ getStaticTopItems()

ILIAS\GlobalScreen\Provider\Provider\ChatMainBarProvider::getStaticTopItems ( )
Returns
TopParentItem[] These are Slates which will be available for configuration.

Implements ILIAS\GlobalScreen\Scope\MainMenu\Provider\StaticMainMenuProvider.

Definition at line 38 of file ChatMainBarProvider.php.

38  : array
39  {
40  return [];
41  }

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