ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
ChatMainBarProvider.php
Go to the documentation of this file.
1
<?php declare(strict_types=1);
2
3
namespace
ILIAS\MainMenu\Provider
;
4
5
use
ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider
;
6
use
ILIAS\UI\Component\Symbol\Icon\Standard
;
7
13
class
ChatMainBarProvider
extends
AbstractStaticMainMenuProvider
14
{
18
public
function
getStaticTopItems
() : array
19
{
20
return
[];
21
}
22
26
public
function
getStaticSubItems
() : 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
}
70
}
ILIAS\MainMenu\Provider
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
ChatMainBarProvider.php:3
Standard
ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider
Interface StaticMainMenuProvider.
Definition:
AbstractStaticMainMenuProvider.php:32
AbstractStaticMainMenuProvider
if
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition:
confirmReg.php:12
ILIAS\MainMenu\Provider\ChatMainBarProvider\getStaticTopItems
getStaticTopItems()
Definition:
ChatMainBarProvider.php:18
ILIAS\MainMenu\Provider\StandardTopItemsProvider\getInstance
static getInstance()
Definition:
StandardTopItemsProvider.php:71
ILIAS\UI\Component\Symbol\Icon\Standard\CHTA
const CHTA
Definition:
Standard.php:79
ilObjChatroom\_getPublicRefId
static _getPublicRefId()
Definition:
class.ilObjChatroom.php:145
ILIAS\MainMenu\Provider\ChatMainBarProvider\getStaticSubItems
getStaticSubItems()
Definition:
ChatMainBarProvider.php:26
ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider\$dic
$dic
Definition:
AbstractStaticMainMenuProvider.php:37
ILIAS\MainMenu\Provider\ChatMainBarProvider
Definition:
ChatMainBarProvider.php:13
ilSetting
Modules
Chatroom
classes
Provider
ChatMainBarProvider.php
Generated on Mon Apr 7 2025 21:00:56 for ILIAS by
1.8.13 (using
Doxyfile
)