/[drupal]/contributions/modules/imagecache/imagecache.module
ViewVC logotype

Diff of /contributions/modules/imagecache/imagecache.module

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

revision 1.68.2.18, Wed Aug 19 20:59:15 2009 UTC revision 1.68.2.19, Wed Aug 19 21:05:23 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: imagecache.module,v 1.68.2.17 2009/08/19 18:35:35 drewish Exp $  // $Id: imagecache.module,v 1.68.2.18 2009/08/19 20:59:15 drewish Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 716  function theme_imagecache($namespace, $p Line 716  function theme_imagecache($namespace, $p
716  }  }
717    
718    
   
 /************************************************************************************  
  * ImageCache action implementation example in module.  
  */  
 function imagecache_resize_image(&$image, $data) {  
   if (!imageapi_image_resize($image, $data['width'], $data['height'])) {  
     watchdog('imagecache', t('imagecache_resize_image failed. image: %image, data: %data.', array('%path' => $image, '%data' => print_r($data, true))), WATCHDOG_ERROR);  
     return false;  
   }  
   return true;  
 }  
   
 function imagecache_resize_form($action) {  
   $form['width'] = array(  
     '#type' => 'textfield',  
     '#title' => t('Width'),  
     '#default_value' => $action['width'],  
     '#description' => t('Enter a width in pixels or as a percentage. i.e. 500 or 80%.'),  
   );  
   $form['height'] = array(  
     '#type' => 'textfield',  
     '#title' => t('Height'),  
     '#default_value' => $action['height'],  
     '#description' => t('Enter a height in pixels or as a percentage. i.e. 500 or 80%.'),  
   );  
   return $form;  
 }  
   
 function theme_imagecache_resize($element) {  
   $data = $element['#value'];  
   return 'width: '. $data['width'] .', height: '. $data['height'];  
 }  
   
   
   
719  /**  /**
720   *  ImageCache 2.x API   *  ImageCache 2.x API
721   *   *

Legend:
Removed from v.1.68.2.18  
changed lines
  Added in v.1.68.2.19

  ViewVC Help
Powered by ViewVC 1.1.2