P_Photocrati_NextGen

The NextGEN Gallery P Photocrati NextGen class.

Defined (1)

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

/products/photocrati_nextgen/product.photocrati_nextgen.php  
  1. class P_Photocrati_NextGen extends C_Base_Product 
  2. static $modules_provided = array( 
  3. 'photocrati-fs' => 'always',  
  4. 'photocrati-i18n' => 'always',  
  5. 'photocrati-validation' => 'always',  
  6. 'photocrati-router' => 'always',  
  7. 'photocrati-wordpress_routing' => 'always',  
  8. 'photocrati-security' => 'always',  
  9. 'photocrati-nextgen_settings' => 'always',  
  10. 'photocrati-mvc' => 'always',  
  11. 'photocrati-ajax' => 'always',  
  12. 'photocrati-datamapper' => 'always',  
  13. 'photocrati-nextgen-legacy' => 'always',  
  14. 'photocrati-nextgen-data' => 'always',  
  15.  
  16. // We should look at how to make the modules below only 
  17. // require loading in wp-admin 
  18. 'photocrati-dynamic_thumbnails' => 'always',  
  19. 'photocrati-nextgen_admin' => 'always',  
  20. 'photocrati-nextgen_gallery_display' => 'always',  
  21. 'photocrati-frame_communication' => 'always',  
  22. 'photocrati-attach_to_post' => 'always',  
  23. 'photocrati-nextgen_addgallery_page' => 'always',  
  24. 'photocrati-nextgen_other_options' => 'always',  
  25. 'photocrati-nextgen_pagination' => 'always',  
  26.  
  27. // Front-end only 
  28. 'photocrati-dynamic_stylesheet' => 'frontend',  
  29.  
  30. // Backend-only 
  31. 'photocrati-nextgen_pro_upgrade' => 'backend',  
  32.  
  33. 'photocrati-cache' => 'always',  
  34. 'photocrati-lightbox' => 'always',  
  35. 'photocrati-nextgen_basic_templates' => 'always',  
  36. 'photocrati-nextgen_basic_gallery' => 'always',  
  37. 'photocrati-nextgen_basic_imagebrowser' => 'always',  
  38. 'photocrati-nextgen_basic_singlepic' => 'always',  
  39. 'photocrati-nextgen_basic_tagcloud' => 'always',  
  40. 'photocrati-nextgen_basic_album' => 'always',  
  41. 'photocrati-widget' => 'always',  
  42. 'photocrati-third_party_compat' => 'always',  
  43. 'photocrati-nextgen_xmlrpc' => 'always',  
  44. 'photocrati-wpcli' => 'always' 
  45. ); 
  46.  
  47. function get_modules_provided() 
  48. return array_keys(self::$modules_provided); 
  49.  
  50. function get_modules_to_load() 
  51. $retval = array(); 
  52.  
  53. foreach (self::$modules_provided as $module_name => $condition) { 
  54. switch ($condition) { 
  55. case 'always': 
  56. $retval[] = $module_name; 
  57. break; 
  58. case 'backend': 
  59. if (is_admin()) 
  60. $retval[] = $module_name; 
  61. break; 
  62. case 'frontend': 
  63. if (!is_admin()) 
  64. $retval[] = $module_name; 
  65. break; 
  66.  
  67. $retval = apply_filters('ngg_get_modules_to_load', $retval, self::$modules_provided); 
  68.  
  69. return $retval; 
  70.  
  71. function define($id = 'pope-product',  
  72. $name = 'Pope Product',  
  73. $description = '',  
  74. $version = '',  
  75. $uri = '',  
  76. $author = '',  
  77. $author_uri = '',  
  78. $context = FALSE) 
  79. parent::define( 
  80. 'photocrati-nextgen',  
  81. 'NextGen Gallery',  
  82. 'NextGen Gallery',  
  83. NGG_PLUGIN_VERSION,  
  84. 'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',  
  85. 'Imagely',  
  86. 'https://www.imagely.com' 
  87. ); 
  88.  
  89. $module_path = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'modules')); 
  90. $this->get_registry()->set_product_module_path($this->module_id, $module_path); 
  91. foreach ($this->get_modules_to_load() as $module_name) $this->_get_registry()->load_module($module_name); 
  92.  
  93. include_once('class.nextgen_product_installer.php'); 
  94. C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Product_Installer');