You are here

function prod_monitor_updates in Production check & Production monitor 6

Same name and namespace in other branches
  1. 7 prod_monitor/includes/prod_monitor.admin.inc \prod_monitor_updates()

Callback for module update status page

1 string reference to 'prod_monitor_updates'
prod_monitor_menu in prod_monitor/prod_monitor.module
Implementation of hook_menu() Note: do not use t() in this hook! Translation is handled by core!

File

prod_monitor/includes/prod_monitor.admin.inc, line 150

Code

function prod_monitor_updates($modules) {
  $output = '';
  $id = $modules['id'];
  drupal_set_title(t('Module update status for') . ' ' . _prod_monitor_get_url($id));

  // Only show a report if the available updates have been fetched!
  if (!empty($modules) && !empty($modules['projects']) && !empty($modules['available'])) {
    module_load_include('inc', 'prod_monitor', 'includes/prod_monitor.update');
    $data = _prod_monitor_calculate_project_data($id, $modules['projects'], $modules['available']);
    $output .= theme('prod_monitor_update_report', $id, $modules['lastupdate'], $data);
  }
  else {
    $destination = drupal_get_destination();
    $output .= theme('prod_monitor_update_report', $id, $modules['lastupdate'], t('No information is available about potential new releases for currently installed modules and themes. To check for updates, you may need to !cron or you can !check. Please note that checking for available updates can take a long time, so please be patient.', array(
      '!cron' => l(t('run cron'), 'admin/reports/status/run-cron', array(
        'attributes' => array(
          'title' => t('run cron'),
        ),
        'query' => $destination,
      )),
      '!check' => l(t('check manually'), 'admin/reports/prod-monitor/site/' . $id . '/update-check', array(
        'attributes' => array(
          'title' => t('check manually'),
        ),
      )),
    )));
  }
  return $output;
}