ilChatroomBlock
More...
◆ getMessages()
◆ getReadableAreas()
ilChatroomBlock::getReadableAreas |
( |
| ) |
|
|
private |
- Returns
- array
Definition at line 54 of file class.ilChatroomBlock.php.
References $DIC, $title, ilChatroom\byObjectId(), ilChatroom\checkUserPermissions(), and ilChatroom\getUntrashedChatReferences().
Referenced by getRoomSelect().
58 $readable_rooms = array();
61 'last_activity' => strtotime(
'-5 days', time())
63 foreach ($chatroom_objects as $object) {
64 if (isset($readable_rooms[$object[
'obj_id']])) {
70 if ($room && !$room->isUserBanned($DIC->user()->getId())) {
71 $readable_rooms[$object[
'obj_id']] = array(
72 'ref_id' => $object[
'ref_id'],
73 'obj_id' => $object[
'obj_id'],
74 'room_id' => $room->getRoomId(),
75 'title' => $object[
'title'],
76 'parent_title' => $object[
'parent_title']
83 foreach ($readable_rooms as $k => $v) {
84 $title[$k] = strtolower($v[
'title']);
86 array_multisort($title, SORT_STRING, $readable_rooms);
88 return $readable_rooms;
static getUntrashedChatReferences($filter=array())
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
◆ getRoomSelect()
ilChatroomBlock::getRoomSelect |
( |
stdClass |
$response | ) |
|
- Parameters
-
- Returns
- string
- Exceptions
-
Definition at line 18 of file class.ilChatroomBlock.php.
References $DIC, $tpl, and getReadableAreas().
24 $tpl =
new ilTemplate(
'tpl.chatroom_block_room_select.html',
true,
true,
'Modules/Chatroom');
26 if (count($readable) > 0) {
28 $tpl->setVariable(
'TXT_SELECT_ROOM', $DIC->language()->txt(
'chat_select_room'));
30 foreach ($readable as $room) {
31 $tpl->setCurrentBlock(
'select_room_row');
32 $tpl->setVariable(
'ROW_VALUE', $room[
'ref_id']);
35 sprintf($DIC->language()->txt(
'room_in_container'), $room[
'title'], $room[
'parent_title'])
38 if ($DIC->user()->getPref(
'chatviewer_last_selected_room') == $room[
'ref_id']) {
39 $tpl->setVariable(
'ROW_SELECTED',
'selected="selected"');
42 $tpl->parseCurrentBlock();
45 $tpl->setVariable(
'TXT_NO_ROOMS', $DIC->language()->txt(
'chatviewer_no_rooms'));
special template class to simplify handling of ITX/PEAR
The documentation for this class was generated from the following file: