mirror of
https://github.com/moodle/moodle.git
synced 2025-03-21 16:10:15 +01:00
MDL-60848 editor_atto: upgrade to add recordrtc
This commit is contained in:
parent
dde2a79a70
commit
6b21108b44
@ -41,5 +41,30 @@ function xmldb_editor_atto_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.4.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2018041100) {
|
||||
$toolbar = get_config('editor_atto', 'toolbar');
|
||||
|
||||
if (strpos($toolbar, 'recordrtc') === false) {
|
||||
$glue = "\r\n";
|
||||
if (strpos($toolbar, $glue) === false) {
|
||||
$glue = "\n";
|
||||
}
|
||||
$groups = explode($glue, $toolbar);
|
||||
// Try to put recordrtc in files group.
|
||||
foreach ($groups as $i => $group) {
|
||||
$parts = explode('=', $group);
|
||||
if (trim($parts[0]) == 'files') {
|
||||
$groups[$i] = 'files = ' . trim($parts[1]) . ', recordrtc';
|
||||
// Update config variable.
|
||||
$toolbar = implode($glue, $groups);
|
||||
set_config('toolbar', $toolbar, 'editor_atto');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Atto editor savepoint reached.
|
||||
upgrade_plugin_savepoint(true, 2018041100, 'editor', 'atto');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ if ($ADMIN->fulltree) {
|
||||
style1 = title, bold, italic
|
||||
list = unorderedlist, orderedlist
|
||||
links = link
|
||||
files = image, media, managefiles
|
||||
files = image, media, managefiles, recordrtc
|
||||
style2 = underline, strike, subscript, superscript
|
||||
align = align
|
||||
indent = indent
|
||||
|
@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017111300; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2018041100; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2017110800; // Requires this Moodle version.
|
||||
$plugin->component = 'editor_atto'; // Full name of the plugin (used for diagnostics).
|
||||
|
Loading…
x
Reference in New Issue
Block a user