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