M_NextGen_AddGallery_Page

The NextGEN Gallery M NextGen AddGallery Page class.

Defined (1)

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

/products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php  
  1. class M_NextGen_AddGallery_Page extends C_Base_Module 
  2. function define($id = 'pope-module',  
  3. $name = 'Pope Module',  
  4. $description = '',  
  5. $version = '',  
  6. $uri = '',  
  7. $author = '',  
  8. $author_uri = '',  
  9. $context = FALSE) 
  10. parent::define( 
  11. 'photocrati-nextgen_addgallery_page',  
  12. 'NextGEN Add Gallery Page',  
  13. 'Provides admin page for adding a gallery and uploading images',  
  14. '0.9',  
  15. 'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',  
  16. 'Imagely',  
  17. 'https://www.imagely.com' 
  18. ); 
  19.  
  20. function initialize() 
  21. $forms = C_Form_Manager::get_instance(); 
  22. $settings = C_NextGen_Settings::get_instance(); 
  23. $forms->add_form(NGG_ADD_GALLERY_SLUG, 'upload_images'); 
  24. if (!is_multisite() || (is_multisite() && $settings->get('wpmuImportFolder'))) 
  25. $forms->add_form(NGG_ADD_GALLERY_SLUG, 'import_media_library'); 
  26. $forms->add_form(NGG_ADD_GALLERY_SLUG, 'import_folder'); 
  27.  
  28. function get_type_list() 
  29. return array( 
  30. 'A_Import_Media_Library_Form' => 'adapter.import_media_library_form.php',  
  31. 'A_Import_Folder_Form' => 'adapter.import_folder_form.php',  
  32. 'A_Nextgen_Addgallery_Ajax' => 'adapter.nextgen_addgallery_ajax.php',  
  33. 'A_Nextgen_Addgallery_Controller' => 'adapter.nextgen_addgallery_controller.php',  
  34. 'A_Nextgen_Addgallery_Pages' => 'adapter.nextgen_addgallery_pages.php',  
  35. 'A_Upload_Images_Form' => 'adapter.upload_images_form.php',  
  36. ); 
  37.  
  38. function _register_adapters() 
  39. // AJAX operations aren't admin requests 
  40. $this->get_registry()->add_adapter('I_Ajax_Controller', 'A_NextGen_AddGallery_Ajax'); 
  41.  
  42. if (is_admin()) { 
  43. $this->get_registry()->add_adapter('I_Page_Manager', 'A_NextGen_AddGallery_Pages'); 
  44. $this->get_registry()->add_adapter('I_NextGen_Admin_Page', 'A_NextGen_AddGallery_Controller', NGG_ADD_GALLERY_SLUG); 
  45. $this->get_registry()->add_adapter('I_Form', 'A_Upload_Images_Form', 'upload_images'); 
  46. if (!is_multisite() || (is_multisite() && C_NextGen_Settings::get_instance()->get('wpmuImportFolder'))) 
  47. $this->get_registry()->add_adapter('I_Form', 'A_Import_Folder_Form', 'import_folder'); 
  48. $this->get_registry()->add_adapter('I_Form', 'A_Import_Media_Library_Form', 'import_media_library'); 
  49.  
  50. function _register_hooks() 
  51. add_action('admin_init', array(&$this, 'register_scripts')); 
  52. add_filter('ngg_non_minified_files', array($this, 'do_not_minify'), 10, 2); 
  53.  
  54. // plupload i18n JS should not be minified 
  55. function do_not_minify($path, $module) 
  56. $retval = FALSE; 
  57. if ($module == 'photocrati-nextgen_addgallery_page' && strpos($path, '/i18n/') !== FALSE) 
  58. $retval = TRUE; 
  59. return $retval; 
  60.  
  61. function register_scripts() 
  62. if (is_admin()) 
  63. $router = C_Router::get_instance(); 
  64. wp_register_script( 
  65. 'browserplus',  
  66. $router->get_static_url('photocrati-nextgen_addgallery_page#browserplus-2.4.21.min.js'),  
  67. FALSE,  
  68. NGG_SCRIPT_VERSION 
  69. ); 
  70. wp_register_script( 
  71. 'ngg.plupload.moxie',  
  72. $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/moxie.min.js'),  
  73. FALSE,  
  74. NGG_SCRIPT_VERSION 
  75. ); 
  76. wp_register_script( 
  77. 'ngg.plupload.full',  
  78. $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/plupload.dev.js'),  
  79. array('ngg.plupload.moxie'),  
  80. NGG_SCRIPT_VERSION 
  81. ); 
  82. wp_register_script( 
  83. 'ngg.plupload.queue',  
  84. $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/jquery.plupload.queue/jquery.plupload.queue.min.js'),  
  85. array('ngg.plupload.full'),  
  86. NGG_SCRIPT_VERSION 
  87. ); 
  88. wp_register_style( 
  89. 'ngg.plupload.queue',  
  90. $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/jquery.plupload.queue/css/jquery.plupload.queue.css'),  
  91. FALSE,  
  92. NGG_SCRIPT_VERSION 
  93. ); 
  94. wp_register_style( 
  95. 'nextgen_addgallery_page',  
  96. $router->get_static_url('photocrati-nextgen_addgallery_page#styles.css'),  
  97. FALSE,  
  98. NGG_SCRIPT_VERSION 
  99. ); 
  100. wp_register_script( 
  101. 'jquery.filetree',  
  102. $router->get_static_url('photocrati-nextgen_addgallery_page#jquery.filetree/jquery.filetree.js'),  
  103. array('jquery'),  
  104. NGG_SCRIPT_VERSION 
  105. ); 
  106. wp_register_style( 
  107. 'jquery.filetree',  
  108. $router->get_static_url('photocrati-nextgen_addgallery_page#jquery.filetree/jquery.filetree.css'),  
  109. FALSE,  
  110. NGG_SCRIPT_VERSION 
  111. ); 
  112. wp_register_script( 
  113. 'nextgen_media_library_import-js',  
  114. $router->get_static_url('photocrati-nextgen_addgallery_page#media-library-import.js'),  
  115. array('jquery', 'ngg_progressbar'),  
  116. NGG_SCRIPT_VERSION 
  117. ); 
  118. wp_register_style( 
  119. 'nextgen_media_library_import-css',  
  120. $router->get_static_url('photocrati-nextgen_addgallery_page#media-library-import.css'),  
  121. FALSE,  
  122. NGG_SCRIPT_VERSION 
  123. );