Mixin_Frame_Event_Publisher

The NextGEN Gallery Mixin Frame Event Publisher class.

Defined (1)

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

/products/photocrati_nextgen/modules/frame_communication/package.module.frame_communication.php  
  1. class Mixin_Frame_Event_Publisher extends Mixin 
  2. /** 
  3. * Encodes data for a setting 
  4. * @param array $data 
  5. * @return string 
  6. */ 
  7. function _encode($data) 
  8. return rawurlencode(json_encode($data)); 
  9. /** 
  10. * Decodes data from a setting 
  11. * @param string $data 
  12. * @return array 
  13. */ 
  14. function _decode($data) 
  15. return (array) json_decode(rawurldecode($data)); 
  16. /** 
  17. * Adds a setting to the frame events 
  18. * @param type $data 
  19. * @return type 
  20. */ 
  21. function add_event($data) 
  22. $id = md5(serialize($data)); 
  23. $data['context'] = $this->object->context; 
  24. $write_cookie = TRUE; 
  25. if (defined('XMLRPC_REQUEST')) { 
  26. $write_cookie = XMLRPC_REQUEST == FALSE; 
  27. if ($write_cookie) { 
  28. setrawcookie($this->object->setting_name . '_' . $id, $this->object->_encode($data), time() + 10800, '/', parse_url(site_url(), PHP_URL_HOST)); 
  29. return $data;