Disable the Dialogue module if the directory doesn't exist anymore

This commit is contained in:
moodler 2005-07-17 03:26:59 +00:00
parent 117d398984
commit 27d8712a07
3 changed files with 45 additions and 1 deletions

View File

@ -1451,6 +1451,28 @@ function main_upgrade($oldversion=0) {
}
}
if ($oldversion < 2005071700) { // Close down the Dialogue module, we are removing it from CVS.
if (!file_exists($CFG->dirroot.'/mod/dialogue/lib.php')) {
if (count_records('dialogue')) { // We have some data, so should keep it
set_field('modules', 'visible', 0, 'name', 'dialogue');
notify('The Dialogue module has been discontinued. If you really want to
continue using it, you should download it individually from
http://download.moodle.org/modules and install it, then
reactivate it from Admin >> Configuration >> Modules.
None of your existing data has been deleted, so all existing
Dialogue activities should re-appear.');
} else { // No data, so do a complete delete
execute_sql('DROP TABLE '.$CFG->prefix.'dialogue', false);
delete_records('modules', 'name', 'dialogue');
notify("The Dialogue module has been discontinued and removed from your site.
You weren't using it anyway. ;-)");
}
}
}
return $result;
}

View File

@ -1171,6 +1171,28 @@ function main_upgrade($oldversion=0) {
}
}
if ($oldversion < 2005071700) { // Close down the Dialogue module, we are removing it from CVS.
if (!file_exists($CFG->dirroot.'/mod/dialogue/lib.php')) {
if (count_records('dialogue')) { // We have some data, so should keep it
set_field('modules', 'visible', 0, 'name', 'dialogue');
notify('The Dialogue module has been discontinued. If you really want to
continue using it, you should download it individually from
http://download.moodle.org/modules and install it, then
reactivate it from Admin >> Configuration >> Modules.
None of your existing data has been deleted, so all existing
Dialogue activities should re-appear.');
} else { // No data, so do a complete delete
execute_sql('DROP TABLE '.$CFG->prefix.'dialogue', false);
delete_records('modules', 'name', 'dialogue');
notify("The Dialogue module has been discontinued and removed from your site.
You weren't using it anyway. ;-)");
}
}
}
return $result;
}

View File

@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
$version = 2005060201; // YYYYMMDD = date
$version = 2005071700; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.6 development'; // Human-friendly version name