Skip to content

Commit

Permalink
Merge branch 'MDL-62872-36' of git://github.com/rezaies/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_36_STABLE
  • Loading branch information
junpataleta committed Mar 20, 2019
2 parents 036e58c + 0bc2276 commit 248f5a1
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 19 deletions.
7 changes: 4 additions & 3 deletions lib/editor/atto/plugins/recordrtc/lib.php
Expand Up @@ -34,8 +34,6 @@
* @param stdClass $fpoptions - unused.
*/
function atto_recordrtc_params_for_js($elementid, $options, $fpoptions) {
global $CFG;

$context = $options['context'];
if (!$context) {
$context = context_system::instance();
Expand All @@ -62,7 +60,10 @@ function atto_recordrtc_params_for_js($elementid, $options, $fpoptions) {
$allowedtypes = '';
}

$maxrecsize = ini_get('upload_max_filesize');
$maxrecsize = get_max_upload_file_size();
if (!empty($options['maxbytes'])) {
$maxrecsize = min($maxrecsize, $options['maxbytes']);
}
$audiortcicon = 'i/audiortc';
$videortcicon = 'i/videortc';
$params = array('contextid' => $context->id,
Expand Down
Expand Up @@ -346,7 +346,7 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
},

/**
* Maximum upload size set on server, in MB.
* Maximum upload size set on server, in bytes.
*
* @attribute maxrecsize
* @type String
Expand Down
Expand Up @@ -346,7 +346,7 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
},

/**
* Maximum upload size set on server, in MB.
* Maximum upload size set on server, in bytes.
*
* @attribute maxrecsize
* @type String
Expand Down
Expand Up @@ -543,8 +543,7 @@ M.atto_recordrtc.audiomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'audio';
// Extract the numbers from the string, and convert to bytes.
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
cm.maxUploadSize = scope.get('maxrecsize');

// Show alert and close plugin if WebRTC is not supported.
ccm.check_has_gum();
Expand Down Expand Up @@ -692,8 +691,7 @@ M.atto_recordrtc.videomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'video';
// Extract the numbers from the string, and convert to bytes.
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
cm.maxUploadSize = scope.get('maxrecsize');

// Show alert and close plugin if WebRTC is not supported.
ccm.check_has_gum();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -543,8 +543,7 @@ M.atto_recordrtc.audiomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'audio';
// Extract the numbers from the string, and convert to bytes.
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
cm.maxUploadSize = scope.get('maxrecsize');

// Show alert and close plugin if WebRTC is not supported.
ccm.check_has_gum();
Expand Down Expand Up @@ -692,8 +691,7 @@ M.atto_recordrtc.videomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'video';
// Extract the numbers from the string, and convert to bytes.
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
cm.maxUploadSize = scope.get('maxrecsize');

// Show alert and close plugin if WebRTC is not supported.
ccm.check_has_gum();
Expand Down
Expand Up @@ -344,7 +344,7 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
},

/**
* Maximum upload size set on server, in MB.
* Maximum upload size set on server, in bytes.
*
* @attribute maxrecsize
* @type String
Expand Down
Expand Up @@ -49,8 +49,7 @@ M.atto_recordrtc.audiomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'audio';
// Extract the numbers from the string, and convert to bytes.
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
cm.maxUploadSize = scope.get('maxrecsize');

// Show alert and close plugin if WebRTC is not supported.
ccm.check_has_gum();
Expand Down
Expand Up @@ -49,8 +49,7 @@ M.atto_recordrtc.videomodule = {
cm.startStopBtn = Y.one('button#start-stop');
cm.uploadBtn = Y.one('button#upload');
cm.recType = 'video';
// Extract the numbers from the string, and convert to bytes.
cm.maxUploadSize = window.parseInt(scope.get('maxrecsize').match(/\d+/)[0], 10) * Math.pow(1024, 2);
cm.maxUploadSize = scope.get('maxrecsize');

// Show alert and close plugin if WebRTC is not supported.
ccm.check_has_gum();
Expand Down

0 comments on commit 248f5a1

Please sign in to comment.