MDL-39088 use word "Uninstall" consistently in plugin administration UI

This commit is contained in:
Petr Škoda 2013-06-26 13:56:24 +02:00
parent d2fba597ef
commit dd24dd37ee
8 changed files with 70 additions and 64 deletions

View File

@ -1,6 +1,6 @@
<?php
// Allows the admin to configure blocks (hide/show, delete and configure)
// Allows the admin to configure blocks (hide/show, uninstall and configure)
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
@ -17,7 +17,7 @@
/// Print headings
$strmanageblocks = get_string('manageblocks');
$strdelete = get_string('delete');
$struninstall = get_string('uninstallplugin', 'core_admin');
$strversion = get_string('version');
$strhide = get_string('hide');
$strshow = get_string('show');
@ -97,8 +97,8 @@
$table = new flexible_table('admin-blocks-compatible');
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'undeletable', 'delete', 'settings'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strprotecthdr, $strdelete, $strsettings));
$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_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('class', 'admintable blockstable generaltable');
$table->set_attribute('id', 'compatibleblockstable');
@ -140,10 +140,10 @@
}
}
if ($deleteurl = plugin_manager::instance()->get_uninstall_url('block_'.$blockname)) {
$delete = html_writer::link($deleteurl, $strdelete);
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('block_'.$blockname)) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
} else {
$delete = '';
$uninstall = '';
}
$settings = ''; // By default, no configuration
@ -209,7 +209,7 @@
'<span'.$class.'>'.$version.'</span>',
$visible,
$undeletable,
$delete,
$uninstall,
$settings
);
$table->add_data($row);
@ -222,8 +222,8 @@
$table = new flexible_table('admin-blocks-incompatible');
$table->define_columns(array('block', 'delete'));
$table->define_headers(array($strname, $strdelete));
$table->define_columns(array('block', 'uninstall'));
$table->define_headers(array($strname, $struninstall));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('class', 'incompatibleblockstable generaltable');
@ -231,14 +231,14 @@
$table->setup();
foreach ($incompatible as $block) {
if ($deleteurl = plugin_manager::instance()->get_uninstall_url('block_'.$block->name)) {
$delete = html_writer::link($deleteurl, $strdelete);
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('block_'.$block->name)) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
} else {
$delete = '';
$uninstall = '';
}
$table->add_data(array(
$block->name,
$delete,
$uninstall,
));
}
$table->print_html();

View File

@ -39,8 +39,8 @@ echo $OUTPUT->heading(get_string('localplugins'));
/// Print the table of all installed local plugins
$table = new flexible_table('localplugins_administration_table');
$table->define_columns(array('name', 'version', 'delete'));
$table->define_headers(array(get_string('plugin'), get_string('version'), get_string('delete')));
$table->define_columns(array('name', 'version', 'uninstall'));
$table->define_headers(array(get_string('plugin'), get_string('version'), get_string('uninstallplugin', 'core_admin')));
$table->define_baseurl($PAGE->url);
$table->set_attribute('id', 'localplugins');
$table->set_attribute('class', 'admintable generaltable');
@ -58,9 +58,9 @@ foreach (get_plugin_list('local') as $plugin => $plugindir) {
collatorlib::asort($plugins);
foreach ($plugins as $plugin => $name) {
$delete = '';
if ($deleteurl = plugin_manager::instance()->get_uninstall_url('local_'.$plugin)) {
$delete = html_writer::link($deleteurl, get_string('uninstallplugin', 'core_admin'));
$uninstall = '';
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('local_'.$plugin)) {
$uninstall = html_writer::link($uninstall, get_string('uninstallplugin', 'core_admin'));
}
$version = get_config('local_' . $plugin);
@ -70,7 +70,7 @@ foreach ($plugins as $plugin => $name) {
$version = '?';
}
$table->add_data(array($name, $version, $delete));
$table->add_data(array($name, $version, $uninstall));
}
$table->print_html();

View File

@ -18,7 +18,7 @@
/// Print headings
$stractivities = get_string("activities");
$strdelete = get_string("delete");
$struninstall = get_string('uninstallplugin', 'core_admin');
$strversion = get_string("version");
$strhide = get_string("hide");
$strshow = get_string("show");
@ -44,7 +44,7 @@
WHERE module=?";
$DB->execute($sql, array($module->id));
// clear the course modinfo cache for courses
// where we just deleted something
// where we just uninstalld something
$sql = "UPDATE {course}
SET modinfo=''
WHERE id IN (SELECT DISTINCT course
@ -83,8 +83,8 @@
/// Print the table of all modules
// construct the flexible table ready to display
$table = new flexible_table(MODULE_TABLE);
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'delete', 'settings'));
$table->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strdelete, $strsettings));
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'uninstall', 'settings'));
$table->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $struninstall, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/modules.php');
$table->set_attribute('id', 'modules');
$table->set_attribute('class', 'generaltable');
@ -102,9 +102,9 @@
$missing = false;
}
$delete = '';
if ($deleteurl = plugin_manager::instance()->get_uninstall_url('mod_'.$module->name)) {
$delete = html_writer::link($deleteurl, $strdelete);
$uninstall = '';
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('mod_'.$module->name)) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
if (file_exists("$CFG->dirroot/mod/$module->name/settings.php") ||
@ -141,7 +141,7 @@
$class = ' class="dimmed_text"';
}
if ($module->name == "forum") {
$delete = "";
$uninstall = "";
$visible = "";
$class = "";
}
@ -152,7 +152,7 @@
$countlink,
'<span'.$class.'>'.$module->version.'</span>',
$visible,
$delete,
$uninstall,
$settings
));
}

View File

@ -18,7 +18,7 @@
* Provides an overview of installed plagiarism plugins
*
* Displays the list of found plagiarism plugins, their version (if found) and
* a link to delete the plagiarism plugin.
* a link to uninstall the plagiarism plugin.
*
* @see http://docs.moodle.org/dev/Plagiarism_API
* @package admin
@ -36,7 +36,8 @@ echo $OUTPUT->header();
// Print the table of all installed plagiarism plugins.
$txt = get_strings(array('settings', 'name', 'version', 'delete'));
$txt = get_strings(array('settings', 'name', 'version'));
$txt->uninstall = get_string('uninstallplugin', 'core_admin');
$plagiarismplugins = get_plugin_list('plagiarism');
if (empty($plagiarismplugins)) {
@ -49,7 +50,7 @@ echo $OUTPUT->heading(get_string('availableplugins', 'plagiarism'), 3, 'main');
echo $OUTPUT->box_start('generalbox authsui');
$table = new html_table();
$table->head = array($txt->name, $txt->version, $txt->delete, $txt->settings);
$table->head = array($txt->name, $txt->version, $txt->uninstall, $txt->settings);
$table->colclasses = array('mdl-left', 'mdl-align', 'mdl-align', 'mdl-align');
$table->data = array();
$table->attributes['class'] = 'manageplagiarismtable generaltable';
@ -69,12 +70,12 @@ foreach ($plagiarismplugins as $plugin => $dir) {
} else {
$version = '?';
}
// Delete link.
$delete = '';
if ($deleteurl = plugin_manager::instance()->get_uninstall_url('plagiarism_'.$plugin)) {
$delete = html_writer::link($deleteurl, get_string('delete'));
// uninstall link.
$uninstall = '';
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('plagiarism_'.$plugin)) {
$uninstall = html_writer::link($uninstallurl, $txt->uninstall);
}
$table->data[] = array($displayname, $version, $delete, $settings);
$table->data[] = array($displayname, $version, $uninstall, $settings);
}
}
echo html_writer::table($table);

View File

@ -18,7 +18,7 @@
* Provides an overview of installed reports
*
* Displays the list of found reports, their version (if found) and
* a link to delete the report.
* a link to uninstall the report.
*
* The code is based on admin/localplugins.php by David Mudrak.
*
@ -38,9 +38,11 @@ echo $OUTPUT->heading(get_string('reports'));
/// Print the table of all installed report plugins
$struninstall = get_string('uninstallplugin', 'core_admin');
$table = new flexible_table('reportplugins_administration_table');
$table->define_columns(array('name', 'version', 'delete'));
$table->define_headers(array(get_string('plugin'), get_string('version'), get_string('delete')));
$table->define_columns(array('name', 'version', 'uninstall'));
$table->define_headers(array(get_string('plugin'), get_string('version'), $struninstall));
$table->define_baseurl($PAGE->url);
$table->set_attribute('id', 'reportplugins');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
@ -70,9 +72,9 @@ foreach ($installed as $config) {
}
foreach ($plugins as $plugin => $name) {
$delete = '';
if ($deleteurl = plugin_manager::instance()->get_uninstall_url('report_'.$plugin)) {
$delete = html_writer::link($deleteurl, get_string('delete'));
$uninstall = '';
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('report_'.$plugin)) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
if (!isset($versions[$plugin])) {
@ -94,7 +96,7 @@ foreach ($plugins as $plugin => $name) {
}
}
$table->add_data(array($name, $version, $delete));
$table->add_data(array($name, $version, $uninstall));
}
$table->print_html();

View File

@ -18,7 +18,7 @@
* Provides an overview of installed admin tools
*
* Displays the list of found admin tools, their version (if found) and
* a link to delete the admin tool.
* a link to uninstall the admin tool.
*
* The code is based on admin/localplugins.php by David Mudrak.
*
@ -38,9 +38,11 @@ echo $OUTPUT->heading(get_string('tools', 'admin'));
/// Print the table of all installed tool plugins
$struninstall = get_string('uninstallplugin', 'core_admin');
$table = new flexible_table('toolplugins_administration_table');
$table->define_columns(array('name', 'version', 'delete'));
$table->define_headers(array(get_string('plugin'), get_string('version'), get_string('delete')));
$table->define_columns(array('name', 'version', 'uninstall'));
$table->define_headers(array(get_string('plugin'), get_string('version'), $struninstall));
$table->define_baseurl($PAGE->url);
$table->set_attribute('id', 'toolplugins');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
@ -70,9 +72,9 @@ foreach ($installed as $config) {
}
foreach ($plugins as $plugin => $name) {
$delete = '';
if ($deleteurl = plugin_manager::instance()->get_uninstall_url('tool_'.$plugin)) {
$delete = html_writer::link($deleteurl, get_string('delete'));
$uninstall = '';
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('tool_'.$plugin)) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
if (!isset($versions[$plugin])) {
@ -94,7 +96,7 @@ foreach ($plugins as $plugin => $name) {
}
}
$table->add_data(array($name, $version, $delete));
$table->add_data(array($name, $version, $uninstall));
}
$table->print_html();

View File

@ -5129,7 +5129,7 @@ class admin_setting_manageenrols extends admin_setting {
$strsettings = get_string('settings');
$strenable = get_string('enable');
$strdisable = get_string('disable');
$struninstall = get_string('uninstallplugin', 'admin');
$struninstall = get_string('uninstallplugin', 'core_admin');
$strusage = get_string('enrolusage', 'enrol');
$strversion = get_string('version');
@ -5240,8 +5240,8 @@ class admin_setting_manageenrols extends admin_setting {
// Add uninstall info.
$uninstall = '';
if ($deleteurl = plugin_manager::instance()->get_uninstall_url('enrol_'.$enrol)) {
$uninstall = html_writer::link($deleteurl, $struninstall);
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('enrol_'.$enrol)) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
// Add a row to the table.
@ -5861,7 +5861,7 @@ class admin_setting_manageeditors extends admin_setting {
// display strings
$txt = get_strings(array('administration', 'settings', 'edit', 'name', 'enable', 'disable',
'up', 'down', 'none'));
$struninstall = get_string('uninstallplugin', 'admin');
$struninstall = get_string('uninstallplugin', 'core_admin');
$txt->updown = "$txt->up/$txt->down";
@ -5942,8 +5942,8 @@ class admin_setting_manageeditors extends admin_setting {
}
$uninstall = '';
if ($deleteurl = plugin_manager::instance()->get_uninstall_url('editor_'.$editor)) {
$uninstall = html_writer::link($deleteurl, $struninstall);
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('editor_'.$editor)) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
// add a row to the table
@ -6130,11 +6130,12 @@ class admin_setting_manageformats extends admin_setting {
$formats = plugin_manager::instance()->get_plugins_of_type('format');
// display strings
$txt = get_strings(array('settings', 'name', 'enable', 'disable', 'up', 'down', 'default', 'delete'));
$txt = get_strings(array('settings', 'name', 'enable', 'disable', 'up', 'down', 'default'));
$txt->uninstall = get_string('uninstallplugin', 'core_admin');
$txt->updown = "$txt->up/$txt->down";
$table = new html_table();
$table->head = array($txt->name, $txt->enable, $txt->updown, $txt->delete, $txt->settings);
$table->head = array($txt->name, $txt->enable, $txt->updown, $txt->uninstall, $txt->settings);
$table->align = array('left', 'center', 'center', 'center', 'center');
$table->width = '90%';
$table->attributes['class'] = 'manageformattable generaltable';
@ -6179,8 +6180,8 @@ class admin_setting_manageformats extends admin_setting {
$settings = html_writer::link($format->get_settings_url(), $txt->settings);
}
$uninstall = '';
if ($deleteurl = plugin_manager::instance()->get_uninstall_url('format_'.$format->name)) {
$uninstall = html_writer::link($deleteurl, $txt->delete);
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('format_'.$format->name)) {
$uninstall = html_writer::link($uninstallurl, $txt->uninstall);
}
$table->data[] =array($strformatname, $hideshow, $updown, $uninstall, $settings);
}

View File

@ -170,7 +170,7 @@ class tiynce_subplugins_settings extends admin_setting {
$strenable = get_string('enable');
$strname = get_string('name');
$strsettings = get_string('settings');
$struninstall = get_string('uninstallplugin', 'admin');
$struninstall = get_string('uninstallplugin', 'core_admin');
$strversion = get_string('version');
$subplugins = get_plugin_list('tinymce');
@ -232,8 +232,8 @@ class tiynce_subplugins_settings extends admin_setting {
// Add uninstall info.
$uninstall = '';
if ($deleteurl = plugin_manager::instance()->get_uninstall_url('tinymce_' . $name)) {
$uninstall = html_writer::link($deleteurl, $struninstall);
if ($uninstallurl = plugin_manager::instance()->get_uninstall_url('tinymce_' . $name)) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
// Add a row to the table.