A_NextGen_Basic_Tagcloud_Controller

Class A_NextGen_Basic_Tagcloud_Controller.

Defined (1)

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

/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/package.module.nextgen_basic_tagcloud.php  
  1. class A_NextGen_Basic_Tagcloud_Controller extends Mixin 
  2. /** 
  3. * Displays the 'tagcloud' display type 
  4. * @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery 
  5. */ 
  6. public function index_action($displayed_gallery, $return = FALSE) 
  7. $display_settings = $displayed_gallery->display_settings; 
  8. $application = C_Router::get_instance()->get_routed_app(); 
  9. $tag = urldecode($this->param('gallerytag')); 
  10. // we're looking at a tag, so show images w/that tag as a thumbnail gallery 
  11. if (!is_home() && !empty($tag)) { 
  12. return C_Displayed_Gallery_Renderer::get_instance()->display_images(array('source' => 'tags', 'container_ids' => array(esc_attr($tag)), 'display_type' => $display_settings['display_type'], 'original_display_type' => $displayed_gallery->display_type, 'original_settings' => $display_settings)); 
  13. $defaults = array('exclude' => '', 'format' => 'list', 'include' => $displayed_gallery->get_term_ids_for_tags(), 'largest' => 22, 'link' => 'view', 'number' => $display_settings['number'], 'order' => 'ASC', 'orderby' => 'name', 'smallest' => 8, 'taxonomy' => 'ngg_tag', 'unit' => 'pt'); 
  14. $args = wp_parse_args('', $defaults); 
  15. // Always query top tags 
  16. $tags = get_terms($args['taxonomy'], array_merge($args, array('orderby' => 'count', 'order' => 'DESC'))); 
  17. foreach ($tags as $key => $tag) { 
  18. $tags[$key]->link = $this->object->set_param_for($application->get_routed_url(TRUE), 'gallerytag', $tag->slug); 
  19. $tags[$key]->id = $tag->term_id; 
  20. $params = $display_settings; 
  21. $params['inner_content'] = $displayed_gallery->inner_content; 
  22. $params['storage'] =& $storage; 
  23. $params['tagcloud'] = wp_generate_tag_cloud($tags, $args); 
  24. $params['displayed_gallery_id'] = $displayed_gallery->id(); 
  25. $params = $this->object->prepare_display_parameters($displayed_gallery, $params); 
  26. return $this->object->render_partial('photocrati-nextgen_basic_tagcloud#nextgen_basic_tagcloud', $params, $return); 
  27. /** 
  28. * Enqueues all static resources required by this display type 
  29. * @param C_Displayed_Gallery $displayed_gallery 
  30. */ 
  31. public function enqueue_frontend_resources($displayed_gallery) 
  32. $this->call_parent('enqueue_frontend_resources', $displayed_gallery); 
  33. wp_enqueue_style('photocrati-nextgen_basic_tagcloud-style', $this->get_static_url('photocrati-nextgen_basic_tagcloud#nextgen_basic_tagcloud.css'), FALSE, NGG_SCRIPT_VERSION); 
  34. $this->enqueue_ngg_styles();