1 update.theme.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

File

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

Code

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

  $version_date = '<span class="version-date">(' . format_date($version['date'], 'custom', 'Y-M-d') . ')</span>';
  $version_details = '<span class="version-details">' . l($version['version'], $version['release_link']) . ' ' . $version_date . '</span></span>';
  $version_title = '<span class="version-title">' . $tag . '</span>';

  $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'],
  );
  $update_links = theme('links__update_version', array('links' => $links));

  $output = '<div class="version ' . $class . '">';
  $output .= '  <div class="version-info">' . $version_title . ' ' . $version_details . '</div>';
  $output .= '  <div class="version-links">' . $update_links . '</div>';
  $output .= '</div>';

  return $output;
}