You are here

function theme_imagefield_crop_crop_image in Imagefield Crop 5

1 theme call to theme_imagefield_crop_crop_image()
_imagefield_crop_widget_form in ./imagefield_crop.module

File

./imagefield_crop.module, line 701

Code

function theme_imagefield_crop_crop_image($file = NULL, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE, $cropId = '') {
  $output = '<div class="imagefield-crop-wrapper">';
  if (!empty($file)) {
    $file = (array) $file;
    if (!$getsize || is_file($file['filepath']) && (list($width, $height, $type, $image_attributes) = @getimagesize($file['filepath']))) {

      //$attributes = drupal_attributes($attributes);
      $alt = empty($alt) ? $file['alt'] : $alt;
      $title = empty($title) ? $file['title'] : $title;
      $url = $file['fid'] == 'upload' ? url($file['preview']) : file_create_url($file['filepath']);
      $output .= '
<div id="image-crop-container-' . $cropId . '" class="image-crop-container"
     style="background-image: url(\'' . $url . '\'); width:' . $width . 'px; height:' . $height . 'px; margin-left:-' . $width / 2 . 'px; margin-top:-' . $height / 2 . 'px;">
</div>

<div id="resizeMe-' . $cropId . '" class="resizeMe" style="background-image: url(\'' . $url . '\')">
	<div id="resizeSE-' . $cropId . '" class="resizeSE"></div>
	<div id="resizeE-' . $cropId . '" class="resizeE"></div>
	<div id="resizeNE-' . $cropId . '" class="resizeNE"></div>
	<div id="resizeN-' . $cropId . '" class="resizeN"></div>
	<div id="resizeNW-' . $cropId . '" class="resizeNW"></div>
	<div id="resizeW-' . $cropId . '" class="resizeW"></div>
	<div id="resizeSW-' . $cropId . '" class="resizeSW"></div>
	<div id="resizeS-' . $cropId . '" class="resizeS"></div>
</div>';
    }
  }
  $output .= '</div>';
  return $output;
}