@@ -28,4 +28,4 @@ |
||
| 28 | 28 | global $CFG; |
| 29 | 29 | |
| 30 | 30 | require_once(dirname(__FILE__).'/lib.php'); |
| 31 | -require_once($CFG->libdir . '/filelib.php'); |
|
| 31 | +require_once($CFG->libdir.'/filelib.php'); |
|
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | $out .= ' <div class="row hide">'."\n"; |
| 78 | 78 | $out .= ' <div class="col-sm-12">'."\n"; |
| 79 | 79 | $out .= ' <div id="alert-warning" class="alert alert-warning"><strong>' |
| 80 | - .get_string('browseralert_title', 'tinymce_recordrtc').'</strong> ' |
|
| 81 | - .get_string('browseralert', 'tinymce_recordrtc').'</div>'."\n"; |
|
| 80 | + .get_string('browseralert_title', 'tinymce_recordrtc').'</strong> ' |
|
| 81 | + .get_string('browseralert', 'tinymce_recordrtc').'</div>'."\n"; |
|
| 82 | 82 | $out .= ' </div>'."\n"; |
| 83 | 83 | $out .= ' </div>'."\n"; |
| 84 | 84 | $out .= ' <div class="row hide">'."\n"; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $out .= ' </div>'."\n"; |
| 101 | 101 | $out .= ' <div class="col-sm-10">'."\n"; |
| 102 | 102 | $out .= ' <button id="start-stop" class="btn btn-lg btn-outline-danger btn-block">' |
| 103 | - .get_string('startrecording', 'tinymce_recordrtc').'</button>'."\n"; |
|
| 103 | + .get_string('startrecording', 'tinymce_recordrtc').'</button>'."\n"; |
|
| 104 | 104 | $out .= ' </div>'."\n"; |
| 105 | 105 | $out .= ' <div class="col-sm-1">'."\n"; |
| 106 | 106 | $out .= ' </div>'."\n"; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $out .= ' </div>'."\n"; |
| 111 | 111 | $out .= ' <div class="col-sm-6">'."\n"; |
| 112 | 112 | $out .= ' <button id="upload" class="btn btn-primary btn-block">' |
| 113 | - .get_string('attachrecording', 'tinymce_recordrtc').'</button>'."\n"; |
|
| 113 | + .get_string('attachrecording', 'tinymce_recordrtc').'</button>'."\n"; |
|
| 114 | 114 | $out .= ' </div>'."\n"; |
| 115 | 115 | $out .= ' <div class="col-sm-3">'."\n"; |
| 116 | 116 | $out .= ' </div>'."\n"; |
@@ -43,10 +43,10 @@ |
||
| 43 | 43 | // Reset page layout for inside editor. |
| 44 | 44 | $PAGE->set_pagelayout('embedded'); |
| 45 | 45 | |
| 46 | -$PAGE->requires->css( new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/css/style.css') ); |
|
| 47 | -$PAGE->requires->js( new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/bowser.js'), true ); |
|
| 48 | -$PAGE->requires->js( new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/adapter.js'), true ); |
|
| 49 | -$PAGE->requires->js( new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/commonmodule.js'), true ); |
|
| 46 | +$PAGE->requires->css(new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/css/style.css')); |
|
| 47 | +$PAGE->requires->js(new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/bowser.js'), true); |
|
| 48 | +$PAGE->requires->js(new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/adapter.js'), true); |
|
| 49 | +$PAGE->requires->js(new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/commonmodule.js'), true); |
|
| 50 | 50 | |
| 51 | 51 | $jsvars = array( |
| 52 | 52 | 'contextid' => $contextid, |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | 'sesskey' => sesskey(), |
| 62 | 62 | 'type' => $this->get_config('allowedtypes'), |
| 63 | 63 | 'timelimit' => $this->get_config('timelimit') |
| 64 | - ); |
|
| 64 | + ); |
|
| 65 | 65 | $this->add_button_after($params, 0, 'audiortc'); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | 'sesskey' => sesskey(), |
| 74 | 74 | 'type' => $this->get_config('allowedtypes'), |
| 75 | 75 | 'timelimit' => $this->get_config('timelimit') |
| 76 | - ); |
|
| 76 | + ); |
|
| 77 | 77 | $this->add_button_after($params, 0, 'videortc'); |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | // Add audio button at the end of the first row. |
| 56 | 56 | $allowedtypes = $this->get_config('allowedtypes', 'both'); |
| 57 | - if ( $allowedtypes == 'both' || $allowedtypes == 'audio') { |
|
| 57 | + if ($allowedtypes == 'both' || $allowedtypes == 'audio') { |
|
| 58 | 58 | // Add parameters for audiortc. |
| 59 | 59 | $params['audiortc'] = array( |
| 60 | 60 | 'contextid' => $options['context']->id, |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // Add video button at the end of the first row. |
| 69 | - if ( $allowedtypes == 'both' || $allowedtypes == 'video') { |
|
| 69 | + if ($allowedtypes == 'both' || $allowedtypes == 'video') { |
|
| 70 | 70 | // Add parameters for audiortc. |
| 71 | 71 | $params['videortc'] = array( |
| 72 | 72 | 'contextid' => $options['context']->id, |
@@ -60,18 +60,18 @@ |
||
| 60 | 60 | // Prepare file record object. |
| 61 | 61 | $usercontext = context_user::instance($USER->id); |
| 62 | 62 | $fileinfo = array( |
| 63 | - 'contextid' => $usercontext->id, // ID of context. |
|
| 64 | - 'component' => 'tinymce_recordrtc', // Usually = table name. |
|
| 65 | - 'filearea' => 'annotation', // Usually = table name. |
|
| 66 | - 'itemid' => time(), // Usually = ID of row in table. |
|
| 67 | - 'filepath' => '/', // Any path beginning and ending in "/". |
|
| 68 | - 'filename' => $filename, // Any filename. |
|
| 69 | - 'author' => fullname($USER), |
|
| 70 | - 'licence' => $CFG->sitedefaultlicense |
|
| 71 | - ); |
|
| 63 | + 'contextid' => $usercontext->id, // ID of context. |
|
| 64 | + 'component' => 'tinymce_recordrtc', // Usually = table name. |
|
| 65 | + 'filearea' => 'annotation', // Usually = table name. |
|
| 66 | + 'itemid' => time(), // Usually = ID of row in table. |
|
| 67 | + 'filepath' => '/', // Any path beginning and ending in "/". |
|
| 68 | + 'filename' => $filename, // Any filename. |
|
| 69 | + 'author' => fullname($USER), |
|
| 70 | + 'licence' => $CFG->sitedefaultlicense |
|
| 71 | + ); |
|
| 72 | 72 | $filesaved = $fs->create_file_from_pathname($fileinfo, $filetmp); |
| 73 | 73 | |
| 74 | 74 | // OK response. |
| 75 | 75 | $filetarget = $filesaved->get_contextid().'/'.$filesaved->get_component().'/'.$filesaved->get_filearea().'/'. |
| 76 | - $filesaved->get_itemid().'/'.$filesaved->get_filename(); |
|
| 76 | + $filesaved->get_itemid().'/'.$filesaved->get_filename(); |
|
| 77 | 77 | echo($filetarget); |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | require_login($course, false, $cm); |
| 35 | 35 | require_sesskey(); |
| 36 | 36 | |
| 37 | -if ( !isset($_FILES["audio-blob"]) && !isset($_FILES["video-blob"]) ) { |
|
| 37 | +if (!isset($_FILES["audio-blob"]) && !isset($_FILES["video-blob"])) { |
|
| 38 | 38 | $error = "Blob not included"; |
| 39 | 39 | debugging($error, DEBUG_DEVELOPER); |
| 40 | 40 | header("HTTP/1.0 400 Bad Request"); |
| 41 | 41 | return; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | -if ( !isset($_POST["audio-filename"]) && !isset($_POST["video-filename"]) ) { |
|
| 44 | +if (!isset($_POST["audio-filename"]) && !isset($_POST["video-filename"])) { |
|
| 45 | 45 | $error = "Filename not included"; |
| 46 | 46 | debugging($error, DEBUG_DEVELOPER); |
| 47 | 47 | header("HTTP/1.0 400 Bad Request"); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | $filename = $_POST["audio-filename"]; |
| 52 | 52 | $filetmp = $_FILES["audio-blob"]["tmp_name"]; |
| 53 | -if ( !isset($_FILES["audio-blob"]) || !isset($_POST["audio-filename"]) ) { |
|
| 53 | +if (!isset($_FILES["audio-blob"]) || !isset($_POST["audio-filename"])) { |
|
| 54 | 54 | $filename = $_POST["video-filename"]; |
| 55 | 55 | $filetmp = $_FILES["video-blob"]["tmp_name"]; |
| 56 | 56 | } |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | // Prepare file record object. |
| 61 | 61 | $usercontext = context_user::instance($USER->id); |
| 62 | 62 | $fileinfo = array( |
| 63 | - 'contextid' => $usercontext->id, // ID of context. |
|
| 63 | + 'contextid' => $usercontext->id, // ID of context. |
|
| 64 | 64 | 'component' => 'tinymce_recordrtc', // Usually = table name. |
| 65 | - 'filearea' => 'annotation', // Usually = table name. |
|
| 66 | - 'itemid' => time(), // Usually = ID of row in table. |
|
| 67 | - 'filepath' => '/', // Any path beginning and ending in "/". |
|
| 68 | - 'filename' => $filename, // Any filename. |
|
| 65 | + 'filearea' => 'annotation', // Usually = table name. |
|
| 66 | + 'itemid' => time(), // Usually = ID of row in table. |
|
| 67 | + 'filepath' => '/', // Any path beginning and ending in "/". |
|
| 68 | + 'filename' => $filename, // Any filename. |
|
| 69 | 69 | 'author' => fullname($USER), |
| 70 | 70 | 'licence' => $CFG->sitedefaultlicense |
| 71 | 71 | ); |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | $out .= ' <div class="row hide">'."\n"; |
| 78 | 78 | $out .= ' <div class="col-sm-12">'."\n"; |
| 79 | 79 | $out .= ' <div id="alert-warning" class="alert alert-warning"><strong>' |
| 80 | - .get_string('browseralert_title', 'tinymce_recordrtc').'</strong> ' |
|
| 81 | - .get_string('browseralert', 'tinymce_recordrtc').'</div>'."\n"; |
|
| 80 | + .get_string('browseralert_title', 'tinymce_recordrtc').'</strong> ' |
|
| 81 | + .get_string('browseralert', 'tinymce_recordrtc').'</div>'."\n"; |
|
| 82 | 82 | $out .= ' </div>'."\n"; |
| 83 | 83 | $out .= ' </div>'."\n"; |
| 84 | 84 | $out .= ' <div class="row hide">'."\n"; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $out .= ' </div>'."\n"; |
| 97 | 97 | $out .= ' <div class="col-sm-10">'."\n"; |
| 98 | 98 | $out .= ' <button id="start-stop" class="btn btn-lg btn-outline-danger btn-block">' |
| 99 | - .get_string('startrecording', 'tinymce_recordrtc').'</button>'."\n"; |
|
| 99 | + .get_string('startrecording', 'tinymce_recordrtc').'</button>'."\n"; |
|
| 100 | 100 | $out .= ' </div>'."\n"; |
| 101 | 101 | $out .= ' <div class="col-sm-1">'."\n"; |
| 102 | 102 | $out .= ' </div>'."\n"; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $out .= ' </div>'."\n"; |
| 107 | 107 | $out .= ' <div class="col-sm-6">'."\n"; |
| 108 | 108 | $out .= ' <button id="upload" class="btn btn-primary btn-block">' |
| 109 | - .get_string('attachrecording', 'tinymce_recordrtc').'</button>'."\n"; |
|
| 109 | + .get_string('attachrecording', 'tinymce_recordrtc').'</button>'."\n"; |
|
| 110 | 110 | $out .= ' </div>'."\n"; |
| 111 | 111 | $out .= ' <div class="col-sm-3">'."\n"; |
| 112 | 112 | $out .= ' </div>'."\n"; |
@@ -43,10 +43,10 @@ |
||
| 43 | 43 | // Reset page layout for inside editor. |
| 44 | 44 | $PAGE->set_pagelayout('embedded'); |
| 45 | 45 | |
| 46 | -$PAGE->requires->css( new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/css/style.css') ); |
|
| 47 | -$PAGE->requires->js( new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/bowser.js'), true ); |
|
| 48 | -$PAGE->requires->js( new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/adapter.js'), true ); |
|
| 49 | -$PAGE->requires->js( new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/commonmodule.js'), true ); |
|
| 46 | +$PAGE->requires->css(new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/css/style.css')); |
|
| 47 | +$PAGE->requires->js(new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/bowser.js'), true); |
|
| 48 | +$PAGE->requires->js(new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/adapter.js'), true); |
|
| 49 | +$PAGE->requires->js(new moodle_url($CFG->wwwroot.MOODLE_TINYMCE_RECORDRTC_ROOT.'tinymce/js/commonmodule.js'), true); |
|
| 50 | 50 | |
| 51 | 51 | $jsvars = array( |
| 52 | 52 | 'contextid' => $contextid, |