4require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
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'));
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;
99 include
'Modules/Chatroom/classes/class.ilChatroomUser.php';
108 $output_messages = array();
111 $output_messages[] = $msg;
114 return $output_messages;
An exception for terminatinating execution or to throw for unit testing.
getMessages(ilChatroom $room)
getRoomSelect(stdClass $response)
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
getSetting($name)
Returns setting from $this->settings array by given name.
static getUntrashedChatReferences($filter=array())
getLastMessagesForChatViewer($number, $chatuser=null)
special template class to simplify handling of ITX/PEAR