Merge branch 'MDL-57737-32' of git://github.com/crazyserver/moodle into MOODLE_32_STABLE

This commit is contained in:
Dan Poltawski
2017-01-23 09:26:56 +00:00
27 changed files with 151 additions and 57 deletions
+2 -1
View File
@@ -56,7 +56,8 @@ lib/amd/src/chartjs-lazy.js
lib/maxmind/GeoIp2/
lib/maxmind/MaxMind/
lib/ltiprovider/
media/player/videojs/amd/src/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js
media/player/videojs/videojs/
mod/assign/feedback/editpdf/fpdi/
repository/s3/S3.php
+2 -1
View File
@@ -57,7 +57,8 @@ lib/amd/src/chartjs-lazy.js
lib/maxmind/GeoIp2/
lib/maxmind/MaxMind/
lib/ltiprovider/
media/player/videojs/amd/src/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js
media/player/videojs/videojs/
mod/assign/feedback/editpdf/fpdi/
repository/s3/S3.php
+3 -3
View File
@@ -242,6 +242,9 @@ function xmldb_enrol_lti_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2016052304, 'enrol', 'lti');
}
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2016120501) {
// Changing precision of field value on table enrol_lti_lti2_nonce to (64).
@@ -255,8 +258,5 @@ function xmldb_enrol_lti_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2016120501, 'enrol', 'lti');
}
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -31,4 +31,4 @@
defined('MOODLE_INTERNAL') || die();
$string['parentlanguage'] = 'es_mx';
$string['thislanguage'] = 'Español - México - kids';
$string['thislanguage'] = 'Español de México para niños';
+1
View File
@@ -36,6 +36,7 @@ $string['chooselanguagehead'] = 'انتخاب زبان';
$string['chooselanguagesub'] = 'لطفاً زبانی را به جهت استفاده در حین نصب انتخاب نمایید. زبانی که در این صفحه انتخاب می‌کنید به عنوان زبان پیش‌فرض سایت نیز مورد استفاده قرار خواهد گرفت. البته می‌توانید بعداً آن را تغییر دهید.<br />ترجمهٔ فارسی این نسخه با همکاری <a href="http://foodle.org" target="_blank">گروه فودل</a> آماده شده است.';
$string['databasehost'] = 'میزبان پایگاه داده';
$string['databasename'] = 'نام پایگاه داده';
$string['databasetypehead'] = 'راه‌انداز پایگاه داده را انتخاب کنید';
$string['dataroot'] = 'دایرکتوری داده';
$string['dbprefix'] = 'پیشوند جدول‌ها';
$string['dirroot'] = 'دایرکتوری مودل';
+1
View File
@@ -31,6 +31,7 @@
defined('MOODLE_INTERNAL') || die();
$string['language'] = 'Valoda';
$string['moodlelogo'] = 'Moodle logo';
$string['next'] = 'Nākamais';
$string['previous'] = 'Iepriekšējais';
$string['reload'] = 'Atkārtoti ielādēt';
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
define(["jquery","media_videojs/video","core/event"],function(a,b,c){var d=function(){c.getLegacyEvents().done(function(b){a(document).on(b.FILTER_CONTENT_UPDATED,e)})},e=function(c,d){var e=".mediaplugin_videojs";d.find(e).addBack(e).find("audio, video").each(function(){var c=a(this).attr("id"),d=a(this).data("setup");b(c,d)})};return{setUp:d}});
define(["jquery","core/event"],function(a,b){var c,d=function(d){c=d,e(null,a("body")),b.getLegacyEvents().done(function(b){a(document).on(b.FILTER_CONTENT_UPDATED,e)})},e=function(b,d){var e=".mediaplugin_videojs";d.find(e).addBack(e).find("audio, video").each(function(){var b=a(this).attr("id"),d=a(this).data("setup"),e=["media_videojs/video-lazy"];d.techOrder&&d.techOrder.indexOf("youtube")!==-1&&e.push("media_videojs/Youtube-lazy"),require(e,function(a){c&&(c(a),c=null),a(b,d)})})};return{setUp:d}});
@@ -24,7 +24,7 @@ THE SOFTWARE. */
if(typeof exports==='object' && typeof module!=='undefined') {
module.exports = factory(require('video.js'));
} else if(typeof define === 'function' && define.amd) {
define(['media_videojs/video'], function(videojs){
define(['media_videojs/video-lazy'], function(videojs){
return (root.Youtube = factory(videojs));
});
} else {
+24 -4
View File
@@ -22,14 +22,23 @@
* @copyright 2016 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'media_videojs/video', 'core/event'], function($, videojs, Event) {
define(['jquery', 'core/event'], function($, Event) {
/**
* Stores the method we need to execute on the first load of videojs module.
*/
var onload;
/**
* Set-up.
*
* Adds the listener for the event to then notify video.js.
* @param {Function} executeonload function to execute when media_videojs/video is loaded
*/
var setUp = function() {
var setUp = function(executeonload) {
onload = executeonload;
// Notify Video.js about the nodes already present on the page.
notifyVideoJS(null, $('body'));
// We need to call popover automatically if nodes are added to the page later.
Event.getLegacyEvents().done(function(events) {
$(document).on(events.FILTER_CONTENT_UPDATED, notifyVideoJS);
@@ -53,9 +62,20 @@ define(['jquery', 'media_videojs/video', 'core/event'], function($, videojs, Eve
.addBack(selector)
.find('audio, video').each(function() {
var id = $(this).attr('id'),
config = $(this).data('setup');
config = $(this).data('setup'),
modules = ['media_videojs/video-lazy'];
videojs(id, config);
if (config.techOrder && config.techOrder.indexOf('youtube') !== -1) {
// Add YouTube to the list of modules we require.
modules.push('media_videojs/Youtube-lazy');
}
require(modules, function(videojs) {
if (onload) {
onload(videojs);
onload = null;
}
videojs(id, config);
});
});
};
+7 -9
View File
@@ -334,21 +334,19 @@ class media_videojs_plugin extends core_media_player_native {
*/
public function setup($page) {
// Load core video JS.
// Load dynamic loader. It will scan page for videojs media and load necessary modules.
// Loader will be loaded on absolutely every page, however the videojs will only be loaded
// when video is present on the page or added later to it in AJAX.
$path = new moodle_url('/media/player/videojs/videojs/video-js.swf');
$contents = 'videojs.options.flash.swf = "' . $path . '";' . "\n";
$contents .= $this->find_language(current_language());
$page->requires->js_amd_inline(<<<EOT
require(["media_videojs/video"], function(videojs) {
$contents
require(["media_videojs/loader"], function(loader) {
loader.setUp(function(videojs) {
$contents
});
});
EOT
);
// Load Youtube JS.
$page->requires->js_amd_inline('require(["media_videojs/Youtube"])');
// Load dynamic loader.
$page->requires->js_call_amd('media_videojs/loader', 'setUp');
}
}
+3 -3
View File
@@ -5,7 +5,7 @@ https://github.com/videojs/video.js
Instructions to import VideoJS player into Moodle:
1. Download the latest release from https://github.com/videojs/video.js/releases in a separate directory
2. copy 'dist/video.js' into 'amd/src/video.js'
2. copy 'dist/video.js' into 'amd/src/video-lazy.js'
3. copy 'dist/font/' into 'fonts/' folder
4. copy 'dist/video-js.css' into 'styles.css'
Replace
@@ -21,8 +21,8 @@ Instructions to import VideoJS player into Moodle:
Import plugins:
1. Copy https://github.com/videojs/videojs-youtube/blob/master/dist/Youtube.js into 'amd/src/Youtube.js'
1. Copy https://github.com/videojs/videojs-youtube/blob/master/dist/Youtube.js into 'amd/src/Youtube-lazy.js'
In the beginning of the js file replace
define(['videojs']
with
define(['media_videojs/video']
define(['media_videojs/video-lazy']
+8 -1
View File
@@ -1,12 +1,19 @@
<?xml version="1.0"?>
<libraries>
<library>
<location>amd/src</location>
<location>amd/src/video-lazy.js</location>
<name>VideoJS</name>
<license>Apache</license>
<version>5.12.6</version>
<licenseversion></licenseversion>
</library>
<library>
<location>amd/src/Youtube-lazy.js</location>
<name>YouTube Playback Technology for Video.js</name>
<license>MIT</license>
<version>2.1.1</version>
<licenseversion></licenseversion>
</library>
<library>
<location>videojs</location>
<name>VideoJS support files</name>
+1 -1
View File
@@ -876,7 +876,7 @@ class core_message_api_testcase extends core_message_messagelib_testcase {
* Tes get_message_processor api.
*/
public function test_get_message_processor() {
$processors = get_message_processors();
$processors = get_message_processors(true);
if (empty($processors)) {
$this->markTestSkipped("No message processors found");
}
+1 -1
View File
@@ -1 +1 @@
define(["core/ajax","jquery","core/templates"],function(a,b,c){return{processResults:function(a,b){var c=[],d=0;for(d=0;d<b.length;d++)c[d]={value:b[d].id,label:b[d].label};return c},transport:function(d,e,f,g){var h=b(d).attr("data-assignmentid"),i=b(d).attr("data-groupid"),j=b('[data-region="configure-filters"] input[type="checkbox"]'),k=[];j.each(function(a,c){k[b(c).attr("name")]=b(c).prop("checked")});var l=a.call([{methodname:"mod_assign_list_participants",args:{assignid:h,groupid:i,filter:e,limit:30,includeenrolments:!1}}]);l[0].then(function(a){var d=[],e=b("[data-showuseridentity]").data("showuseridentity").split(",");b.each(a,function(a,f){var g=f,h=[],i=!0;k.filter_submitted&&!f.submitted&&(i=!1),k.filter_notsubmitted&&f.submitted&&(i=!1),k.filter_requiregrading&&!f.requiregrading&&(i=!1),i&&(b.each(e,function(a,b){"undefined"!=typeof f[b]&&""!==f[b]&&(g.hasidentity=!0,h.push(f[b]))}),g.identity=h.join(", "),d.push(c.render("mod_assign/list_participant_user_summary",g)))}),b.when.apply(b.when,d).then(function(){var c=arguments,d=0;b.each(a,function(a,b){b.label=c[d],d++}),f(a)})},g)}}});
define(["core/ajax","jquery","core/templates"],function(a,b,c){return{processResults:function(a,b){return b},transport:function(d,e,f,g){var h=b(d).attr("data-assignmentid"),i=b(d).attr("data-groupid"),j=b('[data-region="configure-filters"] input[type="checkbox"]'),k=[];j.each(function(a,c){k[b(c).attr("name")]=b(c).prop("checked")}),a.call([{methodname:"mod_assign_list_participants",args:{assignid:h,groupid:i,filter:e,limit:30,includeenrolments:!1}}])[0].then(function(a){var d=[],e=b("[data-showuseridentity]").data("showuseridentity").split(",");return b.each(a,function(a,f){var g=f,h=[],i=!0;k.filter_submitted&&!f.submitted&&(i=!1),k.filter_notsubmitted&&f.submitted&&(i=!1),k.filter_requiregrading&&!f.requiregrading&&(i=!1),i&&(b.each(e,function(a,b){"undefined"!=typeof f[b]&&""!==f[b]&&(g.hasidentity=!0,h.push(f[b]))}),g.identity=h.join(", "),d.push(c.render("mod_assign/list_participant_user_summary",g).then(function(a){return{value:f.id,label:a}})))}),b.when.apply(b,d)}).then(function(){var a=[];arguments[0]&&(a=Array.prototype.slice.call(arguments)),f(a)})["catch"](g)}}});
+17 -23
View File
@@ -35,12 +35,7 @@ define(['core/ajax', 'jquery', 'core/templates'], function(ajax, $, templates) {
* @return {Array}
*/
processResults: function(selector, data) {
var results = [];
var i = 0;
for (i = 0; i < data.length; i++) {
results[i] = {value: data[i].id, label: data[i].label};
}
return results;
return data;
},
/**
@@ -62,12 +57,10 @@ define(['core/ajax', 'jquery', 'core/templates'], function(ajax, $, templates) {
filterstrings[$(element).attr('name')] = $(element).prop('checked');
});
var promise = ajax.call([{
ajax.call([{
methodname: 'mod_assign_list_participants',
args: {assignid: assignmentid, groupid: groupid, filter: query, limit: 30, includeenrolments: false}
}]);
promise[0].then(function(results) {
}])[0].then(function(results) {
var promises = [];
var identityfields = $('[data-showuseridentity]').data('showuseridentity').split(',');
@@ -94,23 +87,24 @@ define(['core/ajax', 'jquery', 'core/templates'], function(ajax, $, templates) {
}
});
ctx.identity = identity.join(', ');
promises.push(templates.render('mod_assign/list_participant_user_summary', ctx));
promises.push(templates.render('mod_assign/list_participant_user_summary', ctx).then(function(html) {
return {value: user.id, label: html};
}));
}
});
// Do the dance for $.when()
return $.when.apply($, promises);
}).then(function() {
var users = [];
// When all the templates have been rendered, call the success handler.
$.when.apply($.when, promises).then(function() {
var args = arguments,
i = 0;
// Determine if we've been passed any arguments..
if (arguments[0]) {
// Undo the $.when() dance from arguments object into an array..
users = Array.prototype.slice.call(arguments);
}
$.each(results, function(index, user) {
user.label = args[i];
i++;
});
success(results);
});
}, failure);
success(users);
}).catch(failure);
}
};
});
@@ -53,6 +53,8 @@ class big_search_form implements renderable, templatable {
public $subject;
public $user;
public $words;
/** @var string The URL of the search form. */
public $actionurl;
/**
* Constructor.
@@ -65,6 +67,7 @@ class big_search_form implements renderable, templatable {
$this->course = $course;
$this->scripturl = new moodle_url('/mod/forum/forum.js');
$this->showfullwords = $DB->get_dbfamily() == 'mysql' || $DB->get_dbfamily() == 'postgres';
$this->actionurl = new moodle_url('/mod/forum/search.php');
$forumoptions = ['' => get_string('allforums', 'forum')] + forum_menu_list($course);
$this->forumoptions = array_map(function($option) use ($forumoptions) {
@@ -161,6 +164,7 @@ class big_search_form implements renderable, templatable {
$data->subject = $this->subject;
$data->user = $this->user;
$data->showfullwords = $this->showfullwords;
$data->actionurl = $this->actionurl->out(false);
$datefrom = $this->datefrom;
if (empty($datefrom)) {
+32 -1
View File
@@ -15,7 +15,38 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_forum/big_search_form
Big search form.
Example context (json):
{
"scripturl": "https://example.com/mod/forum/forum.js",
"actionurl": "https://example.com/mod/forum/search.php",
"courseid": "2",
"words": "apples",
"phrase": "Lorem ipsum dolor",
"notwords": "Not these words",
"showfullwords": [
{
"fullwords": "Exactly"
}
],
"datefromchecked": 1,
"datetochecked": "",
"forumoptions": [
{
"name": "Forum One",
"value": "23"
},
{
"name": "Forum Two",
"value": "34"
}
],
"subject": "Help me please",
"user": "Helpy McUser"
}
}}
<div id="intro" class="box searchbox boxaligncenter">
{{#str}}searchforumintro, forum{{/str}}
@@ -92,7 +123,7 @@
<label for="menuforumid">{{#str}}searchwhichforums, forum{{/str}}</label>
</td>
<td class="c1">
<select name="menuforumid" id="menuforumid">
<select name="forumid" id="menuforumid">
{{#forumoptions}}
<option value="{{value}}">{{name}}</option>
{{/forumoptions}}
+1 -1
View File
@@ -1412,7 +1412,7 @@ class mod_glossary_external extends external_api {
return new external_function_parameters(array(
'glossaryid' => new external_value(PARAM_INT, 'Glossary id'),
'concept' => new external_value(PARAM_TEXT, 'Glossary concept'),
'definition' => new external_value(PARAM_TEXT, 'Glossary concept definition'),
'definition' => new external_value(PARAM_RAW, 'Glossary concept definition'),
'definitionformat' => new external_format_value('definition'),
'options' => new external_multiple_structure (
new external_single_structure(
+1 -1
View File
@@ -1121,7 +1121,7 @@ class mod_glossary_external_testcase extends externallib_advanced_testcase {
$this->setAdminUser();
$concept = 'A concept';
$definition = 'A definition';
$definition = '<p>A definition</p>';
$return = mod_glossary_external::add_entry($glossary->id, $concept, $definition, FORMAT_HTML);
$return = external_api::clean_returnvalue(mod_glossary_external::add_entry_returns(), $return);
@@ -84,6 +84,7 @@ Feature: Scorm multi-sco completion
And I follow "Exit activity"
And I wait until the page is ready
Then I should see "ADV Multi-sco SCORM package"
And I am on homepage
And I log out
And I log in as "teacher1"
And I follow "Course 1"
@@ -45,6 +45,8 @@ Feature: Scorm multi-sco review mode.
And I follow "Exit activity"
And I wait until the page is ready
And I should see "Basic Multi-sco SCORM package"
And I am on homepage
And I follow "Course 1"
And I follow "Basic Multi-sco SCORM package"
And I should see "Normal"
And I press "Enter"
@@ -166,6 +168,8 @@ Feature: Scorm multi-sco review mode.
And I follow "Exit activity"
And I wait until the page is ready
And I should see "ADV Multi-sco SCORM package"
And I am on homepage
And I follow "Course 1"
And I follow "ADV Multi-sco SCORM package"
And I should see "Normal"
And I press "Enter"
@@ -15,7 +15,38 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_forum/big_search_form
Big search form.
Example context (json):
{
"scripturl": "https://example.com/mod/forum/forum.js",
"actionurl": "https://example.com/mod/forum/search.php",
"courseid": "2",
"words": "apples",
"phrase": "Lorem ipsum dolor",
"notwords": "Not these words",
"showfullwords": [
{
"fullwords": "Exactly"
}
],
"datefromchecked": 1,
"datetochecked": "",
"forumoptions": [
{
"name": "Forum One",
"value": "23"
},
{
"name": "Forum Two",
"value": "34"
}
],
"subject": "Help me please",
"user": "Helpy McUser"
}
}}
<div id="intro" class="box searchbox boxaligncenter">
{{#str}}searchforumintro, forum{{/str}}
@@ -92,7 +123,7 @@
<label for="menuforumid">{{#str}}searchwhichforums, forum{{/str}}</label>
</td>
<td class="c1">
<select name="menuforumid" id="menuforumid" class="form-control">
<select name="forumid" id="menuforumid" class="form-control">
{{#forumoptions}}
<option value="{{value}}">{{name}}</option>
{{/forumoptions}}
+2 -2
View File
@@ -29,11 +29,11 @@
defined('MOODLE_INTERNAL') || die();
$version = 2016120501.01; // 20161205 = branching date YYYYMMDD - do not modify!
$version = 2016120501.02; // 20161205 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '3.2.1+ (Build: 20170112)'; // Human-friendly version name
$release = '3.2.1+ (Build: 20170119)'; // Human-friendly version name
$branch = '32'; // This version's branch.
$maturity = MATURITY_STABLE; // This version's maturity level.