M_NextGen_Other_Options

The NextGEN Gallery M NextGen Other Options class.

Defined (1)

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

/products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php  
  1. class M_NextGen_Other_Options extends C_Base_Module 
  2. function define() 
  3. parent::define( 
  4. 'photocrati-nextgen_other_options',  
  5. 'Other Options',  
  6. 'NextGEN Gallery Others Options Page',  
  7. '0.8',  
  8. 'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',  
  9. 'Photocrati Media',  
  10. 'https://www.imagely.com' 
  11. ); 
  12.  
  13. function _register_hooks() 
  14. add_action('admin_bar_menu', array(&$this, 'add_admin_bar_menu'), 101); 
  15. add_action('init', array(&$this, 'register_forms')); 
  16.  
  17. function register_forms() 
  18. $forms = array( 
  19. 'image_options' => 'A_Image_Options_Form',  
  20. 'thumbnail_options' => 'A_Thumbnail_Options_Form',  
  21. 'lightbox_effects' => 'A_Lightbox_Manager_Form',  
  22. 'watermarks' => 'A_Watermarks_Form' 
  23. ); 
  24.  
  25. if (!is_multisite() || (is_multisite() && C_NextGen_Settings::get_instance()->get('wpmuStyle'))) 
  26. $forms['styles'] = 'A_Styles_Form'; 
  27.  
  28. if (is_super_admin() && (!is_multisite() || (is_multisite() && C_NextGen_Settings::get_instance()->get('wpmuRoles')))) 
  29. $forms['roles_and_capabilities'] = 'A_Roles_Form'; 
  30.  
  31. $forms += array( 
  32. 'miscellaneous' => 'A_Miscellaneous_Form',  
  33. 'reset' => 'A_Reset_Form' 
  34. ); 
  35.  
  36. $form_manager = C_Form_Manager::get_instance(); 
  37. foreach ($forms as $form => $adapter) { 
  38. $form_manager->add_form( 
  39. NGG_OTHER_OPTIONS_SLUG,  
  40. $form 
  41. ); 
  42.  
  43. function add_admin_bar_menu() 
  44. global $wp_admin_bar; 
  45.  
  46. if ( current_user_can('NextGEN Change options') ) { 
  47. $wp_admin_bar->add_menu(array( 
  48. 'parent' => 'ngg-menu',  
  49. 'id' => 'ngg-menu-other_options',  
  50. 'title' => __('Other Options', 'nggallery'),  
  51. 'href' => admin_url('admin.php?page=ngg_other_options') 
  52. )); 
  53.  
  54. function _register_adapters() 
  55. $this->get_registry()->add_adapter('I_Ajax_Controller', 'A_Watermarking_Ajax_Actions'); 
  56. $this->get_registry()->add_adapter('I_Ajax_Controller', 'A_Stylesheet_Ajax_Actions'); 
  57.  
  58. if (is_admin()) { 
  59. $this->get_registry()->add_adapter( 
  60. 'I_Page_Manager',  
  61. 'A_Other_Options_Page' 
  62. ); 
  63.  
  64. $this->get_registry()->add_adapter( 
  65. 'I_Form',  
  66. 'A_Custom_Lightbox_Form',  
  67. 'custom_lightbox' 
  68. ); 
  69.  
  70. $this->get_registry()->add_adapter( 
  71. 'I_Form',  
  72. 'A_Image_Options_Form',  
  73. 'image_options' 
  74. ); 
  75.  
  76. $this->get_registry()->add_adapter( 
  77. 'I_Form',  
  78. 'A_Thumbnail_Options_Form',  
  79. 'thumbnail_options' 
  80. ); 
  81.  
  82. $this->get_registry()->add_adapter( 
  83. 'I_Form',  
  84. 'A_Lightbox_Manager_Form',  
  85. 'lightbox_effects' 
  86. ); 
  87.  
  88. $this->get_registry()->add_adapter( 
  89. 'I_Form',  
  90. 'A_Watermarks_Form',  
  91. 'watermarks' 
  92. ); 
  93.  
  94. $this->get_registry()->add_adapter( 
  95. 'I_Form',  
  96. 'A_Styles_Form',  
  97. 'styles' 
  98. ); 
  99.  
  100. $this->get_registry()->add_adapter( 
  101. 'I_Form',  
  102. 'A_Roles_Form',  
  103. 'roles_and_capabilities' 
  104. ); 
  105.  
  106. $this->get_registry()->add_adapter( 
  107. 'I_Form',  
  108. 'A_Miscellaneous_Form',  
  109. 'miscellaneous' 
  110. ); 
  111.  
  112. $this->get_registry()->add_adapter( 
  113. 'I_Form',  
  114. 'A_Reset_Form',  
  115. 'reset' 
  116. ); 
  117.  
  118. $this->get_registry()->add_adapter( 
  119. 'I_NextGen_Admin_Page',  
  120. 'A_Other_Options_Controller',  
  121. NGG_OTHER_OPTIONS_SLUG 
  122. ); 
  123.  
  124. function get_type_list() 
  125. return array( 
  126. 'A_Image_Options_Form' => 'adapter.image_options_form.php',  
  127. 'A_Lightbox_Manager_Form' => 'adapter.lightbox_manager_form.php',  
  128. 'A_Miscellaneous_Form' => 'adapter.miscellaneous_form.php',  
  129. 'A_Other_Options_Controller' => 'adapter.other_options_controller.php',  
  130. 'A_Other_Options_Page' => 'adapter.other_options_page.php',  
  131. 'A_Reset_Form' => 'adapter.reset_form.php',  
  132. 'A_Roles_Form' => 'adapter.roles_form.php',  
  133. 'A_Styles_Form' => 'adapter.styles_form.php',  
  134. 'A_Thumbnail_Options_Form' => 'adapter.thumbnail_options_form.php',  
  135. 'A_Watermarking_Ajax_Actions' => 'adapter.watermarking_ajax_actions.php',  
  136. 'A_Watermarks_Form' => 'adapter.watermarks_form.php',  
  137. 'A_Stylesheet_Ajax_Actions' => 'adapter.stylesheet_ajax_actions.php',  
  138. 'C_Settings_Model' => 'class.settings_model.php',  
  139. 'A_Custom_Lightbox_Form' => 'adapter.custom_lightbox_form.php',  
  140. 'C_Settings_Model' => 'class.settings_model.php' 
  141. );