diff --git a/admin/editors.php b/admin/editors.php
index f6e68ff7a8d..da846faf2f8 100644
--- a/admin/editors.php
+++ b/admin/editors.php
@@ -83,47 +83,6 @@ switch ($action) {
}
break;
- case 'uninstall':
- if ($editor === 'textarea') {
- redirect($returnurl);
- }
- if (get_string_manager()->string_exists('pluginname', 'editor_'.$editor)) {
- $strplugin = get_string('pluginname', 'editor_'.$editor);
- } else {
- $strplugin = $editor;
- }
-
- $PAGE->set_title($strplugin);
- echo $OUTPUT->header();
-
- if (!$confirm) {
- echo $OUTPUT->heading(get_string('editors', 'core_editor'));
-
- $deleteurl = new moodle_url('/admin/editors.php', array('action'=>'uninstall', 'editor'=>$editor, 'sesskey'=>sesskey(), 'confirm'=>1));
-
- echo $OUTPUT->confirm(get_string('editordeleteconfirm', 'core_editor', $strplugin),
- $deleteurl, $returnurl);
- echo $OUTPUT->footer();
- die();
-
- } else {
- // Remove from enabled list.
- $key = array_search($editor, $active_editors);
- unset($active_editors[$key]);
- set_config('texteditors', implode(',', $active_editors));
-
- // Delete everything!!
- uninstall_plugin('editor', $editor);
-
- $a = new stdClass();
- $a->name = $strplugin;
- $a->directory = "$CFG->dirroot/lib/editor/$editor";
- echo $OUTPUT->notification(get_string('plugindeletefiles', '', $a), 'notifysuccess');
- echo $OUTPUT->continue_button($returnurl);
- echo $OUTPUT->footer();
- die();
- }
-
default:
break;
}
diff --git a/lang/en/editor.php b/lang/en/editor.php
index aad66efcbdb..d2922d6f26d 100644
--- a/lang/en/editor.php
+++ b/lang/en/editor.php
@@ -52,7 +52,6 @@ $string['createlink'] = 'Insert Web Link';
$string['cut'] = 'Cut selection';
$string['cutpastemozilla'] = 'Unfortunately, you cannot currently use normal keyboard shortcuts (or even the Paste button) for pasting text into this online editor. This is because of a security feature that is built into some versions of Mozilla and Firefox browsers.
There are three known workarounds you can try:
(1) Instead of CTRL-v, use SHIFT-Insert
(2) Use the Edit->Paste menu in your browser
(3) Change the preferences in your browser by editing the user.js file.
Click the OK button below for more help, or Cancel to return to the editor';
$string['delete'] = 'Delete';
-$string['editordeleteconfirm'] = 'You are about to completely delete the editor plugin \'{$a}\'. This will completely delete everything in the database associated with this plugin. Are you SURE you want to continue?';
$string['editors'] = 'Text editors';
$string['editorsettings'] = 'Manage editors';
$string['enterurlfirst'] = 'You have to enter an URL first';
diff --git a/lib/adminlib.php b/lib/adminlib.php
index 25a364641b8..849b88a9e1d 100644
--- a/lib/adminlib.php
+++ b/lib/adminlib.php
@@ -5943,11 +5943,9 @@ class admin_setting_manageeditors extends admin_setting {
$settings = '';
}
- if ($editor === 'textarea') {
- $uninstall = '';
- } else {
- $uurl = new moodle_url('/admin/editors.php', array('action'=>'uninstall', 'editor'=>$editor, 'sesskey'=>sesskey()));
- $uninstall = html_writer::link($uurl, $struninstall);
+ $uninstall = '';
+ if ($deleteurl = plugin_manager::instance()->get_uninstall_url('editor_'.$editor)) {
+ $uninstall = html_writer::link($deleteurl, $struninstall);
}
// add a row to the table
diff --git a/lib/pluginlib.php b/lib/pluginlib.php
index 674cbe2b5ba..245d339082f 100644
--- a/lib/pluginlib.php
+++ b/lib/pluginlib.php
@@ -3878,6 +3878,17 @@ class plugininfo_editor extends plugininfo_base {
}
}
+ /**
+ * Basic textarea editor can not be uninstalled.
+ */
+ public function is_uninstall_allowed() {
+ if ($this->name === 'textarea') {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
/**
* Returns the information about plugin availability
*