You are here

function theme_canvasactions_perspective_summary in ImageCache Actions 7

Implements theme_hook() for the define perspective 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 1389

Code

function theme_canvasactions_perspective_summary(array $variables) {
  $data = $variables['data'];
  $output = array();
  $output[] = t('%symmetry. Vanishing point: %vanish.', array(
    '%symmetry' => $data['symmetry'],
    '%vanish' => $data['vanish'],
  ));
  if ($data['symmetry'] == 'asymmetrical') {
    switch ($data['vanish']) {
      case 'top':
      case 'bottom':
        $output[] = t('Left distortion: %distortion, right distortion: %opposite_distortion.', array(
          '%distortion' => $data['distortion'] . '%',
          '%opposite_distortion' => $data['opposite_distortion'] . '%',
        ));
        break;
      case 'right':
      case 'left':
        $output[] = t('Top distortion: %distortion, bottom distortion: %opposite_distortion.', array(
          '%distortion' => $data['distortion'] . '%',
          '%opposite_distortion' => $data['opposite_distortion'] . '%',
        ));
        break;
    }
  }
  else {
    $output[] = t('Distortion: %distortion.', array(
      '%distortion' => $data['distortion'] . '%',
    ));
  }
  return implode(' ', $output);
}