function update_page_build

Implements hook_page_build().

File

drupal/core/modules/update/update.module, line 101
Handles updates of Drupal core and contributed projects.

Code

function update_page_build() {
  if (arg(0) == 'admin' && user_access('administer site configuration')) {
    switch (current_path()) {

      // These pages don't need additional nagging.
      case 'admin/appearance/update':
      case 'admin/appearance/install':
      case 'admin/modules/update':
      case 'admin/modules/install':
      case 'admin/reports/updates':
      case 'admin/reports/updates/update':
      case 'admin/reports/updates/install':
      case 'admin/reports/updates/settings':
      case 'admin/reports/status':
      case 'admin/update/ready':
        return;

      // If we are on the appearance or modules list, display a detailed report
      // of the update status.
      case 'admin/appearance':
      case 'admin/modules':
        $verbose = TRUE;
        break;
    }
    module_load_install('update');
    $status = update_requirements('runtime');
    foreach (array(
      'core',
      'contrib',
    ) as $report_type) {
      $type = 'update_' . $report_type;
      if (!empty($verbose)) {
        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');
          }
        }
      }
      else {
        if (isset($status[$type]) && isset($status[$type]['reason']) && $status[$type]['reason'] === UPDATE_NOT_SECURE) {
          drupal_set_message($status[$type]['description'], 'error');
        }
      }
    }
  }
}