Commit e87214bd authored by Petr Škoda's avatar Petr Škoda
Browse files

MDL-42078 multiple uninstall improvements and cleanup

Includes:
* update checker refactored to \core\update\ namespace
* plugininfo classes refactored to \core\plugininfo\ namespace
* plugin_manager renamed to core_plugin_manager
* redirect back to original page after plugin uninstall
* fixed assign subplugin uninstall
* move assign subplugins under the assignment in admin tree
* fixed plugininfo for all question related plugin types
* auth uninstall support
* added missing block dependencies
* added theme uninstall
* subplugin types are following the plugin on plugin overview page
* several performance improvements in plugin manager
* new warnigns when plugininfo are outdated or missing
* multiple fixes and other improvements
parent 56cc9b38
......@@ -10,7 +10,6 @@
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->libdir.'/pluginlib.php');
require_login();
require_capability('moodle/site:config', context_system::instance());
......@@ -53,7 +52,7 @@ switch ($action) {
set_config('registerauth', '');
}
\core\session\manager::gc(); // Remove stale sessions.
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
break;
case 'enable':
......@@ -64,7 +63,7 @@ switch ($action) {
set_config('auth', implode(',', $authsenabled));
}
\core\session\manager::gc(); // Remove stale sessions.
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
break;
case 'down':
......
......@@ -5,7 +5,6 @@
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->libdir.'/pluginlib.php');
admin_externalpage_setup('manageblocks');
......@@ -37,7 +36,7 @@
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '0', array('id'=>$block->id)); // Hide block
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
......@@ -46,7 +45,7 @@
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '1', array('id'=>$block->id)); // Show block
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
......@@ -97,8 +96,8 @@
$table = new flexible_table('admin-blocks-compatible');
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'undeletable', 'uninstall', 'settings'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strprotecthdr, $struninstall, $strsettings));
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'undeletable', 'settings', 'uninstall'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strprotecthdr, $strsettings, $struninstall));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('class', 'admintable blockstable generaltable');
$table->set_attribute('id', 'compatibleblockstable');
......@@ -141,7 +140,7 @@
}
}
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('block_'.$blockname)) {
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('block_'.$blockname, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
} else {
$uninstall = '';
......@@ -184,7 +183,7 @@
} else {
$visible = '<a href="blocks.php?show='.$blockid.'&amp;sesskey='.sesskey().'" title="'.$strshow.'">'.
'<img src="'.$OUTPUT->pix_url('t/show') . '" class="iconsmall" alt="'.$strshow.'" /></a>';
$class = ' class="dimmed_text"'; // Leading space required!
$class = 'dimmed_text';
}
if ($dbversion == $plugin->version) {
......@@ -205,15 +204,15 @@
}
$row = array(
'<span'.$class.'>'.$strblockname.'</span>',
$strblockname,
$blocklist,
'<span'.$class.'>'.$version.'</span>',
$version,
$visible,
$undeletable,
$settings,
$uninstall,
$settings
);
$table->add_data($row);
$table->add_data($row, $class);
}
$table->print_html();
......@@ -232,7 +231,7 @@
$table->setup();
foreach ($incompatible as $block) {
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('block_'.$block->name)) {
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('block_'.$block->name, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
} else {
$uninstall = '';
......
......@@ -753,9 +753,8 @@ if (!$envstatus) {
}
// Test plugin dependencies.
require_once($CFG->libdir . '/pluginlib.php');
$failed = array();
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
cli_error(get_string('pluginschecktodo', 'admin'));
}
......
......@@ -167,9 +167,8 @@ if (!$envstatus) {
}
// Test plugin dependencies.
require_once($CFG->libdir . '/pluginlib.php');
$failed = array();
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
cli_error(get_string('pluginschecktodo', 'admin'));
}
......
......@@ -43,7 +43,6 @@ require_once($CFG->libdir.'/adminlib.php'); // various admin-only function
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
require_once($CFG->libdir.'/clilib.php'); // cli only functions
require_once($CFG->libdir.'/environmentlib.php');
require_once($CFG->libdir.'/pluginlib.php');
// now get cli options
list($options, $unrecognized) = cli_get_params(
......@@ -117,7 +116,7 @@ if (!$envstatus) {
// Test plugin dependencies.
$failed = array();
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
cli_error(get_string('pluginschecktodo', 'admin'));
}
......
......@@ -24,7 +24,6 @@
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/pluginlib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$formatname = required_param('format', PARAM_PLUGIN);
......@@ -39,7 +38,7 @@ require_sesskey();
$return = new moodle_url('/admin/settings.php', array('section' => 'manageformats'));
$formatplugins = plugin_manager::instance()->get_plugins_of_type('format');
$formatplugins = core_plugin_manager::instance()->get_plugins_of_type('format');
$sortorder = array_flip(array_keys($formatplugins));
if (!isset($formatplugins[$formatname])) {
......@@ -53,13 +52,13 @@ switch ($action) {
print_error('cannotdisableformat', 'error', $return);
}
set_config('disabled', 1, 'format_'. $formatname);
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
}
break;
case 'enable':
if (!$formatplugins[$formatname]->is_enabled()) {
unset_config('disabled', 'format_'. $formatname);
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
}
break;
case 'up':
......
......@@ -7,7 +7,6 @@
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->libdir.'/pluginlib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$editor = required_param('editor', PARAM_PLUGIN);
......@@ -94,7 +93,7 @@ if (empty($active_editors)) {
}
set_config('texteditors', implode(',', $active_editors));
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
if ($return) {
redirect ($returnurl);
......
......@@ -27,7 +27,6 @@ define('NO_OUTPUT_BUFFERING', true);
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/pluginlib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$enrol = required_param('enrol', PARAM_PLUGIN);
......@@ -51,7 +50,7 @@ switch ($action) {
case 'disable':
unset($enabled[$enrol]);
set_config('enrol_plugins_enabled', implode(',', array_keys($enabled)));
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
$syscontext->mark_dirty(); // resets all enrol caches
break;
......@@ -62,7 +61,7 @@ switch ($action) {
$enabled = array_keys($enabled);
$enabled[] = $enrol;
set_config('enrol_plugins_enabled', implode(',', $enabled));
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
$syscontext->mark_dirty(); // resets all enrol caches
break;
......@@ -122,7 +121,7 @@ switch ($action) {
echo $OUTPUT->notification(get_string('success'), 'notifysuccess');
if (!$return = plugin_manager::instance()->get_uninstall_url('enrol_'.$enrol)) {
if (!$return = core_plugin_manager::instance()->get_uninstall_url('enrol_'.$enrol, 'manage')) {
$return = new moodle_url('/admin/plugins.php');
}
echo $OUTPUT->continue_button($return);
......
......@@ -33,7 +33,6 @@
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/pluginlib.php');
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$filterpath = optional_param('filterpath', '', PARAM_SAFEDIR);
......@@ -104,7 +103,7 @@
// Reset caches and return
if ($action) {
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
reset_text_filters_cache();
redirect($returnurl);
}
......@@ -137,7 +136,7 @@
$table = new html_table();
$table->head = array(get_string('filter'), get_string('isactive', 'filters'),
get_string('order'), get_string('applyto', 'filters'), get_string('settings'), get_string('delete'));
get_string('order'), get_string('applyto', 'filters'), get_string('settings'), get_string('uninstallplugin', 'core_admin'));
$table->colclasses = array ('leftalign', 'leftalign', 'centeralign', 'leftalign', 'leftalign', 'leftalign');
$table->attributes['class'] = 'admintable generaltable';
$table->id = 'filterssetting';
......@@ -180,7 +179,7 @@
function filters_action_url($filterpath, $action) {
if ($action === 'delete') {
return new moodle_url('/admin/plugins.php', array('sesskey'=>sesskey(), 'uninstall'=>'filter_'.$filterpath));
return core_plugin_manager::instance()->get_uninstall_url('filter_'.$filterpath, 'manage');
}
return new moodle_url('/admin/filters.php', array('sesskey'=>sesskey(), 'filterpath'=>$filterpath, 'action'=>$action));
}
......@@ -233,7 +232,7 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
}
// Delete
$row[] = '<a href="' . filters_action_url($filter, 'delete') . '">' . get_string('delete') . '</a>';
$row[] = '<a href="' . filters_action_url($filter, 'delete') . '">' . get_string('uninstallplugin', 'core_admin') . '</a>';
return $row;
}
......@@ -78,7 +78,6 @@ core_component::get_core_subsystems();
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
require_once($CFG->libdir.'/pluginlib.php'); // available updates notifications
$id = optional_param('id', '', PARAM_TEXT);
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
......@@ -196,7 +195,7 @@ if (!core_tables_exist()) {
// check plugin dependencies
$failed = array();
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
$PAGE->navbar->add(get_string('pluginscheck', 'admin'));
$PAGE->set_title($strinstallation);
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
......@@ -323,7 +322,7 @@ if (!$cache and $version > $CFG->version) { // upgrade
// check plugin dependencies first
$failed = array();
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
die();
}
......@@ -332,12 +331,12 @@ if (!$cache and $version > $CFG->version) { // upgrade
if ($fetchupdates) {
// no sesskey support guaranteed here
if (empty($CFG->disableupdatenotifications)) {
available_update_checker::instance()->fetch();
\core\update\checker::instance()->fetch();
}
redirect($reloadurl);
}
$deployer = available_update_deployer::instance();
$deployer = \core\update\deployer::instance();
if ($deployer->enabled()) {
$deployer->initialize($reloadurl, $reloadurl);
......@@ -348,7 +347,7 @@ if (!$cache and $version > $CFG->version) { // upgrade
}
}
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
echo $output->upgrade_plugin_check_page(core_plugin_manager::instance(), \core\update\checker::instance(),
$version, $showallplugins, $reloadurl,
new moodle_url('/admin/index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1)));
die();
......@@ -386,13 +385,13 @@ if (!$cache and moodle_needs_upgrading()) {
if ($fetchupdates) {
// no sesskey support guaranteed here
available_update_checker::instance()->fetch();
\core\update\checker::instance()->fetch();
redirect($PAGE->url);
}
$output = $PAGE->get_renderer('core', 'admin');
$deployer = available_update_deployer::instance();
$deployer = \core\update\deployer::instance();
if ($deployer->enabled()) {
$deployer->initialize($PAGE->url, $PAGE->url);
......@@ -405,14 +404,14 @@ if (!$cache and moodle_needs_upgrading()) {
// check plugin dependencies first
$failed = array();
if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
die();
}
unset($failed);
// dependencies check passed, let's rock!
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
echo $output->upgrade_plugin_check_page(core_plugin_manager::instance(), \core\update\checker::instance(),
$version, $showallplugins,
new moodle_url($PAGE->url),
new moodle_url('/admin/index.php', array('confirmplugincheck'=>1)));
......@@ -514,6 +513,15 @@ if (any_new_admin_settings($adminroot)){
redirect('upgradesettings.php');
}
// Return to original page that started the plugin uninstallation if necessary.
if (isset($SESSION->pluginuninstallreturn)) {
$return = $SESSION->pluginuninstallreturn;
unset($SESSION->pluginuninstallreturn);
if ($return) {
redirect($return);
}
}
// Everything should now be set up, and the user is an admin
// Print default admin page with notifications.
......@@ -525,13 +533,13 @@ $dbproblems = $DB->diagnose();
$maintenancemode = !empty($CFG->maintenance_enabled);
// Available updates for Moodle core
$updateschecker = available_update_checker::instance();
$updateschecker = \core\update\checker::instance();
$availableupdates = array();
$availableupdates['core'] = $updateschecker->get_update_info('core',
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
// Available updates for contributed plugins
$pluginman = plugin_manager::instance();
$pluginman = core_plugin_manager::instance();
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
if (!empty($plugininfo->availableupdates)) {
......
......@@ -30,7 +30,6 @@
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->libdir.'/pluginlib.php');
admin_externalpage_setup('managelocalplugins');
......@@ -60,7 +59,7 @@ core_collator::asort($plugins);
foreach ($plugins as $plugin => $name) {
$uninstall = '';
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('local_'.$plugin)) {
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('local_'.$plugin, 'manage')) {
$uninstall = html_writer::link($uninstallurl, get_string('uninstallplugin', 'core_admin'));
}
......
......@@ -24,7 +24,6 @@
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->dirroot . '/message/lib.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/pluginlib.php');
// This is an admin page
admin_externalpage_setup('managemessageoutputs');
......@@ -43,7 +42,7 @@ if (!empty($disable) && confirm_sesskey()) {
print_error('outputdoesnotexist', 'message');
}
$DB->set_field('message_processors', 'enabled', '0', array('id'=>$processor->id)); // Disable output
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
}
if (!empty($enable) && confirm_sesskey()) {
......@@ -51,7 +50,7 @@ if (!empty($enable) && confirm_sesskey()) {
print_error('outputdoesnotexist', 'message');
}
$DB->set_field('message_processors', 'enabled', '1', array('id'=>$processor->id)); // Enable output
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
}
if ($disable || $enable) {
......
......@@ -5,7 +5,6 @@
require_once('../course/lib.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->libdir.'/pluginlib.php');
// defines
define('MODULE_TABLE','module_administration_table');
......@@ -48,7 +47,7 @@
FROM {course_modules}
WHERE visibleold=1 AND module=?)",
array($module->id));
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
......@@ -65,7 +64,7 @@
FROM {course_modules}
WHERE visible=1 AND module=?)",
array($module->id));
plugin_manager::reset_caches();
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
......@@ -82,10 +81,10 @@
// construct the flexible table ready to display
$table = new flexible_table(MODULE_TABLE);
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'uninstall', 'settings'));
$table->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $struninstall, $strsettings));
$table->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strsettings, $struninstall));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/modules.php');
$table->set_attribute('id', 'modules');
$table->set_attribute('class', 'generaltable');
$table->set_attribute('class', 'admintable generaltable');
$table->setup();
foreach ($modules as $module) {
......@@ -101,7 +100,7 @@
}
$uninstall = '';
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('mod_'.$module->name)) {
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('mod_'.$module->name, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
......@@ -136,7 +135,7 @@
} else {
$visible = "<a href=\"modules.php?show=$module->name&amp;sesskey=".sesskey()."\" title=\"$strshow\">".
"<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strshow\" /></a>";
$class = ' class="dimmed_text"';
$class = 'dimmed_text';
}
if ($module->name == "forum") {
$uninstall = "";
......@@ -146,13 +145,13 @@
$version = get_config('mod_'.$module->name, 'version');
$table->add_data(array(
'<span'.$class.'>'.$strmodulename.'</span>',
$strmodulename,
$countlink,
'<span'.$class.'>'.$version.'</span>',
$version,
$visible,
$settings,
$uninstall,
$settings
));
), $class);
}
$table->print_html();
......
......@@ -29,7 +29,6 @@
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->libdir.'/pluginlib.php');
admin_externalpage_setup('manageplagiarismplugins');
......@@ -74,7 +73,7 @@ foreach ($plagiarismplugins as $plugin => $dir) {
}
// uninstall link.
$uninstall = '';
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('plagiarism_'.$plugin)) {
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('plagiarism_'.$plugin, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $txt->uninstall);
}
$table->data[] = array($displayname, $version, $uninstall, $settings);
......
......@@ -35,15 +35,15 @@
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/pluginlib.php');
require_once($CFG->libdir . '/filelib.php');
$fetchremote = optional_param('fetchremote', false, PARAM_BOOL);
$updatesonly = optional_param('updatesonly', false, PARAM_BOOL);
$contribonly = optional_param('contribonly', false, PARAM_BOOL);
$uninstall = optional_param('uninstall', '', PARAM_COMPONENT);
$delete = optional_param('delete', '', PARAM_COMPONENT);
$confirmed = optional_param('confirm', false, PARAM_BOOL);
$uninstall = optional_param('uninstall', '', PARAM_COMPONENT);
$delete = optional_param('delete', '', PARAM_COMPONENT);
$confirmed = optional_param('confirm', false, PARAM_BOOL);
$return = optional_param('return', 'overview', PARAM_ALPHA);
// NOTE: do not use admin_externalpage_setup() here because it loads
// full admin tree which is not possible during uninstallation.
......@@ -52,7 +52,7 @@ require_login();
$syscontext = context_system::instance();
require_capability('moodle/site:config', $syscontext);
$pluginman = plugin_manager::instance();
$pluginman = core_plugin_manager::instance();
if ($uninstall) {
require_sesskey();
......@@ -74,7 +74,7 @@ if ($uninstall) {
// Make sure we know the plugin.
if (is_null($pluginfo)) {
throw new moodle_exception('err_uninstalling_unknown_plugin', 'core_plugin', '', array('plugin' => $uninstall),
'plugin_manager::get_plugin_info() returned null for the plugin to be uninstalled');
'core_plugin_manager::get_plugin_info() returned null for the plugin to be uninstalled');
}
$pluginname = $pluginman->plugin_name($pluginfo->component);
......@@ -84,15 +84,17 @@ if ($uninstall) {
if (!$pluginman->can_uninstall_plugin($pluginfo->component)) {
throw new moodle_exception('err_cannot_uninstall_plugin', 'core_plugin', '',
array('plugin' => $pluginfo->component),
'plugin_manager::can_uninstall_plugin() returned false');
'core_plugin_manager::can_uninstall_plugin() returned false');
}
if (!$confirmed) {
$continueurl = new moodle_url($PAGE->url, array('uninstall' => $pluginfo->component, 'sesskey' => sesskey(), 'confirm' => 1));
echo $output->plugin_uninstall_confirm_page($pluginman, $pluginfo, $continueurl);
$continueurl = new moodle_url($PAGE->url, array('uninstall' => $pluginfo->component, 'sesskey' => sesskey(), 'confirm' => 1, 'return'=>$return));
$cancelurl = $pluginfo->get_return_url_after_uninstall($return);
echo $output->plugin_uninstall_confirm_page($pluginman, $pluginfo, $continueurl, $cancelurl);
exit();
} else {
$SESSION->pluginuninstallreturn = $pluginfo->get_return_url_after_uninstall($return);
$progress = new progress_trace_buffer(new text_progress_trace(), false);
$pluginman->uninstall_plugin($pluginfo->component, $progress);
$progress->finished();
......@@ -133,7 +135,7 @@ if ($delete and $confirmed) {
// Make sure we know the plugin.
if (is_null($pluginfo)) {
throw new moodle_exception('err_removing_unknown_plugin', 'core_plugin', '', array('plugin' => $delete),
'plugin_manager::get_plugin_info() returned null for the plugin to be deleted');
'core_plugin_manager::get_plugin_info() returned null for the plugin to be deleted');
}
$pluginname = $pluginman->plugin_name($pluginfo->component);
......@@ -144,7 +146,7 @@ if ($delete and $confirmed) {
if (!is_null($pluginfo->versiondb)) {
throw new moodle_exception('err_removing_installed_plugin', 'core_plugin', '',
array('plugin' => $pluginfo->component, 'versiondb' => $pluginfo->versiondb),
'plugin_manager::get_plugin_info() returned not-null versiondb for the plugin to be deleted');
'core_plugin_manager::get_plugin_info() returned not-null versiondb for the plugin to be deleted');
}
// Make sure the folder is removable.
......@@ -176,7 +178,7 @@ admin_externalpage_setup('pluginsoverview');
/** @var core_admin_renderer $output */
$output = $PAGE->get_renderer('core', 'admin');
$checker = available_update_checker::instance();
$checker = \core\update\checker::instance();
// Filtering options.
$options = array(
......@@ -190,7 +192,7 @@ if ($fetchremote) {
redirect(new moodle_url($PAGE->url, $options));
}
$deployer = available_update_deployer::instance();
$deployer = \core\update\deployer::instance();
if ($deployer->enabled()) {
$myurl = new moodle_url($PAGE->url, array('updatesonly' => $updatesonly, 'contribonly' => $contribonly));
$deployer->initialize($myurl, new moodle_url('/admin'));
......
......@@ -4,7 +4,6 @@ require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->libdir . '/portfoliolib.php');
require_once($CFG->libdir . '/portfolio/forms.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/pluginlib.php');