You are here

function theme_canvasactions_definecanvas_summary in ImageCache Actions 8

Same name and namespace in other branches
  1. 7 canvasactions/canvasactions.inc \theme_canvasactions_definecanvas_summary()

Implements theme_hook() for the define canvas effect summary.

Parameters

array $variables: An associative array containing:

  • data: The current configuration for this image effect.

Return value

string The HTML for the summary of this image effect.

File

canvasactions/canvasactions.inc, line 283

Code

function theme_canvasactions_definecanvas_summary(array $variables) {
  $data = $variables['data'];
  if ($data['exact']['width'] || $data['exact']['height']) {
    $w = !empty($data['exact']['width']) ? $data['exact']['width'] : '100%';
    $h = !empty($data['exact']['height']) ? $data['exact']['height'] : '100%';
    $x = !empty($data['exact']['xpos']) ? $data['exact']['xpos'] : '0';
    $y = !empty($data['exact']['ypos']) ? $data['exact']['ypos'] : '0';
    $output = "{$w}x{$h} ({$x}, {$y})";
  }
  else {
    $output = ' left:' . $data['relative']['leftdiff'];
    $output .= ' right:' . $data['relative']['rightdiff'];
    $output .= ' top:' . $data['relative']['topdiff'];
    $output .= ' bottom:' . $data['relative']['bottomdiff'];
  }
  $output .= theme('imagecacheactions_rgb', array(
    'RGB' => $data['RGB'],
  ));
  $output .= $data['under'] ? t(" <b>under</b> image ") : t(" <b>over</b> image ");
  return $output;
}