A_NextGen_Basic_Gallery_Controller

Class A_NextGen_Basic_Gallery_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_Gallery_Controller extends Mixin 
  2. function index_action($displayed_gallery, $return = FALSE) 
  3. $retval = ''; 
  4. $call_parent = TRUE; 
  5. $show = $this->object->param('show'); 
  6. $pid = $this->object->param('pid'); 
  7. if (!empty($pid) && isset($displayed_gallery->display_settings['use_imagebrowser_effect']) && intval($displayed_gallery->display_settings['use_imagebrowser_effect'])) { 
  8. $show = NGG_BASIC_IMAGEBROWSER; 
  9. // Are we to display a different display type? 
  10. if (!empty($show)) { 
  11. $params = (array) $displayed_gallery->get_entity(); 
  12. $ds = $params['display_settings']; 
  13. if ((!empty($ds['show_slideshow_link']) || !empty($ds['show_thumbnail_link']) || !empty($ds['use_imagebrowser_effect'])) && $show != $this->object->context) { 
  14. // Render the new display type 
  15. $renderer = C_Displayed_Gallery_Renderer::get_instance(); 
  16. $displayed_gallery->original_display_type = $displayed_gallery->display_type; 
  17. $displayed_gallery->original_settings = $displayed_gallery->display_settings; 
  18. $displayed_gallery->display_type = $show; 
  19. $params = (array) $displayed_gallery->get_entity(); 
  20. $params['display_settings'] = array(); 
  21. $retval = $renderer->display_images($params, $return); 
  22. $call_parent = FALSE; 
  23. return $call_parent ? $this->call_parent('index_action', $displayed_gallery, $return) : $retval; 
  24. /** 
  25. * Returns a url to view the displayed gallery using an alternate display 
  26. * type 
  27. * @param C_Displayed_Gallery $displayed_gallery 
  28. * @param string $display_type 
  29. * @return string 
  30. */ 
  31. function get_url_for_alternate_display_type($displayed_gallery, $display_type, $origin_url = FALSE) 
  32. if (!$origin_url && !empty($displayed_gallery->display_settings['original_display_type']) && !empty($_SERVER['ORIG_REQUEST_URI'])) { 
  33. $origin_url = $_SERVER['ORIG_REQUEST_URI']; 
  34. $url = $origin_url ? $origin_url : $this->object->get_routed_url(TRUE); 
  35. $url = $this->object->remove_param_for($url, 'show', $displayed_gallery->id()); 
  36. $url = $this->object->set_param_for($url, 'show', $display_type, $displayed_gallery->id()); 
  37. return $url;