ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\MainMenu\Provider\ChatMainBarProvider Class Reference
+ Inheritance diagram for ILIAS\MainMenu\Provider\ChatMainBarProvider:
+ Collaboration diagram for ILIAS\MainMenu\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 (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
 $dic
 
 $if
 
 $mainmenu
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 $dic
 

Detailed Description

Definition at line 13 of file ChatMainBarProvider.php.

Member Function Documentation

◆ getStaticSubItems()

ILIAS\MainMenu\Provider\ChatMainBarProvider::getStaticSubItems ( )

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

Definition at line 26 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(), and if.

26  : array
27  {
28  $dic = $this->dic;
29 
30  $publicChatRefId = (int) \ilObjChatroom::_getPublicRefId();
31  $publicChatObjId = (int) $dic['ilObjDataCache']->lookupObjId($publicChatRefId);
32 
33  $icon = $this->dic->ui()->factory()
34  ->symbol()
35  ->icon()
36  ->standard(Standard::CHTA, $this->dic->language()->txt('public_room'))->withIsOutlined(true);
37 
38  return [
39  $this->mainmenu->link($this->if->identifier('mm_public_chat'))
40  ->withTitle($this->dic->language()->txt('public_room'))
41  ->withAction('ilias.php?baseClass=ilRepositoryGUI&cmd=view&ref_id=' . $publicChatRefId)
42  ->withParent(StandardTopItemsProvider::getInstance()->getCommunicationIdentification())
43  ->withPosition(10)
44  ->withSymbol($icon)
45  ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('component_not_active')}"))
46  ->withAvailableCallable(
47  function () use ($publicChatObjId) : bool {
48  return $publicChatObjId > 0;
49  }
50  )
51  ->withVisibilityCallable(
52  function () use ($dic, $publicChatRefId) : bool {
53  if (0 === (int) $dic->user()->getId() || $dic->user()->isAnonymous()) {
54  return false;
55  }
56 
57  $hasPublicChatRoomAccess = $dic
58  ->rbac()
59  ->system()
60  ->checkAccessOfUser($dic->user()->getId(), 'read', $publicChatRefId);
61 
62  return (
63  (new \ilSetting('chatroom'))->get('chat_enabled') &&
64  $hasPublicChatRoomAccess
65  );
66  }
67  ),
68  ];
69  }
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12
+ Here is the call graph for this function:

◆ getStaticTopItems()

ILIAS\MainMenu\Provider\ChatMainBarProvider::getStaticTopItems ( )

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

Definition at line 18 of file ChatMainBarProvider.php.

18  : array
19  {
20  return [];
21  }

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