You are here

function theme_upgrade_status_status_label in Upgrade Status 7

Returns HTML for a label to display for a project's update status.

Parameters

array $variables: An associative array containing:

  • status: The integer code for a project's current update status.

// US: Add project data as well so we can determine type of release. // @todo File upstream patch?

  • project: Project data.

See also

update_calculate_project_data()

1 theme call to theme_upgrade_status_status_label()
theme_upgrade_status_report in ./upgrade_status.report.inc
Returns HTML for the project status report.

File

./upgrade_status.report.inc, line 350

Code

function theme_upgrade_status_status_label($variables) {
  $project = $variables['project'];
  switch ($variables['status']) {

    // US: Not applicable.

    #    case UPDATE_NOT_SECURE:

    #      return '<span class="security-error">' . t('Security update required!') . '</span>';

    // US: Not applicable.

    #    case UPDATE_REVOKED:

    #      return '<span class="revoked">' . t('Revoked!') . '</span>';

    // Although unsupported releases should actually be unsupported, we treat
    // them like development releases, since many maintainers merely use this
    // additional flag to hide the release from novice Drupal users.
    case UPGRADE_STATUS_DEVELOPMENT:
    case UPDATE_NOT_SUPPORTED:

      #      return '<span class="not-supported">' . t('Not supported!') . '</span>';

      // US: Additionally output the "development stage" of a project; alpha,
      // beta, and RC are all treated as in development.
      $type = $project['releases'][$project['recommended']]['version'];
      return '<span class="not-current">' . t('In development: %type', array(
        '%type' => $type,
      )) . '</span>';

    // US: Not applicable.

    #    case UPDATE_NOT_CURRENT:

    #      return '<span class="not-current">' . t('Update available') . '</span>';

    // US: Good news for us means that a stable release is available...

    #    case UPDATE_CURRENT:

    #      return '<span class="current">' . t('Up to date') . '</span>';
    case UPGRADE_STATUS_STABLE:
      return '<span class="current">' . t('Available') . '</span>';

    // US: ...or that a module's been moved into core.
    case UPGRADE_STATUS_CORE:
      return '<span class="current">' . t('In core') . '</span>';
  }
}