16 throw new Exception(
'METHOD_NOT_IN_USE', 1456435027);
38 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", ROOT_FOLDER_ID);
39 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
49 $file = $_FILES[
'file_to_upload'][
'tmp_name'];
50 $filename = $_FILES[
'file_to_upload'][
'name'];
51 $type = $_FILES[
'file_to_upload'][
'type'];
58 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
59 require_once
'Modules/Chatroom/classes/class.ilChatroomUser.php';
63 $user_id = $chat_user->getUserId();
69 else if(!$room->isSubscribed($chat_user->getUserId()))
74 $room->saveFileUploadToDb($user_id,
$filename, $type);
101 case !file_exists(
$path):
105 $msg =
'Error: Upload path could not be created!';
111 $msg =
'Error: Upload path is not a directory!';
114 case !is_readable(
$path):
116 $msg =
'Error: Upload path is not readable!';
132 $scope = $room->getRoomId();
142 'Eine neue Datei mit dem Link ' .
143 $ilCtrl->getLinkTarget($this->gui,
'uploadFile-deliverFile') .
149 $params = array_merge($params,
array(
'message' => $message));
150 $query = http_build_query($params);
152 $connector = $this->gui->getConnector();
153 $response = $connector->post($scope,
$query);
154 $responseObject = json_decode($response);
167 $data =
new stdClass();
169 $data->user = $this->gui->object->getPersonalInformation($chat_user);
170 $data->message = $messageString;
172 $data->type =
'message';
static makeDirParents($a_dir)
Create a new directory and all parent directories.
executeDefault($requestedMethod)
Default execute method.
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
Class ilChatroomGUIHandler.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
buildMessage($messageString, $params, ilChatroomUser $chat_user)
Create styles array
The data for the language used.
checkUploadPath($path)
Checks if given upload path exists, is readable or can be created.
displayLinkToUploadedFile($room, $chat_user)
static getDataDir()
get data directory (outside webspace)
getUploadPath()
Returns upload path.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
Class ilChatroomUploadFileGUI Provides methods to upload a file.
uploadFile()
Saves file, fetched from $_FILES to specified upload path.