59 $file = $_FILES[
'file_to_upload'][
'tmp_name'];
60 $filename = $_FILES[
'file_to_upload'][
'name'];
61 $type = $_FILES[
'file_to_upload'][
'type'];
68 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
69 require_once
'Modules/Chatroom/classes/class.ilChatroomUser.php';
73 $user_id = $chat_user->getUserId();
79 else if( !$room->isSubscribed( $chat_user->getUserId() ) )
84 $room->saveFileUploadToDb($user_id,
$filename, $type);
94 $scope = $room->getRoomId();
96 $params[
'public'] = 1;
104 'Eine neue Datei mit dem Link ' .
105 $ilCtrl->getLinkTarget($this->gui,
'uploadFile-deliverFile') .
108 )) , $params, $chat_user
111 $params = array_merge( $params, array(
'message' => $message) );
112 $query = http_build_query( $params );
114 $connector = $this->gui->getConnector();
115 $response = $connector->post( $scope,
$query );
116 $responseObject = json_decode( $response );
136 $data =
new stdClass();
138 $data->user = $this->gui->object->getPersonalInformation( $chat_user );
139 $data->message = $messageString;
140 $data->timestamp = date(
'c' );
141 $data->type =
'message';
142 $data->public = (int)$params[
'public'];
143 $data->recipients = $params[
'recipients'];
159 case !file_exists(
$path ):
163 $msg =
'Error: Upload path could not be created!';
167 case !is_dir(
$path ):
169 $msg =
'Error: Upload path is not a directory!';
172 case !is_readable(
$path ):
174 $msg =
'Error: Upload path is not readable!';