diff --git a/lib/classes/plugin_manager.php b/lib/classes/plugin_manager.php index b5ca099ac67..40bd6b339e3 100644 --- a/lib/classes/plugin_manager.php +++ b/lib/classes/plugin_manager.php @@ -904,6 +904,7 @@ class core_plugin_manager { 'qformat' => array('blackboard'), 'enrol' => array('authorize'), 'tool' => array('bloglevelupgrade'), + 'theme' => array('mymobile'), ); if (!isset($plugins[$type])) { diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 2f142543a9e..3fb7f92382c 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2780,39 +2780,6 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2013102500.01); } - if ($oldversion < 2013110400.00) { - - if (!check_dir_exists($CFG->dirroot . '/theme/mymobile', false)) { - // Delete from config_plugins. - $DB->delete_records('config_plugins', array('plugin' => 'theme_mymobile')); - // Delete the config logs. - $DB->delete_records('config_log', array('plugin' => 'theme_mymobile')); - - // Replace the mymobile settings. - $DB->set_field('course', 'theme', 'clean', array('theme' => 'mymobile')); - $DB->set_field('course_categories', 'theme', 'clean', array('theme' => 'mymobile')); - $DB->set_field('user', 'theme', 'clean', array('theme' => 'mymobile')); - $DB->set_field('mnet_host', 'theme', 'clean', array('theme' => 'mymobile')); - - // Replace the theme configs. - if (get_config('core', 'theme') == 'mymobile') { - set_config('theme', 'clean'); - } - if (get_config('core', 'thememobile') == 'mymobile') { - set_config('thememobile', 'clean'); - } - if (get_config('core', 'themelegacy') == 'mymobile') { - set_config('themelegacy', 'clean'); - } - if (get_config('core', 'themetablet') == 'mymobile') { - set_config('themetablet', 'clean'); - } - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2013110400.00); - } - if ($oldversion < 2013110500.01) { // MDL-38228. Corrected course_modules upgrade script instead of 2013021801.01. @@ -2833,5 +2800,36 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2013110500.01); } + if ($oldversion < 2013110600.01) { + + if (!file_exists($CFG->dirroot . '/theme/mymobile')) { + // Replace the mymobile settings. + $DB->set_field('course', 'theme', 'clean', array('theme' => 'mymobile')); + $DB->set_field('course_categories', 'theme', 'clean', array('theme' => 'mymobile')); + $DB->set_field('user', 'theme', 'clean', array('theme' => 'mymobile')); + $DB->set_field('mnet_host', 'theme', 'clean', array('theme' => 'mymobile')); + + // Replace the theme configs. + if (get_config('core', 'theme') === 'mymobile') { + set_config('theme', 'clean'); + } + if (get_config('core', 'thememobile') === 'mymobile') { + set_config('thememobile', 'clean'); + } + if (get_config('core', 'themelegacy') === 'mymobile') { + set_config('themelegacy', 'clean'); + } + if (get_config('core', 'themetablet') === 'mymobile') { + set_config('themetablet', 'clean'); + } + + // Hacky emulation of plugin uninstallation. + unset_all_config_for_plugin('theme_mymobile'); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2013110600.01); + } + return true; } diff --git a/version.php b/version.php index 7ccc3a517fe..50f52bbd140 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2013110600.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2013110600.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.