MDL-22061 use string_exists during plugin uninstall

This commit is contained in:
Petr Skoda
2010-05-20 07:29:54 +00:00
parent b935d10949
commit 70d35fe6f9
+11 -2
View File
@@ -140,9 +140,18 @@ function uninstall_plugin($type, $name) {
if ($type === 'mod') {
$pluginname = $name; // eg. 'forum'
$strpluginname = get_string('modulename', $pluginname);
if (get_string_manager()->string_exists('modulename', $component)) {
$strpluginname = get_string('modulename', $component);
} else {
$strpluginname = $component;
}
} else {
$pluginname = $component;
$strpluginname = get_string('pluginname', $pluginname); // replaces string 'modulename'
if (get_string_manager()->string_exists('pluginname', $component)) {
$strpluginname = get_string('pluginname', $component);
} else {
$strpluginname = $component;
}
}
echo $OUTPUT->heading($pluginname);
@@ -214,7 +223,7 @@ function uninstall_plugin($type, $name) {
}
}
// perform clean-up taks common for all the plugin/subplugin types
// perform clean-up task common for all the plugin/subplugin types
// delete calendar events
$DB->delete_records('event', array('modulename' => $pluginname));