You are here

function theme_features_storage_link in Features 7.2

Same name and namespace in other branches
  1. 6 theme/theme.inc \theme_features_storage_link()
  2. 7 theme/theme.inc \theme_features_storage_link()

Themes a module status display.

Parameters

array $vars: Variables for this theme hook.

Return value

string Rendered HTML.

3 theme calls to theme_features_storage_link()
features_admin_components in ./features.admin.inc
Form builder for 'admin/structure/features/%feature'.
features_admin_form in ./features.admin.inc
Form builder for 'admin/structure/features'.
template_preprocess_features_admin_components in theme/theme.inc
Display feature component info.

File

theme/theme.inc, line 182
Theme functions and (pre)processors for 'features' module.

Code

function theme_features_storage_link($vars) {
  $classes = array(
    FEATURES_OVERRIDDEN => 'admin-overridden',
    FEATURES_DEFAULT => 'admin-default',
    FEATURES_NEEDS_REVIEW => 'admin-needs-review',
    FEATURES_REBUILDING => 'admin-rebuilding',
    FEATURES_REBUILDABLE => 'admin-rebuilding',
    FEATURES_CONFLICT => 'admin-conflict',
    FEATURES_DISABLED => 'admin-disabled',
    FEATURES_CHECKING => 'admin-loading',
  );
  $default_text = array(
    FEATURES_OVERRIDDEN => t('Overridden'),
    FEATURES_DEFAULT => t('Default'),
    FEATURES_NEEDS_REVIEW => t('Needs review'),
    FEATURES_REBUILDING => t('Rebuilding'),
    FEATURES_REBUILDABLE => t('Rebuilding'),
    FEATURES_CONFLICT => t('Conflict'),
    FEATURES_DISABLED => t('Disabled'),
    FEATURES_CHECKING => t('Checking...'),
  );
  $text = isset($vars['text']) ? $vars['text'] : $default_text[$vars['storage']];
  if ($vars['path']) {
    $vars['options']['attributes']['class'][] = $classes[$vars['storage']];
    $vars['options']['attributes']['class'][] = 'features-storage';
    return l($text, $vars['path'], $vars['options']);
  }
  else {
    return "<span class='{$classes[$vars['storage']]} features-storage'>{$text}</span>";
  }
}