From d2a02cb826fa22ddcd820ef564eeee4c87d2674e Mon Sep 17 00:00:00 2001 From: lucha <lucha@paranoici.org> Date: Sun, 23 Aug 2015 15:40:56 +0200 Subject: [PATCH] [auto] Plugin: nextgen-gallery 2.1.7 --- .../plugins/nextgen-gallery/.hg_archival.txt | 4 +-- .../plugins/nextgen-gallery/.hgsubstate | 2 +- wp-content/plugins/nextgen-gallery/.hgtags | 5 ++++ .../plugins/nextgen-gallery/changelog.txt | 12 ++++++++ .../plugins/nextgen-gallery/nggallery.php | 10 +++++-- .../pope/lib/class.component_registry.php | 7 +++-- .../package.module.attach_to_post.php | 5 ++++ .../ngg_attach_to_post_tinymce_plugin.js | 2 +- .../ngg_attach_to_post_tinymce_plugin.min.js | 2 +- .../modules/cache/package.module.cache.php | 3 ++ .../modules/i18n/lang/nggallery.po | 6 ++-- ...package.module.nextgen_addgallery_page.php | 3 +- .../static/media-library-import.js | 10 ++++--- .../static/media-library-import.min.js | 2 +- .../nextgen_addgallery_page/static/styles.css | 4 +++ .../static/styles.min.css | 2 +- .../templates/import_folder.php | 14 ++++++++-- .../templates/upload_images.php | 18 ++++++++---- .../package.module.nextgen_admin.php | 12 +++++++- .../module.nextgen_basic_album.php | 19 ++++++++++++- .../module.nextgen_basic_gallery.php | 17 +++++++++++ .../package.module.nextgen_basic_gallery.php | 6 ---- ...package.module.nextgen_basic_templates.php | 6 +--- .../package.module.nextgen_data.php | 28 ++++++++++++------- ...package.module.nextgen_gallery_display.php | 22 +++++++++------ .../module.nextgen_settings.php | 3 +- .../modules/ngglegacy/admin/manage.php | 2 +- .../modules/ngglegacy/admin/showmeta.php | 2 ++ .../modules/ngglegacy/lib/ngg-db.php | 4 +-- .../modules/ngglegacy/lib/post-thumbnail.php | 2 +- .../module.third_party_compat.php | 20 +++++++++++++ .../modules/widget/package.module.widget.php | 6 ++-- .../product.photocrati_nextgen.php | 1 - wp-content/plugins/nextgen-gallery/readme.txt | 20 ++++++++++--- 34 files changed, 206 insertions(+), 75 deletions(-) diff --git a/wp-content/plugins/nextgen-gallery/.hg_archival.txt b/wp-content/plugins/nextgen-gallery/.hg_archival.txt index c1ddfd794..1434e0138 100644 --- a/wp-content/plugins/nextgen-gallery/.hg_archival.txt +++ b/wp-content/plugins/nextgen-gallery/.hg_archival.txt @@ -1,4 +1,4 @@ repo: 2b82bc45fbe039c6f4c9f0c667e9cd1ee4d84cbb -node: ca2225de1b2aff836e1fe9d7ff3a0f42820524ce +node: b4a06dc685b9d98ae0a082932ef4822be530c429 branch: default -tag: 2.1.2 +tag: 2.1.7 diff --git a/wp-content/plugins/nextgen-gallery/.hgsubstate b/wp-content/plugins/nextgen-gallery/.hgsubstate index 6b10a0783..8a7dff39c 100644 --- a/wp-content/plugins/nextgen-gallery/.hgsubstate +++ b/wp-content/plugins/nextgen-gallery/.hgsubstate @@ -1 +1 @@ -1195e4b40c1123d4a20aeb29bc66e6daf9f49deb pope +a67d026aa1d495eb6c653faa84450a198d8ab18b pope diff --git a/wp-content/plugins/nextgen-gallery/.hgtags b/wp-content/plugins/nextgen-gallery/.hgtags index 9ed4d8bab..7bc2c8ed8 100644 --- a/wp-content/plugins/nextgen-gallery/.hgtags +++ b/wp-content/plugins/nextgen-gallery/.hgtags @@ -307,3 +307,8 @@ cbe47e4cefc75558b857c50d3efcbc8ce27a5636 2.1.2 2fca6018f85c86f32518b4e601fba84823127dfb 2.1.2 2fca6018f85c86f32518b4e601fba84823127dfb 2.1.2 0000000000000000000000000000000000000000 2.1.2 +0000000000000000000000000000000000000000 2.1.2 +ca2225de1b2aff836e1fe9d7ff3a0f42820524ce 2.1.2 +e60b028280448eca1c164dd54111623c2edc9997 2.1.3 +97ec028ec655b132d0426ccb7f14423123ed2f49 2.1.4 +9c6f1b018b1503530debfbb579e6917ec9bd4cac 2.1.6 diff --git a/wp-content/plugins/nextgen-gallery/changelog.txt b/wp-content/plugins/nextgen-gallery/changelog.txt index 24ee23d27..819d74288 100644 --- a/wp-content/plugins/nextgen-gallery/changelog.txt +++ b/wp-content/plugins/nextgen-gallery/changelog.txt @@ -1,6 +1,18 @@ NextGEN Gallery by Photocrati Media += V2.1.7 - 08.12.2015 = +* Changed: "Flush image cache" now removes images from the database w/o a gallery +* Changed: "Show Meta" popup: parse date_format through date_i18n() +* Changed: Made Add Gallery/Images notifications a link to the gallery +* Changed: No longer cache displayed galleries as transients +* Changed: Updated widgets to use PHP5 parent::__construct() over $this->WP_Widget() +* Fixed: C_NextGen_Metadata->get_EXIF() was bugged with imagebrowser-exif template +* Fixed: Cornerstone/X compatibility +* Fixed: Recovering images was 'generating' from backup instead of copying +* Fixed: Setting post thumbnail more than once on a page/post +* Fixed: Permanently hide display types from ATP without an active POPE module + = V2.1.2 - 07.20.2015 = * NEW: Ability to import from Media Library * NEW: Added filter 'ngg_datamapper_table_name' diff --git a/wp-content/plugins/nextgen-gallery/nggallery.php b/wp-content/plugins/nextgen-gallery/nggallery.php index d5456f34b..362015cac 100755 --- a/wp-content/plugins/nextgen-gallery/nggallery.php +++ b/wp-content/plugins/nextgen-gallery/nggallery.php @@ -4,7 +4,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You /** * Plugin Name: NextGEN Gallery by Photocrati * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 12 million downloads. - * Version: 2.1.2 + * Version: 2.1.7 * Author: Photocrati Media * Plugin URI: http://www.nextgen-gallery.com * Author URI: http://www.photocrati.com @@ -370,7 +370,11 @@ class C_NextGEN_Bootstrap function disable_frontend_logic($enabled, $module_id) { if (is_admin()) - $enabled = FALSE; + { + $settings = C_NextGen_Settings::get_instance(); + if (!$settings->get('always_enable_frontend_logic')) + $enabled = FALSE; + } return $enabled; } @@ -583,7 +587,7 @@ class C_NextGEN_Bootstrap define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products')); define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules')); define('NGG_PLUGIN_STARTED_AT', microtime()); - define('NGG_PLUGIN_VERSION', '2.1.2'); + define('NGG_PLUGIN_VERSION', '2.1.7'); if (!defined('NGG_HIDE_STRICT_ERRORS')) { define('NGG_HIDE_STRICT_ERRORS', TRUE); diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php index 624cf6472..29721c26e 100755 --- a/wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php +++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php @@ -101,7 +101,7 @@ class C_Component_Registry $this->mark_as_searched_path($path); } - if ($load_all) $this->load_all_modules(); + if ($load_all) $this->load_all_modules(NULL, $path); } @@ -183,7 +183,7 @@ class C_Component_Registry return $retval; } - function load_all_modules($type = null) + function load_all_modules($type=NULL, $dir=NULL) { $modules = $this->get_known_module_list(); $ret = true; @@ -191,7 +191,8 @@ class C_Component_Registry foreach ($modules as $module_id) { if ($type == null || $this->get_module_meta($module_id, 'type') == $type) { - $ret = $this->load_module($module_id) && $ret; + if ($dir == NULL || strpos($this->get_module_dir($module_id), $dir) !== FALSE) + $ret = $this->load_module($module_id) && $ret; } } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php index e17dcb47b..f8ace1012 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php @@ -531,10 +531,15 @@ class Mixin_Attach_To_Post_Display_Tab extends Mixin $all_tags->id = 'All'; array_unshift($tags, $all_tags); $display_types = array(); + $registry = C_Component_Registry::get_instance(); foreach ($display_type_mapper->find_all() as $display_type) { if (isset($display_type->hidden_from_ui) && $display_type->hidden_from_ui) { continue; } + $available = $registry->is_module_loaded($display_type->name); + if (!apply_filters('ngg_atp_show_display_type', $available, $display_type)) { + continue; + } $display_types[] = $display_type; } usort($display_types, array($this->object, '_display_type_list_sort')); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js index 57105965d..e2247175b 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js @@ -85,7 +85,7 @@ }, wm_close_event: function(e) { - if (e.target._id == 'ngg_attach_to_post_dialog') { + if (e && e.target && e.target._id && e.target._id == 'ngg_attach_to_post_dialog') { // Restore scrolling for the main content window when the attach to post interface is closed jQuery('html,body').css('overflow', 'auto'); tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.min.js index 021f27252..ae85a3318 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.min.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.min.js @@ -1 +1 @@ -eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(7(w){1f.4=\'1o-1w-1q\';n.1m(\'1E.h\',{t:\'1d D H 1z Q\'});b.1v(\'b.v.8\',{w:w,1C:7(){m{1F:\'D H\',1t:\'1G 1k\',1A:\'N://P.1r.J\',1D:\'N://P.1y-1x.J\',1u:\'0.1\'}},1B:7(2,S){3 a=j;2.c.12=2.c.G;2.c.G=7(X,W){3 C=2.c.12(X,W);C.T(\'1l\',a.M);m C};2.1i(\'h\',j.A,{2:2,Z:2.v.8});2.1g(\'8\',{t:\'h.t\',1h:\'h\',1s:S+\'/1n.1p\'});2.V.1N+=",U";2.V.23="U";2.T(\'24\',7(e){6(e.r.25==\'22\'){6(a.13(e.r).21(\'1Y\')>=0){2.14.1Z.27(e);3 4=e.r.26.29(/\\d+$/);6(4)4=4.2a();3 28=b.1H(a,{2:2,Z:2.v.8,4:4});a.A(4)}}})},13:7(l){3 B=l.O(\'K\')?l.O(\'K\'):l.1W;6(B){m B}1M{m""}},M:7(e){6(e.r.1K==\'11\'){9(\'1a,1b\').u(\'s\',\'1c\');n.E.Y.L(n.E.14.L(\'p\')[0]);n.E.Y.1I(0)}},A:7(4){3 F=1J;6(1O(4)!=\'1P\'){F+="&4="+j.4}3 5=1f;1U(5.z!=1V&&5.z!=5){5=5.z}5=9(5);3 k=5.17();3 q=5.R();3 i=1T;3 o=1e;3 15=1S;3 19=1e;3 g=k-(k*0.16);3 f=q-(q*0.16);6(g<15){g=k-10}6(f<19){f=q-10}6(i>g){i=g}6(o>f){o=f}j.2.c.G({1R:F,4:\'11\',17:i,R:o,t:"D H - 1d 1Q Q"});9(\'1a,1b\').u(\'s\',\'I\');9(\'#18\').u(\'s-y\',\'1c\');9(\'#18\').u(\'s-x\',\'I\')}});b.1X.20(\'8\',b.v.8)})(1j.1L);',62,135,'||editor|var|id|win|if|function|NextGEN_AttachToPost|jQuery|self|tinymce|windowManager|||maxHeight|maxWidth|ngg_attach_to_post|popupWidth|this|winWidth|node|return|tinyMCE|popupHeight||winHeight|target|overflow|title|css|plugins|siteurl|||parent|render_attach_to_post_interface|class_name|modal|NextGEN|activeEditor|attach_to_post_url|open|Gallery|hidden|com|class|select|wm_close_event|http|getAttribute|www|Post|height|plugin_url|on|shortcode|settings|two|one|selection|plugin||ngg_attach_to_post_dialog|nggOldOpen|get_class_name|dom|minWidth|05|width|ngg_attach_to_post_dialog_ifr|minHeight|html|body|auto|Attach|600|window|addButton|cmd|addCommand|photocrati_ajax|Media|close|addI18n|atp_button|wordpress|png|page|photocrati|image|author|version|create|post|gallery|nextgen|to|authorurl|init|getInfo|infourl|en|longname|Photocrati|extend|collapse|nextgen_gallery_attach_to_post_url|_id|wp_site_url|else|extended_valid_elements|typeof|undefined|To|url|800|1200|while|null|className|PluginManager|ngg_displayed_gallery|events|add|indexOf|IMG|custom_elements|mouseup|tagName|src|cancel|obj|match|pop'.split('|'),0,{})) +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(7(H){1g.4=\'1V-1Q-1P\';n.1W(\'1t.m\',{v:\'1d B D 1m 1a\'});f.1s(\'f.k.9\',{H:H,1z:7(){s{1A:\'B D\',1y:\'1x 1v\',1w:\'V://U.1B.T\',1C:\'V://U.1F-1D.T\',1u:\'0.1\'}},1l:7(2,X){3 g=i;2.c.R=2.c.E;2.c.E=7(S,W){3 w=2.c.R(S,W);w.11(\'1i\',g.K);s w};2.1n(\'m\',i.C,{2:2,14:2.k.9});2.1r(\'9\',{v:\'m.v\',1q:\'m\',1p:X+\'/1I.1J\'});2.12.22+=",Q";2.12.20="Q";2.11(\'1Z\',7(e){5(e.8.23==\'24\'){5(g.Y(e.8).29(\'28\')>=0){2.M.27.25(e);3 4=e.8.26.1X(/\\d+$/);5(4)4=4.1O();3 1N=f.1M(g,{2:2,14:2.k.9,4:4});g.C(4)}}})},Y:7(l){3 A=l.13(\'L\')?l.13(\'L\'):l.1T;5(A){s A}1S{s""}},K:7(e){5(e&&e.8&&e.8.N&&e.8.N==\'1c\'){a(\'1f,15\').t(\'u\',\'1e\');n.F.J.O(n.F.M.O(\'p\')[0]);n.F.J.21(0)}},C:7(4){3 G=1H;5(1j(4)!=\'1Y\'){G+="&4="+i.4}3 6=1g;1K(6.z!=1o&&6.z!=6){6=6.z}6=a(6);3 q=6.1b();3 r=6.Z();3 j=1R;3 o=18;3 16=1U;3 19=18;3 b=q-(q*0.17);3 h=r-(r*0.17);5(b<16){b=q-10}5(h<19){h=r-10}5(j>b){j=b}5(o>h){o=h}i.2.c.E({1E:G,4:\'1c\',1b:j,Z:o,v:"B D - 1d 1h 1a"});a(\'1f,15\').t(\'u\',\'I\');a(\'#P\').t(\'u-y\',\'1e\');a(\'#P\').t(\'u-x\',\'I\')}});f.1G.1k(\'9\',f.k.9)})(2a.1L);',62,135,'||editor|var|id|if|win|function|target|NextGEN_AttachToPost|jQuery|maxWidth|windowManager|||tinymce|self|maxHeight|this|popupWidth|plugins|node|ngg_attach_to_post|tinyMCE|popupHeight||winWidth|winHeight|return|css|overflow|title|modal|||parent|class_name|NextGEN|render_attach_to_post_interface|Gallery|open|activeEditor|attach_to_post_url|siteurl|hidden|selection|wm_close_event|class|dom|_id|select|ngg_attach_to_post_dialog_ifr|shortcode|nggOldOpen|one|com|www|http|two|plugin_url|get_class_name|height||on|settings|getAttribute|plugin|body|minWidth|05|600|minHeight|Post|width|ngg_attach_to_post_dialog|Attach|auto|html|window|To|close|typeof|add|init|to|addCommand|null|image|cmd|addButton|create|en|version|Media|authorurl|Photocrati|author|getInfo|longname|photocrati|infourl|gallery|url|nextgen|PluginManager|nextgen_gallery_attach_to_post_url|atp_button|png|while|wp_site_url|extend|obj|pop|page|post|1200|else|className|800|wordpress|addI18n|match|undefined|mouseup|custom_elements|collapse|extended_valid_elements|tagName|IMG|cancel|src|events|ngg_displayed_gallery|indexOf|photocrati_ajax'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/package.module.cache.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/package.module.cache.php index 0519dd883..088232c39 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/package.module.cache.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/package.module.cache.php @@ -56,11 +56,14 @@ class Mixin_Cache extends Mixin */ public function flush_galleries($galleries = array()) { + global $wpdb; if (empty($galleries)) { $galleries = C_Gallery_Mapper::get_instance()->find_all(); } foreach ($galleries as $gallery) { C_Gallery_Storage::get_instance()->flush_cache($gallery); } + // Remove images still in the DB whose gallery no longer exists + $wpdb->query("DELETE FROM `{$wpdb->nggpictures}` WHERE `galleryid` NOT IN (SELECT `gid` FROM `{$wpdb->nggallery}`)"); } } \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery.po b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery.po index 6ad7352e2..e4dcde3e3 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery.po +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery.po @@ -422,7 +422,7 @@ msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php:56 #, php-format -msgid "Done! Successfully imported %s images" +msgid "Done! Successfully imported %s images. <a href=\"%s\" target=\"_blank\">Manage gallery</a>" msgstr "" #: products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php:12 @@ -457,11 +457,11 @@ msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:164 #, php-format -msgid "%s images were uploaded successfully" +msgid "%s images were uploaded successfully. <a href=\"%s\" target=\"_blank\">Manage gallery</a>" msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:167 -msgid "1 image was uploaded successfully" +msgid "1 image was uploaded successfully. <a href=\"%s\" target=\"_blank\">Manage gallery</a>" msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:170 diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/package.module.nextgen_addgallery_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/package.module.nextgen_addgallery_page.php index aec54b2a2..dab45b52a 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/package.module.nextgen_addgallery_page.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/package.module.nextgen_addgallery_page.php @@ -28,7 +28,8 @@ class A_Import_Media_Library_Form extends Mixin wp_enqueue_media(); wp_enqueue_script('nextgen_media_library_import-js'); wp_enqueue_style('nextgen_media_library_import-css'); - $i18n_array = array('title' => __('Import Images into NextGen Gallery', 'nggallery'), 'import_multiple' => __('Import %s images', 'nggallery'), 'import_singular' => __('Import 1 image', 'nggallery'), 'imported_multiple' => __('%s images were uploaded successfully', 'nggallery'), 'imported_singular' => __('1 image was uploaded successfully', 'nggallery'), 'imported_none' => __('0 images were uploaded', 'nggallery'), 'progress_title' => __('Importing gallery', 'nggallery'), 'in_progress' => __('In Progress...', 'nggallery'), 'gritter_title' => __('Upload complete', 'nggallery'), 'gritter_error' => __('An unexpected error occured. This is most likely due to a server misconfiguration. Check your PHP error log or ask your hosting provider for assistance.', 'nggallery')); + $url = admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid={gid}'; + $i18n_array = array('admin_url' => admin_url(), 'title' => __('Import Images into NextGen Gallery', 'nggallery'), 'import_multiple' => __('Import %s images', 'nggallery'), 'import_singular' => __('Import 1 image', 'nggallery'), 'imported_multiple' => sprintf(__('{count} images were uploaded successfully. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url), 'imported_singular' => sprintf(__('1 image was uploaded successfully. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url), 'imported_none' => __('0 images were uploaded', 'nggallery'), 'progress_title' => __('Importing gallery', 'nggallery'), 'in_progress' => __('In Progress...', 'nggallery'), 'gritter_title' => __('Upload complete', 'nggallery'), 'gritter_error' => __('An unexpected error occured. This is most likely due to a server misconfiguration. Check your PHP error log or ask your hosting provider for assistance.', 'nggallery')); foreach (C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image')->get_request_list() as $name => $value) { $i18n_array['sectoken'][$name] = $value; } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.js index fcaad0b28..841b751cc 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.js @@ -71,13 +71,15 @@ ngg_importml.selectors.ml_btn_import.attr('disabled', false); ngg_importml.selectors.ml_btn_select.attr('disabled', false); - delete ngg_importml.methods.import.params.gallery_id; - delete ngg_importml.methods.import.params.gallery_name; - - var msg = ngg_importml_i18n.imported_multiple.replace('%s', ngg_importml.methods.import.import_count); + var msg = ngg_importml_i18n.imported_multiple; if (ngg_importml.methods.import.import_count == 1) { msg = ngg_importml_i18n.imported_singular; } + msg = msg.replace('{gid}', ngg_importml.methods.import.params.gallery_id); + msg = msg.replace('{count}', ngg_importml.methods.import.import_count); + + delete ngg_importml.methods.import.params.gallery_id; + delete ngg_importml.methods.import.params.gallery_name; $.gritter.add({ title: ngg_importml_i18n.gritter_title, diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.js index 5aebd3cd4..897ffecd6 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.js @@ -1 +1 @@ -eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){r 2={J:1q,c:[],3:{9:$(\'#F-C-W-u-6\'),f:$(\'#F-C-Q-1r\'),j:$(\'#F-C-17-10\'),7:$(\'#F-C-17-1m\')},A:5(){L.4.A();L.4.Z()},4:{A:5(){2.v=19.16.Y.1n.2=19.16.Y({1s:k,w:8.w,1t:{K:8.1y}})},H:5(B){B=(B+\'\').1z();1l 1w(B).h(/!/g,\'%21\').h(/\'/g,\'%27\').h(/\\(/g,\'%28\').h(/\\)/g,\'%29\').h(/\\*/g,\'%1u\').h(/%20/g,\'+\')},6:{q:0,a:{1v:\'1A\'},P:5(){2.3.9.x(\'D\',k);2.3.f.x(\'D\',k);2.4.6.a.l=2.4.H(2.3.j.o());2.4.6.a.7=2.4.H(2.3.7.o());1d.1b(8.R).1e(5(G){2.4.6.a[G]=8.R[G]});2.12=$.1i({w:8.1j,1f:k,1h:8.1k});$(2).I(\'t\')},S:5(){2.12.1c(1x);2.3.9.x(\'D\',14);2.3.f.x(\'D\',14);13 2.4.6.a.l;13 2.4.6.a.7;r p=8.1W.h(\'%s\',2.4.6.q);b(2.4.6.q==1){p=8.1X}$.X.T({w:8.1V,K:p,O:k});2.4.6.q=0;2.v.I(\'1B\');2.c=[];2.3.9.i()},t:5(){r a=2.4.6.a;a.1S=[2.c.1T()];$.1Y(1Z.26,a,5(e){b(25 e.N==\'24\'){2.4.6.q++;b(2.3.j.22(\'y[M="\'+e.l+\'"]\').d==0){2.4.6.a.l=e.l;r y=$(\'<y/>\').x(\'M\',e.l).15(e.7);2.3.j.1H(y);2.3.j.o(e.l);y.1J(\'W\',k);2.3.7.o(\'\').i()}}E{$.X.T({w:8.1O,K:e.N,O:k})}b(2.c.d==0){2.4.6.S()}E{$(2).I(\'t\')}},\'1K\')}},Z:5(){$(2).m(\'t\',5(){2.4.6.t()});2.v.m(\'Q\',5(){2.c=[];2.J=2.v.1L().2a(\'1G\');2.J.1Q(5(u){u=u.1D();2.c.1C(u.10)});r p=8.1F.h(\'%s\',2.c.d);b(2.c.d==1){p=8.1U}2.3.9.15(p);2.3.9.n()});2.3.f.m(\'11\',5(z){z.18();2.v.1E()});2.3.9.m(\'11\',5(z){z.18();2.4.6.P()});2.3.j.m(\'1M\',5(){b(1N(L.M)==0){2.3.7.n().U();b(2.3.7.o().d==0){2.3.9.i();2.3.f.i()}}E{2.3.7.i(1I,5(){2.3.j.U();2.3.f.n();b(2.c.d>0){2.3.9.n()}})}});2.3.7.m(\'1R\',5(){b(2.3.7.o().d>0){2.3.7.23(\'N\');2.3.f.n();b(2.c.d>0){2.3.9.n()}}E{2.3.9.i();2.3.f.i()}})}}};$(1g).1a(5(){V.2=2;2.A();V.1o.1p()})})(1P);',62,135,'||ngg_importml|selectors|methods|function|import|gallery_name|ngg_importml_i18n|ml_btn_import|params|if|import_ids|length|data|ml_btn_select||replace|fadeOut|gallery_select|true|gallery_id|on|fadeIn|val|msg|import_count|var||send_ajax|image|ml_dialog|title|attr|option|event|initialize|str|importML|disabled|else|ngg|key|urlencode|trigger|ml_data|text|this|value|error|sticky|start|select|sectoken|done|add|focus|window|selected|gritter|media|set_events|id|click|progress_bar|delete|false|html|wp|gallery|preventDefault|top|ready|keys|close|Object|forEach|infinite|document|starting_value|nggProgressBar|progress_title|in_progress|return|name|frames|Frame_Event_Publisher|broadcast|null|opener|multiple|button|2A|action|encodeURIComponent|100|button_text|toString|import_media_library|reset|push|toJSON|open|import_multiple|selection|append|400|prop|json|state|change|parseInt|gritter_error|jQuery|map|keyup|attachment_ids|pop|import_singular|gritter_title|imported_multiple|imported_singular|post|photocrati_ajax|||find|removeClass|undefined|typeof|url||||get'.split('|'),0,{})) +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){q 2={G:1y,b:[],3:{a:$(\'#F-D-S-t-6\'),j:$(\'#F-D-15-1h\'),l:$(\'#F-D-T-17\'),8:$(\'#F-D-T-1u\')},E:5(){H.4.E();H.4.Q()},4:{E:5(){2.r=O.16.12.1v.2=O.16.12({1i:k,w:7.w,1d:{L:7.1l}})},N:5(C){C=(C+\'\').1t();1s 1n(C).e(/!/g,\'%21\').e(/\'/g,\'%27\').e(/\\(/g,\'%28\').e(/\\)/g,\'%29\').e(/\\*/g,\'%1m\').e(/%20/g,\'+\')},6:{x:0,9:{1o:\'1p\'},13:5(){2.3.a.y(\'z\',k);2.3.j.y(\'z\',k);2.4.6.9.h=2.4.N(2.3.l.n());2.4.6.9.8=2.4.N(2.3.8.n());1q.1r(7.X).1w(5(J){2.4.6.9[J]=7.X[J]});2.W=$.1c({w:7.1b,1e:k,1k:7.1f});$(2).M(\'u\')},11:5(){2.W.1g(1j);2.3.a.y(\'z\',V);2.3.j.y(\'z\',V);q d=7.1a;c(2.4.6.x==1){d=7.1x}d=d.e(\'{1G}\',2.4.6.9.h);d=d.e(\'{25}\',2.4.6.x);U 2.4.6.9.h;U 2.4.6.9.8;$.Z.Y({w:7.24,L:d,P:k});2.4.6.x=0;2.r.M(\'26\');2.b=[];2.3.a.m()},u:5(){q 9=2.4.6.9;9.2a=[2.b.2c()];$.1T(2b.1X,9,5(f){c(1Y f.K==\'1W\'){2.4.6.x++;c(2.3.l.1V(\'v[I="\'+f.h+\'"]\').i==0){2.4.6.9.h=f.h;q v=$(\'<v/>\').y(\'I\',f.h).14(f.8);2.3.l.1U(v);2.3.l.n(f.h);v.1Z(\'S\',k);2.3.8.n(\'\').m()}}A{$.Z.Y({w:7.1z,L:f.K,P:k})}c(2.b.i==0){2.4.6.11()}A{$(2).M(\'u\')}},\'23\')}},Q:5(){$(2).p(\'u\',5(){2.4.6.u()});2.r.p(\'15\',5(){2.b=[];2.G=2.r.1S().1Q(\'1F\');2.G.1R(5(t){t=t.1E();2.b.1D(t.17)});q d=7.1A.e(\'%s\',2.b.i);c(2.b.i==1){d=7.1B}2.3.a.14(d);2.3.a.o()});2.3.j.p(\'18\',5(B){B.R();2.r.1C()});2.3.a.p(\'18\',5(B){B.R();2.4.6.13()});2.3.l.p(\'1H\',5(){c(1I(H.I)==0){2.3.8.o().10();c(2.3.8.n().i==0){2.3.a.m();2.3.j.m()}}A{2.3.8.m(1O,5(){2.3.l.10();2.3.j.o();c(2.b.i>0){2.3.a.o()}})}});2.3.8.p(\'1P\',5(){c(2.3.8.n().i>0){2.3.8.1N(\'K\');2.3.j.o();c(2.b.i>0){2.3.a.o()}}A{2.3.a.m();2.3.j.m()}})}}};$(1M).1J(5(){19.2=2;2.E();19.1K.1L()})})(22);',62,137,'||ngg_importml|selectors|methods|function|import|ngg_importml_i18n|gallery_name|params|ml_btn_import|import_ids|if|msg|replace|data||gallery_id|length|ml_btn_select|true|gallery_select|fadeOut|val|fadeIn|on|var|ml_dialog||image|send_ajax|option|title|import_count|attr|disabled|else|event|str|importML|initialize|ngg|ml_data|this|value|key|error|text|trigger|urlencode|top|sticky|set_events|preventDefault|selected|gallery|delete|false|progress_bar|sectoken|add|gritter|focus|done|media|start|html|select|wp|id|click|window|imported_multiple|progress_title|nggProgressBar|button|infinite|in_progress|close|opener|multiple|100|starting_value|button_text|2A|encodeURIComponent|action|import_media_library|Object|keys|return|toString|name|frames|forEach|imported_singular|null|gritter_error|import_multiple|import_singular|open|push|toJSON|selection|gid|change|parseInt|ready|Frame_Event_Publisher|broadcast|document|removeClass|400|keyup|get|map|state|post|append|find|undefined|url|typeof|prop|||jQuery|json|gritter_title|count|reset||||attachment_ids|photocrati_ajax|pop'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.css index bc362ab6c..5137aed94 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.css @@ -41,4 +41,8 @@ .plupload_droptext { font-size: 16px; color: silver; +} + +#gritter-notice-wrapper a { + color: #00b9eb; } \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.min.css index fc0bf8ea1..68cbd81fd 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.min.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.min.css @@ -1 +1 @@ -#gallery_selection{background-color:#fff;padding:7px}#gallery_selection label{font-weight:600;position:relative;top:-1px}#gallery_selection .plupload_buttons a{margin-right:4px}#gallery_name{width:auto;min-width:200px}#gallery_name.error{border:solid 1px red}#upload_images_content{padding:0}#upload_images_content .plupload_container{padding:0}.plupload_header{display:none}.plupload_buttons{display:inline}.plupload_droptext{font-size:16px;color:silver} \ No newline at end of file +#gallery_selection{background-color:#fff;padding:7px}#gallery_selection label{font-weight:600;position:relative;top:-1px}#gallery_selection .plupload_buttons a{margin-right:4px}#gallery_name{width:auto;min-width:200px}#gallery_name.error{border:solid 1px red}#upload_images_content{padding:0}#upload_images_content .plupload_container{padding:0}.plupload_header{display:none}.plupload_buttons{display:inline}.plupload_droptext{font-size:16px;color:silver}#gritter-notice-wrapper a{color:#00b9eb} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php index b18bbcdbb..cf6b5f480 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php @@ -55,12 +55,20 @@ if (typeof(response) != 'object') response = JSON.parse(response); if (typeof(response.error) == 'string') { progress_bar.set(response.error); + progress_bar.close(4000); } else { - var message = "<?php __('Done! Successfully imported %s images', 'nggallery'); ?>"; - progress_bar.set(message.replace('%s', response.image_ids.length)); + <?php $url = admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid={gid}'; ?> + var message = '<?php echo sprintf(__('Done! Successfully imported {count} images. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url); ?>'; + message = message.replace('{count}', response.image_ids.length); + message = message.replace('{gid}', response.gallery_id); + progress_bar.close(100); + $.gritter.add({ + title: '<?php _e("Upload complete", 'nggallery'); ?>', + text: message, + sticky: true + }); } - progress_bar.close(2000); }); }) }); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php index 65938256b..039867852 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php @@ -164,13 +164,19 @@ // Determine appropriate message to display var upload_count = window.uploaded_image_ids.length; - var msg = "<?php _e('%s images were uploaded successfully', 'nggallery'); ?>"; - msg = msg.replace('%s', upload_count); - if (upload_count == 1) { - msg = "<?php _e('1 image was uploaded successfully', 'nggallery'); ?>"; - } - else if (upload_count == 0) { + var msg = ''; + + <?php $url = admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid={gid}'; ?> + + if (upload_count == 0) { msg = "<?php _e('0 images were uploaded', 'nggallery'); ?>"; + } else { + msg = '<?php printf(__('{count} images were uploaded successfully. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url); ?>'; + if (upload_count == 1) { + msg = '<?php printf(__('1 image was uploaded successfully. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url); ?>'; + } + msg = msg.replace('{gid}', $gallery_id.val()); + msg = msg.replace('{count}', upload_count); } // Display message/notification diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php index c848f9fb2..7de445ed9 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php @@ -710,6 +710,14 @@ class Mixin_NextGen_Admin_Page_Instance_Methods extends Mixin { return 'photocrati-nextgen_admin#nextgen_admin_page'; } + /** + * Returns a list of parameters to include when rendering the view + * @return array + */ + public function get_index_params() + { + return array(); + } public function show_save_button() { return TRUE; @@ -755,7 +763,9 @@ class Mixin_NextGen_Admin_Page_Instance_Methods extends Mixin } } // Render the view - $this->render_partial($this->object->index_template(), array('page_heading' => $this->object->get_page_heading(), 'tabs' => $tabs, 'errors' => $errors, 'success' => $success, 'form_header' => $token->get_form_html(), 'show_save_button' => $this->object->show_save_button(), 'model' => $this->object->has_method('get_model') ? $this->get_model() : NULL)); + $index_params = array('page_heading' => $this->object->get_page_heading(), 'tabs' => $tabs, 'errors' => $errors, 'success' => $success, 'form_header' => $token->get_form_html(), 'show_save_button' => $this->object->show_save_button(), 'model' => $this->object->has_method('get_model') ? $this->get_model() : NULL); + $index_params = array_merge($index_params, $this->object->get_index_params()); + $this->render_partial($this->object->index_template(), $index_params); } else { $this->render_view('photocrati-nextgen_admin#not_authorized', array('name' => $this->object->name, 'title' => $this->object->get_page_title())); } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php index 86b552e99..cf3281da2 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php @@ -112,7 +112,24 @@ class M_NextGen_Basic_Album extends C_Base_Module C_NextGen_Shortcode_Manager::add('album', array(&$this, 'ngglegacy_shortcode')); C_NextGen_Shortcode_Manager::add('nggalbum', array(&$this, 'ngglegacy_shortcode')); } - } + + add_filter('ngg_atp_show_display_type', array($this, 'atp_show_basic_albums'), 10, 2); + } + + /** + * ATP filters display types by not displaying those whose name attribute isn't an active POPE module. This + * is a workaround/hack to compensate for basic albums sharing a module. + * + * @param bool $available + * @param C_Display_Type $display_type + * @return bool + */ + function atp_show_basic_albums($available, $display_type) + { + if (in_array($display_type->name, array(NGG_BASIC_COMPACT_ALBUM, NGG_BASIC_EXTENDED_ALBUM))) + $available = TRUE; + return $available; + } /** * Gets a value from the parameter array, and if not available, uses the default value diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php index 86fd55208..ffdfa4526 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php @@ -143,6 +143,8 @@ class M_NextGen_Basic_Gallery extends C_Base_Module } add_action('ngg_routes', array(&$this, 'define_routes')); + + add_filter('ngg_atp_show_display_type', array($this, 'atp_show_basic_galleries'), 10, 2); } function define_routes($router) @@ -156,6 +158,21 @@ class M_NextGen_Basic_Gallery extends C_Base_Module $router->rewrite("{*}{$slug}{*}/page/{\\d}{*}", "{1}{$slug}{2}/nggpage--{3}{4}"); } + /** + * ATP filters display types by not displaying those whose name attribute isn't an active POPE module. This + * is a workaround/hack to compensate for basic slideshow & thumbnails sharing a module. + * + * @param bool $available + * @param C_Display_Type $display_type + * @return bool + */ + function atp_show_basic_galleries($available, $display_type) + { + if (in_array($display_type->name, array(NGG_BASIC_THUMBNAILS, NGG_BASIC_SLIDESHOW))) + $available = TRUE; + return $available; + } + /** * Gets a value from the parameter array, and if not available, uses the default value * diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php index 651c842d3..f0af7289d 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php @@ -422,11 +422,6 @@ class A_NextGen_Basic_Thumbnails_Controller extends Mixin { $display_settings = $displayed_gallery->display_settings; $gallery_id = $displayed_gallery->id(); - $transient_id = $displayed_gallery->transient_id; - // We must use the transient_id to identify the gallery - if ($display_settings['ajax_pagination']) { - $gallery_id = $transient_id; - } if (!$display_settings['disable_pagination']) { $current_page = (int) $this->param('nggpage', $gallery_id, 1); } else { @@ -517,7 +512,6 @@ class A_NextGen_Basic_Thumbnails_Controller extends Mixin $params['storage'] =& $storage; $params['images'] =& $images; $params['displayed_gallery_id'] = $gallery_id; - $params['transient_id'] = $displayed_gallery->transient_id; $params['current_page'] = $current_page; $params['effect_code'] = $effect_code; $params['pagination'] = $pagination; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/package.module.nextgen_basic_templates.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/package.module.nextgen_basic_templates.php index 7d2c61de3..ff477ae93 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/package.module.nextgen_basic_templates.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/package.module.nextgen_basic_templates.php @@ -74,6 +74,7 @@ class A_NextGen_Basic_Template_Form extends Mixin $gallery_map = C_Gallery_Mapper::get_instance(); $image_key = $image_map->get_primary_key_column(); $gallery_key = $gallery_map->get_primary_key_column(); + $gallery_id = $displayed_gallery->id(); $pid = $this->object->param('pid'); // because picture_list implements ArrayAccess any array-specific actions must be taken on // $picture_list->container or they won't do anything @@ -119,11 +120,6 @@ class A_NextGen_Basic_Template_Form extends Mixin $gallery->title = stripslashes($orig_gallery->title); $gallery->description = html_entity_decode(stripslashes($orig_gallery->galdesc)); $gallery->pageid = $orig_gallery->pageid; - if (!empty($displayed_gallery->display_settings['ajax_pagination'])) { - $gallery_id = $displayed_gallery->transient_id; - } else { - $gallery_id = $displayed_gallery->id(); - } $gallery->anchor = 'ngg-gallery-' . $gallery_id . '-' . $current_page; $gallery->displayed_gallery =& $displayed_gallery; $gallery->columns = @intval($displayed_gallery->display_settings['number_of_columns']); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php index 1c3c72657..f61b5fccb 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php @@ -2514,8 +2514,8 @@ class C_NextGen_Metadata extends C_Component } if (!is_array($this->exif_array)) { $meta = array(); - $exif = isset($this->exif_array['EXIF']) ? $this->exif_array['EXIF'] : array(); - if (count($exif)) { + if (isset($this->exif_data['EXIF'])) { + $exif = $this->exif_data['EXIF']; if (!empty($exif['FNumber'])) { $meta['aperture'] = 'F ' . round($this->exif_frac2dec($exif['FNumber']), 2); } @@ -3330,14 +3330,19 @@ class Mixin_NggLegacy_GalleryStorage_Driver extends Mixin public function delete_gallery($gallery) { $retval = FALSE; - if ($gallery_abspath = $this->object->get_gallery_abspath($gallery)) { - $fs = C_Fs::get_instance(); - $retval = $fs->delete($gallery_abspath); - if ($retval) { - @rmdir($fs->join_paths($gallery_abspath, 'thumbs')); - @rmdir($fs->join_paths($gallery_abspath, 'dynamic')); - @rmdir($gallery_abspath); + if ($abspath = $this->object->get_gallery_abspath($gallery)) { + // delete the directory and everything in it + $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($abspath), RecursiveIteratorIterator::CHILD_FIRST); + foreach ($iterator as $file) { + if (in_array($file->getBasename(), array('.', '..'))) { + continue; + } elseif ($file->isDir()) { + rmdir($file->getPathname()); + } elseif ($file->isFile() || $file->isLink()) { + unlink($file->getPathname()); + } } + $retval = @rmdir($abspath); } return $retval; } @@ -3610,8 +3615,11 @@ class Mixin_NggLegacy_GalleryStorage_Driver extends Mixin if (is_writable($full_abspath) && is_writable(dirname($full_abspath))) { // Copy the backup if (@copy($backup_abspath, $full_abspath)) { - // Re-create all image sizes + // Re-create non-fullsize image sizes foreach ($this->object->get_image_sizes($image) as $named_size) { + if ($named_size == 'full') { + continue; + } $this->object->generate_image_clone($backup_abspath, $this->object->get_image_abspath($image, $named_size), $this->object->get_image_size_params($image, $named_size)); } // Reimport all metadata diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php index 372827c9f..a107e77c9 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php @@ -1535,8 +1535,6 @@ class Mixin_Displayed_Gallery_Renderer extends Mixin // Validate the displayed gallery if ($displayed_gallery) { if ($displayed_gallery->validate()) { - // Set a temporary id - $displayed_gallery->id($displayed_gallery->to_transient()); // Display! return $this->object->render($displayed_gallery, TRUE, $mode); } else { @@ -1583,10 +1581,16 @@ class Mixin_Displayed_Gallery_Renderer extends Mixin if ($mode == null) { $mode = 'normal'; } - // Save the displayed gallery as a transient if it hasn't already. Allows for ajax operations - // to add or modify the gallery without losing a retrievable ID - if (!$displayed_gallery->apply_transient()) { - $displayed_gallery->to_transient(); + if (apply_filters('ngg_cache_displayed_galleries', FALSE)) { + // Save the displayed gallery as a transient if it hasn't already. Allows for ajax operations + // to add or modify the gallery without losing a retrievable ID + if (!$displayed_gallery->apply_transient()) { + $displayed_gallery->to_transient(); + } + } else { + if (is_null($displayed_gallery->id())) { + $displayed_gallery->id(md5(json_encode($displayed_gallery->get_entity()))); + } } // Get the display type controller $controller = $this->get_registry()->get_utility('I_Display_Type_Controller', $displayed_gallery->display_type); @@ -1602,6 +1606,8 @@ class Mixin_Displayed_Gallery_Renderer extends Mixin $lookup = FALSE; } elseif ($controller->is_cachable() === FALSE) { $lookup = FALSE; + } elseif (!NGG_RENDERING_CACHE_ENABLED) { + $lookup = FALSE; } // Enqueue any necessary static resources if (!defined('NGG_SKIP_LOAD_SCRIPTS') || !NGG_SKIP_LOAD_SCRIPTS) { @@ -1628,9 +1634,7 @@ class Mixin_Displayed_Gallery_Renderer extends Mixin } // Try getting the rendered HTML from the cache $key = C_Photocrati_Transient_Manager::create_key('displayed_gallery_rendering', $key_params); - if (NGG_RENDERING_CACHE_ENABLED) { - $html = C_Photocrati_Transient_Manager::fetch($key, FALSE); - } + $html = C_Photocrati_Transient_Manager::fetch($key, FALSE); // Output debug messages if ($html) { $retval .= $this->debug_msg('HIT!'); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php index 066ff8870..13edac3b6 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php @@ -17,7 +17,7 @@ class M_NextGen_Settings extends C_Base_Module 'photocrati-nextgen_settings', 'NextGEN Gallery Settings', 'Provides central management for NextGEN Gallery settings', - '0.8', + '0.9', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com' @@ -129,6 +129,7 @@ class C_NextGen_Settings_Installer // CSS Style 'activateCSS' => 1, // activate the CSS file 'CSSfile' => 'nggallery.css', // set default css filename + 'always_enable_frontend_logic' => FALSE ); } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage.php index e9889967d..30e6e4945 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage.php @@ -787,7 +787,7 @@ class nggManageGallery { check_admin_referer('ngg_updategallery'); if ( nggGallery::current_user_can( 'NextGEN Edit gallery options' ) && !isset ($_GET['s']) ) { - $tags = array('<a>', '<abbr>', '<acronym>', '<address>', '<b>', '<base>', '<basefont>', '<big>', '<blockquote>', '<br>', '<br/>', '<caption>', '<center>', '<cite>', '<code>', '<col>', '<colgroup>', '<dd>', '<del>', '<dfn>', '<dir>', '<div>', '<dl>', '<dt>', '<em>', '<fieldset>', '<font>', '<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<hr>', '<i>', '<ins>', '<label>', '<legend>', '<li>', '<menu>', '<noframes>', '<noscript>', '<ol>', '<optgroup>', '<option>', '<p>', '<pre>', '<q>', '<s>', '<samp>', '<select>', '<small>', '<span>', '<strike>', '<strong>', '<sub>', '<sup>', '<table>', '<tbody>', '<td>', '<tfoot>', '<th>', '<thead>', '<tr>', '<tt>', '<u>', '<ul>'); + $tags = array('<a>', '<abbr>', '<acronym>', '<address>', '<b>', '<base>', '<basefont>', '<big>', '<blockquote>', '<br>', '<br/>', '<caption>', '<center>', '<cite>', '<code>', '<col>', '<colgroup>', '<dd>', '<del>', '<dfn>', '<dir>', '<div>', '<dl>', '<dt>', '<em>', '<fieldset>', '<font>', '<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<hr>', '<i>', '<img>', '<ins>', '<label>', '<legend>', '<li>', '<menu>', '<noframes>', '<noscript>', '<ol>', '<optgroup>', '<option>', '<p>', '<pre>', '<q>', '<s>', '<samp>', '<select>', '<small>', '<span>', '<strike>', '<strong>', '<sub>', '<sup>', '<table>', '<tbody>', '<td>', '<tfoot>', '<th>', '<thead>', '<tr>', '<tt>', '<u>', '<ul>'); $fields = array('title', 'galdesc'); // Sanitize fields diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php index b5e50fd15..94bef145e 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php @@ -69,6 +69,8 @@ $class = ''; if (in_array($key, array('created_timestamp', 'timestamp')) && is_numeric($value)) { $value = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $value); } + if ($key == 'created_date') + $value = date_i18n(get_option('date_format'), strtotime($value)); $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"'; echo '<tr '.$class.'> <td style="width:230px">' . esc_html ( $meta->i18n_name($key) ) . '</td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php index 9e39c72d1..b94364817 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php @@ -644,7 +644,7 @@ class nggdb * @deprecated * @return */ - static function find_last_images($page = 0, $limit = 30, $exclude = true, $galleryId = 0, $orderby = "id") { + static function find_last_images($page = 0, $limit = 30, $exclude = true, $galleryId = 0, $orderby = "pid") { // Determine ordering $order_field = $orderby; $order_direction = 'DESC'; @@ -674,7 +674,7 @@ class nggdb if ($offset && $limit) $mapper->limit($limit, $offset); // Add exclusion clause - if ($exclude) $mapper->where(array("exclude = %d"), 1); + if ($exclude) $mapper->where(array("exclude = 0")); // Add gallery clause if ($galleryId) $mapper->where(array("galleryid = %d"), $galleryId); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php index 720d66de5..a1f71f821 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php @@ -51,7 +51,7 @@ class nggPostThumbnail { if (version_compare($wp_version, '3.5', '>=') && $thumbnail_id <= 0) { - $iframe_src = get_upload_iframe_src('image'); + $iframe_src = get_upload_iframe_src('image', $post_id); $iframe_src = remove_query_arg('TB_iframe', $iframe_src); $iframe_src = add_query_arg('tab', 'nextgen', $iframe_src); $iframe_src = add_query_arg('chromeless', '1', $iframe_src); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php index 7b06caa2f..5bacec08f 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php @@ -76,6 +76,13 @@ class M_Third_Party_Compat extends C_Base_Module define('NGG_DISABLE_RESOURCE_MANAGER', TRUE); } + // Cornerstone's page builder requires a 'clean slate' of css/js that our resource manager interefers with + if (class_exists('Cornerstone')) + { + if (!defined('NGG_DISABLE_FILTER_THE_CONTENT')) define('NGG_DISABLE_FILTER_THE_CONTENT', TRUE); + if (!defined('NGG_DISABLE_RESOURCE_MANAGER')) define('NGG_DISABLE_RESOURCE_MANAGER', TRUE); + } + // Genesis Tabs creates a new query / do_shortcode loop which requires these be set if (class_exists('Genesis_Tabs')) { @@ -113,6 +120,7 @@ class M_Third_Party_Compat extends C_Base_Module add_filter('run_ngg_resource_manager', array($this, 'check_wpecommerce_download')); add_filter('run_ngg_resource_manager', array($this, 'check_mafs_download')); add_filter('run_ngg_resource_manager', array($this, 'check_wps_download')); + add_filter('ngg_atp_show_display_type', array($this, 'atp_check_pro_albums'), 10, 2); // WPML fix if (class_exists('SitePress')) { @@ -125,6 +133,18 @@ class M_Third_Party_Compat extends C_Base_Module add_action('the_post', array(&$this, 'add_ngg_pro_page_parameter')); } + function atp_check_pro_albums($available, $display_type) + { + if (!defined('NGG_PRO_ALBUMS')) + return $available; + + if (in_array($display_type->name, array(NGG_PRO_LIST_ALBUM, NGG_PRO_GRID_ALBUM)) + && $this->get_registry()->is_module_loaded(NGG_PRO_ALBUMS)) + $available = TRUE; + + return $available; + } + /** * Determine if the requested URL is a WP-Photo-Seller download and adjust the resource manager * diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/package.module.widget.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/package.module.widget.php index b19bfb727..c175be566 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/package.module.widget.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/package.module.widget.php @@ -59,7 +59,7 @@ class C_Widget_Gallery extends WP_Widget public function __construct() { $widget_ops = array('classname' => 'ngg_images', 'description' => __('Add recent or random images from the galleries', 'nggallery')); - $this->WP_Widget('ngg-images', __('NextGEN Widget', 'nggallery'), $widget_ops); + parent::__construct('ngg-images', __('NextGEN Widget', 'nggallery'), $widget_ops); } public function form($instance) { @@ -159,7 +159,7 @@ class C_Widget_MediaRSS extends WP_Widget public function __construct() { $widget_ops = array('classname' => 'ngg_mrssw', 'description' => __('Widget that displays Media RSS links for NextGEN Gallery.', 'nggallery')); - $this->WP_Widget('ngg-mrssw', __('NextGEN Media RSS', 'nggallery'), $widget_ops); + parent::__construct('ngg-mrssw', __('NextGEN Media RSS', 'nggallery'), $widget_ops); } public function form($instance) { @@ -215,7 +215,7 @@ class C_Widget_Slideshow extends WP_Widget public function __construct() { $widget_ops = array('classname' => 'widget_slideshow', 'description' => __('Show a NextGEN Gallery Slideshow', 'nggallery')); - $this->WP_Widget('slideshow', __('NextGEN Slideshow', 'nggallery'), $widget_ops); + parent::__construct('slideshow', __('NextGEN Slideshow', 'nggallery'), $widget_ops); } public function form($instance) { diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/product.photocrati_nextgen.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/product.photocrati_nextgen.php index cb7a37290..765d9c837 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/product.photocrati_nextgen.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/product.photocrati_nextgen.php @@ -37,7 +37,6 @@ class P_Photocrati_NextGen extends C_Base_Product // Front-end only 'photocrati-dynamic_stylesheet' => 'frontend', - 'photocrati-mediarss' => 'frontend', // Backend-only 'photocrati-nextgen_pro_upgrade' => 'backend', diff --git a/wp-content/plugins/nextgen-gallery/readme.txt b/wp-content/plugins/nextgen-gallery/readme.txt index d22477a77..9a707dd7a 100644 --- a/wp-content/plugins/nextgen-gallery/readme.txt +++ b/wp-content/plugins/nextgen-gallery/readme.txt @@ -2,17 +2,17 @@ Contributors: photocrati Tags: nextgen, nextgen gallery, gallery, galleries, image, images, image gallery, photo, photos, photo gallery, picture, pictures, picture gallery, album, albums, photo albums, image album, media, media gallery, thumbnails, thumbnail gallery, thumbnail galleries, slideshow, slideshows, slideshow gallery, slideshow galleries, fancybox, lightbox, responsive, responsive gallery, responsive galleries, wordpress responsive gallery, nextcellent, wordpress gallery plugin, wordpress photo gallery plugin, wp gallery, wp gallery plugins, best gallery plugin, free photo gallery, singlepic, image captions imagebrowser, watermarks, watermarking, photography, photographer Requires at least: 3.6.1 -Tested up to: 4.2.2 -Stable tag: 2.1.2 +Tested up to: 4.3.0 +Stable tag: 2.1.7 License: GPLv2 -The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 12 million downloads. +The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 13 million downloads. == Description == = WordPress Gallery Plugin = -NextGEN Gallery is the most popular **WordPress gallery plugin**, and one of the most popular WordPress plugins of all time, with over 12 million downloads. +NextGEN Gallery is the most popular **WordPress gallery plugin**, and one of the most popular WordPress plugins of all time, with over 13 million downloads. It provides a powerful engine for uploading and managing galleries of images, with the ability to batch upload, import meta data, add/delete/rearrange/sort images, edit thumbnails, group galleries into albums, and more. It also provides two front-end display styles (slideshows and thumbnail galleries), both of which come with a wide array of options for controlling size, style, timing, transitions, controls, lightbox effects, and more. @@ -199,6 +199,18 @@ For more information, feel free to visit the official website for the NextGEN Ga == Changelog == += V2.1.7 - 08.12.2015 = +* Changed: "Flush image cache" now removes images from the database w/o a gallery +* Changed: "Show Meta" popup: parse date_format through date_i18n() +* Changed: Made Add Gallery/Images notifications a link to the gallery +* Changed: No longer cache displayed galleries as transients +* Changed: Updated widgets to use PHP5 parent::__construct() over $this->WP_Widget() +* Fixed: C_NextGen_Metadata->get_EXIF() was bugged with imagebrowser-exif template +* Fixed: Cornerstone/X compatibility +* Fixed: Recovering images was 'generating' from backup instead of copying +* Fixed: Setting post thumbnail more than once on a page/post +* Fixed: Permanently hide display types from ATP without an active POPE module + = V2.1.2 - 07.20.2015 = * NEW: Ability to import from Media Library * NEW: Added filter 'ngg_datamapper_table_name' -- GitLab