ilChatroomBlock
More...
◆ getMessages()
◆ getReadableAreas()
ilChatroomBlock::getReadableAreas |
( |
| ) |
|
|
private |
- Returns
- array
Definition at line 41 of file class.ilChatroomBlock.php.
References $DIC, $title, array, ilChatroom\byObjectId(), ilChatroom\checkUserPermissions(), ilChatroom\getUntrashedChatReferences(), and time.
Referenced by getRoomSelect().
45 $readable_rooms =
array();
48 'last_activity' => strtotime(
'-5 days',
time())
50 foreach ($chatroom_objects as $object) {
51 if (isset($readable_rooms[$object[
'obj_id']])) {
57 if ($room && !$room->isUserBanned($DIC->user()->getId())) {
58 $readable_rooms[$object[
'obj_id']] =
array(
59 'ref_id' => $object[
'ref_id'],
60 'obj_id' => $object[
'obj_id'],
61 'room_id' => $room->getRoomId(),
62 'title' => $object[
'title'],
63 'parent_title' => $object[
'parent_title']
70 foreach ($readable_rooms as $k => $v) {
71 $title[$k] = strtolower($v[
'title']);
73 array_multisort($title, SORT_STRING, $readable_rooms);
75 return $readable_rooms;
static getUntrashedChatReferences($filter=array())
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
Create styles array
The data for the language used.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
◆ getRoomSelect()
ilChatroomBlock::getRoomSelect |
( |
| ) |
|
- Returns
- string
Definition at line 16 of file class.ilChatroomBlock.php.
References $DIC, $tpl, and getReadableAreas().
21 $tpl =
new ilTemplate(
'tpl.chatroom_block_room_select.html',
true,
true,
'Modules/Chatroom');
22 $tpl->setVariable(
'TXT_SELECT_ROOM', $DIC->language()->txt(
'chat_select_room'));
23 foreach ($readable as $room) {
24 $tpl->setCurrentBlock(
'select_room_row');
25 $tpl->setVariable(
'ROW_VALUE', $room[
'ref_id']);
26 $tpl->setVariable(
'ROW_CAPTION', sprintf($DIC->language()->txt(
'room_in_container'), $room[
'title'], $room[
'parent_title']));
28 if ($DIC->user()->getPref(
'chatviewer_last_selected_room') == $room[
'ref_id']) {
29 $tpl->setVariable(
'ROW_SELECTED',
'selected="selected"');
32 $tpl->parseCurrentBlock();
special template class to simplify handling of ITX/PEAR
The documentation for this class was generated from the following file: