/products/photocrati_nextgen/modules/ngglegacy/lib/image.php

  1. <?php 
  2. /** 
  3. * This is a wrapper class to the C_Image_Wrapper which provides all of the necessary logic for 
  4. * retrieving attributes as needed. 
  5. * 
  6. * NOTE: it isn't possible yet (as of PHP 5.4) to use overloaded properties in any language constructs other than 
  7. * isset(). To work around this with the wrapper class (which uses overloaded properties) we make a copy of any 
  8. * attributes set to this object. 
  9. */ 
  10. class nggImage extends Ngg_Serializable 
  11. public $_ngiw; 
  12. public $_propogate = TRUE; 
  13.  
  14.  
  15. // TODO: Make nggImage a subclass of C_Component and use the wrapper functionality 
  16. function __construct($image) 
  17. $image->meta_data = $this->unserialize($image->meta_data); 
  18. C_Component_Registry::get_instance(); 
  19. $this->_ngiw = new C_Image_Wrapper($image, NULL, TRUE); 
  20.  
  21. public function __set($name, $value) 
  22. $this->$name = $value; 
  23. if ($this->_propogate) 
  24. $this->_ngiw->__set($name, $value); 
  25.  
  26. public function __isset($name) 
  27. return $this->_ngiw->__isset($name); 
  28.  
  29. public function __unset($name) 
  30. return $this->_ngiw->__unset($name); 
  31.  
  32. public function __get($name) 
  33. $this->_propogate = FALSE; 
  34. $this->$name = $this->_ngiw->__get($name); 
  35. $this->_propogate = TRUE; 
  36. return $this->$name; 
  37.  
  38. function get_thumbcode($galleryname = '') 
  39. return $this->_ngiw->get_thumbcode($galleryname); 
  40.  
  41. function get_href_link() 
  42. return $this->_ngiw->get_href_link(); 
  43.  
  44. function get_href_thumb_link() 
  45. return $this->_ngiw->get_href_thumb_link(); 
  46.  
  47. function cached_singlepic_file($width = '', $height = '', $mode = '' ) 
  48. return $this->_ngiw->cached_singlepic_file($width, $height, $mode); 
  49.  
  50. function get_tags() 
  51. return $this->_ngiw->get_tags(); 
  52.  
  53. function get_permalink() 
  54. return $this->_ngiw->get_permalink(); 
  55.  
.