You are here

function update_status_help in Update Status 5.2

Same name and namespace in other branches
  1. 5 update_status.module \update_status_help()

Implementation of hook_help().

File

./update_status.module, line 60

Code

function update_status_help($section) {
  switch ($section) {
    case 'admin/logs/updates':
      return '<p>' . t('Here you can find information about available updates for your installed modules. Note that each module is part of a "project", which may have the same name as the module or may have a different name.') . '</p>';
    case 'admin/logs/updates/settings':
      return '<p>' . t('Here you can configure what kinds of available updates for your installed modules should be marked as an error on the <a href="@status_report">Status report</a> and the <a href="@modules_page">Modules</a> page, and other related settings.', array(
        '@status_report' => url('admin/logs/status'),
        '@modules_page' => url('admin/build/modules'),
      )) . '</p>';
    case 'admin/build/modules':
      include_once './includes/install.inc';
      $status = update_status_requirements('runtime');
      $types = array(
        'update_status_core',
        'update_status_contrib',
      );
      foreach ($types as $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']);
          }
        }
      }
      return '<p>' . t('See the <a href="@available_updates">available updates</a> page for information on installed modules with new versions released.', array(
        '@available_updates' => url('admin/logs/updates'),
      )) . '</p>';
    case 'admin/logs/updates/settings':
    case 'admin/logs/status':

      // These two pages don't need additional nagging.
      break;
    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($section, '#') === FALSE && user_access('administer site configuration')) {
        include_once './includes/install.inc';
        $status = update_status_requirements('runtime');
        $notify_all = variable_get('update_status_notification_threshold', 'all') == 'all';
        foreach (array(
          'core',
          'contrib',
        ) as $report_type) {
          $type = 'update_status_' . $report_type;
          if (isset($status[$type]) && isset($status[$type]['reason']) && ($status[$type]['reason'] === UPDATE_STATUS_NOT_SECURE || $notify_all && $status[$type]['reason'] == UPDATE_STATUS_NOT_CURRENT)) {
            drupal_set_message($status[$type]['description'], 'error');
          }
        }
      }
  }
}