@@ -74,5 +74,5 @@  | 
                                                    ||
| 74 | 74 | |
| 75 | 75 | // OK response.  | 
                                                        
| 76 | 76 | $filetarget = $filesaved->get_contextid().'/'.$filesaved->get_component().'/'.$filesaved->get_filearea().'/'.  | 
                                                        
| 77 | - $filesaved->get_itemid().'/'.$filesaved->get_filename();  | 
                                                        |
| 77 | + $filesaved->get_itemid().'/'.$filesaved->get_filename();  | 
                                                        |
| 78 | 78 | echo($filetarget);  | 
                                                        
@@ -27,7 +27,7 @@ discard block  | 
                                                    ||
| 27 | 27 | // Disable Moodle-specific debug messages and any errors in output.  | 
                                                        
| 28 | 28 |  define('NO_DEBUG_DISPLAY', true); | 
                                                        
| 29 | 29 | |
| 30 | -require_once(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))).'/config.php');  | 
                                                        |
| 30 | +require_once(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/config.php');  | 
                                                        |
| 31 | 31 | |
| 32 | 32 | // Should probably be required_param, as the context to which it is linked is important.  | 
                                                        
| 33 | 33 |  $contextid = optional_param('contextid', 0, PARAM_INT); | 
                                                        
@@ -65,18 +65,18 @@ discard block  | 
                                                    ||
| 65 | 65 | // Prepare file record object.  | 
                                                        
| 66 | 66 | $usercontext = context_user::instance($USER->id);  | 
                                                        
| 67 | 67 | $fileinfo = array(  | 
                                                        
| 68 | - 'contextid' => $usercontext->id, // ID of context.  | 
                                                        |
| 68 | + 'contextid' => $usercontext->id, // ID of context.  | 
                                                        |
| 69 | 69 | 'component' => 'atto_recordrtc', // Usually = table name.  | 
                                                        
| 70 | - 'filearea' => 'annotation', // Usually = table name.  | 
                                                        |
| 71 | - 'itemid' => time(), // Usually = ID of row in table.  | 
                                                        |
| 72 | - 'filepath' => '/', // Any path beginning and ending in "/".  | 
                                                        |
| 73 | - 'filename' => $filename, // Any filename.  | 
                                                        |
| 70 | + 'filearea' => 'annotation', // Usually = table name.  | 
                                                        |
| 71 | + 'itemid' => time(), // Usually = ID of row in table.  | 
                                                        |
| 72 | + 'filepath' => '/', // Any path beginning and ending in "/".  | 
                                                        |
| 73 | + 'filename' => $filename, // Any filename.  | 
                                                        |
| 74 | 74 | 'author' => fullname($USER),  | 
                                                        
| 75 | 75 | 'license' => $CFG->sitedefaultlicense  | 
                                                        
| 76 | 76 | );  | 
                                                        
| 77 | 77 | $filesaved = $fs->create_file_from_pathname($fileinfo, $filetmp);  | 
                                                        
| 78 | 78 | |
| 79 | 79 | // OK response.  | 
                                                        
| 80 | -$filetarget = $filesaved->get_contextid().'/'.$filesaved->get_component().'/'.$filesaved->get_filearea().'/'.  | 
                                                        |
| 81 | - $filesaved->get_itemid().'/'.$filesaved->get_filename();  | 
                                                        |
| 80 | +$filetarget = $filesaved->get_contextid() . '/' . $filesaved->get_component() . '/' . $filesaved->get_filearea() . '/' .  | 
                                                        |
| 81 | + $filesaved->get_itemid() . '/' . $filesaved->get_filename();  | 
                                                        |
| 82 | 82 | echo($filetarget);  | 
                                                        
@@ -67,7 +67,7 @@ discard block  | 
                                                    ||
| 67 | 67 | 'videortcicon' => $videortcicon,  | 
                                                        
| 68 | 68 | 'oldermoodle' => $moodleversion < $moodle32,  | 
                                                        
| 69 | 69 | 'maxrecsize' => $maxrecsize  | 
                                                        
| 70 | - );  | 
                                                        |
| 70 | + );  | 
                                                        |
| 71 | 71 | |
| 72 | 72 | return $params;  | 
                                                        
| 73 | 73 | }  | 
                                                        
@@ -79,42 +79,42 @@ discard block  | 
                                                    ||
| 79 | 79 | global $PAGE;  | 
                                                        
| 80 | 80 | |
| 81 | 81 |      $PAGE->requires->strings_for_js(array('audiortc', | 
                                                        
| 82 | - 'videortc',  | 
                                                        |
| 83 | - 'gumabort_title',  | 
                                                        |
| 84 | - 'gumabort',  | 
                                                        |
| 85 | - 'gumnotallowed_title',  | 
                                                        |
| 86 | - 'gumnotallowed',  | 
                                                        |
| 87 | - 'gumnotfound_title',  | 
                                                        |
| 88 | - 'gumnotfound',  | 
                                                        |
| 89 | - 'gumnotreadable_title',  | 
                                                        |
| 90 | - 'gumnotreadable',  | 
                                                        |
| 91 | - 'gumoverconstrained_title',  | 
                                                        |
| 92 | - 'gumoverconstrained',  | 
                                                        |
| 93 | - 'gumsecurity_title',  | 
                                                        |
| 94 | - 'gumsecurity',  | 
                                                        |
| 95 | - 'gumtype_title',  | 
                                                        |
| 96 | - 'gumtype',  | 
                                                        |
| 97 | - 'insecurealert_title',  | 
                                                        |
| 98 | - 'insecurealert',  | 
                                                        |
| 99 | - 'browseralert_title',  | 
                                                        |
| 100 | - 'browseralert',  | 
                                                        |
| 101 | - 'startrecording',  | 
                                                        |
| 102 | - 'recordagain',  | 
                                                        |
| 103 | - 'stoprecording',  | 
                                                        |
| 104 | - 'recordingfailed',  | 
                                                        |
| 105 | - 'attachrecording',  | 
                                                        |
| 106 | - 'norecordingfound_title',  | 
                                                        |
| 107 | - 'norecordingfound',  | 
                                                        |
| 108 | - 'nearingmaxsize_title',  | 
                                                        |
| 109 | - 'nearingmaxsize',  | 
                                                        |
| 110 | - 'uploadprogress',  | 
                                                        |
| 111 | - 'uploadfailed',  | 
                                                        |
| 112 | - 'uploadfailed404',  | 
                                                        |
| 113 | - 'uploadaborted',  | 
                                                        |
| 114 | - 'annotationprompt',  | 
                                                        |
| 115 | - 'annotation:audio',  | 
                                                        |
| 116 | - 'annotation:video'),  | 
                                                        |
| 117 | - 'atto_recordrtc');  | 
                                                        |
| 82 | + 'videortc',  | 
                                                        |
| 83 | + 'gumabort_title',  | 
                                                        |
| 84 | + 'gumabort',  | 
                                                        |
| 85 | + 'gumnotallowed_title',  | 
                                                        |
| 86 | + 'gumnotallowed',  | 
                                                        |
| 87 | + 'gumnotfound_title',  | 
                                                        |
| 88 | + 'gumnotfound',  | 
                                                        |
| 89 | + 'gumnotreadable_title',  | 
                                                        |
| 90 | + 'gumnotreadable',  | 
                                                        |
| 91 | + 'gumoverconstrained_title',  | 
                                                        |
| 92 | + 'gumoverconstrained',  | 
                                                        |
| 93 | + 'gumsecurity_title',  | 
                                                        |
| 94 | + 'gumsecurity',  | 
                                                        |
| 95 | + 'gumtype_title',  | 
                                                        |
| 96 | + 'gumtype',  | 
                                                        |
| 97 | + 'insecurealert_title',  | 
                                                        |
| 98 | + 'insecurealert',  | 
                                                        |
| 99 | + 'browseralert_title',  | 
                                                        |
| 100 | + 'browseralert',  | 
                                                        |
| 101 | + 'startrecording',  | 
                                                        |
| 102 | + 'recordagain',  | 
                                                        |
| 103 | + 'stoprecording',  | 
                                                        |
| 104 | + 'recordingfailed',  | 
                                                        |
| 105 | + 'attachrecording',  | 
                                                        |
| 106 | + 'norecordingfound_title',  | 
                                                        |
| 107 | + 'norecordingfound',  | 
                                                        |
| 108 | + 'nearingmaxsize_title',  | 
                                                        |
| 109 | + 'nearingmaxsize',  | 
                                                        |
| 110 | + 'uploadprogress',  | 
                                                        |
| 111 | + 'uploadfailed',  | 
                                                        |
| 112 | + 'uploadfailed404',  | 
                                                        |
| 113 | + 'uploadaborted',  | 
                                                        |
| 114 | + 'annotationprompt',  | 
                                                        |
| 115 | + 'annotation:audio',  | 
                                                        |
| 116 | + 'annotation:video'),  | 
                                                        |
| 117 | + 'atto_recordrtc');  | 
                                                        |
| 118 | 118 | }  | 
                                                        
| 119 | 119 | |
| 120 | 120 | /**  | 
                                                        
@@ -58,7 +58,7 @@ discard block  | 
                                                    ||
| 58 | 58 | }  | 
                                                        
| 59 | 59 |      $params = array('contextid' => $context->id, | 
                                                        
| 60 | 60 | 'sesskey' => $sesskey,  | 
                                                        
| 61 | - 'recordrtcroot' => $CFG->wwwroot.'/lib/editor/atto/plugins/recordrtc/',  | 
                                                        |
| 61 | + 'recordrtcroot' => $CFG->wwwroot . '/lib/editor/atto/plugins/recordrtc/',  | 
                                                        |
| 62 | 62 | 'allowedtypes' => $allowedtypes,  | 
                                                        
| 63 | 63 | 'audiobitrate' => $audiobitrate,  | 
                                                        
| 64 | 64 | 'videobitrate' => $videobitrate,  | 
                                                        
@@ -120,7 +120,7 @@ discard block  | 
                                                    ||
| 120 | 120 | /**  | 
                                                        
| 121 | 121 | * Define file-access behaviour for this plugin.  | 
                                                        
| 122 | 122 | */  | 
                                                        
| 123 | -function atto_recordrtc_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()) { | 
                                                        |
| 123 | +function atto_recordrtc_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) { | 
                                                        |
| 124 | 124 |      if ($filearea !== 'annotation') { | 
                                                        
| 125 | 125 | return false;  | 
                                                        
| 126 | 126 | }  | 
                                                        
@@ -135,7 +135,7 @@ discard block  | 
                                                    ||
| 135 | 135 |      if (!$args) { | 
                                                        
| 136 | 136 | $filepath = '/';  | 
                                                        
| 137 | 137 |      } else { | 
                                                        
| 138 | -        $filepath = '/'.implode('/', $args).'/'; | 
                                                        |
| 138 | +        $filepath = '/' . implode('/', $args) . '/'; | 
                                                        |
| 139 | 139 | }  | 
                                                        
| 140 | 140 | |
| 141 | 141 | $fs = get_file_storage();  |