4 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
16 private function getReadableAreas()
24 $readable_rooms = array();
26 $chatroom_objects = ilChatroom::getUntrashedChatReferences();
27 foreach($chatroom_objects as $object)
29 if(isset($readable_rooms[$object[
'obj_id']]))
34 if($rbacsystem->checkAccess(
'read',
'', $object[
'ref_id']))
37 if($room && !$room->isUserBanned($ilUser->getId()))
39 $readable_rooms[$object[
'obj_id']] = array(
40 'ref_id' => $object[
'ref_id'],
41 'obj_id' => $object[
'obj_id'],
42 'room_id' => $room->getRoomId(),
43 'title' => $object[
'title']
50 foreach($readable_rooms as $k => $v)
52 $title[$k] = strtolower($v[
'title']);
54 array_multisort(
$title, SORT_STRING, $readable_rooms);
56 return $readable_rooms;
62 public function getRoomSelect()
70 $readable = $this->getReadableAreas();
71 $tpl =
new ilTemplate(
'tpl.chatroom_block_room_select.html',
true,
true,
'Modules/Chatroom');
72 $tpl->setVariable(
'TXT_SELECT_ROOM', $lng->txt(
'chat_select_room'));
73 foreach($readable as $room)
75 $tpl->setCurrentBlock(
'select_room_row');
76 $tpl->setVariable(
'ROW_VALUE', $room[
'ref_id']);
77 $tpl->setVariable(
'ROW_CAPTION', $room[
'title']);
79 if($ilUser->getPref(
'chatviewer_last_selected_room') == $room[
'ref_id'])
80 $tpl->setVariable(
'ROW_SELECTED',
'selected="selected"');
82 $tpl->parseCurrentBlock();
99 include
'Modules/Chatroom/classes/class.ilChatroomUser.php';
102 $output_messages = array();
106 $output_messages[] = $msg;
109 return $output_messages;