Mixin_WordPress_GalleryStorage_Driver

The NextGEN Gallery Mixin WordPress GalleryStorage Driver class.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php  
  1. class Mixin_WordPress_GalleryStorage_Driver extends Mixin 
  2. /** 
  3. * Returns the named sizes available for images 
  4. * @global array $_wp_additional_image_sizese 
  5. * @return array 
  6. */ 
  7. function get_image_sizes() 
  8. global $_wp_additional_image_sizes; 
  9. $_wp_additional_image_sizes[] = 'full'; 
  10. return $_wp_additional_image_sizes; 
  11. /** 
  12. * Gets the upload path for new images in this gallery 
  13. * This will always be the date-based directory 
  14. * @param type $gallery 
  15. * @return type 
  16. */ 
  17. function get_upload_abspath($gallery = FALSE) 
  18. // Gallery is used for this driver, as the upload path is 
  19. // the same, regardless of what gallery is used 
  20. $retval = FALSE; 
  21. $dir = wp_upload_dir(time()); 
  22. if ($dir) { 
  23. $retval = $dir['path']; 
  24. return $retval; 
  25. /** 
  26. * Will always return the same as get_upload_abspath(), as 
  27. * WordPress storage is not organized by gallery but by date 
  28. * @param int|object $gallery 
  29. */ 
  30. function get_gallery_abspath($gallery = FALSE) 
  31. return $this->object->get_upload_abspath(); 
  32. /** 
  33. * Gets the url of a particular sized image 
  34. * @param int|object $image 
  35. * @param type $size 
  36. * @return string 
  37. */ 
  38. function get_image_url($image = FALSE, $size = 'full') 
  39. $retval = NULL; 
  40. $image_key = C_Displayed_Gallery_Mapper::get_instance()->get_primary_key_column(); 
  41. if ($image && ($image_id = $this->object->_get_image_id($image))) { 
  42. $parts = wp_get_attachment_image_src($image->{$image_key}); 
  43. if ($parts) { 
  44. $retval = $parts['url']; 
  45. return apply_filters('ngg_get_image_url', $retval, $image, $size);