You are here

function theme_canvasactions_definecanvas_summary in ImageCache Actions 7

Same name and namespace in other branches
  1. 8 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 284

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'];
  }

  /** @noinspection PhpUnhandledExceptionInspection */
  $output .= theme('imagecacheactions_rgb', array(
    'RGB' => $data['RGB'],
  ));
  $output .= $data['under'] ? t(" <b>under</b> image ") : t(" <b>over</b> image ");
  return $output;
}