4 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
16 public function getRoomSelect()
24 $readable = $this->getReadableAreas();
25 $tpl =
new ilTemplate(
'tpl.chatroom_block_room_select.html',
true,
true,
'Modules/Chatroom');
26 $tpl->setVariable(
'TXT_SELECT_ROOM', $lng->txt(
'chat_select_room'));
27 foreach($readable as $room)
29 $tpl->setCurrentBlock(
'select_room_row');
30 $tpl->setVariable(
'ROW_VALUE', $room[
'ref_id']);
31 $tpl->setVariable(
'ROW_CAPTION', sprintf($lng->txt(
'room_in_container'), $room[
'title'], $room[
'parent_title']));
33 if($ilUser->getPref(
'chatviewer_last_selected_room') == $room[
'ref_id'])
34 $tpl->setVariable(
'ROW_SELECTED',
'selected="selected"');
36 $tpl->parseCurrentBlock();
45 private function getReadableAreas()
53 $readable_rooms =
array();
55 $chatroom_objects = ilChatroom::getUntrashedChatReferences(
array(
56 'last_activity' => strtotime(
'-5 days',
time())
58 foreach($chatroom_objects as $object)
60 if(isset($readable_rooms[$object[
'obj_id']]))
65 if($rbacsystem->checkAccess(
'read',
'', $object[
'ref_id']))
68 if($room && !$room->isUserBanned($ilUser->getId()))
70 $readable_rooms[$object[
'obj_id']] =
array(
71 'ref_id' => $object[
'ref_id'],
72 'obj_id' => $object[
'obj_id'],
73 'room_id' => $room->getRoomId(),
74 'title' => $object[
'title'],
75 'parent_title' => $object[
'parent_title']
82 foreach($readable_rooms as $k => $v)
84 $title[$k] = strtolower($v[
'title']);
86 array_multisort($title, SORT_STRING, $readable_rooms);
88 return $readable_rooms;
102 include
'Modules/Chatroom/classes/class.ilChatroomUser.php';
105 $output_messages =
array();
109 $output_messages[] = $msg;
112 return $output_messages;
getSetting($name)
Returns setting from $this->settings array by given name.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
getLastMessagesForChatViewer($number, $chatuser=null)
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.