/[drupal]/contributions/modules/imagecache/imagecache_actions.inc
ViewVC logotype

Diff of /contributions/modules/imagecache/imagecache_actions.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.24.2.2, Wed Aug 19 18:33:41 2009 UTC revision 1.24.2.3, Wed Aug 19 21:05:31 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: imagecache_actions.inc,v 1.24.2.1 2009/08/19 18:29:29 drewish Exp $  // $Id: imagecache_actions.inc,v 1.24.2.2 2009/08/19 18:33:41 drewish Exp $
3    
4  function imagecache_resize_form($action) {  function imagecache_resize_form($action) {
5    $form['width'] = array(    $form['width'] = array(
# Line 27  function imagecache_resize_image(&$image Line 27  function imagecache_resize_image(&$image
27    
28  function theme_imagecache_resize($element) {  function theme_imagecache_resize($element) {
29    $data = $element['#value'];    $data = $element['#value'];
30    return 'width: '. $data['width'] .', height: '. $data['height'];    if ($data['width'] && $data['height']) {
31        return check_plain($data['width']) . 'x' . check_plain($data['height']);
32      }
33      return ($data['width']) ? t('width @width', array('@width' => $data['width'])) : t('height @height', array('@height' => $data['height']));
34  }  }
35    
36  /**  /**
# Line 45  function imagecache_scale_form($data = a Line 48  function imagecache_scale_form($data = a
48  }  }
49    
50  function theme_imagecache_scale($element) {  function theme_imagecache_scale($element) {
51    $output = theme_imagecache_resize($element) .  ', upscale: ';    return theme_imagecache_resize($element) . ' ' . ($element['#value']['upscale'] ? '(' . t('upscaling allowed') . ')' : '');
   $output .= ($element['#value']['upscale']) ? t('Yes') : t('No');  
   return $output;  
52  }  }
53    
54  function imagecache_scale_image(&$image, $data) {  function imagecache_scale_image(&$image, $data) {
# Line 119  function imagecache_deprecated_scale_for Line 120  function imagecache_deprecated_scale_for
120    
121  function theme_imagecache_deprecated_scale($element) {  function theme_imagecache_deprecated_scale($element) {
122    $data = $element['#value'];    $data = $element['#value'];
123    $options = array('inside' => t('Inside dimensions'), 'outside' => t('Outside dimensions'));    $fits = array('inside' => t('Inside dimensions'), 'outside' => t('Outside dimensions'));
124    return 'width: '. $data['width'] .', height: '. $data['height'] .', fit: '. $options[$data['fit']];    return t('width: @width, height: @height, fit: @fit', array('@width' => $data['width'], '@height' => $data['height'], '@fit' => $fits[$data['fit']]));
125  }  }
126    
127  function imagecache_deprecated_scale_image(&$image, $data) {  function imagecache_deprecated_scale_image(&$image, $data) {
# Line 181  function imagecache_crop_form($data = ar Line 182  function imagecache_crop_form($data = ar
182    
183  function theme_imagecache_crop($element) {  function theme_imagecache_crop($element) {
184    $data = $element['#value'];    $data = $element['#value'];
185    return 'width: '. $data['width'] .', height: '. $data['height'] .', xoffset: '. $data['xoffset'] .', yoffset: '. $data['yoffset'];    return t('width: @width, height: @height, xoffset: @xoffset, yoffset: @yoffset', array(
186        '@width' => $data['width'],
187        '@height' => $data['height'],
188        '@xoffset' => $data['xoffset'],
189        '@yoffset' => $data['yoffset'],
190      ));
191  }  }
192    
193  function imagecache_crop_image(&$image, $data) {  function imagecache_crop_image(&$image, $data) {
# Line 241  function imagecache_rotate_form($data = Line 247  function imagecache_rotate_form($data =
247  }  }
248    
249  function theme_imagecache_rotate($element) {  function theme_imagecache_rotate($element) {
250    $output = t('degrees:') .' '. $element['#value']['degrees'] .', ';    $data = $element['#value'];
251    $output .= t('randomize:') .' '. (($element['#value']['random']) ? t('Yes') : t('No')) .', ';    if ($data['random']) {
252    $output .= t('background:') .' '. strlen(trim($element['#value']['bgcolor'])) ? $element['#value']['bgcolor'] : t('Transparent/white');      return t('random between -@degrees&deg and @degrees&deg', array('@degrees' => $data['degrees']));
253    return $output;    }
254      return t('@degrees&deg', array('@degrees' => $data['degrees']));
255  }  }
256    
257  function imagecache_rotate_image(&$image, $data) {  function imagecache_rotate_image(&$image, $data) {
# Line 254  function imagecache_rotate_image(&$image Line 261  function imagecache_rotate_image(&$image
261      'random' => FALSE,      'random' => FALSE,
262      'bgcolor' => '',      'bgcolor' => '',
263    );    );
264    
265    // Set sane default values.    // Set sane default values.
266    if (strlen(trim($data['bgcolor']))) {    if (strlen(trim($data['bgcolor']))) {
267      $data['bgcolor'] = hexdec(str_replace('#', '', $data['bgcolor']));      $data['bgcolor'] = hexdec(str_replace('#', '', $data['bgcolor']));
# Line 310  function imagecache_sharpen_form($data) Line 317  function imagecache_sharpen_form($data)
317  }  }
318    
319  function theme_imagecache_sharpen($element) {  function theme_imagecache_sharpen($element) {
320    $output = t('radius:') .' '. $element['#value']['radius'] .', ';    $data = $element['#value'];
321    $output .= t('sigma:') .' '. $element['#value']['sigma'] .', ';    return t('radius: @radius, sigma: @sigma, amount: @amount, threshold: @threshold', array(
322    $output .= t('amount:') .' '. $element['#value']['amount'] .', ';      '@radius' => $data['radius'],
323    $output .= t('threshold:') .' '. $element['#value']['threshold'] ;      '@sigma' => $data['sigma'],
324    return $output;      '@amount' => $data['amount'],
325        '@threshold' => $data['threshold'],
326      ));
327  }  }
328    
329  function imagecache_sharpen_image(&$image, $data) {  function imagecache_sharpen_image(&$image, $data) {

Legend:
Removed from v.1.24.2.2  
changed lines
  Added in v.1.24.2.3

  ViewVC Help
Powered by ViewVC 1.1.2