Skip to content

Commit

Permalink
MDL-43784 theme: Removing all the old themes
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Mar 21, 2014
1 parent 9b8555f commit 7a2dabc
Show file tree
Hide file tree
Showing 742 changed files with 57 additions and 31,842 deletions.
10 changes: 4 additions & 6 deletions lib/classes/plugin_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,9 @@ public static function is_deleted_standard_plugin($type, $name) {
'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])) {
Expand Down Expand Up @@ -1111,11 +1113,7 @@ public static function standard_plugins_list($type) {
),

'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(
Expand Down
45 changes: 45 additions & 0 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion lib/setuplib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
168 changes: 0 additions & 168 deletions theme/afterburner/config.php

This file was deleted.

78 changes: 0 additions & 78 deletions theme/afterburner/db/upgrade.php

This file was deleted.

60 changes: 0 additions & 60 deletions theme/afterburner/lang/en/theme_afterburner.php

This file was deleted.

Loading

0 comments on commit 7a2dabc

Please sign in to comment.