You are here

function theme_imagecrop in Image javascript crop 5

Same name and namespace in other branches
  1. 6 imagecrop.module \theme_imagecrop()

Theme image crop.

Parameters

$url url of image:

$width width of image:

$height height of image:

$js_lib wether we are using jquery interface or jquery ui:

$resize wether the cropping box is resizeble or not:

Return value

$output html of the javascript crop area

1 theme call to theme_imagecrop()
imagecrop_docrop in ./imagecrop.module
Callback with javascript crop.

File

./imagecrop.module, line 566
Provides a javascript toolbox through an imagecache action.

Code

function theme_imagecrop($url, $width, $height, $js, $resize = 0) {
  $output = '
    <div style="margin-left: 3px;"><div class="imagefield-crop-wrapper" id="imagefield-crop-wrapper" style="position: absolute; margin-top:60px; width: ' . $width . 'px; height: ' . $height . 'px;">
      <div id="image-crop-container" style="background-image: url(\'' . $url . '\'); width:' . $width . 'px; height:' . $height . 'px;"></div>
      <div id="resizeMe" style="background-image: url(\'' . $url . '\'); width:' . $width . 'px; height:' . $height . 'px; top: 20px;">';
  if ($resize == 1 && $js == 'jquery_interface') {
    $output .= '
        <div id="resizeSE"></div>
        <div id="resizeE"></div>
        <div id="resizeNE"></div>
        <div id="resizeN"></div>
        <div id="resizeNW"></div>
        <div id="resizeW"></div>
        <div id="resizeSW"></div>
        <div id="resizeS"></div>
      ';
  }
  $output .= '</div></div></div><div style="clear:both;"></div>';
  return $output;
}