You are here

function theme_environment_indicator_overwritten_header in Environment Indicator 7.2

Theme function for overriden environment indicator in the header of the list.

1 theme call to theme_environment_indicator_overwritten_header()
ctools_export_ui_environment_indicator::list_header in plugins/export_ui/ctools_export_ui_environment_indicator.class.php
Render a header to go before the list.

File

./environment_indicator.theme.inc, line 81
Theme implementation file.

Code

function theme_environment_indicator_overwritten_header($variables) {
  $header = '<div class="overriden-indicator"><h2 class="label">' . t('Overriden indicator.') . '</h2>';
  $header .= '<div class="description">' . t('This indicator is in your settings.php file and will take precedence over any other indicator that matches a hostname. To properly set an indicator in your settings.php file, please visit the !help.', array(
    '!help' => l(t('help pages'), 'admin/help/environment_indicator'),
  )) . '</div></div>';
  $table = '<p>' . t('There is no overriden environment indicator in your settings.php file. You only need one in case you want your indicator to be stored in your settings.php file instead of matching against the hostname. The environment switcher is not supported for overriden environments.') . '</p>';
  if (_environment_indicator_is_overwritten()) {
    $headers = array(
      t('Enabled'),
      t('Name'),
      t('Color'),
      t('Text color'),
      t('Position'),
      t('Fixed'),
    );
    $env = _environment_indicator_load_overwritten();
    $color = $env['color'];
    $text_color = $env['text_color'];
    if (strpos($color, '#') !== 0) {
      $color .= ' <span class="error">(' . t('Invalid color definition') . ')</span>';
    }
    if (strpos($text_color, '#') !== 0) {
      $text_color .= ' <span class="error">(' . t('Invalid color definition') . ')</span>';
    }
    $rows[] = array(
      _environment_indicator_is_overwritten() ? 'TRUE' : 'FALSE',
      $env['name'],
      $color,
      $text_color,
      $env['position'],
      $env['fixed'] ? 'TRUE' : 'FALSE',
    );
    $table = theme('table', array(
      'rows' => $rows,
      'header' => $headers,
    ));
  }
  return $header . $table . '<h2 class="label">' . t('Hostname indicators') . '</h2>';
}