A_NextGen_Basic_Slideshow_Controller

Class A_NextGen_Basic_Slideshow_Controller.

Defined (1)

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

/products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php  
  1. class A_NextGen_Basic_Slideshow_Controller extends Mixin 
  2. /** 
  3. * Displays the ngglegacy thumbnail gallery. 
  4. * This method deprecates the use of the nggShowGallery() function. 
  5. * @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery 
  6. */ 
  7. function index_action($displayed_gallery, $return = FALSE) 
  8. // Get the images to be displayed 
  9. $current_page = (int) $this->param('nggpage', 1); 
  10. if ($images = $displayed_gallery->get_included_entities()) { 
  11. // Get the gallery storage component 
  12. $storage = C_Gallery_Storage::get_instance(); 
  13. // Create parameter list for the view 
  14. $params = $displayed_gallery->display_settings; 
  15. $params['storage'] =& $storage; 
  16. $params['images'] =& $images; 
  17. $params['displayed_gallery_id'] = $displayed_gallery->id(); 
  18. $params['current_page'] = $current_page; 
  19. $params['effect_code'] = $this->object->get_effect_code($displayed_gallery); 
  20. $params['anchor'] = 'ngg-slideshow-' . $displayed_gallery->id() . '-' . rand(1, getrandmax()) . $current_page; 
  21. $gallery_width = $displayed_gallery->display_settings['gallery_width']; 
  22. $gallery_height = $displayed_gallery->display_settings['gallery_height']; 
  23. $params['aspect_ratio'] = $gallery_width / $gallery_height; 
  24. $params['placeholder'] = $this->object->get_static_url('photocrati-nextgen_basic_gallery#slideshow/placeholder.gif'); 
  25. // There was a problem with the slideFX/cycle_effect parameter not getting set 
  26. // correctly in previous versions 
  27. if (!isset($params['display_settings']['cycle_effect']) or !$params['cycle_effect']) { 
  28. $params['cycle_effect'] = 'fade'; 
  29. // Are we to generate a thumbnail link? 
  30. if ($displayed_gallery->display_settings['show_thumbnail_link']) { 
  31. $params['thumbnail_link'] = $this->object->get_url_for_alternate_display_type($displayed_gallery, NGG_BASIC_THUMBNAILS); 
  32. $params = $this->object->prepare_display_parameters($displayed_gallery, $params); 
  33. $retval = $this->object->render_partial('photocrati-nextgen_basic_gallery#slideshow/index', $params, $return); 
  34. } else { 
  35. $retval = $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return); 
  36. return $retval; 
  37. /** 
  38. * Enqueues all static resources required by this display type 
  39. * @param C_Displayed_Gallery $displayed_gallery 
  40. */ 
  41. function enqueue_frontend_resources($displayed_gallery) 
  42. wp_register_script('jquery-cycle', $this->get_static_url("photocrati-nextgen_basic_gallery#slideshow/jquery.cycle.all.js"), array('jquery'), NGG_SCRIPT_VERSION); 
  43. wp_enqueue_script('jquery-cycle'); 
  44. wp_enqueue_style('nextgen_basic_slideshow_style', $this->get_static_url('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow.css'), FALSE, NGG_SCRIPT_VERSION); 
  45. wp_enqueue_script('waitforimages', $this->get_static_url('photocrati-nextgen_basic_gallery#slideshow/jquery.waitforimages.js'), array('jquery'), NGG_SCRIPT_VERSION); 
  46. $this->call_parent('enqueue_frontend_resources', $displayed_gallery); 
  47. $this->enqueue_ngg_styles(); 
  48. /** 
  49. * Provides the url of the JavaScript library required for 
  50. * NextGEN Basic Slideshow to display 
  51. * @return string 
  52. */ 
  53. function _get_js_lib_url() 
  54. return $this->get_static_url('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow.js');