nggGalleryview

The NextGEN Galleryview nggGalleryview class.

Defined (1)

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

/nggGalleryview.php  
  1. class nggGalleryview { 
  2.  
  3. var $plugin_url = false; 
  4.  
  5. function nggGalleryview() { 
  6.  
  7. // Define Plugin URL 
  8. $this->plugin_url = WP_PLUGIN_URL . '/' . plugin_basename( dirname(__FILE__) ) . '/'; 
  9.  
  10. // Load Scripts, Styles, and Templates 
  11. add_action('wp_print_scripts', array(&$this, 'ngg_galleryview_scripts') ); 
  12. add_action('wp_print_styles', array(&$this, 'ngg_galleryview_styles') ); 
  13. add_filter('ngg_render_template', array(&$this, 'add_template'), 10, 2); 
  14.  
  15. // Add our Template 
  16. function add_template( $path, $template_name = false) { 
  17. // Check theme for template first 
  18. if ( file_exists (TEMPLATEPATH . "/nggallery/gallery-galleryview.php")) { 
  19. $template_name == 'gallery-galleryview'; 
  20. $path = TEMPLATEPATH . "/nggallery/gallery-galleryview.php"; 
  21. else { 
  22. $template_name == 'gallery-galleryview'; 
  23. $path = WP_PLUGIN_DIR . '/' . plugin_basename( dirname(__FILE__) ) . '/view/gallery-galleryview.php'; 
  24. return $path; 
  25.  
  26. // GalleryView Styles 
  27. function ngg_galleryview_styles() { 
  28. if ( !is_admin() ) { // we do not want our styles to load in the dashboard 
  29. wp_enqueue_style('galleryview', $this->plugin_url . 'galleryview/css/galleryview.css', false, null, 'all'); 
  30.  
  31. // GalleryView Scripts 
  32. function ngg_galleryview_scripts() { 
  33.  
  34. if ( !is_admin() ) { // we do not want our scripts to load in the dashboard 
  35.  
  36. // Load Jquery 
  37. wp_enqueue_script('jquery'); 
  38.  
  39. // jQuery Easing via CDN 
  40. wp_register_script('jquery-easing', 'http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js', 'jquery', null, false); 
  41. wp_enqueue_script('jquery-easing'); 
  42.  
  43. // jQuery Timers 
  44. wp_register_script('jquery-timers', $this->plugin_url . 'galleryview/js/jquery.timers.js', 'jquery', null, false); 
  45. wp_enqueue_script('jquery-timers'); 
  46.  
  47. // jQuery GalleryView 
  48. wp_register_script('jquery-galleryview', $this->plugin_url . 'galleryview/js/jquery.galleryview.js', array('jquery', 'jquery-timers', 'jquery-easing'), null, false); 
  49. wp_enqueue_script('jquery-galleryview');