You are here

function theme_manualcrop_crop_summary in Manual Crop 7

Returns HTML for a summary of an image crop effect.

Parameters

$variables: An associative array containing:

  • data: The current configuration for this crop effect.

Return value

Summary HTML.

File

./manualcrop.admin.inc, line 183
Admin functionality for the Manual Crop module.

Code

function theme_manualcrop_crop_summary($variables) {
  $data = $variables['data'];
  $str = '';
  if ($data['width'] && $data['height']) {
    $str .= t('minimum crop dimensions ') . ' ' . check_plain($data['width']) . 'x' . check_plain($data['height']);
  }
  elseif ($data['width']) {
    $str .= t('minimum crop width @width', array(
      '@width' => $data['width'],
    ));
  }
  elseif ($data['height']) {
    $str .= t('minimum crop height @height', array(
      '@height' => $data['height'],
    ));
  }
  if (!empty($data['keepproportions'])) {
    if ($str) {
      $str .= ' ' . t('and') . ' ';
    }
    $str .= t('maintain proportions');
  }
  if (!empty($data['reuse_crop_style'])) {
    if ($str) {
      $str .= ' ' . t('and') . ' ';
    }
    $str .= t('using the crop of @style as fallback', array(
      '@style' => _manualcrop_image_style_label($data['reuse_crop_style']),
    ));
  }
  if ($str) {
    $str = '(' . $str . ')';
  }
  return $str;
}