Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00033 require_once "chat/classes/class.ilObjChatGUI.php";
00034
00035 class ilChatController
00036 {
00037 var $gui_obj;
00038
00039 var $ref_id;
00040 var $cmd;
00041
00047 function ilChatController($a_ref_id)
00048 {
00049 define("ILIAS_MODULE","chat");
00050
00051 $this->ref_id = (int) $a_ref_id;
00052 $this->gui_obj =& new ilObjChatGUI(array(),$a_ref_id,true,false);
00053 $this->gui_obj->object->chat_room->setRoomId((int) $_REQUEST["room_id"]);
00054 $this->gui_obj->object->chat_room->setUserId($_SESSION["AccountId"]);
00055
00056
00057 if(!$this->gui_obj->object->chat_room->checkAccess())
00058 {
00059 unset($_REQUEST["room_id"]);
00060 unset($_REQUEST["message"]);
00061 sendInfo("You are not entitled to view this room",true);
00062 }
00063 $this->gui_obj->object->server_comm->setRecipientId((int) $_GET["p_id"]);
00064 $this->__getCommand();
00065 }
00066
00067
00068 function setRefId($a_ref_id)
00069 {
00070 $this->ref_id = $a_ref_id;
00071 }
00072 function getRefId()
00073 {
00074 return $this->ref_id;
00075 }
00076
00077 function execute()
00078 {
00079 $cmd = $this->cmd;
00080 $this->gui_obj->$cmd();
00081 }
00082
00083
00084 function __getCommand()
00085 {
00086 if($_GET["cmd"] == 'gateway')
00087 {
00088 if(is_array($_POST["cmd"]))
00089 {
00090 $_GET["cmd"] = key($_POST["cmd"]);
00091 }
00092
00093
00094
00095
00096
00097 else if (! $_POST["cmd"] && $_POST["message"])
00098 {
00099 $_GET["cmd"] = 'input';
00100 }
00101 else
00102 {
00103 $_GET["cmd"] = 'cancel';
00104 }
00105 }
00106
00107 if($_GET["cmd"])
00108 {
00109 $this->cmd = $_GET["cmd"];
00110 }
00111 else
00112 {
00113 $this->cmd = "showFrames";
00114 }
00115 }
00116 }
00117 ?>