Gallery – Photo Gallery – Image Gallery - Version 2.0.1

Version Description

  • 12.17.2018 =
  • Major Update
  • Build Custom Grids - Take full control of your galleries.
  • New Admin Interface - For a more intuitive user interface, weve blended Modula right into WordPress.
  • Drag & Drop to Upload Images
  • Guidelines to Help You Make the Perfect Gallery (edited)
  • Preview your Gallery Without the Hassle
Download this release

Release Info

Developer machothemes
Plugin Icon wp plugin Gallery – Photo Gallery – Image Gallery
Version 2.0.1
Comparing to
See all releases

Code changes from version 1.3.7 to 2.0.1

Files changed (154) hide show
  1. Modula.php +37 -1422
  2. README.txt +15 -24
  3. admin/add-gallery.php +0 -121
  4. admin/css/colors.css +0 -0
  5. admin/css/materialize.css +0 -5702
  6. admin/css/style.css +0 -1482
  7. admin/edit-gallery.php +0 -393
  8. admin/fancybox/jquery.fancybox.css +0 -771
  9. admin/fancybox/jquery.fancybox.js +0 -5629
  10. admin/fancybox/jquery.fancybox.min.css +0 -1
  11. admin/fancybox/jquery.fancybox.min.js +0 -13
  12. admin/fix.php +0 -109
  13. admin/font/roboto/Roboto-Bold-webfont.eot +0 -0
  14. admin/font/roboto/Roboto-Bold-webfont.svg +0 -593
  15. admin/font/roboto/Roboto-Bold-webfont.ttf +0 -0
  16. admin/font/roboto/Roboto-Bold-webfont.woff +0 -0
  17. admin/font/roboto/Roboto-Light-webfont.eot +0 -0
  18. admin/font/roboto/Roboto-Light-webfont.svg +0 -641
  19. admin/font/roboto/Roboto-Light-webfont.ttf +0 -0
  20. admin/font/roboto/Roboto-Light-webfont.woff +0 -0
  21. admin/font/roboto/Roboto-Regular-webfont.eot +0 -0
  22. admin/font/roboto/Roboto-Regular-webfont.svg +0 -621
  23. admin/font/roboto/Roboto-Regular-webfont.ttf +0 -0
  24. admin/font/roboto/Roboto-Regular-webfont.woff +0 -0
  25. admin/header.php +0 -4
  26. admin/images/captions-settings.jpg +0 -0
  27. admin/images/circles.jpg +0 -0
  28. admin/images/creative-gallery-settings.jpg +0 -0
  29. admin/images/custom-grid-settings.jpg +0 -0
  30. admin/images/customizations-settings.jpg +0 -0
  31. admin/images/drag-and-drop-upload.jpg +0 -0
  32. admin/images/final.jpg +0 -0
  33. admin/images/galleries-list.jpg +0 -0
  34. admin/images/gallery-edit.jpg +0 -0
  35. admin/images/helper-grid.jpg +0 -0
  36. admin/images/hover-effects-settings.jpg +0 -0
  37. admin/images/icon-shortpixel.png +0 -0
  38. admin/images/landscape-portrait.jpg +0 -0
  39. admin/images/live-preview.jpg +0 -0
  40. admin/images/loading-effects-settings.jpg +0 -0
  41. admin/images/material-design.gif +0 -0
  42. admin/images/modula-logo.jpg +0 -0
  43. admin/images/modula-v2-custom-grid.png +0 -0
  44. admin/images/modula-v2-drag-and-drop-upload.png +0 -0
  45. admin/images/modula-v2-familiar-dashboard.png +0 -0
  46. admin/images/modula-v2-helper-grid.png +0 -0
  47. admin/images/modula-v2-intuitive-settings.png +0 -0
  48. admin/images/modula-v2-landscape-or-portrait.png +0 -0
  49. admin/images/modula-v2-live-preview.png +0 -0
  50. admin/images/modula.svg +0 -48
  51. admin/images/social-settings.jpg +0 -0
  52. admin/images/square.gif +0 -0
  53. admin/images/style-settings.jpg +0 -0
  54. admin/images/survey.png +0 -0
  55. admin/images/tip.png +0 -0
  56. admin/import.php +0 -81
  57. admin/include/image-list.php +0 -69
  58. admin/include/tinymce-galleries.php +0 -83
  59. admin/modula-v2.php +0 -99
  60. admin/overview.php +0 -177
  61. admin/scripts/editor-plugin.js +0 -32
  62. admin/scripts/materialize.js +0 -10021
  63. admin/scripts/materialize.min.js +0 -6
  64. admin/scripts/modula-admin.js +0 -1039
  65. admin/tutorial.php +0 -9
  66. admin/upgrade.php +0 -30
  67. admin/welcome-screen/assets/welcome.css +0 -87
  68. admin/welcome-screen/sections/comparison-table.php +0 -91
  69. admin/welcome-screen/sections/getting-started.php +0 -133
  70. admin/welcome-screen/sections/modula-v2.php +0 -11
  71. assets/css/addons.css +47 -0
  72. {scripts → assets/css}/effects.css +0 -0
  73. assets/css/jquery-ui.css +600 -0
  74. assets/css/jquery-ui.min-old.css +7 -0
  75. assets/css/jquery-ui.min.css +7 -0
  76. {lightbox/lightbox2 → assets}/css/lightbox.css +0 -0
  77. {lightbox/lightbox2 → assets}/css/lightbox.min.css +0 -0
  78. {admin → assets}/css/materialdesignicons.css +0 -0
  79. assets/css/modula-cpt.css +1058 -0
  80. assets/css/modula.css +110 -0
  81. assets/css/welcome.css +94 -0
  82. {admin → assets}/font/material-design-icons/license.txt +0 -0
  83. {admin → assets}/font/material-design-icons/materialdesignicons-webfont.eot +0 -0
  84. {admin → assets}/font/material-design-icons/materialdesignicons-webfont.svg +0 -0
  85. {admin → assets}/font/material-design-icons/materialdesignicons-webfont.ttf +0 -0
  86. {admin → assets}/font/material-design-icons/materialdesignicons-webfont.woff +0 -0
  87. {admin → assets}/font/material-design-icons/materialdesignicons-webfont.woff2 +0 -0
  88. {admin → assets}/font/modula/modula-icons.eot +0 -0
  89. {admin → assets}/font/modula/modula-icons.svg +0 -0
  90. {admin → assets}/font/modula/modula-icons.ttf +0 -0
  91. {admin → assets}/font/modula/modula-icons.woff +0 -0
  92. {lightbox/lightbox2 → assets}/images/close.png +0 -0
  93. {admin → assets}/images/effect.jpg +0 -0
  94. {admin → assets/images}/icon.png +0 -0
  95. {lightbox/lightbox2 → assets}/images/loading.gif +0 -0
  96. assets/images/modula-logo.jpg +0 -0
  97. assets/images/modula-menu-icon.jpg +0 -0
  98. assets/images/modula-resize-icon.png +0 -0
  99. assets/images/modula.svg +1 -0
  100. {lightbox/lightbox2 → assets}/images/next.png +0 -0
  101. {lightbox/lightbox2 → assets}/images/prev.png +0 -0
  102. assets/images/ui-icons_444444_256x240.png +0 -0
  103. assets/images/ui-icons_555555_256x240.png +0 -0
  104. assets/images/ui-icons_777620_256x240.png +0 -0
  105. assets/images/ui-icons_777777_256x240.png +0 -0
  106. assets/images/ui-icons_cc0000_256x240.png +0 -0
  107. assets/images/ui-icons_ffffff_256x240.png +0 -0
  108. {scripts → assets/js}/jquery.modula.js +110 -121
  109. {lightbox/lightbox2 → assets}/js/lightbox.js +0 -0
  110. {lightbox/lightbox2 → assets}/js/lightbox.min.js +0 -0
  111. assets/js/modula-addon.js +18 -0
  112. assets/js/modula-cpt-scripts.js +25 -0
  113. assets/js/modula-upgrade.js +142 -0
  114. assets/js/packery.pkgd.js +3410 -0
  115. assets/js/packery.pkgd.min.js +13 -0
  116. assets/js/resizesensor.js +263 -0
  117. assets/js/wp-modula-conditions.js +53 -0
  118. assets/js/wp-modula-gallery.js +508 -0
  119. assets/js/wp-modula-items.js +347 -0
  120. assets/js/wp-modula-modal.js +313 -0
  121. assets/js/wp-modula-settings.js +129 -0
  122. assets/js/wp-modula-upload.js +501 -0
  123. assets/js/wp-modula.js +44 -0
  124. includes/admin/class-modula-addons.php +65 -0
  125. includes/admin/class-modula-admin.php +68 -0
  126. includes/admin/class-modula-cpt-fields-helper.php +430 -0
  127. includes/admin/class-modula-cpt.php +363 -0
  128. includes/admin/class-modula-field-builder.php +384 -0
  129. includes/admin/class-modula-image.php +328 -0
  130. includes/admin/class-modula-upsells.php +96 -0
  131. includes/admin/modula-js-templates.php +132 -0
  132. includes/admin/tabs/addons.php +6 -0
  133. includes/admin/tabs/general.php +14 -0
  134. includes/admin/tabs/modula.php +27 -0
  135. includes/admin/tabs/upsell.php +89 -0
  136. includes/class-modula-upgrades.php +308 -0
  137. includes/class-modula.php +200 -0
  138. includes/helper/class-modula-helper.php +125 -0
  139. includes/libraries/class-gamajo-template-loader.php +317 -0
  140. {lib → includes/libraries}/class-modula-review.php +17 -13
  141. includes/libraries/class-modula-template-loader.php +57 -0
  142. includes/public/class-modula-shortcode.php +219 -0
  143. includes/public/modula-helper-functions.php +118 -0
  144. includes/public/templates/items/item-none.php +15 -0
  145. includes/public/templates/items/item.php +41 -0
  146. includes/public/templates/modula-gallery.php +64 -0
  147. lib/db-class.php +0 -311
  148. lib/gallery-class.php +0 -362
  149. lib/install-db.php +0 -40
  150. lib/languages/modula-gallery.pot +0 -231
  151. lightbox/lightbox2/js/lightbox.min.map +0 -1
  152. scripts/materialize.min.js +0 -9
  153. scripts/modula.css +0 -168
  154. scripts/rollback.js +0 -11
Modula.php CHANGED
@@ -2,1438 +2,53 @@
2
/**
3
* Plugin Name: Modula
4
* Plugin URI: https://wp-modula.com/
5
- * Description: Modula is one of the best & most creative WordPress gallery plugins. Use it to create a great grid or
6
- * masonry image gallery.
7
* Author: Macho Themes
8
- * Version: 1.3.7
9
* Author URI: https://www.machothemes.com/
10
*/
11
12
- define( 'MODULA_PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ) );
13
- define( 'MODULA_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ ) );
14
-
15
- define( 'MODULA_VERSION', '1.3.7' );
16
- define( 'MODULA_PLUGIN_BASE', plugin_basename( __FILE__ ) );
17
- define( 'MODULA_PREVIOUS_PLUGIN_VERSION', '1.3.3' );
18
- define( 'MODULA_FILE_', __FILE__ );
19
-
20
- function modula_lite_create_db_tables() {
21
- include_once( MODULA_PLUGIN_DIR_PATH . '/lib/install-db.php' );
22
- modula_lite_install_db();
23
- }
24
-
25
- class ModulaLite {
26
-
27
- private $loadedData;
28
- private $fields = array();
29
-
30
- private $version = "1.3.6";
31
-
32
- private $defaultValues = array(
33
- 'width' => 100,
34
- 'height' => 800,
35
- 'img_size' => 500,
36
- 'margin' => 10,
37
- 'filters' => '',
38
- 'filterClick' => 'F',
39
- 'allFilterLabel' => 'All',
40
- 'lightbox' => 'lightbox2',
41
- 'shuffle' => 'F',
42
- 'captionColor' => '#ffffff',
43
- 'wp_field_caption' => 'caption',
44
- 'wp_field_title' => 'title',
45
- 'captionFontSize' => 14,
46
- 'titleFontSize' => 16,
47
- 'enableTwitter' => 'T',
48
- 'enableFacebook' => 'T',
49
- 'enableGplus' => 'T',
50
- 'enablePinterest' => 'T',
51
- 'socialIconColor' => '#ffffff',
52
- 'loadedScale' => 100,
53
- 'loadedRotate' => 0,
54
- 'loadedHSlide' => 0,
55
- 'loadedVSlide' => 0,
56
- 'borderSize' => 0,
57
- 'borderRadius' => 0,
58
- 'borderColor' => '#ffffff',
59
- 'shadowSize' => 0,
60
- 'shadowColor' => '#ffffff',
61
- 'style' => '',
62
- 'randomFactor' => 50,
63
- 'hoverColor' => '#000000',
64
- 'hoverOpacity' => '50',
65
- 'hoverEffect' => 'pufrobo',
66
- 'hasResizedImages' => false,
67
- 'importedFrom' => '',
68
- 'hide_title' => false,
69
- 'hide_description' => false,
70
- );
71
-
72
- public function __construct() {
73
- $this->plugin_name = plugin_basename( __FILE__ );
74
- $this->plugin_url = plugins_url( '', __FILE__ );
75
- $this->define_constants();
76
- $this->define_db_tables();
77
- $this->define_hover_effects();
78
- $this->ModulaDB = $this->create_db_conn();
79
-
80
- add_filter( 'widget_text', 'do_shortcode' );
81
- add_filter( 'mce_buttons', array( $this, 'editor_button' ) );
82
- add_filter( 'mce_external_plugins', array( $this, 'register_editor_plugin' ) );
83
-
84
- add_action( 'init', array( $this, 'create_textdomain' ) );
85
-
86
- add_action( 'wp_enqueue_scripts', array( $this, 'add_gallery_scripts' ) );
87
-
88
- add_action( 'admin_menu', array( $this, 'add_gallery_admin_menu' ) );
89
-
90
- add_shortcode( 'Modula', array( $this, 'gallery_shortcode_handler' ) );
91
- add_filter( 'the_content', array( $this, 'shortcode_empty_paragraph_fix' ), 99 );
92
-
93
- add_action( 'wp_ajax_modula_save_gallery', array( $this, 'save_gallery' ) );
94
- add_action( 'wp_ajax_modula_save_image', array( $this, 'save_image' ) );
95
- add_action( 'wp_ajax_modula_add_image', array( $this, 'add_image' ) );
96
- add_action( 'wp_ajax_modula_list_images', array( $this, 'list_images' ) );
97
- add_action( 'wp_ajax_modula_sort_images', array( $this, 'sort_images' ) );
98
- add_action( 'wp_ajax_modula_delete_image', array( $this, 'delete_image' ) );
99
- add_action( 'wp_ajax_modula_resize_images', array( $this, 'resize_images' ) );
100
- add_action( 'wp_ajax_modula_delete_gallery', array( $this, 'delete_gallery' ) );
101
- add_action( 'wp_ajax_modula_clone_gallery', array( $this, 'clone_gallery' ) );
102
- add_action( 'wp_ajax_modula_create_gallery', array( $this, 'create_gallery' ) );
103
- add_action( 'wp_ajax_mtg_shortcode_editor', array( $this, 'mtg_shortcode_editor' ) );
104
- add_action( 'wp_ajax_modula_get_config', array( $this, 'get_config' ) );
105
- add_action( 'wp_ajax_modula_update_config', array( $this, 'update_config' ) );
106
- add_action( 'wp_ajax_modula_get_ext_galleries', array( $this, 'get_ext_galleries' ) );
107
- add_action( 'wp_ajax_modula_do_import_galleries', array( $this, 'do_import_galleries' ) );
108
-
109
- add_filter( 'plugin_row_meta', array( $this, 'register_links' ), 10, 2 );
110
- add_filter( 'admin_footer_text', array( $this, 'admin_footer' ), 1, 2 );
111
-
112
- // Enqueue Fancybox for Modula 2.0 Page
113
- add_action( 'admin_enqueue_scripts', array( $this, 'modula_beta_scripts' ) );
114
-
115
-
116
- // Set fields
117
- $this->fields[ __( 'General', 'modula-gallery' ) ] = array(
118
- "icon" => "mdi mdi-settings",
119
- "fields" => array(
120
- "name" => array(
121
- "name" => esc_html__( 'Name', 'modula-gallery' ),
122
- "type" => "text",
123
- "description" => esc_html__( 'Name of the gallery, for internal use.', 'modula-gallery' ),
124
- "excludeFrom" => array(),
125
- ),
126
- "description" => array(
127
- "name" => esc_html__( 'Description', 'modula-gallery' ),
128
- "type" => "text",
129
- "description" => esc_html__( 'This description is for internal use.', 'modula-gallery' ),
130
- "excludeFrom" => array(),
131
- ),
132
- "width" => array(
133
- "name" => esc_html__( 'Width', 'modula-gallery' ),
134
- "type" => "text",
135
- "description" => esc_html__( 'Width of the gallery (i.e.: 100% or 500px)', 'modula-gallery' ),
136
- "mu" => "px or %",
137
- "excludeFrom" => array(),
138
- ),
139
- "height" => array(
140
- "name" => esc_html__( 'Height', 'modula-gallery' ),
141
- "type" => "number",
142
- "description" => esc_html__( 'Height of the gallery in pixels', 'modula-gallery' ),
143
- "mu" => "px",
144
- "excludeFrom" => array(),
145
- ),
146
- "img_size" => array(
147
- "name" => esc_html__( 'Minimum image size', 'modula-gallery' ),
148
- "type" => "number",
149
- "description" => esc_html__( 'Minimum width or height of the images', 'modula-gallery' ),
150
- "mu" => "px or %",
151
- "excludeFrom" => array(),
152
- ),
153
- "margin" => array(
154
- "name" => esc_html__( 'Margin', 'modula-gallery' ),
155
- "type" => "number",
156
- "description" => esc_html__( 'Margin between images', 'modula-gallery' ),
157
- "mu" => "px",
158
- "excludeFrom" => array(),
159
- ),
160
- "randomFactor" => array(
161
- "name" => esc_html__( 'Random factor', 'modula-gallery' ),
162
- "type" => "ui-slider",
163
- "description" => "",
164
- "min" => 0,
165
- "max" => 100,
166
- "mu" => "%",
167
- "default" => 20,
168
- "excludeFrom" => array(),
169
- ),
170
- "filters" => array(
171
- "name" => esc_html__( 'Filters', 'modula-gallery' ),
172
- "type" => "PRO_FEATURE",
173
- "description" => esc_html__( 'Add your own filters here. Each image can have one or more filters.', 'modula-gallery' ),
174
- "excludeFrom" => array(),
175
- ),
176
- "filterClick" => array(
177
- "name" => esc_html__( 'Reload Page on filter click', 'modula-gallery' ),
178
- "type" => "PRO_FEATURE",
179
- "description" => esc_html__( 'Turn this feature ON if you want to use filters with most lightboxes', 'modula-gallery' ),
180
- "excludeFrom" => array(),
181
- ),
182
- "allFilterLabel" => array(
183
- "name" => esc_html__( 'Text for "All" filter', 'modula-gallery' ),
184
- "type" => "PRO_FEATURE",
185
- "description" => esc_html__( 'Write here the label for the "All" filter', 'modula-gallery' ),
186
- "default" => "All",
187
- "excludeFrom" => array(),
188
- ),
189
- "lightbox" => array(
190
- "name" => esc_html__( 'Lightbox & Links', 'modula-gallery' ),
191
- "type" => "select",
192
- "description" => esc_html__( 'Define here what happens when user click on the images.', 'modula-gallery' ),
193
- "values" => array(
194
- "Link" => array(
195
- "|" . esc_html__( 'No link', 'modula-gallery' ),
196
- "direct|" . esc_html__( 'Direct link to image', 'modula-gallery' ),
197
- "|" . esc_html__( 'Attachment page', 'modula-gallery' )
198
- ),
199
- "Lightboxes" => array( "lightbox2|Lightbox" ),
200
- ),
201
- "disabled" => array(
202
- "Lightboxes with PRO license" => array(
203
- "magnific|Magnific popup",
204
- "prettyphoto|PrettyPhoto",
205
- "fancybox|FancyBox",
206
- "swipebox|SwipeBox",
207
- "lightbox2|Lightbox",
208
- ),
209
- ),
210
- "excludeFrom" => array(),
211
- ),
212
- "shuffle" => array(
213
- "name" => esc_html__( 'Shuffle images', 'modula-gallery' ),
214
- "type" => "toggle",
215
- "default" => "T",
216
- "description" => esc_html__( 'Flag it if you want to shuffle the gallery at each page load', 'modula-gallery' ),
217
- "excludeFrom" => array(),
218
- ),
219
- ),
220
- );
221
- $this->fields[ esc_html__( 'Captions', 'modula-gallery' ) ] = array(
222
- "icon" => "mdi mdi-comment-text-outline",
223
- "fields" => array(
224
- "captionColor" => array(
225
- "name" => esc_html__( 'Caption color', 'modula-gallery' ),
226
- "type" => "color",
227
- "description" => esc_html__( 'Color of the caption.', 'modula-gallery' ),
228
- "default" => "#ffffff",
229
- "excludeFrom" => array(),
230
- ),
231
- "wp_field_caption" => array(
232
- "name" => esc_html__( 'Populate caption from', 'modula-gallery' ),
233
- "type" => "select",
234
- "description" => __( '<strong>This field is used ONLY when images are added to the gallery. </strong> If you don\'t want to automatically populate the caption field select <i>Don\'t Populate</i>', 'modula-gallery' ),
235
- "values" => array(
236
- "Field" => array(
237
- "none|" . esc_html__( 'Don\'t Populate', 'modula-gallery' ),
238
- "title|" . esc_html__( 'WP Image title', 'modula-gallery' ),
239
- "caption|" . esc_html__( 'WP Image caption', 'modula-gallery' ),
240
- "description|" . esc_html__( 'WP Image description', 'modula-gallery' ),
241
- ),
242
- ),
243
- "excludeFrom" => array( "shortcode" ),
244
- ),
245
- "wp_field_title" => array(
246
- "name" => esc_html__( 'Populate title from', 'modula-gallery' ),
247
- "type" => "select",
248
- "description" => __( '<strong>This field is used ONLY when images are added to the gallery. </strong> If you don\'t want to automatically populate the title field select <i>Don\'t Populate</i>', 'modula-gallery' ),
249
- "values" => array(
250
- "Field" => array(
251
- "none|" . esc_html__( 'Don\'t Populate', 'modula-gallery' ),
252
- "title|" . esc_html__( 'WP Image title', 'modula-gallery' ),
253
- "description|" . esc_html__( 'WP Image description', 'modula-gallery' ),
254
- ),
255
- ),
256
- "excludeFrom" => array( "shortcode" ),
257
- ),
258
- "hide_title" => array(
259
- "name" => esc_html__( 'Image Title', 'modula-gallery' ),
260
- "type" => "toggle",
261
- "default" => "T",
262
- "description" => esc_html__( 'Hide image title from frontend', 'modula-gallery' ),
263
- "excludeFrom" => array(),
264
- ),
265
- "hide_description" => array(
266
- "name" => esc_html__( 'Image Description', 'modula-gallery' ),
267
- "type" => "toggle",
268
- "default" => "T",
269
- "description" => esc_html__( 'Hide image description from frontend', 'modula-gallery' ),
270
- "excludeFrom" => array(),
271
- ),
272
- "captionFontSize" => array(
273
- "name" => esc_html__( 'Caption Font Size', 'modula-gallery' ),
274
- "type" => "number",
275
- "description" => "",
276
- "mu" => "px",
277
- "excludeFrom" => array(),
278
- ),
279
- "titleFontSize" => array(
280
- "name" => esc_html__( 'Title Font Size', 'modula-gallery' ),
281
- "type" => "number",
282
- "description" => "",
283
- "mu" => "px",
284
- "excludeFrom" => array(),
285
- ),
286
- ),
287
- );
288
-
289
- $this->fields[ esc_html__( 'Social', 'modula-gallery' ) ] = array(
290
- "icon" => "mdi mdi-link-variant",
291
- "fields" => array(
292
- "enableTwitter" => array(
293
- "name" => esc_html__( 'Add Twitter icon', 'modula-gallery' ),
294
- "type" => "toggle",
295
- "default" => "T",
296
- "description" => esc_html__( 'Enable Twitter Sharing', 'modula-gallery' ),
297
- "excludeFrom" => array(),
298
- ),
299
- "enableFacebook" => array(
300
- "name" => esc_html__( 'Add Facebook icon', 'modula-gallery' ),
301
- "type" => "toggle",
302
- "default" => "T",
303
- "description" => esc_html__( 'Enable Facebook Sharing', 'modula-gallery' ),
304
- "excludeFrom" => array(),
305
- ),
306
- "enableGplus" => array(
307
- "name" => esc_html__( 'Add Google Plus icon', 'modula-gallery' ),
308
- "type" => "toggle",
309
- "default" => "T",
310
- "description" => esc_html__( 'Enable Google Plus Sharing', 'modula-gallery' ),
311
- "excludeFrom" => array(),
312
- ),
313
- "enablePinterest" => array(
314
- "name" => esc_html__( 'Add Pinterest icon', 'modula-gallery' ),
315
- "type" => "toggle",
316
- "default" => "T",
317
- "description" => esc_html__( 'Enable Pinterest Sharing', 'modula-gallery' ),
318
- "excludeFrom" => array(),
319
- ),
320
- "socialIconColor" => array(
321
- "name" => esc_html__( 'Color of social sharing icons', 'modula-gallery' ),
322
- "type" => "color",
323
- "description" => esc_html__( 'Set the color of the social sharing icons', 'modula-gallery' ),
324
- "default" => "#ffffff",
325
- "excludeFrom" => array(),
326
- ),
327
- ),
328
-
329
- );
330
- $this->fields[ esc_html__( 'Image loaded effects', 'modula-gallery' ) ] = array(
331
- "icon" => "mdi mdi-reload",
332
- "fields" => array(
333
- "loadedScale" => array(
334
- "name" => esc_html__( 'Scale', 'modula-gallery' ),
335
- "description" => esc_html__( 'Choose a value below 100% for a zoom-in effect. Choose a value over 100% for a zoom-out effect', 'modula-gallery' ),
336
- "type" => "ui-slider",
337
- "min" => 0,
338
- "max" => 200,
339
- "mu" => "%",
340
- "default" => 100,
341
- "excludeFrom" => array(),
342
- ),
343
- "loadedRotate" => array(
344
- "name" => esc_html__( 'Rotate', 'modula-gallery' ),
345
- "description" => "",
346
- "type" => "PRO_FEATURE",
347
- "min" => - 180,
348
- "max" => 180,
349
- "default" => 0,
350
- "mu" => "deg",
351
- "excludeFrom" => array(),
352
- ),
353
- "loadedHSlide" => array(
354
- "name" => esc_html__( 'Horizontal slide', 'modula-gallery' ),
355
- "description" => "",
356
- "type" => "PRO_FEATURE",
357
- "min" => - 100,
358
- "max" => 100,
359
- "mu" => "px",
360
- "default" => 0,
361
- "excludeFrom" => array(),
362
- ),
363
- "loadedVSlide" => array(
364
- "name" => esc_html__( 'Vertical slide', 'modula-gallery' ),
365
- "description" => "",
366
- "type" => "PRO_FEATURE",
367
- "min" => - 100,
368
- "max" => 100,
369
- "mu" => "px",
370
- "default" => 0,
371
- "excludeFrom" => array(),
372
- ),
373
-
374
- ),
375
- );
376
- $this->fields[ esc_html__( 'Hover effect', 'modula-gallery' ) ] = array(
377
- "icon" => "mdi mdi-blur",
378
- "fields" => array(
379
- "Effect" => array(
380
- "name" => esc_html__( 'Effect', 'modula-gallery' ),
381
- "description" => esc_html__( 'Select an hover effect', 'modula-gallery' ),
382
- "type" => "hover-effect",
383
- "excludeFrom" => array(),
384
- ),
385
- ),
386
- );
387
- $this->fields[ esc_html__( 'Style', 'modula-gallery' ) ] = array(
388
- "icon" => "mdi mdi-format-paint",
389
- "fields" => array(
390
- "borderSize" => array(
391
- "name" => esc_html__( 'Border Size', 'modula-gallery' ),
392
- "type" => "ui-slider",
393
- "description" => "",
394
- "mu" => "px",
395
- "min" => 0,
396
- "max" => 10,
397
- "default" => 0,
398
- "excludeFrom" => array(),
399
- ),
400
- "borderRadius" => array(
401
- "name" => esc_html__( 'Border Radius', 'modula-gallery' ),
402
- "type" => "ui-slider",
403
- "description" => "",
404
- "mu" => "px",
405
- "min" => 0,
406
- "max" => 100,
407
- "default" => 0,
408
- "excludeFrom" => array(),
409
- ),
410
- "borderColor" => array(
411
- "name" => esc_html__( 'Border Color', 'modula-gallery' ),
412
- "type" => "color",
413
- "description" => "",
414
- "default" => "#ffffff",
415
- "excludeFrom" => array(),
416
- ),
417
- "shadowSize" => array(
418
- "name" => esc_html__( 'Shadow Size', 'modula-gallery' ),
419
- "type" => "ui-slider",
420
- "description" => "",
421
- "mu" => "px",
422
- "min" => 0,
423
- "max" => 20,
424
- "default" => 0,
425
- "excludeFrom" => array(),
426
- ),
427
- "shadowColor" => array(
428
- "name" => esc_html__( 'Shadow Color', 'modula-gallery' ),
429
- "type" => "color",
430
- "description" => "",
431
- "default" => "#ffffff",
432
- "excludeFrom" => array(),
433
- ),
434
-
435
- ),
436
- );
437
- $this->fields[ esc_html__( 'Customizations', 'modula-gallery' ) ] = array(
438
- "icon" => "mdi mdi-puzzle",
439
- "fields" => array(
440
- "style" => array(
441
- "name" => esc_html__( 'Custom css', 'modula-gallery' ),
442
- "type" => "textarea",
443
- "description" => '<strong>' . esc_html__( 'Write just the code without using the &lt;style&gt;&lt;/style&gt; tags', 'modula-gallery' ) . '</strong>',
444
- "excludeFrom" => array( "shortcode" ),
445
- ),
446
- ),
447
- );
448
-
449
- }
450
-
451
- public function modula_beta_scripts( $hook ) {
452
-
453
- if ( 'modula_page_modula-lite-gallery-v2' != $hook ) {
454
- return;
455
- }
456
-
457
- wp_enqueue_script( 'modula-fancybox', plugins_url( 'admin/fancybox/jquery.fancybox.min.js', __FILE__), array( 'jquery' ) );
458
- wp_enqueue_style( 'modula-fancybox', plugins_url( 'admin/fancybox/jquery.fancybox.min.css', __FILE__) );
459
-
460
- }
461
-
462
- //Define textdomain
463
- public function create_textdomain() {
464
- $plugin_dir = basename( dirname( __FILE__ ) );
465
- load_plugin_textdomain( 'modula-gallery', false, $plugin_dir . '/lib/languages' );
466
- }
467
-
468
- function define_hover_effects() {
469
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'None', 'none', false, false, 0 );
470
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Pufrobo', 'pufrobo', true, true, 4 );
471
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Fluid Up', '', true, true, 0 );
472
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Hide', '', true, true, 4 );
473
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Quiet', '', true, false, 4 );
474
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Catinelle', '', false, false, 4 );
475
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Reflex', '', true, true, 4 );
476
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Curtain', '', true, false, 4 );
477
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Lens', '', true, true, 4 );
478
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Appear', '', true, false, 4 );
479
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Crafty', '', true, true, 0 );
480
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Seemo', '', true, false, 4 );
481
- $this->hoverEffects[] = new ModulaLiteHoverEffect( 'Comodo', '', true, false, 4 );
482
- }
483
-
484
- public function get_ext_galleries() {
485
- header( "Content-type: application/json" );
486
-
487
- global $wpdb;
488
-
489
- if ( check_admin_referer( "Modula", "Modula" ) ) {
490
- $res = array( "success" => 0 );
491
-
492
- $source = $_POST['source'];
493
- if ( $source ) {
494
- $res['success'] = 1;
495
- $res['galleries'] = array();
496
-
497
- switch ( $source ) {
498
- case 'Envira':
499
- $galleries = get_posts( array(
500
- 'post_type' => 'envira',
501
- 'posts_per_page' => 1000,
502
- ) );
503
- foreach ( $galleries as $g ) {
504
- $item = array();
505
- $item['id'] = $g->ID;
506
- $item['title'] = $g->post_title;
507
- $res['galleries'] [] = $item;
508
- }
509
- break;
510
- case 'NextGen':
511
- $galleries = $wpdb->get_results( "SELECT title, gid FROM $wpdb->nggallery" );
512
- foreach ( $galleries as $g ) {
513
- $item = array();
514
- $item['id'] = $g->gid;
515
- $item['title'] = $g->title;
516
- $res['galleries'] [] = $item;
517
- }
518
- break;
519
- }
520
- }
521
-
522
- echo json_encode( $res );
523
- }
524
- die();
525
- }
526
-
527
- public function admin_footer( $text ) {
528
- global $current_screen;
529
- if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'modula-lite' ) !== false ) {
530
- $url = 'https://wordpress.org/support/plugin/modula-best-grid-gallery/reviews/?rate=5#new-post';
531
- $text = sprintf( __( 'Please rate <strong>Modula Gallery</strong> <a href="%s" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a> on <a href="%s" target="_blank">WordPress.org</a> to help us spread the word. Thank you, on behalf of the Modula team!', 'modula-gallery' ), $url, $url );
532
- }
533
-
534
- return $text;
535
- }
536
-
537
- public function do_import_galleries() {
538
- global $wpdb;
539
-
540
- header( "Content-type: application/json" );
541
- if ( check_admin_referer( "Modula", "Modula" ) ) {
542
- $res = array( "success" => 0 );
543
- $source = $_POST['source'];
544
- $ids = explode( ",", $_POST['ids'] );
545
- switch ( $source ) {
546
- case 'Envira':
547
- foreach ( $ids as $id ) {
548
- $gallery = get_post( $id );
549
- $meta = get_post_meta( $id );
550
- $data = unserialize( $meta['_eg_gallery_data'][0] );
551
-
552
- $g = array(
553
- 'name' => $data['config']['title'],
554
- 'description' => 'Imported from Envira (' . $id . ') on ' . date( 'M, d Y' ),
555
- 'margin' => $data['config']['gutter'],
556
- 'hasResizedImages' => true,
557
- 'importedFrom' => 'Envira',
558
- );
559
- $gdb = array_merge( $this->defaultValues, $g );
560
-
561
- $saved = $this->ModulaDB->addGallery( $gdb );
562
- $newId = $this->ModulaDB->getNewGalleryId();
563
-
564
- if ( $newId && count( $data['gallery'] ) ) {
565
- $images = array();
566
- //TODO only active images
567
- foreach ( $data['gallery'] as $item ) {
568
- $toAdd = new stdClass();
569
- $toAdd->imageId = $this->ModulaDB->getIDbyGUID( $item['src'] );
570
- $toAdd->title = $item['title'];
571
- $toAdd->description = $item['caption'];
572
- $toAdd->imagePath = $item['src'];
573
-
574
- $images [] = $toAdd;
575
- }
576
- $imgResult = $this->ModulaDB->addImages( $newId, $images );
577
- }
578
- }
579
- $res['success'] = 1;
580
- break;
581
- case 'NextGen':
582
- foreach ( $ids as $id ) {
583
- $gallery = $wpdb->get_row( $wpdb->prepare( "SELECT title, gid, path FROM $wpdb->nggallery WHERE gid=%s", $id ) );
584
-
585
- $dbimages = $wpdb->get_results( $wpdb->prepare( "SELECT filename, description, alttext FROM $wpdb->nggpictures WHERE exclude <> 1 AND galleryid=%s", $id ) );
586
-
587
- $g = array(
588
- 'name' => $gallery->title,
589
- 'description' => 'Imported from NextGet (' . $id . ') on ' . date( 'M, d Y' ),
590
- 'hasResizedImages' => true,
591
- 'importedFrom' => 'NextGen',
592
- );
593
- $gdb = array_merge( $this->defaultValues, $g );
594
-
595
- $saved = $this->ModulaDB->addGallery( $gdb );
596
- $newId = $this->ModulaDB->getNewGalleryId();
597
-
598
- if ( $newId && count( $dbimages ) ) {
599
- $images = array();
600
- foreach ( $dbimages as $item ) {
601
- $toAdd = new stdClass();
602
- $toAdd->imageId = - 1;
603
- $toAdd->title = $item->alttext;
604
- $toAdd->description = $item->description;
605
- $toAdd->imagePath = plugins_url( 'image.php', __FILE__ ) . "?w=" . $this->defaultValues['img_size'] . "&src=" . $gallery->path . "/" . $item->filename;
606
-
607
- $images [] = $toAdd;
608
- }
609
- $imgResult = $this->ModulaDB->addImages( $newId, $images );
610
-
611
- }
612
- }
613
- $res['success'] = 1;
614
- break;
615
- }
616
-
617
- echo json_encode( $res );
618
- }
619
- die();
620
- }
621
-
622
- public function register_links( $links, $file ) {
623
- $base = plugin_basename( __FILE__ );
624
- if ( $file == $base ) {
625
- $links[] = '<a href="admin.php?page=modula-lite-admin" title="' . esc_html__( 'Modula Grid Gallery Dashboard', 'modula-gallery' ) . '">' . esc_html__( 'Dashboard', 'modula-gallery' ) . '</a>';
626
- $links[] = '<a href="https://twitter.com/MachoThemez" title="@MachoThemez on Twitter">Twitter</a>';
627
- $links[] = '<a href="https://www.facebook.com/machothemes" title="MachoThemes on Facebook">Facebook</a>';
628
- }
629
-
630
- return $links;
631
-
632
- }
633
-
634
- //delete gallery
635
- function delete_gallery() {
636
- if ( check_admin_referer( "Modula", "Modula" ) ) {
637
- $id = absint( $_POST['gid'] );
638
- $this->ModulaDB->deleteGallery( $id );
639
- }
640
-
641
- die();
642
- }
643
-
644
- public function update_config() {
645
- if ( check_admin_referer( "Modula", "Modula" ) ) {
646
- $id = absint($_POST['id']);
647
- $config = stripslashes( $_POST['config'] );
648
-
649
- $this->ModulaDB->update_config( $id, $config );
650
- }
651
-
652
- die();
653
- }
654
-
655
- public function get_config() {
656
- if ( check_admin_referer( "Modula", "Modula" ) ) {
657
- $id = absint($_POST['id']);
658
-
659
- $data = $this->ModulaDB->getConfig( $id );
660
-
661
- print json_encode( $data );
662
-
663
- }
664
-
665
- die();
666
- }
667
-
668
- //add gallery
669
-
670
- function create_gallery() {
671
- if ( check_admin_referer( "Modula", "Modula" ) ) {
672
- $data = $this->defaultValues;
673
- $data["name"] = sanitize_text_field($_POST['name']);
674
- $data["description"] = wp_filter_post_kses($_POST['description']);
675
- $data["width"] = sanitize_text_field($_POST['width']);
676
- $data["height"] = absint($_POST['height']);
677
- $data["img_size"] = absint( $_POST['img_size'] );
678
- $data["hasResizedImages"] = true;
679
-
680
- $this->ModulaDB->addGallery( $data );
681
- $id = $this->ModulaDB->getLastGalleryId()->Id;
682
-
683
- if ( $id > 0 && array_key_exists( 'images', $_POST ) && strlen( $_POST['images'] ) ) {
684
- $enc_images = stripslashes( $_POST["images"] );
685
- $images = array_splice( json_decode( $enc_images ), 0, 11 + 9 );
686
- ModulaLiteTools::check_and_resize( $images, $data['img_size'] );
687
- $result = $this->ModulaDB->addImages( $id, $images );
688
- }
689
- print $id;
690
- }
691
- die;
692
- }
693
-
694
- //clone gallery
695
- function clone_gallery() {
696
- if ( check_admin_referer( 'Modula', 'Modula' ) ) {
697
- $sourceId = absint( $_POST['gid'] );
698
- $g = $this->ModulaDB->getGalleryById( $sourceId, $this->defaultValues );
699
- $g->name .= "(copy)";
700
- $this->ModulaDB->addGallery( $g );
701
- $id = $this->ModulaDB->getNewGalleryId();
702
- $images = $this->ModulaDB->getImagesByGalleryId( $sourceId );
703
-
704
- foreach ( $images as &$image ) {
705
- $image->Id = null;
706
- $image->gid = $id;
707
- }
708
-
709
- $this->ModulaDB->addImages( $id, $images );
710
- }
711
-
712
- die();
713
- }
714
-
715
-
716
- //Define constants
717
- public function define_constants() {
718
- if ( ! defined( 'Modula_PLUGIN_BASENAME' ) ) {
719
- define( 'Modula_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
720
- }
721
-
722
- if ( ! defined( 'Modula_PLUGIN_NAME' ) ) {
723
- define( 'Modula_PLUGIN_NAME', trim( dirname( Modula_PLUGIN_BASENAME ), '/' ) );
724
- }
725
-
726
- if ( ! defined( 'Modula_PLUGIN_DIR' ) ) {
727
- define( 'Modula_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . Modula_PLUGIN_NAME );
728
- }
729
- }
730
-
731
- //delete Gallery
732
-
733
-
734
- //Define DB tables
735
- public function define_db_tables() {
736
- global $wpdb;
737
-
738
- $wpdb->ModulaGalleries = $wpdb->prefix . 'modula';
739
- $wpdb->ModulaImages = $wpdb->prefix . 'modula_images';
740
- }
741
-
742
-
743
- public function create_db_conn() {
744
- require( 'lib/db-class.php' );
745
- $ModulaDB = ModulaLiteDB::getInstance();
746
-
747
- return $ModulaDB;
748
- }
749
-
750
- public function editor_button( $buttons ) {
751
- array_push( $buttons, 'separator', 'mtg_shortcode_editor' );
752
-
753
- return $buttons;
754
- }
755
-
756
- public function register_editor_plugin( $plugin_array ) {
757
- $plugin_array['mtg_shortcode_editor'] = plugins_url( '/admin/scripts/editor-plugin.js', __file__ );
758
-
759
- return $plugin_array;
760
- }
761
-
762
- public function mtg_shortcode_editor() {
763
- $css_path = plugins_url( 'assets/css/admin.css', __FILE__ );
764
- $admin_url = admin_url();
765
-
766
- $galleries = $this->ModulaDB->getGalleries(); //load all galleries
767
-
768
- include 'admin/include/tinymce-galleries.php';
769
- die();
770
- }
771
-
772
- //Add gallery scripts
773
- public function add_gallery_scripts() {
774
- wp_enqueue_script( 'jquery' );
775
-
776
- wp_register_script( 'modula', plugins_url( 'scripts/jquery.modula.js', __FILE__ ) , array( 'jquery' ) );
777
- wp_enqueue_script( 'modula' );
778
-
779
- wp_register_style( 'modula_stylesheet', plugins_url( 'scripts/modula.css', __FILE__ ), null, $this->version );
780
- wp_enqueue_style( 'modula_stylesheet' );
781
-
782
- wp_register_style( 'effects_stylesheet', plugins_url( 'scripts/effects.css', __FILE__ ), null, $this->version );
783
- wp_enqueue_style( 'effects_stylesheet' );
784
-
785
- wp_register_script( 'lightbox2_script', plugins_url( 'lightbox/lightbox2/js/lightbox.min.js', __FILE__ ), array( 'jquery' ), $this->version, true );
786
- wp_register_style( 'lightbox2_stylesheet', plugins_url( 'lightbox/lightbox2/css/lightbox.min.css', __FILE__ ) );
787
- }
788
-
789
- //Admin Section - register scripts and styles
790
- public function gallery_admin_init() {
791
- if ( function_exists( 'wp_enqueue_media' ) ) {
792
- wp_enqueue_media();
793
- }
794
-
795
- wp_enqueue_script( 'jquery' );
796
-
797
- wp_enqueue_script( 'wp-color-picker' );
798
- wp_enqueue_style( 'wp-color-picker' );
799
-
800
- wp_enqueue_script( 'media-upload' );
801
- wp_enqueue_script( 'thickbox' );
802
-
803
- wp_register_style( 'materialize', plugins_url( 'admin/css/materialize.css', __FILE__ ) );
804
- wp_enqueue_style( 'materialize' );
805
-
806
- wp_register_style( 'styles', plugins_url( 'admin/css/style.css', __FILE__ ) );
807
- wp_enqueue_style( 'styles' );
808
-
809
- wp_register_style( 'effects', plugins_url( 'scripts/effects.css', __FILE__ ) );
810
- wp_enqueue_style( 'effects' );
811
-
812
- wp_register_script( 'materialize', plugins_url( 'admin/scripts/materialize.js', __FILE__ ), array( 'jquery' ) );
813
-
814
- wp_register_script( 'modula', plugins_url( 'admin/scripts/modula-admin.js', __FILE__ ), array(
815
- 'materialize',
816
- 'jquery',
817
- 'media-upload',
818
- 'thickbox',
819
- ), false, false );
820
-
821
- wp_enqueue_script( 'modula' );
822
-
823
- wp_register_style( 'materialdesign-icons', plugins_url( 'admin/css/materialdesignicons.css', __FILE__ ) );
824
- wp_enqueue_style( 'materialdesign-icons' );
825
-
826
- wp_enqueue_style( 'thickbox' );
827
-
828
- $tg_db_version = '1.0';
829
- $installed_ver = get_option( "Modula_db_version" );
830
-
831
- if ( $installed_ver != $tg_db_version ) {
832
- modula_lite_create_db_tables();
833
- update_option( "Modula_db_version", $tg_db_version );
834
- }
835
- }
836
-
837
-
838
- //Create Admin Menu
839
- public function add_gallery_admin_menu() {
840
- $overview = add_menu_page( esc_html__( 'Manage Galleries', 'modula-gallery' ), esc_html__( 'Modula', 'modula-gallery' ), 'edit_posts', 'modula-lite-admin', array(
841
- $this,
842
- 'add_overview',
843
- ), plugins_url( 'admin/icon.png', __FILE__ ) );
844
-
845
-
846
- if ( ! get_option( "Modula_skip_fix" ) && get_option( "Modula_db_version" ) && count( $this->ModulaDB->getGalleries() ) > 0 ) {
847
-
848
- $imageUrl = null;
849
- foreach ( $this->ModulaDB->getGalleries() as $gallery ) {
850
- $gid = $gallery->Id;
851
- $images = $this->ModulaDB->getImagesByGalleryId( $gid );
852
- if ( count( $images ) > 0 ) {
853
- $imageUrl = $images[0]->imagePath;
854
- break;
855
- }
856
- }
857
-
858
- if ( $imageUrl ) {
859
- if ( strncmp( strtolower( $imageUrl ), strtolower( site_url() ), strlen( site_url() ) ) != 0 ) {
860
- $fix = add_submenu_page( 'modula-lite-admin', __( 'Modula >> Fix', 'modula-gallery' ), '❗️ ' . __( 'Fix', 'modula-gallery' ), 'edit_posts', 'modula-lite-gallery-fix', array(
861
- $this,
862
- 'fix',
863
- ) );
864
- add_action( 'load-' . $fix, array( $this, 'gallery_admin_init' ) );
865
- }
866
- }
867
- } else {
868
- add_option( 'Modula_skip_fix', true );
869
- }
870
-
871
- $add_gallery = add_submenu_page( 'modula-lite-admin', __( 'Modula - Add Gallery', 'modula-gallery' ), __( 'Add Gallery', 'modula-gallery' ), 'edit_posts', 'modula-lite-add', array(
872
- $this,
873
- 'add_gallery',
874
- ) );
875
- $edit_gallery = add_submenu_page( NULL, __( 'Modula - Edit Gallery', 'modula-gallery' ), __( 'Edit Gallery', 'modula-gallery' ), 'edit_posts', 'modula-lite-edit', array(
876
- $this,
877
- 'edit_gallery',
878
- ) );
879
- $upgrade = add_submenu_page( 'modula-lite-admin', __( 'Modula - Upgrade to PRO', 'modula-gallery' ), __( 'Upgrade to PRO', 'modula-gallery' ), 'edit_posts', 'modula-lite-gallery-upgrade', array(
880
- $this,
881
- 'upgrade',
882
- ) );
883
- $v2 = add_submenu_page( 'modula-lite-admin', __( 'Try Modula 2.0', 'modula-gallery' ), __( 'Try Modula 2.0', 'modula-gallery' ), 'edit_posts', 'modula-lite-gallery-v2', array(
884
- $this,
885
- 'new_modula',
886
- ) );
887
-
888
-
889
- add_action( 'load-' . $overview, array( $this, 'gallery_admin_init' ) );
890
- add_action( 'load-' . $add_gallery, array( $this, 'gallery_admin_init' ) );
891
- add_action( 'load-' . $edit_gallery, array( $this, 'gallery_admin_init' ) );
892
- add_action( 'load-' . $upgrade, array( $this, 'gallery_admin_init' ) );
893
-
894
- }
895
-
896
- //Create Admin Pages
897
- public function add_overview() {
898
- include( "admin/overview.php" );
899
- }
900
-
901
- public function upgrade() {
902
- include( "admin/upgrade.php" );
903
- }
904
-
905
- public function add_gallery() {
906
- include( "admin/add-gallery.php" );
907
- }
908
-
909
- public function new_modula() {
910
- include( "admin/modula-v2.php" );
911
- }
912
-
913
- public function fix() {
914
- global $wpdb;
915
- include( "admin/fix.php" );
916
- }
917
-
918
- public function delete_image() {
919
- if ( check_admin_referer( 'Modula', 'Modula' ) ) {
920
- foreach ( explode( ",", $_POST["id"] ) as $id ) {
921
- $this->ModulaDB->deleteImage( absint( $id ) );
922
- }
923
- }
924
- die();
925
- }
926
-
927
- public function add_image() {
928
- if ( check_admin_referer( 'Modula', 'Modula' ) ) {
929
- $gid = intval( $_POST['galleryId'] );
930
- $this->loadedData = $this->ModulaDB->getGalleryById( $gid, $this->defaultValues );
931
- $prev = $this->ModulaDB->getImagesByGalleryId( $gid );
932
-
933
- $enc_images = stripslashes( $_POST["enc_images"] );
934
- $images = json_decode( $enc_images );
935
-
936
- $d = 18 + log10( 100 );
937
- $images = array_slice( $images, 0, $d - count( $prev ) );
938
- $images = ModulaLiteTools::check_and_resize( $images, $this->loadedData->img_size );
939
- $result = $this->ModulaDB->addImages( $gid, $images );
940
-
941
- header( "Content-type: application/json" );
942
- if ( $result === false ) {
943
- print "{\"success\":false}";
944
- } else {
945
- print "{\"success\":true}";
946
- }
947
- }
948
- die();
949
- }
950
-
951
- public function sort_images() {
952
- if ( check_admin_referer( 'Modula', 'Modula' ) ) {
953
- $result = $this->ModulaDB->sortImages( explode( ',', $_POST['ids'] ) );
954
-
955
- header( "Content-type: application/json" );
956
- if ( $result === false ) {
957
- print "{\"success\":false}";
958
- } else {
959
- print "{\"success\":true}";
960
- }
961
- }
962
- die();
963
- }
964
-
965
- public function save_image() {
966
- if ( check_admin_referer( 'Modula', 'Modula' ) ) {
967
- $result = false;
968
- // $type = $_POST['type'];
969
-
970
- $target_values = array( '', '_self', '_blank' );
971
- $halign_values = array( 'left', 'right', 'center' );
972
- $valign_values = array( 'top', 'bottom', 'middle' );
973
-
974
- $imageUrl = esc_url( $_POST['img_url'] );
975
- $imageCaption = wp_filter_post_kses( $_POST['description'] );
976
- $title = sanitize_text_field( $_POST['title'] );
977
- if ( in_array( $_POST['target'], $target_values ) ) {
978
- $target = sanitize_text_field($_POST['target']);
979
- }else{
980
- $target = '';
981
- }
982
-
983
- $link = isset( $_POST['link'] ) ? esc_url_raw( $_POST['link'] ) : null;
984
- $imageId = intval( $_POST['img_id'] );
985
- $sortOrder = intval( $_POST['sortOrder'] );
986
-
987
- if ( in_array( $_POST['halign'], $halign_values ) ) {
988
- $halign = sanitize_text_field($_POST['halign']);
989
- }else{
990
- $halign = 'center';
991
- }
992
-
993
- if ( in_array( $_POST['valign'], $valign_values ) ) {
994
- $valign = sanitize_text_field($_POST['valign']);
995
- }else{
996
- $valign = 'middle';
997
- }
998
-
999
- $data = array(
1000
- "target" => $target,
1001
- "link" => $link,
1002
- "imageId" => $imageId,
1003
- "description" => $imageCaption,
1004
- 'title' => $title,
1005
- "halign" => $halign,
1006
- "valign" => $valign,
1007
- "sortOrder" => $sortOrder,
1008
- );
1009
-
1010
- if ( ! empty( $_POST['id'] ) ) {
1011
- $imageId = intval( $_POST['id'] );
1012
- $result = $this->ModulaDB->editImage( $imageId, $data );
1013
- } else {
1014
- $data["gid"] = intval( $_POST['galleryId'] );
1015
- $result = $this->ModulaDB->addFullImage( $data );
1016
- }
1017
-
1018
- header( "Content-type: application/json" );
1019
-
1020
- if ( $result === false ) {
1021
- print "{\"success\":false}";
1022
- } else {
1023
- print "{\"success\":true}";
1024
- }
1025
-
1026
- }
1027
- die();
1028
- }
1029
-
1030
- public function list_images() {
1031
- if ( check_admin_referer( 'Modula', 'Modula' ) ) {
1032
- $gid = intval( $_POST["gid"] );
1033
- $gallery = $this->ModulaDB->getGalleryById( $gid, $this->defaultValues );
1034
-
1035
- $imageResults = $this->ModulaDB->getImagesByGalleryId( $gid );
1036
-
1037
- include( 'admin/include/image-list.php' );
1038
- }
1039
- die();
1040
- }
1041
-
1042
- private function checkboxVal( $field ) {
1043
- if ( isset( $_POST[ $field ] ) ) //return 'checked';
1044
- {
1045
- return 'T';
1046
- }
1047
-
1048
- //return '';
1049
- return 'F';
1050
- }
1051
-
1052
- public function save_gallery() {
1053
- if ( check_admin_referer( 'Modula', 'Modula' ) ) {
1054
- $galleryName = sanitize_text_field( $_POST['tg_name'] );
1055
- $galleryDescription = wp_filter_post_kses( $_POST['tg_description'] );
1056
- $slug = strtolower( str_replace( " ", "", $galleryName ) );
1057
- $margin = absint( $_POST['tg_margin'] );
1058
- $shuffle = $this->checkboxVal( 'tg_shuffle' );
1059
- $width = sanitize_text_field( $_POST['tg_width'] );
1060
- $height = absint($_POST['tg_height']);
1061
- $enableTwitter = $this->checkboxVal( 'tg_enableTwitter' );
1062
- $enableFacebook = $this->checkboxVal( 'tg_enableFacebook' );
1063
- $enableGplus = $this->checkboxVal( 'tg_enableGplus' );
1064
- $enablePinterest = $this->checkboxVal( 'tg_enablePinterest' );
1065
- $lightbox = $_POST['tg_lightbox'];
1066
- $wp_field_caption = $_POST['tg_wp_field_caption'];
1067
- $wp_field_title = $_POST['tg_wp_field_title'];
1068
- $hide_title = $this->checkboxVal( 'tg_hide_title' );
1069
- $hide_description = $this->checkboxVal( 'tg_hide_description' );
1070
- $captionColor = sanitize_hex_color($_POST['tg_captionColor']);
1071
- $borderSize = absint( $_POST['tg_borderSize'] );
1072
- $loadedScale = absint( $_POST['tg_loadedScale'] );
1073
- $loadedRotate = absint( $_POST['tg_loadedRotate'] );
1074
- $loadedVSlide = absint( $_POST['tg_loadedVSlide'] );
1075
- $loadedHSlide = absint( $_POST['tg_loadedHSlide'] );
1076
- $socialIconColor = sanitize_hex_color($_POST['tg_socialIconColor']);
1077
- $hoverEffect = $_POST['tg_hoverEffect'];
1078
- $titleFontSize = absint( $_POST['tg_titleFontSize'] );
1079
- $captionFontSize = absint( $_POST['tg_captionFontSize'] );
1080
- $borderColor = sanitize_hex_color($_POST['tg_borderColor']);
1081
- $borderRadius = intval( $_POST['tg_borderRadius'] );
1082
- $shadowColor = sanitize_hex_color($_POST['tg_shadowColor']);
1083
- $shadowSize = intval( $_POST['tg_shadowSize'] );
1084
- $style = sanitize_text_field($_POST['tg_style']);
1085
-
1086
- $id = isset( $_POST['ftg_gallery_edit'] ) ? intval( $_POST['ftg_gallery_edit'] ) : 0;
1087
-
1088
- $data = array(
1089
- 'name' => $galleryName,
1090
- 'slug' => $slug,
1091
- 'description' => $galleryDescription,
1092
- 'lightbox' => $lightbox,
1093
- 'img_size' => intval( $_POST['tg_img_size'] ),
1094
- 'hasResizedImages' => true,
1095
- 'wp_field_caption' => $wp_field_caption,
1096
- 'wp_field_title' => $wp_field_title,
1097
- 'hide_title' => $hide_title,
1098
- 'hide_description' => $hide_description,
1099
- 'margin' => $margin,
1100
- 'randomFactor' => $_POST['tg_randomFactor'],
1101
- 'shuffle' => $shuffle,
1102
- 'enableTwitter' => $enableTwitter,
1103
- 'enableFacebook' => $enableFacebook,
1104
- 'enableGplus' => $enableGplus,
1105
- 'enablePinterest' => $enablePinterest,
1106
- 'captionColor' => $captionColor,
1107
- 'hoverEffect' => $hoverEffect,
1108
- 'borderSize' => $borderSize,
1109
- 'loadedScale' => $loadedScale,
1110
- 'loadedHSlide' => $loadedHSlide,
1111
- 'loadedVSlide' => $loadedVSlide,
1112
- 'loadedRotate' => $loadedRotate,
1113
- 'socialIconColor' => $socialIconColor,
1114
- 'captionFontSize' => $captionFontSize,
1115
- 'titleFontSize' => $titleFontSize,
1116
- 'borderColor' => $borderColor,
1117
- 'borderRadius' => $borderRadius,
1118
- 'shadowSize' => $shadowSize,
1119
- 'shadowColor' => $shadowColor,
1120
- 'width' => $width,
1121
- 'height' => $height,
1122
- 'style' => $style,
1123
- );
1124
-
1125
- header( "Content-type: application/json" );
1126
- if ( $id > 0 ) {
1127
- $result = $this->ModulaDB->editGallery( $id, $data );
1128
-
1129
- if ( intval( $this->loadedData->img_size ) != $data['img_size'] ) {
1130
- $images = $this->ModulaDB->getImagesByGalleryId( $id );
1131
- $images = ModulaLiteTools::check_and_resize( $images, $data['img_size'] );
1132
-
1133
- foreach ( $images as $img ) {
1134
- $this->ModulaDB->editImage( $img->Id, (array) $img );
1135
- }
1136
- }
1137
-
1138
- $this->loadedData = $this->ModulaDB->getGalleryById( $id, $this->defaultValues );
1139
- } else {
1140
- $result = $this->ModulaDB->addGallery( $data );
1141
- $id = $this->ModulaDB->getNewGalleryId();
1142
- }
1143
-
1144
-
1145
- if ( $result ) {
1146
- print "{\"success\":true,\"id\":" . $id . "}";
1147
- } else {
1148
- print "{\"success\":false}";
1149
- }
1150
- }
1151
- die();
1152
- }
1153
-
1154
- public function edit_gallery() {
1155
- if ( isset( $_GET['galleryId'] ) ) {
1156
- $this->loadedData = $this->ModulaDB->getGalleryById( absint( $_GET['galleryId'] ), $this->defaultValues );
1157
- $modula_fields = $this->fields;
1158
- $modula_parent_page = "dashboard";
1159
-
1160
- include( "admin/edit-gallery.php" );
1161
- } else {
1162
- $redir = true;
1163
- $nobanner = true;
1164
- include( "admin/overview.php" );
1165
- }
1166
- }
1167
-
1168
- public function list_thumbnail_sizes() {
1169
- global $_wp_additional_image_sizes;
1170
- $sizes = array();
1171
- foreach ( get_intermediate_image_sizes() as $s ) {
1172
- $sizes[ $s ] = array( 0, 0 );
1173
- if ( in_array( $s, array( 'thumbnail', 'medium', 'large' ) ) ) {
1174
- $sizes[ $s ][0] = get_option( $s . '_size_w' );
1175
- $sizes[ $s ][1] = get_option( $s . '_size_h' );
1176
- } else {
1177
- if ( isset( $_wp_additional_image_sizes ) && isset( $_wp_additional_image_sizes[ $s ] ) ) {
1178
- $sizes[ $s ] = array(
1179
- $_wp_additional_image_sizes[ $s ]['width'],
1180
- $_wp_additional_image_sizes[ $s ]['height'],
1181
- );
1182
- }
1183
- }
1184
- }
1185
-
1186
- return $sizes;
1187
- }
1188
-
1189
- public function gallery_shortcode_handler( $atts ) {
1190
- require_once( 'lib/gallery-class.php' );
1191
- global $Modula;
1192
-
1193
- if ( class_exists( 'ModulaLiteFE' ) ) {
1194
- $Modula = new ModulaLiteFE( $this->ModulaDB, $atts['id'], $this->defaultValues );
1195
-
1196
- $settings = $Modula->getGallery();
1197
- switch ( $settings->lightbox ) {
1198
- case "lightbox2":
1199
- wp_enqueue_style( 'lightbox2_stylesheet' );
1200
- wp_enqueue_script( 'lightbox2_script' );
1201
- wp_add_inline_script( 'lightbox2_script', 'jQuery(document).ready(function(){lightbox.option({albumLabel: "' . esc_html__( 'Image %1 of %2', 'modula-gallery' ) . '"});});' );
1202
- break;
1203
- }
1204
-
1205
- return $Modula->render();
1206
- } else {
1207
- return esc_html__( 'Gallery not found.', 'modula-gallery' );
1208
- }
1209
- }
1210
-
1211
- public function shortcode_empty_paragraph_fix( $content ) {
1212
-
1213
- $array = array (
1214
- '<p>[Modula' => '[Modula' ,
1215
- '<p>[/Modula' => '[/Modula',
1216
- 'Modula]</p>' => 'Modula]',
1217
- 'Modula]<br />' => 'Modula]'
1218
- );
1219
-
1220
- $content = strtr( $content, $array );
1221
-
1222
- return $content;
1223
- }
1224
-
1225
- }
1226
-
1227
- class ModulaLiteHoverEffect {
1228
-
1229
- var $name;
1230
- var $code;
1231
- var $allowTitle;
1232
- var $allowSubtitle;
1233
- var $maxSocial;
1234
-
1235
- public function __construct( $name, $code, $allowTitle, $allowSubtitle, $maxSocial ) {
1236
- $this->name = $name;
1237
- $this->code = $code;
1238
- $this->allowTitle = $allowTitle;
1239
- $this->allowSubtitle = $allowSubtitle;
1240
- $this->maxSocial = $maxSocial;
1241
- }
1242
- }
1243
-
1244
- class ModulaLiteTools {
1245
-
1246
- public static function get_image_size_links( $id ) {
1247
- $result = array();
1248
- $sizes = get_intermediate_image_sizes();
1249
- $sizes[] = 'full';
1250
-
1251
- foreach ( $sizes as $size ) {
1252
- $image = wp_get_attachment_image_src( $id, $size );
1253
-
1254
- if ( ! empty( $image ) && ( true == $image[3] || 'full' == $size ) ) {
1255
- $result["$image[1]x$image[2]"] = $image[0];
1256
- }
1257
- }
1258
-
1259
- return $result;
1260
- }
1261
-
1262
- public static function resize_image( $id, $img_size ) {
1263
- $file = get_attached_file( $id );
1264
- $editor = wp_get_image_editor( $file );
1265
- $size = $editor->get_size();
1266
- if ( $size["width"] > $size["height"] ) {
1267
- $editor->resize( 10000, $img_size );
1268
- } else {
1269
- $editor->resize( $img_size, 10000 );
1270
- }
1271
- $path_parts = pathinfo( $file );
1272
- $filename = $path_parts['dirname'] . "/" . $path_parts['filename'] . "-" . $img_size . "x" . $img_size . "." . $path_parts["extension"];
1273
-
1274
- if ( ! file_exists( $filename ) ) {
1275
- $editor->save( $filename );
1276
- }
1277
-
1278
- return basename( $filename );
1279
- }
1280
-
1281
- public static function check_and_resize( &$images, $size ) {
1282
- foreach ( $images as &$img ) {
1283
- $metadata = wp_get_attachment_metadata( $img->imageId );
1284
-
1285
- if ( $img->imageId > 0 ) {
1286
- $uploads = wp_get_upload_dir();
1287
- $file = get_post_meta( $img->imageId, '_wp_attached_file', true );
1288
- $baseurl = $uploads['baseurl'] . '/' . str_replace( basename( $file ), "", $file );
1289
- $res_name = ModulaLiteTools::resize_image( $img->imageId, $size );
1290
-
1291
- if ( ! ( array_key_exists( "image_meta", $metadata ) && array_key_exists( "resized_images", $metadata["image_meta"] ) && in_array( $size . "x" . $size, $metadata["image_meta"]["resized_images"] ) ) ) {
1292
- if ( isset( $metadata['image_meta'] ) ) {
1293
- $md = $size . 'x' . $size;
1294
- $metadata['image_meta']['resized_images'][] = $md;
1295
- wp_update_attachment_metadata( $img->imageId, $metadata );
1296
- }
1297
- }
1298
-
1299
- $img->imagePath = $baseurl . $res_name;
1300
- } else {
1301
- $img->imagePath = preg_replace( "/w=(\d+)/", "w=" . $size, $img->imagePath );
1302
- }
1303
- }
1304
-
1305
- return $images;
1306
- }
1307
- }
1308
-
1309
- if ( class_exists( "ModulaLite" ) ) {
1310
- global $ob_ModulaLite;
1311
- $ob_ModulaLite = new ModulaLite();
1312
- }
1313
-
1314
- function modula_lite_check_for_review() {
1315
-
1316
- if ( ! is_admin() ) {
1317
- return;
1318
- }
1319
-
1320
- require_once MODULA_PLUGIN_DIR_PATH . 'lib/class-modula-review.php';
1321
-
1322
- Modula_Review::get_instance( array(
1323
- 'slug' => 'modula-best-grid-gallery',
1324
- 'messages' => array(
1325
- 'notice' => __( "Hey, I noticed you have created %s galleries - that's awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.<br><br><strong>~ Cristian Raiber</strong>,<br><strong>CEO Modula</strong>.", 'modula-gallery' ),
1326
- 'rate' => __( 'Ok, you deserve it', 'modula-gallery' ),
1327
- 'rated' => __( 'I already did', 'modula-gallery' ),
1328
- 'no_rate' => __( 'No, not good enough', 'modula-gallery' ),
1329
- ),
1330
- ) );
1331
-
1332
- }
1333
- modula_lite_check_for_review();
1334
-
1335
- // Add compatibility with AO
1336
- add_filter('autoptimize_filter_js_exclude','modula_lite_override_jsexclude',90,1);
1337
- function modula_lite_override_jsexclude( $exclude ) {
1338
- if ( is_array( $exclude ) ) {
1339
- $exclude[] = 'jquery.modula.js';
1340
- }else{
1341
- $exclude .= ", jquery.modula.js";
1342
- }
1343
- return $exclude;
1344
- }
1345
-
1346
- // Beta Testing.
1347
- add_action( 'admin_notices', 'modula_beta_notices' );
1348
- add_action( 'wp_ajax_modula_beta_testing', 'modula_beta_ajax' );
1349
- add_action( 'admin_print_footer_scripts', 'modula_beta_ajax_script', 99 );
1350
-
1351
- function modula_beta_notices() {
1352
-
1353
- $options = get_option( 'modula-checks', array() );
1354
1355
- if ( isset( $options['beta-testing'] ) ) {
1356
- return;
1357
- }
1358
- ?>
1359
- <style type="text/css">
1360
- #modula-beta-testing-info {
1361
- display: inline-block;
1362
- margin-left: 15px;
1363
- }
1364
- </style>
1365
- <div id="modula-beta-testing" class="notice notice-success" style="position:relative;">
1366
- <h3>Try Modula 2.0 !!</h3>
1367
- <p>We’ve been working on an awesome update to Modula over the last few months and can’t wait to release it to the public. But, before that can happen, we need the help of amazing users in the WordPress community (just like you) to improve Modula 2.0’s first beta.</p>
1368
- <p class="actions">
1369
- <a id="modula-beta-testing-dwn" href="https://machothemes.com/downloads/modula-2.0.0.zip" target="_blank" class="button button-primary modula-beta-testing-button"><?php echo __( 'Download Modula 2.0 Beta', 'modula-gallery' ); ?></a>
1370
- <a id="modula-beta-testing-info" href="<?php echo admin_url( 'admin.php?page=modula-lite-gallery-v2' ) ?>" target="_blank" class="modula-beta-testing-button"><?php echo __( 'Find more', 'modula-gallery' ); ?></a>
1371
- </p>
1372
- <button type="button" class="notice-dismiss" style="cursoir:pointer;"><span class="screen-reader-text">Dismiss this notice.</span></button>
1373
- </div>
1374
- <script>
1375
- jQuery(document).ready(function(){
1376
- jQuery( '#modula-beta-testing .notice-dismiss' ).click(function( evt ){
1377
- evt.preventDefault();
1378
- var ajaxData = {
1379
- 'action' : 'modula_beta_testing',
1380
- 'security' : '<?php echo wp_create_nonce( 'modula-beta-testing' ) ?>'
1381
- }
1382
- jQuery.ajax({
1383
- url: "<?php echo admin_url('admin-ajax.php'); ?>",
1384
- method: "POST",
1385
- data: ajaxData,
1386
- dataType: "html"
1387
- }).done(function(){
1388
- jQuery("#modula-beta-testing").hide();
1389
- });
1390
- });
1391
- })
1392
- </script>
1393
- <?php
1394
}
1395
1396
- function modula_beta_ajax() {
1397
-
1398
- check_ajax_referer( 'modula-beta-testing', 'security' );
1399
1400
- $options = get_option( 'modula-checks', array() );
1401
- $options['beta-testing'] = 1;
1402
1403
- update_option( 'modula-checks', $options );
1404
1405
- wp_die( 'ok' );
1406
1407
}
1408
1409
- function modula_beta_ajax_script() {
1410
-
1411
- $ajax_nonce = wp_create_nonce( "modula-beta-testing" );
1412
-
1413
- ?>
1414
-
1415
- <script type="text/javascript">
1416
- jQuery( document ).ready( function( $ ){
1417
-
1418
- $( '.modula-beta-testing-button' ).click( function( evt ){
1419
- var href = $(this).attr('href'),
1420
- id = $(this).attr('id');
1421
-
1422
- var data = {
1423
- action: 'modula_beta_testing',
1424
- security: '<?php echo $ajax_nonce; ?>',
1425
- };
1426
-
1427
- $.post( '<?php echo admin_url( 'admin-ajax.php' ) ?>', data, function( response ) {
1428
- $( '#modula-beta-testing' ).slideUp( 'fast', function() {
1429
- $( this ).remove();
1430
- } );
1431
- });
1432
-
1433
- } );
1434
-
1435
- });
1436
- </script>
1437
-
1438
- <?php
1439
- }
2
/**
3
* Plugin Name: Modula
4
* Plugin URI: https://wp-modula.com/
5
+ * Description: Modula is one of the best & most creative WordPress gallery plugins. Use it to create a great grid or masonry image gallery.
6
* Author: Macho Themes
7
+ * Version: 2.0.1
8
* Author URI: https://www.machothemes.com/
9
*/
10
11
+ /**
12
+ * Define Constants
13
+ *
14
+ * @since 2.0.0
15
+ */
16
+ define( 'MODULA_LITE_VERSION', '2.0.0' );
17
+ define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) );
18
+ define( 'MODULA_URL', plugin_dir_url( __FILE__ ) );
19
20
+ /**
21
+ * The code that runs during plugin activation.
22
+ * This action is documented in includes/class-modula-activator.php
23
+ */
24
+ function modula_activate() {
25
+ require_once plugin_dir_path( __FILE__ ) . 'includes/class-modula-upgrades.php';
26
+ $upgrades = Modula_Upgrades::get_instance();
27
+ $upgrades->check_on_activate();
28
}
29
30
+ register_activation_hook( __FILE__, 'modula_activate' );
31
32
+ /**
33
+ * The core plugin class that is used to define internationalization,
34
+ * admin-specific hooks, and public-facing site hooks.
35
+ */
36
+ require plugin_dir_path( __FILE__ ) . 'includes/class-modula.php';
37
38
+ /**
39
+ * Begins execution of the plugin.
40
+ *
41
+ * Since everything within the plugin is registered via hooks,
42
+ * then kicking off the plugin from this point in the file does
43
+ * not affect the page life cycle.
44
+ *
45
+ * @since 2.0.0
46
+ */
47
+ function modula_run() {
48
49
+ // Our core class
50
+ $plugin = new Modula();
51
52
}
53
54
+ modula_run();
README.txt CHANGED
@@ -2,8 +2,8 @@
2
Contributors: machothemes, silkalns
3
Tags: best gallery plugin, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, wordpress portfolio plugin, masonry gallery, fancy gallery, media gallery, mosaic gallery, polaroid gallery, portfolio gallery
4
Requires at least: 3.8
5
- Tested up to: 4.9
6
- Stable tag: 1.3.7
7
License: GPLv3 or later
8
License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
@@ -13,18 +13,9 @@ Photo Gallery by Modula - an advanced solution for Photo Gallery users. Create b
13
14
Modula Image Gallery is a creative and original WordPress plugin perfect for creating custom, unique, and responsive image galleries. Modula is available in both a Lite/free version and a premium version and it is currently the easiest and fastest photo gallery plugin for WordPress. Directly from its dashboard you are able to build stunning galleries in a few seconds, unlike many other WordPress plugins.
15
16
- = Try Modula 2.0 Beta =
17
-
18
- We’ve been working on an awesome update to Modula over the last few months and can’t wait to release it to the public. But, before that can happen, we need the help of amazing users in the WordPress community (just like you) to improve Modula 2.0’s first beta. You can download our new plugin from <a href="https://machothemes.com/downloads/modula-2.0.0.zip" target="_blank">here</a>.
19
-
20
- Below is a video that showcases the new features of Modula 2.0.
21
-
22
- https://www.youtube.com/watch?v=NxrTXQNExh4
23
-
24
= See a 60s video of Modula in action =
25
26
- https://www.youtube.com/watch?v=tq8yUYxgtnA
27
-
28
29
> **Time-saving features available in the FULL version:**
30
>
@@ -100,11 +91,6 @@ Modula is also the best WordPress portfolio plugin, as it allows you to build go
100
* travel
101
* also wedding albums.
102
103
- If you're frustated because your current galleries looks boring and too standard then you can use the importer which is included with Modula. The importer is currently able to import Envira and NextGen galleries.
104
-
105
- > This plugin is maintained and supported by Macho Themes.
106
- > Check out some of the other <a href="//machothemes.com/plugins/">WordPress plugins</a> we've developed.
107
- > Check out some of the other <a href="//machothemes.com/themes/free/">free WordPress themes</a> we've developed.
108
109
== Installation ==
110
= For automatic installation: =
@@ -163,16 +149,21 @@ Free support is included only with a PRO license: [Buy Modula PRO](https://wp-mo
163
164
== Screenshots ==
165
166
- 1. Gallery with Appear effect
167
- 2. Gallery with Crafty effect and round corners
168
- 3. Gallery with Catinelle effect
169
- 4. Gallery with Appear effect
170
- 5. Gallery with Pufrobo effect
171
- 6. Lightgallery lightbox
172
- 7. Admin panel with Material design
173
174
== Changelog ==
175
176
= 1.3.7 =
177
* fixed dismiss button from beta testing notice.
178
2
Contributors: machothemes, silkalns
3
Tags: best gallery plugin, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, wordpress portfolio plugin, masonry gallery, fancy gallery, media gallery, mosaic gallery, polaroid gallery, portfolio gallery
4
Requires at least: 3.8
5
+ Tested up to: 5.0
6
+ Stable tag: 2.0.1
7
License: GPLv3 or later
8
License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
13
14
Modula Image Gallery is a creative and original WordPress plugin perfect for creating custom, unique, and responsive image galleries. Modula is available in both a Lite/free version and a premium version and it is currently the easiest and fastest photo gallery plugin for WordPress. Directly from its dashboard you are able to build stunning galleries in a few seconds, unlike many other WordPress plugins.
15
16
= See a 60s video of Modula in action =
17
18
+ https://www.youtube.com/watch?v=NxrTXQNExh4
19
20
> **Time-saving features available in the FULL version:**
21
>
91
* travel
92
* also wedding albums.
93
94
95
== Installation ==
96
= For automatic installation: =
149
150
== Screenshots ==
151
152
+ 1. Custom Grid - Freely resize images
153
+ 2. Custom Grid - Helper Grid
154
+ 3. Back-end Options UI Walkthrough
155
+ 4. Responsive galleries created with Modula
156
157
== Changelog ==
158
159
+ = 2.0.1 - 12.17.2018 =
160
+ * Major Update
161
+ * Build Custom Grids - Take full control of your galleries.
162
+ * New Admin Interface - For a more intuitive user interface, we’ve blended Modula right into WordPress.
163
+ * Drag & Drop to Upload Images
164
+ * Guidelines to Help You Make the Perfect Gallery (edited)
165
+ * Preview your Gallery Without the Hassle
166
+
167
= 1.3.7 =
168
* fixed dismiss button from beta testing notice.
169
admin/add-gallery.php DELETED
@@ -1,121 +0,0 @@
1
- <?php
2
- if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
3
- die( _e( 'You are not allowed to call this page directly.', 'modula-gallery' ) );
4
- }
5
-
6
- $tg_subtitle = "New Gallery";
7
- ?>
8
-
9
- <?php include( "header.php" ) ?>
10
-
11
-
12
- <div id="modula-wizard" class="add-gallery">
13
- <h2> <?php _e( 'Add New Gallery', 'modula-gallery' ); ?> </h2>
14
- <form action="#" method="post">
15
- <?php wp_nonce_field( 'Modula', 'Modula' ); ?>
16
- <input type="hidden" name="enc_images" value=""/>
17
-
18
- <fieldset data-step="1">
19
- <div class="row">
20
- <div class="input-field">
21
- <input name="tg_name" id="name" type="text" class="validate" required="required">
22
- <label for="name"><?php echo esc_html__( 'Name of the gallery', 'modula-gallery' ) ?></label>
23
- </div>
24
- </div>
25
- <div class="row">
26
- <div class="input-field">
27
- <input name="tg_description" id="description" type="text" class="validate">
28
- <label for="description"><?php echo esc_html__( 'Description of the gallery (for internal use)', 'modula-gallery' ) ?></label>
29
- </div>
30
- </div>
31
- <div class="row">
32
- <div class="input-field col s6">
33
- <input name="tg_width" id="width" type="text" value="100%">
34
- <label for="width"><?php echo esc_html__( 'Gallery width', 'modula-gallery' ) ?></label>
35
- </div>
36
- <div class="input-field col s6">
37
- <input name="tg_height" id="height" type="text" value="800">
38
- <label for="height"><?php echo esc_html__( 'Gallery height in pixels', 'modula-gallery' ) ?></label>
39
- </div>
40
- </div>
41
- </fieldset>
42
- <fieldset data-step="2" data-branch="images">
43
- <div class="field">
44
- <h5><?php echo esc_html__( 'WordPress field for titles:', 'modula-gallery' ) ?></h5>
45
- <select class="browser-default" name="ftg_wp_field_title">
46
- <option value="none"><?php echo esc_html__( 'Don\'t use titles', 'modula-gallery' ); ?></option>
47
- <option value="title" selected><?php echo esc_html__( 'Title', 'modula-gallery' ); ?></option>
48
- <option value="description"><?php echo esc_html__( 'Description', 'modula-gallery' ); ?></option>
49
- </select>
50
- </div>
51
- <div class="field">
52
- <h5><?php echo esc_html__( 'WordPress field for captions:', 'modula-gallery' ) ?></h5>
53
- <select class="browser-default" name="ftg_wp_field_caption">
54
- <option value="none"><?php echo esc_html( 'Don\'t use captions', 'modula-gallery' ); ?></option>
55
- <option value="title"><?php echo esc_html( 'Title', 'modula-gallery' ); ?></option>
56
- <option value="caption" selected><?php echo esc_html( 'Captions', 'modula-gallery' ); ?></option>
57
- <option value="description"><?php echo esc_html( 'Description', 'modula-gallery' ); ?></option>
58
- </select>
59
- </div>
60
- </fieldset>
61
- <fieldset data-step="3" data-save="true">
62
- <div class="field">
63
- <h5><?php echo esc_html__( 'Image size', 'modula-gallery' ) ?></h5>
64
- <div class="row">
65
- <div class="input-field">
66
- <input name="tg_img_size" id="img_size" type="text" class="validate" required="required" value="500">
67
- <label for="name"><?php echo esc_html__( 'Minimum width or height of images', 'modula-gallery' ) ?></label>
68
- </div>
69
- </div>
70
-
71
- <label class="shortpixel">
72
- <img src="<?php echo esc_url( plugins_url( '', __file__ ) ); ?>/images/icon-shortpixel.png" alt="ShortPixel">
73
- <a target="_blank" href="https://shortpixel.com/h/af/HUOYEBB31472"><?php echo esc_html__( 'We suggest using the ShortPixel image optimization plugin to optimize your images and get the best possible SEO results & load speed..', 'modula-gallery' ) ?></a>
74
- </label>
75
-
76
- </div>
77
- <div class="field select-images">
78
- <a class="waves-effect waves-light btn add-images">
79
- <i class="mdi mdi-plus left"></i> <?php echo esc_html__( 'Add images', 'modula-gallery' ) ?></a>
80
- <br> <label><?php echo esc_html__( 'You can add images now or later.', 'modula-gallery' ) ?></label>
81
-
82
- <div class="images list-group"></div>
83
- </div>
84
- </fieldset>
85
-
86
- <footer class="page-footer">
87
- <div class="progress loading hide">
88
- <div class="indeterminate"></div>
89
- </div>
90
-
91
- <a class="waves-effect waves-yellow btn-flat prev"><?php echo esc_html__( 'Previous', 'modula-gallery' ) ?></a>
92
- <a class="waves-effect waves-green btn-flat next"><?php echo esc_html__( 'Next', 'modula-gallery' ) ?></a>
93
- </footer>
94
-
95
- </form>
96
- <div id="success" class="modal">
97
- <div class="modal-content">
98
- <h4><?php echo esc_html__( 'Success!', 'modula-gallery' ) ?></h4>
99
- <p><?php echo esc_html__( 'Your gallery', 'modula-gallery' ) ?>
100
- "<span class="gallery-name"></span>" <?php echo esc_html__( 'has been created. Copy the following shortcode:', 'modula-gallery' ) ?>
101
- <br> <input type="text" class="code"><br>
102
- <?php echo esc_html__( 'and paste it inside a post or a page. Otherwise click', 'modula-gallery' ) ?>
103
- <a class='customize'><?php echo esc_html__( 'here', 'modula-gallery' ) ?></a> <?php echo esc_html__( 'to customize
104
- the gallery.', 'modula-gallery' ) ?>
105
- </p>
106
- </div>
107
- <div class="modal-'footer">
108
- <a href="?page=modula-lite-admin" id="modal-close" class="waves-effect waves-green btn-flat modal-action"><?php echo esc_html__( 'Close', 'modula-gallery' ) ?></a>
109
- </div>
110
- </div>
111
-
112
- <div id="error" class="modal">
113
- <div class="modal-content">
114
- <h4><?php echo esc_html__( 'Error!', 'modula-gallery' ) ?></h4>
115
- <p><?php echo esc_html__( 'For some reason it was not possible to save your gallery', 'modula-gallery' ) ?></p>
116
- </div>
117
- <div class="modal-footer">
118
- <a href="?page=modula-lite-admin" class="waves-effect waves-green btn-flat modal-action"><?php echo esc_html__( 'Close', 'modula-gallery' ) ?></a>
119
- </div>
120
- </div>
121
- </div>
admin/css/colors.css DELETED
File without changes
admin/css/materialize.css DELETED
@@ -1,5702 +0,0 @@
1
- /*!
2
- * Materialize v0.95.3 (http://materializecss.com)
3
- * Copyright 2014-2015 Materialize
4
- * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
5
- */
6
- .materialize-red.lighten-5 {
7
- background-color: #fdeaeb !important; }
8
-
9
- .materialize-red-text.text-lighten-5 {
10
- color: #fdeaeb !important; }
11
-
12
- .materialize-red.lighten-4 {
13
- background-color: #f8c1c3 !important; }
14
-
15
- .materialize-red-text.text-lighten-4 {
16
- color: #f8c1c3 !important; }
17
-
18
- .materialize-red.lighten-3 {
19
- background-color: #f3989b !important; }
20
-
21
- .materialize-red-text.text-lighten-3 {
22
- color: #f3989b !important; }
23
-
24
- .materialize-red.lighten-2 {
25
- background-color: #ee6e73 !important; }
26
-
27
- .materialize-red-text.text-lighten-2 {
28
- color: #ee6e73 !important; }
29
-
30
- .materialize-red.lighten-1 {
31
- background-color: #ea454b !important; }
32
-
33
- .materialize-red-text.text-lighten-1 {
34
- color: #ea454b !important; }
35
-
36
- .materialize-red {
37
- background-color: #e51c23 !important; }
38
-
39
- .materialize-red-text {
40
- color: #e51c23 !important; }
41
-
42
- .materialize-red.darken-1 {
43
- background-color: #d0181e !important; }
44
-
45
- .materialize-red-text.text-darken-1 {
46
- color: #d0181e !important; }
47
-
48
- .materialize-red.darken-2 {
49
- background-color: #b9151b !important; }
50
-
51
- .materialize-red-text.text-darken-2 {
52
- color: #b9151b !important; }
53
-
54
- .materialize-red.darken-3 {
55
- background-color: #a21318 !important; }
56
-
57
- .materialize-red-text.text-darken-3 {
58
- color: #a21318 !important; }
59
-
60
- .materialize-red.darken-4 {
61
- background-color: #8b1014 !important; }
62
-
63
- .materialize-red-text.text-darken-4 {
64
- color: #8b1014 !important; }
65
-
66
- .red.lighten-5 {
67
- background-color: #FFEBEE !important; }
68
-
69
- .red-text.text-lighten-5 {
70
- color: #FFEBEE !important; }
71
-
72
- .red.lighten-4 {
73
- background-color: #FFCDD2 !important; }
74
-
75
- .red-text.text-lighten-4 {
76
- color: #FFCDD2 !important; }
77
-
78
- .red.lighten-3 {
79
- background-color: #EF9A9A !important; }
80
-
81
- .red-text.text-lighten-3 {
82
- color: #EF9A9A !important; }
83
-
84
- .red.lighten-2 {
85
- background-color: #E57373 !important; }
86
-
87
- .red-text.text-lighten-2 {
88
- color: #E57373 !important; }
89
-
90
- .red.lighten-1 {
91
- background-color: #EF5350 !important; }
92
-
93
- .red-text.text-lighten-1 {
94
- color: #EF5350 !important; }
95
-
96
- .red {
97
- background-color: #F44336 !important; }
98
-
99
- .red-text {
100
- color: #F44336 !important; }
101
-
102
- .red.darken-1 {
103
- background-color: #E53935 !important; }
104
-
105
- .red-text.text-darken-1 {
106
- color: #E53935 !important; }
107
-
108
- .red.darken-2 {
109
- background-color: #D32F2F !important; }
110
-
111
- .red-text.text-darken-2 {
112
- color: #D32F2F !important; }
113
-
114
- .red.darken-3 {
115
- background-color: #C62828 !important; }
116
-
117
- .red-text.text-darken-3 {
118
- color: #C62828 !important; }
119
-
120
- .red.darken-4 {
121
- background-color: #B71C1C !important; }
122
-
123
- .red-text.text-darken-4 {
124
- color: #B71C1C !important; }
125
-
126
- .red.accent-1 {
127
- background-color: #FF8A80 !important; }
128
-
129
- .red-text.text-accent-1 {
130
- color: #FF8A80 !important; }
131
-
132
- .red.accent-2 {
133
- background-color: #FF5252 !important; }
134
-
135
- .red-text.text-accent-2 {
136
- color: #FF5252 !important; }
137
-
138
- .red.accent-3 {
139
- background-color: #FF1744 !important; }
140
-
141
- .red-text.text-accent-3 {
142
- color: #FF1744 !important; }
143
-
144
- .red.accent-4 {
145
- background-color: #D50000 !important; }
146
-
147
- .red-text.text-accent-4 {
148
- color: #D50000 !important; }
149
-
150
- .pink.lighten-5 {
151
- background-color: #fce4ec !important; }
152
-
153
- .pink-text.text-lighten-5 {
154
- color: #fce4ec !important; }
155
-
156
- .pink.lighten-4 {
157
- background-color: #f8bbd0 !important; }
158
-
159
- .pink-text.text-lighten-4 {
160
- color: #f8bbd0 !important; }
161
-
162
- .pink.lighten-3 {
163
- background-color: #f48fb1 !important; }
164
-
165
- .pink-text.text-lighten-3 {
166
- color: #f48fb1 !important; }
167
-
168
- .pink.lighten-2 {
169
- background-color: #f06292 !important; }
170
-
171
- .pink-text.text-lighten-2 {
172
- color: #f06292 !important; }
173
-
174
- .pink.lighten-1 {
175
- background-color: #ec407a !important; }
176
-
177
- .pink-text.text-lighten-1 {
178
- color: #ec407a !important; }
179
-
180
- .pink {
181
- background-color: #e91e63 !important; }
182
-
183
- .pink-text {
184
- color: #e91e63 !important; }
185
-
186
- .pink.darken-1 {
187
- background-color: #d81b60 !important; }
188
-
189
- .pink-text.text-darken-1 {
190
- color: #d81b60 !important; }
191
-
192
- .pink.darken-2 {
193
- background-color: #c2185b !important; }
194
-
195
- .pink-text.text-darken-2 {
196
- color: #c2185b !important; }
197
-
198
- .pink.darken-3 {
199
- background-color: #ad1457 !important; }
200
-
201
- .pink-text.text-darken-3 {
202
- color: #ad1457 !important; }
203
-
204
- .pink.darken-4 {
205
- background-color: #880e4f !important; }
206
-
207
- .pink-text.