NextGEN Gallery – WordPress Gallery Plugin - Version 2.0.21

Version Description

  • 09.09.2013 =
  • NEW: Multisite support
  • Changed: Default image quality set to 100 for generated images
  • Changed: Removed dependence on simplehtmldom library
  • Fixed: Related images functionality works as it did in 1.9.x
  • Fixed: Don't compress inline JavaScript in post/page content
  • Fixed: Click-to-advance slideshow behavior for slideshows
  • Fixed: Security warnings from VaultPress
  • Fixed: View as Slideshow link works with AJAX pagination
  • Fixed: Broken links on Overview page
  • Fixed: Backup images option
  • Fixed: Stylesheet url generated correctly for Windows hosts
  • Fixed: Compatibility with NextGen Custom Fields plugin
  • Fixed: Compatibility with Adsense Explosion plugin
  • Fixed: Suppress wp_footer notices unless WP_DEBUG is set to TRUE
Download this release

Release Info

Developer photocrati
Plugin Icon 128x128 NextGEN Gallery – WordPress Gallery Plugin
Version 2.0.21
Comparing to
See all releases

Code changes from version 2.0.17 to 2.0.21

Files changed (62) hide show
  1. changelog.txt +16 -0
  2. nggallery.php +2 -2
  3. non_pope/class.nextgen_settings.php +5 -7
  4. non_pope/class.nextgen_style_manager.php +8 -1
  5. non_pope/class.photocrati_installer.php +63 -9
  6. non_pope/class.photocrati_resource_manager.php +7 -3
  7. non_pope/class.photocrati_settings_manager.php +1 -1
  8. products/photocrati_nextgen/modules/ajax/class.ajax_installer.php +1 -1
  9. products/photocrati_nextgen/modules/ajax/module.ajax.php +2 -2
  10. products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php +1 -1
  11. products/photocrati_nextgen/modules/attach_to_post/class.attach_to_post_installer.php +1 -1
  12. products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php +38 -61
  13. products/photocrati_nextgen/modules/datamapper/class.datamapper_installer.php +1 -1
  14. products/photocrati_nextgen/modules/dynamic_stylesheet/class.dynamic_stylesheet_controller.php +1 -1
  15. products/photocrati_nextgen/modules/dynamic_stylesheet/class.dynamic_stylesheet_installer.php +1 -1
  16. products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_installer.php +1 -1
  17. products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_manager.php +1 -1
  18. products/photocrati_nextgen/modules/frame_communication/class.frame_communication_installer.php +1 -1
  19. products/photocrati_nextgen/modules/frame_communication/class.frame_event_publisher.php +1 -1
  20. products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/nextgen_lightbox_init.js +6 -3
  21. products/photocrati_nextgen/modules/mvc/adapter.mvc_fs.php +1 -1
  22. products/photocrati_nextgen/modules/mvc/class.mvc_installer.php +1 -1
  23. products/photocrati_nextgen/modules/mvc/class.mvc_view.php +1 -1
  24. products/photocrati_nextgen/modules/mvc/module.mvc.php +2 -2
  25. products/photocrati_nextgen/modules/mvc/templates/index.php +1 -1
  26. products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_forms.php +7 -9
  27. products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.upload_images_form.php +8 -4
  28. products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_installer.php +1 -1
  29. products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php +1 -1
  30. products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php +1 -1
  31. products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_controller.php +1 -1
  32. products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_routes.php +1 -1
  33. products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.ajax_pagination_actions.php +4 -0
  34. products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_routes.php +1 -1
  35. products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_urls.php +1 -1
  36. products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnails_controller.php +5 -2
  37. products/photocrati_nextgen/modules/nextgen_basic_gallery/mixin.nextgen_basic_gallery_controller.php +2 -2
  38. products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.js +1 -0
  39. products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_controller.php +0 -1
  40. products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_routes.php +1 -1
  41. products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_routes.php +1 -1
  42. products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_urls.php +1 -1
  43. products/photocrati_nextgen/modules/nextgen_data/class.gallery_storage.php +1 -1
  44. products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php +1 -0
  45. products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper.php +1 -2
  46. products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php +1 -0
  47. products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.displayed_gallery_related_element.php +0 -114
  48. products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php +1 -1
  49. products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php +69 -2
  50. products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_related_images.css +22 -0
  51. products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_forms.php +17 -8
  52. products/photocrati_nextgen/modules/nextgen_other_options/class.settings_model.php +1 -1
  53. products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php +4 -4
  54. products/photocrati_nextgen/modules/nextgen_settings/class.nextgen_settings_installer.php +44 -17
  55. products/photocrati_nextgen/modules/ngglegacy/admin/admin.php +2 -2
  56. products/photocrati_nextgen/modules/ngglegacy/admin/overview.php +2 -2
  57. products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php +5 -5
  58. products/photocrati_nextgen/modules/router/class.router_installer.php +2 -2
  59. products/photocrati_nextgen/modules/router/class.routing_app.php +1 -1
  60. products/photocrati_nextgen/modules/router/mixin.url_manipulation.php +1 -1
  61. products/photocrati_nextgen/product.photocrati_nextgen.php +2 -2
  62. readme.txt +16 -0
changelog.txt CHANGED
@@ -1,6 +1,22 @@
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  = V2.0.17 - 08.30.2013 =
5
  Fixed: Match legacy behaviour when changing gallery path, i.e. don't move files
6
 
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
4
+ = V2.0.21 - 09.09.2013 =
5
+ * NEW: Multisite support
6
+ * Changed: Default image quality set to 100 for generated images
7
+ * Changed: Removed dependence on simplehtmldom library
8
+ * Fixed: Related images functionality works as it did in 1.9.x
9
+ * Fixed: Don't compress inline JavaScript in post/page content
10
+ * Fixed: Click-to-advance slideshow behavior for slideshows
11
+ * Fixed: Security warnings from VaultPress
12
+ * Fixed: View as Slideshow link works with AJAX pagination
13
+ * Fixed: Broken links on Overview page
14
+ * Fixed: Backup images option
15
+ * Fixed: Stylesheet url generated correctly for Windows hosts
16
+ * Fixed: Compatibility with NextGen Custom Fields plugin
17
+ * Fixed: Compatibility with Adsense Explosion plugin
18
+ * Fixed: Suppress wp_footer notices unless WP_DEBUG is set to TRUE
19
+
20
  = V2.0.17 - 08.30.2013 =
21
  Fixed: Match legacy behaviour when changing gallery path, i.e. don't move files
22
 
nggallery.php CHANGED
@@ -4,7 +4,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
4
  /**
5
  * Plugin Name: NextGEN Gallery by Photocrati
6
  * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 7 million downloads.
7
- * Version: 2.0.17
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
@@ -315,7 +315,7 @@ class C_NextGEN_Bootstrap
315
  define('NEXTGEN_GALLERY_MODULE_URL', path_join(NEXTGEN_GALLERY_PRODUCT_URL, 'photocrati_nextgen/modules'));
316
  define('NEXTGEN_GALLERY_PLUGIN_CLASS', path_join(NEXTGEN_GALLERY_PLUGIN_DIR, 'module.NEXTGEN_GALLERY_PLUGIN.php'));
317
  define('NEXTGEN_GALLERY_PLUGIN_STARTED_AT', microtime());
318
- define('NEXTGEN_GALLERY_PLUGIN_VERSION', '2.0.17');
319
  }
320
 
321
 
4
  /**
5
  * Plugin Name: NextGEN Gallery by Photocrati
6
  * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 7 million downloads.
7
+ * Version: 2.0.21
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
315
  define('NEXTGEN_GALLERY_MODULE_URL', path_join(NEXTGEN_GALLERY_PRODUCT_URL, 'photocrati_nextgen/modules'));
316
  define('NEXTGEN_GALLERY_PLUGIN_CLASS', path_join(NEXTGEN_GALLERY_PLUGIN_DIR, 'module.NEXTGEN_GALLERY_PLUGIN.php'));
317
  define('NEXTGEN_GALLERY_PLUGIN_STARTED_AT', microtime());
318
+ define('NEXTGEN_GALLERY_PLUGIN_VERSION', '2.0.21');
319
  }
320
 
321
 
non_pope/class.nextgen_settings.php CHANGED
@@ -5,7 +5,7 @@ if (!class_exists('C_NextGen_Settings')) {
5
  class C_NextGen_Settings {
6
  static function get_instance()
7
  {
8
- return C_Photocrati_Settings_Manager::get_instance();
9
  }
10
 
11
  static function add_option_handler($klass, $options=array())
@@ -20,12 +20,10 @@ if (!class_exists('C_NextGen_Global_Settings')) {
20
  class C_NextGen_Global_Settings extends C_NextGen_Settings {
21
  static function get_instance()
22
  {
23
- if (is_multisite()) {
24
- return C_Photocrati_Global_Settings_Manager::get_instance();
25
- }
26
- else {
27
- return C_Photocrati_Settings_Manager::get_instance();
28
- }
29
  }
30
  }
31
  }
5
  class C_NextGen_Settings {
6
  static function get_instance()
7
  {
8
+ return C_Photocrati_Settings_Manager::get_instance();
9
  }
10
 
11
  static function add_option_handler($klass, $options=array())
20
  class C_NextGen_Global_Settings extends C_NextGen_Settings {
21
  static function get_instance()
22
  {
23
+ if (is_multisite())
24
+ return C_Photocrati_Global_Settings_Manager::get_instance();
25
+ else
26
+ return C_Photocrati_Settings_Manager::get_instance();
 
 
27
  }
28
  }
29
  }
non_pope/class.nextgen_style_manager.php CHANGED
@@ -147,7 +147,14 @@ class C_NextGen_Style_Manager
147
  */
148
  function get_selected_stylesheet()
149
  {
150
- return C_NextGen_Settings::get_instance()->get('CSSfile', 'nggallery.css');
 
 
 
 
 
 
 
151
  }
152
 
153
  /**
147
  */
148
  function get_selected_stylesheet()
149
  {
150
+ $settings = C_NextGen_Settings::get_instance();
151
+
152
+ // use the same css resource for all subsites when wpmuStyle=true
153
+ if (!is_multisite() || (is_multisite() && $settings->get('wpmuStyle')))
154
+ return $settings->get('CSSfile', 'nggallery.css');
155
+ else
156
+ return C_Nextgen_Global_Settings::get_instance()->get('wpmuCSSfile');
157
+
158
  }
159
 
160
  /**
non_pope/class.photocrati_installer.php CHANGED
@@ -54,20 +54,53 @@ if (!class_exists('C_Photocrati_Installer'))
54
  if (method_exists($handler, 'uninstall')) return $handler->uninstall($hard);
55
 
56
  if ($hard) {
57
- C_NextGen_Global_Settings::get_instance()->destroy();
58
  C_NextGen_Settings::get_instance()->destroy();
 
59
  }
60
  }
61
 
62
  static function update($reset=FALSE)
63
  {
64
- $global_settings = C_NextGen_Global_Settings::get_instance();
65
- $local_settings = C_NextGen_Settings::get_instance();
66
- $last_module_list = $reset ? array() : $global_settings->get('pope_module_list', array());
67
- $current_module_list = self::_generate_module_info();
68
 
69
- if (count(($modules = array_diff($current_module_list, $last_module_list)))>0) {
 
 
 
 
 
 
 
 
 
 
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  // The cache should be flushed
72
  C_Photocrati_Cache::flush();
73
 
@@ -77,17 +110,38 @@ if (!class_exists('C_Photocrati_Installer'))
77
 
78
  foreach ($modules as $module_name) {
79
  if (($handler = self::get_handler_instance(array_shift(explode('|', $module_name))))) {
80
- if (method_exists($handler, 'install')) $handler->install($reset);
 
81
  }
82
  }
83
 
84
  // Update the module list
85
- $global_settings->set('pope_module_list', $current_module_list);
 
 
 
 
 
 
 
 
86
 
87
  // Save any changes settings
88
  $global_settings->save();
89
  $local_settings->save();
90
- }
 
 
 
 
 
 
 
 
 
 
 
 
91
  }
92
 
93
  static function _generate_module_info()
54
  if (method_exists($handler, 'uninstall')) return $handler->uninstall($hard);
55
 
56
  if ($hard) {
 
57
  C_NextGen_Settings::get_instance()->destroy();
58
+ C_NextGen_Global_Settings::get_instance()->destroy();
59
  }
60
  }
61
 
62
  static function update($reset=FALSE)
63
  {
64
+ $local_settings = C_NextGen_Settings::get_instance();
65
+ $global_settings = C_NextGen_Global_Settings::get_instance();
 
 
66
 
67
+ // This is a specific hack/work-around/fix and can probably be removed sometime after 2.0.20's release
68
+ //
69
+ // NextGen 2x was not multisite compatible until 2.0.18. Users that upgraded before this
70
+ // will have nearly all of their settings stored globally (network wide) in wp_sitemeta. If
71
+ // pope_module_list (which should always be a local setting) exists site-wide we wipe the current
72
+ // global ngg_options and restore from defaults. This should only ever run once.
73
+ if (is_multisite() && isset($global_settings->pope_module_list))
74
+ {
75
+ // Setting this to TRUE will wipe current settings for display types, but also
76
+ // allows the display type installer to run correctly
77
+ $reset = TRUE;
78
 
79
+ $settings_installer = new C_NextGen_Settings_Installer();
80
+ $global_defaults = $settings_installer->get_global_defaults();
81
+
82
+ // Preserve the network options we honor by restoring them after calling $global_settings->reset()
83
+ $global_settings_to_keep = array();
84
+ foreach ($global_defaults as $key => $val) {
85
+ $global_settings_to_keep[$key] = $global_settings->$key;
86
+ }
87
+
88
+ // Resets internal options to an empty array
89
+ $global_settings->reset();
90
+
91
+ // Restore the defaults, then our saved values. This must be done again later because
92
+ // we've set $reset to TRUE.
93
+ $settings_installer->install_global_settings();
94
+ foreach ($global_settings_to_keep as $key => $val) {
95
+ $global_settings->$key = $val;
96
+ }
97
+ }
98
+
99
+ $last_module_list = $reset ? array() : $local_settings->get('pope_module_list', array());
100
+ $current_module_list = self::_generate_module_info();
101
+
102
+ if (count(($modules = array_diff($current_module_list, $last_module_list))) > 0)
103
+ {
104
  // The cache should be flushed
105
  C_Photocrati_Cache::flush();
106
 
110
 
111
  foreach ($modules as $module_name) {
112
  if (($handler = self::get_handler_instance(array_shift(explode('|', $module_name))))) {
113
+ if (method_exists($handler, 'install'))
114
+ $handler->install($reset);
115
  }
116
  }
117
 
118
  // Update the module list
119
+ $local_settings->set('pope_module_list', $current_module_list);
120
+
121
+ // NOTE & TODO: if the above section that declares $global_settings_to_keep is removed this should also
122
+ // Since a hard-reset of the settings was forced we must again re-apply our previously saved values
123
+ if (isset($global_settings_to_keep)) {
124
+ foreach ($global_settings_to_keep as $key => $val) {
125
+ $global_settings->$key = $val;
126
+ }
127
+ }
128
 
129
  // Save any changes settings
130
  $global_settings->save();
131
  $local_settings->save();
132
+ }
133
+
134
+ // Another workaround to an issue caused by NextGen's lack of multisite compatibility. It's possible
135
+ // the string substitation wasn't performed, so if a '%' symbol exists in gallerypath we reset it. It's
136
+ // another db call, but again this should only ever run once.
137
+ //
138
+ // Remove this when removing the above reset-global-settings code
139
+ if (strpos($local_settings->gallerypath, '%'))
140
+ {
141
+ $settings_installer = new C_NextGen_Settings_Installer();
142
+ $local_settings->gallerypath = $settings_installer->gallerypath_replace($global_settings->gallerypath);
143
+ $local_settings->save();
144
+ }
145
  }
146
 
147
  static function _generate_module_info()
non_pope/class.photocrati_resource_manager.php CHANGED
@@ -74,8 +74,12 @@ class C_Photocrati_Resource_Manager
74
 
75
  $this->wrote_footer = TRUE;
76
  }
77
-
78
-
 
 
 
 
79
  function output_buffer_handler($content)
80
  {
81
  return $this->output_buffer();
@@ -124,7 +128,7 @@ class C_Photocrati_Resource_Manager
124
 
125
  // If W3TC is installed and activated, we can't output the
126
  // scripts and manipulate the buffer, so we can only provide a warning
127
- if (defined('W3TC')) {
128
  define('DONOTCACHEPAGE', TRUE);
129
  if (!did_action('wp_footer')) {
130
  error_log("We're sorry, but your theme's page template didn't make a call to wp_footer(), which is required by NextGEN Gallery. Please add this call to your page templates.");
74
 
75
  $this->wrote_footer = TRUE;
76
  }
77
+
78
+ /**
79
+ * Output the buffer after PHP execution has ended (but before shutdown)
80
+ * @param $content
81
+ * @return string
82
+ */
83
  function output_buffer_handler($content)
84
  {
85
  return $this->output_buffer();
128
 
129
  // If W3TC is installed and activated, we can't output the
130
  // scripts and manipulate the buffer, so we can only provide a warning
131
+ if (defined('W3TC') && defined('WP_DEBUG') && WP_DEBUG) {
132
  define('DONOTCACHEPAGE', TRUE);
133
  if (!did_action('wp_footer')) {
134
  error_log("We're sorry, but your theme's page template didn't make a call to wp_footer(), which is required by NextGEN Gallery. Please add this call to your page templates.");
non_pope/class.photocrati_settings_manager.php CHANGED
@@ -41,7 +41,7 @@ if (!class_exists('C_Photocrati_Settings_Manager_Base')) {
41
  */
42
  protected function _get_option_handler($option_name, $method='get')
43
  {
44
- $retval = NULL;;
45
 
46
  if (isset($this->_option_handlers[$option_name])) {
47
  if (!is_object($this->_option_handlers[$option_name])) {
41
  */
42
  protected function _get_option_handler($option_name, $method='get')
43
  {
44
+ $retval = NULL;
45
 
46
  if (isset($this->_option_handlers[$option_name])) {
47
  if (!is_object($this->_option_handlers[$option_name])) {
products/photocrati_nextgen/modules/ajax/class.ajax_installer.php CHANGED
@@ -5,7 +5,7 @@ class C_Ajax_Installer
5
  function install()
6
  {
7
  // Delete cached values. Needed for 2.0.7 and less
8
- $settings = C_NextGen_Global_Settings::get_instance();
9
  $settings->delete('ajax_url');
10
  $settings->delete('ajax_slug');
11
  $settings->delete('ajax_js_url');
5
  function install()
6
  {
7
  // Delete cached values. Needed for 2.0.7 and less
8
+ $settings = C_NextGen_Settings::get_instance();
9
  $settings->delete('ajax_url');
10
  $settings->delete('ajax_slug');
11
  $settings->delete('ajax_js_url');
products/photocrati_nextgen/modules/ajax/module.ajax.php CHANGED
@@ -21,7 +21,7 @@ class M_Ajax extends C_Base_Module
21
  );
22
 
23
  include_once('class.ajax_option_handler.php');
24
- C_NextGen_Global_Settings::add_option_handler('C_Ajax_Option_Handler', array(
25
  'ajax_slug',
26
  'ajax_url',
27
  'ajax_js_url'
@@ -56,7 +56,7 @@ class M_Ajax extends C_Base_Module
56
  */
57
  function enqueue_scripts()
58
  {
59
- $settings = C_NextGen_Global_Settings::get_instance();
60
  $router = $this->get_registry()->get_utility('I_Router');
61
 
62
  $site_url = $router->get_base_url(TRUE);
21
  );
22
 
23
  include_once('class.ajax_option_handler.php');
24
+ C_NextGen_Settings::add_option_handler('C_Ajax_Option_Handler', array(
25
  'ajax_slug',
26
  'ajax_url',
27
  'ajax_js_url'
56
  */
57
  function enqueue_scripts()
58
  {
59
+ $settings = C_NextGen_Settings::get_instance();
60
  $router = $this->get_registry()->get_utility('I_Router');
61
 
62
  $site_url = $router->get_base_url(TRUE);
products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php CHANGED
@@ -81,7 +81,7 @@ class Mixin_Attach_To_Post extends Mixin
81
  );
82
 
83
  // Enqueue the backbone app for the display tab
84
- $settings = C_NextGen_Global_Settings::get_instance();
85
  $preview_url = $settings->gallery_preview_url;
86
  $display_tab_js_url = $settings->attach_to_post_display_tab_js_url;
87
  if ($this->object->_displayed_gallery->id()) {
81
  );
82
 
83
  // Enqueue the backbone app for the display tab
84
+ $settings = C_NextGen_Settings::get_instance();
85
  $preview_url = $settings->gallery_preview_url;
86
  $display_tab_js_url = $settings->attach_to_post_display_tab_js_url;
87
  if ($this->object->_displayed_gallery->id()) {
products/photocrati_nextgen/modules/attach_to_post/class.attach_to_post_installer.php CHANGED
@@ -5,7 +5,7 @@ class C_Attach_To_Post_Installer
5
  function install()
6
  {
7
  // Delete cached values. Needed for 2.0.7 and less
8
- $settings = C_NextGen_Global_Settings::get_instance();
9
  $settings->delete('attach_to_post_url');
10
  $settings->delete('gallery_preview_url');
11
  $settings->delete('attach_to_post_display_tab_js_url');
5
  function install()
6
  {
7
  // Delete cached values. Needed for 2.0.7 and less
8
+ $settings = C_NextGen_Settings::get_instance();
9
  $settings->delete('attach_to_post_url');
10
  $settings->delete('gallery_preview_url');
11
  $settings->delete('attach_to_post_display_tab_js_url');
products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php CHANGED
@@ -31,7 +31,7 @@ class M_Attach_To_Post extends C_Base_Module
31
  );
32
 
33
  include_once('class.attach_to_post_option_handler.php');
34
- C_NextGen_Global_Settings::add_option_handler('C_Attach_To_Post_Option_Handler', array(
35
  'attach_to_post_url',
36
  'gallery_preview_url',
37
  'attach_to_post_display_tab_js_url'
@@ -130,58 +130,42 @@ class M_Attach_To_Post extends C_Base_Module
130
  */
131
  function substitute_placeholder_imgs($content)
132
  {
133
- // Load html into parser
134
- $doc = new simple_html_dom();
135
- if ($content) {
136
- $doc->load($content);
137
-
138
- // Find all placeholder images
139
- $imgs = $doc->find("img[class='ngg_displayed_gallery']");
140
- if ($imgs) {
141
-
142
- // Get some utilities
143
- $mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Mapper');
144
- $router = $this->get_registry()->get_utility('I_Router');
145
-
146
- // To match ATP entries we compare the stored url against a generic path
147
- // We must check HTTP and HTTPS as well as permalink and non-permalink forms
148
- $preview_url = parse_url($router->join_paths(
149
- $router->remove_url_segment('index.php', $router->get_base_url()),
150
- '/nextgen-attach_to_post/preview'
151
- ));
152
- $preview_url = preg_quote($preview_url['host'] . $preview_url['path'], '#');
153
-
154
- $alt_preview_url = parse_url($router->join_paths(
155
- $router->remove_url_segment('index.php', $router->get_base_url()),
156
- 'index.php/nextgen-attach_to_post/preview'
157
- ));
158
- $alt_preview_url = preg_quote($alt_preview_url['host'] . $alt_preview_url['path'], '#');
159
-
160
- // Substitute each image for the gallery type frontent content
161
- foreach ($imgs as $img) {
162
-
163
- // The placeholder MUST have a gallery instance id
164
- if (preg_match("#http(s)?://({$preview_url}|{$alt_preview_url})/id--(\d+)#", $img->src, $match)) {
165
-
166
- // Find the displayed gallery
167
- $displayed_gallery_id = $match[3];
168
- $displayed_gallery = $mapper->find($displayed_gallery_id, TRUE);
169
-
170
- // Get the content for the displayed gallery
171
- $content = '<p>'._('Invalid Displayed Gallery').'</p>';
172
- if ($displayed_gallery) {
173
- $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
174
- $content = $renderer->render($displayed_gallery, TRUE);
175
- }
176
-
177
- // Replace the placeholder with the displayed gallery content
178
- $img->outertext = $content;
179
- }
180
- }
181
- $content = (string)$doc->save();
182
- }
183
- return $content;
184
- }
185
  }
186
 
187
  /**
@@ -194,13 +178,6 @@ class M_Attach_To_Post extends C_Base_Module
194
  // Enqueue resources needed at post/page level
195
  if (preg_match("/\/wp-admin\/(post|post-new)\.php$/", $_SERVER['SCRIPT_NAME'])) {
196
  $this->_enqueue_tinymce_resources();
197
-
198
- # wp_enqueue_style(
199
- # 'ngg_custom_scrollbar', $this->get_static_url('jquery.mCustomScrollbar.css')
200
- # );
201
- # wp_enqueue_script(
202
- # 'ngg_custom_scrollbar', $this->get_static_url('jquery.mCustomScrollbar.concat.min.js'), array('jquery')
203
- # );
204
  wp_enqueue_style(
205
  'ngg_attach_to_post_dialog', $router->get_static_url('photocrati-attach_to_post#attach_to_post_dialog.css')
206
  );
@@ -222,7 +199,7 @@ class M_Attach_To_Post extends C_Base_Module
222
  wp_localize_script(
223
  'media-editor',
224
  'nextgen_gallery_attach_to_post_url',
225
- C_NextGen_Global_Settings::get_instance()->attach_to_post_url
226
  );
227
 
228
  // Registers our tinymce button and plugin for attaching galleries
31
  );
32
 
33
  include_once('class.attach_to_post_option_handler.php');
34
+ C_NextGen_Settings::add_option_handler('C_Attach_To_Post_Option_Handler', array(
35
  'attach_to_post_url',
36
  'gallery_preview_url',
37
  'attach_to_post_display_tab_js_url'
130
  */
131
  function substitute_placeholder_imgs($content)
132
  {
133
+ // Get some utilities
134
+ $mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Mapper');
135
+ $router = $this->get_registry()->get_utility('I_Router');
136
+
137
+ // To match ATP entries we compare the stored url against a generic path
138
+ // We must check HTTP and HTTPS as well as permalink and non-permalink forms
139
+ $preview_url = parse_url($router->join_paths(
140
+ $router->remove_url_segment('index.php', $router->get_base_url()),
141
+ '/nextgen-attach_to_post/preview'
142
+ ));
143
+ $preview_url = preg_quote($preview_url['host'] . $preview_url['path'], '#');
144
+
145
+ $alt_preview_url = parse_url($router->join_paths(
146
+ $router->remove_url_segment('index.php', $router->get_base_url()),
147
+ 'index.php/nextgen-attach_to_post/preview'
148
+ ));
149
+ $alt_preview_url = preg_quote($alt_preview_url['host'] . $alt_preview_url['path'], '#');
150
+
151
+ // The placeholder MUST have a gallery instance id
152
+ if (preg_match_all("#<img.*http(s)?://({$preview_url}|{$alt_preview_url})/id--(\\d+).*\\/>#mi", $content, $matches, PREG_SET_ORDER)) {
153
+ foreach ($matches as $match) {
154
+ // Find the displayed gallery
155
+ $displayed_gallery_id = $match[3];
156
+ $displayed_gallery = $mapper->find($displayed_gallery_id, TRUE);
157
+
158
+ // Get the content for the displayed gallery
159
+ $retval = '<p>'._('Invalid Displayed Gallery').'</p>';
160
+ if ($displayed_gallery) {
161
+ $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
162
+ $retval = $renderer->render($displayed_gallery, TRUE);
163
+ }
164
+ $content = str_replace($match[0], $retval, $content);
165
+ }
166
+ }
167
+
168
+ return $content;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  }
170
 
171
  /**
178
  // Enqueue resources needed at post/page level
179
  if (preg_match("/\/wp-admin\/(post|post-new)\.php$/", $_SERVER['SCRIPT_NAME'])) {
180
  $this->_enqueue_tinymce_resources();
 
 
 
 
 
 
 
181
  wp_enqueue_style(
182
  'ngg_attach_to_post_dialog', $router->get_static_url('photocrati-attach_to_post#attach_to_post_dialog.css')
183
  );
199
  wp_localize_script(
200
  'media-editor',
201
  'nextgen_gallery_attach_to_post_url',
202
+ C_NextGen_Settings::get_instance()->attach_to_post_url
203
  );
204
 
205
  // Registers our tinymce button and plugin for attaching galleries
products/photocrati_nextgen/modules/datamapper/class.datamapper_installer.php CHANGED
@@ -4,7 +4,7 @@ class C_DataMapper_Installer
4
  {
5
  function __construct()
6
  {
7
- $this->settings = C_NextGen_Global_Settings::get_instance();
8
  }
9
 
10
  function install()
4
  {
5
  function __construct()
6
  {
7
+ $this->settings = C_NextGen_Settings::get_instance();
8
  }
9
 
10
  function install()
products/photocrati_nextgen/modules/dynamic_stylesheet/class.dynamic_stylesheet_controller.php CHANGED
@@ -17,7 +17,7 @@ class C_Dynamic_Stylesheet_Controller extends C_MVC_Controller
17
  function initialize()
18
  {
19
  parent::initialize();
20
- $this->_app = C_NextGen_Global_Settings::get_instance()->dynamic_stylesheet_slug;
21
  }
22
 
23
  static function &get_instance($context=FALSE)
17
  function initialize()
18
  {
19
  parent::initialize();
20
+ $this->_app = C_NextGen_Settings::get_instance()->dynamic_stylesheet_slug;
21
  }
22
 
23
  static function &get_instance($context=FALSE)
products/photocrati_nextgen/modules/dynamic_stylesheet/class.dynamic_stylesheet_installer.php CHANGED
@@ -4,7 +4,7 @@ class C_Dynamic_Stylesheet_Installer
4
  {
5
  function __construct()
6
  {
7
- $this->settings = C_NextGen_Global_Settings::get_instance();
8
  }
9
 
10
  function install()
4
  {
5
  function __construct()
6
  {
7
+ $this->settings = C_NextGen_Settings::get_instance();
8
  }
9
 
10
  function install()
products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_installer.php CHANGED
@@ -4,7 +4,7 @@ class C_Dynamic_Thumbnails_Installer
4
  {
5
  function __construct()
6
  {
7
- $this->settings = C_NextGen_Global_Settings::get_instance();
8
  }
9
 
10
  function install()
4
  {
5
  function __construct()
6
  {
7
+ $this->settings = C_NextGen_Settings::get_instance();
8
  }
9
 
10
  function install()
products/photocrati_nextgen/modules/dynamic_thumbnails/class.dynamic_thumbnails_manager.php CHANGED
@@ -4,7 +4,7 @@ class Mixin_Dynamic_Thumbnails_Manager extends Mixin
4
  {
5
  function get_route_name()
6
  {
7
- return C_NextGen_Global_Settings::get_instance()->get('dynamic_thumbnail_slug');
8
  }
9
 
10
  function _get_params_sanitized($params)
4
  {
5
  function get_route_name()
6
  {
7
+ return C_NextGen_Settings::get_instance()->get('dynamic_thumbnail_slug');
8
  }
9
 
10
  function _get_params_sanitized($params)
products/photocrati_nextgen/modules/frame_communication/class.frame_communication_installer.php CHANGED
@@ -4,7 +4,7 @@ class C_Frame_Communication_Installer
4
  {
5
  function __construct()
6
  {
7
- $this->settings = C_NextGen_Global_Settings::get_instance();
8
  }
9
 
10
  function install()
4
  {
5
  function __construct()
6
  {
7
+ $this->settings = C_NextGen_Settings::get_instance();
8
  }
9
 
10
  function install()
products/photocrati_nextgen/modules/frame_communication/class.frame_event_publisher.php CHANGED
@@ -15,7 +15,7 @@ class C_Frame_Event_Publisher extends C_Component
15
  function initialize()
16
  {
17
  parent::initialize();
18
- $this->setting_name = C_NextGen_Global_Settings::get_instance()->frame_communication_option_name;
19
  }
20
 
21
  /**
15
  function initialize()
16
  {
17
  parent::initialize();
18
+ $this->setting_name = C_NextGen_Settings::get_instance()->frame_communication_option_name;
19
  }
20
 
21
  /**
products/photocrati_nextgen/modules/lightbox/static/jquery.lightbox/nextgen_lightbox_init.js CHANGED
@@ -5,7 +5,10 @@ jQuery(function($) {
5
  */
6
  function insert_code_in_another_methods_scope(scope, method_name, callback)
7
  {
8
- var scope_code = eval(scope).toString();
 
 
 
9
  var callback_code = callback.toString().replace(/[^\{]*{/, '').replace(/\}$/, '');
10
  var regex = new RegExp('(fu' + 'nc' + '' + 'tion '+method_name+'\\([^\\)]*\\)){');
11
  scope_code = scope_code.replace(regex, function(str, match){
@@ -13,8 +16,8 @@ jQuery(function($) {
13
  }).replace(/\$([\s\.\(=])/g, function(str, match){
14
  return 'jQuery'+match;
15
  });
16
- window.eval(scope+" = "+scope_code);
17
- return eval(scope);
18
  };
19
 
20
  // Adjusts the _resize_container_image_box() function to take into
5
  */
6
  function insert_code_in_another_methods_scope(scope, method_name, callback)
7
  {
8
+ var do_that_name = 'e' + '' + ('v');
9
+ do_that_name += 'a' + 'l';
10
+ var do_that = window[do_that_name];
11
+ var scope_code = do_that(scope).toString();
12
  var callback_code = callback.toString().replace(/[^\{]*{/, '').replace(/\}$/, '');
13
  var regex = new RegExp('(fu' + 'nc' + '' + 'tion '+method_name+'\\([^\\)]*\\)){');
14
  scope_code = scope_code.replace(regex, function(str, match){
16
  }).replace(/\$([\s\.\(=])/g, function(str, match){
17
  return 'jQuery'+match;
18
  });
19
+ do_that(scope+" = "+scope_code);
20
+ return do_that(scope);
21
  };
22
 
23
  // Adjusts the _resize_container_image_box() function to take into
products/photocrati_nextgen/modules/mvc/adapter.mvc_fs.php CHANGED
@@ -20,7 +20,7 @@ class A_MVC_Fs extends Mixin
20
  // Create the absolute path to the file
21
  $path = $fs->join_paths(
22
  $mod_dir,
23
- C_NextGen_Global_Settings::get_instance()->get('mvc_static_dirname'),
24
  $path
25
  );
26
 
20
  // Create the absolute path to the file
21
  $path = $fs->join_paths(
22
  $mod_dir,
23
+ C_NextGen_Settings::get_instance()->get('mvc_static_dirname'),
24
  $path
25
  );
26
 
products/photocrati_nextgen/modules/mvc/class.mvc_installer.php CHANGED
@@ -4,7 +4,7 @@ class C_MVC_Installer
4
  {
5
  function __construct()
6
  {
7
- $this->settings = C_NextGen_Global_Settings::get_instance();
8
  }
9
 
10
  function install()
4
  {
5
  function __construct()
6
  {
7
+ $this->settings = C_NextGen_Settings::get_instance();
8
  }
9
 
10
  function install()
products/photocrati_nextgen/modules/mvc/class.mvc_view.php CHANGED
@@ -230,7 +230,7 @@ class Mixin_Mvc_View_Instance_Methods extends Mixin
230
  function find_template_abspath($path, $module=FALSE)
231
  {
232
  $fs = $this->get_registry()->get_utility('I_Fs');
233
- $settings = C_NextGen_Global_Settings::get_instance();
234
 
235
  // We also accept module_name#path, which needs parsing.
236
  if (!$module)
230
  function find_template_abspath($path, $module=FALSE)
231
  {
232
  $fs = $this->get_registry()->get_utility('I_Fs');
233
+ $settings = C_NextGen_Settings::get_instance();
234
 
235
  // We also accept module_name#path, which needs parsing.
236
  if (!$module)
products/photocrati_nextgen/modules/mvc/module.mvc.php CHANGED
@@ -3,7 +3,7 @@
3
  /***
4
  {
5
  Module: photocrati-mvc,
6
- Depends: { photocrati-router }
7
  }
8
  ***/
9
 
@@ -31,7 +31,7 @@ class M_MVC extends C_Base_Module
31
  C_Photocrati_Installer::add_handler($this->module_id, 'C_Mvc_Installer');
32
 
33
  include_once('class.mvc_option_handler.php');
34
- C_NextGen_Global_Settings::add_option_handler('C_Mvc_Option_Handler', array(
35
  'mvc_template_dir'
36
  ));
37
  }
3
  /***
4
  {
5
  Module: photocrati-mvc,
6
+ Depends: { photocrati-router, photocrati-nextgen_settings }
7
  }
8
  ***/
9
 
31
  C_Photocrati_Installer::add_handler($this->module_id, 'C_Mvc_Installer');
32
 
33
  include_once('class.mvc_option_handler.php');
34
+ C_NextGen_Settings::add_option_handler('C_Mvc_Option_Handler', array(
35
  'mvc_template_dir'
36
  ));
37
  }
products/photocrati_nextgen/modules/mvc/templates/index.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $settings = C_NextGen_Global_Settings::get_instance();
3
  $obj = method_exists($this, 'get_class_definition_dir') ? $this : $this->object;
4
  $template_dir = path_join($obj->get_class_definition_dir(), 'templates');
5
  $default_template_dir = $settings->mvc_template_dir;
1
  <?php
2
+ $settings = C_NextGen_Settings::get_instance();
3
  $obj = method_exists($this, 'get_class_definition_dir') ? $this : $this->object;
4
  $template_dir = path_join($obj->get_class_definition_dir(), 'templates');
5
  $default_template_dir = $settings->mvc_template_dir;
products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_forms.php CHANGED
@@ -4,18 +4,16 @@ class A_NextGen_AddGallery_Forms extends Mixin
4
  {
5
  function initialize()
6
  {
7
- $forms = array(
8
- 'upload_images' => 'A_Upload_Images_Form',
9
- 'import_folder' => 'A_Import_Folder_Form'
10
- );
11
-
12
  $registry = $this->object->get_registry();
 
 
 
 
 
13
  foreach ($forms as $form => $adapter) {
14
  $registry->add_adapter('I_Form', $adapter, $form);
15
- $this->object->add_form(
16
- NEXTGEN_ADD_GALLERY_SLUG,
17
- $form
18
- );
19
  }
20
  }
21
  }
4
  {
5
  function initialize()
6
  {
7
+ $settings = C_NextGen_Settings::get_instance();
 
 
 
 
8
  $registry = $this->object->get_registry();
9
+
10
+ $forms = array('upload_images' => 'A_Upload_Images_Form');
11
+ if (!is_multisite() || (is_multisite() && $settings->get('wpmuImportFolder')))
12
+ $forms['import_folder'] = 'A_Import_Folder_Form';
13
+
14
  foreach ($forms as $form => $adapter) {
15
  $registry->add_adapter('I_Form', $adapter, $form);
16
+ $this->object->add_form(NEXTGEN_ADD_GALLERY_SLUG, $form);
 
 
 
17
  }
18
  }
19
  }
products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.upload_images_form.php CHANGED
@@ -47,10 +47,14 @@ class A_Upload_Images_Form extends Mixin
47
  $imgs->extensions = "jpg,jpeg,gif,png,JPG,JPEG,GIF,PNG";
48
  $retval[] = $imgs;
49
 
50
- $zips = new stdClass;
51
- $zips->title = "Zip files";
52
- $zips->extensions = "zip,ZIP";
53
- $retval[] = $zips;
 
 
 
 
54
 
55
  return $retval;
56
  }
47
  $imgs->extensions = "jpg,jpeg,gif,png,JPG,JPEG,GIF,PNG";
48
  $retval[] = $imgs;
49
 
50
+ $settings = C_NextGen_Settings::get_instance();
51
+ if (!is_multisite() || (is_multisite() && $settings->get('wpmuZipUpload')))
52
+ {
53
+ $zips = new stdClass;
54
+ $zips->title = "Zip files";
55
+ $zips->extensions = "zip,ZIP";
56
+ $retval[] = $zips;
57
+ }
58
 
59
  return $retval;
60
  }
products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_installer.php CHANGED
@@ -8,7 +8,7 @@ class C_NextGen_Admin_Installer
8
  // were statically set rather than dynamically using a handler. Therefore, we need
9
  // to delete those static values
10
  $module_name = 'photocrati-nextgen_admin';
11
- $settings = C_NextGen_Global_Settings::get_instance();
12
  $modules = $settings->pope_module_list;
13
  $cleanup = FALSE;
14
  if (!isset($modules[$module_name])) $cleanup = FALSE;
8
  // were statically set rather than dynamically using a handler. Therefore, we need
9
  // to delete those static values
10
  $module_name = 'photocrati-nextgen_admin';
11
+ $settings = C_NextGen_Settings::get_instance();
12
  $modules = $settings->pope_module_list;
13
  $cleanup = FALSE;
14
  if (!isset($modules[$module_name])) $cleanup = FALSE;
products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php CHANGED
@@ -118,7 +118,7 @@ class Mixin_NextGen_Admin_Page_Instance_Methods extends Mixin
118
 
119
  function enqueue_jquery_ui_theme()
120
  {
121
- $settings = C_NextGen_Global_Settings::get_instance();
122
  wp_enqueue_style(
123
  $settings->jquery_ui_theme,
124
  is_ssl() ?
118
 
119
  function enqueue_jquery_ui_theme()
120
  {
121
+ $settings = C_NextGen_Settings::get_instance();
122
  wp_enqueue_style(
123
  $settings->jquery_ui_theme,
124
  is_ssl() ?
products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php CHANGED
@@ -29,7 +29,7 @@ class M_NextGen_Admin extends C_Base_Module
29
  C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Admin_Installer');
30
 
31
  include_once('class.nextgen_admin_option_handler.php');
32
- C_NextGen_Global_Settings::add_option_handler('C_NextGen_Admin_Option_Handler', array(
33
  'jquery_ui_theme',
34
  'jquery_ui_theme_version',
35
  'jquery_ui_theme_url'
29
  C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Admin_Installer');
30
 
31
  include_once('class.nextgen_admin_option_handler.php');
32
+ C_NextGen_Settings::add_option_handler('C_NextGen_Admin_Option_Handler', array(
33
  'jquery_ui_theme',
34
  'jquery_ui_theme_version',
35
  'jquery_ui_theme_url'
products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_controller.php CHANGED
@@ -253,7 +253,7 @@ class A_NextGen_Basic_Album_Controller extends Mixin
253
 
254
  function prettify_pagelink($pagelink)
255
  {
256
- $param_separator = C_NextGen_Global_Settings::get_instance()->get('router_param_separator');
257
  $regex = implode('', array(
258
  '#',
259
  '/(gallery|album)',
253
 
254
  function prettify_pagelink($pagelink)
255
  {
256
+ $param_separator = C_NextGen_Settings::get_instance()->get('router_param_separator');
257
  $regex = implode('', array(
258
  '#',
259
  '/(gallery|album)',
products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_album_routes.php CHANGED
@@ -22,7 +22,7 @@ class A_NextGen_Basic_Album_Routes extends Mixin
22
  // Get router
23
  $router = $this->get_registry()->get_utility('I_Router');
24
  $app = $router->get_routed_app();
25
- $slug = C_NextGen_Global_Settings::get_instance()->router_param_slug;
26
 
27
  // If we're viewing an album, rewrite the urls
28
  $regex = "/photocrati-nextgen_basic_\w+_album/";
22
  // Get router
23
  $router = $this->get_registry()->get_utility('I_Router');
24
  $app = $router->get_routed_app();
25
+ $slug = C_NextGen_Settings::get_instance()->router_param_slug;
26
 
27
  // If we're viewing an album, rewrite the urls
28
  $regex = "/photocrati-nextgen_basic_\w+_album/";
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.ajax_pagination_actions.php CHANGED
@@ -14,6 +14,10 @@ class A_Ajax_Pagination_Actions extends Mixin
14
  $displayed_gallery = $factory->create('displayed_gallery', $mapper);
15
  $displayed_gallery->apply_transient($id);
16
 
 
 
 
 
17
  // render the displayed gallery
18
  $this->renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
19
  $retval['html'] = $this->renderer->render($displayed_gallery, TRUE);
14
  $displayed_gallery = $factory->create('displayed_gallery', $mapper);
15
  $displayed_gallery->apply_transient($id);
16
 
17
+ // Prevent future "show slideshow" links from using the AJAX request URI
18
+ if ($displayed_gallery->display_settings['ajax_pagination'])
19
+ $displayed_gallery->display_settings['slideshow_link_origin'] = $_SERVER['HTTP_REFERER'];
20
+
21
  // render the displayed gallery
22
  $this->renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
23
  $retval['html'] = $this->renderer->render($displayed_gallery, TRUE);
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_routes.php CHANGED
@@ -14,7 +14,7 @@ class A_NextGen_Basic_Gallery_Routes extends Mixin
14
 
15
  function add_nextgen_basic_gallery_routes()
16
  {
17
- $slug = C_NextGen_Global_Settings::get_instance()->router_param_slug;
18
  $this->object->rewrite("{$slug}{*}/image/{*}", "{$slug}{1}/pid--{2}");
19
  $this->object->rewrite("{$slug}{*}/slideshow/{*}", "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW . "{2}");
20
  $this->object->rewrite("{$slug}{*}/thumbnails/{*}", "{$slug}{1}/show--". NEXTGEN_GALLERY_BASIC_THUMBNAILS . "{2}");
14
 
15
  function add_nextgen_basic_gallery_routes()
16
  {
17
+ $slug = C_NextGen_Settings::get_instance()->router_param_slug;
18
  $this->object->rewrite("{$slug}{*}/image/{*}", "{$slug}{1}/pid--{2}");
19
  $this->object->rewrite("{$slug}{*}/slideshow/{*}", "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW . "{2}");
20
  $this->object->rewrite("{$slug}{*}/thumbnails/{*}", "{$slug}{1}/show--". NEXTGEN_GALLERY_BASIC_THUMBNAILS . "{2}");
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_urls.php CHANGED
@@ -57,7 +57,7 @@ class A_NextGen_Basic_Gallery_Urls extends Mixin
57
  );
58
 
59
  // Get the settings manager
60
- $settings = C_NextGen_Global_Settings::get_instance();
61
 
62
  // Create the regex pattern
63
  $sep = preg_quote($settings->router_param_separator, '#');
57
  );
58
 
59
  // Get the settings manager
60
+ $settings = C_NextGen_Settings::get_instance();
61
 
62
  // Create the regex pattern
63
  $sep = preg_quote($settings->router_param_separator, '#');
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnails_controller.php CHANGED
@@ -114,9 +114,12 @@ class A_NextGen_Basic_Thumbnails_Controller extends Mixin_NextGen_Basic_Gallery_
114
 
115
  // Generate a slideshow link
116
  $slideshow_link = '';
117
- if ($display_settings['show_slideshow_link']) {
 
 
 
118
  $slideshow_link = $this->object->get_url_for_alternate_display_type(
119
- $displayed_gallery, NEXTGEN_GALLERY_BASIC_SLIDESHOW
120
  );
121
  }
122
 
114
 
115
  // Generate a slideshow link
116
  $slideshow_link = '';
117
+ if ($display_settings['show_slideshow_link'])
118
+ {
119
+ // origin_url is necessary for ajax operations. slideshow_link_origin will NOT always exist.
120
+ $origin_url = (empty($display_settings['slideshow_link_origin']) ? FALSE : $display_settings['slideshow_link_origin']);
121
  $slideshow_link = $this->object->get_url_for_alternate_display_type(
122
+ $displayed_gallery, NEXTGEN_GALLERY_BASIC_SLIDESHOW, $origin_url
123
  );
124
  }
125
 
products/photocrati_nextgen/modules/nextgen_basic_gallery/mixin.nextgen_basic_gallery_controller.php CHANGED
@@ -19,9 +19,9 @@ class Mixin_NextGen_Basic_Gallery_Controller extends Mixin
19
  * @param string $display_type
20
  * @return string
21
  */
22
- function get_url_for_alternate_display_type($displayed_gallery, $display_type)
23
  {
24
- $url = $this->object->get_routed_url(TRUE);
25
  $url = $this->object->remove_param_for($url, 'show', $displayed_gallery->id());
26
  $url = $this->object->set_param_for($url, 'show', $display_type, $displayed_gallery->id());
27
 
19
  * @param string $display_type
20
  * @return string
21
  */
22
+ function get_url_for_alternate_display_type($displayed_gallery, $display_type, $origin_url = FALSE)
23
  {
24
+ $url = ($origin_url ? $origin_url : $this->object->get_routed_url(TRUE));
25
  $url = $this->object->remove_param_for($url, 'show', $displayed_gallery->id());
26
  $url = $this->object->set_param_for($url, 'show', $display_type, $displayed_gallery->id());
27
 
products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.js CHANGED
@@ -40,6 +40,7 @@ jQuery.fn.nggShowSlideshow = function(args) {
40
  containerResize: false,
41
  fit: 1,
42
  timeout: s.timeout,
 
43
  after: function(currSlideElement, nextSlideElement, options, forwardFlag) {
44
  // update the pro-lightbox triggers should they exist
45
  jQuery(nextSlideElement).parent().siblings('div.ngg-trigger-buttons').each(function() {
40
  containerResize: false,
41
  fit: 1,
42
  timeout: s.timeout,
43
+ next: self, // advance to next image when clicked
44
  after: function(currSlideElement, nextSlideElement, options, forwardFlag) {
45
  // update the pro-lightbox triggers should they exist
46
  jQuery(nextSlideElement).parent().siblings('div.ngg-trigger-buttons').each(function() {
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_controller.php CHANGED
@@ -99,7 +99,6 @@ class A_NextGen_Basic_ImageBrowser_Controller extends Mixin
99
 
100
  // our image to display
101
  $picture = new C_Image_Wrapper($imap->find($numeric_pid), NULL, TRUE);
102
- $picture = apply_filters('ngg_image_object', $picture, $numeric_pid);
103
 
104
  // determine URI to the next & previous images
105
  $back_pid = ($key >= 1) ? $picture_array[$key - 1] : end($picture_array);
99
 
100
  // our image to display
101
  $picture = new C_Image_Wrapper($imap->find($numeric_pid), NULL, TRUE);
 
102
 
103
  // determine URI to the next & previous images
104
  $back_pid = ($key >= 1) ? $picture_array[$key - 1] : end($picture_array);
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_routes.php CHANGED
@@ -14,7 +14,7 @@ class A_NextGen_Basic_ImageBrowser_Routes extends Mixin
14
 
15
  function _add_nextgen_basic_imagebrowser_routes()
16
  {
17
- $slug = C_NextGen_Global_Settings::get_instance()->router_param_slug;
18
  $this->object->rewrite("{$slug}{*}/image/{\\w}", "{$slug}{1}/pid--{2}");
19
  }
20
  }
14
 
15
  function _add_nextgen_basic_imagebrowser_routes()
16
  {
17
+ $slug = C_NextGen_Settings::get_instance()->router_param_slug;
18
  $this->object->rewrite("{$slug}{*}/image/{\\w}", "{$slug}{1}/pid--{2}");
19
  }
20
  }
products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_routes.php CHANGED
@@ -14,7 +14,7 @@ class A_NextGen_Basic_TagCloud_Routes extends Mixin
14
 
15
  function _add_nextgen_basic_tagcloud_routes()
16
  {
17
- $slug = C_NextGen_Global_Settings::get_instance()->router_param_slug;
18
  $this->object->rewrite("{$slug}{*}/tags/{\\w}{*}", "{$slug}{1}/gallerytag--{2}{3}");
19
  }
20
  }
14
 
15
  function _add_nextgen_basic_tagcloud_routes()
16
  {
17
+ $slug = C_NextGen_Settings::get_instance()->router_param_slug;
18
  $this->object->rewrite("{$slug}{*}/tags/{\\w}{*}", "{$slug}{1}/gallerytag--{2}{3}");
19
  }
20
  }
products/photocrati_nextgen/modules/nextgen_basic_tagcloud/adapter.nextgen_basic_tagcloud_urls.php CHANGED
@@ -48,7 +48,7 @@ class A_NextGen_Basic_TagCloud_Urls extends Mixin
48
  );
49
 
50
  // Get the settings manager
51
- $settings = C_NextGen_Global_Settings::get_instance();
52
 
53
  // Create the regex pattern
54
  $sep = preg_quote($settings->router_param_separator, '#');
48
  );
49
 
50
  // Get the settings manager
51
+ $settings = C_NextGen_Settings::get_instance();
52
 
53
  // Create the regex pattern
54
  $sep = preg_quote($settings->router_param_separator, '#');
products/photocrati_nextgen/modules/nextgen_data/class.gallery_storage.php CHANGED
@@ -24,7 +24,7 @@ class Mixin_GalleryStorage extends Mixin
24
  if (!defined('GALLERYSTORAGE_DRIVER')) {
25
 
26
  // Get the datamapper configured in the database
27
- $factory_method = C_NextGen_Global_Settings::get_instance()->gallerystorage_driver;
28
 
29
  // Define a constant and use this as the global gallerystorage driver,
30
  // unless running in a SimpleTest Environment
24
  if (!defined('GALLERYSTORAGE_DRIVER')) {
25
 
26
  // Get the datamapper configured in the database
27
+ $factory_method = C_NextGen_Settings::get_instance()->gallerystorage_driver;
28
 
29
  // Define a constant and use this as the global gallerystorage driver,
30
  // unless running in a SimpleTest Environment
products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php CHANGED
@@ -505,6 +505,7 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
505
  if (($gallery_id = $this->object->_get_gallery_id($gallery))) {
506
 
507
  // Ensure that there is capacity available
 
508
  if ( (is_multisite()) && nggWPMU::wpmu_enable_function('wpmuQuotaCheck')) {
509
  if (upload_is_user_over_quota(FALSE)) {
510
  throw new E_NoSpaceAvailableException();
505
  if (($gallery_id = $this->object->_get_gallery_id($gallery))) {
506
 
507
  // Ensure that there is capacity available
508
+ require_once(ABSPATH . 'wp-admin/includes/ms.php');
509
  if ( (is_multisite()) && nggWPMU::wpmu_enable_function('wpmuQuotaCheck')) {
510
  if (upload_is_user_over_quota(FALSE)) {
511
  throw new E_NoSpaceAvailableException();
products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper.php CHANGED
@@ -82,10 +82,9 @@ class C_Image_Wrapper
82
 
83
  // cache the results
84
  ksort($image);
85
- $this->_cache = $image;
86
  $id_field = (!empty($image['id_field']) ? $image['id_field'] : 'pid');
 
87
  $this->_orig_image_id = $image[$id_field];
88
-
89
  $this->_legacy = $legacy;
90
  }
91
 
82
 
83
  // cache the results
84
  ksort($image);
 
85
  $id_field = (!empty($image['id_field']) ? $image['id_field'] : 'pid');
86
+ $this->_cache = (array) apply_filters('ngg_image_object', (object) $image, $image[$id_field]);
87
  $this->_orig_image_id = $image[$id_field];
 
88
  $this->_legacy = $legacy;
89
  }
90
 
products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php CHANGED
@@ -642,6 +642,7 @@ class Mixin_NggLegacy_GalleryStorage_Driver extends Mixin
642
  // Ensure that there is capacity available
643
  if ((is_multisite()) && $settings->get('wpmuQuotaCheck'))
644
  {
 
645
  if (upload_is_user_over_quota(FALSE)) {
646
  $message .= sprintf(__('Sorry, you have used your space allocation. Please delete some files to upload more files.', 'nggallery'));
647
  throw new E_NoSpaceAvailableException();
642
  // Ensure that there is capacity available
643
  if ((is_multisite()) && $settings->get('wpmuQuotaCheck'))
644
  {
645
+ require_once(ABSPATH . 'wp-admin/includes/ms.php');
646
  if (upload_is_user_over_quota(FALSE)) {
647
  $message .= sprintf(__('Sorry, you have used your space allocation. Please delete some files to upload more files.', 'nggallery'));
648
  throw new E_NoSpaceAvailableException();
products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.displayed_gallery_related_element.php DELETED
@@ -1,114 +0,0 @@
1
- <?php
2
-
3
- class A_Displayed_Gallery_Related_Element extends Mixin
4
- {
5
- function initialize()
6
- {
7
- $this->object->add_post_hook(
8
- 'render_object',
9
- 'Renders "related" link for the gallery',
10
- get_class(),
11
- 'render_related'
12
- );
13
- }
14
-
15
- function _check_rendering($displayed_gallery, $template_id, $root_element)
16
- {
17
- $ret = $this->object->_check_addition_rendering($displayed_gallery, $template_id, $root_element, 'layout');
18
-
19
- switch ($template_id)
20
- {
21
- case 'photocrati-nextgen_basic_album#compact':
22
- case 'photocrati-nextgen_basic_album#extended':
23
- case 'photocrati-nextgen_basic_tagcloud#nextgen_basic_tagcloud':
24
- {
25
- $ret = false;
26
-
27
- break;
28
- }
29
- }
30
-
31
- return $ret;
32
- }
33
-
34
- function render_related()
35
- {
36
- if (!C_NextGen_Settings::get_instance()->get('activateTags')) return;
37
-
38
- $root_element = $this->object->get_method_property(
39
- $this->method_called,
40
- ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE
41
- );
42
-
43
- $displayed_type = $this->object->get_param('display_type_rendering');
44
- $displayed_gallery = $this->object->get_param('displayed_gallery');
45
- $template_id = $root_element->get_id();
46
-
47
- if (!$this->object->_check_rendering($displayed_gallery, $template_id, $root_element))
48
- return;
49
-
50
- if ($displayed_type && $displayed_gallery != null)
51
- {
52
- $list = $root_element->find('nextgen_gallery.gallery_container', TRUE);
53
- foreach ($list as $container_element) {
54
- $container_element->append($this->object->render_related_string());
55
- }
56
- }
57
-
58
- return $root_element;
59
- }
60
-
61
- function render_related_string()
62
- {
63
- $settings = C_NextGen_Settings::get_instance();
64
- $type = $settings->appendType;
65
- $maxImages = $settings->maxImages;
66
- $sluglist = array();
67
-
68
- switch ($type) {
69
- case 'tags':
70
- if (function_exists('get_the_tags'))
71
- {
72
- $taglist = get_the_tags();
73
- if (is_array($taglist)) {
74
- foreach ($taglist as $tag) {
75
- $sluglist[] = $tag->slug;
76
- }
77
- }
78
- }
79
- break;
80
- case 'category':
81
- $catlist = get_the_category();
82
- if (is_array($catlist))
83
- {
84
- foreach ($catlist as $cat) {
85
- $sluglist[] = $cat->category_nicename;
86
- }
87
- }
88
- break;
89
- }
90
-
91
- $taglist = implode(',', $sluglist);
92
-
93
- if ($taglist === 'uncategorized' || empty($taglist))
94
- return;
95
-
96
- $renderer = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer');
97
- $view = C_Component_Registry::get_instance()->get_utility('I_Component_Factory')
98
- ->create('mvc_view', '');
99
- $retval = $renderer->display_images(array(
100
- 'source' => 'tags',
101
- 'container_ids' => $taglist,
102
- 'display_type' => NEXTGEN_GALLERY_BASIC_THUMBNAILS,
103
- 'images_per_page' => $maxImages,
104
- 'maximum_entity_count' => $maxImages,
105
- 'template' => $view->get_template_abspath('photocrati-nextgen_gallery_display#related'),
106
- 'show_all_in_lightbox' => FALSE,
107
- 'show_slideshow_link' => FALSE,
108
- 'disable_pagination' => TRUE
109
- ));
110
-
111
- return apply_filters('ngg_show_related_gallery_content', $retval, $taglist);
112
- }
113
-
114
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php CHANGED
@@ -76,7 +76,7 @@ class Mixin_Displayed_Gallery_Validation extends Mixin
76
 
77
  // If no maximum_entity_count has been given, then set a maximum
78
  if (!isset($this->object->maximum_entity_count)) {
79
- $this->object->maximum_entity_count = C_Photocrati_Global_Settings_Manager::get('maximum_entity_count', 500);
80
  }
81
 
82
  }
76
 
77
  // If no maximum_entity_count has been given, then set a maximum
78
  if (!isset($this->object->maximum_entity_count)) {
79
+ $this->object->maximum_entity_count = C_Photocrati_Settings_Manager::get('maximum_entity_count', 500);
80
  }
81
 
82
  }
products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php CHANGED
@@ -88,7 +88,6 @@ class M_Gallery_Display extends C_Base_Module
88
  );
89
 
90
  $this->get_registry()->add_adapter('I_MVC_View', 'A_Gallery_Display_View');
91
- $this->get_registry()->add_adapter('I_MVC_View', 'A_Displayed_Gallery_Related_Element');
92
  }
93
 
94
  /**
@@ -100,6 +99,69 @@ class M_Gallery_Display extends C_Base_Module
100
  C_NextGen_Shortcode_Manager::add('ngg_images', array(&$this, 'display_images'));
101
  add_action('init', array(&$this, '_register_resources'));
102
  add_action('admin_bar_menu', array(&$this, 'add_admin_bar_menu'), 100);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
104
 
105
  /**
@@ -137,6 +199,12 @@ class M_Gallery_Display extends C_Base_Module
137
  $router->get_static_url('photocrati-nextgen_gallery_display#nextgen_gallery_display_settings.css')
138
  );
139
 
 
 
 
 
 
 
140
  wp_register_script(
141
  'jquery.nextgen_radio_toggle',
142
  $router->get_static_url('photocrati-nextgen_gallery_display#jquery.nextgen_radio_toggle.js'),
@@ -192,7 +260,6 @@ class M_Gallery_Display extends C_Base_Module
192
  return array(
193
  'A_Display_Settings_Controller' => 'adapter.display_settings_controller.php',
194
  'A_Display_Settings_Page' => 'adapter.display_settings_page.php',
195
- 'A_Displayed_Gallery_Related_Element' => 'adapter.displayed_gallery_related_element.php',
196
  'A_Gallery_Display_Factory' => 'adapter.gallery_display_factory.php',
197
  'C_Gallery_Display_Installer' => 'class.gallery_display_installer.php',
198
  'A_Gallery_Display_View' => 'adapter.gallery_display_view.php',
88
  );
89
 
90
  $this->get_registry()->add_adapter('I_MVC_View', 'A_Gallery_Display_View');
 
91
  }
92
 
93
  /**
99
  C_NextGen_Shortcode_Manager::add('ngg_images', array(&$this, 'display_images'));
100
  add_action('init', array(&$this, '_register_resources'));
101
  add_action('admin_bar_menu', array(&$this, 'add_admin_bar_menu'), 100);
102
+ add_filter('the_content', array($this, '_render_related_images'));
103
+ }
104
+
105
+ function _render_related_string()
106
+ {
107
+ $settings = C_NextGen_Settings::get_instance();
108
+ $type = $settings->appendType;
109
+ $maxImages = $settings->maxImages;
110
+ $sluglist = array();
111
+
112
+ switch ($type) {
113
+ case 'tags':
114
+ if (function_exists('get_the_tags'))
115
+ {
116
+ $taglist = get_the_tags();
117
+ if (is_array($taglist)) {
118
+ foreach ($taglist as $tag) {
119
+ $sluglist[] = $tag->slug;
120
+ }
121
+ }
122
+ }
123
+ break;
124
+ case 'category':
125
+ $catlist = get_the_category();
126
+ if (is_array($catlist))
127
+ {
128
+ foreach ($catlist as $cat) {
129
+ $sluglist[] = $cat->category_nicename;
130
+ }
131
+ }
132
+ break;
133
+ }
134
+
135
+ $taglist = implode(',', $sluglist);
136
+
137
+ if ($taglist === 'uncategorized' || empty($taglist))
138
+ return;
139
+
140
+ $renderer = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer');
141
+ $view = C_Component_Registry::get_instance()->get_utility('I_Component_Factory')
142
+ ->create('mvc_view', '');
143
+ $retval = $renderer->display_images(array(
144
+ 'source' => 'tags',
145
+ 'container_ids' => $taglist,
146
+ 'display_type' => NEXTGEN_GALLERY_BASIC_THUMBNAILS,
147
+ 'images_per_page' => $maxImages,
148
+ 'maximum_entity_count' => $maxImages,
149
+ 'template' => $view->get_template_abspath('photocrati-nextgen_gallery_display#related'),
150
+ 'show_all_in_lightbox' => FALSE,
151
+ 'show_slideshow_link' => FALSE,
152
+ 'disable_pagination' => TRUE
153
+ ));
154
+
155
+ return apply_filters('ngg_show_related_gallery_content', $retval, $taglist);
156
+ }
157
+
158
+ function _render_related_images($content)
159
+ {
160
+ if (C_NextGen_Settings::get_instance()->get('activateTags')) {
161
+ $content .= $this->_render_related_string();
162
+ }
163
+
164
+ return $content;
165
  }
166
 
167
  /**
199
  $router->get_static_url('photocrati-nextgen_gallery_display#nextgen_gallery_display_settings.css')
200
  );
201
 
202
+ wp_register_style(
203
+ 'nextgen_gallery_related_images',
204
+ $router->get_static_url('photocrati-nextgen_gallery_display#nextgen_gallery_related_images.css')
205
+ );
206
+ wp_enqueue_style('nextgen_gallery_related_images');
207
+
208
  wp_register_script(
209
  'jquery.nextgen_radio_toggle',
210
  $router->get_static_url('photocrati-nextgen_gallery_display#jquery.nextgen_radio_toggle.js'),
260
  return array(
261
  'A_Display_Settings_Controller' => 'adapter.display_settings_controller.php',
262
  'A_Display_Settings_Page' => 'adapter.display_settings_page.php',
 
263
  'A_Gallery_Display_Factory' => 'adapter.gallery_display_factory.php',
264
  'C_Gallery_Display_Installer' => 'class.gallery_display_installer.php',
265
  'A_Gallery_Display_View' => 'adapter.gallery_display_view.php',
products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_related_images.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* ----------- Related images -------------*/
3
+ .ngg-related-gallery {
4
+ background:#F9F9F9;
5
+ border:1px solid #E0E0E0;
6
+ overflow:hidden;
7
+ margin-bottom:1em;
8
+ margin-top:1em;
9
+ padding:5px;
10
+ }
11
+ .ngg-related-gallery img {
12
+ border: 1px solid #DDDDDD;
13
+ float: left;
14
+ margin: 0pt 3px;
15
+ padding: 2px;
16
+ height: 50px;
17
+ width: 50px;
18
+ }
19
+
20
+ .ngg-related-gallery img:hover {
21
+ border: 1px solid #000000;
22
+ }
products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_forms.php CHANGED
@@ -5,14 +5,23 @@ class A_Other_Options_Forms extends Mixin
5
  function initialize()
6
  {
7
  $forms = array(
8
- 'image_options' => 'A_Image_Options_Form',
9
- 'thumbnail_options' => 'A_Thumbnail_Options_Form',
10
- 'lightbox_effects' => 'A_Lightbox_Manager_Form',
11
- 'watermarks' => 'A_Watermarks_Form',
12
- 'styles' => 'A_Styles_Form',
13
- 'roles_and_capabilities'=> 'A_Roles_Form',
14
- 'miscellaneous' => 'A_Miscellaneous_Form',
15
- //'reset_and_uninstall' => 'A_Reset_Form',
 
 
 
 
 
 
 
 
 
16
  );
17
 
18
  $registry = $this->object->get_registry();
5
  function initialize()
6
  {
7
  $forms = array(
8
+ 'image_options' => 'A_Image_Options_Form',
9
+ 'thumbnail_options' => 'A_Thumbnail_Options_Form',
10
+ 'lightbox_effects' => 'A_Lightbox_Manager_Form',
11
+ 'watermarks' => 'A_Watermarks_Form'
12
+ );
13
+
14
+ if (!is_multisite() || (is_multisite() && C_NextGen_Settings::get_instance()->get('wpmuStyle')))
15
+ $forms['styles'] = 'A_Styles_Form';
16
+
17
+ if (is_super_admin() && (!is_multisite() || (is_multisite() && C_NextGen_Settings::get_instance()->get('wpmuRoles'))))
18
+ $forms['roles_and_capabilities'] = 'A_Roles_Form';
19
+
20
+ $forms += array(
21
+ 'miscellaneous' => 'A_Miscellaneous_Form'
22
+ // NOTE & TODO: the following line must do some authentication to prevent sub-sites admins
23
+ // from affecting others on the network
24
+ // 'reset_and_uninstall' => 'A_Reset_Form'
25
  );
26
 
27
  $registry = $this->object->get_registry();
products/photocrati_nextgen/modules/nextgen_other_options/class.settings_model.php CHANGED
@@ -22,7 +22,7 @@ class C_Settings_Model extends C_Component
22
  parent::define($context);
23
  $this->add_mixin('Mixin_Validation');
24
  if ($this->has_context('global') OR $this->has_context('site')) {
25
- $this->wrapper = C_NextGen_Global_Settings::get_instance();
26
  }
27
  else $this->wrapper = C_NextGen_Settings::get_instance();
28
  }
22
  parent::define($context);
23
  $this->add_mixin('Mixin_Validation');
24
  if ($this->has_context('global') OR $this->has_context('site')) {
25
+ $this->wrapper = C_NextGen_Settings::get_instance();
26
  }
27
  else $this->wrapper = C_NextGen_Settings::get_instance();
28
  }
products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php CHANGED
@@ -129,10 +129,10 @@
129
  </label>
130
  <input
131
  id="backup_images_yes"
132
- name="image_options[backup_images]"
133
  value="1"
134
  type="radio"
135
- <?php checked(1, $backup_images)?>
136
  />
137
  &nbsp;
138
  <label for="backup_images_no">
@@ -140,10 +140,10 @@
140
  </label>
141
  <input
142
  id="backup_images_no"
143
- name="image_options[backup_images]"
144
  value="0"
145
  type="radio"
146
- <?php checked(0, $backup_images)?>
147
  />
148
  </td>
149
  </tr>
129
  </label>
130
  <input
131
  id="backup_images_yes"
132
+ name="image_options[imgBackup]"
133
  value="1"
134
  type="radio"
135
+ <?php checked(1, $backup_images ? 1 : 0)?>
136
  />
137
  &nbsp;
138
  <label for="backup_images_no">
140
  </label>
141
  <input
142
  id="backup_images_no"
143
+ name="image_options[imgBackup]"
144
  value="0"
145
  type="radio"
146
+ <?php checked(0, $backup_images ? 1 : 0)?>
147
  />
148
  </td>
149
  </tr>
products/photocrati_nextgen/modules/nextgen_settings/class.nextgen_settings_installer.php CHANGED
@@ -7,17 +7,19 @@ class C_NextGen_Settings_Installer
7
 
8
  function __construct()
9
  {
10
- $this->site_settings = C_NextGen_Global_Settings::get_instance();
11
  $this->blog_settings = C_NextGen_Settings::get_instance();
 
12
 
13
- $this->_global_defaults = array(
14
  'gallerypath' => 'wp-content/blogs.dir/%BLOG_ID%/files/',
15
  'wpmuCSSfile' => 'nggallery.css',
16
- 'wpmuStyle' => TRUE,
 
 
 
17
  'datamapper_driver' => 'custom_table_datamapper',
18
  'gallerystorage_driver' => 'ngglegacy_gallery_storage',
19
- 'maximum_entity_count' => 500,
20
- 'router_param_slug' => 'nggallery'
21
  );
22
 
23
  $this->_local_settings = array(
@@ -45,7 +47,7 @@ class C_NextGen_Settings_Installer
45
  // Image Settings
46
  'imgWidth' => 800, // Image Width
47
  'imgHeight' => 600, // Image height
48
- 'imgQuality' => 85, // Image Quality
49
  'imgBackup' => True, // Create a backup
50
  'imgAutoResize' => False, // Resize after upload
51
 
@@ -110,7 +112,7 @@ class C_NextGen_Settings_Installer
110
 
111
  function install_global_settings($reset=FALSE)
112
  {
113
- foreach ($this->_global_defaults as $key => $value) {
114
  if ($reset) $this->site_settings->set($key, NULL);
115
  $this->site_settings->set_default_value($key, $value);
116
  }
@@ -118,19 +120,27 @@ class C_NextGen_Settings_Installer
118
 
119
  function install_local_settings($reset=FALSE)
120
  {
121
- if (is_multisite()) {
122
- $gallerypath = str_replace(
123
- array('%BLOG_ID%', get_current_blog_id()),
124
- array('%BLOG_NAME%', get_bloginfo('name')),
125
- $this->_global_defaults['gallerypath']
126
- );
127
- $this->_local_settings['gallerypath'] = $gallerypath;
128
- }
129
-
130
  foreach ($this->_local_settings as $key => $value) {
131
  if ($reset) $this->blog_settings->set($key, NULL);
132
  $this->blog_settings->set_default_value($key, $value);
133
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  }
135
 
136
  function install($reset=FALSE)
@@ -138,4 +148,21 @@ class C_NextGen_Settings_Installer
138
  $this->install_global_settings($reset);
139
  $this->install_local_settings($reset);
140
  }
141
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  function __construct()
9
  {
 
10
  $this->blog_settings = C_NextGen_Settings::get_instance();
11
+ $this->site_settings = C_NextGen_Global_Settings::get_instance();
12
 
13
+ $this->_global_settings = array(
14
  'gallerypath' => 'wp-content/blogs.dir/%BLOG_ID%/files/',
15
  'wpmuCSSfile' => 'nggallery.css',
16
+ 'wpmuStyle' => FALSE,
17
+ 'wpmuRoles' => FALSE,
18
+ 'wpmuImportFolder' => FALSE,
19
+ 'wpmuZipUpload' => FALSE,
20
  'datamapper_driver' => 'custom_table_datamapper',
21
  'gallerystorage_driver' => 'ngglegacy_gallery_storage',
22
+ 'maximum_entity_count' => 500
 
23
  );
24
 
25
  $this->_local_settings = array(
47
  // Image Settings
48
  'imgWidth' => 800, // Image Width
49
  'imgHeight' => 600, // Image height
50
+ 'imgQuality' => 100, // Image Quality
51
  'imgBackup' => True, // Create a backup
52
  'imgAutoResize' => False, // Resize after upload
53
 
112
 
113
  function install_global_settings($reset=FALSE)
114
  {
115
+ foreach ($this->_global_settings as $key => $value) {
116
  if ($reset) $this->site_settings->set($key, NULL);
117
  $this->site_settings->set_default_value($key, $value);
118
  }
120
 
121
  function install_local_settings($reset=FALSE)
122
  {
 
 
 
 
 
 
 
 
 
123
  foreach ($this->_local_settings as $key => $value) {
124
  if ($reset) $this->blog_settings->set($key, NULL);
125
  $this->blog_settings->set_default_value($key, $value);
126
  }
127
+
128
+ if (is_multisite())
129
+ {
130
+ // If this is already network activated we just need to use the existing setting
131
+ // Note: attempting to use C_NextGen_Global_Settings here may result in an infinite loop,
132
+ // so get_site_option() is used to check
133
+ if ($options = get_site_option('ngg_options'))
134
+ $gallerypath = $options['gallerypath'];
135
+ else
136
+ $gallerypath = $this->_global_settings['gallerypath'];
137
+
138
+ $gallerypath = $this->gallerypath_replace($gallerypath);
139
+
140
+ // a gallerypath setting has already been set, so we explicitly set a default AND set a new value
141
+ $this->blog_settings->set_default_value('gallerypath', $gallerypath);
142
+ $this->blog_settings->set('gallerypath', $gallerypath);
143
+ }
144
  }
145
 
146
  function install($reset=FALSE)
148
  $this->install_global_settings($reset);
149
  $this->install_local_settings($reset);
150
  }
151
+
152
+ function get_global_defaults()
153
+ {
154
+ return $this->_global_settings;
155
+ }
156
+
157
+ function get_local_defaults()
158
+ {
159
+ return $this->_local_settings;
160
+ }
161
+
162
+ function gallerypath_replace($gallerypath)
163
+ {
164
+ $gallerypath = str_replace('%BLOG_NAME%', get_bloginfo('name'), $gallerypath);
165
+ $gallerypath = str_replace('%BLOG_ID%', get_current_blog_id(), $gallerypath);
166
+ return $gallerypath;
167
+ }
168
+ }
products/photocrati_nextgen/modules/ngglegacy/admin/admin.php CHANGED
@@ -172,7 +172,7 @@ class nggAdminPanel{
172
 
173
  add_menu_page( _n( 'Gallery', 'Galleries', 1, 'nggallery' ), _n( 'Gallery', 'Galleries', 1, 'nggallery' ), 'nggallery-wpmu', NGGFOLDER, array (&$this, 'show_network_settings'), path_join(NGGALLERY_URLPATH, 'admin/images/nextgen_16_color.png') );
174
  add_submenu_page( NGGFOLDER , __('Network settings', 'nggallery'), __('Network settings', 'nggallery'), 'nggallery-wpmu', NGGFOLDER, array (&$this, 'show_network_settings'));
175
- add_submenu_page( NGGFOLDER , __('Reset / Uninstall', 'nggallery'), __('Reset / Uninstall', 'nggallery'), 'activate_plugins', 'nggallery-setup', array (&$this, 'show_menu'));
176
  }
177
 
178
  /**
@@ -392,7 +392,7 @@ class nggAdminPanel{
392
 
393
  function enqueue_jquery_ui_theme()
394
  {
395
- $settings = C_NextGen_Global_Settings::get_instance();
396
  wp_enqueue_style(
397
  $settings->jquery_ui_theme,
398
  $settings->jquery_ui_theme_url,
172
 
173
  add_menu_page( _n( 'Gallery', 'Galleries', 1, 'nggallery' ), _n( 'Gallery', 'Galleries', 1, 'nggallery' ), 'nggallery-wpmu', NGGFOLDER, array (&$this, 'show_network_settings'), path_join(NGGALLERY_URLPATH, 'admin/images/nextgen_16_color.png') );
174
  add_submenu_page( NGGFOLDER , __('Network settings', 'nggallery'), __('Network settings', 'nggallery'), 'nggallery-wpmu', NGGFOLDER, array (&$this, 'show_network_settings'));
175
+ // add_submenu_page( NGGFOLDER , __('Reset / Uninstall', 'nggallery'), __('Reset / Uninstall', 'nggallery'), 'activate_plugins', 'nggallery-setup', array (&$this, 'show_menu'));
176
  }
177
 
178
  /**
392
 
393
  function enqueue_jquery_ui_theme()
394
  {
395
+ $settings = C_NextGen_Settings::get_instance();
396
  wp_enqueue_style(
397
  $settings->jquery_ui_theme,
398
  $settings->jquery_ui_theme_url,
products/photocrati_nextgen/modules/ngglegacy/admin/overview.php CHANGED
@@ -493,8 +493,8 @@ function ngg_overview_right_now() {
493
  <table>
494
  <tbody>
495
  <tr class="first">
496
- <td class="first b"><a href="admin.php?page=nggallery-add-gallery"><?php echo $images; ?></a></td>
497
- <td class="t"><a href="admin.php?page=nggallery-add-gallery"><?php echo _n( 'Image', 'Images', $images, 'nggallery' ); ?></a></td>
498
  <td class="b"></td>
499
  <td class="last"></td>
500
  </tr>
493
  <table>
494
  <tbody>
495
  <tr class="first">
496
+ <td class="first b"><a href="admin.php?page=ngg_addgallery"><?php echo $images; ?></a></td>
497
+ <td class="t"><a href="admin.php?page=ngg_addgallery"><?php echo _n( 'Image', 'Images', $images, 'nggallery' ); ?></a></td>
498
  <td class="b"></td>
499
  <td class="last"></td>
500
  </tr>
products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php CHANGED
@@ -92,16 +92,16 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
92
  <td>
93
  <select name="wpmuCSSfile">
94
  <?php
95
- $csslist = ngg_get_cssfiles();
96
- foreach ($csslist as $key =>$a_cssfile) {
97
- $css_name = $a_cssfile['Name'];
 
98
  if ($key == $ngg_options['wpmuCSSfile']) {
99
- $file_show = $key;
100
  $selected = " selected='selected'";
101
  }
102
  else $selected = '';
103
  $css_name = esc_attr($css_name);
104
- echo "\n\t<option value=\"$key\" $selected>$css_name</option>";
105
  }
106
  ?>
107
  </select><br />
92
  <td>
93
  <select name="wpmuCSSfile">
94
  <?php
95
+ // $csslist = ngg_get_cssfiles();
96
+ $csslist = C_NextGen_Style_Manager::get_instance()->find_all_stylesheets();
97
+ foreach ($csslist as $key => $a_cssfile) {
98
+ $css_name = $a_cssfile['name'];
99
  if ($key == $ngg_options['wpmuCSSfile']) {
 
100
  $selected = " selected='selected'";
101
  }
102
  else $selected = '';
103
  $css_name = esc_attr($css_name);
104
+ echo "\n\t<option value=\"{$key}\" {$selected}>{$css_name}</option>";
105
  }
106
  ?>
107
  </select><br />
products/photocrati_nextgen/modules/router/class.router_installer.php CHANGED
@@ -4,9 +4,9 @@ class C_Router_Installer
4
  {
5
  function install()
6
  {
7
- $settings = C_NextGen_Global_Settings::get_instance();
8
  $settings->set_default_value('router_param_separator', '--');
9
  $settings->set_default_value('router_param_prefix', '');
10
- $settings->set_default_value('router_param_slug', 'params');
11
  }
12
  }
4
  {
5
  function install()
6
  {
7
+ $settings = C_NextGen_Settings::get_instance();
8
  $settings->set_default_value('router_param_separator', '--');
9
  $settings->set_default_value('router_param_prefix', '');
10
+ $settings->set_default_value('router_param_slug', 'nggallery');
11
  }
12
  }
products/photocrati_nextgen/modules/router/class.routing_app.php CHANGED
@@ -806,7 +806,7 @@ class C_Routing_App extends C_Component
806
 
807
  function get_routing_settings()
808
  {
809
- $settings = C_NextGen_Global_Settings::get_instance();
810
  $object = new stdClass();
811
  $object->router_param_separator = $settings->router_param_separator;
812
  $object->router_param_slug = $settings->router_param_slug;
806
 
807
  function get_routing_settings()
808
  {
809
+ $settings = C_NextGen_Settings::get_instance();
810
  $object = new stdClass();
811
  $object->router_param_separator = $settings->router_param_separator;
812
  $object->router_param_slug = $settings->router_param_slug;
products/photocrati_nextgen/modules/router/mixin.url_manipulation.php CHANGED
@@ -144,7 +144,7 @@ class Mixin_Url_Manipulation extends Mixin
144
  function strip_param_segments($request_uri, $remove_slug=TRUE)
145
  {
146
  $retval = $request_uri ? $request_uri : '/';
147
- $settings = C_NextGen_Global_Settings::get_instance();
148
  $sep = preg_quote($settings->router_param_separator, '#');
149
  $param_regex = "#((?P<id>\w+){$sep})?(?<key>\w+){$sep}(?P<value>.+)/?$#";
150
  $slug = $settings->router_param_slug && $remove_slug ? '/' . preg_quote($settings->router_param_slug,'#') : '';
144
  function strip_param_segments($request_uri, $remove_slug=TRUE)
145
  {
146
  $retval = $request_uri ? $request_uri : '/';
147
+ $settings = C_NextGen_Settings::get_instance();
148
  $sep = preg_quote($settings->router_param_separator, '#');
149
  $param_regex = "#((?P<id>\w+){$sep})?(?<key>\w+){$sep}(?P<value>.+)/?$#";
150
  $slug = $settings->router_param_slug && $remove_slug ? '/' . preg_quote($settings->router_param_slug,'#') : '';
products/photocrati_nextgen/product.photocrati_nextgen.php CHANGED
@@ -17,8 +17,8 @@ class P_Photocrati_NextGen extends C_Base_Product
17
  'photocrati-wordpress_routing',
18
  'photocrati-security',
19
  'photocrati-lzw',
 
20
  'photocrati-mvc',
21
- 'photocrati-nextgen_settings',
22
  'photocrati-ajax',
23
  'photocrati-dynamic_stylesheet',
24
  'photocrati-frame_communication',
@@ -52,7 +52,7 @@ class P_Photocrati_NextGen extends C_Base_Product
52
  'photocrati-nextgen',
53
  'Photocrati NextGen',
54
  'Photocrati NextGen',
55
- '2.0.17',
56
  'http://www.nextgen-gallery.com',
57
  'Photocrati Media',
58
  'http://www.photocrati.com'
17
  'photocrati-wordpress_routing',
18
  'photocrati-security',
19
  'photocrati-lzw',
20
+ 'photocrati-nextgen_settings',
21
  'photocrati-mvc',
 
22
  'photocrati-ajax',
23
  'photocrati-dynamic_stylesheet',
24
  'photocrati-frame_communication',
52
  'photocrati-nextgen',
53
  'Photocrati NextGen',
54
  'Photocrati NextGen',
55
+ '2.0.21',
56
  'http://www.nextgen-gallery.com',
57
  'Photocrati Media',
58
  'http://www.photocrati.com'
readme.txt CHANGED
@@ -195,6 +195,22 @@ For more information, feel free to visit the official website for the NextGEN Ga
195
 
196
  == Changelog ==
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  = V2.0.17 - 08.30.2013 =
199
  Fixed: Match legacy behaviour when changing gallery path, i.e. don't move files
200
 
195
 
196
  == Changelog ==
197
 
198
+ = V2.0.21 - 09.09.2013 =
199
+ * NEW: Multisite support
200
+ * Changed: Default image quality set to 100 for generated images
201
+ * Changed: Removed dependence on simplehtmldom library
202
+ * Fixed: Related images functionality works as it did in 1.9.x
203
+ * Fixed: Don't compress inline JavaScript in post/page content
204
+ * Fixed: Click-to-advance slideshow behavior for slideshows
205
+ * Fixed: Security warnings from VaultPress
206
+ * Fixed: View as Slideshow link works with AJAX pagination
207
+ * Fixed: Broken links on Overview page
208
+ * Fixed: Backup images option
209
+ * Fixed: Stylesheet url generated correctly for Windows hosts
210
+ * Fixed: Compatibility with NextGen Custom Fields plugin
211
+ * Fixed: Compatibility with Adsense Explosion plugin
212
+ * Fixed: Suppress wp_footer notices unless WP_DEBUG is set to TRUE
213
+
214
  = V2.0.17 - 08.30.2013 =
215
  Fixed: Match legacy behaviour when changing gallery path, i.e. don't move files
216