function theme_update_version

7.x update.report.inc theme_update_version($variables)
6.x update.report.inc theme_update_version($version, $tag, $class)
8.x update.report.inc theme_update_version($variables)

Returns HTML for the version display of a project.

Parameters

array $variables: An associative array containing:

  • version: An array of data about the latest released version, containing:

    • version: The version number.
    • release_link: The URL for the release notes.
    • date: The date of the release.
    • download_link: The URL for the downloadable file.
  • tag: The title of the project.
  • class: A string containing extra classes for the wrapping table.

Related topics

1 theme call to theme_update_version()
theme_update_report in drupal/modules/update/update.report.inc
Returns HTML for the project status report.
2 string references to the theme hook from theme_update_version()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

theme_update_report in drupal/modules/update/update.report.inc
Returns HTML for the project status report.
update_theme in drupal/modules/update/update.module
Implements hook_theme().

File

drupal/modules/update/update.report.inc, line 299
Code required only when rendering the available updates report.

Code

function theme_update_version($variables) {
  $version = $variables['version'];
  $tag = $variables['tag'];
  $class = implode(' ', $variables['class']);

  $output = '';
  $output .= '<table class="version ' . $class . '">';
  $output .= '<tr>';
  $output .= '<td class="version-title">' . $tag . "</td>\n";
  $output .= '<td class="version-details">';
  $output .= l($version['version'], $version['release_link']);
  $output .= ' <span class="version-date">(' . format_date($version['date'], 'custom', 'Y-M-d') . ')</span>';
  $output .= "</td>\n";
  $output .= '<td class="version-links">';
  $links = array();
  $links['update-download'] = array(
    'title' => t('Download'),
    'href' => $version['download_link'],
  );
  $links['update-release-notes'] = array(
    'title' => t('Release notes'),
    'href' => $version['release_link'],
  );
  $output .= theme('links__update_version', array('links' => $links));
  $output .= '</td>';
  $output .= '</tr>';
  $output .= "</table>\n";
  return $output;
}