mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
MDL-43784 theme: Removing all the old themes
This commit is contained in:
parent
9b8555fbea
commit
7a2dabcbaa
742 changed files with 57 additions and 31842 deletions
|
@ -909,7 +909,9 @@ class core_plugin_manager {
|
|||
'qformat' => array('blackboard'),
|
||||
'enrol' => array('authorize'),
|
||||
'tool' => array('bloglevelupgrade'),
|
||||
'theme' => array('mymobile'),
|
||||
'theme' => array('mymobile', 'afterburner', 'anomaly', 'arialist', 'binarius', 'boxxie', 'brick', 'formal_white',
|
||||
'formfactor', 'fusion', 'leatherbound', 'magazine', 'nimble', 'nonzero', 'overlay', 'serenity', 'sky_high',
|
||||
'splash', 'standard', 'standardold'),
|
||||
);
|
||||
|
||||
if (!isset($plugins[$type])) {
|
||||
|
@ -1111,11 +1113,7 @@ class core_plugin_manager {
|
|||
),
|
||||
|
||||
'theme' => array(
|
||||
'afterburner', 'anomaly', 'arialist', 'base', 'binarius', 'bootstrapbase',
|
||||
'boxxie', 'brick', 'canvas', 'clean', 'formal_white', 'formfactor',
|
||||
'fusion', 'leatherbound', 'magazine', 'nimble',
|
||||
'nonzero', 'overlay', 'serenity', 'sky_high', 'splash',
|
||||
'standard', 'standardold'
|
||||
'base', 'bootstrapbase', 'canvas', 'clean'
|
||||
),
|
||||
|
||||
'tool' => array(
|
||||
|
|
|
@ -3183,5 +3183,50 @@ function xmldb_main_upgrade($oldversion) {
|
|||
upgrade_main_savepoint(true, 2014031400.04);
|
||||
}
|
||||
|
||||
if ($oldversion < 2014032000.01) {
|
||||
|
||||
// Removing the themes from core.
|
||||
$themes = array('afterburner', 'anomaly', 'arialist', 'binarius', 'boxxie', 'brick', 'formal_white', 'formfactor',
|
||||
'fusion', 'leatherbound', 'magazine', 'nimble', 'nonzero', 'overlay', 'serenity', 'sky_high', 'splash',
|
||||
'standard', 'standardold');
|
||||
|
||||
foreach ($themes as $key => $theme) {
|
||||
if (check_dir_exists($CFG->dirroot . '/theme/' . $theme, false)) {
|
||||
// Ignore the themes that have been re-downloaded.
|
||||
unset($themes[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
list($insql, $inparams) = $DB->get_in_or_equal($themes, SQL_PARAMS_NAMED);
|
||||
|
||||
// Replace the theme usage.
|
||||
$DB->set_field_select('course', 'theme', 'clean', "theme $insql", $inparams);
|
||||
$DB->set_field_select('course_categories', 'theme', 'clean', "theme $insql", $inparams);
|
||||
$DB->set_field_select('user', 'theme', 'clean', "theme $insql", $inparams);
|
||||
$DB->set_field_select('mnet_host', 'theme', 'clean', "theme $insql", $inparams);
|
||||
|
||||
// Replace the theme configs.
|
||||
if (in_array(get_config('core', 'theme'), $themes)) {
|
||||
set_config('theme', 'clean');
|
||||
}
|
||||
if (in_array(get_config('core', 'thememobile'), $themes)) {
|
||||
set_config('thememobile', 'clean');
|
||||
}
|
||||
if (in_array(get_config('core', 'themelegacy'), $themes)) {
|
||||
set_config('themelegacy', 'clean');
|
||||
}
|
||||
if (in_array(get_config('core', 'themetablet'), $themes)) {
|
||||
set_config('themetablet', 'clean');
|
||||
}
|
||||
|
||||
// Hacky emulation of plugin uninstallation.
|
||||
foreach ($themes as $theme) {
|
||||
unset_all_config_for_plugin('theme_' . $theme);
|
||||
}
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2014032000.01);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1261,7 +1261,7 @@ function disable_output_buffering() {
|
|||
*/
|
||||
function redirect_if_major_upgrade_required() {
|
||||
global $CFG;
|
||||
$lastmajordbchanges = 2014022600.00;
|
||||
$lastmajordbchanges = 2014031900.00;
|
||||
if (empty($CFG->version) or (float)$CFG->version < $lastmajordbchanges or
|
||||
during_initial_install() or !empty($CFG->adminsetuppending)) {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue