4 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
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();
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;
86 include
'Modules/Chatroom/classes/class.ilChatroomUser.php';
95 $output_messages =
array();
98 $output_messages[] = $msg;
101 return $output_messages;
static getUntrashedChatReferences($filter=array())
getSetting($name)
Returns setting from $this->settings array by given name.
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
getLastMessagesForChatViewer($number, $chatuser=null)
getMessages(ilChatroom $room)
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.