@@ -14,4 +14,4 @@ |
||
14 | 14 | global $CFG; |
15 | 15 | |
16 | 16 | require_once(dirname(__FILE__).'/lib.php'); |
17 | -require_once($CFG->libdir . '/filelib.php'); |
|
17 | +require_once($CFG->libdir.'/filelib.php'); |
@@ -19,15 +19,15 @@ |
||
19 | 19 | $PAGE->set_context($context); |
20 | 20 | $PAGE->set_url(MOODLE_TINYMCE_RECORDRTC_URL); |
21 | 21 | $PAGE->set_cacheable(false); |
22 | -$title = isset($cm->name)? $cm->name: ''; |
|
22 | +$title = isset($cm->name) ? $cm->name : ''; |
|
23 | 23 | $PAGE->set_title($title); |
24 | 24 | $PAGE->set_heading($title); |
25 | 25 | |
26 | 26 | // Reset page layout for inside editor. |
27 | 27 | $PAGE->set_pagelayout('embedded'); |
28 | 28 | |
29 | -$PAGE->requires->css( new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/css/style.css') ); |
|
30 | -$PAGE->requires->js( new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/detector.js') ); |
|
29 | +$PAGE->requires->css(new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/css/style.css')); |
|
30 | +$PAGE->requires->js(new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/detector.js')); |
|
31 | 31 | |
32 | 32 | $jsVars = array( |
33 | 33 | 'contextid' => $contextid, |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $this->add_js_plugin($params); |
41 | 41 | |
42 | 42 | // Add parameters for recordrtc. |
43 | - $params['recordrtc'] = array('contextid' => $options['context']->id, 'sesskey' => sesskey() ); |
|
43 | + $params['recordrtc'] = array('contextid' => $options['context']->id, 'sesskey' => sesskey()); |
|
44 | 44 | |
45 | 45 | // Position button in toolbar. |
46 | 46 | if ($row = $this->find_button($params, 'moodlemedia')) { |
@@ -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 | ); |