Skip to content

Commit

Permalink
Issue # 6309: Add help text to the Uninstall Modules page.
Browse files Browse the repository at this point in the history
  • Loading branch information
bugfolder committed Dec 7, 2023
1 parent 3ffd114 commit 84ab22b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
15 changes: 14 additions & 1 deletion core/modules/system/system.admin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,16 @@ function system_modules_uninstall($form, $form_state = NULL) {
}
}

$help = t('Modules must be disabled in the <a href="@link">List modules</a> tab before they can be uninstalled.', array('@link' => url('admin/modules')));
if (!empty($disabled_modules)) {
$help .= ' ' . t('The modules listed below have been disabled and may be uninstalled.');
}
$help .= ' ' . t('Uninstalling a module will permanently remove its settings and/or associated data, while leaving the module files in place. To remove a module permanently, delete its files from the <code>/modules</code> folder of your Backdrop installation.');
$form['help'] = array(
'#type' => 'help',
'#markup' => $help,
);

// Only build the rest of the form if there are any modules available to
// uninstall.
if (!empty($disabled_modules)) {
Expand Down Expand Up @@ -1583,7 +1593,10 @@ function system_cron_settings($form, &$form_state) {

$form['cron_url'] = array(
'#type' => 'help',
'#markup' => t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url($base_url . '/core/cron.php', array('external' => TRUE, 'query' => array('cron_key' => state_get('cron_key', 'backdrop')))))),
'#markup' => t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url($base_url . '/core/cron.php', array(
'external' => TRUE,
'query' => array('cron_key' => state_get('cron_key', 'backdrop')),
)))),
);

$form['cron'] = array(
Expand Down
25 changes: 19 additions & 6 deletions core/modules/system/system.theme.inc
Original file line number Diff line number Diff line change
Expand Up @@ -248,23 +248,36 @@ function theme_system_modules_uninstall($variables) {
$disabled_message = format_plural(count($form['modules'][$module]['#required_by']),
'To uninstall @module, the following module must be uninstalled first: @required_modules',
'To uninstall @module, the following modules must be uninstalled first: @required_modules',
array('@module' => $form['modules'][$module]['#module_name'], '@required_modules' => implode(', ', $form['modules'][$module]['#required_by'])));
array(
'@module' => $form['modules'][$module]['#module_name'],
'@required_modules' => implode(', ', $form['modules'][$module]['#required_by']),
));
$disabled_message = '<div class="admin-requirements">' . $disabled_message . '</div>';
}
else {
$disabled_message = '';
}
$rows[] = array(
array('data' => backdrop_render($form['uninstall'][$module]), 'align' => 'center'),
array(
'data' => backdrop_render($form['uninstall'][$module]),
'align' => 'center',
),
'<strong><label for="' . $form['uninstall'][$module]['#id'] . '">' . backdrop_render($form['modules'][$module]['name']) . '</label></strong>',
array('data' => backdrop_render($form['modules'][$module]['description']) . $disabled_message, 'class' => array('description')),
array(
'data' => backdrop_render($form['modules'][$module]['description']) . $disabled_message,
'class' => array('description'),
),
);
}

$output = theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No modules are available to uninstall.')));
$output .= backdrop_render_children($form);
$form['modules'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
'#empty' => t('No modules are available to uninstall.'),
);

return $output;
return backdrop_render_children($form);
}

/**
Expand Down

0 comments on commit 84ab22b

Please sign in to comment.