Adds link to chat.
More...
◆ __construct()
ilChatUserActionProvider::__construct |
( |
| ) |
|
Constructor.
Definition at line 42 of file class.ilChatUserActionProvider.php.
References ilObjChatroom\_getPublicRefId().
44 parent::__construct();
46 include_once
'Modules/Chatroom/classes/class.ilObjChatroom.php';
49 $chatSettings =
new ilSetting(
'chatroom');
50 $this->chat_enabled = $chatSettings->get(
'chat_enabled');
51 $this->osc_enabled = $chatSettings->get(
'enable_osc');
53 $this->lng->loadLanguageModule(
'chatroom');
◆ acceptsMessages()
ilChatUserActionProvider::acceptsMessages |
( |
|
$a_user_id | ) |
|
|
protected |
◆ checkUserChatAccess()
ilChatUserActionProvider::checkUserChatAccess |
( |
|
$a_user_id | ) |
|
|
protected |
Check user chat access.
- Parameters
-
- Returns
- bool
Definition at line 82 of file class.ilChatUserActionProvider.php.
References $GLOBALS.
Referenced by collectActionsForTargetUser().
84 if (!array_key_exists($a_user_id, self::$user_access)) {
85 self::$user_access[$a_user_id] =
$GLOBALS[
'DIC']->rbac()->system()->checkAccessOfUser($a_user_id,
'read', $this->pub_ref_id);
88 return self::$user_access[$a_user_id];
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
◆ collectActionsForTargetUser()
ilChatUserActionProvider::collectActionsForTargetUser |
( |
|
$a_target_user | ) |
|
Collect all actions.
- Parameters
-
int | $a_target_user | target user |
- Returns
- ilUserActionCollection collection
Definition at line 110 of file class.ilChatUserActionProvider.php.
References ilObjUser\_lookupLogin(), acceptsMessages(), array, checkUserChatAccess(), ilUserActionCollection\getInstance(), and ilUserActionProvider\getUserId().
114 if (!$this->chat_enabled) {
121 $f->setType(
"invite");
122 $f->setText($this->lng->txt(
'chat_invite_public_room'));
123 $f->setHref(
'./ilias.php?baseClass=ilRepositoryGUI&ref_id=' . $this->pub_ref_id .
'&usr_id=' . $a_target_user .
'&cmd=view-invitePD');
124 $coll->addAction($f);
128 if ($this->osc_enabled && $a_target_user != $this->
getUserId()) {
131 $f->setType(
"invite_osd");
133 $f->setText($this->lng->txt(
'chat_osc_start_conversation'));
135 'onscreenchat-userid' => $a_target_user,
139 $f->setText($this->lng->txt(
'chat_osc_doesnt_accept_msg'));
141 'onscreenchat-inact-userid' => $a_target_user
144 $coll->addAction($f);
static _lookupLogin($a_user_id)
lookup login
acceptsMessages($a_user_id)
static getInstance()
Get instance.
Create styles array
The data for the language used.
checkUserChatAccess($a_user_id)
Check user chat access.
Action that can be performed on a user.
◆ getActionTypes()
ilChatUserActionProvider::getActionTypes |
( |
| ) |
|
Definition at line 67 of file class.ilChatUserActionProvider.php.
References array.
70 "invite" => $this->lng->txt(
'chat_user_action_invite_public_room'),
71 "invite_osd" => $this->lng->txt(
'chat_user_action_invite_osd')
Create styles array
The data for the language used.
◆ getComponentId()
ilChatUserActionProvider::getComponentId |
( |
| ) |
|
◆ $accepts_messages_cache
ilChatUserActionProvider::$accepts_messages_cache = array() |
|
staticprotected |
◆ $chat_enabled
ilChatUserActionProvider::$chat_enabled = false |
|
protected |
◆ $osc_enabled
ilChatUserActionProvider::$osc_enabled = false |
|
protected |
◆ $pub_ref_id
ilChatUserActionProvider::$pub_ref_id = 0 |
|
protected |
◆ $user_access
ilChatUserActionProvider::$user_access = array() |
|
staticprotected |
The documentation for this class was generated from the following file: