@@ -43,15 +43,15 @@ |
||
| 43 | 43 | // Prepare file record object. |
| 44 | 44 | $user_context = context_user::instance($USER->id); |
| 45 | 45 | $fileinfo = array( |
| 46 | - 'contextid' => $user_context->id, // ID of context. |
|
| 47 | - 'component' => 'tinymce_recordrtc', // Usually = table name. |
|
| 48 | - 'filearea' => 'annotation', // Usually = table name. |
|
| 49 | - 'itemid' => time(), // Usually = ID of row in table. |
|
| 50 | - 'filepath' => '/', // Any path beginning and ending in "/". |
|
| 51 | - 'filename' => $fileName, // Any filename. |
|
| 52 | - 'author' => fullname($USER), |
|
| 53 | - 'licence' => $CFG->sitedefaultlicense |
|
| 54 | - ); |
|
| 46 | + 'contextid' => $user_context->id, // ID of context. |
|
| 47 | + 'component' => 'tinymce_recordrtc', // Usually = table name. |
|
| 48 | + 'filearea' => 'annotation', // Usually = table name. |
|
| 49 | + 'itemid' => time(), // Usually = ID of row in table. |
|
| 50 | + 'filepath' => '/', // Any path beginning and ending in "/". |
|
| 51 | + 'filename' => $fileName, // Any filename. |
|
| 52 | + 'author' => fullname($USER), |
|
| 53 | + 'licence' => $CFG->sitedefaultlicense |
|
| 54 | + ); |
|
| 55 | 55 | $fileSaved = $fs->create_file_from_pathname($fileinfo, $fileTmp); |
| 56 | 56 | |
| 57 | 57 | // OK response. |
@@ -19,13 +19,13 @@ discard block |
||
| 19 | 19 | require_login($course, false, $cm); |
| 20 | 20 | require_sesskey(); |
| 21 | 21 | |
| 22 | -if ( !isset($_FILES["audio-blob"]) && !isset($_FILES["video-blob"]) ) { |
|
| 22 | +if (!isset($_FILES["audio-blob"]) && !isset($_FILES["video-blob"])) { |
|
| 23 | 23 | error_log("Blob not included"); |
| 24 | 24 | header("HTTP/1.0 400 Bad Request"); |
| 25 | 25 | return; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -if ( !isset($_POST["audio-filename"]) && !isset($_POST["video-filename"]) ) { |
|
| 28 | +if (!isset($_POST["audio-filename"]) && !isset($_POST["video-filename"])) { |
|
| 29 | 29 | error_log("Filename not included"); |
| 30 | 30 | header("HTTP/1.0 400 Bad Request"); |
| 31 | 31 | return; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $fileName = $_POST["audio-filename"]; |
| 35 | 35 | $fileTmp = $_FILES["audio-blob"]["tmp_name"]; |
| 36 | -if ( !isset($_FILES["audio-blob"]) || !isset($_POST["audio-filename"]) ) { |
|
| 36 | +if (!isset($_FILES["audio-blob"]) || !isset($_POST["audio-filename"])) { |
|
| 37 | 37 | $fileName = $_POST["video-filename"]; |
| 38 | 38 | $fileTmp = $_FILES["video-blob"]["tmp_name"]; |
| 39 | 39 | } |
@@ -43,12 +43,12 @@ discard block |
||
| 43 | 43 | // Prepare file record object. |
| 44 | 44 | $user_context = context_user::instance($USER->id); |
| 45 | 45 | $fileinfo = array( |
| 46 | - 'contextid' => $user_context->id, // ID of context. |
|
| 46 | + 'contextid' => $user_context->id, // ID of context. |
|
| 47 | 47 | 'component' => 'tinymce_recordrtc', // Usually = table name. |
| 48 | - 'filearea' => 'annotation', // Usually = table name. |
|
| 49 | - 'itemid' => time(), // Usually = ID of row in table. |
|
| 50 | - 'filepath' => '/', // Any path beginning and ending in "/". |
|
| 51 | - 'filename' => $fileName, // Any filename. |
|
| 48 | + 'filearea' => 'annotation', // Usually = table name. |
|
| 49 | + 'itemid' => time(), // Usually = ID of row in table. |
|
| 50 | + 'filepath' => '/', // Any path beginning and ending in "/". |
|
| 51 | + 'filename' => $fileName, // Any filename. |
|
| 52 | 52 | 'author' => fullname($USER), |
| 53 | 53 | 'licence' => $CFG->sitedefaultlicense |
| 54 | 54 | ); |