1 update.theme.inc theme_update_last_check($variables)

Returns HTML for the last time we checked for update data.

In addition to properly formatting the given timestamp, this function also provides a "Check manually" button, that refreshes the available update, and redirects back to the same page.

Parameters

$variables: An associative array containing:

  • last: The timestamp when the site last checked for available updates.

See also

theme_update_report()

theme_update_available_updates_form()

Related topics

File

core/modules/update/update.theme.inc, line 39
Theme functions for the Update module.

Code

function theme_update_last_check($variables) {
  $last = $variables['last'];

  $output = '<div class="update checked">';

  $output .= $last ? t('Last checked: @time ago', array('@time' => format_interval(REQUEST_TIME - $last))) : t('Last checked: never') . ' ';
  if (user_access('administer site configuration')) {
    $output .= l(t('Check manually'), 'admin/reports/updates/check', array('attributes' => array('class' => array('button', 'button-secondary')), 'query' => backdrop_get_destination()));
  }
  if (module_exists('installer') && user_access('access_site_reports')) {
    // Link to the updates installation page from the available updates report
    // (don't add this link to the "Available updates" Dashboard block).
    if ($variables['theme_hook_original'] == 'update_last_check') {
      $output .= l(t('Install system updates'), 'admin/config/system/updates');
    }
  }

  $output .= '</div>';

  return $output;
}