| Versionen | |
|---|---|
| drupal6 – drupal7 | update_help($path, $arg) |
Implementation of hook_help().
modules/
<?php
function update_help($path, $arg) {
switch ($path) {
case 'admin/reports/updates':
$output = '<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>';
$output .= '<p>' . t('To extend the functionality or to change the look of your site, a number of contributed <a href="@modules">modules</a> and <a href="@themes">themes</a> are available.', array('@modules' => 'http://drupal.org/project/modules', '@themes' => 'http://drupal.org/project/themes')) . '</p>';
return $output;
case 'admin/build/themes':
case 'admin/build/modules':
include_once './includes/install.inc';
$status = update_requirements('runtime');
foreach (array('core', 'contrib') as $report_type) {
$type = 'update_' . $report_type;
if (isset($status[$type]['severity'])) {
if ($status[$type]['severity'] == REQUIREMENT_ERROR) {
drupal_set_message($status[$type]['description'], 'error');
}
elseif ($status[$type]['severity'] == REQUIREMENT_WARNING) {
drupal_set_message($status[$type]['description'], 'warning');
}
}
}
return '<p>' . t('See the <a href="@available_updates">available updates</a> page for information on installed modules and themes with new versions released.', array('@available_updates' => url('admin/reports/updates'))) . '</p>';
case 'admin/reports/updates/settings':
case 'admin/reports/status':
// These two pages don't need additional nagging.
break;
case 'admin/help#update':
$output = '<p>' . t("The Update status module periodically checks for new versions of your site's software (including contributed modules and themes), and alerts you to available updates.") . '</p>';
$output .= '<p>' . t('The <a href="@update-report">report of available updates</a> will alert you when new releases are available for download. You may configure options for update checking frequency and notifications at the <a href="@update-settings">Update status module settings page</a>.', array('@update-report' => url('admin/reports/updates'), '@update-settings' => url('admin/reports/updates/settings'))) . '</p>';
$output .= '<p>' . t('Please note that in order to provide this information, anonymous usage statistics are sent to drupal.org. If desired, you may disable the Update status module from the <a href="@modules">module administration page</a>.', array('@modules' => url('admin/build/modules'))) . '</p>';
$output .= '<p>' . t('For more information, see the online handbook entry for <a href="@update">Update status module</a>.', array('@update' => 'http://drupal.org/handbook/modules/update')) . '</p>';
return $output;
default:
// Otherwise, if we're on *any* admin page and there's a security
// update missing, print an error message about it.
if (arg(0) == 'admin' && strpos($path, '#') === FALSE
&& user_access('administer site configuration')) {
include_once './includes/install.inc';
$status = update_requirements('runtime');
foreach (array('core', 'contrib') as $report_type) {
$type = 'update_' . $report_type;
if (isset($status[$type])
&& isset($status[$type]['reason'])
&& $status[$type]['reason'] === UPDATE_NOT_SECURE) {
drupal_set_message($status[$type]['description'], 'error');
}
}
}
}
}
?>
Kommentare
Kommentar hinzufügen