You are here

function theme_textimage_text_effect_summary in Textimage 7.3

Renders 'textimage_background' image effect summary.

Implements theme_hook().

Parameters

array $variables: An associative array containing:

  • data: The current configuration of the image effect.

Return value

string The HTML for the summary of the image effect.

File

effects/textimage_text.inc, line 614
Implementation of the 'textimage_text' image effect.

Code

function theme_textimage_text_effect_summary($variables) {

  // Merge input data with effect defaults.
  $data = drupal_array_merge_deep(_textimage_text_effect_defaults(), $variables['data']);
  $output = ' - ' . t('Font:') . ' ' . $data['font']['name'];
  $output .= ' - ' . t('Size: @size', array(
    '@size' => $data['font']['size'],
  ));
  if ($data['font']['angle']) {
    $output = $output . ' ' . t('- Rotate: @angle°', array(
      '@angle' => $data['font']['angle'],
    ));
  }
  $output .= ' - ' . t('Color:') . ' ' . theme('textimage_colored_string', array(
    'text' => t('Sample'),
    'foreground_color' => $data['font']['color'],
    'background_color' => $data['layout']['background_color'],
  ));
  $background_opacity = _textimage_rgba_to_opacity($data['layout']['background_color']);
  $font_opacity = _textimage_rgba_to_opacity($data['font']['color']);
  $stroke_opacity = _textimage_rgba_to_opacity($data['font']['stroke_color']);
  if ($font_opacity != 100 || $stroke_opacity != 100 || $background_opacity != 100) {
    $output .= ', ' . t('opacity: bg @background_opacity%, fg @font_opacity%', array(
      '@background_opacity' => $background_opacity,
      '@font_opacity' => $font_opacity,
    ));
    if ($stroke_opacity && $stroke_opacity != 100) {
      $output .= ', ' . t('@stroke_mode @stroke_opacity%', array(
        '@stroke_mode' => $data['font']['stroke_mode'] == 'outline' ? t('outline') : t('shadow'),
        '@stroke_opacity' => $stroke_opacity,
      ));
    }
  }
  return $output;
}