Image Photo Gallery Final Tiles Grid - Version 3.3.24

Version Description

Download this release

Release Info

Developer GreenTreeLabs
Plugin Icon 128x128 Image Photo Gallery Final Tiles Grid
Version 3.3.24
Comparing to
See all releases

Code changes from version 3.3.22 to 3.3.24

FinalTilesGalleryLite.php CHANGED
@@ -1,250 +1,254 @@
1
  <?php
2
 
3
- /**
4
- * Plugin Name: Final Tiles Grid Gallery - Image Gallery
5
- * Plugin URI: https://www.final-tiles-gallery.com
6
- * Description: Wordpress Plugin for creating responsive image galleries. By: GreenTreeLabs
7
- * Author: Green Tree Labs
8
- * Version: 3.3.22
9
- * Author URI: https://www.greentreelabs.net
10
- *
11
- * @fs_premium_only /lightbox-pro/
12
- *
13
  */
14
- define( 'FTGVERSION', '3.3.22' );
15
- /*
16
- Changelog:
17
- 3.3.22
18
- Added "ask for review" functionality
19
- 3.3.21
20
- Fixed disabled hover rotation field
21
- 3.3.20
22
- Fixed disabled caption behaviour field
23
- 3.3.19
24
- Fixed ignored caption font size
25
- 3.3.18
26
- Fixed issue with iconv function
27
- 3.3.17
28
- Fixed issues in admin panel
29
- 3.3.16
30
- Fixed plugin name
31
- 3.3.15
32
- Fixed minor issue
33
- 3.3.14
34
- Fixed bug
35
- 3.3.13
36
- Fixed menu slug
37
- 3.3.12
38
- Lite version code merged with premium
39
- 3.3.10
40
- Bug fix (wrong behaviour on mobile with columns layout)
41
- 3.3.9
42
- Extended support for PHP versions
43
- 3.3.8
44
- Bug fix (Woocommerce categories were ignored)
45
- 3.3.7
46
- Bug fix (Youtube videos not showing in lightboxes)
47
- 3.3.6
48
- Bug fix (Vimeo videos not showing in lightboxes)
49
- 3.3.5
50
- Enhanced compatibility with EverlightBox
51
- 3.3.4
52
- Bug fix (woocommerce 3.1.x galleries not working)
53
- Admin UI minor fixes
54
- 3.3.3
55
- Bug fix (wrong behaviour of captions on mobile devices)
56
- 3.3.2
57
- Bug fix (videos not using the masonry layout)
58
- 3.3.1
59
- Bug fix (videos not visible)
60
- 3.3.0
61
- Use gallery options inside shortcode
62
- Enhanced backend UI
63
- Added new caption behaviours
64
- Fix FitVid conflicts
65
- Added Hover effects and Image loaded effects presets
66
- Added hover effect duration
67
- Added new feature: disable grid size below given screen width
68
- Added title and description to LightGallery
69
- 3.2.9
70
- Added support for EverlightBox
71
- Renamed get_image_sizes function to avoid conflicts
72
- 3.2.8
73
- Minor Bug fix
74
- 3.2.7
75
- Minor Bug fix
76
- 3.2.6
77
- Bug fix
78
- New feature: choose image size for lightbox
79
- 3.2.5
80
- SwipeBox now supports filters
81
- Download the full size from LighGallery
82
- Ajax loading (beta)
83
- 3.2.4
84
- Bug fix
85
- 3.2.3
86
- Bug fix
87
- 3.2.2
88
- Bug fix
89
- 3.2.1
90
- Bug fix
91
- 3.2.0
92
- Lightbox groups
93
- Hidden images
94
- 3.1.32
95
- Added date filter to media panel
96
- Added support to Enhanced Media Panel
97
- Lazy loading with multiple image loading
98
- Pre-selected filter
99
- 3.1.31
100
- Enhanced compatibility with other plugins and themes by adding data-class attribute on images
101
- 3.1.30
102
- Fixed jQuery issue
103
- 3.1.29
104
- Minor bug fix
105
- 3.1.28
106
- Bug fix
107
- 3.1.27
108
- Alt tag
109
- 3.1.26
110
- Bug fix
111
- 3.1.25
112
- Bug fix
113
- 3.1.24
114
- Bug fix
115
- 3.1.23
116
- Fixed bug occuring with Lazy load + Filters
117
- 3.1.22
118
- Lazy load
119
- 3.1.21
120
- New layout Masonry
121
- 3.1.20
122
- Max number of posts for "Recent posts" galleries
123
- 3.1.19
124
- Open videos in lightbox
125
- 3.1.18
126
- Admin panel enhancements
127
- Fixed issue about Magnific Popup being loaded even when not needed
128
- 3.1.17
129
- New lightbox added: Lightgallery
130
- Fixed minor bug in Custom CSS (removed slashes)
131
- 3.1.16
132
- Fixed bug in 'Recent posts' galleries, now it's possible to link posts
133
- 3.1.15
134
- Added new lightbox: LightGallery
135
- 3.1.14
136
- Import/Export features, Set title font size, select images by filter (backend), choose mobile lightbox
137
- 3.1.13
138
- Fixed issue with some lightboxes on pages with more than one gallery
139
- 3.1.12
140
- Solved conflicts with FitVids
141
- 3.1.11
142
- [Backend] edit gallery by clicking the tile
143
- 3.1.10
144
- Bug fix
145
- 3.1.9
146
- Load gallery with a selected filter, choose to reload page after clicking a filter,
147
- choose gallery from text editor, load scripts from footer for enhanced page load
148
- 3.1.8
149
- Updated material design fonts
150
- 3.1.7
151
- Fix grid size 0
152
- 3.1.6
153
- Minor bug fix
154
- 3.1.5
155
- Image loaded effects
156
- 3.1.4
157
- Bug fix
158
- 3.1.3
159
- Set a custom label for "All" filter, Choose size of images in admin panel, Loading bar color, Loading bar background color, Caption font size, Sequential image loading
160
- 3.1.2
161
- PrettyPhoto security fix
162
- 3.1.1
163
- Minor bug fix
164
- 3.1.0
165
- New Backoffice
166
- Wizard
167
- WooCommerce products
168
- New caption styles
169
- Earn money with referral
170
- 3.0.21
171
- Bug fix
172
- 3.0.20
173
- Support for Social Gallery plugin by EpicPlugins
174
- 3.0.19
175
- Bug fix
176
- 3.0.18
177
- Posts galleries can use lightboxes
178
- 3.0.17
179
- Bug fix
180
- 3.0.16
181
- Filters available with recent posts
182
- 3.0.15
183
- bug fix
184
- 3.1.14
185
- New customization fields: before gallery text and after gallery text
186
- 3.0.13
187
- Removed unused gallery properties
188
- Read "Description" field from media panel
189
- Added delay control
190
- 3.0.12
191
- minor bug fix
192
- 3.0.11
193
- Image width and height attributes are now ignored
194
- 3.0.10
195
- Added compatibility with Cherry themes
196
- 3.0.9
197
- Minor bug fix
198
- 3.0.8
199
- Minor bug fix
200
- 3.0.7
201
- Minor bug fix
202
- 3.0.6
203
- Added filters in media panel
204
- 3.0.5
205
- Minor bug fix
206
- 3.0.4
207
- Minor bug fix
208
- 3.0.3
209
- Bug fix
210
- 3.0.2
211
- Bug fix
212
- 3.0.1
213
- Bug fix
214
- 3.0
215
- New grid layout algorithm
216
- Video support, reverse order option
217
- Automatic gallery with recent posts, toggle HTML compression, caption behavior on mobile devices, custom caption icon, update to FontAwesone 4.1.0
218
- 2.1.10
219
- Lazy loading
220
- 2.1.9
221
- Fixed issue with single quote character in captions
222
- 2.1.8
223
- Re-activated html compression
224
- 2.1.7
225
- Fixed notice messages
226
- 2.1.6
227
- Magnific Popup and Lightbox now work with gallery filters
228
- 2.1.5
229
- New feature: dynamic image size factor
230
- 2.1.4
231
- New fields: CSS class and REL on A tag
232
- 2.1.3
233
- Social icons bug fix
234
-
235
- 2.1.2
236
- Show empty captions
237
- Inverted captions (visible then hidden on mouse over)
238
- Icons in captions
239
- Admin redesign UI
240
- Enable/Disable effects on mouse over
241
- Caption auto height
242
- Set color of social sharing icons
243
- Fixed captions
244
- Loading progress bar
245
- Minor bugs fixes
246
- Page with support request instructions
247
- Page with instructions
 
 
 
 
248
  */
249
  if ( !function_exists( 'ftg_fs' ) ) {
250
  // Create a helper function for easy SDK access.
@@ -309,7 +313,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
309
  'captionIcon' => 'zoom',
310
  'captionIconColor' => '#ffffff',
311
  'captionIconSize' => 12,
312
- 'captionMobileBehavior' => 'desktop',
313
  'captionOpacity' => 80,
314
  'captionPosition' => 'inside',
315
  'captionVerticalAlignment' => 'middle',
@@ -356,8 +360,8 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
356
  'loadedScaleY' => 100,
357
  'loadedScaleX' => 100,
358
  'loadedVSlide' => 0,
359
- 'loadingBarBackgroundColor' => '#fff',
360
- 'loadingBarColor' => '#666',
361
  'loadMethod' => 'sequential',
362
  'margin' => 10,
363
  'max_posts' => 0,
@@ -501,46 +505,42 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
501
  if ( !$valid ) {
502
  return;
503
  }
 
504
  ?>
505
- <div class="notice notice-info is-dismissible ftg-review-notice">
506
  <p><?php
507
  _e( 'Hey, I noticed you created a photo gallery with Final Tiles - that’s awesome! Would you mind give it a 5-star rating on WordPress to help us spread the word and boost our motivation for new featrues?', 'final-tiles-gallery-lite' );
508
- ?>
509
- </p>
510
  <p><strong><?php
511
  _e( 'Diego Imbriani<br>Founder of GreenTreeLabs', 'final-tiles-gallery' );
512
- ?>
513
- </strong></p>
514
- <p>
515
  <a href="https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/reviews/?filter=5#new-post" class="ftg-dismiss-review-notice ftg-review-out" target="_blank" rel="noopener"><?php
516
  _e( 'Ok, you deserve it', 'final-tiles-gallery-lite' );
517
- ?>
518
- </a><br>
519
  <a href="#" class="ftg-dismiss-review-notice" rel="noopener"><?php
520
  _e( 'Nope, maybe later', 'final-tiles-gallery' );
521
- ?>
522
- </a><br>
523
  <a href="#" class="ftg-dismiss-review-notice" rel="noopener"><?php
524
  _e( 'I already did', 'final-tiles-gallery' );
525
- ?>
526
- </a><br>
527
- </p>
528
- </div>
529
- <script type="text/javascript">
530
- jQuery(document).ready( function($) {
531
- $(document).on('click', '.ftg-dismiss-review-notice, .ftg-review-notice button', function( event ) {
532
- if ( ! $(this).hasClass('ftg-review-out') ) {
533
- event.preventDefault();
534
- }
535
-
536
- $.post( ajaxurl, {
537
- action: 'ftg_dismiss_review'
538
- });
539
-
540
- $('.ftg-review-notice').remove();
541
- });
542
- });
543
- </script>
544
  <?php
545
  }
546
 
@@ -582,15 +582,16 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
582
  'excludeFrom'
583
  );
584
  foreach ( $this->fields as $tab_name => $tab ) {
585
- foreach ( $tab['fields'] as $key => $field ) {
586
  //print_r($field);
587
  foreach ( $keys as $kk ) {
588
  if ( !array_key_exists( $kk, $field ) ) {
589
- $this->fields[$tab_name]['fields'][$key][$kk] = '';
590
  }
591
  }
592
  }
593
  }
 
594
  }
595
 
596
  public function register_links( $links, $file )
@@ -678,16 +679,16 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
678
 
679
  public function attachment_fields_to_edit( $form, $post )
680
  {
681
- $form['ftg_link'] = array(
682
- 'label' => 'Link <small>FTG</small>',
683
- 'input' => 'text',
684
- 'value' => get_post_meta( $post->ID, '_ftg_link', true ),
685
- 'helps' => '',
686
  );
687
- $form['ftg_target'] = array(
688
- 'label' => '_blank <small>FTG</small>',
689
- 'input' => 'html',
690
- 'html' => "<input type='checkbox' name='attachments[{$post->ID}][ftg_target]' id='attachments[{$post->ID}][ftg_target]' value='_mblank' " . (( get_post_meta( $post->ID, '_ftg_target', true ) == '_mblank' ? 'checked' : '' )) . ' />',
691
  );
692
  return $form;
693
  }
@@ -709,7 +710,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
709
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
710
  $this->FinalTilesdb->deleteGallery( intval( $_POST['id'] ) );
711
  }
712
- die;
713
  }
714
 
715
  public function update_configuration()
@@ -721,7 +722,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
721
  $this->FinalTilesdb->update_config( $id, $config );
722
  }
723
 
724
- die;
725
  }
726
 
727
  public function get_configuration()
@@ -733,7 +734,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
733
  echo $gallery ;
734
  }
735
 
736
- die;
737
  }
738
 
739
  public function get_image_size_url()
@@ -741,7 +742,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
741
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
742
  echo wp_get_attachment_image_url( $_POST['id'], $_POST['size'], false ) ;
743
  }
744
- die;
745
  }
746
 
747
  //Clone gallery
@@ -751,7 +752,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
751
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
752
  $sourceId = intval( $_POST['id'] );
753
  $g = $this->FinalTilesdb->getGalleryById( $sourceId, true );
754
- $g['name'] .= ' (copy)';
755
  $this->FinalTilesdb->addGallery( $g );
756
  $id = $this->FinalTilesdb->getNewGalleryId();
757
  $images = $this->FinalTilesdb->getImagesByGalleryId( $sourceId );
@@ -762,7 +763,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
762
  $this->FinalTilesdb->addImages( $id, $images );
763
  }
764
 
765
- die;
766
  }
767
 
768
  //Add gallery scripts
@@ -797,15 +798,15 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
797
  wp_enqueue_media();
798
  }
799
  $ftg_db_version = '5.0';
800
- $installed_ver = get_option( 'FinalTiles_gallery_db_version' );
801
  if ( !$installed_ver ) {
802
- update_option( 'FinalTiles_gallery_db_version', $ftg_db_version );
803
  }
804
  $this->FinalTilesdb->updateConfiguration();
805
 
806
  if ( $installed_ver != $ftg_db_version ) {
807
  $this->create_db_tables();
808
- update_option( 'FinalTiles_gallery_db_version', $ftg_db_version );
809
  }
810
 
811
  function ftg_get_image_sizes()
@@ -836,9 +837,9 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
836
  }
837
 
838
  foreach ( ftg_get_image_sizes() as $name => $size ) {
839
- $this->fields['Links & Lightbox']['fields']['lightboxImageSize']['values']['Size'][] = $name . '|' . $name . ' (' . $size['width'] . 'x' . $size['height'] . (( $size['crop'] ? ' cropped)' : ')' ));
840
  }
841
- $this->fields['Links & Lightbox']['fields']['lightboxImageSize']['values']['Size'][] = 'full|Original (full)';
842
  wp_enqueue_script( 'jquery' );
843
  wp_enqueue_script( 'jquery-ui-dialog' );
844
  wp_enqueue_script( 'jquery-ui-sortable' );
@@ -906,35 +907,35 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
906
  global $ftg_fields ;
907
  $ftg_fields = $this->fields;
908
  global $ftg_parent_page ;
909
- $ftg_parent_page = 'dashboard';
910
 
911
- if ( array_key_exists( 'id', $_GET ) ) {
912
  $woocommerce_post_types = array(
913
- 'product',
914
- 'product_variation',
915
- 'shop_order',
916
- 'shop_order_refund',
917
- 'shop_coupon',
918
- 'shop_webhook'
919
  );
920
- $wp_post_types = array( 'revision', 'nav_menu_item' );
921
  $excluded_post_types = array_merge( $wp_post_types, $woocommerce_post_types );
922
  $woo_categories = $this->getWooCategories();
923
- include 'admin/edit-gallery.php';
924
  } else {
925
- include 'admin/overview.php';
926
  }
927
 
928
  }
929
 
930
  public function tutorial()
931
  {
932
- include 'admin/tutorial.php';
933
  }
934
 
935
  public function support()
936
  {
937
- include 'admin/support.php';
938
  }
939
 
940
  private function getWooCategories()
@@ -973,23 +974,23 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
973
  $ftg_fields = $this->fields;
974
  $gallery = null;
975
  $woocommerce_post_types = array(
976
- 'product',
977
- 'product_variation',
978
- 'shop_order',
979
- 'shop_order_refund',
980
- 'shop_coupon',
981
- 'shop_webhook'
982
  );
983
- $wp_post_types = array( 'revision', 'nav_menu_item' );
984
  $excluded_post_types = array_merge( $wp_post_types, $woocommerce_post_types );
985
  $woo_categories = $this->getWooCategories();
986
- include 'admin/add-gallery.php';
987
  }
988
 
989
  public function delete_image()
990
  {
991
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
992
- foreach ( explode( ',', $_POST['id'] ) as $id ) {
993
  $this->FinalTilesdb->deleteImage( intval( $id ) );
994
  }
995
  }
@@ -1001,13 +1002,13 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1001
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1002
 
1003
  if ( $_POST['source'] == 'posts' ) {
1004
- foreach ( explode( ',', $_POST['id'] ) as $id ) {
1005
  update_post_meta( intval( $id ), 'ftg_filters', $_POST['filters'] );
1006
  }
1007
  } else {
1008
- foreach ( explode( ',', $_POST['id'] ) as $id ) {
1009
  $result = $this->FinalTilesdb->editImage( $id, array(
1010
- 'filters' => $_POST['filters'],
1011
  ) );
1012
  }
1013
  }
@@ -1019,10 +1020,10 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1019
  public function toggle_visibility()
1020
  {
1021
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1022
- foreach ( explode( ',', $_POST['id'] ) as $id ) {
1023
  $image = $this->FinalTilesdb->getImage( $id );
1024
  $this->FinalTilesdb->editImage( $id, array(
1025
- 'hidden' => ( $image->hidden == 'T' ? 'F' : 'T' ),
1026
  ) );
1027
  }
1028
  }
@@ -1034,13 +1035,13 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1034
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1035
 
1036
  if ( $_POST['source'] == 'posts' ) {
1037
- foreach ( explode( ',', $_POST['id'] ) as $id ) {
1038
  update_post_meta( intval( $id ), 'ftg_group', $_POST['group'] );
1039
  }
1040
  } else {
1041
- foreach ( explode( ',', $_POST['id'] ) as $id ) {
1042
  $result = $this->FinalTilesdb->editImage( $id, array(
1043
- 'group' => $_POST['group'],
1044
  ) );
1045
  }
1046
  }
@@ -1054,15 +1055,15 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1054
 
1055
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1056
  $gid = intval( $_POST['galleryId'] );
1057
- $enc_images = stripslashes( $_POST['enc_images'] );
1058
  $images = json_decode( $enc_images );
1059
  $result = $this->FinalTilesdb->addImages( $gid, $images );
1060
- header( 'Content-type: application/json' );
1061
 
1062
  if ( $result === false ) {
1063
- echo '{"success":false}' ;
1064
  } else {
1065
- echo '{"success":true}' ;
1066
  }
1067
 
1068
  }
@@ -1094,12 +1095,12 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1094
 
1095
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1096
  $result = $this->FinalTilesdb->sortImages( explode( ',', $_POST['ids'] ) );
1097
- header( 'Content-type: application/json' );
1098
 
1099
  if ( $result === false ) {
1100
- echo '{"success":false}' ;
1101
  } else {
1102
- echo '{"success":true}' ;
1103
  }
1104
 
1105
  }
@@ -1112,7 +1113,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1112
  require_once 'lib/gallery-class.php';
1113
 
1114
  if ( check_admin_referer( 'finaltilesgallery', 'finaltilesgallery' ) ) {
1115
- $gid = intval( $_POST['gallery'] );
1116
  $images = $this->FinalTilesdb->getImagesByGalleryId( $gid );
1117
  $FinalTilesGallery = new FinalTilesGallery( $gid, $this->FinalTilesdb, $this->defaultValues );
1118
  echo $FinalTilesGallery->images_markup() ;
@@ -1139,7 +1140,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1139
  $postId = intval( $_POST['post_id'] );
1140
  $img_url = stripslashes( $_POST['img_url'] );
1141
  update_post_meta( $postId, 'ftg_image_url', $img_url );
1142
- if ( array_key_exists( 'filters', $_POST ) && strlen( $_POST['filters'] ) ) {
1143
  update_post_meta( $postId, 'ftg_filters', $_POST['filters'] );
1144
  }
1145
  } else {
@@ -1155,34 +1156,34 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1155
  $imageId = intval( $_POST['img_id'] );
1156
  $sortOrder = intval( $_POST['sortOrder'] );
1157
  $data = array(
1158
- 'imagePath' => $imageUrl,
1159
- 'target' => $target,
1160
- 'link' => $link,
1161
- 'imageId' => $imageId,
1162
- 'description' => $imageCaption,
1163
- 'filters' => $filters,
1164
- 'title' => $title,
1165
- 'group' => $group,
1166
- 'hidden' => $hidden,
1167
- 'sortOrder' => $sortOrder,
1168
  );
1169
 
1170
- if ( !empty($_POST['id']) ) {
1171
  $imageId = intval( $_POST['id'] );
1172
  $result = $this->FinalTilesdb->editImage( $imageId, $data );
1173
  } else {
1174
- $data['gid'] = intval( $_POST['galleryId'] );
1175
  $result = $this->FinalTilesdb->addFullImage( $data );
1176
  }
1177
 
1178
  }
1179
 
1180
- header( 'Content-type: application/json' );
1181
 
1182
  if ( $result === false ) {
1183
- echo '{"success":false}' ;
1184
  } else {
1185
- echo '{"success":true}' ;
1186
  }
1187
 
1188
  }
@@ -1195,31 +1196,31 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1195
 
1196
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1197
  $result = false;
1198
- $type = ( isset( $_POST['type'] ) ? $_POST['type'] : '' );
1199
  $data = array(
1200
- 'imagePath' => stripslashes( $_POST['embed'] ),
1201
- 'filters' => stripslashes( $_POST['filters'] ),
1202
- 'gid' => intval( $_POST['galleryId'] ),
1203
  );
1204
- $id = ( isset( $_POST['id'] ) ? intval( $_POST['id'] ) : '' );
1205
- $step = ( isset( $_POST['step'] ) ? $_POST['step'] : '' );
1206
  if ( !empty($step) ) {
1207
 
1208
- if ( $step == 'add' ) {
1209
  $result = $this->FinalTilesdb->addVideo( $data );
1210
  } else {
1211
- if ( $step == 'edit' ) {
1212
  $result = $this->FinalTilesdb->editVideo( $id, $data );
1213
  }
1214
  }
1215
 
1216
  }
1217
- header( 'Content-type: application/json' );
1218
 
1219
  if ( $result === false ) {
1220
- echo '{"success":false}' ;
1221
  } else {
1222
- echo '{"success":true}' ;
1223
  }
1224
 
1225
  }
@@ -1231,11 +1232,11 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1231
  {
1232
 
1233
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1234
- $gid = intval( $_POST['gid'] );
1235
  $imageResults = $this->FinalTilesdb->getImagesByGalleryId( $gid );
1236
  $gallery = $this->FinalTilesdb->getGalleryById( $gid );
1237
- $list_size = 'medium';
1238
- $column_size = 's6 m3 l3';
1239
  if ( isset( $_POST['list_size'] ) && !empty($_POST['list_size']) ) {
1240
  $list_size = $_POST['list_size'];
1241
  }
@@ -1261,23 +1262,23 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1261
 
1262
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1263
  $data = $this->defaultValues;
1264
- $data['name'] = $_POST['ftg_name'];
1265
- $data['description'] = $_POST['ftg_description'];
1266
- $data['source'] = $_POST['ftg_source'];
1267
- $data['wp_field_caption'] = $_POST['ftg_wp_field_caption'];
1268
- $data['wp_field_title'] = $_POST['ftg_wp_field_title'];
1269
- $data['captionEffect'] = $_POST['ftg_captionEffect'];
1270
- $data['post_categories'] = $_POST['post_categories'];
1271
- $data['post_tags'] = $_POST['post_tags'];
1272
- $data['layout'] = $_POST['layout'];
1273
- $data['defaultWooImageSize'] = $_POST['def_imgsize'];
1274
- $data['defaultPostImageSize'] = $_POST['def_imgsize'];
1275
- $data['woo_categories'] = $_POST['woo_categories'];
1276
  $result = $this->FinalTilesdb->addGallery( $data );
1277
  $id = $this->FinalTilesdb->getNewGalleryId();
1278
 
1279
  if ( $id > 0 && array_key_exists( 'enc_images', $_POST ) && strlen( $_POST['enc_images'] ) ) {
1280
- $enc_images = stripslashes( $_POST['enc_images'] );
1281
  $images = json_decode( $enc_images );
1282
  $result = $this->FinalTilesdb->addImages( $id, $images );
1283
  }
@@ -1304,7 +1305,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1304
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1305
  $galleryName = stripslashes( $_POST['ftg_name'] );
1306
  $galleryDescription = stripslashes( $_POST['ftg_description'] );
1307
- $slug = strtolower( str_replace( ' ', '', $galleryName ) );
1308
  $margin = intval( $_POST['ftg_margin'] );
1309
  $minTileWidth = intval( $_POST['ftg_minTileWidth'] );
1310
  $gridCellSize = intval( $_POST['ftg_gridCellSize'] );
@@ -1455,7 +1456,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1455
  'loadedRotateY' => intval( $_POST['ftg_loadedRotateY'] ),
1456
  'loadedRotateX' => intval( $_POST['ftg_loadedRotateX'] ),
1457
  );
1458
- header( 'Content-type: application/json' );
1459
 
1460
  if ( $id > 0 ) {
1461
  $result = $this->FinalTilesdb->editGallery( $id, $data );
@@ -1466,9 +1467,9 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1466
 
1467
 
1468
  if ( $result ) {
1469
- echo '{"success":true,"id":' . $id . '}' ;
1470
  } else {
1471
- echo '{"success":false}' ;
1472
  }
1473
 
1474
  }
@@ -1484,7 +1485,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1484
  foreach ( $sizes as $size ) {
1485
  $image = wp_get_attachment_image_src( $id, $size );
1486
  if ( !empty($image) && (true == $image[3] || 'full' == $size) ) {
1487
- $result["{$image['1']}x{$image['2']}"] = $image[0];
1488
  }
1489
  }
1490
  ksort( $result );
@@ -1507,73 +1508,73 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1507
  );
1508
  $settings = $FinalTilesGallery->getGallery();
1509
  switch ( $settings->lightbox ) {
1510
- case 'magnific':
1511
  wp_enqueue_style( 'magnific_stylesheet' );
1512
  wp_enqueue_script( 'magnific_script' );
1513
  break;
1514
- case 'prettyphoto':
1515
  wp_enqueue_style( 'prettyphoto_stylesheet' );
1516
  wp_enqueue_script( 'prettyphoto_script' );
1517
  break;
1518
- case 'fancybox':
1519
  wp_enqueue_style( 'fancybox_stylesheet' );
1520
  wp_enqueue_script( 'fancybox_script' );
1521
  break;
1522
- case 'colorbox':
1523
  wp_enqueue_style( 'colorbox_stylesheet' );
1524
  wp_enqueue_script( 'colorbox_script' );
1525
  break;
1526
- case 'swipebox':
1527
  wp_enqueue_style( 'swipebox_stylesheet' );
1528
  wp_enqueue_script( 'swipebox_script' );
1529
  break;
1530
- case 'lightbox2':
1531
  wp_enqueue_style( 'lightbox2_stylesheet' );
1532
  wp_enqueue_script( 'lightbox2_script' );
1533
  break;
1534
- case 'image-lightbox':
1535
  wp_enqueue_script( 'image-lightbox_script' );
1536
- case 'lightgallery':
1537
  wp_enqueue_style( 'lightgallery_stylesheet' );
1538
  wp_enqueue_script( 'lightgallery_script' );
1539
  break;
1540
  }
1541
  switch ( $settings->mobileLightbox ) {
1542
  default:
1543
- case 'magnific':
1544
  wp_enqueue_style( 'magnific_stylesheet' );
1545
  wp_enqueue_script( 'magnific_script' );
1546
  break;
1547
- case 'prettyphoto':
1548
  wp_enqueue_style( 'prettyphoto_stylesheet' );
1549
  wp_enqueue_script( 'prettyphoto_script' );
1550
  break;
1551
- case 'fancybox':
1552
  wp_enqueue_style( 'fancybox_stylesheet' );
1553
  wp_enqueue_script( 'fancybox_script' );
1554
  break;
1555
- case 'colorbox':
1556
  wp_enqueue_style( 'colorbox_stylesheet' );
1557
  wp_enqueue_script( 'colorbox_script' );
1558
  break;
1559
- case 'swipebox':
1560
  wp_enqueue_style( 'swipebox_stylesheet' );
1561
  wp_enqueue_script( 'swipebox_script' );
1562
  break;
1563
- case 'lightbox2':
1564
  wp_enqueue_style( 'lightbox2_stylesheet' );
1565
  wp_enqueue_script( 'lightbox2_script' );
1566
  break;
1567
- case 'image-lightbox':
1568
  wp_enqueue_script( 'image-lightbox_script' );
1569
- case 'lightgallery':
1570
  wp_enqueue_style( 'lightgallery_stylesheet' );
1571
  wp_enqueue_script( 'lightgallery_script' );
1572
  break;
1573
  }
1574
  return $FinalTilesGallery->render();
1575
  } else {
1576
- return 'Gallery not found.';
1577
  }
1578
 
1579
  }
@@ -1588,7 +1589,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1588
  {
1589
  $text = preg_replace( '~[^\\pL\\d]+~u', '-', $text );
1590
  $text = trim( $text, '-' );
1591
- if ( function_exists( 'iconv' ) ) {
1592
  $text = iconv( 'utf-8', 'us-ascii//TRANSLIT', $text );
1593
  }
1594
  $text = strtolower( $text );
@@ -1601,13 +1602,13 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1601
 
1602
  public static function getFieldType( $field )
1603
  {
1604
- return 'cta';
1605
  }
1606
 
1607
- public $fields = array() ;
1608
  private function addField( $section, $field, $data )
1609
  {
1610
- $this->fields[$section]['fields'][$field] = $data;
1611
  }
1612
 
1613
  private function setupFields()
@@ -1617,7 +1618,7 @@ if ( !class_exists( 'FinalTiles_Gallery' ) ) {
1617
 
1618
  }
1619
  }
1620
- if ( !class_exists( 'FinalTilesGalleryUtils' ) ) {
1621
  class FinalTilesGalleryUtils
1622
  {
1623
  public static function shortcodeToFieldName( $string, $capitalizeFirstCharacter = false )
@@ -1644,7 +1645,7 @@ if ( !class_exists( 'FinalTilesGalleryUtils' ) ) {
1644
  }
1645
  }
1646
 
1647
- if ( class_exists( 'FinalTiles_Gallery' ) ) {
1648
  global $ob_FinalTiles_Gallery ;
1649
  $ob_FinalTiles_Gallery = new FinalTiles_Gallery();
1650
- }
1
  <?php
2
 
3
+ /**
4
+ * Plugin Name: Final Tiles Grid Gallery - Image Gallery
5
+ * Plugin URI: https://www.final-tiles-gallery.com
6
+ * Description: Wordpress Plugin for creating responsive image galleries. By: GreenTreeLabs
7
+ * Author: Green Tree Labs
8
+ * Version: 3.3.24
9
+ * Author URI: https://www.greentreelabs.net
10
+ *
11
+ * @fs_premium_only /lightbox-pro/
12
+ *
13
  */
14
+ define( "FTGVERSION", "3.3.24" );
15
+ /*
16
+ Changelog:
17
+ 3.3.24
18
+ Fixed missing captions on mobile
19
+ 3.3.23
20
+ Added "ask for review" functionality
21
+ 3.3.22
22
+ Fixed issue with filters
23
+ 3.3.21
24
+ Fixed disabled hover rotation field
25
+ 3.3.20
26
+ Fixed disabled caption behaviour field
27
+ 3.3.19
28
+ Fixed ignored caption font size
29
+ 3.3.18
30
+ Fixed issue with iconv function
31
+ 3.3.17
32
+ Fixed issues in admin panel
33
+ 3.3.16
34
+ Fixed plugin name
35
+ 3.3.15
36
+ Fixed minor issue
37
+ 3.3.14
38
+ Fixed bug
39
+ 3.3.13
40
+ Fixed menu slug
41
+ 3.3.12
42
+ Lite version code merged with premium
43
+ 3.3.10
44
+ Bug fix (wrong behaviour on mobile with columns layout)
45
+ 3.3.9
46
+ Extended support for PHP versions
47
+ 3.3.8
48
+ Bug fix (Woocommerce categories were ignored)
49
+ 3.3.7
50
+ Bug fix (Youtube videos not showing in lightboxes)
51
+ 3.3.6
52
+ Bug fix (Vimeo videos not showing in lightboxes)
53
+ 3.3.5
54
+ Enhanced compatibility with EverlightBox
55
+ 3.3.4
56
+ Bug fix (woocommerce 3.1.x galleries not working)
57
+ Admin UI minor fixes
58
+ 3.3.3
59
+ Bug fix (wrong behaviour of captions on mobile devices)
60
+ 3.3.2
61
+ Bug fix (videos not using the masonry layout)
62
+ 3.3.1
63
+ Bug fix (videos not visible)
64
+ 3.3.0
65
+ Use gallery options inside shortcode
66
+ Enhanced backend UI
67
+ Added new caption behaviours
68
+ Fix FitVid conflicts
69
+ Added Hover effects and Image loaded effects presets
70
+ Added hover effect duration
71
+ Added new feature: disable grid size below given screen width
72
+ Added title and description to LightGallery
73
+ 3.2.9
74
+ Added support for EverlightBox
75
+ Renamed get_image_sizes function to avoid conflicts
76
+ 3.2.8
77
+ Minor Bug fix
78
+ 3.2.7
79
+ Minor Bug fix
80
+ 3.2.6
81
+ Bug fix
82
+ New feature: choose image size for lightbox
83
+ 3.2.5
84
+ SwipeBox now supports filters
85
+ Download the full size from LighGallery
86
+ Ajax loading (beta)
87
+ 3.2.4
88
+ Bug fix
89
+ 3.2.3
90
+ Bug fix
91
+ 3.2.2
92
+ Bug fix
93
+ 3.2.1
94
+ Bug fix
95
+ 3.2.0
96
+ Lightbox groups
97
+ Hidden images
98
+ 3.1.32
99
+ Added date filter to media panel
100
+ Added support to Enhanced Media Panel
101
+ Lazy loading with multiple image loading
102
+ Pre-selected filter
103
+ 3.1.31
104
+ Enhanced compatibility with other plugins and themes by adding data-class attribute on images
105
+ 3.1.30
106
+ Fixed jQuery issue
107
+ 3.1.29
108
+ Minor bug fix
109
+ 3.1.28
110
+ Bug fix
111
+ 3.1.27
112
+ Alt tag
113
+ 3.1.26
114
+ Bug fix
115
+ 3.1.25
116
+ Bug fix
117
+ 3.1.24
118
+ Bug fix
119
+ 3.1.23
120
+ Fixed bug occuring with Lazy load + Filters
121
+ 3.1.22
122
+ Lazy load
123
+ 3.1.21
124
+ New layout Masonry
125
+ 3.1.20
126
+ Max number of posts for "Recent posts" galleries
127
+ 3.1.19
128
+ Open videos in lightbox
129
+ 3.1.18
130
+ Admin panel enhancements
131
+ Fixed issue about Magnific Popup being loaded even when not needed
132
+ 3.1.17
133
+ New lightbox added: Lightgallery
134
+ Fixed minor bug in Custom CSS (removed slashes)
135
+ 3.1.16
136
+ Fixed bug in 'Recent posts' galleries, now it's possible to link posts
137
+ 3.1.15
138
+ Added new lightbox: LightGallery
139
+ 3.1.14
140
+ Import/Export features, Set title font size, select images by filter (backend), choose mobile lightbox
141
+ 3.1.13
142
+ Fixed issue with some lightboxes on pages with more than one gallery
143
+ 3.1.12
144
+ Solved conflicts with FitVids
145
+ 3.1.11
146
+ [Backend] edit gallery by clicking the tile
147
+ 3.1.10
148
+ Bug fix
149
+ 3.1.9
150
+ Load gallery with a selected filter, choose to reload page after clicking a filter,
151
+ choose gallery from text editor, load scripts from footer for enhanced page load
152
+ 3.1.8
153
+ Updated material design fonts
154
+ 3.1.7
155
+ Fix grid size 0
156
+ 3.1.6
157
+ Minor bug fix
158
+ 3.1.5
159
+ Image loaded effects
160
+ 3.1.4
161
+ Bug fix
162
+ 3.1.3
163
+ Set a custom label for "All" filter, Choose size of images in admin panel, Loading bar color, Loading bar background color, Caption font size, Sequential image loading
164
+ 3.1.2
165
+ PrettyPhoto security fix
166
+ 3.1.1
167
+ Minor bug fix
168
+ 3.1.0
169
+ New Backoffice
170
+ Wizard
171
+ WooCommerce products
172
+ New caption styles
173
+ Earn money with referral
174
+ 3.0.21
175
+ Bug fix
176
+ 3.0.20
177
+ Support for Social Gallery plugin by EpicPlugins
178
+ 3.0.19
179
+ Bug fix
180
+ 3.0.18
181
+ Posts galleries can use lightboxes
182
+ 3.0.17
183
+ Bug fix
184
+ 3.0.16
185
+ Filters available with recent posts
186
+ 3.0.15
187
+ bug fix
188
+ 3.1.14
189
+ New customization fields: before gallery text and after gallery text
190
+ 3.0.13
191
+ Removed unused gallery properties
192
+ Read "Description" field from media panel
193
+ Added delay control
194
+ 3.0.12
195
+ minor bug fix
196
+ 3.0.11
197
+ Image width and height attributes are now ignored
198
+ 3.0.10
199
+ Added compatibility with Cherry themes
200
+ 3.0.9
201
+ Minor bug fix
202
+ 3.0.8
203
+ Minor bug fix
204
+ 3.0.7
205
+ Minor bug fix
206
+ 3.0.6
207
+ Added filters in media panel
208
+ 3.0.5
209
+ Minor bug fix
210
+ 3.0.4
211
+ Minor bug fix
212
+ 3.0.3
213
+ Bug fix
214
+ 3.0.2
215
+ Bug fix
216
+ 3.0.1
217
+ Bug fix
218
+ 3.0
219
+ New grid layout algorithm
220
+ Video support, reverse order option
221
+ Automatic gallery with recent posts, toggle HTML compression, caption behavior on mobile devices, custom caption icon, update to FontAwesone 4.1.0
222
+ 2.1.10
223
+ Lazy loading
224
+ 2.1.9
225
+ Fixed issue with single quote character in captions
226
+ 2.1.8
227
+ Re-activated html compression
228
+ 2.1.7
229
+ Fixed notice messages
230
+ 2.1.6
231
+ Magnific Popup and Lightbox now work with gallery filters
232
+ 2.1.5
233
+ New feature: dynamic image size factor
234
+ 2.1.4
235
+ New fields: CSS class and REL on A tag
236
+ 2.1.3
237
+ Social icons bug fix
238
+
239
+ 2.1.2
240
+ Show empty captions
241
+ Inverted captions (visible then hidden on mouse over)
242
+ Icons in captions
243
+ Admin redesign UI
244
+ Enable/Disable effects on mouse over
245
+ Caption auto height
246
+ Set color of social sharing icons
247
+ Fixed captions
248
+ Loading progress bar
249
+ Minor bugs fixes
250
+ Page with support request instructions
251
+ Page with instructions
252
  */
253
  if ( !function_exists( 'ftg_fs' ) ) {
254
  // Create a helper function for easy SDK access.
313
  'captionIcon' => 'zoom',
314
  'captionIconColor' => '#ffffff',
315
  'captionIconSize' => 12,
316
+ 'captionMobileBehavior' => "desktop",
317
  'captionOpacity' => 80,
318
  'captionPosition' => 'inside',
319
  'captionVerticalAlignment' => 'middle',
360
  'loadedScaleY' => 100,
361
  'loadedScaleX' => 100,
362
  'loadedVSlide' => 0,
363
+ 'loadingBarBackgroundColor' => "#fff",
364
+ 'loadingBarColor' => "#666",
365
  'loadMethod' => 'sequential',
366
  'margin' => 10,
367
  'max_posts' => 0,
505
  if ( !$valid ) {
506
  return;
507
  }
508
+ // We have a candidate! Output a review message.
509
  ?>
510
+ <div class="notice notice-info is-dismissible ftg-review-notice">
511
  <p><?php
512
  _e( 'Hey, I noticed you created a photo gallery with Final Tiles - that’s awesome! Would you mind give it a 5-star rating on WordPress to help us spread the word and boost our motivation for new featrues?', 'final-tiles-gallery-lite' );
513
+ ?></p>
 
514
  <p><strong><?php
515
  _e( 'Diego Imbriani<br>Founder of GreenTreeLabs', 'final-tiles-gallery' );
516
+ ?></strong></p>
517
+ <p>
 
518
  <a href="https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/reviews/?filter=5#new-post" class="ftg-dismiss-review-notice ftg-review-out" target="_blank" rel="noopener"><?php
519
  _e( 'Ok, you deserve it', 'final-tiles-gallery-lite' );
520
+ ?></a><br>
 
521
  <a href="#" class="ftg-dismiss-review-notice" rel="noopener"><?php
522
  _e( 'Nope, maybe later', 'final-tiles-gallery' );
523
+ ?></a><br>
 
524
  <a href="#" class="ftg-dismiss-review-notice" rel="noopener"><?php
525
  _e( 'I already did', 'final-tiles-gallery' );
526
+ ?></a><br>
527
+ </p>
528
+ </div>
529
+ <script type="text/javascript">
530
+ jQuery(document).ready( function($) {
531
+ $(document).on('click', '.ftg-dismiss-review-notice, .ftg-review-notice button', function( event ) {
532
+ if ( ! $(this).hasClass('ftg-review-out') ) {
533
+ event.preventDefault();
534
+ }
535
+
536
+ $.post( ajaxurl, {
537
+ action: 'ftg_dismiss_review'
538
+ });
539
+
540
+ $('.ftg-review-notice').remove();
541
+ });
542
+ });
543
+ </script>
 
544
  <?php
545
  }
546
 
582
  'excludeFrom'
583
  );
584
  foreach ( $this->fields as $tab_name => $tab ) {
585
+ foreach ( $tab["fields"] as $key => $field ) {
586
  //print_r($field);
587
  foreach ( $keys as $kk ) {
588
  if ( !array_key_exists( $kk, $field ) ) {
589
+ $this->fields[$tab_name]["fields"][$key][$kk] = "";
590
  }
591
  }
592
  }
593
  }
594
+ //print_r($this->fields);
595
  }
596
 
597
  public function register_links( $links, $file )
679
 
680
  public function attachment_fields_to_edit( $form, $post )
681
  {
682
+ $form["ftg_link"] = array(
683
+ "label" => "Link <small>FTG</small>",
684
+ "input" => "text",
685
+ "value" => get_post_meta( $post->ID, "_ftg_link", true ),
686
+ "helps" => "",
687
  );
688
+ $form["ftg_target"] = array(
689
+ "label" => "_blank <small>FTG</small>",
690
+ "input" => "html",
691
+ "html" => "<input type='checkbox' name='attachments[{$post->ID}][ftg_target]' id='attachments[{$post->ID}][ftg_target]' value='_mblank' " . (( get_post_meta( $post->ID, "_ftg_target", true ) == "_mblank" ? "checked" : "" )) . " />",
692
  );
693
  return $form;
694
  }
710
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
711
  $this->FinalTilesdb->deleteGallery( intval( $_POST['id'] ) );
712
  }
713
+ exit;
714
  }
715
 
716
  public function update_configuration()
722
  $this->FinalTilesdb->update_config( $id, $config );
723
  }
724
 
725
+ exit;
726
  }
727
 
728
  public function get_configuration()
734
  echo $gallery ;
735
  }
736
 
737
+ exit;
738
  }
739
 
740
  public function get_image_size_url()
742
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
743
  echo wp_get_attachment_image_url( $_POST['id'], $_POST['size'], false ) ;
744
  }
745
+ exit;
746
  }
747
 
748
  //Clone gallery
752
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
753
  $sourceId = intval( $_POST['id'] );
754
  $g = $this->FinalTilesdb->getGalleryById( $sourceId, true );
755
+ $g['name'] .= " (copy)";
756
  $this->FinalTilesdb->addGallery( $g );
757
  $id = $this->FinalTilesdb->getNewGalleryId();
758
  $images = $this->FinalTilesdb->getImagesByGalleryId( $sourceId );
763
  $this->FinalTilesdb->addImages( $id, $images );
764
  }
765
 
766
+ exit;
767
  }
768
 
769
  //Add gallery scripts
798
  wp_enqueue_media();
799
  }
800
  $ftg_db_version = '5.0';
801
+ $installed_ver = get_option( "FinalTiles_gallery_db_version" );
802
  if ( !$installed_ver ) {
803
+ update_option( "FinalTiles_gallery_db_version", $ftg_db_version );
804
  }
805
  $this->FinalTilesdb->updateConfiguration();
806
 
807
  if ( $installed_ver != $ftg_db_version ) {
808
  $this->create_db_tables();
809
+ update_option( "FinalTiles_gallery_db_version", $ftg_db_version );
810
  }
811
 
812
  function ftg_get_image_sizes()
837
  }
838
 
839
  foreach ( ftg_get_image_sizes() as $name => $size ) {
840
+ $this->fields["Links & Lightbox"]["fields"]["lightboxImageSize"]["values"]["Size"][] = $name . "|" . $name . " (" . $size['width'] . 'x' . $size['height'] . (( $size['crop'] ? ' cropped)' : ')' ));
841
  }
842
+ $this->fields["Links & Lightbox"]["fields"]["lightboxImageSize"]["values"]["Size"][] = "full|Original (full)";
843
  wp_enqueue_script( 'jquery' );
844
  wp_enqueue_script( 'jquery-ui-dialog' );
845
  wp_enqueue_script( 'jquery-ui-sortable' );
907
  global $ftg_fields ;
908
  $ftg_fields = $this->fields;
909
  global $ftg_parent_page ;
910
+ $ftg_parent_page = "dashboard";
911
 
912
+ if ( array_key_exists( "id", $_GET ) ) {
913
  $woocommerce_post_types = array(
914
+ "product",
915
+ "product_variation",
916
+ "shop_order",
917
+ "shop_order_refund",
918
+ "shop_coupon",
919
+ "shop_webhook"
920
  );
921
+ $wp_post_types = array( "revision", "nav_menu_item" );
922
  $excluded_post_types = array_merge( $wp_post_types, $woocommerce_post_types );
923
  $woo_categories = $this->getWooCategories();
924
+ include "admin/edit-gallery.php";
925
  } else {
926
+ include "admin/overview.php";
927
  }
928
 
929
  }
930
 
931
  public function tutorial()
932
  {
933
+ include "admin/tutorial.php";
934
  }
935
 
936
  public function support()
937
  {
938
+ include "admin/support.php";
939
  }
940
 
941
  private function getWooCategories()
974
  $ftg_fields = $this->fields;
975
  $gallery = null;
976
  $woocommerce_post_types = array(
977
+ "product",
978
+ "product_variation",
979
+ "shop_order",
980
+ "shop_order_refund",
981
+ "shop_coupon",
982
+ "shop_webhook"
983
  );
984
+ $wp_post_types = array( "revision", "nav_menu_item" );
985
  $excluded_post_types = array_merge( $wp_post_types, $woocommerce_post_types );
986
  $woo_categories = $this->getWooCategories();
987
+ include "admin/add-gallery.php";
988
  }
989
 
990
  public function delete_image()
991
  {
992
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
993
+ foreach ( explode( ",", $_POST["id"] ) as $id ) {
994
  $this->FinalTilesdb->deleteImage( intval( $id ) );
995
  }
996
  }
1002
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1003
 
1004
  if ( $_POST['source'] == 'posts' ) {
1005
+ foreach ( explode( ",", $_POST["id"] ) as $id ) {
1006
  update_post_meta( intval( $id ), 'ftg_filters', $_POST['filters'] );
1007
  }
1008
  } else {
1009
+ foreach ( explode( ",", $_POST["id"] ) as $id ) {
1010
  $result = $this->FinalTilesdb->editImage( $id, array(
1011
+ "filters" => $_POST["filters"],
1012
  ) );
1013
  }
1014
  }
1020
  public function toggle_visibility()
1021
  {
1022
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1023
+ foreach ( explode( ",", $_POST["id"] ) as $id ) {
1024
  $image = $this->FinalTilesdb->getImage( $id );
1025
  $this->FinalTilesdb->editImage( $id, array(
1026
+ "hidden" => ( $image->hidden == 'T' ? 'F' : 'T' ),
1027
  ) );
1028
  }
1029
  }
1035
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1036
 
1037
  if ( $_POST['source'] == 'posts' ) {
1038
+ foreach ( explode( ",", $_POST["id"] ) as $id ) {
1039
  update_post_meta( intval( $id ), 'ftg_group', $_POST['group'] );
1040
  }
1041
  } else {
1042
+ foreach ( explode( ",", $_POST["id"] ) as $id ) {
1043
  $result = $this->FinalTilesdb->editImage( $id, array(
1044
+ "group" => $_POST["group"],
1045
  ) );
1046
  }
1047
  }
1055
 
1056
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1057
  $gid = intval( $_POST['galleryId'] );
1058
+ $enc_images = stripslashes( $_POST["enc_images"] );
1059
  $images = json_decode( $enc_images );
1060
  $result = $this->FinalTilesdb->addImages( $gid, $images );
1061
+ header( "Content-type: application/json" );
1062
 
1063
  if ( $result === false ) {
1064
+ echo "{\"success\":false}" ;
1065
  } else {
1066
+ echo "{\"success\":true}" ;
1067
  }
1068
 
1069
  }
1095
 
1096
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1097
  $result = $this->FinalTilesdb->sortImages( explode( ',', $_POST['ids'] ) );
1098
+ header( "Content-type: application/json" );
1099
 
1100
  if ( $result === false ) {
1101
+ echo "{\"success\":false}" ;
1102
  } else {
1103
+ echo "{\"success\":true}" ;
1104
  }
1105
 
1106
  }
1113
  require_once 'lib/gallery-class.php';
1114
 
1115
  if ( check_admin_referer( 'finaltilesgallery', 'finaltilesgallery' ) ) {
1116
+ $gid = intval( $_POST["gallery"] );
1117
  $images = $this->FinalTilesdb->getImagesByGalleryId( $gid );
1118
  $FinalTilesGallery = new FinalTilesGallery( $gid, $this->FinalTilesdb, $this->defaultValues );
1119
  echo $FinalTilesGallery->images_markup() ;
1140
  $postId = intval( $_POST['post_id'] );
1141
  $img_url = stripslashes( $_POST['img_url'] );
1142
  update_post_meta( $postId, 'ftg_image_url', $img_url );
1143
+ if ( array_key_exists( "filters", $_POST ) && strlen( $_POST['filters'] ) ) {
1144
  update_post_meta( $postId, 'ftg_filters', $_POST['filters'] );
1145
  }
1146
  } else {
1156
  $imageId = intval( $_POST['img_id'] );
1157
  $sortOrder = intval( $_POST['sortOrder'] );
1158
  $data = array(
1159
+ "imagePath" => $imageUrl,
1160
+ "target" => $target,
1161
+ "link" => $link,
1162
+ "imageId" => $imageId,
1163
+ "description" => $imageCaption,
1164
+ "filters" => $filters,
1165
+ "title" => $title,
1166
+ "group" => $group,
1167
+ "hidden" => $hidden,
1168
+ "sortOrder" => $sortOrder,
1169
  );
1170
 
1171
+ if ( !empty($_POST["id"]) ) {
1172
  $imageId = intval( $_POST['id'] );
1173
  $result = $this->FinalTilesdb->editImage( $imageId, $data );
1174
  } else {
1175
+ $data["gid"] = intval( $_POST['galleryId'] );
1176
  $result = $this->FinalTilesdb->addFullImage( $data );
1177
  }
1178
 
1179
  }
1180
 
1181
+ header( "Content-type: application/json" );
1182
 
1183
  if ( $result === false ) {
1184
+ echo "{\"success\":false}" ;
1185
  } else {
1186
+ echo "{\"success\":true}" ;
1187
  }
1188
 
1189
  }
1196
 
1197
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1198
  $result = false;
1199
+ $type = ( isset( $_POST['type'] ) ? $_POST['type'] : "" );
1200
  $data = array(
1201
+ "imagePath" => stripslashes( $_POST["embed"] ),
1202
+ "filters" => stripslashes( $_POST['filters'] ),
1203
+ "gid" => intval( $_POST['galleryId'] ),
1204
  );
1205
+ $id = ( isset( $_POST['id'] ) ? intval( $_POST['id'] ) : "" );
1206
+ $step = ( isset( $_POST['step'] ) ? $_POST['step'] : "" );
1207
  if ( !empty($step) ) {
1208
 
1209
+ if ( $step == "add" ) {
1210
  $result = $this->FinalTilesdb->addVideo( $data );
1211
  } else {
1212
+ if ( $step == "edit" ) {
1213
  $result = $this->FinalTilesdb->editVideo( $id, $data );
1214
  }
1215
  }
1216
 
1217
  }
1218
+ header( "Content-type: application/json" );
1219
 
1220
  if ( $result === false ) {
1221
+ echo "{\"success\":false}" ;
1222
  } else {
1223
+ echo "{\"success\":true}" ;
1224
  }
1225
 
1226
  }
1232
  {
1233
 
1234
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1235
+ $gid = intval( $_POST["gid"] );
1236
  $imageResults = $this->FinalTilesdb->getImagesByGalleryId( $gid );
1237
  $gallery = $this->FinalTilesdb->getGalleryById( $gid );
1238
+ $list_size = "medium";
1239
+ $column_size = "s6 m3 l3";
1240
  if ( isset( $_POST['list_size'] ) && !empty($_POST['list_size']) ) {
1241
  $list_size = $_POST['list_size'];
1242
  }
1262
 
1263
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1264
  $data = $this->defaultValues;
1265
+ $data["name"] = $_POST['ftg_name'];
1266
+ $data["description"] = $_POST['ftg_description'];
1267
+ $data["source"] = $_POST['ftg_source'];
1268
+ $data["wp_field_caption"] = $_POST['ftg_wp_field_caption'];
1269
+ $data["wp_field_title"] = $_POST['ftg_wp_field_title'];
1270
+ $data["captionEffect"] = $_POST['ftg_captionEffect'];
1271
+ $data["post_categories"] = $_POST["post_categories"];
1272
+ $data["post_tags"] = $_POST["post_tags"];
1273
+ $data["layout"] = $_POST["layout"];
1274
+ $data["defaultWooImageSize"] = $_POST['def_imgsize'];
1275
+ $data["defaultPostImageSize"] = $_POST['def_imgsize'];
1276
+ $data["woo_categories"] = $_POST["woo_categories"];
1277
  $result = $this->FinalTilesdb->addGallery( $data );
1278
  $id = $this->FinalTilesdb->getNewGalleryId();
1279
 
1280
  if ( $id > 0 && array_key_exists( 'enc_images', $_POST ) && strlen( $_POST['enc_images'] ) ) {
1281
+ $enc_images = stripslashes( $_POST["enc_images"] );
1282
  $images = json_decode( $enc_images );
1283
  $result = $this->FinalTilesdb->addImages( $id, $images );
1284
  }
1305
  if ( check_admin_referer( 'FinalTiles_gallery', 'FinalTiles_gallery' ) ) {
1306
  $galleryName = stripslashes( $_POST['ftg_name'] );
1307
  $galleryDescription = stripslashes( $_POST['ftg_description'] );
1308
+ $slug = strtolower( str_replace( " ", "", $galleryName ) );
1309
  $margin = intval( $_POST['ftg_margin'] );
1310
  $minTileWidth = intval( $_POST['ftg_minTileWidth'] );
1311
  $gridCellSize = intval( $_POST['ftg_gridCellSize'] );
1456
  'loadedRotateY' => intval( $_POST['ftg_loadedRotateY'] ),
1457
  'loadedRotateX' => intval( $_POST['ftg_loadedRotateX'] ),
1458
  );
1459
+ header( "Content-type: application/json" );
1460
 
1461
  if ( $id > 0 ) {
1462
  $result = $this->FinalTilesdb->editGallery( $id, $data );
1467
 
1468
 
1469
  if ( $result ) {
1470
+ echo "{\"success\":true,\"id\":" . $id . "}" ;
1471
  } else {
1472
+ echo "{\"success\":false}" ;
1473
  }
1474
 
1475
  }
1485
  foreach ( $sizes as $size ) {
1486
  $image = wp_get_attachment_image_src( $id, $size );
1487
  if ( !empty($image) && (true == $image[3] || 'full' == $size) ) {
1488
+ $result["{$image[1]}x{$image[2]}"] = $image[0];
1489
  }
1490
  }
1491
  ksort( $result );
1508
  );
1509
  $settings = $FinalTilesGallery->getGallery();
1510
  switch ( $settings->lightbox ) {
1511
+ case "magnific":
1512
  wp_enqueue_style( 'magnific_stylesheet' );
1513
  wp_enqueue_script( 'magnific_script' );
1514
  break;
1515
+ case "prettyphoto":
1516
  wp_enqueue_style( 'prettyphoto_stylesheet' );
1517
  wp_enqueue_script( 'prettyphoto_script' );
1518
  break;
1519
+ case "fancybox":
1520
  wp_enqueue_style( 'fancybox_stylesheet' );
1521
  wp_enqueue_script( 'fancybox_script' );
1522
  break;
1523
+ case "colorbox":
1524
  wp_enqueue_style( 'colorbox_stylesheet' );
1525
  wp_enqueue_script( 'colorbox_script' );
1526
  break;
1527
+ case "swipebox":
1528
  wp_enqueue_style( 'swipebox_stylesheet' );
1529
  wp_enqueue_script( 'swipebox_script' );
1530
  break;
1531
+ case "lightbox2":
1532
  wp_enqueue_style( 'lightbox2_stylesheet' );
1533
  wp_enqueue_script( 'lightbox2_script' );
1534
  break;
1535
+ case "image-lightbox":
1536
  wp_enqueue_script( 'image-lightbox_script' );
1537
+ case "lightgallery":
1538
  wp_enqueue_style( 'lightgallery_stylesheet' );
1539
  wp_enqueue_script( 'lightgallery_script' );
1540
  break;
1541
  }
1542
  switch ( $settings->mobileLightbox ) {
1543
  default:
1544
+ case "magnific":
1545
  wp_enqueue_style( 'magnific_stylesheet' );
1546
  wp_enqueue_script( 'magnific_script' );
1547
  break;
1548
+ case "prettyphoto":
1549
  wp_enqueue_style( 'prettyphoto_stylesheet' );
1550
  wp_enqueue_script( 'prettyphoto_script' );
1551
  break;
1552
+ case "fancybox":
1553
  wp_enqueue_style( 'fancybox_stylesheet' );
1554
  wp_enqueue_script( 'fancybox_script' );
1555
  break;
1556
+ case "colorbox":
1557
  wp_enqueue_style( 'colorbox_stylesheet' );
1558
  wp_enqueue_script( 'colorbox_script' );
1559
  break;
1560
+ case "swipebox":
1561
  wp_enqueue_style( 'swipebox_stylesheet' );
1562
  wp_enqueue_script( 'swipebox_script' );
1563
  break;
1564
+ case "lightbox2":
1565
  wp_enqueue_style( 'lightbox2_stylesheet' );
1566
  wp_enqueue_script( 'lightbox2_script' );
1567
  break;
1568
+ case "image-lightbox":
1569
  wp_enqueue_script( 'image-lightbox_script' );
1570
+ case "lightgallery":
1571
  wp_enqueue_style( 'lightgallery_stylesheet' );
1572
  wp_enqueue_script( 'lightgallery_script' );
1573
  break;
1574
  }
1575
  return $FinalTilesGallery->render();
1576
  } else {
1577
+ return "Gallery not found.";
1578
  }
1579
 
1580
  }
1589
  {
1590
  $text = preg_replace( '~[^\\pL\\d]+~u', '-', $text );
1591
  $text = trim( $text, '-' );
1592
+ if ( function_exists( "iconv" ) ) {
1593
  $text = iconv( 'utf-8', 'us-ascii//TRANSLIT', $text );
1594
  }
1595
  $text = strtolower( $text );
1602
 
1603
  public static function getFieldType( $field )
1604
  {
1605
+ return "cta";
1606
  }
1607
 
1608
+ var $fields = array() ;
1609
  private function addField( $section, $field, $data )
1610
  {
1611
+ $this->fields[$section]["fields"][$field] = $data;
1612
  }
1613
 
1614
  private function setupFields()
1618
 
1619
  }
1620
  }
1621
+ if ( !class_exists( "FinalTilesGalleryUtils" ) ) {
1622
  class FinalTilesGalleryUtils
1623
  {
1624
  public static function shortcodeToFieldName( $string, $capitalizeFirstCharacter = false )
1645
  }
1646
  }
1647
 
1648
+ if ( class_exists( "FinalTiles_Gallery" ) ) {
1649
  global $ob_FinalTiles_Gallery ;
1650
  $ob_FinalTiles_Gallery = new FinalTiles_Gallery();
1651
+ }
admin/add-gallery.php CHANGED
@@ -6,11 +6,10 @@ if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
6
  ?>
7
 
8
  <?php
9
- $ftg_subtitle = 'New gallery';
10
- ?>
11
-
12
  <?php
13
- include 'header.php';
14
  ?>
15
 
16
 
@@ -19,8 +18,7 @@ include 'header.php';
19
  <div id="ftg-wizard">
20
  <h2><?php
21
  _e( 'Add new gallery wizard', 'final-tiles-gallery' );
22
- ?>
23
- </h2>
24
 
25
  <form action="#" method="post">
26
  <?php
@@ -38,29 +36,25 @@ wp_nonce_field( 'FinalTiles_gallery', 'FinalTiles_gallery' );
38
  <input name="ftg_name" id="name" type="text" class="validate" required="required">
39
  <label for="name"><?php
40
  _e( 'Name of the gallery', 'final-tiles-gallery' );
41
- ?>
42
- </label>
43
  </div>
44
  </div>
45
  <div class="input-field">
46
  <textarea name="ftg_description" class="materialize-textarea" id="description"></textarea>
47
  <label for="description"><?php
48
  _e( 'Description of the gallery', 'final-tiles-gallery' );
49
- ?>
50
- </label>
51
  </div>
52
  </fieldset>
53
  <fieldset data-step="2">
54
  <h5><?php
55
  _e( 'Choose the source of the images', 'final-tiles-gallery' );
56
- ?>
57
- </h5>
58
  <p>
59
  <input class="with-gap" type="radio" checked="checked" name="ftg_source" id="source1" value="images" />
60
  <label for="source1"><?php
61
  _e( 'Media library', 'final-tiles-gallery' );
62
- ?>
63
- </label>
64
  </p>
65
  <p>
66
  <?php
@@ -68,11 +62,9 @@ _e( 'Media library', 'final-tiles-gallery' );
68
  <input disabled class="with-gap" type="radio" name="ftg_source" value="*" id="source2" />
69
  <label for="source2"><?php
70
  _e( 'Recent posts', 'final-tiles-gallery' );
71
- ?>
72
- - <a class="in-wizard-cta" href="<?php
73
  echo ftg_fs()->get_upgrade_url() ;
74
- ?>
75
- "><i class="mdi mdi-bell-ring-outline"></i>
76
  <?php
77
  _e( 'Unlock this feature. Upgrade Now!', 'final-tiles-grid-gallery-lite' );
78
  ?>
@@ -86,11 +78,9 @@ _e( 'Unlock this feature. Upgrade Now!', 'final-tiles-grid-gallery-lite' );
86
  <input class="with-gap" disabled type="radio" name="ftg_source" value="*" id="source3" />
87
  <label for="source3"><?php
88
  _e( 'WooCommerce products', 'final-tiles-gallery' );
89
- ?>
90
- - <a class="in-wizard-cta" href="<?php
91
  echo ftg_fs()->get_upgrade_url() ;
92
- ?>
93
- "><i class="mdi mdi-bell-ring-outline"></i>
94
  <?php
95
  _e( 'Unlock this feature. Upgrade Now!', 'final-tiles-grid-gallery-lite' );
96
  ?>
@@ -103,8 +93,7 @@ _e( 'Unlock this feature. Upgrade Now!', 'final-tiles-grid-gallery-lite' );
103
  <div class="field">
104
  <h5><?php
105
  _e( 'WordPress field for captions:', 'final-tiles-gallery' );
106
- ?>
107
- </h5>
108
  <select class="browser-default" name="ftg_wp_field_caption">
109
  <option value="none"> Don't use captions </option>
110
  <option value="title"> Title </option>
@@ -116,8 +105,7 @@ _e( 'WordPress field for captions:', 'final-tiles-gallery' );
116
  <div class="field">
117
  <h5><?php
118
  _e( 'WordPress field for titles:', 'final-tiles-gallery' );
119
- ?>
120
- </h5>
121
  <select class="browser-default" name="ftg_wp_field_title">
122
  <option value="none"> Don't use titles </option>
123
  <option selected value="title"> Title </option>
@@ -144,39 +132,31 @@ _e( 'WordPress field for titles:', 'final-tiles-gallery' );
144
  <div class="field">
145
  <h5><?php
146
  _e( 'Caption effect:', 'final-tiles-gallery' );
147
- ?>
148
- </h5>
149
  <select class="browser-default" name="ftg_captionEffect">
150
  <option value="none"><?php
151
  _e( 'Fade' );
152
- ?>
153
- </option>
154
  <?php
155
  ?>
156
  <option value="fixed" disabled><?php
157
  _e( 'Fixed' );
158
- ?>
159
- (Upgrade to unlock)</option>
160
  <option value="fixed-bg" disabled><?php
161
  _e( 'Fixed with background' );
162
- ?>
163
- (Upgrade to unlock)</option>
164
  <option value="fixed-then-hidden" disabled><?php
165
  _e( 'Fixed, hidden on hover' );
166
- ?>
167
- (Upgrade to unlock)</option>
168
  <option value="fixed-bottom" disabled><?php
169
  _e( 'Fixed at bottom' );
170
- ?>
171
- (Upgrade to unlock)</option>
172
  <option value="slide-from-top" disabled><?php
173
  _e( 'Slide from top' );
174
- ?>
175
- (Upgrade to unlock)</option>
176
  <option value="slide-from-bottom" disabled><?php
177
  _e( 'Slide from bottom' );
178
- ?>
179
- (Upgrade to unlock)</option>
180
  <?php
181
  ?>
182
  </select>
@@ -188,8 +168,7 @@ _e( 'Slide from bottom' );
188
  <div class="field">
189
  <h5><?php
190
  _e( 'Choose the layout', 'final-tiles-gallery' );
191
- ?>
192
- </h5>
193
  <select class="browser-default" name="layout">
194
  <option value="final">Final Tiles Gallery (mixed image width)</option>
195
  <option value="columns">Masonry (columns, same image width)</option>
@@ -198,41 +177,35 @@ _e( 'Choose the layout', 'final-tiles-gallery' );
198
  <div class="field">
199
  <h5><?php
200
  _e( 'Choose a default image size', 'final-tiles-gallery' );
201
- ?>
202
- </h5>
203
- <select class="browser-default" name="def_imgsize">
204
  <?php
205
  foreach ( $this->list_thumbnail_sizes() as $size => $atts ) {
206
- print '<option value="' . $size . '">' . $size . ' (' . implode( 'x', $atts ) . ')</option>';
207
  }
208
  ?>
209
  </select>
210
  <label><?php
211
  _e( 'You can customize each image later', 'final-tiles-gallery' );
212
- ?>
213
- </label>
214
  <br>
215
  <label class="shortpixel">
216
  <img src="<?php
217
  echo plugins_url( '', __FILE__ ) ;
218
- ?>
219
- /images/icon-shortpixel.png" alt="ShortPixel">
220
  <a target="_blank" href="https://shortpixel.com/wp/af/J4PFT4Z72393"><?php
221
  _e( 'We suggest you to use ShortPixel image optimization plugin for best SEO results.', 'modula-gallery' );
222
- ?>
223
- </a></label>
224
  </div>
225
  <div class="field select-images">
226
  <a class="waves-effect waves-light btn add-images">
227
  <i class="fa fa-plus left"></i> <?php
228
  _e( 'Add images', 'final-tiles-gallery' );
229
- ?>
230
- </a>
231
  <br>
232
  <label><?php
233
  _e( 'You can add images now or later.', 'final-tiles-gallery' );
234
- ?>
235
- </label>
236
  <div class="images list-group"></div>
237
  </div>
238
  </fieldset>
@@ -242,35 +215,28 @@ _e( 'You can add images now or later.', 'final-tiles-gallery' );
242
  </div>
243
  <a class="waves-effect waves-yellow btn-flat prev"><?php
244
  _e( 'Previous', 'final-tiles-gallery' );
245
- ?>
246
- </a>
247
  <a class="waves-effect waves-green btn-flat next"><?php
248
  _e( 'Next', 'final-tiles-gallery' );
249
- ?>
250
- </a>
251
  </footer>
252
  </form>
253
  <div id="success" class="modal">
254
  <div class="modal-content">
255
  <h4><?php
256
  _e( 'Success!', 'final-tiles-gallery' );
257
- ?>
258
- </h4>
259
  <p><?php
260
  _e( 'Your gallery', 'final-tiles-gallery' );
261
- ?>
262
- "<span class="gallery-name"></span>" <?php
263
  _e( 'has been created. Copy the following shortcode:', 'final-tiles-gallery' );
264
- ?>
265
- <br>
266
  <input type="text" readonly class="code"><br>
267
  <?php
268
  _e( 'and paste it inside a post or a page. Otherwise click', 'final-tiles-gallery' );
269
- ?>
270
- <a class='customize'><?php
271
  _e( 'here', 'final-tiles-gallery' );
272
- ?>
273
- </a> <?php
274
  _e( 'to customize
275
  the gallery.', 'final-tiles-gallery' );
276
  ?>
@@ -279,30 +245,33 @@ _e( 'to customize
279
  <div class="modal-'footer">
280
  <a href="?page=ftg-lite-gallery-admin" id="modal-close" class="waves-effect waves-green btn-flat modal-action"><?php
281
  _e( 'Close', 'final-tiles-gallery' );
282
- ?>
283
- </a>
284
  </div>
285
  </div>
286
  <div id="error" class="modal">
287
  <div class="modal-content">
288
  <h4><?php
289
  _e( 'Error!', 'final-tiles-gallery' );
290
- ?>
291
- </h4>
292
  <p><?php
293
  _e( 'For some reason it was not possible to save your gallery, please contact', 'final-tiles-gallery' );
294
- ?>
295
- <a href="?page=ftg-support"><?php
296
  _e( 'support', 'final-tiles-gallery' );
297
- ?>
298
- </a>.</p>
299
  </div>
300
  <div class="modal-footer">
301
  <a href="?page=ftg-lite-gallery-admin" class="waves-effect waves-green btn-flat modal-action modal-close"><?php
302
  _e( 'Close', 'final-tiles-gallery' );
303
- ?>
304
- </a>
305
  </div>
306
  </div>
307
  </div>
308
- </div>
 
 
 
 
 
 
 
 
6
  ?>
7
 
8
  <?php
9
+ $ftg_subtitle = "New gallery";
10
+ ?>
 
11
  <?php
12
+ include "header.php";
13
  ?>
14
 
15
 
18
  <div id="ftg-wizard">
19
  <h2><?php
20
  _e( 'Add new gallery wizard', 'final-tiles-gallery' );
21
+ ?></h2>
 
22
 
23
  <form action="#" method="post">
24
  <?php
36
  <input name="ftg_name" id="name" type="text" class="validate" required="required">
37
  <label for="name"><?php
38
  _e( 'Name of the gallery', 'final-tiles-gallery' );
39
+ ?></label>
 
40
  </div>
41
  </div>
42
  <div class="input-field">
43
  <textarea name="ftg_description" class="materialize-textarea" id="description"></textarea>
44
  <label for="description"><?php
45
  _e( 'Description of the gallery', 'final-tiles-gallery' );
46
+ ?></label>
 
47
  </div>
48
  </fieldset>
49
  <fieldset data-step="2">
50
  <h5><?php
51
  _e( 'Choose the source of the images', 'final-tiles-gallery' );
52
+ ?></h5>
 
53
  <p>
54
  <input class="with-gap" type="radio" checked="checked" name="ftg_source" id="source1" value="images" />
55
  <label for="source1"><?php
56
  _e( 'Media library', 'final-tiles-gallery' );
57
+ ?></label>
 
58
  </p>
59
  <p>
60
  <?php
62
  <input disabled class="with-gap" type="radio" name="ftg_source" value="*" id="source2" />
63
  <label for="source2"><?php
64
  _e( 'Recent posts', 'final-tiles-gallery' );
65
+ ?> - <a class="in-wizard-cta" href="<?php
 
66
  echo ftg_fs()->get_upgrade_url() ;
67
+ ?>"><i class="mdi mdi-bell-ring-outline"></i>
 
68
  <?php
69
  _e( 'Unlock this feature. Upgrade Now!', 'final-tiles-grid-gallery-lite' );
70
  ?>
78
  <input class="with-gap" disabled type="radio" name="ftg_source" value="*" id="source3" />
79
  <label for="source3"><?php
80
  _e( 'WooCommerce products', 'final-tiles-gallery' );
81
+ ?> - <a class="in-wizard-cta" href="<?php
 
82
  echo ftg_fs()->get_upgrade_url() ;
83
+ ?>"><i class="mdi mdi-bell-ring-outline"></i>
 
84
  <?php
85
  _e( 'Unlock this feature. Upgrade Now!', 'final-tiles-grid-gallery-lite' );
86
  ?>
93
  <div class="field">
94
  <h5><?php
95
  _e( 'WordPress field for captions:', 'final-tiles-gallery' );
96
+ ?></h5>
 
97
  <select class="browser-default" name="ftg_wp_field_caption">
98
  <option value="none"> Don't use captions </option>
99
  <option value="title"> Title </option>
105
  <div class="field">
106
  <h5><?php
107
  _e( 'WordPress field for titles:', 'final-tiles-gallery' );
108
+ ?></h5>
 
109
  <select class="browser-default" name="ftg_wp_field_title">
110
  <option value="none"> Don't use titles </option>
111
  <option selected value="title"> Title </option>
132
  <div class="field">
133
  <h5><?php
134
  _e( 'Caption effect:', 'final-tiles-gallery' );
135
+ ?></h5>
 
136
  <select class="browser-default" name="ftg_captionEffect">
137
  <option value="none"><?php
138
  _e( 'Fade' );
139
+ ?></option>
 
140
  <?php
141
  ?>
142
  <option value="fixed" disabled><?php
143
  _e( 'Fixed' );
144
+ ?> (Upgrade to unlock)</option>
 
145
  <option value="fixed-bg" disabled><?php
146
  _e( 'Fixed with background' );
147
+ ?> (Upgrade to unlock)</option>
 
148
  <option value="fixed-then-hidden" disabled><?php
149
  _e( 'Fixed, hidden on hover' );
150
+ ?> (Upgrade to unlock)</option>
 
151
  <option value="fixed-bottom" disabled><?php
152
  _e( 'Fixed at bottom' );
153
+ ?> (Upgrade to unlock)</option>
 
154
  <option value="slide-from-top" disabled><?php
155
  _e( 'Slide from top' );
156
+ ?> (Upgrade to unlock)</option>
 
157
  <option value="slide-from-bottom" disabled><?php
158
  _e( 'Slide from bottom' );
159
+ ?> (Upgrade to unlock)</option>
 
160
  <?php
161
  ?>
162
  </select>
168
  <div class="field">
169
  <h5><?php
170
  _e( 'Choose the layout', 'final-tiles-gallery' );
171
+ ?></h5>
 
172
  <select class="browser-default" name="layout">
173
  <option value="final">Final Tiles Gallery (mixed image width)</option>
174
  <option value="columns">Masonry (columns, same image width)</option>
177
  <div class="field">
178
  <h5><?php
179
  _e( 'Choose a default image size', 'final-tiles-gallery' );
180
+ ?></h5>
181
+ <select class="browser-default def_imgsize" name="def_imgsize">
 
182
  <?php
183
  foreach ( $this->list_thumbnail_sizes() as $size => $atts ) {
184
+ print '<option value="' . $size . '">' . $size . " (" . implode( 'x', $atts ) . ")</option>";
185
  }
186
  ?>
187
  </select>
188
  <label><?php
189
  _e( 'You can customize each image later', 'final-tiles-gallery' );
190
+ ?></label>
 
191
  <br>
192
  <label class="shortpixel">
193
  <img src="<?php
194
  echo plugins_url( '', __FILE__ ) ;
195
+ ?>/images/icon-shortpixel.png" alt="ShortPixel">
 
196
  <a target="_blank" href="https://shortpixel.com/wp/af/J4PFT4Z72393"><?php
197
  _e( 'We suggest you to use ShortPixel image optimization plugin for best SEO results.', 'modula-gallery' );
198
+ ?></a></label>
 
199
  </div>
200
  <div class="field select-images">
201
  <a class="waves-effect waves-light btn add-images">
202
  <i class="fa fa-plus left"></i> <?php
203
  _e( 'Add images', 'final-tiles-gallery' );
204
+ ?></a>
 
205
  <br>
206
  <label><?php
207
  _e( 'You can add images now or later.', 'final-tiles-gallery' );
208
+ ?></label>
 
209
  <div class="images list-group"></div>
210
  </div>
211
  </fieldset>
215
  </div>
216
  <a class="waves-effect waves-yellow btn-flat prev"><?php
217
  _e( 'Previous', 'final-tiles-gallery' );
218
+ ?></a>
 
219
  <a class="waves-effect waves-green btn-flat next"><?php
220
  _e( 'Next', 'final-tiles-gallery' );
221
+ ?></a>
 
222
  </footer>
223
  </form>
224
  <div id="success" class="modal">
225
  <div class="modal-content">
226
  <h4><?php
227
  _e( 'Success!', 'final-tiles-gallery' );
228
+ ?></h4>
 
229
  <p><?php
230
  _e( 'Your gallery', 'final-tiles-gallery' );
231
+ ?> "<span class="gallery-name"></span>" <?php
 
232
  _e( 'has been created. Copy the following shortcode:', 'final-tiles-gallery' );
233
+ ?><br>
 
234
  <input type="text" readonly class="code"><br>
235
  <?php
236
  _e( 'and paste it inside a post or a page. Otherwise click', 'final-tiles-gallery' );
237
+ ?> <a class='customize'><?php
 
238
  _e( 'here', 'final-tiles-gallery' );
239
+ ?></a> <?php
 
240
  _e( 'to customize
241
  the gallery.', 'final-tiles-gallery' );
242
  ?>
245
  <div class="modal-'footer">
246
  <a href="?page=ftg-lite-gallery-admin" id="modal-close" class="waves-effect waves-green btn-flat modal-action"><?php
247
  _e( 'Close', 'final-tiles-gallery' );
248
+ ?></a>
 
249
  </div>
250
  </div>
251
  <div id="error" class="modal">
252
  <div class="modal-content">
253
  <h4><?php
254
  _e( 'Error!', 'final-tiles-gallery' );
255
+ ?></h4>
 
256
  <p><?php
257
  _e( 'For some reason it was not possible to save your gallery, please contact', 'final-tiles-gallery' );
258
+ ?><a href="?page=ftg-support"><?php
 
259
  _e( 'support', 'final-tiles-gallery' );
260
+ ?></a>.</p>
 
261
  </div>
262
  <div class="modal-footer">
263
  <a href="?page=ftg-lite-gallery-admin" class="waves-effect waves-green btn-flat modal-action modal-close"><?php
264
  _e( 'Close', 'final-tiles-gallery' );
265
+ ?></a>
 
266
  </div>
267
  </div>
268
  </div>
269
+ </div>
270
+ <script>
271
+ jQuery(function (){
272
+ var $ = jQuery;
273
+ $(".def_imgsize").val("medium");
274
+
275
+ $()
276
+ });
277
+ </script>
admin/include/edit-gallery.php CHANGED
@@ -16,7 +16,7 @@ if ( !function_exists( 'ftg_p' ) ) {
16
  if ( $gallery == NULL || $gallery->{$field} === NULL ) {
17
 
18
  if ( $default === NULL ) {
19
- print '';
20
  } else {
21
  print stripslashes( $default );
22
  }
@@ -31,7 +31,7 @@ if ( !function_exists( 'ftg_p' ) ) {
31
  $gallery,
32
  $field,
33
  $value,
34
- $type = 'selected'
35
  )
36
  {
37
  global $ftg_options ;
@@ -43,7 +43,7 @@ if ( !function_exists( 'ftg_p' ) ) {
43
 
44
 
45
  if ( $gallery == NULL ) {
46
- print '';
47
  } else {
48
  if ( $gallery->{$field} == $value ) {
49
  print $type;
@@ -54,30 +54,30 @@ if ( !function_exists( 'ftg_p' ) ) {
54
 
55
  function ftg_checkFieldDisabled( $options )
56
  {
57
- if ( count( $options ) == 3 && $options[2] == 'disabled' ) {
58
- return 'disabled';
59
  }
60
- return '';
61
  }
62
 
63
  function ftg_checkDisabledOption( $plan )
64
  {
65
- return 'disabled';
66
- return '';
67
  }
68
 
69
  function ftg_printPro( $plan )
70
  {
71
- return ' (upgrade to unlock)';
72
- return '';
73
  }
74
 
75
  function ftg_printFieldPro( $options )
76
  {
77
- if ( count( $options ) == 3 && $options[2] == 'disabled' ) {
78
- return ' (upgrade to unlock)';
79
  }
80
- return '';
81
  }
82
 
83
  }
@@ -89,7 +89,7 @@ $filters = explode( '|', $gallery->filters );
89
  $idx = 0;
90
  function ftgSortByName( $a, $b )
91
  {
92
- return $a['name'] > $b['name'];
93
  }
94
 
95
  ?>
@@ -101,52 +101,46 @@ foreach ( $ftg_fields as $section => $s ) {
101
  ?>
102
  <li id="<?php
103
  _e( FinalTiles_Gallery::slugify( $section ) );
104
- ?>
105
- ">
106
  <div class="collapsible-header">
107
  <i class="mdi <?php
108
- _e( $s['icon'] );
109
- ?>
110
- ftg-section-icon white-text <?php
111
  print $colors[$idx];
112
- ?>
113
- darken-2"></i> <?php
114
  _e( $section );
115
  ?>
116
  </div>
117
  <div class="collapsible-body <?php
118
  print $colors[$idx];
119
- ?>
120
- lighten-5 tab form-fields">
121
  <div class="jump-head">
122
  <?php
123
  $jumpFields = array();
124
- foreach ( $s['fields'] as $f => $data ) {
125
  $jumpFields[$f] = $data;
126
  $jumpFields[$f]['_code'] = $f;
127
  }
128
  unset( $f );
129
  unset( $data );
130
- usort( $jumpFields, 'ftgSortByName' );
131
  ?>
132
  <select class="browser-default jump">
133
  <option><?php
134
  _e( 'Jump to setting', 'final-tiles-gallery' );
135
- ?>
136
- </option>
137
  <?php
138
  foreach ( $jumpFields as $f => $data ) {
139
  ?>
140
  <?php
141
 
142
- if ( is_array( $data['excludeFrom'] ) && !in_array( $ftg_parent_page, $data['excludeFrom'] ) ) {
143
  ?>
144
  <option value="<?php
145
  _e( $data['_code'] );
146
- ?>
147
- ">
148
  <?php
149
- _e( $data['name'] );
150
  ?>
151
  </option>
152
  <?php
@@ -160,20 +154,18 @@ foreach ( $ftg_fields as $section => $s ) {
160
 
161
  <?php
162
 
163
- if ( array_key_exists( 'presets', $s ) ) {
164
  ?>
165
  <select class="browser-default presets" data-field-idx="<?php
166
  echo $idx ;
167
- ?>
168
- ">
169
  <option value="">Select preset</option>
170
  <?php
171
- foreach ( $s['presets'] as $preset => $data ) {
172
  ?>
173
  <option><?php
174
  echo $preset ;
175
- ?>
176
- </option>
177
  <?php
178
  }
179
  ?>
@@ -186,32 +178,29 @@ foreach ( $ftg_fields as $section => $s ) {
186
  <table>
187
  <tbody>
188
  <?php
189
- foreach ( $s['fields'] as $f => $data ) {
190
  ?>
191
  <?php
192
 
193
- if ( is_array( $data['excludeFrom'] ) && !in_array( $ftg_parent_page, $data['excludeFrom'] ) ) {
194
  ?>
195
 
196
  <tr class="row-<?php
197
  print $f;
198
- ?>
199
- <?php
200
- print $data['type'];
201
- ?>
202
- ">
203
  <th scope="row">
204
  <label><?php
205
- _e( $data['name'] );
206
  ?>
207
  <?php
208
 
209
- if ( $data['mu'] ) {
210
  ?>
211
  (<?php
212
- _e( $data['mu'] );
213
- ?>
214
- )
215
  <?php
216
  }
217
 
@@ -220,72 +209,62 @@ foreach ( $ftg_fields as $section => $s ) {
220
  </th>
221
  <td>
222
  <div class="field <?php
223
- echo ( in_array( 'shortcode', $data['excludeFrom'] ) ? '' : 'js-update-shortcode' ) ;
224
- ?>
225
- ">
226
  <?php
227
 
228
- if ( $data['type'] == 'text' ) {
229
  ?>
230
  <div class="text">
231
  <input type="text" size="30" name="ftg_<?php
232
  print $f;
233
- ?>
234
- " value="<?php
235
- ftg_p( $gallery, $f, $data['default'] );
236
- ?>
237
- " />
238
  </div>
239
  <?php
240
- } elseif ( $data['type'] == 'cta' ) {
241
  ?>
242
  <div class="text">
243
  <a class="in-table-cta" href="<?php
244
  echo ftg_fs()->get_upgrade_url() ;
245
- ?>
246
- "><i class="mdi mdi-bell-ring-outline"></i>
247
  <?php
248
  _e( 'Unlock this feature. Upgrade Now!', 'final-tiles-grid-gallery-lite' );
249
  ?>
250
  </a>
251
  </div>
252
  <?php
253
- } elseif ( $data['type'] == 'select' ) {
254
  ?>
255
  <div class="text">
256
  <select class="browser-default" name="ftg_<?php
257
  print $f;
258
- ?>
259
- ">
260
  <?php
261
- foreach ( array_keys( $data['values'] ) as $optgroup ) {
262
  ?>
263
  <optgroup label="<?php
264
  print $optgroup;
265
- ?>
266
- ">
267
  <?php
268
- foreach ( $data['values'][$optgroup] as $option ) {
269
  ?>
270
 
271
  <?php
272
- $v = explode( '|', $option );
273
  ?>
274
 
275
  <option <?php
276
  echo ftg_checkFieldDisabled( $v ) ;
277
- ?>
278
- <?php
279
  ftg_sel( $gallery, $f, $v[0] );
280
- ?>
281
- value="<?php
282
  print $v[0];
283
- ?>
284
- "><?php
285
  print $v[1];
286
  echo ftg_printFieldPro( $v ) ;
287
- ?>
288
- </option>
289
  <?php
290
  }
291
  ?>
@@ -296,7 +275,7 @@ foreach ( $ftg_fields as $section => $s ) {
296
  </select>
297
  <?php
298
 
299
- if ( $f == 'lightbox' ) {
300
  ?>
301
  <div class="col s12 ftg-everlightbox-settings">
302
  <?php
@@ -315,8 +294,7 @@ foreach ( $ftg_fields as $section => $s ) {
315
  <?php
316
  }
317
 
318
- ?>
319
-
320
  </div>
321
  <?php
322
  }
@@ -324,88 +302,73 @@ foreach ( $ftg_fields as $section => $s ) {
324
  ?>
325
  </div>
326
  <?php
327
- } elseif ( $data['type'] == 'toggle' ) {
328
  ?>
329
  <div class="text">
330
  <input type="checkbox" class="ftg-checkbox" id="ftg_<?php
331
  print $f;
332
- ?>
333
- " name="ftg_<?php
334
  print $f;
335
- ?>
336
- " value="<?php
337
- ftg_p( $gallery, $f, $data['default'] );
338
- ?>
339
- " <?php
340
  ftg_sel(
341
  $gallery,
342
  $f,
343
- 'T',
344
- 'checked'
345
  );
346
- ?>
347
- />
348
  <label for="ftg_<?php
349
  print $f;
350
- ?>
351
- "><?php
352
- _e( $data['description'] );
353
- ?>
354
- </label>
355
  </div>
356
 
357
  <?php
358
- } elseif ( $data['type'] == 'slider' ) {
359
  ?>
360
 
361
  <div class="text">
362
  <p class="range-field">
363
  <input name="ftg_<?php
364
  print $f;
365
- ?>
366
- " value="<?php
367
- ftg_p( $gallery, $f, $data['default'] );
368
- ?>
369
- " type="range" min="<?php
370
- print $data['min'];
371
- ?>
372
- " max="<?php
373
- print $data['max'];
374
- ?>
375
- " />
376
  </p>
377
  </div>
378
 
379
  <?php
380
- } elseif ( $data['type'] == 'number' ) {
381
  ?>
382
  <div class="text">
383
  <input type="text" name="ftg_<?php
384
  print $f;
385
- ?>
386
- " class="integer-only" value="<?php
387
- ftg_p( $gallery, $f, $data['default'] );
388
- ?>
389
- " >
390
  </div>
391
 
392
  <?php
393
- } elseif ( $data['type'] == 'color' ) {
394
  ?>
395
  <div class="text">
396
  <input type="text" size="6" data-default-color="<?php
397
- print $data['default'];
398
- ?>
399
- " name="ftg_<?php
400
  print $f;
401
- ?>
402
- " value="<?php
403
- ftg_p( $gallery, $f, $data['default'] );
404
- ?>
405
- " class='pickColor' /> </div>
406
 
407
  <?php
408
- } elseif ( $data['type'] == 'filter' ) {
409
  ?>
410
 
411
  <div class="filters gallery-filters dynamic-table">
@@ -414,29 +377,25 @@ foreach ( $ftg_fields as $section => $s ) {
414
  <i class="fa fa-plus left"></i> Add filter</a>
415
  <p class="reset"><button class="waves-effect waves-light btn yellow reset-default-filter">Reset selected filter</button></p>
416
  <input type="hidden" name="ftg_filters" value="<?php
417
- ftg_p( $gallery, 'filters' );
418
- ?>
419
- " />
420
  <input type="hidden" name="filter_def" value="<?php
421
- ftg_p( $gallery, 'defaultFilter' );
422
- ?>
423
- " />
424
  </div>
425
 
426
  <?php
427
- } elseif ( $data['type'] == 'textarea' ) {
428
  ?>
429
  <div class="text">
430
  <textarea name="ftg_<?php
431
  print $f;
432
- ?>
433
- "><?php
434
  ftg_p( $gallery, $f );
435
- ?>
436
- </textarea>
437
  </div>
438
  <?php
439
- } elseif ( $data['type'] == 'custom_isf' ) {
440
  ?>
441
  <div class="custom_isf dynamic-table">
442
  <table class="striped">
@@ -445,27 +404,23 @@ foreach ( $ftg_fields as $section => $s ) {
445
  <th></th>
446
  <th><?php
447
  _e( 'Resolution', 'final-tiles-gallery' );
448
- ?>
449
- (px)</th>
450
  <th><?php
451
  _e( 'Size factor', 'final-tiles-gallery' );
452
- ?>
453
- (%)</th>
454
  </tr>
455
  </thead>
456
  <tbody>
457
  </tbody>
458
  </table>
459
  <input type="hidden" name="ftg_imageSizeFactorCustom" value="<?php
460
- ftg_p( $gallery, 'imageSizeFactorCustom' );
461
- ?>
462
- " />
463
  <a href="#" class="add waves-effect waves-light btn">
464
  <i class="mdi-content-add left"></i>
465
  <?php
466
  _e( 'Add resolution', 'final-tiles-gallery' );
467
- ?>
468
- </a>
469
  </div>
470
  <?php
471
  }
@@ -474,37 +429,32 @@ foreach ( $ftg_fields as $section => $s ) {
474
  <div class="help">
475
  <?php
476
 
477
- if ( strlen( $data['description'] ) ) {
478
  ?>
479
  <p><?php
480
- _e( $data['description'] );
481
- ?>
482
- </p>
483
  <?php
484
  }
485
 
486
  ?>
487
  <?php
488
 
489
- if ( !in_array( 'shortcode', $data['excludeFrom'] ) && $data['type'] != 'cta' ) {
490
  ?>
491
  <div class="ftg-code">
492
  <a href="#" class="toggle-shortcode" data-code="<?php
493
  print $f;
494
- ?>
495
- "><i class="mdi mdi-settings"></i></a>
496
  <span id="shortcode-<?php
497
  print $f;
498
- ?>
499
- ">
500
  Shortcode attribute:
501
  <input type="text" class="shortcode-val" readonly="" value='<?php
502
  _e( FinalTilesGalleryUtils::fieldNameToShortcode( $f ) );
503
- ?>
504
- ="<?php
505
- ftg_p( $gallery, $f, $data['default'] );
506
- ?>
507
- "'>
508
  </span>
509
  </div>
510
  <?php
@@ -519,8 +469,7 @@ foreach ( $ftg_fields as $section => $s ) {
519
  <?php
520
  }
521
 
522
- ?>
523
-
524
  <?php
525
  }
526
  ?>
@@ -538,46 +487,38 @@ foreach ( $ftg_fields as $section => $s ) {
538
  <div class="collapsible-header">
539
  <i class="mdi mdi-image-filter ftg-section-icon white-text <?php
540
  print $colors[$idx];
541
- ?>
542
- darken-2"></i> <?php
543
  _e( 'Images', 'final-tiles-gallery' );
544
  ?>
545
  </div>
546
  <div class="collapsible-body <?php
547
  print $colors[$idx];
548
- ?>
549
- lighten-5">
550
  <div id="images" class="ftg-section form-fields">
551
  <div class="actions">
552
  <label><?php
553
  _e( 'Source:', 'final-tiles-gallery' );
554
- ?>
555
- </label>
556
  <select name="ftg_source" class="browser-default">
557
  <option value="images"><?php
558
  _e( 'User images', 'final-tiles-gallery' );
559
- ?>
560
- </option>
561
  <option value="posts" <?php
562
  echo ftg_checkDisabledOption( 'ultimate' ) ;
563
- ?>
564
- ><?php
565
  _e( 'Recent posts with featured image', 'final-tiles-gallery' );
566
  echo ftg_printPro( 'ultimate' ) ;
567
- ?>
568
- </option>
569
  <?php
570
 
571
  if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
572
  ?>
573
  <option value="woocommerce" <?php
574
  echo ftg_checkDisabledOption( 'ultimate' ) ;
575
- ?>
576
- ><?php
577
  _e( 'WooCommerce products', 'final-tiles-gallery' );
578
  echo ftg_printPro( 'ultimate' ) ;
579
- ?>
580
- </option>
581
  <?php
582
  }
583
 
@@ -589,13 +530,11 @@ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', g
589
  <label>Loading method</label>
590
  <select name="ftg_loadMethod" class="browser-default">
591
  <option <?php
592
- ftg_sel( $gallery, 'loadMethod', 'sequential' );
593
- ?>
594
- value="sequential">Sequential</option>
595
  <option <?php
596
- ftg_sel( $gallery, 'loadMethod', 'lazy' );
597
- ?>
598
- value="lazy">Lazy</option>
599
  </select>
600
  </div>
601
  </div>
@@ -604,21 +543,18 @@ ftg_sel( $gallery, 'loadMethod', 'lazy' );
604
  <label>Ajax loading</label>
605
  <select name="ftg_ajaxLoading" class="browser-default js-ajax-loading-control">
606
  <option <?php
607
- ftg_sel( $gallery, 'ajaxLoading', 'F' );
608
- ?>
609
- value="F">Complete markup on page</option>
610
  <option <?php
611
- ftg_sel( $gallery, 'ajaxLoading', 'T' );
612
- ?>
613
- value="T">Enable ajax loading (still in beta!)</option>
614
  </select>
615
  </div>
616
  <div class="row js-ajax-loading" style="display:none;">
617
  <label>Number of images to load via ajax</label>
618
  <input class="browser-default" type="text" value="<?php
619
  echo $gallery->tilesPerPage ;
620
- ?>
621
- " name="ftg_tilesPerPage">
622
  </div>
623
  </div>
624
  <div class="actions source-images source-panel">
@@ -627,73 +563,58 @@ echo $gallery->tilesPerPage ;
627
  <span class="shortpixel">
628
  <img src="<?php
629
  echo plugins_url( '', __FILE__ ) ;
630
- ?>
631
- /../images/icon-shortpixel.png" alt="ShortPixel">
632
  <a target="_blank" href="https://shortpixel.com/wp/af/J4PFT4Z72393"><?php
633
  _e( 'We suggest you to use ShortPixel image optimization plugin for best SEO results.', 'modula-gallery' );
634
- ?>
635
- </a></span>
636
  </div>
637
  <label><?php
638
  _e( 'Image size', 'final-tiles-gallery' );
639
- ?>
640
- </label>
641
 
642
  <select class="current-image-size browser-default">
643
  <?php
644
  foreach ( $this->list_thumbnail_sizes() as $size => $atts ) {
645
- print '<option value="' . $size . '">' . $size . ' (' . implode( 'x', $atts ) . ')</option>';
646
  }
647
  ?>
648
  </select>
649
  <p class="tips"><?php
650
  _e( 'Want to add more images sizes?', 'final-tiles-gallery' );
651
- ?>
652
- <a href="http://www.wpbeginner.com/wp-tutorials/how-to-create-additional-image-sizes-in-wordpress/" target="_blank"><?php
653
  _e( 'Read a simple tutorial.', 'final-tiles-gallery' );
654
- ?>
655
- </a></p>
656
  <div class="tips">
657
  <strong><?php
658
  _e( 'About choosing a proper image size:', 'final-tiles-gallery' );
659
- ?>
660
- </strong> <?php
661
- _e( 'Final Tiles Gallery doesn\'t scale down the images when there\'s enough space, it gives you the freedom to choose your favourite size for each image. So you should use images that are smaller than the container, choose the', 'final-tiles-gallery' );
662
- ?>
663
- <strong><?php
664
  _e( 'thumbnail', 'final-tiles-gallery' );
665
- ?>
666
- </strong> <?php
667
  _e( 'or', 'final-tiles-gallery' );
668
- ?>
669
- <strong><?php
670
  _e( 'medium', 'final-tiles-gallery' );
671
- ?>
672
- </strong> <?php
673
  _e( 'size, for example.', 'final-tiles-gallery' );
674
- ?>
675
- <br>
676
  <br>
677
  <?php
678
  _e( 'How to get a better grid? Watch the', 'final-tiles-gallery' );
679
- ?>
680
- <a href="https://www.youtube.com/watch?v=RNT4JGjtyrs" target="_blank"><?php
681
  _e( 'video tutorial', 'final-tiles-gallery' );
682
- ?>
683
- </a>.
684
  </div>
685
  </div>
686
  <div class="row">
687
  <a href="#" class="open-media-panel waves-effect waves-light btn action"><i class="mdi mdi-image-area"></i> <?php
688
  _e( 'Add images', 'final-tiles-gallery' );
689
- ?>
690
- </a>
691
  <?php
692
  ?>
693
  <a onclick="alert('Upgrade to unlock')" href="#" class="waves-effect waves-light btn"><i class="mdi mdi-video"></i> <?php
694
  _e( 'Add video', 'final-tiles-gallery' );
695
- ?>
696
- </a>
697
  <?php
698
  ?>
699
  </div>
@@ -701,67 +622,53 @@ _e( 'Add video', 'final-tiles-gallery' );
701
  <p class="tips"><?php
702
  _e( 'For multiple selections: Click+CTRL.
703
  Drag images to change order.', 'final-tiles-gallery' );
704
- ?>
705
- </p>
706
  </div>
707
  </div>
708
  <div class="actions source-posts source-panel">
709
  <div class="row">
710
  <label><?php
711
  _e( 'Image size', 'final-tiles-gallery' );
712
- ?>
713
- </label>
714
 
715
  <select class="browser-default" name="ftg_defaultPostImageSize">
716
  <?php
717
  foreach ( $this->list_thumbnail_sizes() as $size => $atts ) {
718
- print '<option ' . (( $size == $gallery->defaultPostImageSize ? 'selected' : '' )) . ' value="' . $size . '">' . $size . ' (' . implode( 'x', $atts ) . ')</option>';
719
  }
720
  ?>
721
  </select>
722
  <p class="tips"><?php
723
  _e( 'Want to add more images sizes?', 'final-tiles-gallery' );
724
- ?>
725
- <a href="http://www.wpbeginner.com/wp-tutorials/how-to-create-additional-image-sizes-in-wordpress/" target="_blank"><?php
726
  _e( 'Read a simple tutorial.', 'final-tiles-gallery' );
727
- ?>
728
- </a></p>
729
  <div class="tips">
730
  <strong><?php
731
  _e( 'About choosing a proper image size:', 'final-tiles-gallery' );
732
- ?>
733
- </strong> <?php
734
- _e( 'Final Tiles Gallery doesn\'t scale down the images
735
- when there\'s enough space, it gives you the freedom to choose your favourite size for each image.
736
- So you should use images that are smaller than the container, choose the', 'final-tiles-gallery' );
737
- ?>
738
- <strong><?php
739
  _e( 'thumbnail', 'final-tiles-gallery' );
740
- ?>
741
- </strong> <?php
742
  _e( 'or', 'final-tiles-gallery' );
743
  ?>
744
  <strong><?php
745
  _e( 'medium', 'final-tiles-gallery' );
746
- ?>
747
- </strong> <?php
748
  _e( 'size, for example.', 'final-tiles-gallery' );
749
- ?>
750
- <br>
751
  <br>
752
  <?php
753
  _e( 'How to get a better grid? Watch the', 'final-tiles-gallery' );
754
- ?>
755
- <a href="https://www.youtube.com/watch?v=RNT4JGjtyrs" target="_blank"><?php
756
  _e( 'video tutorial', 'final-tiles-gallery' );
757
- ?>
758
- </a>.
759
  </div>
760
  <div class="row checkboxes">
761
  <strong class="label"><?php
762
  _e( 'Post type:', 'final-tiles-gallery' );
763
- ?>
764
- </strong>
765
  <span>
766
  <?php
767
  $idx = 0;
@@ -775,18 +682,14 @@ foreach ( get_post_types( '', 'names' ) as $t ) {
775
  ?>
776
  <input id="post-type-<?php
777
  _e( $idx );
778
- ?>
779
- " type="checkbox" name="post_types" value="<?php
780
  _e( $t );
781
- ?>
782
- ">
783
  <label for="post-type-<?php
784
  _e( $idx );
785
- ?>
786
- "><?php
787
  _e( $t );
788
- ?>
789
- </label>
790
  <?php
791
  $idx++;
792
  ?>
@@ -799,15 +702,13 @@ foreach ( get_post_types( '', 'names' ) as $t ) {
799
  ?>
800
  <input type="hidden" name="ftg_post_types" value="<?php
801
  _e( $gallery->post_types );
802
- ?>
803
- " />
804
  </span>
805
  </div>
806
  <div class="row checkboxes">
807
  <strong class="label"><?php
808
  _e( 'Categories:', 'final-tiles-gallery' );
809
- ?>
810
- </strong>
811
  <span>
812
  <?php
813
  $idx = 0;
@@ -817,18 +718,14 @@ foreach ( get_categories() as $c ) {
817
  ?>
818
  <input id="post-cat-<?php
819
  _e( $idx );
820
- ?>
821
- " type="checkbox" name="post_categories" value="<?php
822
  _e( $c->cat_ID );
823
- ?>
824
- ">
825
  <label for="post-cat-<?php
826
  _e( $idx );
827
- ?>
828
- "><?php
829
  _e( $c->name );
830
- ?>
831
- </label>
832
  <?php
833
  $idx++;
834
  ?>
@@ -837,15 +734,13 @@ foreach ( get_categories() as $c ) {
837
  ?>
838
  <input type="hidden" name="ftg_post_categories" value="<?php
839
  _e( $gallery->post_categories );
840
- ?>
841
- " />
842
  </span>
843
  </div>
844
  <div class="row checkboxes">
845
  <strong class="label"><?php
846
  _e( 'Tags:', 'final-tiles-gallery' );
847
- ?>
848
- </strong>
849
  <span>
850
  <?php
851
  $tags = get_tags();
@@ -859,18 +754,14 @@ foreach ( $tags as $c ) {
859
 
860
  <input id="post-tag-<?php
861
  _e( $idx );
862
- ?>
863
- " type="checkbox" name="post_tags" value="<?php
864
  _e( $c->term_id );
865
- ?>
866
- ">
867
  <label for="post-tag-<?php
868
  _e( $idx );
869
- ?>
870
- "><?php
871
  _e( $c->name );
872
- ?>
873
- </label>
874
  <?php
875
  $idx++;
876
  ?>
@@ -890,24 +781,20 @@ if ( count( $tags ) == 0 ) {
890
  ?>
891
  <input type="hidden" name="ftg_post_tags" value="<?php
892
  echo $gallery->post_tags ;
893
- ?>
894
- " />
895
  </span>
896
  </div>
897
  <div class="row checkboxes">
898
  <strong class="label"><?php
899
  _e( 'Max posts:', 'final-tiles-gallery' );
900
- ?>
901
- </strong>
902
  <span class="aside">
903
  <input type="text" name="ftg_max_posts" value="<?php
904
  echo $gallery->max_posts ;
905
- ?>
906
- ">
907
  <span><?php
908
  _e( '(enter 0 for unlimited posts)', 'final-tiles-gallery' );
909
- ?>
910
- </span>
911
  </span>
912
  </div>
913
  </div>
@@ -920,59 +807,46 @@ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', g
920
  <div class="row">
921
  <label><?php
922
  _e( 'Image size', 'final-tiles-gallery' );
923
- ?>
924
- </label>
925
 
926
  <select class="browser-default" name="ftg_defaultWooImageSize">
927
  <?php
928
  foreach ( $this->list_thumbnail_sizes() as $size => $atts ) {
929
- print '<option ' . (( $size == $gallery->defaultWooImageSize ? 'selected' : '' )) . ' value="' . $size . '">' . $size . ' (' . implode( 'x', $atts ) . ')</option>';
930
  }
931
  ?>
932
  </select>
933
  <p class="tips"><?php
934
  _e( 'Want to add more images sizes?', 'final-tiles-gallery' );
935
- ?>
936
- <a href="http://www.wpbeginner.com/wp-tutorials/how-to-create-additional-image-sizes-in-wordpress/" target="_blank"><?php
937
  _e( 'Read a simple tutorial.', 'final-tiles-gallery' );
938
- ?>
939
- </a></p>
940
  <div class="tips">
941
  <strong><?php
942
  _e( 'About choosing a proper image size:', '