imagecache default presets


/ Published in: PHP
Save to your folder(s)

have multiple imagecache files be recognized as default


Copy this code and paste it in your HTML
  1. function icye_site_imagecache_default_presets(){
  2. $presets = array();
  3. $path = drupal_get_path('module', 'icye_site') . '/imagecache';
  4. $files = drupal_system_listing('.inc$', $path, 'name', 0);
  5. foreach ($files as $file) {
  6. include_once $file->filename;
  7. }
  8. return $presets;
  9. }
  10.  
  11.  
  12. $presets['site_logo'] = array (
  13. 'presetname' => 'site_logo',
  14. 'actions' =>
  15. 0 =>
  16. 'weight' => '0',
  17. 'module' => 'imagecache',
  18. 'action' => 'imagecache_scale_and_crop',
  19. 'data' =>
  20. 'width' => '12%',
  21. 'height' => '12%',
  22. ),
  23. ),
  24. ),
  25. );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.