You are here

function theme_entity_status in Entity API 7

Themes the exportable status of an entity.

1 theme call to theme_entity_status()
EntityDefaultUIController::overviewTableRow in includes/entity.ui.inc
Generates the row for the passed entity and may be overridden in order to customize the rows.

File

theme/entity.theme.inc, line 137
Holds entity module's theme functions.

Code

function theme_entity_status($variables) {
  $status = $variables['status'];
  $html = $variables['html'];
  if (($status & ENTITY_FIXED) == ENTITY_FIXED) {
    $label = t('Fixed');
    $help = t('The configuration is fixed and cannot be changed.');
    return $html ? "<span class='entity-status-fixed' title='{$help}'>" . $label . "</span>" : $label;
  }
  elseif (($status & ENTITY_OVERRIDDEN) == ENTITY_OVERRIDDEN) {
    $label = t('Overridden');
    $help = t('This configuration is provided by a module, but has been changed.');
    return $html ? "<span class='entity-status-overridden' title='{$help}'>" . $label . "</span>" : $label;
  }
  elseif ($status & ENTITY_IN_CODE) {
    $label = t('Default');
    $help = t('A module provides this configuration.');
    return $html ? "<span class='entity-status-default' title='{$help}'>" . $label . "</span>" : $label;
  }
  elseif ($status & ENTITY_CUSTOM) {
    $label = t('Custom');
    $help = t('A custom configuration by a user.');
    return $html ? "<span class='entity-status-custom' title='{$help}'>" . $label . "</span>" : $label;
  }
}