M_NextGen_Admin

The NextGEN Gallery M NextGen Admin class.

Defined (1)

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

/products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php  
  1. class M_NextGen_Admin extends C_Base_Module 
  2. /** 
  3. * Defines the module 
  4. */ 
  5. function define($id = 'pope-module',  
  6. $name = 'Pope Module',  
  7. $description = '',  
  8. $version = '',  
  9. $uri = '',  
  10. $author = '',  
  11. $author_uri = '',  
  12. $context = FALSE) 
  13. parent::define( 
  14. 'photocrati-nextgen_admin',  
  15. 'NextGEN Administration',  
  16. 'Provides a framework for adding Administration pages',  
  17. '0.16',  
  18. 'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',  
  19. 'Imagely',  
  20. 'https://www.imagely.com' 
  21. ); 
  22.  
  23. C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Admin_Installer'); 
  24.  
  25. C_NextGen_Settings::get_instance()->add_option_handler('C_NextGen_Admin_Option_Handler', array( 
  26. 'jquery_ui_theme',  
  27. 'jquery_ui_theme_version',  
  28. 'jquery_ui_theme_url' 
  29. )); 
  30. if (is_multisite()) C_NextGen_Global_Settings::get_instance()->add_option_handler('C_NextGen_Admin_Option_Handler', array( 
  31. 'jquery_ui_theme',  
  32. 'jquery_ui_theme_version',  
  33. 'jquery_ui_theme_url' 
  34. )); 
  35.  
  36. /** 
  37. * Register utilities necessary for this module (and the plugin) 
  38. */ 
  39. function _register_utilities() 
  40. // Provides a NextGEN Administation page 
  41. $this->get_registry()->add_utility( 
  42. 'I_NextGen_Admin_Page',  
  43. 'C_NextGen_Admin_Page_Controller' 
  44. ); 
  45.  
  46. $this->get_registry()->add_utility( 
  47. 'I_Page_Manager',  
  48. 'C_Page_Manager' 
  49. ); 
  50.  
  51. // Provides a form manager 
  52. $this->get_registry()->add_utility( 
  53. 'I_Form_Manager',  
  54. 'C_Form_Manager' 
  55. ); 
  56.  
  57. // Provides a form 
  58. $this->get_registry()->add_utility( 
  59. 'I_Form',  
  60. 'C_Form' 
  61. ); 
  62.  
  63. /** 
  64. * Registers adapters required by this module 
  65. */ 
  66. function _register_adapters() 
  67. $this->get_registry()->add_adapter( 
  68. 'I_MVC_Controller',  
  69. 'A_MVC_Validation' 
  70. ); 
  71.  
  72. if (is_admin()) { 
  73. $this->get_registry('I_NextGen_Admin_Page', 'A_Fs_Access_Page', NGG_FS_ACCESS_SLUG); 
  74. $this->get_registry()->add_adapter( 
  75. 'I_Page_Manager',  
  76. 'A_NextGen_Admin_Default_Pages' 
  77. ); 
  78.  
  79. /** 
  80. * Hooks into the WordPress Framework 
  81. */ 
  82. function _register_hooks() 
  83. // Register scripts 
  84. add_action('init', array($this, 'register_scripts'), 9); 
  85.  
  86. // Provides menu options for managing NextGEN Settings 
  87. add_action('admin_menu', array($this, 'add_menu_pages'), 999); 
  88.  
  89. // Define routes 
  90. add_action('ngg_routes', array($this, 'define_routes')); 
  91.  
  92. // Provides admin notices 
  93. $notices = C_Admin_Notification_Manager::get_instance(); 
  94. add_action('init', array($notices, 'serve_ajax_request')); 
  95. add_action('admin_footer', array($notices, 'enqueue_scripts')); 
  96. add_action('do_ngg_notices', array($notices, 'render')); 
  97. add_action('ngg_created_new_gallery', array($this, 'set_review_notice_flag')); 
  98. add_action('ngg_created_new_gallery', get_class().'::update_gallery_count_setting'); 
  99. add_action('ngg_delete_gallery', get_class().'::update_gallery_count_setting'); 
  100. if (!self::is_ngg_legacy_page()) { 
  101. add_action('all_admin_notices', get_class().'::emit_do_notices_action'); 
  102.  
  103. $notices = C_Admin_Notification_Manager::get_instance(); 
  104.  
  105. $php_id = 0; 
  106.  
  107. if (defined('PHP_VERSION_ID')) { 
  108. $php_id = PHP_VERSION_ID; 
  109. else { 
  110. $version = explode('.', PHP_VERSION); 
  111.  
  112. $php_id = ($version[0] * 10000 + $version[1] * 100 + $version[2]); 
  113.  
  114. if ($php_id < 50300) { 
  115. $notices->add("ngg_php52_deprecation", array("message" => __('PHP 5.2 will be deprecated in a future version of NextGEN. Please upgrade your PHP installation to 5.3 or above.', 'nggallery'))); 
  116.  
  117. // Add review notices 
  118. $review_notice_1 = new C_Review_Notice(array( 
  119. 'name' => 'review_level_1',  
  120. 'range' => array('min' => 3, 'max' => 8),  
  121. 'follows' => '') 
  122. ); 
  123. $review_notice_2 = new C_Review_Notice(array( 
  124. 'name' => 'review_level_2',  
  125. 'range' => array('min' => 10, 'max' => 18),  
  126. 'follows' => &$review_notice_1) 
  127. ); 
  128. $review_notice_3 = new C_Review_Notice(array( 
  129. 'name' => 'review_level_3',  
  130. 'range' => array('min' => 20, 'max' => PHP_INT_MAX),  
  131. 'follows' => &$review_notice_2) 
  132. ); 
  133. $notices->add($review_notice_1->get_name(), $review_notice_1); 
  134. $notices->add($review_notice_2->get_name(), $review_notice_2); 
  135. $notices->add($review_notice_3->get_name(), $review_notice_3); 
  136.  
  137. /** 
  138. * Used to determine if the current request is for a NGG legacy page 
  139. * @return bool 
  140. */ 
  141. static function is_ngg_legacy_page() 
  142. return ( 
  143. is_admin() && 
  144. isset($_REQUEST['page']) && 
  145. in_array($_REQUEST['page'], array( 
  146. 'nggallery-manage-gallery',  
  147. 'nggallery-manage-album',  
  148. 'nggallery-tags',  
  149. 'manage-galleries' 
  150. )) 
  151. ); 
  152.  
  153. /** 
  154. * Emits the 'do_ngg_notices' action 
  155. * Used by the notification manager to render all notices 
  156. */ 
  157. static function emit_do_notices_action() 
  158. if (!did_action('do_ngg_notices')) { 
  159. do_action('do_ngg_notices'); 
  160.  
  161. /** 
  162. * We do not want to suddenly ask users for a review when they have upgraded. Instead we will wait for a new 
  163. * gallery to be created and then will we also consider displaying reviews if the gallery count is within range. 
  164. */ 
  165. function set_review_notice_flag() 
  166. $settings = C_NextGen_Settings::get_instance(); 
  167. if (!$settings->get('gallery_created_after_reviews_introduced')) 
  168. $settings->set('gallery_created_after_reviews_introduced', TRUE); 
  169. $settings->save(); 
  170.  
  171. /** 
  172. * Review notifications are pegged to run only when the current gallery count is within a certain range. This 
  173. * updates the 'gallery_count' setting when galleries have been created or deleted. 
  174. */ 
  175. static function update_gallery_count_setting() 
  176. $settings = C_NextGen_Settings::get_instance(); 
  177. $mapper = C_Gallery_Mapper::get_instance(); 
  178. $original_cache_setting = $mapper->__use_cache; 
  179. $mapper->_use_cache = FALSE; 
  180. $gallery_count = C_Gallery_Mapper::get_instance()->count(); 
  181. $mapper->_use_cache = $original_cache_setting; 
  182. $settings->set('gallery_count', $gallery_count); 
  183. $settings->save(); 
  184. return $gallery_count; 
  185.  
  186. function define_routes($router) 
  187. // TODO: Why is this in the nextgen-admin module? Shouldn't it be in the other options module? 
  188. $router->create_app('/nextgen-settings') 
  189. ->route('/update_watermark_preview', 'I_Settings_Manager_Controller#watermark_update'); 
  190.  
  191. function register_scripts() 
  192. $router = C_Router::get_instance(); 
  193. wp_register_script( 
  194. 'gritter',  
  195. $router->get_static_url('photocrati-nextgen_admin#gritter/gritter.min.js'),  
  196. array('jquery'),  
  197. NGG_SCRIPT_VERSION 
  198. ); 
  199. wp_register_style( 
  200. 'gritter',  
  201. $router->get_static_url('photocrati-nextgen_admin#gritter/css/gritter.css'),  
  202. FALSE,  
  203. NGG_SCRIPT_VERSION 
  204. ); 
  205. wp_register_script( 
  206. 'ngg_progressbar',  
  207. $router->get_static_url('photocrati-nextgen_admin#ngg_progressbar.js'),  
  208. array('gritter'),  
  209. NGG_SCRIPT_VERSION 
  210. ); 
  211. wp_register_style( 
  212. 'ngg_progressbar',  
  213. $router->get_static_url('photocrati-nextgen_admin#ngg_progressbar.css'),  
  214. array('gritter'),  
  215. NGG_SCRIPT_VERSION 
  216. ); 
  217. wp_register_style( 
  218. 'ngg_select2',  
  219. $router->get_static_url('photocrati-nextgen_admin#select2/select2.css'),  
  220. FALSE,  
  221. NGG_SCRIPT_VERSION 
  222. ); 
  223. wp_register_script( 
  224. 'ngg_select2',  
  225. $router->get_static_url('photocrati-nextgen_admin#select2/select2.modded.js'),  
  226. FALSE,  
  227. NGG_SCRIPT_VERSION 
  228. ); 
  229. wp_register_script( 
  230. 'jquery.nextgen_radio_toggle',  
  231. $router->get_static_url('photocrati-nextgen_admin#jquery.nextgen_radio_toggle.js'),  
  232. array('jquery'),  
  233. NGG_SCRIPT_VERSION 
  234. ); 
  235.  
  236. if (preg_match("#/wp-admin/post(-new)?.php#", $_SERVER['REQUEST_URI'])) 
  237. wp_enqueue_script('ngg_progressbar'); 
  238. wp_enqueue_style('ngg_progressbar'); 
  239.  
  240. wp_register_style( 
  241. 'ngg-jquery-ui',  
  242. $router->get_static_url('photocrati-nextgen_admin#jquery-ui/jquery-ui-1.10.4.custom.css'),  
  243. FALSE,  
  244. NGG_SCRIPT_VERSION 
  245. ); 
  246.  
  247. $this->enqueue_wizard_components(); 
  248.  
  249. function init_wizards() 
  250. $wizards = C_NextGEN_Wizard_Manager::get_instance(); 
  251. $wizards->set_starter(__('Do you need help with NextGEN?', 'nggallery')); 
  252. $wizards->set_active(false); 
  253.  
  254. // Add gallery creation wizard for new users 
  255. $wizard = $wizards->add_wizard('nextgen.beginner.gallery_creation'); 
  256. $wizard->add_step('start'); 
  257. $wizard->set_step_text('start', __('Hello, it looks like you don\'t have any galleries, this wizard will guide you through creating your first gallery.', 'nggallery')); 
  258. $wizard->set_step_view('start', 'a.toplevel_page_nextgen-gallery'); 
  259. $wizard->add_step('gallery_menu'); 
  260. $wizard->set_step_text('gallery_menu', __('Click on the Gallery menu to access NextGEN\'s functionality.', 'nggallery')); 
  261. $wizard->set_step_target('gallery_menu', 'a.toplevel_page_nextgen-gallery', 'right center', 'left center'); 
  262. $wizard->set_step_view('gallery_menu', 'a.toplevel_page_nextgen-gallery'); 
  263. $wizard->add_step('add_gallery_menu'); 
  264. $wizard->set_step_text('add_gallery_menu', __('Click on the "Add Gallery / Images" menu to create new galleries with images.', 'nggallery')); 
  265. $wizard->set_step_target('add_gallery_menu', 'a[href*="admin.php?page=ngg_addgallery"]', 'right center', 'left center'); 
  266. $wizard->set_step_view('add_gallery_menu', 'a[href*="admin.php?page=ngg_addgallery"]'); 
  267. $wizard->add_step('input_gallery_name'); 
  268. $wizard->set_step_text('input_gallery_name', __('Select a name for your gallery.', 'nggallery')); 
  269. $wizard->set_step_target('input_gallery_name', 'input#gallery_name', 'bottom center', 'top center'); 
  270. $wizard->set_step_target_wait('input_gallery_name', '5'); 
  271. $wizard->set_step_view('input_gallery_name', 'input#gallery_name'); 
  272. $wizard->add_step('select_images'); 
  273. $wizard->set_step_text('select_images', __('Now click the "Add Files" button and select some images to add to the gallery.', 'nggallery')); 
  274. $wizard->set_step_target('select_images', 'a#uploader_browse', 'right center', 'left center'); 
  275. $wizard->set_step_target_wait('select_images', '5'); 
  276. $wizard->set_step_view('select_images', 'a#uploader_browse'); 
  277. $wizard->add_step('upload_images'); 
  278. $wizard->set_step_text('upload_images', __('Now click the "Start Upload" button to begin the upload process.', 'nggallery')); 
  279. $wizard->set_step_target('upload_images', 'a#uploader_upload', 'right center', 'left center'); 
  280. $wizard->set_step_target_wait('upload_images', '5'); 
  281. $wizard->set_step_view('upload_images', 'a#uploader_upload'); 
  282. $wizard->add_step('finish'); 
  283. $wizard->set_step_text('finish', __('Congratulations! You just created your first gallery.', 'nggallery')); 
  284.  
  285. $wizard = $wizards->add_wizard('nextgen.beginner.gallery_creation_igw'); 
  286. $wizard->add_step('start'); 
  287. $wizard->set_step_text('start', __('Hello, this wizard will guide you through creating a NextGEN gallery and inserting it into a page. Click "Next step" to proceed.', 'nggallery')); 
  288. $wizard->add_step('pages_menu'); 
  289. $wizard->set_step_text('pages_menu', __('Click on "Pages" to access your WordPress pages.', 'nggallery')); 
  290. $wizard->set_step_target('pages_menu', '#menu-pages a.menu-top', 'right center', 'left center'); 
  291. $wizard->set_step_view('pages_menu', '#menu-pages a.menu-top'); 
  292. $wizard->add_step('add_page_menu'); 
  293. $wizard->set_step_text('add_page_menu', __('Click "Add New" to create a new page.', 'nggallery')); 
  294. $wizard->set_step_target('add_page_menu', '#menu-pages a[href*="post-new.php?post_type=page"]', 'right center', 'left center'); 
  295. $wizard->set_step_view('add_page_menu', '#menu-pages a[href*="post-new.php?post_type=page"]'); 
  296. $wizard->add_step('input_page_title'); 
  297. $wizard->set_step_text('input_page_title', __('Type in a title for your page.', 'nggallery')); 
  298. $wizard->set_step_target('input_page_title', 'input#title', 'bottom center', 'top center'); 
  299. $wizard->set_step_view('input_page_title', 'input#title'); 
  300. $wizard->add_step('add_gallery_button'); 
  301. $wizard->set_step_text('add_gallery_button', __('Now click the "Add Gallery" button to open NextGEN\'s Insert Gallery Window (IGW).', 'nggallery')); 
  302. $wizard->set_step_target('add_gallery_button', 'a#ngg-media-button', 'right center', 'left center'); 
  303. $wizard->set_step_view('add_gallery_button', 'a#ngg-media-button'); 
  304. $wizard->add_step('add_gallery_tab'); 
  305. $wizard->set_step_text('add_gallery_tab', __('Now click the "Add Gallery / Images" tab to add a new gallery.', 'nggallery')); 
  306. $wizard->set_step_target('add_gallery_tab', '#attach_to_post_tabs a#ui-id-2', 'bottom center', 'top center'); 
  307. $wizard->set_step_view('add_gallery_tab', '#attach_to_post_tabs a#ui-id-2'); 
  308. $wizard->set_step_context('add_gallery_tab', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]'); 
  309. $wizard->set_step_lazy('add_gallery_tab', true); 
  310. $wizard->set_step_condition('add_gallery_tab', 'nextgen_event', 'plupload_init', null, 10000); 
  311. $wizard->add_step('input_gallery_name'); 
  312. $wizard->set_step_text('input_gallery_name', __('Select a name for your gallery.', 'nggallery')); 
  313. $wizard->set_step_target('input_gallery_name', 'input#gallery_name:visible', 'bottom center', 'top center'); 
  314. $wizard->set_step_view('input_gallery_name', 'input#gallery_name'); 
  315. $wizard->set_step_context('input_gallery_name', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab')); 
  316. $wizard->set_step_lazy('input_gallery_name', true); 
  317. $wizard->add_step('select_images'); 
  318. $wizard->set_step_text('select_images', __('Now click the "Add Files" button and select some images to add to the gallery.', 'nggallery')); 
  319. $wizard->set_step_target('select_images', 'a#uploader_browse', 'right center', 'left center'); 
  320. $wizard->set_step_view('select_images', 'a#uploader_browse'); 
  321. $wizard->set_step_context('select_images', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab')); 
  322. $wizard->set_step_lazy('select_images', true); 
  323. $wizard->add_step('upload_images'); 
  324. $wizard->set_step_text('upload_images', __('Now click the "Start Upload" button to begin the upload process.', 'nggallery')); 
  325. $wizard->set_step_target('upload_images', 'a#uploader_upload', 'right center', 'left center'); 
  326. $wizard->set_step_view('upload_images', 'a#uploader_upload'); 
  327. $wizard->set_step_context('upload_images', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab')); 
  328. $wizard->set_step_lazy('upload_images', true); 
  329. $wizard->set_step_condition('upload_images', 'plupload_bind', 'UploadComplete', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab', '#uploader')); 
  330. $wizard->add_step('display_gallery_tab'); 
  331. $wizard->set_step_text('display_gallery_tab', __('Congratulations! You just created your first gallery. Now let\'s insert it into the page. Click the "Display Galleries" tab.', 'nggallery')); 
  332. $wizard->set_step_target('display_gallery_tab', '#attach_to_post_tabs a#ui-id-1', 'bottom center', 'top center'); 
  333. $wizard->set_step_view('display_gallery_tab', '#attach_to_post_tabs a#ui-id-1'); 
  334. $wizard->set_step_context('display_gallery_tab', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]'); 
  335. $wizard->set_step_lazy('display_gallery_tab', true); 
  336. $wizard->set_step_condition('display_gallery_tab', 'wait', '500'); 
  337. $wizard->add_step('display_type_select'); 
  338. $wizard->set_step_text('display_type_select', __('Click on the "NextGEN Basic Slideshow" radio button to select the display type for the gallery.', 'nggallery')); 
  339. $wizard->set_step_target('display_type_select', '.display_type_preview input[value="photocrati-nextgen_basic_slideshow"]', 'bottom center', 'top center'); 
  340. $wizard->set_step_view('display_type_select', '.display_type_preview input[type="radio"]'); 
  341. $wizard->set_step_context('display_type_select', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]'); 
  342. $wizard->set_step_lazy('display_type_select', true); 
  343. $wizard->add_step('display_accordion_close'); 
  344. $wizard->set_step_text('display_accordion_close', __('Now let\'s specify which gallery to display. Start by clicking on the "Select a display type" section header to collapse it.', 'nggallery')); 
  345. $wizard->set_step_target('display_accordion_close', '#displayed_tab #display_type_tab', 'bottom center', 'top center'); 
  346. $wizard->set_step_view('display_accordion_close', '#displayed_tab #display_type_tab'); 
  347. $wizard->set_step_context('display_accordion_close', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]'); 
  348. $wizard->set_step_lazy('display_accordion_close', true); 
  349. $wizard->set_step_condition('display_accordion_close', 'wait', '1000'); 
  350. $wizard->add_step('source_accordion_open'); 
  351. $wizard->set_step_text('source_accordion_open', __('Now click on the "What would you like to display?" section\'s header to expand it.', 'nggallery')); 
  352. $wizard->set_step_target('source_accordion_open', '#displayed_tab #source_tab', 'bottom center', 'top center'); 
  353. $wizard->set_step_view('source_accordion_open', '#displayed_tab #source_tab'); 
  354. $wizard->set_step_context('source_accordion_open', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]'); 
  355. $wizard->set_step_lazy('source_accordion_open', true); 
  356. $wizard->set_step_condition('source_accordion_open', 'wait', '1000'); 
  357. $wizard->add_step('source_select'); 
  358. $wizard->set_step_text('source_select', __('Now click inside the "Galleries" field and select your gallery.', 'nggallery')); 
  359. $wizard->set_step_target('source_select', '#source_configuration .galleries_column .select2-container input', 'right center', 'left center'); 
  360. $wizard->set_step_view('source_select', '#source_configuration .galleries_column select'); 
  361. $wizard->set_step_context('source_select', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]'); 
  362. $wizard->set_step_lazy('source_select', true); 
  363. $wizard->add_step('insert_gallery'); 
  364. $wizard->set_step_text('insert_gallery', __('Now click on the "Insert Displayed Gallery" button to insert the gallery in your page.', 'nggallery')); 
  365. $wizard->set_step_target('insert_gallery', '#displayed_tab #save_displayed_gallery', 'right center', 'left center'); 
  366. $wizard->set_step_view('insert_gallery', '#displayed_tab #save_displayed_gallery'); 
  367. $wizard->set_step_context('insert_gallery', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]'); 
  368. $wizard->set_step_lazy('insert_gallery', true); 
  369. $wizard->set_step_condition('insert_gallery', 'wait', '1000'); 
  370. $wizard->add_step('finish'); 
  371. $wizard->set_step_text('finish', __('Congratulations! You just created your first gallery. You can now click the "Publish" button on the right to publish your page.', 'nggallery')); 
  372.  
  373. // adjust wizards state based on query/parameters 
  374. $wizards->handle_wizard_query(); 
  375.  
  376. global $ngg_fs; 
  377. // make sure we don't trigger the wizards if NGG Fremius is running or this is an AJAX request 
  378. if (isset($_REQUEST['ngg_dismiss_notice']) || (is_admin() && !M_Attach_To_Post::is_atp_url() && !isset($_REQUEST['attach_to_post']) && (!isset($ngg_fs) || !$ngg_fs->is_activation_mode()) && (!defined('DOING_AJAX') || !DOING_AJAX))) { 
  379. $wizards->set_active(true); 
  380.  
  381. // before adding notices or activating individual wizards, ensure wizards are globally enabled and no wizard is currently running already 
  382. if ($wizards->is_active() && $wizards->get_running_wizard() == null) { 
  383. // add notice for gallery creation wizard 
  384. $wizard = $wizards->get_wizard('nextgen.beginner.gallery_creation_igw'); 
  385.  
  386. if (!$wizard->is_completed() && !$wizard->is_cancelled()) { 
  387. $mapper = C_Gallery_Mapper::get_instance(); 
  388. if ($mapper->count() == 0) { 
  389. $wizard->set_active(true); 
  390. $notices = C_Admin_Notification_Manager::get_instance(); 
  391. $notices->add('ngg_wizard_' . $wizard->get_id(), array("message" => __('Thanks for installing NextGEN Gallery! Want help creating your first gallery?', 'nggallery') . ' <a data-ngg-wizard="' . $wizard->get_id() . '" class="ngg-wizard-invoker" href="' . esc_url(add_query_arg('ngg_wizard', $wizard->get_id())) . '">' . __('Launch the Gallery Wizard', 'nggallery') . '</a>. ' . __('If you close this message, you can also launch the Gallery Wizard at any time from the', 'nggallery') . ' <a href="' . esc_url(admin_url('admin.php?page=nextgen-gallery')) . '">' . __('NextGEN Overview page', 'nggallery') . '</a>.')); 
  392. else if (isset($_GET['page']) && $_GET['page'] == 'nextgen-gallery') { 
  393. $wizard->set_active(true); 
  394.  
  395. function enqueue_wizard_components() 
  396. $router = C_Router::get_instance(); 
  397.  
  398. // Wizards related scripts/styles 
  399. wp_register_style( 
  400. 'bootstrap-tooltip',  
  401. $router->get_static_url('photocrati-nextgen_admin#bootstrap/css/bootstrap-tooltip.css'),  
  402. FALSE,  
  403. NGG_SCRIPT_VERSION 
  404. ); 
  405.  
  406. wp_register_script( 
  407. 'tourist',  
  408. $router->get_static_url('photocrati-nextgen_admin#tourist/tourist.js'),  
  409. array('jquery', 'backbone'),  
  410. NGG_SCRIPT_VERSION 
  411. ); 
  412. wp_register_style( 
  413. 'tourist',  
  414. $router->get_static_url('photocrati-nextgen_admin#tourist/tourist.css'),  
  415. array('bootstrap-tooltip'),  
  416. NGG_SCRIPT_VERSION 
  417. ); 
  418. wp_register_script( 
  419. 'ngg-wizards',  
  420. $router->get_static_url('photocrati-nextgen_admin#nextgen_wizards.js'),  
  421. array('tourist'),  
  422. NGG_SCRIPT_VERSION,  
  423. true 
  424. ); 
  425. wp_register_style( 
  426. 'ngg-wizards',  
  427. $router->get_static_url('photocrati-nextgen_admin#nextgen_wizards.css'),  
  428. array('tourist'),  
  429. NGG_SCRIPT_VERSION 
  430. ); 
  431.  
  432. $wizards = C_NextGEN_Wizard_Manager::get_instance(); 
  433. $wizard = $wizards->get_next_wizard(); 
  434.  
  435. if ($wizards->is_active() && $wizard != null) { 
  436. $data = array(); 
  437. $data['starter'] = array('text' => $wizards->get_starter(), 'image' => $router->get_static_url('photocrati-nextgen_admin#wizard_starter_icon.png')); 
  438. $running_wizard = $wizards->get_running_wizard(); 
  439. $data['running_wizard'] = $running_wizard != null ? $running_wizard->get_id() : null; 
  440. $data['wizard_list'] = array($wizard->toData()); 
  441. wp_localize_script('ngg-wizards', 'NextGEN_Wizard_Manager_State', $data); 
  442. if (method_exists('M_Gallery_Display', 'enqueue_fontawesome')) 
  443. M_Gallery_Display::enqueue_fontawesome(); 
  444.  
  445. wp_enqueue_style('ngg-wizards'); 
  446. wp_enqueue_script('ngg-wizards'); 
  447. }; 
  448.  
  449. function initialize() 
  450. $this->init_wizards(); 
  451.  
  452. /** 
  453. * Adds menu pages to manage NextGen Settings 
  454. * @uses action: admin_menu 
  455. */ 
  456. function add_menu_pages() 
  457. C_Page_Manager::get_instance()->setup(); 
  458.  
  459. function get_type_list() 
  460. return array( 
  461. 'A_Fs_Access_Page' => 'adapter.fs_access_page.php',  
  462. 'A_MVC_Validation' => 'adapter.mvc_validation.php',  
  463. 'C_Nextgen_Admin_Installer' => 'class.nextgen_admin_installer.php',  
  464. 'A_Nextgen_Admin_Default_Pages' => 'adapter.nextgen_admin_default_pages.php',  
  465. 'A_Nextgen_Settings_Routes' => 'adapter.nextgen_settings_routes.php',  
  466. 'C_Form' => 'class.form.php',  
  467. 'C_Form_Manager' => 'class.form_manager.php',  
  468. 'C_Nextgen_Admin_Page_Controller' => 'class.nextgen_admin_page_controller.php',  
  469. 'C_Page_Manager' => 'class.page_manager.php',  
  470. 'C_Admin_Notification_Manager' => 'class.admin_notification_manager.php',  
  471. 'C_NextGEN_Wizard_Manager' => 'class.nextgen_wizard_manager.php',  
  472. );