37 require_once
"classes/class.ilObjectGUI.php";
38 require_once
"Modules/Chat/classes/class.ilChatRecording.php";
49 function ilObjChatGUI($a_data,$a_id,$a_call_by_reference =
true, $a_prepare_output =
true)
54 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference, $a_prepare_output);
57 $this->ctrl->saveParameter($this,array(
"ref_id",
"cmdClass"));
60 if(is_object($this->object->chat_user))
62 $this->
object->chat_user->setUserId(
$_SESSION[
"AccountId"]);
70 if(
$_GET[
"baseClass"] ==
"ilChatPresentationGUI")
79 $next_class = $this->ctrl->getNextClass($this);
80 $cmd = $this->ctrl->getCmd();
86 case 'ilpermissiongui':
87 include_once(
"./classes/class.ilPermissionGUI.php");
89 $ret =& $this->ctrl->forwardCommand($perm_gui);
92 case "ilpublicuserprofilegui":
93 include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
95 $ret = $this->ctrl->forwardCommand($profile_gui);
98 case 'ilinfoscreengui':
130 $this->ctrl->redirect($this);
139 global $ilLocator,
$tree,$ilObjDataCache;
141 if (
$_GET[
"admin_mode"] ==
"settings")
143 $ilLocator->addItem($this->lng->txt(
"administration"),
144 $this->ctrl->getLinkTargetByClass(
"iladministrationgui",
"frameset"),
148 $chat_settings_ref_id = $tree->getParentId($this->object->getRefId());
149 $chat_settings_obj_id = $ilObjDataCache->lookupObjId($chat_settings_ref_id);
151 $this->ctrl->setParameterByClass(
'ilobjchatservergui',
'ref_id',$chat_settings_ref_id);
152 $ilLocator->addItem($ilObjDataCache->lookupTitle($chat_settings_obj_id),
153 $this->ctrl->getLinkTargetByClass(array(
'iladministrationgui',
'ilobjchatservergui'),
157 if ($this->object->getRefId() != SYSTEM_FOLDER_ID)
159 $ilLocator->addItem($this->object->getTitle(),
160 $this->ctrl->getLinkTarget($this,
"view"));
173 $this->target_script = $a_script;
177 return $this->target_script.
"?".$a_params;
190 global $ilUser,$rbacadmin;
195 $roles = $new_obj->initDefaultRoles();
198 $rbacadmin->assignUser($roles[0],$ilUser->getId());
203 "ilias.php?baseClass=ilChatHandlerGUI&ref_id=".$new_obj->getRefId().
"&cmd=view"));
209 include_once
'Modules/Chat/classes/class.ilChatBlockedUsers.php';
213 if(!$rbacsystem->checkAccess(
'moderate',$this->object->getRefId()))
215 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
218 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.chat_blocked_users.html",
"Modules/Chat");
221 if(!count($blocked = $blocked_obj->getBlockedUsers()))
223 $this->tpl->setVariable(
"MESSAGE_NO_BLOCKED",$this->lng->txt(
'chat_no_blocked'));
227 $this->tpl->setCurrentBlock(
"delete_blocked");
228 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'chat_blocked_unlocked'));
230 $this->tpl->parseCurrentBlock();
233 foreach($blocked as $usr_id)
237 $this->tpl->setCurrentBlock(
"blocked_users");
238 $this->tpl->setVariable(
"FULLNAME",$tmp_user->getFullname());
239 $this->tpl->setVariable(
"LOGIN",$tmp_user->getLogin());
240 $this->tpl->setVariable(
"BLOCK_CHECK",
ilUtil::formCheckbox(0,
'blocked_check[]',$tmp_user->getId()));
241 $this->tpl->parseCurrentBlock();
245 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
247 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->lng->txt(
'chat_blocked_users'));
248 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'chat_blocked_users'));
249 $this->tpl->setVariable(
"HEADER_NAME",$this->lng->txt(
'chat_user_name'));
251 $this->tpl->setVariable(
"BTN_BLOCK",$this->lng->txt(
'chat_block_user'));
257 include_once
'Modules/Chat/classes/class.ilChatBlockedUsers.php';
261 if(!$rbacsystem->checkAccess(
'moderate',$this->object->getRefId()))
263 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
275 if($blocked_obj->isBlocked($usr_id))
283 $blocked_obj->block($usr_id);
293 include_once
'Modules/Chat/classes/class.ilChatBlockedUsers.php';
297 if(!$rbacsystem->checkAccess(
'moderate',$this->object->getRefId()))
299 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
304 if(!is_array($_POST[
'blocked_check']))
311 foreach($_POST[
'blocked_check'] as $usr_id)
313 $blocked_obj->unblock($usr_id);
325 if(!$rbacsystem->checkAccess(
'moderate',$this->object->getRefId()))
327 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
334 $this->
object->server_comm->setKickedUser($tmp_user->getLogin());
335 $this->
object->server_comm->setType(
"kick");
336 $this->
object->server_comm->send();
338 $this->
object->chat_room->setKicked((
int)
$_GET[
'kick_id']);
340 #ilUtil::sendInfo($this->lng->txt("chat_user_dropped"),true);
349 if(!$rbacsystem->checkAccess(
'moderate',$this->object->getRefId()))
351 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
356 $this->
object->chat_room->setUnkicked((
int)
$_GET[
'kick_id']);
358 #ilUtil::sendInfo($this->lng->txt("chat_user_dropped"),true);
365 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
372 include_once
'Modules/Chat/classes/class.ilChatBlockedUsers.php';
374 global $rbacsystem,$ilUser;
376 if (!$rbacsystem->checkAccess(
"read", $this->ref_id))
378 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
380 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.chat_view.html",
"Modules/Chat");
383 if(!$this->object->server_comm->isAlive() or !$this->ilias->getSetting(
"chat_active"))
401 $this->tpl->setCurrentBlock(
"confirm_delete");
402 $this->tpl->setVariable(
"TXT_DELETE_CANCEL",$this->lng->txt(
"cancel"));
403 $this->tpl->setVariable(
"TXT_DELETE_CONFIRM",$this->lng->txt(
"delete"));
404 $this->tpl->parseCurrentBlock();
409 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_chat'));
410 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'chat_rooms'));
413 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
414 $this->tpl->setVariable(
"TXT_CHATROOMS",$this->lng->txt(
"chat_chatrooms"));
415 $this->tpl->setVariable(
"ACTIONS",$this->lng->txt(
'actions'));
419 if($rbacsystem->checkAccess(
'write',$this->ref_id))
421 $rooms = $this->
object->chat_room->getAllRoomsOfObject();
425 $this->
object->chat_room->setOwnerId(
$_SESSION[
"AccountId"]);
426 $rooms = $this->
object->chat_room->getRoomsOfObject();
429 $script =
'./ilias.php?baseClass=ilChatPresentationGUI';
437 $this->tpl->setCurrentBlock(
"blocked");
438 $this->tpl->setVariable(
"MESSAGE_BLOCKED",$this->lng->txt(
'chat_blocked'));
439 $this->tpl->parseCurrentBlock();
441 elseif($this->object->server_comm->isAlive() and $this->ilias->getSetting(
"chat_active"))
443 $this->tpl->setCurrentBlock(
"active");
444 $this->tpl->setVariable(
"ROOM_LINK",$script.
"&ref_id=".$this->ref_id.
"&room_id=0");
445 $this->tpl->setVariable(
"ROOM_TARGET",
"chat");
446 $this->tpl->setVariable(
"ROOM_TXT_LINK",$this->lng->txt(
"show"));
447 $this->tpl->parseCurrentBlock();
451 $this->tpl->touchBlock(
"not_active");
453 $this->tpl->setCurrentBlock(
"tbl_rooms_row");
454 $this->tpl->setVariable(
"ROWCOL",++$counter % 2 ?
"tblrow1" :
"tblrow2");
455 $this->tpl->setVariable(
"ROOM_CHECK",
459 $this->tpl->setVariable(
"ROOM_NAME",$this->object->getTitle().
" ".$this->lng->txt(
"chat_public_room"));
460 $this->tpl->setVariable(
"USERS_ONLINE",
461 $this->lng->txt(
'chat_users_active').
': '.
463 $this->tpl->parseCurrentBlock();
465 foreach($rooms as $room)
468 if($this->object->server_comm->isAlive() and $this->ilias->getSetting(
"chat_active"))
470 $this->tpl->setCurrentBlock(
"active");
471 $this->tpl->setVariable(
"ROOM_LINK",$script.
"&ref_id=".$this->ref_id.
"&room_id=".$room[
"room_id"]);
472 $this->tpl->setVariable(
"ROOM_TARGET",
"chat");
473 $this->tpl->setVariable(
"ROOM_TXT_LINK",$this->lng->txt(
"show"));
474 $this->tpl->parseCurrentBlock();
478 $this->tpl->touchBlock(
"not_active");
480 $this->tpl->setCurrentBlock(
"tbl_rooms_row");
481 $this->tpl->setVariable(
"ROWCOL",++$counter % 2 ?
"tblrow1" :
"tblrow2");
482 $this->tpl->setVariable(
"ROOM_CHECK",
487 $this->tpl->setVariable(
"ROOM_NAME",$room[
"title"]);
488 $this->tpl->setVariable(
"USERS_ONLINE",
489 $this->lng->txt(
'chat_users_active').
': '.
491 $this->tpl->parseCurrentBlock();
493 $this->tpl->setCurrentBlock(
"has_rooms");
496 $this->tpl->setVariable(
"FOOTER_HAS_ROOMS_OK",$this->lng->txt(
"ok"));
497 $this->tpl->parseCurrentBlock();
499 $this->tpl->setVariable(
"FOOTER_OK",$this->lng->txt(
"add"));
502 $this->tpl->setCurrentBlock(
"perma_link");
503 $this->tpl->setVariable(
"PERMA_LINK", ILIAS_HTTP_PATH.
505 $this->object->getType().
506 "_".$this->object->getRefId().
"&client_id=".CLIENT_ID);
507 $this->tpl->setVariable(
"TXT_PERMA_LINK", $this->lng->txt(
"perma_link"));
508 $this->tpl->setVariable(
"PERMA_TARGET",
"_top");
509 $this->tpl->parseCurrentBlock();
517 if (!$rbacsystem->checkAccess(
"read", $this->ref_id))
519 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
522 if(!isset($_POST[
"del_id"]))
530 switch($_POST[
"action"])
533 if(count($_POST[
"del_id"]) > 1)
540 if(in_array(0,$_POST[
"del_id"]))
549 $_SESSION[
"room_id_rename"] = (int) $_POST[
"del_id"][0];
551 $room =&
new ilChatRoom($this->object->getId());
554 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.chat_edit_room.html",
"Modules/Chat");
555 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
556 $this->tpl->setVariable(
"TXT_ROOM_NAME",$this->lng->txt(
"chat_room_name"));
557 $this->tpl->setVariable(
"ROOM_CANCEL",$this->lng->txt(
"cancel"));
558 $this->tpl->setVariable(
"TXT_EDIT_CHATROOMS",$this->lng->txt(
"chat_chatroom_rename"));
559 $this->tpl->setVariable(
"ROOM_NAME",$room->getTitle());
560 $this->tpl->setVariable(
"CMD",
"renameRoom");
561 $this->tpl->setVariable(
"ROOM_EDIT",$this->lng->txt(
"rename"));
565 if(in_array(0,$_POST[
"del_id"]))
572 $_SESSION[
"room_id_delete"] = $_POST[
"del_id"];
583 if(in_array(0,$_POST[
"del_id"]) and !$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
590 foreach($_POST[
"del_id"] as $room_id)
592 $this->
object->chat_room->setRoomId($room_id);
593 $this->
object->server_comm->setType(
"delete");
594 $this->
object->server_comm->send();
595 $this->
object->chat_room->deleteAllMessages();
609 if ($rbacsystem->checkAccess(
"moderate", $this->object->getRefId()) &&
610 $this->object->chat_room->checkWriteAccess())
612 $this->
object->server_comm->setType(
'delete');
614 $this->
object->server_comm->setMessage($message);
615 $this->
object->server_comm->send();
617 $this->
object->chat_room->deleteAllMessages();
619 unset(
$_GET[
"room_id_empty"]);
627 if (!$rbacsystem->checkAccess(
"read", $this->ref_id))
629 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
631 if(!
$_GET[
"room_id_delete"])
633 $this->ilias->raiseError($this->lng->txt(
"chat_select_one_room"),$this->ilias->error_obj->MESSAGE);
635 $this->
object->chat_room->setOwnerId(
$_SESSION[
"AccountId"]);
636 $rooms = array(
$_GET[
"room_id_delete"]);
637 if (!$rbacsystem->checkAccess(
"write", $this->ref_id))
639 $delResult = $this->
object->chat_room->deleteRooms($rooms, $this->object->chat_room->getOwnerId());
643 $delResult = $this->
object->chat_room->deleteRooms($rooms);
647 $this->ilias->raiseError($this->object->chat_room->getErrorMessage(),$this->ilias->error_obj->MESSAGE);
649 unset(
$_GET[
"room_id_delete"]);
652 $this->ctrl->redirect($this,
'showFrames');
659 if (!$rbacsystem->checkAccess(
"read", $this->ref_id))
661 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
665 $this->ilias->raiseError($this->lng->txt(
"chat_select_one_room"),$this->ilias->error_obj->MESSAGE);
667 $this->
object->chat_room->setOwnerId(
$_SESSION[
"AccountId"]);
668 if(!$this->object->chat_room->deleteRooms(
$_SESSION[
"room_id_delete"]))
670 $this->ilias->raiseError($this->object->chat_room->getErrorMessage(),$this->ilias->error_obj->MESSAGE);
683 if (!$rbacsystem->checkAccess(
"read", $this->ref_id))
685 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
690 $room =&
new ilChatRoom($this->object->getId());
692 $room->setOwnerId(
$_SESSION[
"AccountId"]);
694 if(!$room->validate())
711 if (!$rbacsystem->checkAccess(
"read", $this->ref_id))
713 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
715 $room =&
new ilChatRoom($this->object->getId());
717 $room->setOwnerId(
$_SESSION[
"AccountId"]);
719 if(!$room->validate())
721 $this->ilias->raiseError($room->getErrorMessage(),$this->ilias->error_obj->MESSAGE);
728 #header("location: ".$this->getTargetScript("cmd=gateway&ref_id=".$this->ref_id));
736 if (!$rbacsystem->checkAccess(
"read", $this->ref_id))
738 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
741 $room =&
new ilChatRoom($this->object->getId());
744 if(!$room->validate())
746 $this->ilias->raiseError($room->getErrorMessage(),$this->ilias->error_obj->MESSAGE);
763 if (!$rbacsystem->checkAccess(
"read", $this->ref_id))
765 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
767 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.chat_edit_room.html",
"Modules/Chat");
768 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
769 $this->tpl->setVariable(
"TXT_ROOM_NAME",$this->lng->txt(
"chat_room_name"));
770 $this->tpl->setVariable(
"ROOM_CANCEL",$this->lng->txt(
"cancel"));
772 $this->tpl->setVariable(
"TXT_EDIT_CHATROOMS",$this->lng->txt(
"chat_chatroom_rename"));
773 $this->tpl->setVariable(
"ROOM_NAME",
"");
774 $this->tpl->setVariable(
"CMD",
"addRoom");
775 $this->tpl->setVariable(
"ROOM_EDIT",$this->lng->txt(
"add"));
783 if (!$rbacsystem->checkAccess(
"moderate", $this->object->getRefId()))
785 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
787 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.chat_recordings.html",
"Modules/Chat");
789 $this->
object->__initChatRecording();
791 if (!is_array(
$data = $this->object->chat_recording->getRecordings()))
797 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
798 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'chat_recordings'));
799 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'chat_recording_description'));
800 $this->tpl->setVariable(
"HEADER_MOD",$this->lng->txt(
'chat_recording_moderator'));
801 $this->tpl->setVariable(
"HEADER_TIME",$this->lng->txt(
'chat_recording_time_frame'));
802 $this->tpl->setVariable(
"HEADER_ACTION",$this->lng->txt(
'chat_recording_action'));
804 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
807 for ($i = 0; $i < count(
$data); $i++)
809 $this->tpl->setCurrentBlock(
"recording_row");
811 if(
$data[$i][
"title"] !=
"")
813 $this->tpl->setVariable(
"RECORDING_TITLE",
$data[$i][
"title"]);
815 if (
$data[$i][
"description"] !=
"")
817 $this->tpl->setVariable(
"RECORDING_DESCRIPTION",
$data[$i][
"description"]);
819 if (is_array($moderator = $this->object->chat_recording->getModerator(
$data[$i][
"moderator_id"])))
821 $this->tpl->setVariable(
"MODERATOR", $moderator);
823 $this->tpl->setVariable(
"START_TIME", date(
"Y-m-d H:i:s",
$data[$i][
"start_time"]));
824 if (
$data[$i][
"end_time"] > 0)
826 $this->tpl->setVariable(
"END_TIME", date(
"Y-m-d H:i:s",
$data[$i][
"end_time"]));
827 $this->ctrl->setParameter($this,
'record_id',
$data[$i][
"record_id"]);
828 $this->tpl->setVariable(
"LINK_EXPORT",$this->ctrl->getLinkTarget($this,
'exportRecording'));
829 $this->tpl->setVariable(
"TXT_EXPORT",$this->lng->txt(
'export'));
832 $this->tpl->parseCurrentBlock();
840 if (!$rbacsystem->checkAccess(
"moderate", $this->object->getRefId()))
842 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
845 if(!is_array($_POST[
'recordings']))
853 $this->
object->__initChatRecording();
856 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.chat_ask_delete_recordings.html",
"Modules/Chat");
858 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
859 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'chat_recordings'));
860 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'chat_recording_description'));
861 $this->tpl->setVariable(
"HEADER_MOD",$this->lng->txt(
'chat_recording_moderator'));
862 $this->tpl->setVariable(
"HEADER_TIME",$this->lng->txt(
'chat_recording_time_frame'));
864 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
865 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
868 for ($i = 0; $i < count($_POST[
"recordings"]); $i++)
870 $this->
object->chat_recording->getRecord($_POST[
"recordings"][$i]);
871 $this->tpl->setCurrentBlock(
"recordings_row");
872 if($this->object->chat_recording->getTitle() !=
"")
874 $this->tpl->setVariable(
"RECORDING_TITLE", $this->object->chat_recording->getTitle());
876 if($this->object->chat_recording->getDescription() !=
"")
878 $this->tpl->setVariable(
"RECORDING_DESCRIPTION", $this->object->chat_recording->getDescription());
880 if ($moderator = $this->object->chat_recording->getModerator())
882 $this->tpl->setVariable(
"MODERATOR", $moderator);
884 $this->tpl->setVariable(
"START_TIME", date(
"Y-m-d H:i:s", $this->object->chat_recording->getStartTime()));
885 if ($this->object->chat_recording->getEndTime() > 0)
887 $this->tpl->setVariable(
"END_TIME", date(
"Y-m-d H:i:s", $this->object->chat_recording->getEndTime()));
890 $this->tpl->parseCurrentBlock();
892 $_SESSION[
'chat_recordings_del'] = $_POST[
'recordings'];
899 if (!$rbacsystem->checkAccess(
"moderate", $this->object->getRefId()))
901 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
904 if(!is_array(
$_SESSION[
'chat_recordings_del']))
912 $this->
object->__initChatRecording();
914 foreach(
$_SESSION[
'chat_recordings_del'] as $record_id)
916 $this->
object->chat_recording->delete($record_id);
929 if (!$rbacsystem->checkAccess(
"moderate", $this->object->getRefId()))
931 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
933 $this->
object->__initChatRecording();
935 if (!$this->object->chat_recording->getRecord(
$_GET[
"record_id"]) ||
936 $this->
object->chat_recording->getEndTime() == 0)
944 $tmp_tpl =&
new ilTemplate(
"tpl.chat_export_recording.html",
true,
true,
"Modules/Chat");
946 if($this->object->chat_recording->getTitle())
948 $tmp_tpl->setVariable(
"TITLE",$this->object->chat_recording->getTitle());
950 $tmp_tpl->setVariable(
"START_TIME",date(
"Y-m-d H:i:s", $this->object->chat_recording->getStartTime()));
951 $tmp_tpl->setVariable(
"END_TIME",date(
"Y-m-d H:i:s", $this->object->chat_recording->getEndTime()));
952 $tmp_tpl->setVariable(
"CONTENT",$this->object->chat_recording->exportMessages());
960 global $rbacsystem,$ilUser;
962 if (!$rbacsystem->checkAccess(
"moderate", $this->object->getRefId()))
964 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
967 $this->
object->__initChatRecording();
970 $this->
object->chat_recording->setRoomId(
$_GET[
"room_id"]);
972 if (!$this->object->chat_recording->isRecording())
974 $this->
object->chat_recording->setModeratorId($ilUser->getId());
975 $this->
object->chat_recording->startRecording($_POST[
"title"]);
983 global $rbacsystem,$ilUser;
985 if (!$rbacsystem->checkAccess(
"moderate", $this->object->getRefId()))
987 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
990 $this->
object->__initChatRecording();
993 $this->
object->chat_recording->setRoomId(
$_GET[
"room_id"]);
995 if ($this->object->chat_recording->isRecording())
997 $this->
object->chat_recording->stopRecording($ilUser->getId());
1010 if (!$rbacsystem->checkAccess(
"read", $this->ref_id))
1012 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1016 $this->tpl =
new ilTemplate(
"tpl.chat_start.html",
false,
false,
'Modules/Chat');
1018 $ilCtrl->setParameter($this,
"room_id", $_REQUEST[
"room_id"]);
1021 $ilCtrl->setParameter($this,
"p_id",
$_GET[
"p_id"]);
1023 else if (
$_GET[
"a_id"])
1025 $ilCtrl->setParameter($this,
"pa_id",
$_GET[
"a_id"]);
1026 $ilCtrl->setParameter($this,
"a_id",
$_GET[
"a_id"]);
1028 $this->tpl->setVariable(
"USER_TARGET",
1029 $ilCtrl->getLinkTarget($this,
"showUserFrame"));
1030 $this->tpl->setVariable(
"TOP_TARGET",
1031 $ilCtrl->getLinkTarget($this,
"showTopFrame"));
1032 $this->tpl->setVariable(
"INPUT_TARGET",
1033 $ilCtrl->getLinkTarget($this,
"showInputFrame"));
1034 $this->tpl->setVariable(
"RIGHT_TARGET",
1035 $ilCtrl->getLinkTarget($this,
"showRightFrame"));
1037 $this->tpl->setVariable(
"SERVER_TARGET",$this->object->server_comm->getServerFrameSource());
1039 $this->tpl->show(
false,
false);
1048 global
$ilCtrl, $ilMainMenu, $ilLocator, $ilUser;
1050 $this->
object->chat_room->setUserId(
$_SESSION[
"AccountId"]);
1051 $this->
object->chat_room->updateLastVisit();
1052 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1054 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.chat_user_frame.html",
'Modules/Chat');
1055 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1057 $ilMainMenu->setSmallMode(
true);
1058 $this->tpl->setVariable(
"MAINMENU", $ilMainMenu->getHTML());
1059 $this->tpl->addJavascript(
"./Services/Javascript/js/Basic.js");
1060 $this->tpl->addJavascript(
"./Services/Navigation/js/ServiceNavigation.js");
1061 $this->tpl->fillJavaScriptFiles();
1063 $ilLocator->addRepositoryItems($this->object->getRefId());
1064 $ilLocator->addItem($this->object->getTitle(),
'repository.php?ref_id='.$this->object->getRefId(),
'_top', $this->
object->getRefId());
1065 $this->tpl->setLocator();
1067 if($_REQUEST[
"room_id"])
1069 $this->tpl->setVariable(
"TITLE",$this->object->chat_room->getTitle());
1073 $this->tpl->setVariable(
"TITLE",$this->object->getTitle());
1078 if($ilUser->getId() != ANONYMOUS_USER_ID)
1080 $ilCtrl->setParameter($this,
"room_id", $this->object->chat_room->getRoomId());
1081 $this->tpl->setVariable(
"ADD_FORMACTION",
1082 $ilCtrl->getFormAction($this,
"addPrivateRoom"));
1083 $this->tpl->setVariable(
"TXT_ADD_PRIVATE_CHATROOM", $this->lng->txt(
"chat_add_private_chatroom"));
1084 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
1088 if($this->object->chat_room->isOwner())
1093 $this->tpl->show(
false);
1099 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1101 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.chat_top_frame.html",
'Modules/Chat');
1103 $this->tpl->show(
false);
1109 global $rbacsystem,
$ilCtrl, $ilUser;
1111 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1113 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.chat_input_frame.html",
'Modules/Chat');
1120 if(
true || $ilUser->getId() != ANONYMOUS_USER_ID)
1125 $message = $this->lng->txt(
"chat_private_message").
" ";
1126 $message .= $this->
object->chat_user->getLogin().
" -> ".$user_obj->getLogin();
1129 else if(
$_GET[
"a_id"])
1132 $message = $this->lng->txt(
"chat_address_user").
" ".$user_obj->getLogin();
1136 $ilCtrl->setParameter($this,
"room_id", $_REQUEST[
"room_id"]);
1139 $ilCtrl->setParameter($this,
"p_id",
$_GET[
"p_id"]);
1141 else if (
$_GET[
"a_id"])
1143 $ilCtrl->setParameter($this,
"a_id",
$_GET[
"a_id"]);
1145 $this->tpl->setVariable(
"FORMACTION", $ilCtrl->getFormAction($this,
"input"));
1146 $ilCtrl->clearParameters($this);
1148 $this->tpl->setVariable(
"TXT_NEW_MESSAGE",$this->lng->txt(
'chat_new_message'));
1149 $this->tpl->setVariable(
"TXT_COLOR",$this->lng->txt(
"chat_color"));
1150 $this->tpl->setVariable(
"TXT_TYPE",$this->lng->txt(
"chat_type"));
1151 $this->tpl->setVariable(
"TXT_FACE",$this->lng->txt(
"chat_face"));
1152 $this->tpl->setVariable(
"TXT_INPUT",$this->lng->txt(
"chat_input"));
1156 $this->tpl->setCurrentBlock(
"cancel");
1157 $this->tpl->setVariable(
"TXT_SUBMIT_CANCEL",$this->lng->txt(
"cancel_whisper"));
1158 $this->tpl->parseCurrentBlock();
1159 $this->tpl->setVariable(
"TXT_SUBMIT_OK",$this->lng->txt(
"ok"));
1161 elseif(
$_GET[
"a_id"])
1163 $this->tpl->setCurrentBlock(
"cancel");
1164 $this->tpl->setVariable(
"TXT_SUBMIT_CANCEL",$this->lng->txt(
"cancel_talk"));
1165 $this->tpl->parseCurrentBlock();
1166 $this->tpl->setVariable(
"TXT_SUBMIT_OK",$this->lng->txt(
"ok"));
1170 $this->tpl->setVariable(
"TXT_SUBMIT_OK",$this->lng->txt(
"ok"));
1172 $this->tpl->setVariable(
"TXT_HTML_EXPORT",$this->lng->txt(
'exp_html'));
1174 $this->tpl->setVariable(
"RADIO_TYPE",$this->
__getFontType());
1175 $this->tpl->setVariable(
"CHECK_FACE",$this->
__getFontFace());
1177 if ($rbacsystem->checkAccess(
"moderate", $this->object->getRefId()))
1179 $this->
object->__initChatRecording();
1180 $this->tpl->setCurrentBlock(
"moderator");
1181 $this->
object->chat_recording->setRoomId($this->object->chat_room->getRoomId());
1182 if ($this->object->chat_recording->isRecording())
1184 if ($this->object->chat_recording->getTitle() !=
"")
1186 $this->tpl->setVariable(
"TXT_TITLE_STOP_RECORDING", $this->lng->txt(
"chat_recording_title"));
1187 $this->tpl->setVariable(
"VAL_TITLE_STOP_RECORDING", $this->object->chat_recording->getTitle());
1189 if ($this->object->chat_recording->getDescription() !=
"")
1191 $this->tpl->setVariable(
"TXT_DESCRIPTION_STOP_RECORDING", $this->lng->txt(
"chat_recording_description"));
1192 $this->tpl->setVariable(
"VAL_DESCRIPTION_STOP_RECORDING", $this->object->chat_recording->getDescription());
1194 $this->tpl->setVariable(
"TXT_SUBMIT_STOP_RECORDING", $this->lng->txt(
"chat_stop_recording"));
1198 $this->tpl->setVariable(
"TXT_TITLE_START_RECORDING", $this->lng->txt(
"chat_recording_title"));
1199 $this->tpl->setVariable(
"TXT_DESCRIPTION_START_RECORDING", $this->lng->txt(
"chat_recording_description"));
1200 $this->tpl->setVariable(
"TXT_SUBMIT_START_RECORDING", $this->lng->txt(
"chat_start_recording"));
1203 $ilCtrl->setParameter($this,
"room_id", $this->object->chat_room->getRoomId());
1204 $this->tpl->setVariable(
"MODERATOR_FORMACTION",
1205 $ilCtrl->getFormAction($this,
"startRecording"));
1206 $this->tpl->setVariable(
"TXT_RECORDINGS",$this->lng->txt(
'chat_recordings'));
1207 $this->tpl->setVariable(
"MODERATOR_TARGET",
"_top");
1208 $this->tpl->parseCurrentBlock(
"moderator");
1212 $this->tpl->setCurrentBlock(
'perma_link');
1213 $this->tpl->setVariable(
'PERMA_LINK', ILIAS_HTTP_PATH.
'/goto.php?target='.$this->object->getType().
'_'.$this->
object->getRefId().
'&client_id='.CLIENT_ID);
1214 $this->tpl->setVariable(
'TXT_PERMA_LINK', $this->lng->txt(
'chat_link_to_this_chat'));
1215 $this->tpl->setVariable(
'PERMA_TARGET',
'_top');
1216 $this->tpl->parseCurrentBlock();
1218 $this->tpl->show(
false);
1224 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1226 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.chat_right_frame.html",
'Modules/Chat');
1227 $this->tpl->show(
false);
1233 unset(
$_GET[
"p_id"]);
1234 unset(
$_GET[
"a_id"]);
1241 unset(
$_GET[
"p_id"]);
1242 unset(
$_GET[
"a_id"]);
1250 $this->
object->chat_room->setUserId(
$_SESSION[
"AccountId"]);
1251 $this->
object->chat_room->updateLastVisit();
1254 if(!$_POST[
"message"])
1260 if($_POST[
"message"] and $this->object->chat_room->checkWriteAccess())
1266 $this->
object->server_comm->setMessage($message);
1267 if((
int)
$_GET[
"p_id"])
1269 $this->
object->server_comm->setType(
'private');
1271 else if((
int) $_GET[
"a_id"])
1273 $this->
object->server_comm->setType(
'address');
1275 if(!$this->object->server_comm->send())
1277 $this->error = $this->lng->txt(
"chat_no_connection");
1291 $this->
object->chat_room->invite((
int)
$_GET[
"i_id"]);
1292 $this->
object->sendMessage((
int) $_GET[
"i_id"]);
1293 if((
int)$this->object->chat_room->getRoomId())
1295 ilUtil::sendInfo(sprintf($this->lng->txt(
"chat_user_invited_private"), $this->
object->chat_room->getTitle()),
true);
1299 ilUtil::sendInfo(sprintf($this->lng->txt(
"chat_user_invited_public"), $this->
object->getTitle()),
true);
1310 if(!
$_GET[
'usr_id'])
1316 $this->
object->chat_room->setOwnerId($ilUser->getId());
1322 if(!$id = $this->object->chat_room->lookupRoomId())
1324 $id = $this->
object->chat_room->add();
1328 $this->
object->chat_room->setRoomId($id);
1329 $this->
object->chat_room->invite((
int)
$_GET[
"usr_id"]);
1330 $this->
object->sendMessage((
int) $_GET[
'usr_id']);
1332 if((
int)$this->object->chat_room->getRoomId())
1334 ilUtil::sendInfo(sprintf($this->lng->txt(
"chat_user_invited_private"), $this->
object->chat_room->getTitle()),
true);
1338 ilUtil::sendInfo(sprintf($this->lng->txt(
"chat_user_invited_public"), $this->
object->getTitle()),
true);
1341 ilUtil::redirect(
'ilias.php?baseClass=ilChatPresentationGUI&ref_id='.$this->object->getRefId().
'&room_id='.$id);
1348 $this->
object->chat_room->drop((
int)
$_GET[
"i_id"]);
1350 $tmp_user =&
new ilObjUser($_GET[
"i_id"]);
1351 $this->
object->server_comm->setKickedUser($tmp_user->getLogin());
1352 $this->
object->server_comm->setType(
"kick");
1353 $this->
object->server_comm->send();
1361 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.chat_close.html",
'Modules/Chat');
1363 $this->tpl->touchBlock(
"content");
1368 $tmp_tpl =&
new ilTemplate(
"tpl.chat_export.html",
true,
true,
"Modules/Chat");
1370 if($this->object->chat_room->getRoomId())
1372 $tmp_tpl->setVariable(
"CHAT_NAME",$this->object->chat_room->getTitle());
1376 $tmp_tpl->setVariable(
"CHAT_NAME",$this->object->getTitle());
1378 $tmp_tpl->setVariable(
"CHAT_DATE",strftime(
"%c",time()));
1379 $tmp_tpl->setVariable(
"CONTENT",$this->object->chat_room->getAllMessages());
1389 include_once
'Modules/Chat/classes/class.ilChatBlockedUsers.php';
1391 $all_users = $this->
object->chat_room->getOnlineUsers();
1394 $filtered_users = array();
1395 foreach($all_users as
$user)
1399 if($user[
'user_id'] ==
$_SESSION[
'AccountId'] ||
1400 $user[
'user_id'] == ANONYMOUS_USER_ID)
1406 $oUser->setId($user[
'user_id']);
1409 if($oUser->getPref(
'hide_own_online_status') ==
'y')
1414 $filtered_users[] = $oUser;
1418 if(count($filtered_users) < 1)
1420 $this->tpl->setCurrentBlock(
'no_online');
1421 $this->tpl->setVariable(
'NO_ONLINE_USERS', $this->lng->txt(
'chat_no_online_users'));
1422 $this->tpl->parseCurrentBlock();
1427 foreach($filtered_users as $user)
1431 $this->tpl->setCurrentBlock(
'online_row_start');
1432 $this->tpl->touchBlock(
'online_row_start');
1433 $this->tpl->parseCurrentBlock();
1435 if($counter == count($filtered_users) - 1)
1437 $this->tpl->setCurrentBlock(
'online_empty_col');
1438 $this->tpl->touchBlock(
'online_empty_col');
1439 $this->tpl->parseCurrentBlock();
1442 if(($counter % 2) || $counter == count($filtered_users) - 1)
1444 $this->tpl->setCurrentBlock(
'online_row_end');
1445 $this->tpl->touchBlock(
'online_row_end');
1446 $this->tpl->parseCurrentBlock();
1449 $this->tpl->setCurrentBlock(
'online');
1450 if($ilUser->getId() != ANONYMOUS_USER_ID)
1452 if (
$_GET[
'p_id'] == $user->getId() ||
1453 $_GET[
'a_id'] == $user->getId())
1455 $this->tpl->setVariable(
'ONLINE_FONT_A',
'smallred');
1459 $this->tpl->setVariable(
'ONLINE_FONT_A',
'small');
1462 if($this->object->chat_room->isInvited($user->getId()))
1472 $ilCtrl->setParameter($this,
'room_id', $_REQUEST[
'room_id']);
1473 $ilCtrl->setParameter($this,
'i_id', $user->getId());
1474 $this->tpl->setVariable(
'ONLINE_LINK_A',
1475 $ilCtrl->getLinkTarget($this,
$cmd));
1476 $ilCtrl->clearParameters($this);
1477 $this->tpl->setVariable(
'TXT_INVITE_USER',
$cmd ==
'invite' ? $this->lng->txt(
'chat_invite_user') :
1478 $this->lng->txt(
'chat_disinvite_user'));
1479 if($user->getPref(
'public_profile') ==
'y')
1481 $this->tpl->setVariable(
'ONLINE_USER_NAME_A',
1482 $user->getFirstname().
' '.$user->getLastname().
' ('.$user->getLogin().
')');
1486 $this->tpl->setVariable(
'ONLINE_USER_NAME_A', $user->getLogin());
1488 $this->tpl->setVariable(
'INVITE_IMG_SRC',
1493 $this->tpl->setVariable(
'ONLINE_USER_NAME_A_NOT_INVITEABLE', $user->getLogin());
1495 $this->tpl->parseCurrentBlock();
1499 $this->tpl->setCurrentBlock(
'show_online');
1500 $this->tpl->setVariable(
'ONLINE_USERS', $this->lng->txt(
'chat_online_users'));
1501 $this->tpl->parseCurrentBlock();
1506 global $rbacsystem,
$ilCtrl, $ilUser;
1508 if(isset(
$_GET[
"a_users"]))
1510 if(
$_GET[
"a_users"])
1521 $hide =
$_SESSION[
"a_users"] ?
true :
false;
1523 $this->tpl->setVariable(
"ACTIVE_USERS",$this->lng->txt(
"chat_active_users"));
1524 $this->tpl->setVariable(
"DETAILS_B_TXT",$hide ? $this->lng->txt(
"chat_show_details") : $this->lng->txt(
"chat_hide_details"));
1525 $ilCtrl->setParameter($this,
"room_id", $this->object->chat_room->getRoomId());
1526 $ilCtrl->setParameter($this,
"a_users", ($hide ? 0 : 1));
1527 $this->tpl->setVariable(
"DETAILS_B",
1528 $ilCtrl->getLinkTarget($this,
"showUserFrame"));
1529 $ilCtrl->clearParameters($this);
1535 $users = $this->
object->chat_room->getActiveUsers();
1536 if(count($users) <= 1)
1538 $this->tpl->setCurrentBlock(
"no_actice");
1539 $this->tpl->setVariable(
"NO_ACTIVE_USERS",$this->lng->txt(
"chat_no_active_users"));
1540 $this->tpl->parseCurrentBlock();
1545 foreach($users as
$user)
1551 $user_obj->setId($user);
1554 if($rbacsystem->checkAccess(
'moderate',$this->object->getRefId()) and !$_REQUEST[
'room_id'])
1556 $this->tpl->setCurrentBlock(
"moderate");
1557 $ilCtrl->setParameter($this,
"kick_id", $user_obj->getId());
1558 if($this->object->chat_room->isKicked($user_obj->getId()))
1561 $this->tpl->setVariable(
"MOD_TXT_INVITE_USER",$this->lng->txt(
'chat_unkick_user_session'));
1562 $this->tpl->setVariable(
"MOD_ONLINE_LINK_A",
1563 $ilCtrl->getLinkTarget($this,
"unkickUser"));
1567 $this->tpl->setVariable(
"MOD_INVITE_IMG_SRC",
ilUtil::getImagePath(
'minus.gif',
'Modules/Chat'));
1568 $this->tpl->setVariable(
"MOD_TXT_INVITE_USER",$this->lng->txt(
'chat_kick_user_session'));
1569 $this->tpl->setVariable(
"MOD_ONLINE_LINK_A",
1570 $ilCtrl->getLinkTarget($this,
"kickUser"));
1572 $ilCtrl->clearParameters($this);
1574 if($user_obj->getPref(
'public_profile') ==
'y')
1576 $this->tpl->setVariable(
"MOD_ONLINE_USER_NAME_A", $user_obj->getFirstname().
" ".$user_obj->getLastname().
" (".$user_obj->getLogin().
")");
1580 $this->tpl->setVariable(
"MOD_ONLINE_USER_NAME_A",$user_obj->getLogin());
1584 $this->tpl->parseCurrentBlock();
1588 $this->tpl->setCurrentBlock(
"non_moderate");
1589 if (
$_GET[
"p_id"] == $user ||
1590 $_GET[
"a_id"] == $user)
1592 $this->tpl->setVariable(
"ACTIVE_FONT_A",
"smallred");
1596 $this->tpl->setVariable(
"ACTIVE_FONT_A",
"small");
1598 $this->tpl->setVariable(
"ACTIVE_USER_NAME_A",$user_obj->getLogin());
1599 $this->tpl->parseCurrentBlock();
1601 $this->tpl->setCurrentBlock(
"active");
1603 if($ilUser->getId() != ANONYMOUS_USER_ID && $user != ANONYMOUS_USER_ID)
1605 if($user_obj->getPref(
'public_profile') ==
'y')
1607 $this->tpl->setVariable(
'ACTIVE_ROW_TXT_PROFILE', $this->lng->txt(
'chat_profile'));
1608 $ilCtrl->setParameter($this,
"user", $user_obj->getId());
1609 $this->tpl->setVariable(
'ACTIVE_ROW_PROFILE_LINK',
1610 $ilCtrl->getLinkTarget($this,
"showUserProfile"));
1611 $ilCtrl->clearParameters($this);
1614 $ilCtrl->setParameter($this,
"room_id", $_REQUEST[
"room_id"]);
1615 $ilCtrl->setParameter($this,
"a_id", $user);
1616 $this->tpl->setVariable(
"ACTIVE_ADDRESS_A",
1617 $ilCtrl->getLinkTarget($this,
"showInputFrame"));
1618 $this->tpl->setVariable(
"ACTIVE_TXT_ADDRESS_A",$this->lng->txt(
"chat_address"));
1620 $ilCtrl->setParameter($this,
"p_id", $user);
1621 $ilCtrl->setParameter($this,
"a_id",
"");
1622 $this->tpl->setVariable(
"ACTIVE_LINK_A",
1623 $ilCtrl->getLinkTarget($this,
"showInputFrame"));
1624 $this->tpl->setVariable(
"ACTIVE_TXT_WHISPER_A",$this->lng->txt(
"chat_whisper"));
1625 $ilCtrl->setParameter($this,
"p_id",
"");
1628 $this->tpl->parseCurrentBlock();
1634 $opt = array(
"createRoom" => $this->lng->txt(
"chat_room_select"));
1643 $opt[
"exportRoom"] = $this->lng->txt(
"chat_html_export");
1645 if($rbacsystem->checkAccess(
'write',$this->object->getRefId()) or
1646 count($this->object->chat_room->getRoomsOfObject()))
1648 $opt[
"refreshRoom"] = $this->lng->txt(
"chat_refresh");
1651 if(count($this->object->chat_room->getRoomsOfObject()))
1653 $opt[
"renameRoom"] = $this->lng->txt(
"rename");
1654 $opt[
"deleteRoom"] = $this->lng->txt(
"delete");
1665 global $rbacsystem, $ilUser,
$ilCtrl;
1667 include_once
'Modules/Chat/classes/class.ilChatBlockedUsers.php';
1669 $public_rooms = $this->
object->chat_room->getAllRooms();
1670 $private_rooms = $this->
object->chat_room->getRooms();
1672 if(isset(
$_GET[
"h_rooms"]))
1674 if(
$_GET[
"h_rooms"])
1684 $hide =
$_SESSION[
"h_rooms"] ?
true :
false;
1686 $this->tpl->setVariable(
"ROOMS_ROOMS",$this->lng->txt(
"chat_rooms"));
1687 $this->tpl->setVariable(
"DETAILS_TXT",$hide ? $this->lng->txt(
"chat_show_details") : $this->lng->txt(
"chat_hide_details"));
1688 $this->tpl->setVariable(
"ROOMS_COUNT",count($public_rooms) + count($private_rooms));
1689 $ilCtrl->setParameter($this,
"room_id", $this->object->chat_room->getRoomId());
1690 $ilCtrl->setParameter($this,
"h_rooms", ($hide ? 0 : 1));
1691 $this->tpl->setVariable(
"DETAILS_A",
1692 $ilCtrl->getLinkTarget($this,
"showUserFrame"));
1693 $ilCtrl->clearParameters($this);
1700 $this->
object->__initChatRecording();
1703 foreach($public_rooms as $room)
1705 $tblrow = ($room[
'child'] == $this->
object->getRefId()) ?
'tblrowmarked' :
'tblrow1';
1712 $this->tpl->setCurrentBlock(
"room_row");
1713 $this->tpl->setVariable(
"ROOM_ROW_CSS",$tblrow);
1714 $ilCtrl->setParameter($this,
"ref_id", $room[
"child"]);
1715 $this->tpl->setVariable(
"ROOM_LINK", $ilCtrl->getLinkTarget($this,
"showFrames"));
1716 $ilCtrl->setParameter($this,
"ref_id",
$_GET[
"ref_id"]);
1717 $this->tpl->setVariable(
"ROOM_TARGET",
"_top");
1718 $this->tpl->setVariable(
"ROOM_NAME",$room[
"title"]);
1719 $this->tpl->setVariable(
"ROOM_ONLINE",$this->object->chat_room->getCountActiveUser($room[
"obj_id"],0));
1720 $this->
object->chat_recording->setObjId($room[
"obj_id"]);
1721 if ($room[
"child"] == $this->object->getRefId() &&
1722 $this->
object->chat_room->getRoomId() == 0 &&
1723 $rbacsystem->checkAccess(
"moderate", $this->object->getRefId()))
1725 $this->tpl->setVariable(
"TXT_EMPTY_ROOM", $this->lng->txt(
"chat_empty"));
1726 $ilCtrl->setParameter($this,
"ref_id", $room[
"child"]);
1727 $this->tpl->setVariable(
"LINK_EMPTY_ROOM",
1728 $ilCtrl->getLinkTarget($this,
"emptyRoom"));
1729 $ilCtrl->setParameter($this,
"ref_id",
$_GET[
"ref_id"]);
1732 $this->
object->chat_recording->setObjId($room[
"obj_id"]);
1733 $this->
object->chat_recording->setRoomId(0);
1734 if ($this->object->chat_recording->isRecording())
1736 $this->tpl->setVariable(
"TXT_RECORDING", $this->lng->txt(
"chat_recording_running"));
1738 $this->tpl->parseCurrentBlock();
1740 reset($private_rooms);
1741 foreach($private_rooms as $priv_room)
1743 if ($priv_room[
"chat_id"] == $room[
"obj_id"])
1745 $this->tpl->touchBlock(
"room_row_indent");
1746 $this->tpl->setCurrentBlock(
"room_row");
1747 $this->tpl->setVariable(
"ROOM_ROW_CSS",$tblrow);
1748 $ilCtrl->setParameter($this,
"ref_id", $room[
"child"]);
1749 $ilCtrl->setParameter($this,
"room_id", $priv_room[
"room_id"]);
1750 $this->tpl->setVariable(
"ROOM_LINK",
1751 $ilCtrl->getLinkTarget($this,
"showFrames"));
1752 $ilCtrl->clearParameters($this);
1754 $this->tpl->setVariable(
"ROOM_TARGET",
"_top");
1755 $this->tpl->setVariable(
"ROOM_NAME",$priv_room[
"title"]);
1756 $this->tpl->setVariable(
"ROOM_ONLINE",
1757 $this->object->chat_room->getCountActiveUser($priv_room[
"chat_id"],$priv_room[
"room_id"]));
1759 if ($priv_room[
"owner"] !=
$_SESSION[
"AccountId"] &&
1760 !$rbacsystem->checkAccess(
'moderate', $this->object->getRefId()))
1764 $this->tpl->setVariable(
"TXT_ROOM_INVITATION", $this->lng->txt(
"chat_invited_by"));
1765 $this->tpl->setVariable(
"ROOM_INVITATION_USER", $user_obj->getLogin());
1770 $this->tpl->setVariable(
"TXT_DELETE_ROOM", $this->lng->txt(
"delete"));
1771 $ilCtrl->setParameter($this,
"room_id", $this->object->chat_room->getRoomId());
1772 $ilCtrl->setParameter($this,
"room_id_delete", $priv_room[
"room_id"]);
1773 $this->tpl->setVariable(
"LINK_DELETE_ROOM",
1774 $ilCtrl->getLinkTarget($this,
"deleteRoom"));
1777 $this->
object->chat_recording->setObjId($priv_room[
"chat_id"]);
1778 $this->
object->chat_recording->setRoomId($priv_room[
"room_id"]);
1779 if ($this->object->chat_recording->isRecording())
1781 $this->tpl->setVariable(
"TXT_RECORDING", $this->lng->txt(
"chat_recording_running"));
1784 if ($priv_room[
"chat_id"] == $this->object->getRefId() &&
1785 $priv_room[
"room_id"] == $this->
object->chat_room->getRoomId() &&
1786 $rbacsystem->checkAccess(
"moderate", $this->object->getRefId()))
1788 $this->tpl->setVariable(
"TXT_EMPTY_ROOM", $this->lng->txt(
"chat_empty"));
1789 $ilCtrl->setParameter($this,
"ref_id", $this->object->getRefId());
1790 $ilCtrl->setParameter($this,
"room_id", $this->object->chat_room->getRoomId());
1791 $this->tpl->setVariable(
"LINK_EMPTY_ROOM",
1792 $ilCtrl->getLinkTarget($this,
"emptyRoom"));
1793 $ilCtrl->clearParameters($this);
1796 $this->tpl->parseCurrentBlock();
1806 $this->tpl->setCurrentBlock(
"ChatStyle");
1810 $this->tpl->setVariable(
"EXPIRES",
"<meta http-equiv=\"expires\" content=\"now\">".
1811 "<meta http-equiv=\"refresh\" content=\"30\">");
1813 $this->tpl->parseCurrentBlock();
1818 $colors = array(
"black" => $this->lng->txt(
"chat_black"),
1819 "red" => $this->lng->txt(
"chat_red"),
1820 "green" => $this->lng->txt(
"chat_green"),
1821 "maroon" => $this->lng->txt(
"chat_maroon"),
1822 "olive" => $this->lng->txt(
"chat_olive"),
1823 "navy" => $this->lng->txt(
"chat_navy"),
1824 "purple" => $this->lng->txt(
"chat_purple"),
1825 "teal" => $this->lng->txt(
"chat_teal"),
1826 "silver" => $this->lng->txt(
"chat_silver"),
1827 "gray" => $this->lng->txt(
"chat_gray"),
1828 "lime" => $this->lng->txt(
"chat_lime"),
1829 "yellow" => $this->lng->txt(
"chat_yellow"),
1830 "fuchsia" => $this->lng->txt(
"chat_fuchsia"),
1831 "aqua" => $this->lng->txt(
"chat_aqua"),
1832 "blue" => $this->lng->txt(
"chat_blue"));
1839 $types = array(
"times" => $this->lng->txt(
"chat_times"),
1840 "tahoma" => $this->lng->txt(
"chat_tahoma"),
1841 "arial" => $this->lng->txt(
"chat_arial"));
1843 $_POST[
"type"] = $_POST[
"type"] ? $_POST[
"type"] :
"times";
1845 foreach($types as $name => $type)
1847 $this->tpl->setCurrentBlock(
"FONT_TYPES");
1848 $this->tpl->setVariable(
"BL_TXT_TYPE",$type);
1849 $this->tpl->setVariable(
"FONT_TYPE",$name);
1850 $this->tpl->setVariable(
"TYPE_CHECKED",$_POST[
"type"] == $name ?
"checked=\"checked\"" :
"");
1851 $this->tpl->parseCurrentBlock();
1857 $_POST[
"face"] = is_array($_POST[
"face"]) ? $_POST[
"face"] : array();
1859 $types = array(
"bold" => $this->lng->txt(
"chat_bold"),
1860 "italic" => $this->lng->txt(
"chat_italic"),
1861 "underlined" => $this->lng->txt(
"chat_underlined"));
1863 $this->tpl->setCurrentBlock(
"FONT_FACES");
1864 $this->tpl->setVariable(
"BL_TXT_FACE",
"<b>".$this->lng->txt(
"chat_bold").
"</b>");
1865 $this->tpl->setVariable(
"FONT_FACE",
"bold");
1866 $this->tpl->setVariable(
"FACE_CHECKED",in_array(
"bold",$_POST[
"face"]) ?
"checked=\"checked\"" :
"");
1867 $this->tpl->parseCurrentBlock();
1869 $this->tpl->setCurrentBlock(
"FONT_FACES");
1870 $this->tpl->setVariable(
"BL_TXT_FACE",
"<i>".$this->lng->txt(
"chat_italic").
"</i>");
1871 $this->tpl->setVariable(
"FONT_FACE",
"italic");
1872 $this->tpl->setVariable(
"FACE_CHECKED",in_array(
"italic",$_POST[
"face"]) ?
"checked=\"checked\"" :
"");
1873 $this->tpl->parseCurrentBlock();
1875 $this->tpl->setCurrentBlock(
"FONT_FACES");
1876 $this->tpl->setVariable(
"BL_TXT_FACE",
"<u>".$this->lng->txt(
"chat_underlined").
"</u>");
1877 $this->tpl->setVariable(
"FONT_FACE",
"underlined");
1878 $this->tpl->setVariable(
"FACE_CHECKED",in_array(
"underlined",$_POST[
"face"]) ?
"checked=\"checked\"" :
"");
1879 $this->tpl->parseCurrentBlock();
1884 $tpl =
new ilTemplate(
"tpl.chat_message.html",
true,
true,
'Modules/Chat');
1886 $_POST[
'message'] = htmlentities(trim($_POST[
'message']),ENT_QUOTES,
'utf-8');
1889 $tpl->setVariable(
"MESSAGE",$_POST[
"message"]);
1890 $tpl->setVariable(
"FONT_COLOR",$_POST[
"color"]);
1891 $tpl->setVariable(
"FONT_FACE",$_POST[
"type"]);
1898 $tpl->setCurrentBlock(
"private");
1899 $tpl->setVariable(
"PRIVATE_U_COLOR",
"red");
1900 $tpl->setVariable(
"PRIVATE_FROM",$user_obj->getLogin());
1904 $tpl->setVariable(
"PRIVATE_TO",$user_obj->getLogin());
1905 $tpl->parseCurrentBlock();
1907 else if(
$_GET[
"a_id"])
1909 $tpl->setCurrentBlock(
"address");
1910 $tpl->setVariable(
"ADDRESS_FROM_COLOR",
"navy");
1913 $tpl->setVariable(
"ADDRESS_FROM",$user_obj->getLogin());
1915 $tpl->setVariable(
"ADDRESS_TO_COLOR",
"red");
1918 $tpl->setVariable(
"ADDRESS_TO",$user_obj->getLogin());
1919 $tpl->parseCurrentBlock();
1923 $tpl->setCurrentBlock(
"normal");
1924 $tpl->setVariable(
"NORMAL_U_COLOR",
"navy");
1925 $tpl->setVariable(
"NORMAL_UNAME",$this->object->chat_user->getLogin());
1926 $tpl->parseCurrentBlock();
1931 foreach($_POST[
"face"] as $face)
1933 $tpl->setCurrentBlock(
"type_open");
1937 $tpl->setVariable(
"TYPE_TYPE_O",
"b");
1940 $tpl->setVariable(
"TYPE_TYPE_O",
"i");
1944 $tpl->setVariable(
"TYPE_TYPE_O",
"u");
1947 $tpl->parseCurrentBlock();
1949 $_POST[
"face"] = array_reverse($_POST[
"face"]);
1950 foreach($_POST[
"face"] as $face)
1952 $tpl->setCurrentBlock(
"type_close");
1956 $tpl->setVariable(
"TYPE_TYPE_C",
"b");
1959 $tpl->setVariable(
"TYPE_TYPE_C",
"i");
1963 $tpl->setVariable(
"TYPE_TYPE_C",
"u");
1966 $tpl->parseCurrentBlock();
1970 $message = preg_replace(
"/\r/",
"",
$tpl->get());
1971 $message = preg_replace(
"/\n/",
"",$message);
1977 include_once
"Modules/Chat/classes/class.ilFileDataChat.php";
1979 if(count($_POST[
"del_id"]) == 1)
1981 $this->
object->chat_room->setRoomId($_POST[
"del_id"][0]);
1987 foreach($_POST[
"del_id"] as $id)
1989 $this->
object->chat_room->setRoomId((
int) $id);
1991 $tmp_tpl =&
new ilTemplate(
"tpl.chat_export.html",
true,
true,
"Modules/Chat");
1995 $tmp_tpl->setVariable(
"CHAT_NAME",$this->object->chat_room->getTitle());
1999 $tmp_tpl->setVariable(
"CHAT_NAME",$this->object->getTitle());
2001 $tmp_tpl->setVariable(
"CHAT_DATE",strftime(
"%c",time()));
2002 $tmp_tpl->setVariable(
"CONTENT",$this->object->chat_room->getAllMessages());
2004 $file_obj->addFile(
"chat_".$this->object->chat_room->getRoomId().
".html",$tmp_tpl->get());
2006 $fname = $file_obj->zip();
2017 global $rbacsystem,$rbacreview, $ilAccess;
2019 $this->ctrl->setParameter($this,
"ref_id",$this->object->getRefId());
2023 if($rbacsystem->checkAccess(
'read',$this->object->getRefId()))
2025 $force_active = (
$_GET[
"cmd"] ==
"" ||
$_GET[
"cmd"] ==
"view")
2028 $tabs_gui->addTarget(
"chat_rooms",
2029 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
""), get_class($this),
2034 if ($ilAccess->checkAccess(
'visible',
'', $this->ref_id))
2036 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui"
2037 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
2041 $tabs_gui->addTarget(
"info_short",
2042 $this->ctrl->getLinkTargetByClass(
2043 array(
"ilobjchatgui",
"ilinfoscreengui"),
"showSummary"),
2044 array(
"showSummary",
"infoScreen"),
2045 "",
"", $force_active);
2048 if($rbacsystem->checkAccess(
'write',$this->object->getRefId()))
2050 $force_active = (
$_GET[
"cmd"] ==
"edit")
2053 $tabs_gui->addTarget(
"edit_properties",
2054 $this->ctrl->getLinkTarget($this,
"edit"),
"edit", get_class($this),
2057 if($rbacsystem->checkAccess(
'moderate',$this->object->getRefId()))
2059 $tabs_gui->addTarget(
"chat_recordings",
2060 $this->ctrl->getLinkTarget($this,
"recordings"),
"recordings", get_class($this));
2062 if($rbacsystem->checkAccess(
'moderate',$this->object->getRefId()))
2064 $tabs_gui->addTarget(
"chat_blocked_users",
2065 $this->ctrl->getLinkTarget($this,
"blockedUsers"),
2066 array(
"blockedUsers",
"unBlockUsers",
"blockUser"), get_class($this));
2069 if($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
2071 $tabs_gui->addTarget(
"perm_settings",
2072 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
2079 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2080 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
2100 include_once
'./classes/class.ilTabsGUI.php';
2102 $this->tpl->setCurrentBlock(
"header_image");
2104 $this->tpl->parseCurrentBlock();
2105 $this->tpl->setVariable(
"HEADER",$this->object->getTitle());
2106 $this->tpl->setVariable(
"H_DESCRIPTION",$this->object->getDescription());
2108 #$tabs_gui =& new ilTabsGUI();
2109 $this->
getTabs($this->tabs_gui);
2112 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
2118 global $ilias_locator;
2120 $this->tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html");
2123 foreach ($tree->getPathFull($this->object->getRefId()) as $key => $row)
2127 $this->tpl->touchBlock(
'locator_separator_prefix');
2130 $this->tpl->setCurrentBlock(
"locator_item");
2132 if($row[
"type"] ==
'chat')
2134 $this->tpl->setVariable(
"ITEM",$this->object->getTitle());
2135 $this->tpl->setVariable(
"LINK_ITEM",$this->ctrl->getLinkTarget($this));
2137 elseif ($row[
"child"] != $tree->getRootId())
2139 $this->tpl->setVariable(
"ITEM", $row[
"title"]);
2140 $this->tpl->setVariable(
"LINK_ITEM",
"repository.php?ref_id=".$row[
"child"]);
2144 $this->tpl->setVariable(
"ITEM", $this->lng->txt(
"repository"));
2145 $this->tpl->setVariable(
"LINK_ITEM",
"repository.php?ref_id=".$row[
"child"]);
2148 $this->tpl->parseCurrentBlock();
2151 $this->tpl->setVariable(
"TXT_LOCATOR",$this->lng->txt(
"locator"));
2152 $this->tpl->parseCurrentBlock();
2159 if ($ilAccess->checkAccess(
"read",
"", $a_target))
2161 $_GET[
"ref_id"] = $a_target;
2162 $_GET[
"cmd"] =
"view";
2163 $_GET[
"baseClass"] =
"ilChatHandlerGUI";
2164 include(
"ilias.php");
2167 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
2169 $_GET[
"cmd"] =
"frameset";
2170 $_GET[
"target"] =
"";
2171 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
2174 include(
"repository.php");
2178 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
2185 require_once
'./Services/User/classes/class.ilPublicUserProfileGUI.php';
2191 $tpl->setContent($ilCtrl->getHTML($profile_gui));
2200 if (is_object($this->
object))
2202 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
''),
'',
$_GET[
'ref_id']);
2213 $this->ctrl->setCmd(
"showSummary");
2214 $this->ctrl->setCmdClass(
"ilinfoscreengui");
2225 if (!$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
2227 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
2230 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
2233 $info->enablePrivateNotes();
2235 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
2242 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
2255 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
2258 $this->ctrl->forwardCommand($info);