function update_help in Drupal 8
Same name and namespace in other branches
- 6 modules/update/update.module \update_help()
- 7 modules/update/update.module \update_help()
- 9 core/modules/update/update.module \update_help()
Implements hook_help().
File
- core/
modules/ update/ update.module, line 118 - Handles updates of Drupal core and contributed projects.
Code
function update_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.update':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Update Manager module periodically checks for new versions of your site\'s software (including contributed modules and themes), and alerts administrators to available updates. The Update Manager system is also used by some other modules to manage updates and downloads; for example, the Interface Translation module uses the Update Manager to download translations from the localization server. Note that whenever the Update Manager system is used, anonymous usage statistics are sent to Drupal.org. If desired, you may disable the Update Manager module from the <a href=":modules">Extend page</a>; if you do so, functionality that depends on the Update Manager system will not work. For more information, see the <a href=":update">online documentation for the Update Manager module</a>.', [
':update' => 'https://www.drupal.org/documentation/modules/update',
':modules' => Url::fromRoute('system.modules_list')
->toString(),
]) . '</p>';
// Only explain the Update manager if it has not been disabled.
if (_update_manager_access()) {
$output .= '<p>' . t('The Update Manager also allows administrators to update and install modules and themes through the administration interface.') . '</p>';
}
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Checking for available updates') . '</dt>';
$output .= '<dd>' . t('The <a href=":update-report">Available updates report</a> displays core, contributed modules, and themes for which there are new releases available for download. On the report page, you can also check manually for updates. You can configure the frequency of update checks, which are performed during cron runs, and whether notifications are sent on the <a href=":update-settings">Update Manager settings page</a>.', [
':update-report' => Url::fromRoute('update.status')
->toString(),
':update-settings' => Url::fromRoute('update.settings')
->toString(),
]) . '</dd>';
// Only explain the Update manager if it has not been disabled.
if (_update_manager_access()) {
$output .= '<dt>' . t('Performing updates through the Update page') . '</dt>';
$output .= '<dd>' . t('The Update Manager module allows administrators to perform updates directly from the <a href=":update-page">Update page</a>. It lists all available updates, and you can confirm whether you want to download them. If you don\'t have sufficient access rights to your web server, you could be prompted for your FTP/SSH password. Afterwards the files are transferred into your site installation, overwriting your old files. Direct links to the Update page are also displayed on the <a href=":modules_page">Extend page</a> and the <a href=":themes_page">Appearance page</a>.', [
':modules_page' => Url::fromRoute('system.modules_list')
->toString(),
':themes_page' => Url::fromRoute('system.themes_page')
->toString(),
':update-page' => Url::fromRoute('update.report_update')
->toString(),
]) . '</dd>';
$output .= '<dt>' . t('Installing new modules and themes through the Install page') . '</dt>';
$output .= '<dd>' . t('You can also install new modules and themes in the same fashion, through the <a href=":install">Install page</a>, or by clicking the <em>Install new module/theme</em> links at the top of the <a href=":modules_page">Extend page</a> and the <a href=":themes_page">Appearance page</a>. In this case, you are prompted to provide either the URL to the download, or to upload a packaged release file from your local computer.', [
':modules_page' => Url::fromRoute('system.modules_list')
->toString(),
':themes_page' => Url::fromRoute('system.themes_page')
->toString(),
':install' => Url::fromRoute('update.report_install')
->toString(),
]) . '</dd>';
}
$output .= '</dl>';
return $output;
case 'update.status':
return '<p>' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . '</p>';
case 'system.modules_list':
if (_update_manager_access()) {
$output = '<p>' . t('Regularly review and install <a href=":updates">available updates</a> to maintain a secure and current site. Always run the <a href=":update-php">update script</a> each time a module is updated.', [
':update-php' => Url::fromRoute('system.db_update')
->toString(),
':updates' => Url::fromRoute('update.status')
->toString(),
]) . '</p>';
}
else {
$output = '<p>' . t('Regularly review <a href=":updates">available updates</a> to maintain a secure and current site. Always run the <a href=":update-php">update script</a> each time a module is updated.', [
':update-php' => Url::fromRoute('system.db_update')
->toString(),
':updates' => Url::fromRoute('update.status')
->toString(),
]) . '</p>';
}
return $output;
}
}