Cherry Projects - Version 1.2.5

Version Description

  • Elementor page builder compatibility
  • Fixed bugs
Download this release

Release Info

Developer TemplateMonster 2002
Plugin Icon 128x128 Cherry Projects
Version 1.2.5
Comparing to
See all releases

Code changes from version 1.2.4 to 1.2.5

Files changed (114) hide show
  1. admin/includes/class-projects-admin.php +0 -670
  2. admin/includes/class-projects-options-page.php +1 -0
  3. cherry-framework/cherry-core.php +69 -96
  4. cherry-framework/config.json +15 -15
  5. cherry-framework/modules/cherry-breadcrumbs/cherry-breadcrumbs.php +53 -26
  6. cherry-framework/modules/cherry-customizer/cherry-customizer.php +40 -39
  7. cherry-framework/modules/cherry-customizer/inc/class-cherry-wp-customize-iconpicker.php +5 -3
  8. cherry-framework/modules/cherry-db-updater/cherry-db-updater.php +1 -3
  9. cherry-framework/modules/cherry-dynamic-css/cherry-dynamic-css.php +1 -3
  10. cherry-framework/modules/cherry-dynamic-css/inc/class-cherry-dynamic-css-collector.php +1 -1
  11. cherry-framework/modules/cherry-dynamic-css/inc/class-cherry-dynamic-css-utilities.php +4 -4
  12. cherry-framework/modules/cherry-google-fonts-loader/cherry-google-fonts-loader.php +5 -12
  13. cherry-framework/modules/cherry-handler/cherry-handler.php +50 -28
  14. cherry-framework/modules/cherry-interface-builder/cherry-interface-builder.php +28 -9
  15. cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.scss +36 -2
  16. cherry-framework/modules/cherry-interface-builder/inc/assets/min/cherry-interface-builder.min.css +1 -1
  17. cherry-framework/modules/cherry-interface-builder/inc/views/component-accordion.php +1 -1
  18. cherry-framework/modules/cherry-interface-builder/inc/views/component-repeater.php +1 -1
  19. cherry-framework/modules/cherry-interface-builder/inc/views/component-tab-horizontal.php +1 -1
  20. cherry-framework/modules/cherry-interface-builder/inc/views/component-tab-vertical.php +1 -1
  21. cherry-framework/modules/cherry-interface-builder/inc/views/component-toggle.php +1 -1
  22. cherry-framework/modules/cherry-interface-builder/inc/views/control.php +1 -1
  23. cherry-framework/modules/cherry-interface-builder/inc/views/form.php +1 -1
  24. cherry-framework/modules/cherry-interface-builder/inc/views/html.php +1 -1
  25. cherry-framework/modules/cherry-interface-builder/inc/views/section.php +1 -1
  26. cherry-framework/modules/cherry-interface-builder/inc/views/settings-children-title.php +1 -1
  27. cherry-framework/modules/cherry-interface-builder/inc/views/settings.php +1 -1
  28. cherry-framework/modules/cherry-interface-builder/inc/views/tab-children-title.php +1 -1
  29. cherry-framework/modules/cherry-interface-builder/inc/views/toggle-children-title.php +1 -1
  30. cherry-framework/modules/cherry-js-core/cherry-js-core.php +26 -10
  31. cherry-framework/modules/cherry-post-formats-api/cherry-post-formats-api.php +42 -16
  32. cherry-framework/modules/cherry-post-formats-api/inc/class-cherry-facebook-embed.php +1 -1
  33. cherry-framework/modules/cherry-post-meta/cherry-post-meta.php +4 -6
  34. cherry-framework/modules/cherry-term-meta/cherry-term-meta.php +1 -3
  35. cherry-framework/modules/cherry-toolkit/cherry-toolkit.php +1 -3
  36. cherry-framework/modules/cherry-ui-elements/assets/sass/_lock.scss +110 -0
  37. cherry-framework/modules/cherry-ui-elements/cherry-ui-elements.php +27 -10
  38. cherry-framework/modules/cherry-ui-elements/i-ui.php +1 -1
  39. cherry-framework/modules/cherry-ui-elements/inc/class-cherry-lock-element.php +128 -0
  40. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/ui-button.php +3 -3
  41. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/view/button-view.php +10 -4
  42. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.css +1 -1
  43. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-checkbox.scss +8 -5
  44. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/ui-checkbox.php +36 -16
  45. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/min/ui-colorpicker.min.css +1 -1
  46. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-colorpicker.scss +7 -1
  47. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/ui-colorpicker.php +26 -10
  48. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/min/ui-iconpicker.min.css +1 -1
  49. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-iconpicker.scss +8 -0
  50. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/ui-iconpicker.php +66 -9
  51. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/min/ui-media.min.css +1 -1
  52. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-media.scss +7 -0
  53. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/ui-media.php +27 -9
  54. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/min/ui-radio.min.css +1 -1
  55. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/min/ui-radio.min.js +1 -1
  56. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/ui-radio.scss +2 -1
  57. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/ui-radio.php +40 -17
  58. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/ui-repeater.php +39 -6
  59. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select.min.css +1 -1
  60. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select.min.js +1 -1
  61. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.js +1 -1
  62. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.scss +1 -0
  63. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/ui-select.php +74 -53
  64. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/min/ui-slider.min.css +1 -1
  65. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/ui-slider.scss +7 -0
  66. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/ui-slider.php +26 -9
  67. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/min/ui-stepper.min.css +1 -1
  68. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/ui-stepper.scss +7 -0
  69. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/ui-stepper.php +25 -6
  70. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/min/ui-switcher.min.css +1 -1
  71. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-switcher.scss +1 -0
  72. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/ui-switcher.php +28 -10
  73. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/min/ui-text.min.css +1 -1
  74. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/ui-text.scss +7 -0
  75. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/ui-text.php +22 -5
  76. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/min/ui-textarea.min.css +1 -1
  77. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/ui-textarea.scss +7 -0
  78. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/ui-textarea.php +23 -5
  79. cherry-framework/modules/cherry-ui-elements/ui-element.php +1 -16
  80. cherry-framework/modules/cherry-utility/cherry-utility.php +17 -7
  81. cherry-framework/modules/cherry-utility/inc/cherry-attributes-utilit.php +6 -3
  82. cherry-framework/modules/cherry-utility/inc/cherry-media-utilit.php +3 -1
  83. cherry-framework/modules/cherry-utility/inc/cherry-meta-data-utilit.php +2 -1
  84. cherry-framework/modules/cherry-utility/inc/cherry-satellite-utilit.php +8 -4
  85. cherry-framework/modules/cherry-widget-factory/cherry-widget-factory.php +15 -8
  86. cherry-framework/modules/cherry-widget-factory/inc/class-cherry-abstract-widget.php +34 -149
  87. cherry-framework/modules/cherry5-assets-loader/assets/append.js +16 -0
  88. cherry-framework/modules/cherry5-assets-loader/assets/min/append.min.js +1 -0
  89. cherry-framework/modules/cherry5-assets-loader/assets/var.js +2 -0
  90. cherry-framework/modules/cherry5-assets-loader/cherry5-assets-loader.php +136 -0
  91. cherry-framework/modules/cherry5-assets-loader/inc/cherry5-assets-loader-handle-css.php +50 -0
  92. cherry-framework/modules/cherry5-assets-loader/inc/cherry5-assets-loader-handle-js.php +50 -0
  93. cherry-framework/modules/cherry5-assets-loader/inc/cherry5-assets-loader-handle.php +113 -0
  94. cherry-framework/modules/cherry5-insert-shortcode/assets/cherry-insert-shortcode.scss +0 -1
  95. cherry-framework/modules/cherry5-insert-shortcode/cherry5-insert-shortcode.php +45 -21
  96. cherry-framework/modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-button.php +1 -1
  97. cherry-framework/modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php +35 -11
  98. cherry-framework/modules/cherry5-insert-shortcode/inc/views/insert-shortcode-pop-up.php +1 -1
  99. cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-content-area.php +1 -1
  100. cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-has-not-option.php +1 -1
  101. cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-options.php +1 -1
  102. cherry-framework/setup-theme.php +44 -0
  103. cherry-framework/setup.php +1 -1
  104. cherry-projects.php +2 -2
  105. public/assets/js/cherry-projects-plugin.js +4 -4
  106. public/assets/js/cherry-projects-scripts.js +34 -11
  107. public/includes/class-projects-data.php +8 -7
  108. public/includes/class-projects-shortcode.php +496 -6
  109. public/includes/class-projects-term-data.php +0 -1
  110. public/includes/class-projects-term-shortcode.php +289 -6
  111. public/includes/ext/class-cherry-projects-elementor-compat.php +123 -0
  112. public/includes/ext/class-cherry-projects-elementor-module.php +247 -0
  113. public/includes/ext/class-cherry-projects-terms-elementor-module.php +248 -0
  114. readme.txt +7 -2
admin/includes/class-projects-admin.php CHANGED
@@ -36,9 +36,6 @@ class Cherry_Projects_Admin {
36
 
37
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
38
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );
39
-
40
- // Shortcode insert module registration
41
- add_action( 'after_setup_theme', array( $this, 'shortcode_registration' ), 10 );
42
  }
43
 
44
  /**
@@ -173,673 +170,6 @@ class Cherry_Projects_Admin {
173
  }
174
  }
175
 
176
- /**
177
- * Shortcode registration
178
- *
179
- * @return void
180
- */
181
- public function shortcode_registration() {
182
- cherry_projects()->get_core()->init_module( 'cherry5-insert-shortcode', array() );
183
-
184
- $utility = cherry_projects()->get_core()->modules['cherry-utility']->utility;
185
-
186
- $category_list = $utility->satellite->get_terms_array( CHERRY_PROJECTS_NAME . '_category', 'slug' );
187
- $tag_list = $utility->satellite->get_terms_array( CHERRY_PROJECTS_NAME . '_tag', 'slug' );
188
-
189
- cherry5_register_shortcode(
190
- array(
191
- 'title' => esc_html__( 'Projects', 'cherry-projects' ),
192
- 'description' => esc_html__( 'Showcase your projects using a variety of layouts with Cherry Projects plugin', 'cherry-projects' ),
193
- 'icon' => '<span class="dashicons dashicons-layout"></span>',
194
- 'slug' => 'cherry-prijects-plugin',
195
- 'shortcodes' => array(
196
- array(
197
- 'title' => esc_html__( 'Projects', 'cherry-projects' ),
198
- 'description' => esc_html__( 'Shortcode is used to display the projects list with set parameters.', 'cherry-projects' ),
199
- 'icon' => '<span class="dashicons dashicons-layout"></span>',
200
- 'slug' => 'cherry_projects',
201
- 'options' => array(
202
-
203
- 'listing_layout' => array(
204
- 'type' => 'radio',
205
- 'title' => esc_html__( 'Projects listing layout', 'cherry-projects' ),
206
- 'description' => esc_html__( 'Choose projects listing view layout.', 'cherry-projects' ),
207
- 'value' => 'grid-layout',
208
- 'display_input' => false,
209
- 'options' => array(
210
- 'grid-layout' => array(
211
- 'label' => esc_html__( 'Grid', 'cherry-projects' ),
212
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-grid.svg',
213
- 'slave' => 'projects-listing-layout-grid-layout',
214
- ),
215
- 'masonry-layout' => array(
216
- 'label' => esc_html__( 'Masonry', 'cherry-projects' ),
217
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-masonry.svg',
218
- 'slave' => 'projects-listing-layout-masonry-layout',
219
- ),
220
- 'justified-layout' => array(
221
- 'label' => esc_html__( 'Justified', 'cherry-projects' ),
222
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-justified.svg',
223
- 'slave' => 'projects-listing-layout-justified-layout',
224
- ),
225
- 'cascading-grid-layout' => array(
226
- 'label' => esc_html__( 'Cascading grid', 'cherry-projects' ),
227
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-cascading-grid.svg',
228
- 'slave' => 'projects-listing-layout-cascading-grid-layout',
229
- ),
230
- 'list-layout' => array(
231
- 'label' => esc_html__( 'List', 'cherry-projects' ),
232
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-listing.svg',
233
- 'slave' => 'projects-listing-layout-list-layout',
234
- ),
235
- ),
236
- ),
237
-
238
- 'loading_mode' => array(
239
- 'type' => 'radio',
240
- 'title' => esc_html__( 'Pagination mode', 'cherry-projects' ),
241
- 'description' => esc_html__( 'Choose projects pagination mode', 'cherry-projects' ),
242
- 'value' => 'ajax-pagination-mode',
243
- 'class' => '',
244
- 'display_input' => false,
245
- 'options' => array(
246
- 'ajax-pagination-mode' => array(
247
- 'label' => esc_html__( 'Ajax pagination', 'cherry-projects' ),
248
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/loading-mode-ajax-pagination.svg',
249
- ),
250
- 'more-button-mode' => array(
251
- 'label' => esc_html__( 'More button', 'cherry-projects' ),
252
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/loading-mode-ajax-more-button.svg',
253
- ),
254
- 'lazy-loading-mode' => array(
255
- 'label' => esc_html__( 'Lazy loading', 'cherry-projects' ),
256
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/loading-mode-lazy-loading.svg',
257
- ),
258
- 'none-mode' => array(
259
- 'label' => esc_html__( 'None', 'cherry-projects' ),
260
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/loading-mode-none.svg',
261
- ),
262
- ),
263
- ),
264
-
265
- 'load_animation' => array(
266
- 'type' => 'radio',
267
- 'title' => esc_html__( 'Loading animation', 'cherry-projects' ),
268
- 'description' => esc_html__( 'Choose posts loading animation', 'cherry-projects' ),
269
- 'value' => 'loading-animation-move-up',
270
- 'class' => '',
271
- 'display_input' => false,
272
- 'options' => array(
273
- 'loading-animation-fade' => array(
274
- 'label' => esc_html__( 'Fade animation', 'cherry-projects' ),
275
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-fade.svg',
276
- ),
277
- 'loading-animation-scale' => array(
278
- 'label' => esc_html__( 'Scale animation', 'cherry-projects' ),
279
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-scale.svg',
280
- ),
281
- 'loading-animation-move-up' => array(
282
- 'label' => esc_html__( 'Move Up animation', 'cherry-projects' ),
283
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-move-up.svg',
284
- ),
285
- 'loading-animation-flip' => array(
286
- 'label' => esc_html__( 'Flip animation', 'cherry-projects' ),
287
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-flip.svg',
288
- ),
289
- 'loading-animation-helix' => array(
290
- 'label' => esc_html__( 'Helix animation', 'cherry-projects' ),
291
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-helix.svg',
292
- ),
293
- 'loading-animation-fall-perspective' => array(
294
- 'label' => esc_html__( 'Fall perspective animation', 'cherry-projects' ),
295
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-fall-perspective.svg',
296
- ),
297
- ),
298
- ),
299
-
300
- 'hover_animation' => array(
301
- 'type' => 'radio',
302
- 'title' => esc_html__( 'Hover animation', 'cherry-projects' ),
303
- 'description' => esc_html__( 'Choose posts images hover animation', 'cherry-projects' ),
304
- 'value' => 'simple-scale',
305
- 'class' => '',
306
- 'display_input' => false,
307
- 'options' => array(
308
- 'simple-fade' => array(
309
- 'label' => esc_html__( 'Fade', 'cherry-projects' ),
310
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/hover-fade.svg',
311
- ),
312
- 'simple-scale' => array(
313
- 'label' => esc_html__( 'Scale', 'cherry-projects' ),
314
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/hover-scale.svg',
315
- ),
316
- 'custom' => array(
317
- 'label' => esc_html__( 'Custom', 'cherry-projects' ),
318
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/inherit.svg',
319
- ),
320
- ),
321
- ),
322
-
323
- 'filter_visible' => array(
324
- 'type' => 'switcher',
325
- 'title' => esc_html__( 'Filters', 'cherry-projects' ),
326
- 'description' => esc_html__( 'Enable/disable listing filters', 'cherry-projects' ),
327
- 'value' => 'true',
328
- 'toggle' => array(
329
- 'true_toggle' => esc_html__( 'Show', 'cherry-projects' ),
330
- 'false_toggle' => esc_html__( 'Hide', 'cherry-projects' ),
331
- ),
332
- ),
333
-
334
- 'filter_type' => array(
335
- 'type' => 'radio',
336
- 'title' => esc_html__( 'Filter type', 'cherry-projects' ),
337
- 'description' => esc_html__( 'Select if you want to filter posts by tag or by category.', 'cherry-projects' ),
338
- 'value' => 'category',
339
- 'display-input' => true,
340
- 'options' => array(
341
- 'category' => array(
342
- 'label' => esc_html__( 'Category', 'cherry-projects' ),
343
- 'slave' => 'projects-filter-type-category',
344
- ),
345
- 'tag' => array(
346
- 'label' => esc_html__( 'Tag', 'cherry-projects' ),
347
- 'slave' => 'projects-filter-type-tag',
348
- ),
349
- ),
350
- ),
351
-
352
- 'category_list' => array(
353
- 'type' => 'select',
354
- 'title' => esc_html__( 'Projects filter categories list', 'cherry-projects' ),
355
- 'multiple' => true,
356
- 'value' => array(),
357
- 'class' => 'cherry-multi-select',
358
- 'options' => $category_list,
359
- 'master' => 'projects-filter-type-category',
360
- ),
361
-
362
- 'tags_list' => array(
363
- 'type' => 'select',
364
- 'title' => esc_html__( 'Projects filter tags list', 'cherry-projects' ),
365
- 'multiple' => true,
366
- 'value' => array(),
367
- 'class' => 'cherry-multi-select',
368
- 'options' => $tag_list,
369
- 'master' => 'projects-filter-type-tag',
370
- ),
371
-
372
- 'order_filter_visible' => array(
373
- 'type' => 'switcher',
374
- 'title' => esc_html__( 'Order filters', 'cherry-projects' ),
375
- 'description' => esc_html__( 'Enable/disable order filters', 'cherry-projects' ),
376
- 'value' => 'false',
377
- 'toggle' => array(
378
- 'true_toggle' => 'On',
379
- 'false_toggle' => 'Off',
380
- 'true_slave' => 'projects-order-filter-visible-true',
381
- 'false_slave' => 'projects-order-filter-visible-false',
382
- ),
383
- ),
384
-
385
- 'order_filter_default_value' => array(
386
- 'type' => 'radio',
387
- 'title' => esc_html__( 'Order filter default value', 'cherry-projects' ),
388
- 'value' => 'desc',
389
- 'display-input' => true,
390
- 'options' => array(
391
- 'desc' => array(
392
- 'label' => esc_html__( 'DESC', 'cherry-projects' ),
393
- ),
394
- 'asc' => array(
395
- 'label' => esc_html__( 'ASC', 'cherry-projects' ),
396
- ),
397
- ),
398
- 'master' => 'projects-order-filter-visible-true',
399
- ),
400
-
401
- 'orderby_filter_default_value' => array(
402
- 'type' => 'radio',
403
- 'title' => esc_html__( 'Order by filter default value', 'cherry-projects' ),
404
- 'value' => 'date',
405
- 'display-input' => true,
406
- 'options' => array(
407
- 'date' => array(
408
- 'label' => esc_html__( 'Date', 'cherry-projects' ),
409
- ),
410
- 'name' => array(
411
- 'label' => esc_html__( 'Name', 'cherry-projects' ),
412
- ),
413
- 'modified' => array(
414
- 'label' => esc_html__( 'Modified', 'cherry-projects' ),
415
- ),
416
- 'comment_count' => array(
417
- 'label' => esc_html__( 'Comments', 'cherry-projects' ),
418
- ),
419
- ),
420
- 'master' => 'projects-order-filter-visible-true',
421
- ),
422
-
423
- 'posts_format' => array(
424
- 'type' => 'radio',
425
- 'title' => esc_html__( 'Post Format', 'cherry-projects' ),
426
- 'value' => 'post-format-all',
427
- 'display-input' => true,
428
- 'options' => array(
429
- 'post-format-all' => array(
430
- 'label' => esc_html__( 'All formats', 'cherry-projects' ),
431
- ),
432
- 'post-format-standard' => array(
433
- 'label' => esc_html__( 'Standard', 'cherry-projects' ),
434
- ),
435
- 'post-format-image' => array(
436
- 'label' => esc_html__( 'Image', 'cherry-projects' ),
437
- ),
438
- 'post-format-gallery' => array(
439
- 'label' => esc_html__( 'Gallery', 'cherry-projects' ),
440
- ),
441
- 'post-format-audio' => array(
442
- 'label' => esc_html__( 'Audio', 'cherry-projects' ),
443
- ),
444
- 'post-format-video' => array(
445
- 'label' => esc_html__( 'Video', 'cherry-projects' ),
446
- ),
447
- ),
448
- ),
449
-
450
- 'single_term' => array(
451
- 'type' => 'text',
452
- 'title' => esc_html__( 'Single term slug', 'cherry-projects' ),
453
- 'value' => '',
454
- ),
455
-
456
- 'device_layout_column_number' => array(
457
- 'type' => 'component-tab-horizontal',
458
- ),
459
-
460
- 'column_number_desktop_layout' => array(
461
- 'type' => 'settings',
462
- 'parent' => 'device_layout_column_number',
463
- 'title' => esc_html__( 'Desktop', 'cherry-projects' ),
464
- 'description' => esc_html__( 'Define column number for desktop layout', 'cherry-projects' ),
465
- ),
466
-
467
- 'column_number_laptop_layout' => array(
468
- 'type' => 'settings',
469
- 'parent' => 'device_layout_column_number',
470
- 'title' => esc_html__( 'Laptop', 'cherry-projects' ),
471
- 'description' => esc_html__( 'Define column number for laptop layout', 'cherry-projects' ),
472
- ),
473
-
474
- 'column_number_album_tablet_layout' => array(
475
- 'type' => 'settings',
476
- 'parent' => 'device_layout_column_number',
477
- 'title' => esc_html__( 'Album Tablet', 'cherry-projects' ),
478
- 'description' => esc_html__( 'Define column number for tablet layout', 'cherry-projects' ),
479
- ),
480
-
481
- 'column_number_portrait_tablet_layout' => array(
482
- 'type' => 'settings',
483
- 'parent' => 'device_layout_column_number',
484
- 'title' => esc_html__( 'Portrait Tablet', 'cherry-projects' ),
485
- 'description' => esc_html__( 'Define column number for tablet layout', 'cherry-projects' ),
486
- ),
487
-
488
- 'column_number_mobile_layout' => array(
489
- 'type' => 'settings',
490
- 'parent' => 'device_layout_column_number',
491
- 'title' => esc_html__( 'Mobile', 'cherry-projects' ),
492
- 'description' => esc_html__( 'Define column number for mobile layout', 'cherry-projects' ),
493
- ),
494
-
495
- 'column_number' => array(
496
- 'type' => 'slider',
497
- 'parent' => 'column_number_desktop_layout',
498
- 'title' => esc_html__( 'Column number', 'cherry-projects' ),
499
- 'description' => esc_html__( 'Select number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
500
- 'max_value' => 6,
501
- 'min_value' => 1,
502
- 'value' => 4,
503
- ),
504
-
505
- 'column_number_laptop' => array(
506
- 'type' => 'slider',
507
- 'parent' => 'column_number_laptop_layout',
508
- 'title' => esc_html__( 'Labtop column number', 'cherry-projects' ),
509
- 'description' => esc_html__( 'Select laptop number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
510
- 'max_value' => 6,
511
- 'min_value' => 1,
512
- 'value' => 3,
513
- ),
514
-
515
- 'column_number_album_tablet' => array(
516
- 'type' => 'slider',
517
- 'parent' => 'column_number_album_tablet_layout',
518
- 'title' => esc_html__( 'Album Tablet column number', 'cherry-projects' ),
519
- 'description' => esc_html__( 'Select album tablet number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
520
- 'max_value' => 6,
521
- 'min_value' => 1,
522
- 'value' => 2,
523
- ),
524
-
525
- 'column_number_portrait_tablet' => array(
526
- 'type' => 'slider',
527
- 'parent' => 'column_number_portrait_tablet_layout',
528
- 'title' => esc_html__( 'Portrait Tablet column number', 'cherry-projects' ),
529
- 'description' => esc_html__( 'Select portrait tablet number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
530
- 'max_value' => 6,
531
- 'min_value' => 1,
532
- 'value' => 2,
533
- ),
534
-
535
- 'column_number_mobile' => array(
536
- 'type' => 'slider',
537
- 'parent' => 'column_number_mobile_layout',
538
- 'title' => esc_html__( 'Tablet column number', 'cherry-projects' ),
539
- 'description' => esc_html__( 'Select mobile number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
540
- 'max_value' => 6,
541
- 'min_value' => 1,
542
- 'value' => 1,
543
- ),
544
-
545
- 'post_per_page' => array(
546
- 'type' => 'slider',
547
- 'title' => esc_html__( 'Posts per page', 'cherry-projects' ),
548
- 'description' => esc_html__( 'Select how many posts per page do you want to display(-1 means that will show all projects)', 'cherry-projects' ),
549
- 'max_value' => 50,
550
- 'min_value' => -1,
551
- 'value' => 9,
552
- ),
553
-
554
- 'item_margin' => array(
555
- 'type' => 'slider',
556
- 'title' => esc_html__( 'Item margin', 'cherry-projects' ),
557
- 'description' => esc_html__( 'Select projects item margin (outer indent) value.', 'cherry-projects' ),
558
- 'max_value' => 50,
559
- 'min_value' => 0,
560
- 'value' => 4,
561
- ),
562
-
563
- 'justified_fixed_height' => array(
564
- 'type' => 'slider',
565
- 'title' => esc_html__( 'Justified fixed height', 'cherry-projects' ),
566
- 'description' => esc_html__( 'Select projects item justified height value.', 'cherry-projects' ),
567
- 'max_value' => 1000,
568
- 'min_value' => 50,
569
- 'value' => 300,
570
- 'master' => 'projects-listing-layout-justified-layout',
571
- ),
572
-
573
- 'grid_template' => array(
574
- 'type' => 'text',
575
- 'title' => esc_html__( 'Grid template', 'cherry-projects' ),
576
- 'description' => esc_html__( 'Grid content template', 'cherry-projects' ),
577
- 'value' => 'grid-default.tmpl',
578
- 'master' => 'projects-listing-layout-grid-layout',
579
- ),
580
-
581
- 'masonry_template' => array(
582
- 'type' => 'text',
583
- 'title' => esc_html__( 'Masonry template', 'cherry-projects' ),
584
- 'description' => esc_html__( 'Masonry content template', 'cherry-projects' ),
585
- 'value' => 'masonry-default.tmpl',
586
- 'master' => 'projects-listing-layout-masonry-layout',
587
- ),
588
-
589
- 'justified_template' => array(
590
- 'type' => 'text',
591
- 'title' => esc_html__( 'Justified template', 'cherry-projects' ),
592
- 'description' => esc_html__( 'Justified content template', 'cherry-projects' ),
593
- 'value' => 'justified-default.tmpl',
594
- 'master' => 'projects-listing-layout-justified-layout',
595
- ),
596
-
597
- 'cascading_grid_template' => array(
598
- 'type' => 'text',
599
- 'title' => esc_html__( 'Cascading grid template', 'cherry-projects' ),
600
- 'description' => esc_html__( 'Cascading grid template', 'cherry-projects' ),
601
- 'value' => 'cascading-grid-default.tmpl',
602
- 'master' => 'projects-listing-layout-cascading-grid-layout',
603
- ),
604
-
605
- 'list_template' => array(
606
- 'type' => 'text',
607
- 'title' => esc_html__( 'List template', 'cherry-projects' ),
608
- 'description' => esc_html__( 'List content template', 'cherry-projects' ),
609
- 'value' => 'list-default.tmpl',
610
- 'master' => 'projects-listing-layout-list-layout',
611
- ),
612
- ),
613
- ),
614
- array(
615
- 'title' => esc_html__( 'Projects Terms', 'cherry-projects' ),
616
- 'description' => esc_html__( 'The shortcode displays Category and Tag sections content listing with set parameters.', 'cherry-projects' ),
617
- 'icon' => '<span class="dashicons dashicons-category"></span>',
618
- 'slug' => 'cherry_projects_terms',
619
- 'options' => array(
620
-
621
- 'term_type' => array(
622
- 'type' => 'radio',
623
- 'title' => esc_html__( 'Filter type', 'cherry-projects' ),
624
- 'description' => esc_html__( 'Select if you want to filter posts by tag or by category.', 'cherry-projects' ),
625
- 'value' => 'category',
626
- 'display-input' => true,
627
- 'options' => array(
628
- 'category' => array(
629
- 'label' => esc_html__( 'Category', 'cherry-projects' ),
630
- ),
631
- 'tag' => array(
632
- 'label' => esc_html__( 'Tag', 'cherry-projects' ),
633
- ),
634
- ),
635
- ),
636
-
637
- 'listing_layout' => array(
638
- 'type' => 'radio',
639
- 'title' => esc_html__( 'Terms listing layout', 'cherry-projects' ),
640
- 'description' => esc_html__( 'Choose terms listing view layout.', 'cherry-projects' ),
641
- 'value' => 'grid-layout',
642
- 'display_input' => false,
643
- 'options' => array(
644
- 'grid-layout' => array(
645
- 'label' => esc_html__( 'Grid', 'cherry-projects' ),
646
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-grid.svg',
647
- 'slave' => 'projects-listing-layout-grid-layout',
648
- ),
649
- 'masonry-layout' => array(
650
- 'label' => esc_html__( 'Masonry', 'cherry-projects' ),
651
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-masonry.svg',
652
- 'slave' => 'projects-listing-layout-masonry-layout',
653
- ),
654
- 'cascading-grid-layout' => array(
655
- 'label' => esc_html__( 'Cascading grid', 'cherry-projects' ),
656
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-cascading-grid.svg',
657
- 'slave' => 'projects-listing-layout-cascading-grid-layout',
658
- ),
659
- 'list-layout' => array(
660
- 'label' => esc_html__( 'List', 'cherry-projects' ),
661
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-listing.svg',
662
- 'slave' => 'projects-listing-layout-list-layout',
663
- ),
664
- ),
665
- ),
666
-
667
- 'load_animation' => array(
668
- 'type' => 'radio',
669
- 'title' => esc_html__( 'Loading animation', 'cherry-projects' ),
670
- 'description' => esc_html__( 'Choose terms loading animation', 'cherry-projects' ),
671
- 'value' => 'loading-animation-move-up',
672
- 'class' => '',
673
- 'display_input' => false,
674
- 'options' => array(
675
- 'loading-animation-fade' => array(
676
- 'label' => esc_html__( 'Fade animation', 'cherry-projects' ),
677
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-fade.svg',
678
- ),
679
- 'loading-animation-scale' => array(
680
- 'label' => esc_html__( 'Scale animation', 'cherry-projects' ),
681
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-scale.svg',
682
- ),
683
- 'loading-animation-move-up' => array(
684
- 'label' => esc_html__( 'Move Up animation', 'cherry-projects' ),
685
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-move-up.svg',
686
- ),
687
- 'loading-animation-flip' => array(
688
- 'label' => esc_html__( 'Flip animation', 'cherry-projects' ),
689
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-flip.svg',
690
- ),
691
- 'loading-animation-helix' => array(
692
- 'label' => esc_html__( 'Helix animation', 'cherry-projects' ),
693
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-helix.svg',
694
- ),
695
- 'loading-animation-fall-perspective' => array(
696
- 'label' => esc_html__( 'Fall perspective animation', 'cherry-projects' ),
697
- 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-fall-perspective.svg',
698
- ),
699
- ),
700
- ),
701
-
702
- 'device_layout_column_number' => array(
703
- 'type' => 'component-tab-horizontal',
704
- ),
705
-
706
- 'column_number_desktop_layout' => array(
707
- 'type' => 'settings',
708
- 'parent' => 'device_layout_column_number',
709
- 'title' => esc_html__( 'Desktop', 'cherry-projects' ),
710
- 'description' => esc_html__( 'Define column number for desktop layout', 'cherry-projects' ),
711
- ),
712
-
713
- 'column_number_laptop_layout' => array(
714
- 'type' => 'settings',
715
- 'parent' => 'device_layout_column_number',
716
- 'title' => esc_html__( 'Laptop', 'cherry-projects' ),
717
- 'description' => esc_html__( 'Define column number for laptop layout', 'cherry-projects' ),
718
- ),
719
-
720
- 'column_number_album_tablet_layout' => array(
721
- 'type' => 'settings',
722
- 'parent' => 'device_layout_column_number',
723
- 'title' => esc_html__( 'Album Tablet', 'cherry-projects' ),
724
- 'description' => esc_html__( 'Define column number for tablet layout', 'cherry-projects' ),
725
- ),
726
-
727
- 'column_number_portrait_tablet_layout' => array(
728
- 'type' => 'settings',
729
- 'parent' => 'device_layout_column_number',
730
- 'title' => esc_html__( 'Portrait Tablet', 'cherry-projects' ),
731
- 'description' => esc_html__( 'Define column number for tablet layout', 'cherry-projects' ),
732
- ),
733
-
734
- 'column_number_mobile_layout' => array(
735
- 'type' => 'settings',
736
- 'parent' => 'device_layout_column_number',
737
- 'title' => esc_html__( 'Mobile', 'cherry-projects' ),
738
- 'description' => esc_html__( 'Define column number for mobile layout', 'cherry-projects' ),
739
- ),
740
-
741
- 'column_number' => array(
742
- 'type' => 'slider',
743
- 'parent' => 'column_number_desktop_layout',
744
- 'title' => esc_html__( 'Column number', 'cherry-projects' ),
745
- 'description' => esc_html__( 'Select number of columns for masonry and grid projects layouts. (Min 2, max 6)', 'cherry-projects' ),
746
- 'max_value' => 6,
747
- 'min_value' => 1,
748
- 'value' => 3,
749
- ),
750
-
751
- 'column_number_laptop' => array(
752
- 'type' => 'slider',
753
- 'parent' => 'column_number_laptop_layout',
754
- 'title' => esc_html__( 'Labtop column number', 'cherry-projects' ),
755
- 'description' => esc_html__( 'Select laptop number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
756
- 'max_value' => 6,
757
- 'min_value' => 1,
758
- 'value' => 3,
759
- ),
760
-
761
- 'column_number_album_tablet' => array(
762
- 'type' => 'slider',
763
- 'parent' => 'column_number_album_tablet_layout',
764
- 'title' => esc_html__( 'Album Tablet column number', 'cherry-projects' ),
765
- 'description' => esc_html__( 'Select album tablet number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
766
- 'max_value' => 6,
767
- 'min_value' => 1,
768
- 'value' => 2,
769
- ),
770
-
771
- 'column_number_portrait_tablet' => array(
772
- 'type' => 'slider',
773
- 'parent' => 'column_number_portrait_tablet_layout',
774
- 'title' => esc_html__( 'Portrait Tablet column number', 'cherry-projects' ),
775
- 'description' => esc_html__( 'Select portrait tablet number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
776
- 'max_value' => 6,
777
- 'min_value' => 1,
778
- 'value' => 2,
779
- ),
780
-
781
- 'column_number_mobile' => array(
782
- 'type' => 'slider',
783
- 'parent' => 'column_number_mobile_layout',
784
- 'title' => esc_html__( 'Tablet column number', 'cherry-projects' ),
785
- 'description' => esc_html__( 'Select mobile number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
786
- 'max_value' => 6,
787
- 'min_value' => 1,
788
- 'value' => 1,
789
- ),
790
-
791
- 'post_per_page' => array(
792
- 'type' => 'slider',
793
- 'title' => esc_html__( 'Posts per page', 'cherry-projects' ),
794
- 'description' => esc_html__( 'Select how many posts per page do you want to display(-1 means that will show all projects)', 'cherry-projects' ),
795
- 'max_value' => 50,
796
- 'min_value' => -1,
797
- 'value' => 6,
798
- ),
799
-
800
- 'item_margin' => array(
801
- 'type' => 'slider',
802
- 'title' => esc_html__( 'Item margin', 'cherry-projects' ),
803
- 'description' => esc_html__( 'Select projects item margin (outer indent) value.', 'cherry-projects' ),
804
- 'max_value' => 50,
805
- 'min_value' => 0,
806
- 'value' => 4,
807
- ),
808
-
809
- 'grid_template' => array(
810
- 'type' => 'text',
811
- 'title' => esc_html__( 'Grid template', 'cherry-projects' ),
812
- 'description' => esc_html__( 'Grid content template', 'cherry-projects' ),
813
- 'value' => 'terms-grid-default.tmpl',
814
- ),
815
-
816
- 'masonry_template' => array(
817
- 'type' => 'text',
818
- 'title' => esc_html__( 'Masonry template', 'cherry-projects' ),
819
- 'description' => esc_html__( 'Masonry content template', 'cherry-projects' ),
820
- 'value' => 'terms-masonry-default.tmpl',
821
- ),
822
-
823
- 'cascading_grid_template' => array(
824
- 'type' => 'text',
825
- 'title' => esc_html__( 'Cascading grid template', 'cherry-projects' ),
826
- 'description' => esc_html__( 'Cascading grid template', 'cherry-projects' ),
827
- 'value' => 'terms-cascading-grid-default.tmpl',
828
- ),
829
-
830
- 'list_template' => array(
831
- 'type' => 'text',
832
- 'title' => esc_html__( 'List template', 'cherry-projects' ),
833
- 'description' => esc_html__( 'List content template', 'cherry-projects' ),
834
- 'value' => 'terms-list-default.tmpl',
835
- ),
836
- ),
837
- ),
838
- ),
839
- )
840
- );
841
- }
842
-
843
  /**
844
  * Returns the instance.
845
  *
36
 
37
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
38
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );
 
 
 
39
  }
40
 
41
  /**
170
  }
171
  }
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  /**
174
  * Returns the instance.
175
  *
admin/includes/class-projects-options-page.php CHANGED
@@ -81,6 +81,7 @@ class Cherry_Projects_Options_Page {
81
  * @since 1.0.0
82
  */
83
  public function init() {
 
84
  $this->utility = cherry_projects()->get_core()->modules['cherry-utility']->utility;
85
  $this->builder = cherry_projects()->get_core()->modules['cherry-interface-builder'];
86
  }
81
  * @since 1.0.0
82
  */
83
  public function init() {
84
+ cherry_projects()->get_core()->init_module( 'cherry5-insert-shortcode', array() );
85
  $this->utility = cherry_projects()->get_core()->modules['cherry-utility']->utility;
86
  $this->builder = cherry_projects()->get_core()->modules['cherry-interface-builder'];
87
  }
cherry-framework/cherry-core.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Class Cherry Core
4
- * Version: 1.4.2
5
  *
6
  * @package Cherry_Framework
7
  * @subpackage Class
@@ -59,25 +59,29 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
59
  * Constructor.
60
  *
61
  * @since 1.0.0
62
- * @since 1.1.1 Using dirname( __FILE__ ) instead of __DIR__.
63
  */
64
  public function __construct( $settings = array() ) {
65
- $base_dir = trailingslashit( dirname( __FILE__ ) );
66
- $base_url = trailingslashit( $this->base_url( '', __FILE__ ) );
67
 
68
  $defaults = array(
69
  'framework_path' => 'cherry-framework',
70
  'modules' => array(),
71
- 'base_dir' => $base_dir,
72
- 'base_url' => $base_url,
73
- 'extra_base_dir' => '',
74
  );
75
 
76
  $this->settings = array_merge( $defaults, $settings );
77
 
78
- $this->settings['extra_base_dir'] = trailingslashit( $this->settings['base_dir'] );
79
- $this->settings['base_dir'] = $base_dir;
80
- $this->settings['base_url'] = $base_url;
 
 
 
 
 
 
 
81
 
82
  $this->run_collector();
83
 
@@ -118,26 +122,10 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
118
  }
119
 
120
  foreach ( $this->settings['modules'] as $module => $settings ) {
121
- $priority = $this->get_module_priority( $module );
122
- $path = $this->get_module_path( $module );
123
 
124
  if ( ! array_key_exists( $module, self::$all_modules ) ) {
125
- self::$all_modules[ $module ] = array( $priority => $path );
126
- } else {
127
-
128
- $old_priority = array_keys( self::$all_modules[ $module ] );
129
-
130
- if ( ! is_array( $old_priority ) || ! isset( $old_priority[0] ) ) {
131
- continue;
132
- }
133
-
134
- $compare = version_compare( $old_priority[0], $priority, '<' );
135
-
136
- if ( $compare ) {
137
- continue;
138
- }
139
-
140
- self::$all_modules[ $module ] = array( $priority => $path );
141
  }
142
  }
143
 
@@ -156,10 +144,8 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
156
  * @since 1.1.0
157
  */
158
  public static function load_all_modules() {
 
159
 
160
- foreach ( self::$all_modules as $module => $data ) {
161
-
162
- $path = current( $data );
163
  $loaded = self::load_module( $module, $path );
164
 
165
  if ( ! $loaded ) {
@@ -174,7 +160,7 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
174
  * @since 1.4.0
175
  */
176
  public function load_textdomain() {
177
- $mo_file_path = dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo';
178
 
179
  load_textdomain( 'cherry-framework', $mo_file_path );
180
  }
@@ -209,7 +195,6 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
209
  * @since 1.1.0
210
  */
211
  public function init_autoload_modules() {
212
-
213
  if ( empty( $this->modules ) ) {
214
  return;
215
  }
@@ -225,6 +210,7 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
225
  }
226
 
227
  $args = ! empty( $settings['args'] ) ? $settings['args'] : array();
 
228
  $this->init_module( $module, $args );
229
  }
230
  }
@@ -238,6 +224,12 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
238
  * @return mixed
239
  */
240
  public function init_module( $module, $args = array() ) {
 
 
 
 
 
 
241
  $this->modules[ $module ] = $this->get_module_instance( $module, $args );
242
 
243
  /**
@@ -275,14 +267,14 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
275
  public static function load_module( $module, $path ) {
276
  $class_name = self::get_class_name( $module );
277
 
278
- if ( class_exists( $class_name ) ) {
279
- return true;
280
- }
281
-
282
  if ( ! $path ) {
283
  return false;
284
  }
285
 
 
 
 
 
286
  require_once( $path );
287
 
288
  return true;
@@ -304,7 +296,9 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
304
  return false;
305
  }
306
 
307
- return $this->modules[ $module ] = call_user_func( array( $class_name, 'get_instance' ), $this, $args );
 
 
308
  }
309
 
310
  /**
@@ -330,11 +324,9 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
330
  */
331
  public function get_module_path( $module ) {
332
  $abs_path = false;
333
- $rel_path = 'modules/' . $module . '/' . $module . '.php';
334
 
335
- if ( file_exists( $this->settings['extra_base_dir'] . $rel_path ) ) {
336
- $abs_path = $this->settings['extra_base_dir'] . $rel_path;
337
- } else if ( file_exists( $this->settings['base_dir'] . $rel_path ) ) {
338
  $abs_path = $this->settings['base_dir'] . $rel_path;
339
  }
340
 
@@ -342,60 +334,21 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
342
  }
343
 
344
  /**
345
- * Get module priority from it's version.
346
- * Version information should be provided as a value stored in the header notation.
347
  *
348
- * @link https://developer.wordpress.org/reference/functions/get_file_data/
349
- * @since 1.0.0
350
- * @param string $module Module slug or path.
351
- * @param bool $is_path Set this as true, if `$module` contains a path.
352
- * @return int
353
  */
354
- public function get_module_priority( $module, $is_path = false ) {
355
-
356
- // Default phpDoc headers.
357
- $default_headers = array(
358
- 'version' => 'Version',
359
- );
360
-
361
- // Maximum version number (major, minor, patch).
362
- $max_version = array(
363
- 99,
364
- 99,
365
- 999,
366
- );
367
-
368
- // If `$module` is a slug, get module path.
369
- if ( ! $is_path ) {
370
- $module = $this->get_module_path( $module );
371
- }
372
-
373
- $version = '1.0.0';
374
-
375
- /* @TODO: Add smart check */
376
- if ( ! $module ) {
377
- return $version;
378
- }
379
-
380
- $data = get_file_data( $module , $default_headers );
381
-
382
- // Check if version string has a valid value.
383
- if ( isset( $data['version'] ) && false !== strpos( $data['version'], '.' ) ) {
384
-
385
- // Clean the version string.
386
- preg_match( '/[\d\.]+/', $data['version'], $version );
387
- $version = $version[0];
388
- }
389
-
390
- // Convert version into integer.
391
- $parts = explode( '.', $version );
392
 
393
- // Calculate priority.
394
- foreach ( $parts as $index => $part ) {
395
- $parts[ $index ] = $max_version[ $index ] - (int) $part;
396
  }
397
 
398
- return (int) join( '', $parts );
399
  }
400
 
401
  /**
@@ -410,15 +363,24 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
410
  */
411
  public static function base_url( $file_path = '', $module_path ) {
412
  $module_path = wp_normalize_path( $module_path );
413
- $module_dir = dirname( $module_path );
 
 
 
 
 
 
 
414
 
415
  $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
416
  $stylesheet = get_stylesheet();
417
  $theme_root = get_raw_theme_root( $stylesheet );
418
  $theme_dir = "$theme_root/$stylesheet";
419
 
420
- if ( 0 === strpos( $module_path, $plugin_dir ) ) {
421
- $url = plugin_dir_url( $module_path );
 
 
422
  } else if ( false !== strpos( $module_path, $theme_dir ) ) {
423
  $explode = explode( $theme_dir, $module_dir );
424
  $url = get_stylesheet_directory_uri() . end( $explode );
@@ -446,7 +408,7 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
446
  */
447
  public function pass_core_to_widgets( $core, $path ) {
448
  $path = str_replace( '\\', '/', $path );
449
- $current_core = str_replace( '\\', '/', $this->settings['extra_base_dir'] );
450
 
451
  if ( false !== strpos( $path, $current_core ) ) {
452
  return self::get_instance();
@@ -455,11 +417,22 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
455
  return $core;
456
  }
457
 
 
 
 
 
 
 
 
 
 
 
 
 
458
  /**
459
  * Get path to the core directory.
460
  *
461
  * @since 1.0.0
462
- * @deprecated 1.1.0 Use constant `dirname( __FILE__ )`
463
  * @return string
464
  */
465
  public function get_core_dir() {
1
  <?php
2
  /**
3
  * Class Cherry Core
4
+ * Version: 1.5.0
5
  *
6
  * @package Cherry_Framework
7
  * @subpackage Class
59
  * Constructor.
60
  *
61
  * @since 1.0.0
 
62
  */
63
  public function __construct( $settings = array() ) {
64
+ global $chery_core_version;
 
65
 
66
  $defaults = array(
67
  'framework_path' => 'cherry-framework',
68
  'modules' => array(),
69
+ 'base_dir' => '',
70
+ 'base_url' => '',
 
71
  );
72
 
73
  $this->settings = array_merge( $defaults, $settings );
74
 
75
+ if ( isset( $chery_core_version ) && 0 < sizeof( $chery_core_version ) ) {
76
+ $core_paths = array_values( $chery_core_version );
77
+ $path_parts = pathinfo( $core_paths[0] );
78
+ $this->settings['base_dir'] = trailingslashit( $path_parts['dirname'] );
79
+ } else {
80
+ // This condition and the using of the function dirname is due to core backwards compatibility with old framework versions
81
+ $this->settings['base_dir'] = trailingslashit( dirname( __FILE__ ) );
82
+ }
83
+
84
+ $this->settings['base_url'] = trailingslashit( $this->base_url( '', $this->settings['base_dir'] ) );
85
 
86
  $this->run_collector();
87
 
122
  }
123
 
124
  foreach ( $this->settings['modules'] as $module => $settings ) {
125
+ $file_path = $this->get_module_file( $module );
 
126
 
127
  if ( ! array_key_exists( $module, self::$all_modules ) ) {
128
+ self::$all_modules[ $module ] = $file_path;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  }
130
  }
131
 
144
  * @since 1.1.0
145
  */
146
  public static function load_all_modules() {
147
+ foreach ( self::$all_modules as $module => $path ) {
148
 
 
 
 
149
  $loaded = self::load_module( $module, $path );
150
 
151
  if ( ! $loaded ) {
160
  * @since 1.4.0
161
  */
162
  public function load_textdomain() {
163
+ $mo_file_path = $this->settings['base_dir'] . 'languages/' . get_locale() . '.mo';
164
 
165
  load_textdomain( 'cherry-framework', $mo_file_path );
166
  }
195
  * @since 1.1.0
196
  */
197
  public function init_autoload_modules() {
 
198
  if ( empty( $this->modules ) ) {
199
  return;
200
  }
210
  }
211
 
212
  $args = ! empty( $settings['args'] ) ? $settings['args'] : array();
213
+
214
  $this->init_module( $module, $args );
215
  }
216
  }
224
  * @return mixed
225
  */
226
  public function init_module( $module, $args = array() ) {
227
+
228
+ if ( empty( $args[ 'module_path' ] ) ) {
229
+ $get_module_path = $this->get_module_path( $module );
230
+ $args['module_path'] = ( $get_module_path ) ? $get_module_path : '';
231
+ }
232
+
233
  $this->modules[ $module ] = $this->get_module_instance( $module, $args );
234
 
235
  /**
267
  public static function load_module( $module, $path ) {
268
  $class_name = self::get_class_name( $module );
269
 
 
 
 
 
270
  if ( ! $path ) {
271
  return false;
272
  }
273
 
274
+ if ( class_exists( $class_name ) ) {
275
+ return true;
276
+ }
277
+
278
  require_once( $path );
279
 
280
  return true;
296
  return false;
297
  }
298
 
299
+ $this->modules[ $module ] = call_user_func( array( $class_name, 'get_instance' ), $this, $args );
300
+
301
+ return $this->modules[ $module ];
302
  }
303
 
304
  /**
324
  */
325
  public function get_module_path( $module ) {
326
  $abs_path = false;
327
+ $rel_path = 'modules/' . $module . '/';
328
 
329
+ if ( file_exists( $this->settings['base_dir'] . $rel_path ) ) {
 
 
330
  $abs_path = $this->settings['base_dir'] . $rel_path;
331
  }
332
 
334
  }
335
 
336
  /**
337
+ * Get path to main file for passed module.
 
338
  *
339
+ * @since 1.0.1
340
+ * @param string $module Module slug.
341
+ * @return string
 
 
342
  */
343
+ public function get_module_file( $module ) {
344
+ $abs_path = false;
345
+ $rel_path = 'modules/' . $module . '/' . $module . '.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
 
347
+ if ( file_exists( $this->settings['base_dir'] . $rel_path ) ) {
348
+ $abs_path = $this->settings['base_dir'] . $rel_path;
 
349
  }
350
 
351
+ return $abs_path;
352
  }
353
 
354
  /**
363
  */
364
  public static function base_url( $file_path = '', $module_path ) {
365
  $module_path = wp_normalize_path( $module_path );
366
+ preg_match( '/\..*$/', $module_path, $ext );
367
+
368
+ if ( empty( $ext ) ) {
369
+ $module_dir = $module_path;
370
+ } else {
371
+ // This condition and the using of the function dirname is due to core backwards compatibility with old framework versions
372
+ $module_dir = dirname( $module_path );
373
+ }
374
 
375
  $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
376
  $stylesheet = get_stylesheet();
377
  $theme_root = get_raw_theme_root( $stylesheet );
378
  $theme_dir = "$theme_root/$stylesheet";
379
 
380
+ if ( 0 === strpos( $module_dir, $plugin_dir ) ) {
381
+ $home_url = home_url();
382
+ $abs_path = wp_normalize_path( ABSPATH );
383
+ $url = str_replace( untrailingslashit( $abs_path ), $home_url, $module_dir );
384
  } else if ( false !== strpos( $module_path, $theme_dir ) ) {
385
  $explode = explode( $theme_dir, $module_dir );
386
  $url = get_stylesheet_directory_uri() . end( $explode );
408
  */
409
  public function pass_core_to_widgets( $core, $path ) {
410
  $path = str_replace( '\\', '/', $path );
411
+ $current_core = str_replace( '\\', '/', $this->settings['base_dir'] );
412
 
413
  if ( false !== strpos( $path, $current_core ) ) {
414
  return self::get_instance();
417
  return $core;
418
  }
419
 
420
+ /**
421
+ * Get core version.
422
+ *
423
+ * @since 1.5.0
424
+ * @return string
425
+ */
426
+ public function get_core_version() {
427
+ global $chery_core_version;
428
+
429
+ return key( $chery_core_version );
430
+ }
431
+
432
  /**
433
  * Get path to the core directory.
434
  *
435
  * @since 1.0.0
 
436
  * @return string
437
  */
438
  public function get_core_dir() {
cherry-framework/config.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name" : "Cherry Framework",
3
- "version" : "1.4.2",
4
  "description" : "",
5
  "doc_link" : "https://github.com/CherryFramework/cherry-framework-docs",
6
  "git_link" : "https://github.com/CherryFramework/cherry-framework",
@@ -115,17 +115,6 @@
115
  "required" : false,
116
  "dependencies" : [ "cherry-interface-builder" ]
117
  },
118
- "cherry-template-manager" : {
119
- "name" : "Template Manager",
120
- "description" : "Module for load and parse *.tmpl files.",
121
- "version" : "1.0.2",
122
- "doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/05.%20cherry-template-manager.md",
123
- "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-template-manager",
124
- "compatible" : ["theme", "plugin"],
125
- "wordpress_org" : true,
126
- "required" : false,
127
- "dependencies" : []
128
- },
129
  "cherry-term-meta" : {
130
  "name" : "Term Meta",
131
  "description" : "Manage term metadata.",
@@ -151,7 +140,7 @@
151
  "cherry-ui-elements" : {
152
  "name" : "UI Elements",
153
  "description" : "UI Elements",
154
- "version" : "1.4.1",
155
  "doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/09.%20cherry-ui-elements.md",
156
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-ui-elements",
157
  "compatible" : ["theme", "plugin"],
@@ -162,7 +151,7 @@
162
  "cherry-utility" : {
163
  "name" : "Utility",
164
  "description" : "Multiple utility functions.",
165
- "version" : "1.1.6",
166
  "doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/08.%20cherry-utility.md",
167
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-utility",
168
  "compatible" : ["theme", "plugin"],
@@ -181,10 +170,21 @@
181
  "required" : false,
182
  "dependencies" : [ "cherry-ui-elements" ]
183
  },
 
 
 
 
 
 
 
 
 
 
 
184
  "cherry5-insert-shortcode" : {
185
  "name" : "Insert Shortcode",
186
  "description" : "The module allows you to add shortcodes from editor tinyMCE.",
187
- "version" : "1.0.1",
188
  "doc_link" : "",
189
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry5-insert-shortcode",
190
  "compatible" : [ "plugin" ],
1
  {
2
  "name" : "Cherry Framework",
3
+ "version" : "1.4.3.1",
4
  "description" : "",
5
  "doc_link" : "https://github.com/CherryFramework/cherry-framework-docs",
6
  "git_link" : "https://github.com/CherryFramework/cherry-framework",
115
  "required" : false,
116
  "dependencies" : [ "cherry-interface-builder" ]
117
  },
 
 
 
 
 
 
 
 
 
 
 
118
  "cherry-term-meta" : {
119
  "name" : "Term Meta",
120
  "description" : "Manage term metadata.",
140
  "cherry-ui-elements" : {
141
  "name" : "UI Elements",
142
  "description" : "UI Elements",
143
+ "version" : "1.4.3",
144
  "doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/09.%20cherry-ui-elements.md",
145
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-ui-elements",
146
  "compatible" : ["theme", "plugin"],
151
  "cherry-utility" : {
152
  "name" : "Utility",
153
  "description" : "Multiple utility functions.",
154
+ "version" : "1.1.7",
155
  "doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/08.%20cherry-utility.md",
156
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-utility",
157
  "compatible" : ["theme", "plugin"],
170
  "required" : false,
171
  "dependencies" : [ "cherry-ui-elements" ]
172
  },
173
+ "cherry5-assets-loader" : {
174
+ "name" : "Assets Loader",
175
+ "description" : "The module allows you deferred loading scripts and styles.",
176
+ "version" : "1.0.0",
177
+ "doc_link" : "",
178
+ "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry5-assets-loader",
179
+ "compatible" : [ "theme", "plugin" ],
180
+ "wordpress_org" : true,
181
+ "required" : false,
182
+ "dependencies" : [ "cherry-js-core" ]
183
+ },
184
  "cherry5-insert-shortcode" : {
185
  "name" : "Insert Shortcode",
186
  "description" : "The module allows you to add shortcodes from editor tinyMCE.",
187
+ "version" : "1.0.2",
188
  "doc_link" : "",
189
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry5-insert-shortcode",
190
  "compatible" : [ "plugin" ],
cherry-framework/modules/cherry-breadcrumbs/cherry-breadcrumbs.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Breadcrumb Trail
4
  * Description: A breadcrumb menu script for WordPress
5
- * Version: 1.1.3
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -334,23 +333,10 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
334
  * @since 1.0.0
335
  */
336
  public function default_labels() {
337
- $page_on_front_id = get_option( 'page_on_front' );
338
- $use_custom_front_title = 'true';
339
- $use_custom_front_title = ( 'true' == $use_custom_front_title ) ? true : false;
340
-
341
- if ( $page_on_front_id ) {
342
- $page_on_front_title = get_the_title( $page_on_front_id );
343
- }
344
-
345
- if ( $use_custom_front_title ) {
346
- $default = esc_html__( 'Home', 'cherry-framework' );
347
- $page_on_front_title = $default;
348
- $page_on_front_title = $this->prepare_label( $page_on_front_title, $default );
349
- }
350
 
351
  $labels = array(
352
  'browse' => esc_html__( 'Browse:', 'cherry-framework' ),
353
- 'home' => $page_on_front_title,
354
  'error_404' => esc_html__( '404 Not Found', 'cherry-framework' ),
355
  'archives' => esc_html__( 'Archives', 'cherry-framework' ),
356
  'search' => esc_html__( 'Search results for &#8220;%s&#8221;', 'cherry-framework' ),
@@ -369,6 +355,33 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
369
  return $labels;
370
  }
371
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
  /**
373
  * Build breadcrumbs trail items array.
374
  *
@@ -455,12 +468,16 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
455
  $this->add_paged_items();
456
 
457
  /**
458
- * Filter final item array
459
  *
460
  * @since 1.0.0
461
- * @var array
 
 
 
 
462
  */
463
- $this->items = apply_filters( 'cherry_breadcrumbs_items', $this->items, $this->args );
464
 
465
  }
466
 
@@ -468,13 +485,14 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
468
  * Add trail item int array.
469
  *
470
  * @since 1.0.0
 
471
  *
472
  * @param string $format Item format to add.
473
  * @param string $label Item label.
474
  * @param string $url Item URL.
475
  * @param string $class Item CSS class.
476
  */
477
- public function _add_item( $format = 'link_format', $label, $url = '', $class = '' ) {
478
 
479
  $title = esc_attr( wp_strip_all_tags( $label ) );
480
  $css = ( 'target_format' == $format ) ? 'target' : 'link';
@@ -485,9 +503,14 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
485
  $class = $this->css[ $css ];
486
  }
487
 
488
- $item = sprintf( $this->args[ $format ], $label, $class, $title, $url );
 
489
 
490
- $this->items[] = sprintf( $this->args['item_format'], $item, esc_attr( $this->css['item'] ) );
 
 
 
 
491
 
492
  if ( 'target_format' == $format ) {
493
  $this->page_title = $label;
@@ -725,8 +748,10 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
725
  /* Display terms for specific post type taxonomy if requested. */
726
  $this->add_post_terms( $post_id );
727
 
 
 
728
  /* End with the post title. */
729
- if ( $post_title = single_post_title( '', false ) ) {
730
 
731
  if ( 1 < get_query_var( 'page' ) ) {
732
 
@@ -1118,7 +1143,10 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
1118
  'link_format',
1119
  $week,
1120
  add_query_arg(
1121
- array( 'm' => get_the_time( 'Y' ), 'w' => get_the_time( 'W' ) ),
 
 
 
1122
  esc_url( home_url( '/' ) )
1123
  )
1124
  );
@@ -1227,10 +1255,9 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
1227
  if ( is_paged() ) {
1228
  $url = get_search_link();
1229
  $this->_add_item( 'link_format', $label, $url );
1230
-
 
1231
  }
1232
-
1233
- $this->_add_item( 'target_format', $label );
1234
  }
1235
 
1236
  /**
2
  /**
3
  * Module Name: Breadcrumb Trail
4
  * Description: A breadcrumb menu script for WordPress
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
333
  * @since 1.0.0
334
  */
335
  public function default_labels() {
 
 
 
 
 
 
 
 
 
 
 
 
 
336
 
337
  $labels = array(
338
  'browse' => esc_html__( 'Browse:', 'cherry-framework' ),
339
+ 'home' => $this->home_title(),
340
  'error_404' => esc_html__( '404 Not Found', 'cherry-framework' ),
341
  'archives' => esc_html__( 'Archives', 'cherry-framework' ),
342
  'search' => esc_html__( 'Search results for &#8220;%s&#8221;', 'cherry-framework' ),
355
  return $labels;
356
  }
357
 
358
+ /**
359
+ * Returns home title
360
+ *
361
+ * @return string
362
+ */
363
+ public function home_title() {
364
+
365
+ $title = esc_html__( 'Home', 'cherry-framework' );
366
+ $use_custom_title = apply_filters( 'cherry_breadcrumbs_custom_home_title', true );
367
+
368
+ if ( $use_custom_title ) {
369
+
370
+ $page_on_front_id = get_option( 'page_on_front' );
371
+ $page_title = false;
372
+
373
+ if ( $page_on_front_id ) {
374
+ $page_title = get_the_title( $page_on_front_id );
375
+ }
376
+
377
+ if ( ! empty( $page_title ) ) {
378
+ $title = $page_title;
379
+ }
380
+ }
381
+
382
+ return $this->prepare_label( $title );
383
+ }
384
+
385
  /**
386
  * Build breadcrumbs trail items array.
387
  *
468
  $this->add_paged_items();
469
 
470
  /**
471
+ * Filter final items array
472
  *
473
  * @since 1.0.0
474
+ * @since 1.1.5 Added 3rd parameter $this.
475
+ *
476
+ * @param array $this->items Current items array.
477
+ * @param array $this->args Current instance arguments array.
478
+ * @param array $this Current instance.
479
  */
480
+ $this->items = apply_filters( 'cherry_breadcrumbs_items', $this->items, $this->args, $this );
481
 
482
  }
483
 
485
  * Add trail item int array.
486
  *
487
  * @since 1.0.0
488
+ * @since 1.1.5 $prepend parameter.
489
  *
490
  * @param string $format Item format to add.
491
  * @param string $label Item label.
492
  * @param string $url Item URL.
493
  * @param string $class Item CSS class.
494
  */
495
+ public function _add_item( $format = 'link_format', $label, $url = '', $class = '', $prepend = false ) {
496
 
497
  $title = esc_attr( wp_strip_all_tags( $label ) );
498
  $css = ( 'target_format' == $format ) ? 'target' : 'link';
503
  $class = $this->css[ $css ];
504
  }
505
 
506
+ $item = sprintf( $this->args[ $format ], $label, $class, $title, $url );
507
+ $result = sprintf( $this->args['item_format'], $item, esc_attr( $this->css['item'] ) );
508
 
509
+ if ( true === $prepend ) {
510
+ array_unshift( $this->items, $result );
511
+ } else {
512
+ $this->items[] = $result;
513
+ }
514
 
515
  if ( 'target_format' == $format ) {
516
  $this->page_title = $label;
748
  /* Display terms for specific post type taxonomy if requested. */
749
  $this->add_post_terms( $post_id );
750
 
751
+ $post_title = single_post_title( '', false );
752
+
753
  /* End with the post title. */
754
+ if ( $post_title ) {
755
 
756
  if ( 1 < get_query_var( 'page' ) ) {
757
 
1143
  'link_format',
1144
  $week,
1145
  add_query_arg(
1146
+ array(
1147
+ 'm' => get_the_time( 'Y' ),
1148
+ 'w' => get_the_time( 'W' ),
1149
+ ),
1150
  esc_url( home_url( '/' ) )
1151
  )
1152
  );
1255
  if ( is_paged() ) {
1256
  $url = get_search_link();
1257
  $this->_add_item( 'link_format', $label, $url );
1258
+ } else {
1259
+ $this->_add_item( 'target_format', $label );
1260
  }
 
 
1261
  }
1262
 
1263
  /**
cherry-framework/modules/cherry-customizer/cherry-customizer.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Customizer
4
  * Description: Customizer functionality.
5
- * Version: 1.1.7
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,7 +9,6 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.1.7
14
  * @author Cherry Team <cherryframework@gmail.com>
15
  * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
@@ -32,15 +30,6 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
32
  */
33
  class Cherry_Customizer {
34
 
35
- /**
36
- * The version of this module.
37
- *
38
- * @since 1.0.0
39
- * @access protected
40
- * @var string
41
- */
42
- protected $version;
43
-
44
  /**
45
  * Unique prefix.
46
  * This is a theme or plugin slug.
@@ -105,6 +94,15 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
105
  */
106
  protected $fonts;
107
 
 
 
 
 
 
 
 
 
 
108
  /**
109
  * Module initialization.
110
  *
@@ -157,7 +155,6 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
157
  * Cherry customizer class construct.
158
  */
159
  public function __construct( $core, $args ) {
160
-
161
  /**
162
  * Cherry Customizer only works in WordPress 4.0 or later.
163
  */
@@ -171,14 +168,13 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
171
  return;
172
  }
173
 
174
- $this->prefix = $this->prepare_prefix( $args['prefix'] );
175
- $this->capability = ! empty( $args['capability'] ) ? $args['capability'] : 'edit_theme_options';
176
- $this->type = ! empty( $args['type'] ) && $this->sanitize_type( $args['type'] )
177
- ? $args['type'] : 'theme_mod';
178
- $this->options = $args['options'];
179
- $this->core = $core;
180
- $this->fonts = array();
181
- $this->version = '1.1.5';
182
 
183
  add_action( 'customize_register', array( $this, 'register' ) );
184
 
@@ -210,12 +206,11 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
210
  * Include advanced customizer controls classes
211
  *
212
  * @since 1.1.0
213
- * @since 1.1.4 Using dirname( __FILE__ ) instead of __DIR__.
214
  */
215
  private function include_custom_controls() {
216
 
217
  if ( ! class_exists( 'Cherry_WP_Customize_Iconpicker' ) ) {
218
- require_once( trailingslashit( dirname( __FILE__ ) ) . '/inc/class-cherry-wp-customize-iconpicker.php' );
219
  }
220
 
221
  }
@@ -324,6 +319,7 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
324
  * Add a customize control.
325
  *
326
  * @since 1.0.0
 
327
  * @param numder $id Settings ID.
328
  * @param array $args Control arguments.
329
  */
@@ -374,28 +370,43 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
374
  case 'url':
375
  case 'password':
376
  case 'checkbox':
377
- $control_args = wp_parse_args( array( 'type' => $field_type ), $control_args );
 
 
 
378
  break;
379
 
380
  case 'range':
381
  case 'number':
382
  $input_attrs = ( isset( $args['input_attrs'] ) ) ? $args['input_attrs'] : array();
383
- $control_args = wp_parse_args( array( 'type' => $field_type, 'input_attrs' => $input_attrs ), $control_args );
 
 
 
384
  break;
385
 
386
  case 'select':
387
  $choices = ( isset( $args['choices'] ) ) ? $args['choices'] : array();
388
- $control_args = wp_parse_args( array( 'type' => 'select', 'choices' => $choices ), $control_args );
 
 
 
389
  break;
390
 
391
  case 'fonts':
392
  $choices = ( isset( $args['choices'] ) ) ? $args['choices'] : $this->get_fonts();
393
- $control_args = wp_parse_args( array( 'type' => 'select', 'choices' => $choices ), $control_args );
 
 
 
394
  break;
395
 
396
  case 'radio':
397
  $choices = ( isset( $args['choices'] ) ) ? $args['choices'] : array();
398
- $control_args = wp_parse_args( array( 'type' => 'radio', 'choices' => $choices ), $control_args );
 
 
 
399
  break;
400
 
401
  case 'hex_color':
@@ -516,16 +527,6 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
516
  $this->customize = $customize;
517
  }
518
 
519
- /**
520
- * Retrieve the version number.
521
- *
522
- * @since 1.0.0
523
- * @return string The version number of the module.
524
- */
525
- public function get_version() {
526
- return $this->version;
527
- }
528
-
529
  /**
530
  * Retrieve a option value by ID.
531
  *
@@ -924,8 +925,8 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
924
  * @param object $this Cherry_Customiser instance.
925
  */
926
  return apply_filters( 'cherry_customizer_get_fonts_data', array(
927
- 'standard' => dirname( __FILE__ ) . '/assets/fonts/standard.json',
928
- 'google' => dirname( __FILE__ ) . '/assets/fonts/google.json',
929
  ), $this );
930
  }
931
 
2
  /**
3
  * Module Name: Customizer
4
  * Description: Customizer functionality.
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
  * @copyright Copyright (c) 2012 - 2016, Cherry Team
14
  * @link http://www.cherryframework.com/
30
  */
31
  class Cherry_Customizer {
32
 
 
 
 
 
 
 
 
 
 
33
  /**
34
  * Unique prefix.
35
  * This is a theme or plugin slug.
94
  */
95
  protected $fonts;
96
 
97
+ /**
98
+ * Module directory path.
99
+ *
100
+ * @since 1.5.0
101
+ * @access protected
102
+ * @var srting.
103
+ */
104
+ protected $module_path;
105
+
106
  /**
107
  * Module initialization.
108
  *
155
  * Cherry customizer class construct.
156
  */
157
  public function __construct( $core, $args ) {
 
158
  /**
159
  * Cherry Customizer only works in WordPress 4.0 or later.
160
  */
168
  return;
169
  }
170
 
171
+ $this->prefix = $this->prepare_prefix( $args['prefix'] );
172
+ $this->capability = ! empty( $args['capability'] ) ? $args['capability'] : 'edit_theme_options';
173
+ $this->type = ! empty( $args['type'] ) && $this->sanitize_type( $args['type'] ) ? $args['type'] : 'theme_mod';
174
+ $this->options = $args['options'];
175
+ $this->core = $core;
176
+ $this->fonts = array();
177
+ $this->module_path = $args['module_path'];
 
178
 
179
  add_action( 'customize_register', array( $this, 'register' ) );
180
 
206
  * Include advanced customizer controls classes
207
  *
208
  * @since 1.1.0
 
209
  */
210
  private function include_custom_controls() {
211
 
212
  if ( ! class_exists( 'Cherry_WP_Customize_Iconpicker' ) ) {
213
+ require_once( $this->module_path . 'inc/class-cherry-wp-customize-iconpicker.php' );
214
  }
215
 
216
  }
319
  * Add a customize control.
320
  *
321
  * @since 1.0.0
322
+ * @since 1.1.8 Added a `dropdown-pages` support.
323
  * @param numder $id Settings ID.
324
  * @param array $args Control arguments.
325
  */
370
  case 'url':
371
  case 'password':
372
  case 'checkbox':
373
+ case 'dropdown-pages':
374
+ $control_args = wp_parse_args( array(
375
+ 'type' => $field_type,
376
+ ), $control_args );
377
  break;
378
 
379
  case 'range':
380
  case 'number':
381
  $input_attrs = ( isset( $args['input_attrs'] ) ) ? $args['input_attrs'] : array();
382
+ $control_args = wp_parse_args( array(
383
+ 'type' => $field_type,
384
+ 'input_attrs' => $input_attrs,
385
+ ), $control_args );
386
  break;
387
 
388
  case 'select':
389
  $choices = ( isset( $args['choices'] ) ) ? $args['choices'] : array();
390
+ $control_args = wp_parse_args( array(
391
+ 'type' => 'select',
392
+ 'choices' => $choices,
393
+ ), $control_args );
394
  break;
395
 
396
  case 'fonts':
397
  $choices = ( isset( $args['choices'] ) ) ? $args['choices'] : $this->get_fonts();
398
+ $control_args = wp_parse_args( array(
399
+ 'type' => 'select',
400
+ 'choices' => $choices,
401
+ ), $control_args );
402
  break;
403
 
404
  case 'radio':
405
  $choices = ( isset( $args['choices'] ) ) ? $args['choices'] : array();
406
+ $control_args = wp_parse_args( array(
407
+ 'type' => 'radio',
408
+ 'choices' => $choices,
409
+ ), $control_args );
410
  break;
411
 
412
  case 'hex_color':
527
  $this->customize = $customize;
528
  }
529
 
 
 
 
 
 
 
 
 
 
 
530
  /**
531
  * Retrieve a option value by ID.
532
  *
925
  * @param object $this Cherry_Customiser instance.
926
  */
927
  return apply_filters( 'cherry_customizer_get_fonts_data', array(
928
+ 'standard' => $this->module_path . 'assets/fonts/standard.json',
929
+ 'google' => $this->module_path . 'assets/fonts/google.json',
930
  ), $this );
931
  }
932
 
cherry-framework/modules/cherry-customizer/inc/class-cherry-wp-customize-iconpicker.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Framework
6
  * @subpackage Modules/Customizer
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
@@ -26,7 +26,7 @@ if ( class_exists( 'WP_Customize_Control' ) ) {
26
  public $icon_data = array();
27
 
28
  /**
29
- * Trigger to try automatically pase icons from CSS file or not.
30
  *
31
  * @var boolean
32
  */
@@ -70,7 +70,9 @@ if ( class_exists( 'WP_Customize_Control' ) ) {
70
  $core = apply_filters( 'cherry_customizer_get_core', false );
71
  $ui_builder = $core->init_module(
72
  'cherry-ui-elements',
73
- array( 'ui_elements' => array( 'iconpicker' ) )
 
 
74
  );
75
 
76
  $args = array(
5
  * @package Cherry_Framework
6
  * @subpackage Modules/Customizer
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
26
  public $icon_data = array();
27
 
28
  /**
29
+ * Trigger to try automatically parse icons from CSS file or not.
30
  *
31
  * @var boolean
32
  */
70
  $core = apply_filters( 'cherry_customizer_get_core', false );
71
  $ui_builder = $core->init_module(
72
  'cherry-ui-elements',
73
+ array(
74
+ 'ui_elements' => array( 'iconpicker' ),
75
+ )
76
  );
77
 
78
  $args = array(
cherry-framework/modules/cherry-db-updater/cherry-db-updater.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Database Updater
4
  * Description: Handle database updates if required.
5
- * Version: 1.0.0
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Db_Updater
12
  * @subpackage Modules
13
- * @version 1.0.0
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
2
  /**
3
  * Module Name: Database Updater
4
  * Description: Handle database updates if required.
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Db_Updater
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
cherry-framework/modules/cherry-dynamic-css/cherry-dynamic-css.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Dynamic CSS
4
  * Description: CSS parser which uses variables & functions for CSS code optimization
5
- * Version: 1.4.0
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,7 +9,6 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.4.0
14
  * @author Cherry Team <cherryframework@gmail.com>
15
  * @copyright Copyright (c) 2012 - 2017, Cherry Team
16
  * @link http://www.cherryframework.com/
@@ -515,7 +513,7 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
515
  /**
516
  * Filter user function arguments
517
  *
518
- * @since 4.0.0
519
  */
520
  function prepare_args( $item ) {
521
 
2
  /**
3
  * Module Name: Dynamic CSS
4
  * Description: CSS parser which uses variables & functions for CSS code optimization
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
  * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
513
  /**
514
  * Filter user function arguments
515
  *
516
+ * @since 1.0.0
517
  */
518
  function prepare_args( $item ) {
519
 
cherry-framework/modules/cherry-dynamic-css/inc/class-cherry-dynamic-css-collector.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package Cherry_Framework
6
  * @author Cherry Team <cherryframework@gmail.com>
7
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
8
  * @link http://www.cherryframework.com/
9
  * @license http://www.gnu.org/licenses/gpl-3.0.html
10
  */
4
  *
5
  * @package Cherry_Framework
6
  * @author Cherry Team <cherryframework@gmail.com>
7
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
8
  * @link http://www.cherryframework.com/
9
  * @license http://www.gnu.org/licenses/gpl-3.0.html
10
  */
cherry-framework/modules/cherry-dynamic-css/inc/class-cherry-dynamic-css-utilities.php CHANGED
@@ -193,7 +193,7 @@ if ( ! class_exists( 'Cherry_Dynamic_Css_Utilities' ) ) {
193
  $is_rgb = ( false !== strpos( $color, 'rgb' ) && false === $is_rgba ) ? true : false;
194
  $is_hex = ( false === $is_rgba && false === $is_rgb ) ? true : false;
195
 
196
- $percent = round( ( double ) $percent / 100, 4 );
197
 
198
  if ( $is_hex && '#' == $color[0] ) {
199
  $color = substr( $color, 1 );
@@ -499,7 +499,7 @@ if ( ! class_exists( 'Cherry_Dynamic_Css_Utilities' ) ) {
499
  /**
500
  * Prepare font family for passing into typography function.
501
  *
502
- * @since 4.0.5
503
  * @param [string] $item Array item.
504
  * @param [int] $index Array item index.
505
  * @return void
@@ -723,10 +723,10 @@ if ( ! class_exists( 'Cherry_Dynamic_Css_Utilities' ) ) {
723
 
724
  switch ( $operation ) {
725
  case 'multiple' :
726
- $size = ( double ) $size * ( double ) $percent;
727
  break;
728
  case 'addition' :
729
- $size = ( double ) $size + ( double ) $percent;
730
  break;
731
  }
732
 
193
  $is_rgb = ( false !== strpos( $color, 'rgb' ) && false === $is_rgba ) ? true : false;
194
  $is_hex = ( false === $is_rgba && false === $is_rgb ) ? true : false;
195
 
196
+ $percent = round( (double) $percent / 100, 4 );
197
 
198
  if ( $is_hex && '#' == $color[0] ) {
199
  $color = substr( $color, 1 );
499
  /**
500
  * Prepare font family for passing into typography function.
501
  *
502
+ * @since 1.0.0
503
  * @param [string] $item Array item.
504
  * @param [int] $index Array item index.
505
  * @return void
723
 
724
  switch ( $operation ) {
725
  case 'multiple' :
726
+ $size = (double) $size * (double) $percent;
727
  break;
728
  case 'addition' :
729
+ $size = (double) $size + (double) $percent;
730
  break;
731
  }
732
 
cherry-framework/modules/cherry-google-fonts-loader/cherry-google-fonts-loader.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Google Fonts Loader
4
  * Description: Enqueue Google fonts
5
- * Version: 1.1.0
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.1.0
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
@@ -30,14 +28,7 @@ if ( ! class_exists( 'Cherry_Google_Fonts_Loader' ) ) {
30
  class Cherry_Google_Fonts_Loader {
31
 
32
  /**
33
- * Module version
34
- *
35
- * @var string
36
- */
37
- public $module_version = '1.1.0';
38
-
39
- /**
40
- * Module version
41
  *
42
  * @var string
43
  */
@@ -84,7 +75,9 @@ if ( ! class_exists( 'Cherry_Google_Fonts_Loader' ) ) {
84
  function __construct( $core, $args ) {
85
 
86
  $this->core = $core;
87
- $this->args = wp_parse_args( $args, array( 'options' => array() ) );
 
 
88
 
89
  $this->fonts_host = apply_filters( 'cherry_google_fonts_cdn', $this->fonts_host );
90
 
2
  /**
3
  * Module Name: Google Fonts Loader
4
  * Description: Enqueue Google fonts
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
28
  class Cherry_Google_Fonts_Loader {
29
 
30
  /**
31
+ * Module slug.
 
 
 
 
 
 
 
32
  *
33
  * @var string
34
  */
75
  function __construct( $core, $args ) {
76
 
77
  $this->core = $core;
78
+ $this->args = wp_parse_args( $args, array(
79
+ 'options' => array(),
80
+ ) );
81
 
82
  $this->fonts_host = apply_filters( 'cherry_google_fonts_cdn', $this->fonts_host );
83
 
cherry-framework/modules/cherry-handler/cherry-handler.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Cherry handler
4
  * Description: Initializes handlers
5
- * Version: 1.1.3
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.1.3
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
@@ -31,6 +29,24 @@ if ( ! class_exists( 'Cherry_Handler' ) ) {
31
  */
32
  class Cherry_Handler {
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  /**
35
  * Default settings.
36
  *
@@ -38,20 +54,14 @@ if ( ! class_exists( 'Cherry_Handler' ) ) {
38
  * @var array
39
  */
40
  private $settings = array(
41
- 'id' => '',
42
- 'action' => '',
43
- 'capability' => '',
44
- 'is_public' => false,
45
- 'callback' => '',
46
- 'type' => 'POST',
47
- 'data_type' => 'json',
48
- 'sys_messages' => array(
49
- 'invalid_base_data' => 'Unable to process the request without nonce or server error',
50
- 'no_right' => 'No right for this action',
51
- 'invalid_nonce' => 'Stop CHEATING!!!',
52
- 'access_is_allowed' => 'Access is allowed',
53
- 'wait_processing' => 'Please wait, processing the previous request',
54
- ),
55
  );
56
 
57
  /**
@@ -62,7 +72,16 @@ if ( ! class_exists( 'Cherry_Handler' ) ) {
62
  * @param array $args Class args.
63
  */
64
  public function __construct( $core, $args = array() ) {
65
- $this->settings = array_merge( $this->settings, $args );
 
 
 
 
 
 
 
 
 
66
 
67
  if ( empty( $this->settings['id'] ) ) {
68
  echo '<h3>ID is required attr</h3>';
@@ -74,11 +93,13 @@ if ( ! class_exists( 'Cherry_Handler' ) ) {
74
  return false;
75
  }
76
 
77
- add_action( 'wp_ajax_' . $this->settings['action'], array( $this, 'handler_init' ) );
 
78
 
79
- // Public action check
80
- if ( filter_var( $this->settings['is_public'], FILTER_VALIDATE_BOOLEAN ) ) {
81
- add_action( 'wp_ajax_nopriv_' . $this->settings['action'], array( $this, 'handler_init' ) );
 
82
  }
83
 
84
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
@@ -155,17 +176,17 @@ if ( ! class_exists( 'Cherry_Handler' ) ) {
155
  public function enqueue_scripts() {
156
  wp_enqueue_script(
157
  'cherry-handler-js',
158
- esc_url( Cherry_Core::base_url( 'assets/js/min/cherry-handler.min.js', __FILE__ ) ),
159
  array( 'jquery' ),
160
- '1.1.3',
161
  true
162
  );
163
 
164
  wp_enqueue_style(
165
  'cherry-handler-css',
166
- esc_url( Cherry_Core::base_url( 'assets/css/cherry-handler-styles.min.css', __FILE__ ) ),
167
  array(),
168
- '1.1.3',
169
  'all'
170
  );
171
  }
@@ -192,8 +213,9 @@ if ( ! class_exists( 'Cherry_Handler' ) ) {
192
  );
193
 
194
  if ( $this->settings['is_public'] ) {
195
- $ajax_url = esc_url( admin_url( 'admin-ajax.php' ) );
196
- wp_localize_script( 'cherry-handler-js', 'cherryHandlerAjaxUrl', array( 'ajax_url' => $ajax_url ) );
 
197
  }
198
  }
199
 
2
  /**
3
  * Module Name: Cherry handler
4
  * Description: Initializes handlers
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
29
  */
30
  class Cherry_Handler {
31
 
32
+ /**
33
+ * Core version.
34
+ *
35
+ * @since 1.5.0
36
+ * @access public
37
+ * @var string
38
+ */
39
+ public $core_version = '';
40
+
41
+ /**
42
+ * Module directory path.
43
+ *
44
+ * @since 1.5.0
45
+ * @access protected
46
+ * @var srting.
47
+ */
48
+ protected $module_path;
49
+
50
  /**
51
  * Default settings.
52
  *
54
  * @var array
55
  */
56
  private $settings = array(
57
+ 'id' => '',
58
+ 'action' => '',
59
+ 'capability' => '',
60
+ 'is_public' => false,
61
+ 'callback' => '',
62
+ 'type' => 'POST',
63
+ 'data_type' => 'json',
64
+ 'sys_messages' => array(),
 
 
 
 
 
 
65
  );
66
 
67
  /**
72
  * @param array $args Class args.
73
  */
74
  public function __construct( $core, $args = array() ) {
75
+ $this->settings['sys_messages'] = array(
76
+ 'invalid_base_data' => esc_html__( 'Unable to process the request without nonce or server error', 'cherry-framework' ),
77
+ 'no_right' => esc_html__( 'No right for this action', 'cherry-framework' ),
78
+ 'invalid_nonce' => esc_html__( 'Stop CHEATING!!!', 'cherry-framework' ),
79
+ 'access_is_allowed' => esc_html__( 'Access is allowed', 'cherry-framework' ),
80
+ 'wait_processing' => esc_html__( 'Please wait, processing the previous request', 'cherry-framework' ),
81
+ );
82
+ $this->settings = array_merge( $this->settings, $args );
83
+ $this->core_version = $core->get_core_version();
84
+ $this->module_path = $args['module_path'];
85
 
86
  if ( empty( $this->settings['id'] ) ) {
87
  echo '<h3>ID is required attr</h3>';
93
  return false;
94
  }
95
 
96
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
97
+ add_action( 'wp_ajax_' . $this->settings['action'], array( $this, 'handler_init' ) );
98
 
99
+ // Public action check.
100
+ if ( filter_var( $this->settings['is_public'], FILTER_VALIDATE_BOOLEAN ) ) {
101
+ add_action( 'wp_ajax_nopriv_' . $this->settings['action'], array( $this, 'handler_init' ) );
102
+ }
103
  }
104
 
105
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
176
  public function enqueue_scripts() {
177
  wp_enqueue_script(
178
  'cherry-handler-js',
179
+ esc_url( Cherry_Core::base_url( 'assets/js/min/cherry-handler.min.js', $this->module_path ) ),
180
  array( 'jquery' ),
181
+ $this->core_version,
182
  true
183
  );
184
 
185
  wp_enqueue_style(
186
  'cherry-handler-css',
187
+ esc_url( Cherry_Core::base_url( 'assets/css/cherry-handler-styles.min.css', $this->module_path ) ),
188
  array(),
189
+ $this->core_version,
190
  'all'
191
  );
192
  }
213
  );
214
 
215
  if ( $this->settings['is_public'] ) {
216
+ wp_localize_script( 'cherry-handler-js', 'cherryHandlerAjaxUrl', array(
217
+ 'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ),
218
+ ) );
219
  }
220
  }
221
 
cherry-framework/modules/cherry-interface-builder/cherry-interface-builder.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Interface Builder
4
  * Description: The module for the creation of interfaces in the WordPress admin panel
5
- * Version: 1.1.2
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.1.2
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
@@ -30,6 +28,25 @@ if ( ! class_exists( 'Cherry_Interface_Builder' ) ) {
30
  * @since 1.0.0
31
  */
32
  class Cherry_Interface_Builder {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  /**
34
  * Module settings.
35
  *
@@ -106,7 +123,9 @@ if ( ! class_exists( 'Cherry_Interface_Builder' ) ) {
106
  $this->args
107
  );
108
 
109
- $this->ui_elements = $core->init_module( 'cherry-ui-elements' );
 
 
110
 
111
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
112
  }
@@ -277,7 +296,7 @@ if ( ! class_exists( 'Cherry_Interface_Builder' ) ) {
277
  $path = ( array_key_exists( $type, $this->args['views'] ) ) ? $this->args['views'][ $type ] : $this->args['views']['control'];
278
 
279
  $path = is_array( $path ) ? $path[0] : $path;
280
- $path = file_exists( $path ) ? $path : trailingslashit( dirname( __FILE__ ) ) . $path;
281
 
282
  } else {
283
  $path = $args['view'];
@@ -442,16 +461,16 @@ if ( ! class_exists( 'Cherry_Interface_Builder' ) ) {
442
  public function enqueue_assets() {
443
  wp_enqueue_script(
444
  'cherry-interface-builder',
445
- esc_url( Cherry_Core::base_url( 'inc/assets/min/cherry-interface-builder.min.js', __FILE__ ) ),
446
  array( 'jquery' ),
447
- '1.0.0',
448
  true
449
  );
450
  wp_enqueue_style(
451
  'cherry-interface-builder',
452
- esc_url( Cherry_Core::base_url( 'inc/assets/min/cherry-interface-builder.min.css', __FILE__ ) ),
453
  array(),
454
- '1.0.0',
455
  'all'
456
  );
457
  }
2
  /**
3
  * Module Name: Interface Builder
4
  * Description: The module for the creation of interfaces in the WordPress admin panel
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
28
  * @since 1.0.0
29
  */
30
  class Cherry_Interface_Builder {
31
+
32
+ /**
33
+ * Core version.
34
+ *
35
+ * @since 1.5.0
36
+ * @access public
37
+ * @var string
38
+ */
39
+ public $core_version = '';
40
+
41
+ /**
42
+ * Module directory path.
43
+ *
44
+ * @since 1.5.0
45
+ * @access protected
46
+ * @var srting.
47
+ */
48
+ protected $module_path;
49
+
50
  /**
51
  * Module settings.
52
  *
123
  $this->args
124
  );
125
 
126
+ $this->core_version = $core->get_core_version();
127
+ $this->module_path = $args['module_path'];
128
+ $this->ui_elements = $core->init_module( 'cherry-ui-elements' );
129
 
130
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
131
  }
296
  $path = ( array_key_exists( $type, $this->args['views'] ) ) ? $this->args['views'][ $type ] : $this->args['views']['control'];
297
 
298
  $path = is_array( $path ) ? $path[0] : $path;
299
+ $path = file_exists( $path ) ? $path : $this->module_path . $path;
300
 
301
  } else {
302
  $path = $args['view'];
461
  public function enqueue_assets() {
462
  wp_enqueue_script(
463
  'cherry-interface-builder',
464
+ esc_url( Cherry_Core::base_url( 'inc/assets/min/cherry-interface-builder.min.js', $this->module_path ) ),
465
  array( 'jquery' ),
466
+ $this->core_version,
467
  true
468
  );
469
  wp_enqueue_style(
470
  'cherry-interface-builder',
471
+ esc_url( Cherry_Core::base_url( 'inc/assets/min/cherry-interface-builder.min.css', $this->module_path ) ),
472
  array(),
473
+ $this->core_version,
474
  'all'
475
  );
476
  }
cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.scss CHANGED
@@ -1,4 +1,5 @@
1
  $color-1: #fff; // Background color.
 
2
  $color-2: #efefef; // Background color.
3
  $color-3: #96989a; // Description color and tabs button text color.
4
  $color-4: #b4b7ba; //
@@ -202,6 +203,10 @@ html{
202
  background: none;
203
  cursor: pointer;
204
  position: relative;
 
 
 
 
205
  .cherry-toggle__title {
206
  font-weight: 700;
207
  font-size: 14px;
@@ -221,6 +226,9 @@ html{
221
  height: 9px;
222
  text-align: left;
223
  overflow: hidden;
 
 
 
224
  &.hide-icon{
225
  &:before{
226
  position: relative;
@@ -236,8 +244,6 @@ html{
236
  top: -7px;
237
  left: -9px;
238
  }
239
- //position: relative;
240
- //left: 14px;
241
  transform:scaleX(0);
242
  transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
243
  }
@@ -266,6 +272,12 @@ html{
266
  box-shadow:$shadow;
267
  border-radius: $br-radius;
268
  border: $border;
 
 
 
 
 
 
269
  }
270
  }
271
  }
@@ -384,6 +396,15 @@ html{
384
  }
385
  }
386
  }
 
 
 
 
 
 
 
 
 
387
  }
388
  .cherry-settings{
389
  & + & {
@@ -430,6 +451,19 @@ html{
430
  @media ( min-width: 961px ) {
431
  padding: $padding * 3;
432
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  }
434
 
435
  .cherry-section.cherry-scroll > .cherry-section__holder > .cherry-section__inner,
1
  $color-1: #fff; // Background color.
2
+ $widget-bg: #495159; // Background color in widgets.
3
  $color-2: #efefef; // Background color.
4
  $color-3: #96989a; // Description color and tabs button text color.
5
  $color-4: #b4b7ba; //
203
  background: none;
204
  cursor: pointer;
205
  position: relative;
206
+ .widget &{
207
+ background-color: $widget-bg;
208
+ color: $color-1;
209
+ }
210
  .cherry-toggle__title {
211
  font-weight: 700;
212
  font-size: 14px;
226
  height: 9px;
227
  text-align: left;
228
  overflow: hidden;
229
+ .widget &{
230
+ color: $color-1;
231
+ }
232
  &.hide-icon{
233
  &:before{
234
  position: relative;
244
  top: -7px;
245
  left: -9px;
246
  }
 
 
247
  transform:scaleX(0);
248
  transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
249
  }
272
  box-shadow:$shadow;
273
  border-radius: $br-radius;
274
  border: $border;
275
+ .widget &{
276
+ box-shadow:none;
277
+ border-radius: 0;
278
+ border-left: 0;
279
+ border-right: 0;
280
+ }
281
  }
282
  }
283
  }
396
  }
397
  }
398
  }
399
+ .widget &{
400
+ padding: 0;
401
+ &__content{
402
+ margin: 0 $margin * -1.5 $margin * 2;
403
+ .cherry-control{
404
+ padding: $padding * 1.5 $padding * 2;
405
+ }
406
+ }
407
+ }
408
  }
409
  .cherry-settings{
410
  & + & {
451
  @media ( min-width: 961px ) {
452
  padding: $padding * 3;
453
  }
454
+ .widget & {
455
+ padding: $padding * 1.5 0;
456
+ flex-direction: column;
457
+ &__content{
458
+ -webkit-box-flex: 0;
459
+ flex: 0 1 100%;
460
+ }
461
+ &__info{
462
+ -webkit-box-flex: 0;
463
+ flex: 0 1 100%;
464
+ padding-right: 0;
465
+ }
466
+ }
467
  }
468
 
469
  .cherry-section.cherry-scroll > .cherry-section__holder > .cherry-section__inner,
cherry-framework/modules/cherry-interface-builder/inc/assets/min/cherry-interface-builder.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-kit button *{pointer-events:none}.cherry-component__content .cherry-settings__content{display:none}.cherry-component__content .cherry-settings__content.show{display:inherit}html{font-size:13px}.cherry-ui-kit h1{font-weight:700;font-size:2.308rem;line-height:2.308rem}.cherry-ui-kit h1 .dashicons{font-size:3rem;line-height:inherit;width:20px;margin:0 20px 0 -5px}.cherry-ui-kit h2{font-weight:600;font-size:1.538rem;line-height:1.538rem}.cherry-ui-kit h2 .dashicons{font-size:2rem;line-height:inherit;width:20px;margin-right:20px}.cherry-ui-kit h3{font-weight:600;font-size:1.231rem;line-height:1.231rem}.cherry-ui-kit h3 .dashicons{font-size:1.7rem;line-height:inherit;margin-right:5px}.cherry-ui-kit h4{font-weight:500;font-size:1.077rem;line-height:1.077rem}.cherry-ui-kit h5{font-weight:500;font-size:1.077rem;line-height:1.077rem}.cherry-ui-kit h6{font-weight:400;font-size:1rem;line-height:1rem}.cherry-ui-kit a{color:#298ffc;text-decoration:none}.cherry-ui-kit a:hover{color:#23282d}.cherry-ui-kit a:focus{outline:1px solid rgba(41,143,252,0.6);box-shadow:0px 0px 2px rgba(41,143,252,0.6)}.cherry-ui-kit__description{font-size:0.9rem;color:#96989a;margin:10px 0}.cherry-ui-kit__title{margin:20px 0}.cherry-ui-kit.hide{display:none}.cherry-control+.cherry-control,.cherry-settings+.cherry-control{border-top:1px solid rgba(0,0,0,0.1)}.cherry-section{padding:10px;background-color:#fff;margin-left:-10px}.cherry-section__title,.cherry-section__description{margin:10px 0 0 0}.cherry-section+.cherry-ui-kit{border-top:1px solid rgba(0,0,0,0.1)}@media (min-width: 783px){.cherry-section{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);padding:15px;margin:15px 15px 0 0}.cherry-section__holder{background-color:#efefef;border-radius:5px;padding:15px}.cherry-section__info{background-color:#fff;border-radius:5px;padding:15px;box-shadow:0px 5px 21px rgba(0,0,0,0.1);margin-bottom:15px}.cherry-section .cherry-settings{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);background-color:#fff;margin-top:15px}.cherry-section .cherry-settings:first-child{margin-top:0}}@media (min-width: 961px){.cherry-section{padding:30px;margin:20px 20px 0 0}.cherry-section__info{padding:30px;margin-bottom:30px}.cherry-section__holder{padding:30px}.cherry-section .cherry-settings{margin-top:30px}}.cherry-component{padding:20px 0}@media (min-width: 783px){.cherry-component{padding:15px}}@media (min-width: 961px){.cherry-component{padding:30px}}.cherry-component+*{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component__title{margin-top:0}.cherry-component .cherry-component__content .cherry-settings{padding:0;border-top:none}.cherry-component__button{display:block;min-height:45px;-webkit-transition:all 300ms cubic-bezier(0.55, 0.055, 0.675, 0.19);transition:all 300ms cubic-bezier(0.55, 0.055, 0.675, 0.19)}.cherry-component__button .cherry-ui-kit__title{color:inherit}.cherry-component__button.active,.cherry-component__button:hover{color:#298ffc;-webkit-transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1);transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component__button:focus{outline:none;box-shadow:inset 0px 0px 10px rgba(41,143,252,0.5);-webkit-transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275);transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button,.cherry-component.cherry-toggle .cherry-component__button{width:100%;padding:15px 20px;border:0;background:none;cursor:pointer;position:relative}.cherry-component.cherry-accordion .cherry-component__button .cherry-toggle__title,.cherry-component.cherry-toggle .cherry-component__button .cherry-toggle__title{font-weight:700;font-size:14px;float:left;margin:0}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"],.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"]{position:absolute;top:50%;right:5px;margin-top:-10px;font-size:25px;color:#b4b7ba;padding:5px 5px;width:10px;height:9px;text-align:left;overflow:hidden}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].hide-icon,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].hide-icon{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transition:all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].hide-icon:before,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].hide-icon:before{position:relative;top:-8px;left:-9px}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].show-icon,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].show-icon{-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transition:all 300ms cubic-bezier(0.215, 0.61, 0.355, 1);transition:all 300ms cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].show-icon:before,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].show-icon:before{position:relative;top:-7px;left:-9px}.cherry-component.cherry-accordion .cherry-component__button.active>span[class*="icon"].show-icon,.cherry-component.cherry-toggle .cherry-component__button.active>span[class*="icon"].show-icon{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275);transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button.active>span[class*="icon"].hide-icon,.cherry-component.cherry-toggle .cherry-component__button.active>span[class*="icon"].hide-icon{-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1);transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component.cherry-accordion .cherry-component__button+.cherry-settings__content,.cherry-component.cherry-toggle .cherry-component__button+.cherry-settings__content{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-accordion>.cherry-ui-kit__content>.cherry-settings+.cherry-settings,.cherry-component.cherry-toggle>.cherry-ui-kit__content>.cherry-settings+.cherry-settings{margin-top:10px}.cherry-component.cherry-accordion>.cherry-ui-kit__content>.cherry-settings,.cherry-component.cherry-toggle>.cherry-ui-kit__content>.cherry-settings{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__tabs{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-ms-flex-line-pack:start;align-content:flex-start;border-bottom:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0;-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%;-ms-flex-item-align:auto;-ms-grid-row-align:auto;align-self:auto;padding:15px 20px;border:0;background:none;cursor:pointer}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button.active{-ms-box-shadow:inset 0px -3px 0px 0px #298ffc;box-shadow:inset 0px -3px 0px 0px #298ffc}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button .cherry-tab__title{font-weight:700;font-size:14px;float:left;margin:0}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button+button{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__body{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);background-color:#fff}.cherry-component.cherry-tab .cherry-tab__body .cherry-settings{box-shadow:none;border-radius:0;border:none;background-color:inherit;margin:0}@media (min-width: 783px){.cherry-component.cherry-tab .cherry-tab__tabs{border:solid 1px rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button+button{border-top:none}.cherry-component.cherry-tab .cherry-tab__body{border:none}.cherry-component.cherry-tab .cherry-tab__body .cherry-tab__content{border:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab--horizontal>.cherry-tab__body{border-radius:none}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__tabs{-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;border-radius:5px 5px 0 0;border-bottom:none}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button{-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__content{border-radius:0 0 5px 5px}.cherry-component.cherry-tab--vertical>.cherry-tab__body{display:-webkit-box;display:-ms-flexbox;display:flex;border-radius:none}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:0;-ms-flex:0 1 25%;flex:0 1 25%;border-radius:5px 0 0 5px;border-right:none}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button{text-align:right}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button .cherry-tab__title{width:100%}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button.active{box-shadow:inset -3px 0px 0px #298ffc}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__content{-webkit-box-flex:0;-ms-flex:0 1 75%;flex:0 1 75%;border-radius:0 5px 5px 0}}@media (min-width: 1200px){.cherry-component.cherry-tab--vertical .cherry-tab__tabs{-webkit-box-flex:0;-ms-flex:0 1 20%;flex:0 1 20%}.cherry-component.cherry-tab--vertical .cherry-tab__content{-webkit-box-flex:0;-ms-flex:0 1 80%;flex:0 1 80%}}.cherry-settings+.cherry-settings{border-top:1px solid rgba(0,0,0,0.1)}.cherry-settings .cherry-settings__title{margin-bottom:10px}.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:10px}@media (min-width: 783px){.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:15px}}@media (min-width: 961px){.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:30px}}.cherry-control{padding:15px 20px}.cherry-control__title{margin:0 0 10px 0}.cherry-control__description{margin-top:0}.cherry-control .cherry-ui-container{margin:0}@media (min-width: 783px){.cherry-control{padding:15px;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap}.cherry-control__info{-webkit-box-flex:0;-ms-flex:0 1 30%;flex:0 1 30%;padding-right:15px}.cherry-control__content{-webkit-box-flex:0;-ms-flex:0 1 70%;flex:0 1 70%}}@media (min-width: 961px){.cherry-control{padding:30px}}@media (min-width: 783px){.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner,.cherry-tab__content>.cherry-scroll,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content{max-height:700px;overflow-y:auto;position:relative}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar{width:10px;height:10px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-button,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-button,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-button,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-button{width:0px;height:0px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb{background-color:#298ffc;border:none;border-radius:5px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb:hover,.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb:active,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb:hover,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb:active,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:hover,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:active,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:hover,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:active{background:#206ff4}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-track,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-track,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-track,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-track{background-color:#fff;border:none;border-radius:5px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-corner,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-corner,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-corner,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-corner{background:transparent}}
1
+ .cherry-ui-kit button *{pointer-events:none}.cherry-component__content .cherry-settings__content{display:none}.cherry-component__content .cherry-settings__content.show{display:inherit}html{font-size:13px}.cherry-ui-kit h1{font-weight:700;font-size:2.308rem;line-height:2.308rem}.cherry-ui-kit h1 .dashicons{font-size:3rem;line-height:inherit;width:20px;margin:0 20px 0 -5px}.cherry-ui-kit h2{font-weight:600;font-size:1.538rem;line-height:1.538rem}.cherry-ui-kit h2 .dashicons{font-size:2rem;line-height:inherit;width:20px;margin-right:20px}.cherry-ui-kit h3{font-weight:600;font-size:1.231rem;line-height:1.231rem}.cherry-ui-kit h3 .dashicons{font-size:1.7rem;line-height:inherit;margin-right:5px}.cherry-ui-kit h4{font-weight:500;font-size:1.077rem;line-height:1.077rem}.cherry-ui-kit h5{font-weight:500;font-size:1.077rem;line-height:1.077rem}.cherry-ui-kit h6{font-weight:400;font-size:1rem;line-height:1rem}.cherry-ui-kit a{color:#298ffc;text-decoration:none}.cherry-ui-kit a:hover{color:#23282d}.cherry-ui-kit a:focus{outline:1px solid rgba(41,143,252,0.6);box-shadow:0px 0px 2px rgba(41,143,252,0.6)}.cherry-ui-kit__description{font-size:0.9rem;color:#96989a;margin:10px 0}.cherry-ui-kit__title{margin:20px 0}.cherry-ui-kit.hide{display:none}.cherry-control+.cherry-control,.cherry-settings+.cherry-control{border-top:1px solid rgba(0,0,0,0.1)}.cherry-section{padding:10px;background-color:#fff;margin-left:-10px}.cherry-section__title,.cherry-section__description{margin:10px 0 0 0}.cherry-section+.cherry-ui-kit{border-top:1px solid rgba(0,0,0,0.1)}@media (min-width: 783px){.cherry-section{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);padding:15px;margin:15px 15px 0 0}.cherry-section__holder{background-color:#efefef;border-radius:5px;padding:15px}.cherry-section__info{background-color:#fff;border-radius:5px;padding:15px;box-shadow:0px 5px 21px rgba(0,0,0,0.1);margin-bottom:15px}.cherry-section .cherry-settings{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);background-color:#fff;margin-top:15px}.cherry-section .cherry-settings:first-child{margin-top:0}}@media (min-width: 961px){.cherry-section{padding:30px;margin:20px 20px 0 0}.cherry-section__info{padding:30px;margin-bottom:30px}.cherry-section__holder{padding:30px}.cherry-section .cherry-settings{margin-top:30px}}.cherry-component{padding:20px 0}@media (min-width: 783px){.cherry-component{padding:15px}}@media (min-width: 961px){.cherry-component{padding:30px}}.cherry-component+*{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component__title{margin-top:0}.cherry-component .cherry-component__content .cherry-settings{padding:0;border-top:none}.cherry-component__button{display:block;min-height:45px;-webkit-transition:all 300ms cubic-bezier(0.55, 0.055, 0.675, 0.19);transition:all 300ms cubic-bezier(0.55, 0.055, 0.675, 0.19)}.cherry-component__button .cherry-ui-kit__title{color:inherit}.cherry-component__button.active,.cherry-component__button:hover{color:#298ffc;-webkit-transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1);transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component__button:focus{outline:none;box-shadow:inset 0px 0px 10px rgba(41,143,252,0.5);-webkit-transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275);transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button,.cherry-component.cherry-toggle .cherry-component__button{width:100%;padding:15px 20px;border:0;background:none;cursor:pointer;position:relative}.widget .cherry-component.cherry-accordion .cherry-component__button,.widget .cherry-component.cherry-toggle .cherry-component__button{background-color:#495159;color:#fff}.cherry-component.cherry-accordion .cherry-component__button .cherry-toggle__title,.cherry-component.cherry-toggle .cherry-component__button .cherry-toggle__title{font-weight:700;font-size:14px;float:left;margin:0}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"],.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"]{position:absolute;top:50%;right:5px;margin-top:-10px;font-size:25px;color:#b4b7ba;padding:5px 5px;width:10px;height:9px;text-align:left;overflow:hidden}.widget .cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"],.widget .cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"]{color:#fff}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].hide-icon,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].hide-icon{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transition:all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].hide-icon:before,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].hide-icon:before{position:relative;top:-8px;left:-9px}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].show-icon,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].show-icon{-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transition:all 300ms cubic-bezier(0.215, 0.61, 0.355, 1);transition:all 300ms cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component.cherry-accordion .cherry-component__button>span[class*="icon"].show-icon:before,.cherry-component.cherry-toggle .cherry-component__button>span[class*="icon"].show-icon:before{position:relative;top:-7px;left:-9px}.cherry-component.cherry-accordion .cherry-component__button.active>span[class*="icon"].show-icon,.cherry-component.cherry-toggle .cherry-component__button.active>span[class*="icon"].show-icon{-webkit-transform:scaleX(1);transform:scaleX(1);-webkit-transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275);transition-timing-function:cubic-bezier(0.175, 0.885, 0.32, 1.275)}.cherry-component.cherry-accordion .cherry-component__button.active>span[class*="icon"].hide-icon,.cherry-component.cherry-toggle .cherry-component__button.active>span[class*="icon"].hide-icon{-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1);transition-timing-function:cubic-bezier(0.215, 0.61, 0.355, 1)}.cherry-component.cherry-accordion .cherry-component__button+.cherry-settings__content,.cherry-component.cherry-toggle .cherry-component__button+.cherry-settings__content{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-accordion>.cherry-ui-kit__content>.cherry-settings+.cherry-settings,.cherry-component.cherry-toggle>.cherry-ui-kit__content>.cherry-settings+.cherry-settings{margin-top:10px}.cherry-component.cherry-accordion>.cherry-ui-kit__content>.cherry-settings,.cherry-component.cherry-toggle>.cherry-ui-kit__content>.cherry-settings{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1)}.widget .cherry-component.cherry-accordion>.cherry-ui-kit__content>.cherry-settings,.widget .cherry-component.cherry-toggle>.cherry-ui-kit__content>.cherry-settings{box-shadow:none;border-radius:0;border-left:0;border-right:0}.cherry-component.cherry-tab .cherry-tab__tabs{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-ms-flex-line-pack:start;align-content:flex-start;border-bottom:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0;-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%;-ms-flex-item-align:auto;-ms-grid-row-align:auto;align-self:auto;padding:15px 20px;border:0;background:none;cursor:pointer}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button.active{-ms-box-shadow:inset 0px -3px 0px 0px #298ffc;box-shadow:inset 0px -3px 0px 0px #298ffc}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button .cherry-tab__title{font-weight:700;font-size:14px;float:left;margin:0}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button+button{border-top:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__body{box-shadow:0px 5px 21px rgba(0,0,0,0.1);border-radius:5px;border:1px solid rgba(0,0,0,0.1);background-color:#fff}.cherry-component.cherry-tab .cherry-tab__body .cherry-settings{box-shadow:none;border-radius:0;border:none;background-color:inherit;margin:0}@media (min-width: 783px){.cherry-component.cherry-tab .cherry-tab__tabs{border:solid 1px rgba(0,0,0,0.1)}.cherry-component.cherry-tab .cherry-tab__tabs .cherry-component__button+button{border-top:none}.cherry-component.cherry-tab .cherry-tab__body{border:none}.cherry-component.cherry-tab .cherry-tab__body .cherry-tab__content{border:1px solid rgba(0,0,0,0.1)}.cherry-component.cherry-tab--horizontal>.cherry-tab__body{border-radius:none}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__tabs{-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;border-radius:5px 5px 0 0;border-bottom:none}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button{-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto}.cherry-component.cherry-tab--horizontal>.cherry-tab__body>.cherry-tab__content{border-radius:0 0 5px 5px}.cherry-component.cherry-tab--vertical>.cherry-tab__body{display:-webkit-box;display:-ms-flexbox;display:flex;border-radius:none}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:0;-ms-flex:0 1 25%;flex:0 1 25%;border-radius:5px 0 0 5px;border-right:none}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button{text-align:right}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button .cherry-tab__title{width:100%}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__tabs .cherry-component__button.active{box-shadow:inset -3px 0px 0px #298ffc}.cherry-component.cherry-tab--vertical>.cherry-tab__body>.cherry-tab__content{-webkit-box-flex:0;-ms-flex:0 1 75%;flex:0 1 75%;border-radius:0 5px 5px 0}}@media (min-width: 1200px){.cherry-component.cherry-tab--vertical .cherry-tab__tabs{-webkit-box-flex:0;-ms-flex:0 1 20%;flex:0 1 20%}.cherry-component.cherry-tab--vertical .cherry-tab__content{-webkit-box-flex:0;-ms-flex:0 1 80%;flex:0 1 80%}}.widget .cherry-component{padding:0}.widget .cherry-component__content{margin:0 -15px 20px}.widget .cherry-component__content .cherry-control{padding:15px 20px}.cherry-settings+.cherry-settings{border-top:1px solid rgba(0,0,0,0.1)}.cherry-settings .cherry-settings__title{margin-bottom:10px}.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:10px}@media (min-width: 783px){.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:15px}}@media (min-width: 961px){.cherry-settings__description,.cherry-settings .cherry-settings__title{margin-left:30px}}.cherry-control{padding:15px 20px}.cherry-control__title{margin:0 0 10px 0}.cherry-control__description{margin-top:0}.cherry-control .cherry-ui-container{margin:0}@media (min-width: 783px){.cherry-control{padding:15px;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap}.cherry-control__info{-webkit-box-flex:0;-ms-flex:0 1 30%;flex:0 1 30%;padding-right:15px}.cherry-control__content{-webkit-box-flex:0;-ms-flex:0 1 70%;flex:0 1 70%}}@media (min-width: 961px){.cherry-control{padding:30px}}.widget .cherry-control{padding:15px 0;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.widget .cherry-control__content{-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%}.widget .cherry-control__info{-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%;padding-right:0}@media (min-width: 783px){.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner,.cherry-tab__content>.cherry-scroll,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content{max-height:700px;overflow-y:auto;position:relative}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar{width:10px;height:10px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-button,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-button,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-button,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-button{width:0px;height:0px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb{background-color:#298ffc;border:none;border-radius:5px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb:hover,.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-thumb:active,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb:hover,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-thumb:active,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:hover,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:active,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:hover,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-thumb:active{background:#206ff4}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-track,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-track,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-track,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-track{background-color:#fff;border:none;border-radius:5px}.cherry-section.cherry-scroll>.cherry-section__holder>.cherry-section__inner::-webkit-scrollbar-corner,.cherry-tab__content>.cherry-scroll::-webkit-scrollbar-corner,.cherry-accordion__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-corner,.cherry-toggle__content>.cherry-scroll>.cherry-settings__content::-webkit-scrollbar-corner{background:transparent}}
cherry-framework/modules/cherry-interface-builder/inc/views/component-accordion.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/component-repeater.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/component-tab-horizontal.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/component-tab-vertical.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/component-toggle.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/control.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/form.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/html.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/section.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/settings-children-title.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/settings.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/tab-children-title.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-interface-builder/inc/views/toggle-children-title.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Interface_Builder
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry-js-core/cherry-js-core.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: JS Core
4
  * Description: Initializes global JS object which provides additional plugin functionality
5
- * Version: 1.1.2
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.1.2
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
@@ -41,12 +39,22 @@ if ( ! class_exists( 'Cherry_Js_Core' ) ) {
41
  private static $instance = null;
42
 
43
  /**
44
- * Module version.
45
  *
46
- * @since 1.0.0
 
47
  * @var string
48
  */
49
- private $module_version = '1.1.2';
 
 
 
 
 
 
 
 
 
50
 
51
  /**
52
  * Default options.
@@ -68,7 +76,9 @@ if ( ! class_exists( 'Cherry_Js_Core' ) ) {
68
  * @param array $args Class args.
69
  */
70
  public function __construct( $core, $args = array() ) {
71
- $this->options = array_merge( $this->options, $args );
 
 
72
 
73
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_cherry_scripts' ), 0 );
74
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_cherry_scripts' ), 0 );
@@ -83,14 +93,20 @@ if ( ! class_exists( 'Cherry_Js_Core' ) ) {
83
  public function enqueue_cherry_scripts() {
84
 
85
  if ( 'framework' === $this->options['product_type'] ) {
86
- $src = esc_url( Cherry_Core::base_url( 'assets/js/min/cherry-js-core.min.js', __FILE__ ) );
87
- $version = $this->module_version;
88
  } else {
89
  $src = ( ! empty( $this->options['src'] ) ? esc_url( $this->options['src'] ) : false );
90
  $version = ( ! empty( $this->options['version'] ) ? absint( $this->options['src'] ) : false );
91
  }
92
 
93
- wp_enqueue_script( 'cherry-js-core', $src, array( 'jquery' ), $version, true );
 
 
 
 
 
 
94
  }
95
 
96
  /**
2
  /**
3
  * Module Name: JS Core
4
  * Description: Initializes global JS object which provides additional plugin functionality
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
39
  private static $instance = null;
40
 
41
  /**
42
+ * Core version.
43
  *
44
+ * @since 1.5.0
45
+ * @access public
46
  * @var string
47
  */
48
+ public $core_version = '';
49
+
50
+ /**
51
+ * Module directory path.
52
+ *
53
+ * @since 1.5.0
54
+ * @access protected
55
+ * @var srting.
56
+ */
57
+ protected $module_path;
58
 
59
  /**
60
  * Default options.
76
  * @param array $args Class args.
77
  */
78
  public function __construct( $core, $args = array() ) {
79
+ $this->options = array_merge( $this->options, $args );
80
+ $this->core_version = $core->get_core_version();
81
+ $this->module_path = $args['module_path'];
82
 
83
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_cherry_scripts' ), 0 );
84
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_cherry_scripts' ), 0 );
93
  public function enqueue_cherry_scripts() {
94
 
95
  if ( 'framework' === $this->options['product_type'] ) {
96
+ $src = esc_url( Cherry_Core::base_url( 'assets/js/min/cherry-js-core.min.js', $this->module_path ) );
97
+ $version = $this->core_version;
98
  } else {
99
  $src = ( ! empty( $this->options['src'] ) ? esc_url( $this->options['src'] ) : false );
100
  $version = ( ! empty( $this->options['version'] ) ? absint( $this->options['src'] ) : false );
101
  }
102
 
103
+ wp_enqueue_script(
104
+ 'cherry-js-core',
105
+ $src,
106
+ array( 'jquery' ),
107
+ $this->core_version,
108
+ true
109
+ );
110
  }
111
 
112
  /**
cherry-framework/modules/cherry-post-formats-api/cherry-post-formats-api.php CHANGED
@@ -3,7 +3,6 @@
3
  * API functions for post formats specific content
4
  * Module Name: Post Formats API
5
  * Description: API for post formats specific content
6
- * Version: 1.1.2
7
  * Author: Cherry Team
8
  * Author URI: http://www.cherryframework.com/
9
  * License: GPLv3
@@ -11,9 +10,8 @@
11
  *
12
  * @package Cherry_Framework
13
  * @subpackage Modules
14
- * @version 1.1.2
15
  * @author Cherry Team <cherryframework@gmail.com>
16
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
17
  * @link http://www.cherryframework.com/
18
  * @license http://www.gnu.org/licenses/gpl-3.0.html
19
  */
@@ -31,11 +29,22 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
31
  class Cherry_Post_Formats_Api {
32
 
33
  /**
34
- * Module version
35
  *
 
 
36
  * @var string
37
  */
38
- public $module_version = '1.1.0';
 
 
 
 
 
 
 
 
 
39
 
40
  /**
41
  * Module slug
@@ -110,6 +119,9 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
110
  'height' => 400,
111
  ) );
112
 
 
 
 
113
  $formats = array(
114
  'image',
115
  'gallery',
@@ -199,11 +211,10 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
199
  * Include required API files
200
  *
201
  * @since 1.0.0
202
- * @since 1.1.1 Using dirname( __FILE__ ) instead of __DIR__.
203
  * @return void
204
  */
205
  public function includes() {
206
- require_once dirname( __FILE__ ) . '/inc/class-cherry-facebook-embed.php';
207
 
208
  // Register Facebook Embed.
209
  if ( class_exists( 'Cherry_Facebook_Embed' ) ) {
@@ -220,9 +231,9 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
220
  public function assets() {
221
  wp_enqueue_script(
222
  'cherry-post-formats',
223
- Cherry_Core::base_url( 'assets/js/min/cherry-post-formats.min.js', __FILE__ ),
224
  array( 'jquery', 'cherry-js-core' ),
225
- $this->module_version,
226
  true
227
  );
228
  }
@@ -503,7 +514,9 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
503
  * @since 1.0.0
504
  * @param array existing attributes.
505
  */
506
- $img_atts = apply_filters( 'cherry_post_image_attributes', array( 'class' => $css_model['image'] ) );
 
 
507
 
508
  if ( has_post_thumbnail( $post_id ) ) {
509
 
@@ -552,7 +565,9 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
552
  $url = get_permalink( $post_id );
553
  }
554
 
555
- $data_atts = array( 'data-cherrypopup' => true );
 
 
556
 
557
  if ( false !== $args['popup_init'] ) {
558
  $init = json_encode( $args['popup_init'] );
@@ -855,8 +870,13 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
855
  wp_enqueue_script( $args['popup_handle'] );
856
  }
857
 
858
- $slider_data = array( 'data-cherryslider' => true );
859
- $popup_data = array( 'data-cherrypopup' => true );
 
 
 
 
 
860
 
861
  if ( false !== $args['slider'] ) {
862
  $slider_data['data-slider'] = $args['slider'];
@@ -897,7 +917,9 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
897
  */
898
  $img_atts = apply_filters(
899
  'cherry_post_gallery_image_attributes',
900
- array( 'class' => $css_model['image'] ),
 
 
901
  $img
902
  );
903
 
@@ -926,7 +948,9 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
926
  $width = $_wp_additional_image_sizes[ $args['size'] ]['width'];
927
  }
928
 
929
- $default_atts = array( 'width' => $width );
 
 
930
  $img_atts = array_merge( $default_atts, $img_atts );
931
  $thumb = sprintf( '<img src="%s" %s>', esc_url( $img ), $this->prepare_atts( $img_atts ) );
932
  $url = $img;
@@ -940,7 +964,9 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
940
  }
941
 
942
  $slide_atts = $this->prepare_atts(
943
- array_merge( array( 'class' => $css_model['link'] . $nth_class ), $popup_data )
 
 
944
  );
945
 
946
  $slide_content = sprintf( $format, $image, $caption, $url, $slide_atts );
3
  * API functions for post formats specific content
4
  * Module Name: Post Formats API
5
  * Description: API for post formats specific content
 
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
 
13
  * @author Cherry Team <cherryframework@gmail.com>
14
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
15
  * @link http://www.cherryframework.com/
16
  * @license http://www.gnu.org/licenses/gpl-3.0.html
17
  */
29
  class Cherry_Post_Formats_Api {
30
 
31
  /**
32
+ * Core version.
33
  *
34
+ * @since 1.5.0
35
+ * @access public
36
  * @var string
37
  */
38
+ public $core_version = '';
39
+
40
+ /**
41
+ * Module directory path.
42
+ *
43
+ * @since 1.5.0
44
+ * @access protected
45
+ * @var srting.
46
+ */
47
+ protected $module_path;
48
 
49
  /**
50
  * Module slug
119
  'height' => 400,
120
  ) );
121
 
122
+ $this->core_version = $core->get_core_version();
123
+ $this->module_path = $args['module_path'];
124
+
125
  $formats = array(
126
  'image',
127
  'gallery',
211
  * Include required API files
212
  *
213
  * @since 1.0.0
 
214
  * @return void
215
  */
216
  public function includes() {
217
+ require_once $this->module_path . 'inc/class-cherry-facebook-embed.php';
218
 
219
  // Register Facebook Embed.
220
  if ( class_exists( 'Cherry_Facebook_Embed' ) ) {
231
  public function assets() {
232
  wp_enqueue_script(
233
  'cherry-post-formats',
234
+ Cherry_Core::base_url( 'assets/js/min/cherry-post-formats.min.js', $this->module_path ),
235
  array( 'jquery', 'cherry-js-core' ),
236
+ $this->core_version,
237
  true
238
  );
239
  }
514
  * @since 1.0.0
515
  * @param array existing attributes.
516
  */
517
+ $img_atts = apply_filters( 'cherry_post_image_attributes', array(
518
+ 'class' => $css_model['image'],
519
+ ) );
520
 
521
  if ( has_post_thumbnail( $post_id ) ) {
522
 
565
  $url = get_permalink( $post_id );
566
  }
567
 
568
+ $data_atts = array(
569
+ 'data-cherrypopup' => true,
570
+ );
571
 
572
  if ( false !== $args['popup_init'] ) {
573
  $init = json_encode( $args['popup_init'] );
870
  wp_enqueue_script( $args['popup_handle'] );
871
  }
872
 
873
+ $slider_data = array(
874
+ 'data-cherryslider' => true,
875
+ );
876
+
877
+ $popup_data = array(
878
+ 'data-cherrypopup' => true,
879
+ );
880
 
881
  if ( false !== $args['slider'] ) {
882
  $slider_data['data-slider'] = $args['slider'];
917
  */
918
  $img_atts = apply_filters(
919
  'cherry_post_gallery_image_attributes',
920
+ array(
921
+ 'class' => $css_model['image'],
922
+ ),
923
  $img
924
  );
925
 
948
  $width = $_wp_additional_image_sizes[ $args['size'] ]['width'];
949
  }
950
 
951
+ $default_atts = array(
952
+ 'width' => $width,
953
+ );
954
  $img_atts = array_merge( $default_atts, $img_atts );
955
  $thumb = sprintf( '<img src="%s" %s>', esc_url( $img ), $this->prepare_atts( $img_atts ) );
956
  $url = $img;
964
  }
965
 
966
  $slide_atts = $this->prepare_atts(
967
+ array_merge( array(
968
+ 'class' => $css_model['link'] . $nth_class,
969
+ ), $popup_data )
970
  );
971
 
972
  $slide_content = sprintf( $format, $image, $caption, $url, $slide_atts );
cherry-framework/modules/cherry-post-formats-api/inc/class-cherry-facebook-embed.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Framework
6
  * @subpackage Class
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.en.html
11
  */
5
  * @package Cherry_Framework
6
  * @subpackage Class
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.en.html
11
  */
cherry-framework/modules/cherry-post-meta/cherry-post-meta.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Post Meta
4
  * Description: Manage post meta
5
- * Version: 1.2.1
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.2.1
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
@@ -165,7 +163,9 @@ if ( ! class_exists( 'Cherry_Post_Meta' ) ) {
165
 
166
  $columns = array_merge(
167
  $columns_before,
168
- array( $column_key => $column_data['label'] ),
 
 
169
  $columns_after
170
  );
171
  } else {
@@ -291,9 +291,7 @@ if ( ! class_exists( 'Cherry_Post_Meta' ) ) {
291
  * Get registered control fields
292
  *
293
  * @since 1.0.0
294
- * @since 1.1.3 Using dirname( __FILE__ ) instead of __DIR__.
295
  * @since 1.2.0 Use interface builder for HTML rendering.
296
- *
297
  * @param mixed $post Current post object.
298
  * @return void
299
  */
2
  /**
3
  * Module Name: Post Meta
4
  * Description: Manage post meta
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
163
 
164
  $columns = array_merge(
165
  $columns_before,
166
+ array(
167
+ $column_key => $column_data['label'],
168
+ ),
169
  $columns_after
170
  );
171
  } else {
291
  * Get registered control fields
292
  *
293
  * @since 1.0.0
 
294
  * @since 1.2.0 Use interface builder for HTML rendering.
 
295
  * @param mixed $post Current post object.
296
  * @return void
297
  */
cherry-framework/modules/cherry-term-meta/cherry-term-meta.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Term Meta
4
  * Description: Manage term metadata
5
- * Version: 1.1.4
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.1.4
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
2
  /**
3
  * Module Name: Term Meta
4
  * Description: Manage term metadata
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
cherry-framework/modules/cherry-toolkit/cherry-toolkit.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Framework Toolkit
4
  * Description: Framework Toolkit contains various PHP utilities
5
- * Version: 1.2.0
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Class
13
- * @version 1.2.0
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
2
  /**
3
  * Module Name: Framework Toolkit
4
  * Description: Framework Toolkit contains various PHP utilities
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Class
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
cherry-framework/modules/cherry-ui-elements/assets/sass/_lock.scss ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $lock-bg-color: rgba(0,0,0,0.9);
2
+ .cherry-lock-element{
3
+ user-select: none;
4
+ cursor: no-drop;
5
+ position: relative;
6
+ filter: grayscale( 100% );
7
+
8
+ &.inline-block{
9
+ display: inline-block;
10
+ }
11
+
12
+ & label{
13
+ position: relative;
14
+ }
15
+ .cherry-lable-content,
16
+ .cherry-checkbox-item,
17
+ .select2-container,
18
+ > *:first-child{
19
+ opacity: 0.5;
20
+ pointer-events: none;
21
+ }
22
+
23
+ a.cherry-lock-element__area{
24
+ position: absolute;
25
+ top: 0;
26
+ left: 0;
27
+ width: 100%;
28
+ height: 100%;
29
+ z-index: 2000;
30
+ cursor: no-drop;
31
+ &:focus{
32
+ outline: none;
33
+ box-shadow: none;
34
+ }
35
+ &:hover{
36
+ .cherry-lock-element__label{
37
+ animation-name: lock_show;
38
+ animation-duration: 450ms;
39
+ animation-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
40
+ }
41
+ }
42
+ }
43
+
44
+ &__label {
45
+ opacity: 0;
46
+ display: inline-block;
47
+ background-color: $lock-bg-color;
48
+ border-radius: 5px;
49
+ color: #fff;
50
+ padding: 8px 10px;
51
+ position: absolute;
52
+ white-space: nowrap;
53
+ top: -10px;
54
+ left: 50%;
55
+ box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.5);
56
+ will-change: auto;
57
+ pointer-events: none;
58
+ font-size: 14px;
59
+ line-height: 16px;
60
+
61
+ animation-name: lock_hide;
62
+ animation-duration: 200ms;
63
+ animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
64
+ animation-fill-mode: both;
65
+
66
+ transform-origin: 0% 0%;
67
+ * + *{
68
+ margin-right: 5px;
69
+ }
70
+ &:after {
71
+ border: solid;
72
+ border-color: $lock-bg-color transparent;
73
+ border-width: 6px 6px 0 6px;
74
+ bottom: -5px;
75
+ margin-left: -6px;
76
+ content: "";
77
+ left: 50%;
78
+ position: absolute;
79
+ }
80
+ }
81
+ }
82
+ @keyframes lock_show {
83
+ 0% {
84
+ opacity: 0;
85
+ filter: blur(5px);
86
+ transform: scale( 0 ) translate(-50%, 200% );
87
+ }
88
+ 60% {
89
+ opacity: 0.8;
90
+ transform: scale( 1.1 ) translate(-50%, -130% );
91
+ }
92
+ 100% {
93
+ opacity: 1;
94
+ filter: blur(0px);
95
+ transform: scale( 1 ) translate(-50%, -100% );
96
+ }
97
+ }
98
+
99
+ @keyframes lock_hide {
100
+ 0% {
101
+ opacity: 1;
102
+ filter: blur(0px);
103
+ transform: scale( 1 ) translate(-50%, -100%);
104
+ }
105
+ 100% {
106
+ opacity: 0;
107
+ filter: blur(3px);
108
+ transform: scale( 0 ) translate(-50%, 200%);
109
+ }
110
+ }
cherry-framework/modules/cherry-ui-elements/cherry-ui-elements.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: UI Elements
4
  * Description: Class for the building ui elements
5
- * Version: 1.4.1
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.4.1
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
@@ -56,6 +54,24 @@ if ( ! class_exists( 'Cherry_UI_Elements' ) ) {
56
  ),
57
  );
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  /**
60
  * Constructor.
61
  *
@@ -64,7 +80,10 @@ if ( ! class_exists( 'Cherry_UI_Elements' ) ) {
64
  * @param array $args Arguments.
65
  */
66
  public function __construct( $core, $args ) {
67
- $this->args = array_merge( $this->args, $args );
 
 
 
68
  $this->ui_elements_require();
69
 
70
  // Load admin assets.
@@ -105,23 +124,21 @@ if ( ! class_exists( 'Cherry_UI_Elements' ) ) {
105
  * Require UI-elements.
106
  *
107
  * @since 1.0.0
108
- * @since 1.1.4 Using dirname( __FILE__ ) instead of __DIR__.
109
  * @return void
110
  */
111
  public function ui_elements_require() {
112
 
113
  // Add I_UI interface.
114
  if ( ! interface_exists( 'I_UI' ) ) {
115
- require_once( dirname( __FILE__ ) . '/i-ui.php' );
116
  }
117
 
118
- if ( ! class_exists( 'UI_Element' ) ) {
119
- require_once( dirname( __FILE__ ) . '/ui-element.php' );
120
- }
121
 
122
  if ( ! empty( $this->args['ui_elements'] ) ) {
123
  foreach ( $this->args['ui_elements'] as $ui_element ) {
124
- require_once( dirname( __FILE__ ) . '/inc/ui-elements/ui-' . $ui_element . '/ui-' . $ui_element . '.php' );
125
  }
126
  }
127
  }
2
  /**
3
  * Module Name: UI Elements
4
  * Description: Class for the building ui elements
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
54
  ),
55
  );
56
 
57
+ /**
58
+ * Core version.
59
+ *
60
+ * @since 1.5.0
61
+ * @access public
62
+ * @var string
63
+ */
64
+ public static $core_version = '';
65
+
66
+ /**
67
+ * Module directory path.
68
+ *
69
+ * @since 1.5.0
70
+ * @access protected
71
+ * @var srting.
72
+ */
73
+ public static $module_path;
74
+
75
  /**
76
  * Constructor.
77
  *
80
  * @param array $args Arguments.
81
  */
82
  public function __construct( $core, $args ) {
83
+ $this->args = array_merge( $this->args, $args );
84
+ self::$core_version = $core->get_core_version();
85
+ self::$module_path = $args['module_path'];
86
+
87
  $this->ui_elements_require();
88
 
89
  // Load admin assets.
124
  * Require UI-elements.
125
  *
126
  * @since 1.0.0
 
127
  * @return void
128
  */
129
  public function ui_elements_require() {
130
 
131
  // Add I_UI interface.
132
  if ( ! interface_exists( 'I_UI' ) ) {
133
+ require_once( self::$module_path . 'i-ui.php' );
134
  }
135
 
136
+ require_once( self::$module_path. 'ui-element.php' );
137
+ require_once( self::$module_path . 'inc/class-cherry-lock-element.php' );
 
138
 
139
  if ( ! empty( $this->args['ui_elements'] ) ) {
140
  foreach ( $this->args['ui_elements'] as $ui_element ) {
141
+ require_once( self::$module_path . 'inc/ui-elements/ui-' . $ui_element . '/ui-' . $ui_element . '.php' );
142
  }
143
  }
144
  }
cherry-framework/modules/cherry-ui-elements/i-ui.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Framework
6
  * @subpackage Class
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.en.html
11
  */
5
  * @package Cherry_Framework
6
  * @subpackage Class
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.en.html
11
  */
cherry-framework/modules/cherry-ui-elements/inc/class-cherry-lock-element.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class lock the elements
4
+ *
5
+ * @package Cherry_Framework
6
+ * @subpackage Class
7
+ * @author Cherry Team <support@cherryframework.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
+ * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/gpl-3.0.en.html
11
+ */
12
+
13
+ // If class `Cherry5_Lock_Element` doesn't exists yet.
14
+ if ( ! class_exists( 'Cherry5_Lock_Element' ) ) {
15
+
16
+ /**
17
+ * Cherry5_Lock_Element class.
18
+ */
19
+ class Cherry5_Lock_Element {
20
+
21
+ /**
22
+ * Default settings.
23
+ *
24
+ * @since 1.4.3
25
+ * @access private
26
+ * @var array
27
+ */
28
+ private $defaults_args = array();
29
+
30
+ /**
31
+ * The attributes of the class.
32
+ *
33
+ * @since 1.4.3
34
+ * @access private
35
+ * @var array
36
+ */
37
+ private $args = array();
38
+
39
+ /**
40
+ * The status of locked element.
41
+ *
42
+ * @since 1.4.3
43
+ * @access private
44
+ * @var bool
45
+ */
46
+ private $element_lock = false;
47
+
48
+ /**
49
+ * Constructor method for the class.
50
+ *
51
+ * @since 1.4.3
52
+ * @access public
53
+ * @return void
54
+ */
55
+ public function __construct( $args = array() ) {
56
+
57
+ if ( ! is_array( $args ) || empty( $args ) || empty( $args['lock'] ) ) {
58
+ return false;
59
+ }
60
+
61
+ $this->element_lock = true;
62
+ $this->defaults_args = apply_filters( 'cherry5_lock_element_defaults', array(
63
+ 'label' => esc_html__( 'Unlocked in PRO', 'cherry-framework' ),
64
+ 'url' => '#',
65
+ 'html' => '<a class="cherry-lock-element__area" target="_blank" href="%1$s" title="%3$s"><span class="cherry-lock-element__label">%2$s %3$s</span></a>',
66
+ 'icon' => '<i class="fa fa-unlock-alt" aria-hidden="true"></i>',
67
+ 'class' => 'cherry-lock-element',
68
+ ), $args );
69
+
70
+ $this->args = wp_parse_args( $args['lock'], $this->defaults_args );
71
+ }
72
+
73
+ /**
74
+ * Return lock element HTML-class.
75
+ *
76
+ * @since 1.4.3
77
+ * @access public
78
+ * @return string
79
+ */
80
+ public function get_class( $sub_class = '' ) {
81
+
82
+ if ( ! $this->element_lock ) {
83
+ return '';
84
+ }
85
+
86
+ $classes = array(
87
+ $this->args['class'],
88
+ $sub_class,
89
+ );
90
+
91
+ $classes = array_filter( $classes );
92
+ $classes = array_map( 'esc_attr', $classes );
93
+
94
+ return ' ' . join( ' ', $classes );
95
+ }
96
+
97
+ /**
98
+ * Return disabled attribute.
99
+ *
100
+ * @since 1.4.3
101
+ * @access public
102
+ * @return string
103
+ */
104
+ public function get_disabled_attr() {
105
+ return $this->element_lock ? ' disabled' : '';
106
+ }
107
+
108
+ /**
109
+ * Return lock element HTML-markup.
110
+ *
111
+ * @since 1.4.3
112
+ * @access public
113
+ * @return string
114
+ */
115
+ public function get_html() {
116
+
117
+ if ( ! $this->element_lock ) {
118
+ return '';
119
+ }
120
+
121
+ return sprintf( $this->args['html'],
122
+ esc_url( $this->args['url'] ),
123
+ $this->args['icon'],
124
+ esc_attr( $this->args['label'] )
125
+ );
126
+ }
127
+ }
128
+ }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/ui-button.php CHANGED
@@ -61,7 +61,7 @@ if ( ! class_exists( 'UI_Button' ) ) {
61
  */
62
  public function render() {
63
  $html = Cherry_Toolkit::render_view(
64
- dirname( __FILE__ ) . '/view/button-view.php',
65
  $this->settings
66
  );
67
 
@@ -76,9 +76,9 @@ if ( ! class_exists( 'UI_Button' ) ) {
76
  public static function enqueue_assets() {
77
  wp_enqueue_style(
78
  'ui-button',
79
- esc_url( Cherry_Core::base_url( 'assets/min/ui-button.min.css', __FILE__ ) ),
80
  array(),
81
- '1.3.2',
82
  'all'
83
  );
84
  }
61
  */
62
  public function render() {
63
  $html = Cherry_Toolkit::render_view(
64
+ Cherry_UI_Elements::$module_path . 'inc/ui-elements/ui-button/view/button-view.php',
65
  $this->settings
66
  );
67
 
76
  public static function enqueue_assets() {
77
  wp_enqueue_style(
78
  'ui-button',
79
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-button/assets/min/ui-button.min.css', Cherry_UI_Elements::$module_path ) ),
80
  array(),
81
+ Cherry_UI_Elements::$core_version,
82
  'all'
83
  );
84
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/view/button-view.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_UI_Elements
6
  * @subpackage View
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
@@ -14,18 +14,24 @@
14
  if ( ! defined( 'WPINC' ) ) {
15
  die;
16
  }
17
- $class = trim( implode( ' ', array( 'cherry5-ui-button', 'cherry5-ui-button-' . $__data['style'] . '-style ', $__data['master'], $__data['class'], 'ui-button' ) ) );
18
- $attrs = Cherry_Toolkit::join(
 
 
 
19
  array(
20
  'type' => esc_attr( $__data['button_type'] ),
21
  'id' => esc_attr( $__data['id'] ),
22
  'name' => esc_attr( $__data['name'] ),
23
  'class' => esc_attr( $class ),
24
- 'disabled' => filter_var( $__data['disabled'], FILTER_VALIDATE_BOOLEAN ),
25
  'form' => esc_attr( $__data['form'] ),
26
  'formaction' => esc_attr( $__data['formaction'] ),
27
  )
28
  );
 
 
 
 
29
  ?>
30
 
31
  <button <?php echo $attrs; ?>><?php echo $__data['content']; ?></button>
5
  * @package Cherry_UI_Elements
6
  * @subpackage View
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
14
  if ( ! defined( 'WPINC' ) ) {
15
  die;
16
  }
17
+
18
+ $classes = array( 'cherry5-ui-button', 'cherry5-ui-button-' . $__data['style'] . '-style', $__data['master'], $__data['class'], 'ui-button' );
19
+ $classes = array_filter( $classes );
20
+ $class = trim( implode( ' ', $classes ) );
21
+ $attrs = Cherry_Toolkit::join(
22
  array(
23
  'type' => esc_attr( $__data['button_type'] ),
24
  'id' => esc_attr( $__data['id'] ),
25
  'name' => esc_attr( $__data['name'] ),
26
  'class' => esc_attr( $class ),
 
27
  'form' => esc_attr( $__data['form'] ),
28
  'formaction' => esc_attr( $__data['formaction'] ),
29
  )
30
  );
31
+
32
+ if ( filter_var( $__data['disabled'], FILTER_VALIDATE_BOOLEAN ) ) {
33
+ $attrs .= ' disabled';
34
+ }
35
  ?>
36
 
37
  <button <?php echo $attrs; ?>><?php echo $__data['content']; ?></button>
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}.cherry-checkbox-item{width:26px;height:26px;display:inline-block;border-radius:2px;margin-right:10px;margin-bottom:6px;cursor:pointer;position:relative;background-color:#f1f1f1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1)}.cherry-checkbox-item .marker{position:absolute;width:26px;height:26px;top:0px;left:0px;color:#fff;font-size:28px;-webkit-transition:inherit;transition:inherit;-webkit-transform:scale(0);transform:scale(0)}.cherry-checkbox-item .marker:before{-webkit-transition:inherit;transition:inherit;position:relative;left:-2px}.cherry-checkbox-input[checked]+.cherry-checkbox-item{background-color:#48c569}.cherry-checkbox-input[checked]+.cherry-checkbox-item .marker{-webkit-transform:scale(1);transform:scale(1)}.cherry-checkbox-label{display:inline-block;vertical-align:top;font-size:14px;line-height:26px;color:#23282d;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cherry-checkbox-label:focus{outline:1px solid rgba(41,143,252,0.6);box-shadow:0px 0px 2px rgba(41,143,252,0.6)}
1
+ .cherry-lock-element{user-select:none;cursor:no-drop;position:relative;filter:grayscale(100%)}.cherry-lock-element.inline-block{display:inline-block}.cherry-lock-element label{position:relative}.cherry-lock-element .cherry-lable-content,.cherry-lock-element .cherry-checkbox-item,.cherry-lock-element .select2-container,.cherry-lock-element>*:first-child{opacity:0.5;pointer-events:none}.cherry-lock-element a.cherry-lock-element__area{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2000;cursor:no-drop}.cherry-lock-element a.cherry-lock-element__area:focus{outline:none;box-shadow:none}.cherry-lock-element a.cherry-lock-element__area:hover .cherry-lock-element__label{animation-name:lock_show;animation-duration:450ms;animation-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1)}.cherry-lock-element__label{opacity:0;display:inline-block;background-color:rgba(0,0,0,0.9);border-radius:5px;color:#fff;padding:8px 10px;position:absolute;white-space:nowrap;top:-10px;left:50%;box-shadow:2px 2px 5px 0px rgba(0,0,0,0.5);will-change:auto;pointer-events:none;font-size:14px;line-height:16px;animation-name:lock_hide;animation-duration:200ms;animation-timing-function:cubic-bezier(0.55, 0.055, 0.675, 0.19);animation-fill-mode:both;transform-origin:0% 0%}.cherry-lock-element__label *+*{margin-right:5px}.cherry-lock-element__label:after{border:solid;border-color:rgba(0,0,0,0.9) transparent;border-width:6px 6px 0 6px;bottom:-5px;margin-left:-6px;content:"";left:50%;position:absolute}@keyframes lock_show{0%{opacity:0;filter:blur(5px);transform:scale(0) translate(-50%, 200%)}60%{opacity:0.8;transform:scale(1.1) translate(-50%, -130%)}100%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}}@keyframes lock_hide{0%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}100%{opacity:0;filter:blur(3px);transform:scale(0) translate(-50%, 200%)}}.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}.cherry-checkbox-item{width:26px;height:26px;display:inline-block;border-radius:2px;margin-right:10px;margin-bottom:6px;cursor:pointer;position:relative;background-color:#f1f1f1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1)}.cherry-checkbox-item .marker{position:absolute;width:26px;height:26px;top:0px;left:0px;color:#fff;font-size:28px;-webkit-transition:inherit;transition:inherit;-webkit-transform:scale(0);transform:scale(0)}.cherry-checkbox-item .marker:before{-webkit-transition:inherit;transition:inherit;position:relative;left:-2px}.cherry-checkbox-input[checked]+.cherry-checkbox-item{background-color:#48c569}.cherry-checkbox-input[checked]+.cherry-checkbox-item .marker{-webkit-transform:scale(1);transform:scale(1)}.cherry-checkbox-label{display:inline-block;vertical-align:top;font-size:14px;line-height:26px;color:#23282d;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cherry-checkbox-label:focus{outline:1px solid rgba(41,143,252,0.6);box-shadow:0px 0px 2px rgba(41,143,252,0.6)}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-checkbox.scss CHANGED
@@ -1,5 +1,6 @@
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
 
3
 
4
  .cherry-ui-container{
5
  margin: 10px 0 20px 0;
@@ -40,11 +41,13 @@ label.cherry-label{
40
  }
41
  }
42
  }
43
- .cherry-checkbox-input[checked]{
44
- &+.cherry-checkbox-item{
45
- background-color: $green_color;
46
- .marker{
47
- transform: scale(1);
 
 
48
  }
49
  }
50
  }
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
3
+ @import "../../../../assets/sass/lock";
4
 
5
  .cherry-ui-container{
6
  margin: 10px 0 20px 0;
41
  }
42
  }
43
  }
44
+ .cherry-checkbox-input{
45
+ &[checked]{
46
+ &+.cherry-checkbox-item{
47
+ background-color: $green_color;
48
+ .marker{
49
+ transform: scale(1);
50
+ }
51
  }
52
  }
53
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/ui-checkbox.php CHANGED
@@ -46,6 +46,15 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
46
  'master' => '',
47
  );
48
 
 
 
 
 
 
 
 
 
 
49
  /**
50
  * Constructor method for the UI_Checkbox class.
51
  *
@@ -54,6 +63,7 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
54
  function __construct( $args = array() ) {
55
  $this->defaults_settings['id'] = 'cherry-ui-checkbox-' . uniqid();
56
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
 
57
 
58
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
59
  }
@@ -64,9 +74,14 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
64
  * @since 1.0.0
65
  */
66
  public function render() {
67
- $html = '';
68
- $class = $this->settings['class'];
69
- $class .= ' ' . $this->settings['master'];
 
 
 
 
 
70
 
71
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
72
 
@@ -80,6 +95,7 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
80
  }
81
 
82
  foreach ( $this->settings['options'] as $option => $option_value ) {
 
83
 
84
  if ( ! empty( $this->settings['value'] ) ) {
85
  $option_checked = array_key_exists( $option, $this->settings['value'] ) ? $option : '';
@@ -89,21 +105,25 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
89
  $item_value = 'false';
90
  }
91
 
92
- $checked = ( ! empty( $option_checked ) && 'true' === $item_value ) ? 'checked' : '';
93
-
94
  $option_label = isset( $option_value ) && is_array( $option_value ) ? $option_value['label'] : $option_value;
95
- $data_slave = isset( $option_value['slave'] ) && ! empty( $option_value['slave'] ) ? ' data-slave="' . $option_value['slave'] . '"' : '';
96
 
97
  $html .= '<div class="cherry-checkbox-item-wrap">';
98
- $html .= '<input type="hidden" id="' . esc_attr( $this->settings['id'] ) . '-' . $counter . '" class="cherry-checkbox-input" name="' . esc_attr( $this->settings['name'] ) . '[' . $option . ']" ' . $checked . ' value="' . esc_html( $item_value ) . '"' . $data_slave . '>';
99
- $html .= '<div class="cherry-checkbox-item"><span class="marker dashicons dashicons-yes"></span></div>';
100
- $html .= '<label class="cherry-checkbox-label" for="' . esc_attr( $this->settings['id'] ) . '-' . $counter . '">' . esc_html( $option_label ) . '</label> ';
 
 
 
 
 
101
  $html .= '</div>';
102
 
103
  $counter++;
104
  }
105
  }
106
- $html .= '</div>';
107
 
108
  return $html;
109
  }
@@ -115,18 +135,18 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
115
  */
116
  public static function enqueue_assets() {
117
  wp_enqueue_script(
118
- 'ui-checkbox-min',
119
- esc_url( Cherry_Core::base_url( 'assets/min/ui-checkbox.min.js', __FILE__ ) ),
120
  array( 'jquery' ),
121
- '1.3.2',
122
  true
123
  );
124
 
125
  wp_enqueue_style(
126
- 'ui-checkbox-min',
127
- esc_url( Cherry_Core::base_url( 'assets/min/ui-checkbox.min.css', __FILE__ ) ),
128
  array(),
129
- '1.3.2',
130
  'all'
131
  );
132
  }
46
  'master' => '',
47
  );
48
 
49
+ /**
50
+ * Instance of this Cherry5_Lock_Element class.
51
+ *
52
+ * @since 1.0.0
53
+ * @var object
54
+ * @access private
55
+ */
56
+ private $lock_element = null;
57
+
58
  /**
59
  * Constructor method for the UI_Checkbox class.
60
  *
63
  function __construct( $args = array() ) {
64
  $this->defaults_settings['id'] = 'cherry-ui-checkbox-' . uniqid();
65
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
66
+ $this->lock_element = new Cherry5_Lock_Element( $this->settings );
67
 
68
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
69
  }
74
  * @since 1.0.0
75
  */
76
  public function render() {
77
+ $html = '';
78
+ $class = implode( ' ',
79
+ array(
80
+ $this->settings['class'],
81
+ $this->settings['master'],
82
+ $this->lock_element->get_class( 'inline-block' ),
83
+ )
84
+ );
85
 
86
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
87
 
95
  }
96
 
97
  foreach ( $this->settings['options'] as $option => $option_value ) {
98
+ $lock_option = new Cherry5_Lock_Element( $option_value );
99
 
100
  if ( ! empty( $this->settings['value'] ) ) {
101
  $option_checked = array_key_exists( $option, $this->settings['value'] ) ? $option : '';
105
  $item_value = 'false';
106
  }
107
 
108
+ $checked = ( ! empty( $option_checked ) && 'true' === $item_value ) ? 'checked' : '';
 
109
  $option_label = isset( $option_value ) && is_array( $option_value ) ? $option_value['label'] : $option_value;
110
+ $data_slave = isset( $option_value['slave'] ) && ! empty( $option_value['slave'] ) ? ' data-slave="' . $option_value['slave'] . '"' : '';
111
 
112
  $html .= '<div class="cherry-checkbox-item-wrap">';
113
+ $html .= '<span class="' . $lock_option->get_class( 'inline-block' ) . '"">';
114
+ $html .= '<span class="cherry-lable-content">';
115
+ $html .= '<input type="hidden" id="' . esc_attr( $this->settings['id'] ) . '-' . $counter . '" class="cherry-checkbox-input" name="' . esc_attr( $this->settings['name'] ) . '[' . $option . ']" ' . $checked . ' value="' . esc_html( $item_value ) . '"' . $data_slave . $lock_option->get_disabled_attr() . '>';
116
+ $html .= '<div class="cherry-checkbox-item"><span class="marker dashicons dashicons-yes"></span></div>';
117
+ $html .= '<label class="cherry-checkbox-label" for="' . esc_attr( $this->settings['id'] ) . '-' . $counter . '"><span class="cherry-lable-content">' . esc_html( $option_label ) . '</span></label> ';
118
+ $html .= '</span>';
119
+ $html .= $lock_option->get_html();
120
+ $html .= '</span>';
121
  $html .= '</div>';
122
 
123
  $counter++;
124
  }
125
  }
126
+ $html .= $this->lock_element->get_html() . '</div>';
127
 
128
  return $html;
129
  }
135
  */
136
  public static function enqueue_assets() {
137
  wp_enqueue_script(
138
+ 'ui-checkbox',
139
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.js', Cherry_UI_Elements::$module_path ) ),
140
  array( 'jquery' ),
141
+ Cherry_UI_Elements::$core_version,
142
  true
143
  );
144
 
145
  wp_enqueue_style(
146
+ 'ui-checkbox',
147
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.css', Cherry_UI_Elements::$module_path ) ),
148
  array(),
149
+ Cherry_UI_Elements::$core_version,
150
  'all'
151
  );
152
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/min/ui-colorpicker.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-colorpicker-wrapper{background-color:#f1f1f1;padding:5px;max-width:230px;height:46px;box-sizing:border-box}.cherry-ui-colorpicker-wrapper .wp-picker-container,.customize-control-content .wp-picker-container{display:block;position:relative;z-index:1000}.cherry-ui-colorpicker-wrapper .wp-picker-container:active,.customize-control-content .wp-picker-container:active{display:block}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result,.customize-control-content .wp-picker-container>.wp-color-result{margin:0;border-radius:2px;display:block;border:none;box-shadow:none;height:auto;padding-left:35px}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result:after,.customize-control-content .wp-picker-container>.wp-color-result:after{padding:7px 0px;font-size:14px;border-left:none}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result:focus,.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result:active,.customize-control-content .wp-picker-container>.wp-color-result:focus,.customize-control-content .wp-picker-container>.wp-color-result:active{outline:none;border:1px solid rgba(41,143,252,0.6);box-shadow:0px 0px 2px rgba(41,143,252,0.6)}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap,.customize-control-content .wp-picker-container>.wp-picker-input-wrap{display:none;display:-webkit-box;display:-ms-flexbox;display:flex;width:calc(100% - 40px);max-width:calc(100% - 40px);float:right}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap:after,.customize-control-content .wp-picker-container>.wp-picker-input-wrap:after{content:'.';clear:both;visibility:hidden;height:0}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap input[type="text"],.customize-control-content .wp-picker-container>.wp-picker-input-wrap input[type="text"]{padding:8px 10px 9px;font-size:14px;max-width:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap input[type="button"],.customize-control-content .wp-picker-container>.wp-picker-input-wrap input[type="button"]{height:auto;border:none;border-radius:2px;box-shadow:none;padding:6px 10px 7px;font-size:14px;margin-left:5px;-ms-flex-negative:0;flex-shrink:0}.cherry-ui-colorpicker-wrapper .wp-picker-container.wp-picker-active>.wp-color-result,.customize-control-content .wp-picker-container.wp-picker-active>.wp-color-result{height:35px;width:0;display:inline-block;margin-right:5px}.cherry-ui-colorpicker-wrapper .wp-picker-container.wp-picker-active>.wp-color-result:after,.customize-control-content .wp-picker-container.wp-picker-active>.wp-color-result:after{display:none}.cherry-ui-colorpicker-wrapper .wp-picker-container.wp-picker-active>.wp-picker-input-wrap,.customize-control-content .wp-picker-container.wp-picker-active>.wp-picker-input-wrap{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}
1
+ .cherry-lock-element{user-select:none;cursor:no-drop;position:relative;filter:grayscale(100%)}.cherry-lock-element.inline-block{display:inline-block}.cherry-lock-element label{position:relative}.cherry-lock-element .cherry-lable-content,.cherry-lock-element .cherry-checkbox-item,.cherry-lock-element .select2-container,.cherry-lock-element>*:first-child{opacity:0.5;pointer-events:none}.cherry-lock-element a.cherry-lock-element__area{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2000;cursor:no-drop}.cherry-lock-element a.cherry-lock-element__area:focus{outline:none;box-shadow:none}.cherry-lock-element a.cherry-lock-element__area:hover .cherry-lock-element__label{animation-name:lock_show;animation-duration:450ms;animation-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1)}.cherry-lock-element__label{opacity:0;display:inline-block;background-color:rgba(0,0,0,0.9);border-radius:5px;color:#fff;padding:8px 10px;position:absolute;white-space:nowrap;top:-10px;left:50%;box-shadow:2px 2px 5px 0px rgba(0,0,0,0.5);will-change:auto;pointer-events:none;font-size:14px;line-height:16px;animation-name:lock_hide;animation-duration:200ms;animation-timing-function:cubic-bezier(0.55, 0.055, 0.675, 0.19);animation-fill-mode:both;transform-origin:0% 0%}.cherry-lock-element__label *+*{margin-right:5px}.cherry-lock-element__label:after{border:solid;border-color:rgba(0,0,0,0.9) transparent;border-width:6px 6px 0 6px;bottom:-5px;margin-left:-6px;content:"";left:50%;position:absolute}@keyframes lock_show{0%{opacity:0;filter:blur(5px);transform:scale(0) translate(-50%, 200%)}60%{opacity:0.8;transform:scale(1.1) translate(-50%, -130%)}100%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}}@keyframes lock_hide{0%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}100%{opacity:0;filter:blur(3px);transform:scale(0) translate(-50%, 200%)}}.cherry-ui-elements-lock{opacity:0.5;cursor:no-drop;pointer-events:none;-webkit-filter:grayscale(100%);filter:grayscale(100%)}.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-colorpicker-wrapper{background-color:#f1f1f1;padding:5px;max-width:230px;height:46px;box-sizing:border-box}.cherry-ui-colorpicker-wrapper .wp-picker-container,.customize-control-content .wp-picker-container{display:block;position:relative;z-index:1000}.cherry-ui-colorpicker-wrapper .wp-picker-container:active,.customize-control-content .wp-picker-container:active{display:block}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result,.customize-control-content .wp-picker-container>.wp-color-result{margin:0;border-radius:2px;display:block;border:none;box-shadow:none;height:auto;padding-left:35px}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result:after,.customize-control-content .wp-picker-container>.wp-color-result:after{padding:7px 0px;font-size:14px;border-left:none}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result:focus,.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-color-result:active,.customize-control-content .wp-picker-container>.wp-color-result:focus,.customize-control-content .wp-picker-container>.wp-color-result:active{outline:none;border:1px solid rgba(41,143,252,0.6);box-shadow:0px 0px 2px rgba(41,143,252,0.6)}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap,.customize-control-content .wp-picker-container>.wp-picker-input-wrap{display:none;display:-webkit-box;display:-ms-flexbox;display:flex;width:calc(100% - 40px);max-width:calc(100% - 40px);float:right}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap:after,.customize-control-content .wp-picker-container>.wp-picker-input-wrap:after{content:'.';clear:both;visibility:hidden;height:0}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap input[type="text"],.customize-control-content .wp-picker-container>.wp-picker-input-wrap input[type="text"]{padding:8px 10px 9px;font-size:14px;max-width:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.cherry-ui-colorpicker-wrapper .wp-picker-container>.wp-picker-input-wrap input[type="button"],.customize-control-content .wp-picker-container>.wp-picker-input-wrap input[type="button"]{height:auto;border:none;border-radius:2px;box-shadow:none;padding:6px 10px 7px;font-size:14px;margin-left:5px;-ms-flex-negative:0;flex-shrink:0}.cherry-ui-colorpicker-wrapper .wp-picker-container.wp-picker-active>.wp-color-result,.customize-control-content .wp-picker-container.wp-picker-active>.wp-color-result{height:35px;width:0;display:inline-block;margin-right:5px}.cherry-ui-colorpicker-wrapper .wp-picker-container.wp-picker-active>.wp-color-result:after,.customize-control-content .wp-picker-container.wp-picker-active>.wp-color-result:after{display:none}.cherry-ui-colorpicker-wrapper .wp-picker-container.wp-picker-active>.wp-picker-input-wrap,.customize-control-content .wp-picker-container.wp-picker-active>.wp-picker-input-wrap{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-colorpicker.scss CHANGED
@@ -1,8 +1,14 @@
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
 
3
 
4
  $font_size: 14px;
5
-
 
 
 
 
 
6
  .cherry-ui-container{
7
  margin: 10px 0 20px 0;
8
  }
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
3
+ @import "../../../../assets/sass/lock";
4
 
5
  $font_size: 14px;
6
+ .cherry-ui-elements-lock{
7
+ opacity: 0.5;
8
+ cursor: no-drop;
9
+ pointer-events: none;
10
+ filter: grayscale( 100% );
11
+ }
12
  .cherry-ui-container{
13
  margin: 10px 0 20px 0;
14
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/ui-colorpicker.php CHANGED
@@ -35,8 +35,18 @@ if ( ! class_exists( 'UI_Colorpicker' ) ) {
35
  'label' => '',
36
  'class' => '',
37
  'master' => '',
 
38
  );
39
 
 
 
 
 
 
 
 
 
 
40
  /**
41
  * Constructor method for the UI_Colorpicker class.
42
  *
@@ -45,6 +55,7 @@ if ( ! class_exists( 'UI_Colorpicker' ) ) {
45
  function __construct( $args = array() ) {
46
  $this->defaults_settings['id'] = 'cherry-ui-colorpicker-' . uniqid();
47
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
 
48
 
49
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
50
  }
@@ -56,15 +67,20 @@ if ( ! class_exists( 'UI_Colorpicker' ) ) {
56
  */
57
  public function render() {
58
  $html = '';
59
- $class = $this->settings['class'];
60
- $class .= ' ' . $this->settings['master'];
 
 
 
 
61
 
62
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
63
  if ( '' !== $this->settings['label'] ) {
64
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
65
  }
66
- $html .= '<div class="cherry-ui-colorpicker-wrapper">';
67
- $html .= '<input type="text" id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-ui-colorpicker" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '"/>';
 
68
  $html .= '</div>';
69
  $html .= '</div>';
70
 
@@ -79,18 +95,18 @@ if ( ! class_exists( 'UI_Colorpicker' ) ) {
79
  public static function enqueue_assets() {
80
 
81
  wp_enqueue_script(
82
- 'ui-colorpicker-min',
83
- esc_url( Cherry_Core::base_url( 'assets/min/ui-colorpicker.min.js', __FILE__ ) ),
84
  array( 'jquery', 'wp-color-picker' ),
85
- '1.3.2',
86
  true
87
  );
88
 
89
  wp_enqueue_style(
90
- 'ui-colorpicker-min',
91
- esc_url( Cherry_Core::base_url( 'assets/min/ui-colorpicker.min.css', __FILE__ ) ),
92
  array( 'wp-color-picker' ),
93
- '1.3.2',
94
  'all'
95
  );
96
  }
35
  'label' => '',
36
  'class' => '',
37
  'master' => '',
38
+ 'lock' => false,
39
  );
40
 
41
+ /**
42
+ * Instance of this Cherry5_Lock_Element class.
43
+ *
44
+ * @since 1.0.0
45
+ * @var object
46
+ * @access private
47
+ */
48
+ private $lock_element = null;
49
+
50
  /**
51
  * Constructor method for the UI_Colorpicker class.
52
  *
55
  function __construct( $args = array() ) {
56
  $this->defaults_settings['id'] = 'cherry-ui-colorpicker-' . uniqid();
57
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
58
+ $this->lock_element = new Cherry5_Lock_Element( $this->settings );
59
 
60
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
61
  }
67
  */
68
  public function render() {
69
  $html = '';
70
+ $class = implode( ' ',
71
+ array(
72
+ $this->settings['class'],
73
+ $this->settings['master'],
74
+ )
75
+ );
76
 
77
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
78
  if ( '' !== $this->settings['label'] ) {
79
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
80
  }
81
+ $html .= '<div class="cherry-ui-colorpicker-wrapper' . $this->lock_element->get_class() .'">';
82
+ $html .= '<input type="text" id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-ui-colorpicker" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '"' . $this->lock_element->get_disabled_attr() . '/>';
83
+ $html .= $this->lock_element->get_html();
84
  $html .= '</div>';
85
  $html .= '</div>';
86
 
95
  public static function enqueue_assets() {
96
 
97
  wp_enqueue_script(
98
+ 'ui-colorpicker',
99
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-colorpicker/assets/min/ui-colorpicker.min.js', Cherry_UI_Elements::$module_path ) ),
100
  array( 'jquery', 'wp-color-picker' ),
101
+ Cherry_UI_Elements::$core_version,
102
  true
103
  );
104
 
105
  wp_enqueue_style(
106
+ 'ui-colorpicker',
107
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-colorpicker/assets/min/ui-colorpicker.min.css', Cherry_UI_Elements::$module_path ) ),
108
  array( 'wp-color-picker' ),
109
+ Cherry_UI_Elements::$core_version,
110
  'all'
111
  );
112
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/min/ui-iconpicker.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-iconpicker-group{position:relative}.full .cherry-ui-iconpicker-group{max-width:100%}.fixed .cherry-ui-iconpicker-group{max-width:230px}.cherry-ui-iconpicker-group .input-group-addon{position:absolute;width:36px;height:36px;left:0px;top:0px;background:#f1f1f1;font-size:14px;line-height:36px;text-align:center;border-radius:3px 0 0 3px;border-right:1px solid #dddcdc;margin:7px}.cherry-ui-iconpicker-group .input-group-addon .fa{line-height:36px}.cherry-ui-iconpicker-group .cherry-ui-text{font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #f1f1f1;box-shadow:none;padding-left:60px}.cherry-ui-iconpicker-group .cherry-ui-text:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}.iconpicker-popover.popover{position:absolute;top:0;left:0;display:none;max-width:none;padding:1px;text-align:left;width:242px;background:#f0f0f0;z-index:999}.iconpicker-popover.popover.top,.iconpicker-popover.popover.topLeftCorner,.iconpicker-popover.popover.topLeft,.iconpicker-popover.popover.topRight,.iconpicker-popover.popover.topRightCorner{margin-top:-10px}.iconpicker-popover.popover.right,.iconpicker-popover.popover.rightTop,.iconpicker-popover.popover.rightBottom{margin-left:10px}.iconpicker-popover.popover.bottom,.iconpicker-popover.popover.bottomRightCorner,.iconpicker-popover.popover.bottomRight,.iconpicker-popover.popover.bottomLeft,.iconpicker-popover.popover.bottomLeftCorner{margin-top:10px}.iconpicker-popover.popover.left,.iconpicker-popover.popover.leftBottom,.iconpicker-popover.popover.leftTop{margin-left:-10px}.iconpicker-popover.popover.inline{margin:0 0 14px 0;position:relative;display:inline-block;opacity:1;top:auto;left:auto;bottom:auto;right:auto;max-width:100%;box-shadow:none;z-index:auto;vertical-align:top}.iconpicker-popover.popover.inline>.arrow{display:none}.dropdown-menu .iconpicker-popover.inline{margin:0;border:none}.dropdown-menu.iconpicker-container{padding:0}.iconpicker-popover.popover .popover-title{padding:14px;font-size:14px;line-height:16px;border-bottom:1px solid #ebebeb;background-color:#f0f0f0}.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search{margin:0 0 2px 0}.iconpicker-popover.popover .popover-title-text ~ input[type=search].iconpicker-search{margin-top:14px}.iconpicker-popover.popover .popover-content{padding:0px;text-align:center}.iconpicker-popover .popover-footer{float:none;clear:both;padding:14px;text-align:right;margin:0;border-top:1px solid #ebebeb;background-color:#f0f0f0}.iconpicker-popover .popover-footer:before,.iconpicker-popover .popover-footer:after{content:" ";display:table}.iconpicker-popover .popover-footer:after{clear:both}.iconpicker-popover .popover-footer .iconpicker-btn{margin-left:10px}.iconpicker-popover .popover-footer input[type=search].iconpicker-search{margin-bottom:14px}.iconpicker-popover.popover>.arrow,.iconpicker-popover.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.iconpicker-popover.popover>.arrow{border-width:11px}.iconpicker-popover.popover>.arrow:after{border-width:10px;content:""}.iconpicker-popover.popover.top>.arrow,.iconpicker-popover.popover.topLeft>.arrow,.iconpicker-popover.popover.topRight>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#f0f0f0;bottom:-11px}.iconpicker-popover.popover.top>.arrow:after,.iconpicker-popover.popover.topLeft>.arrow:after,.iconpicker-popover.popover.topRight>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#ffffff}.iconpicker-popover.popover.topLeft>.arrow{left:14px;margin-left:0}.iconpicker-popover.popover.topRight>.arrow{left:auto;right:14px;margin-left:0}.iconpicker-popover.popover.right>.arrow,.iconpicker-popover.popover.rightTop>.arrow,.iconpicker-popover.popover.rightBottom>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#f0f0f0}.iconpicker-popover.popover.right>.arrow:after,.iconpicker-popover.popover.rightTop>.arrow:after,.iconpicker-popover.popover.rightBottom>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#ffffff}.iconpicker-popover.popover.rightTop>.arrow{top:auto;bottom:14px;margin-top:0}.iconpicker-popover.popover.rightBottom>.arrow{top:14px;margin-top:0}.iconpicker-popover.popover.bottom>.arrow,.iconpicker-popover.popover.bottomRight>.arrow,.iconpicker-popover.popover.bottomLeft>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#f0f0f0;top:-11px}.iconpicker-popover.popover.bottom>.arrow:after,.iconpicker-popover.popover.bottomRight>.arrow:after,.iconpicker-popover.popover.bottomLeft>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#f0f0f0}.iconpicker-popover.popover.bottomLeft>.arrow{left:14px;margin-left:0}.iconpicker-popover.popover.bottomRight>.arrow{left:auto;right:14px;margin-left:0}.iconpicker-popover.popover.left>.arrow,.iconpicker-popover.popover.leftBottom>.arrow,.iconpicker-popover.popover.leftTop>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#f0f0f0}.iconpicker-popover.popover.left>.arrow:after,.iconpicker-popover.popover.leftBottom>.arrow:after,.iconpicker-popover.popover.leftTop>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#ffffff;bottom:-10px}.iconpicker-popover.popover.leftBottom>.arrow{top:14px;margin-top:0}.iconpicker-popover.popover.leftTop>.arrow{top:auto;bottom:14px;margin-top:0}.iconpicker{position:relative;text-align:left;text-shadow:none;line-height:0;display:block;margin:0;overflow:hidden}.iconpicker *{box-sizing:content-box;position:relative}.iconpicker:before,.iconpicker:after{content:" ";display:table}.iconpicker:after{clear:both}.iconpicker .iconpicker-items{position:relative;clear:both;float:none;padding:10px 0 0 10px;background:#fff;margin:0;overflow:hidden;overflow-y:auto;min-height:55px;max-height:275px}.iconpicker .iconpicker-items:before,.iconpicker .iconpicker-items:after{content:" ";display:table}.iconpicker .iconpicker-items:after{clear:both}.iconpicker .iconpicker-item{float:left;width:28px;height:28px;line-height:28px;margin:0 7px 7px 0;text-align:center;cursor:pointer;border-radius:3px;font-size:18px;color:#444;box-shadow:0 0 0 1px #dddddd}.iconpicker .iconpicker-item .fa{line-height:28px}.iconpicker .iconpicker-item:hover:not(.iconpicker-selected){background-color:#eeeeee}.iconpicker .iconpicker-item.iconpicker-selected{box-shadow:none;background:#ddd}.iconpicker-component{cursor:pointer}
1
+ .cherry-lock-element{user-select:none;cursor:no-drop;position:relative;filter:grayscale(100%)}.cherry-lock-element.inline-block{display:inline-block}.cherry-lock-element label{position:relative}.cherry-lock-element .cherry-lable-content,.cherry-lock-element .cherry-checkbox-item,.cherry-lock-element .select2-container,.cherry-lock-element>*:first-child{opacity:0.5;pointer-events:none}.cherry-lock-element a.cherry-lock-element__area{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2000;cursor:no-drop}.cherry-lock-element a.cherry-lock-element__area:focus{outline:none;box-shadow:none}.cherry-lock-element a.cherry-lock-element__area:hover .cherry-lock-element__label{animation-name:lock_show;animation-duration:450ms;animation-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1)}.cherry-lock-element__label{opacity:0;display:inline-block;background-color:rgba(0,0,0,0.9);border-radius:5px;color:#fff;padding:8px 10px;position:absolute;white-space:nowrap;top:-10px;left:50%;box-shadow:2px 2px 5px 0px rgba(0,0,0,0.5);will-change:auto;pointer-events:none;font-size:14px;line-height:16px;animation-name:lock_hide;animation-duration:200ms;animation-timing-function:cubic-bezier(0.55, 0.055, 0.675, 0.19);animation-fill-mode:both;transform-origin:0% 0%}.cherry-lock-element__label *+*{margin-right:5px}.cherry-lock-element__label:after{border:solid;border-color:rgba(0,0,0,0.9) transparent;border-width:6px 6px 0 6px;bottom:-5px;margin-left:-6px;content:"";left:50%;position:absolute}@keyframes lock_show{0%{opacity:0;filter:blur(5px);transform:scale(0) translate(-50%, 200%)}60%{opacity:0.8;transform:scale(1.1) translate(-50%, -130%)}100%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}}@keyframes lock_hide{0%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}100%{opacity:0;filter:blur(3px);transform:scale(0) translate(-50%, 200%)}}.cherry-ui-elements-lock{opacity:0.5;cursor:no-drop;pointer-events:none;-webkit-filter:grayscale(100%);filter:grayscale(100%)}.cherry-ui-iconpicker-group{position:relative}.full .cherry-ui-iconpicker-group{max-width:100%}.fixed .cherry-ui-iconpicker-group{max-width:230px}.cherry-ui-iconpicker-group .input-group-addon{position:absolute;width:36px;height:36px;left:0px;top:0px;background:#f1f1f1;font-size:14px;line-height:36px;text-align:center;border-radius:3px 0 0 3px;border-right:1px solid #dddcdc;margin:7px}.cherry-ui-iconpicker-group .input-group-addon .fa{line-height:36px}.cherry-ui-iconpicker-group .cherry-ui-text{font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #f1f1f1;box-shadow:none;padding-left:60px}.cherry-ui-iconpicker-group .cherry-ui-text:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}.iconpicker-popover.popover{position:absolute;top:0;left:0;display:none;max-width:none;padding:1px;text-align:left;width:242px;background:#f0f0f0;z-index:999}.iconpicker-popover.popover.top,.iconpicker-popover.popover.topLeftCorner,.iconpicker-popover.popover.topLeft,.iconpicker-popover.popover.topRight,.iconpicker-popover.popover.topRightCorner{margin-top:-10px}.iconpicker-popover.popover.right,.iconpicker-popover.popover.rightTop,.iconpicker-popover.popover.rightBottom{margin-left:10px}.iconpicker-popover.popover.bottom,.iconpicker-popover.popover.bottomRightCorner,.iconpicker-popover.popover.bottomRight,.iconpicker-popover.popover.bottomLeft,.iconpicker-popover.popover.bottomLeftCorner{margin-top:10px}.iconpicker-popover.popover.left,.iconpicker-popover.popover.leftBottom,.iconpicker-popover.popover.leftTop{margin-left:-10px}.iconpicker-popover.popover.inline{margin:0 0 14px 0;position:relative;display:inline-block;opacity:1;top:auto;left:auto;bottom:auto;right:auto;max-width:100%;box-shadow:none;z-index:auto;vertical-align:top}.iconpicker-popover.popover.inline>.arrow{display:none}.dropdown-menu .iconpicker-popover.inline{margin:0;border:none}.dropdown-menu.iconpicker-container{padding:0}.iconpicker-popover.popover .popover-title{padding:14px;font-size:14px;line-height:16px;border-bottom:1px solid #ebebeb;background-color:#f0f0f0}.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search{margin:0 0 2px 0}.iconpicker-popover.popover .popover-title-text ~ input[type=search].iconpicker-search{margin-top:14px}.iconpicker-popover.popover .popover-content{padding:0px;text-align:center}.iconpicker-popover .popover-footer{float:none;clear:both;padding:14px;text-align:right;margin:0;border-top:1px solid #ebebeb;background-color:#f0f0f0}.iconpicker-popover .popover-footer:before,.iconpicker-popover .popover-footer:after{content:" ";display:table}.iconpicker-popover .popover-footer:after{clear:both}.iconpicker-popover .popover-footer .iconpicker-btn{margin-left:10px}.iconpicker-popover .popover-footer input[type=search].iconpicker-search{margin-bottom:14px}.iconpicker-popover.popover>.arrow,.iconpicker-popover.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.iconpicker-popover.popover>.arrow{border-width:11px}.iconpicker-popover.popover>.arrow:after{border-width:10px;content:""}.iconpicker-popover.popover.top>.arrow,.iconpicker-popover.popover.topLeft>.arrow,.iconpicker-popover.popover.topRight>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#f0f0f0;bottom:-11px}.iconpicker-popover.popover.top>.arrow:after,.iconpicker-popover.popover.topLeft>.arrow:after,.iconpicker-popover.popover.topRight>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#ffffff}.iconpicker-popover.popover.topLeft>.arrow{left:14px;margin-left:0}.iconpicker-popover.popover.topRight>.arrow{left:auto;right:14px;margin-left:0}.iconpicker-popover.popover.right>.arrow,.iconpicker-popover.popover.rightTop>.arrow,.iconpicker-popover.popover.rightBottom>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#f0f0f0}.iconpicker-popover.popover.right>.arrow:after,.iconpicker-popover.popover.rightTop>.arrow:after,.iconpicker-popover.popover.rightBottom>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#ffffff}.iconpicker-popover.popover.rightTop>.arrow{top:auto;bottom:14px;margin-top:0}.iconpicker-popover.popover.rightBottom>.arrow{top:14px;margin-top:0}.iconpicker-popover.popover.bottom>.arrow,.iconpicker-popover.popover.bottomRight>.arrow,.iconpicker-popover.popover.bottomLeft>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#f0f0f0;top:-11px}.iconpicker-popover.popover.bottom>.arrow:after,.iconpicker-popover.popover.bottomRight>.arrow:after,.iconpicker-popover.popover.bottomLeft>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#f0f0f0}.iconpicker-popover.popover.bottomLeft>.arrow{left:14px;margin-left:0}.iconpicker-popover.popover.bottomRight>.arrow{left:auto;right:14px;margin-left:0}.iconpicker-popover.popover.left>.arrow,.iconpicker-popover.popover.leftBottom>.arrow,.iconpicker-popover.popover.leftTop>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#f0f0f0}.iconpicker-popover.popover.left>.arrow:after,.iconpicker-popover.popover.leftBottom>.arrow:after,.iconpicker-popover.popover.leftTop>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#ffffff;bottom:-10px}.iconpicker-popover.popover.leftBottom>.arrow{top:14px;margin-top:0}.iconpicker-popover.popover.leftTop>.arrow{top:auto;bottom:14px;margin-top:0}.iconpicker{position:relative;text-align:left;text-shadow:none;line-height:0;display:block;margin:0;overflow:hidden}.iconpicker *{box-sizing:content-box;position:relative}.iconpicker:before,.iconpicker:after{content:" ";display:table}.iconpicker:after{clear:both}.iconpicker .iconpicker-items{position:relative;clear:both;float:none;padding:10px 0 0 10px;background:#fff;margin:0;overflow:hidden;overflow-y:auto;min-height:55px;max-height:275px}.iconpicker .iconpicker-items:before,.iconpicker .iconpicker-items:after{content:" ";display:table}.iconpicker .iconpicker-items:after{clear:both}.iconpicker .iconpicker-item{float:left;width:28px;height:28px;line-height:28px;margin:0 7px 7px 0;text-align:center;cursor:pointer;border-radius:3px;font-size:18px;color:#444;box-shadow:0 0 0 1px #dddddd}.iconpicker .iconpicker-item .fa{line-height:28px}.iconpicker .iconpicker-item:hover:not(.iconpicker-selected){background-color:#eeeeee}.iconpicker .iconpicker-item.iconpicker-selected{box-shadow:none;background:#ddd}.iconpicker-component{cursor:pointer}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-iconpicker.scss CHANGED
@@ -1,5 +1,13 @@
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
 
 
 
 
 
 
 
 
3
 
4
  .cherry-ui-iconpicker-group {
5
  position: relative;
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
3
+ @import "../../../../assets/sass/lock";
4
+
5
+ .cherry-ui-elements-lock{
6
+ opacity: 0.5;
7
+ cursor: no-drop;
8
+ pointer-events: none;
9
+ filter: grayscale( 100% );
10
+ }
11
 
12
  .cherry-ui-iconpicker-group {
13
  position: relative;
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/ui-iconpicker.php CHANGED
@@ -41,8 +41,19 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
41
  'master' => '',
42
  'width' => 'fixed', // full, fixed
43
  'required' => false,
 
44
  );
45
 
 
 
 
 
 
 
 
 
 
 
46
  /**
47
  * Default icon data settings.
48
  *
@@ -77,6 +88,8 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
77
  */
78
  public static $printed_sets = array();
79
 
 
 
80
  /**
81
  * Constructor method for the UI_Iconpicker class.
82
  *
@@ -85,6 +98,7 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
85
  function __construct( $args = array() ) {
86
  $this->defaults_settings['id'] = 'cherry-ui-input-icon-' . uniqid();
87
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
 
88
 
89
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
90
  add_action( 'admin_footer', array( $this, 'print_icon_set' ), 1 );
@@ -110,9 +124,16 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
110
  * @since 1.0.0
111
  */
112
  public function render() {
113
- $html = '';
114
- $class = $this->settings['class'] . $this->settings['width'] ;
115
- $class .= ' ' . $this->settings['master'];
 
 
 
 
 
 
 
116
 
117
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
118
  if ( '' !== $this->settings['label'] ) {
@@ -133,11 +154,47 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
133
  }
134
 
135
  $html .= '</div>';
 
136
  $html .= '</div>';
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  return $html;
139
  }
140
 
 
 
 
 
 
 
 
 
 
 
 
141
  /**
142
  * Returns iconpicker html markup
143
  *
@@ -294,25 +351,25 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
294
 
295
  wp_enqueue_style(
296
  'ui-iconpicker',
297
- esc_url( Cherry_Core::base_url( 'assets/min/ui-iconpicker.min.css', __FILE__ ) ),
298
  array(),
299
- '1.3.2',
300
  'all'
301
  );
302
 
303
  wp_enqueue_script(
304
  'jquery-iconpicker',
305
- esc_url( Cherry_Core::base_url( 'assets/min/jquery-iconpicker.min.js', __FILE__ ) ),
306
  array( 'jquery' ),
307
- '1.3.2',
308
  true
309
  );
310
 
311
  wp_enqueue_script(
312
  'ui-iconpicker',
313
- esc_url( Cherry_Core::base_url( 'assets/min/ui-iconpicker.min.js', __FILE__ ) ),
314
  array( 'jquery' ),
315
- '1.3.2',
316
  true
317
  );
318
  }
41
  'master' => '',
42
  'width' => 'fixed', // full, fixed
43
  'required' => false,
44
+ 'lock' => false,
45
  );
46
 
47
+ /**
48
+ * Instance of this Cherry5_Lock_Element class.
49
+ *
50
+ * @since 1.0.0
51
+ * @var object
52
+ * @access private
53
+ */
54
+ private $lock_element = null;
55
+
56
+
57
  /**
58
  * Default icon data settings.
59
  *
88
  */
89
  public static $printed_sets = array();
90
 
91
+ public $temp_icons = null;
92
+
93
  /**
94
  * Constructor method for the UI_Iconpicker class.
95
  *
98
  function __construct( $args = array() ) {
99
  $this->defaults_settings['id'] = 'cherry-ui-input-icon-' . uniqid();
100
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
101
+ $this->lock_element = new Cherry5_Lock_Element( $this->settings );
102
 
103
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
104
  add_action( 'admin_footer', array( $this, 'print_icon_set' ), 1 );
124
  * @since 1.0.0
125
  */
126
  public function render() {
127
+ $html = '';
128
+ $lock_lable = ! empty( $this->settings['lock']['label'] )? sprintf('<div class="cherry-lock-label">%1$s</div>', $this->settings['lock']['label'] ) : '' ;
129
+ $class = implode( ' ',
130
+ array(
131
+ $this->settings['class'],
132
+ $this->settings['master'],
133
+ $this->settings['width'],
134
+ $this->lock_element->get_class( 'inline-block' ),
135
+ )
136
+ );
137
 
138
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
139
  if ( '' !== $this->settings['label'] ) {
154
  }
155
 
156
  $html .= '</div>';
157
+ $html .= $this->lock_element->get_html();
158
  $html .= '</div>';
159
 
160
+ /**
161
+ * Maybe add js repeater template to response
162
+ *
163
+ * @var bool
164
+ */
165
+ $add_js_to_response = apply_filters( 'cherry_ui_add_data_to_element', false );
166
+
167
+ if ( $add_js_to_response ) {
168
+
169
+ ob_start();
170
+ $this->print_icon_set();
171
+ $icons = ob_get_clean();
172
+
173
+ $in_repeater = apply_filters( 'cherry_ui_is_repeater', false );
174
+
175
+ if ( $in_repeater ) {
176
+ $this->temp_icons = $icons;
177
+ add_filter( 'cherry_ui_add_repater_data', array( $this, 'store_icons' ) );
178
+ } else {
179
+ $html .= $icons;
180
+ }
181
+
182
+ }
183
+
184
  return $html;
185
  }
186
 
187
+ public function store_icons( $data = array() ) {
188
+
189
+ if ( ! is_array( $data ) ) {
190
+ $data = array();
191
+ }
192
+
193
+ $data[] = $this->temp_icons;
194
+
195
+ return $data;
196
+ }
197
+
198
  /**
199
  * Returns iconpicker html markup
200
  *
351
 
352
  wp_enqueue_style(
353
  'ui-iconpicker',
354
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-iconpicker/assets/min/ui-iconpicker.min.css', Cherry_UI_Elements::$module_path ) ),
355
  array(),
356
+ Cherry_UI_Elements::$core_version,
357
  'all'
358
  );
359
 
360
  wp_enqueue_script(
361
  'jquery-iconpicker',
362
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-iconpicker/assets/min/jquery-iconpicker.min.js', Cherry_UI_Elements::$module_path ) ),
363
  array( 'jquery' ),
364
+ Cherry_UI_Elements::$core_version,
365
  true
366
  );
367
 
368
  wp_enqueue_script(
369
  'ui-iconpicker',
370
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-iconpicker/assets/min/ui-iconpicker.min.js', Cherry_UI_Elements::$module_path ) ),
371
  array( 'jquery' ),
372
+ Cherry_UI_Elements::$core_version,
373
  true
374
  );
375
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/min/ui-media.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-media-wrap .cherry-upload-preview{display:block;margin:0 0 5px 0}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap{position:relative;display:inline-block;vertical-align:top;width:120px;height:120px}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner{width:110px;height:110px;margin:3px;position:relative;border:2px solid #298ffc;border-radius:2px;overflow:hidden}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder{width:100%;height:100%;position:relative;background:#f1f1f1;box-sizing:border-box}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder .centered{position:absolute;width:100%;height:100%;top:0;left:0;-webkit-transform:translate(50%, 50%);transform:translate(50%, 50%)}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder img{max-width:100%;height:auto;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder span{width:auto;height:auto;font-size:60px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .title{position:absolute;width:100%;padding:5px 0;bottom:0;left:0;color:#fff;background:rgba(41,143,252,0.8);text-align:center;font-size:11px;overflow:hidden}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap:hover .cherry-remove-image{display:block}.cherry-ui-media-wrap .cherry-upload-preview .cherry-media-thumb-sortable-placeholder{width:112px;height:112px;margin:3px;vertical-align:top;border:1px dashed #dcdcdc;display:inline-block;background-color:#f1f1f1}.cherry-ui-media-wrap .upload-button{float:left}.cherry-ui-media-wrap .cherry-remove-image{width:30px;height:30px;color:#e54343;display:block;position:absolute;top:0;right:0;cursor:pointer;text-decoration:none;outline:0;display:none}.cherry-ui-media-wrap .cherry-remove-image i{width:30px;height:30px;font-size:30px}.cherry-ui-media-wrap .cherry-remove-image:hover{color:#d71e1e}.cherry-ui-media-wrap .cherry-bgsetting{float:left;width:32%;margin-right:1%}.cherry-ui-media-wrap .cherry-bgsetting:nth-child(3n+1){width:34%;margin-right:0}.cherry-ui-media-wrap .cherry-bgsetting select{margin-bottom:10px}.button-default_{position:relative;display:inline-block;font-size:12px;line-height:18px;font-weight:900;letter-spacing:0.5px;text-decoration:none;padding:15px 20px;color:#23282d;text-transform:uppercase;border-radius:4px;border-width:1px;border-style:solid;outline:none;cursor:pointer;transition:all 200ms linear;color:#fff;border-color:#777879 #2f343a #2f343a #777879;background-color:#495159}.button-default_:before{position:absolute;display:block;width:100%;height:100%;top:0;left:0;border-radius:4px;background-image:linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);content:''}.button-default_:hover:before{background-image:linear-gradient(0deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%)}.button-default_:active:before{opacity:0}.button-default_:active{background-color:#495159;border-color:#181b1e #777879 #777879 #181b1e}
1
+ .cherry-lock-element{user-select:none;cursor:no-drop;position:relative;filter:grayscale(100%)}.cherry-lock-element.inline-block{display:inline-block}.cherry-lock-element label{position:relative}.cherry-lock-element .cherry-lable-content,.cherry-lock-element .cherry-checkbox-item,.cherry-lock-element .select2-container,.cherry-lock-element>*:first-child{opacity:0.5;pointer-events:none}.cherry-lock-element a.cherry-lock-element__area{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2000;cursor:no-drop}.cherry-lock-element a.cherry-lock-element__area:focus{outline:none;box-shadow:none}.cherry-lock-element a.cherry-lock-element__area:hover .cherry-lock-element__label{animation-name:lock_show;animation-duration:450ms;animation-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1)}.cherry-lock-element__label{opacity:0;display:inline-block;background-color:rgba(0,0,0,0.9);border-radius:5px;color:#fff;padding:8px 10px;position:absolute;white-space:nowrap;top:-10px;left:50%;box-shadow:2px 2px 5px 0px rgba(0,0,0,0.5);will-change:auto;pointer-events:none;font-size:14px;line-height:16px;animation-name:lock_hide;animation-duration:200ms;animation-timing-function:cubic-bezier(0.55, 0.055, 0.675, 0.19);animation-fill-mode:both;transform-origin:0% 0%}.cherry-lock-element__label *+*{margin-right:5px}.cherry-lock-element__label:after{border:solid;border-color:rgba(0,0,0,0.9) transparent;border-width:6px 6px 0 6px;bottom:-5px;margin-left:-6px;content:"";left:50%;position:absolute}@keyframes lock_show{0%{opacity:0;filter:blur(5px);transform:scale(0) translate(-50%, 200%)}60%{opacity:0.8;transform:scale(1.1) translate(-50%, -130%)}100%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}}@keyframes lock_hide{0%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}100%{opacity:0;filter:blur(3px);transform:scale(0) translate(-50%, 200%)}}.cherry-ui-elements-lock{opacity:0.5;cursor:no-drop;pointer-events:none;-webkit-filter:grayscale(100%);filter:grayscale(100%)}.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-media-wrap .cherry-upload-preview{display:block;margin:0 0 5px 0}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap{position:relative;display:inline-block;vertical-align:top;width:120px;height:120px}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner{width:110px;height:110px;margin:3px;position:relative;border:2px solid #298ffc;border-radius:2px;overflow:hidden}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder{width:100%;height:100%;position:relative;background:#f1f1f1;box-sizing:border-box}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder .centered{position:absolute;width:100%;height:100%;top:0;left:0;-webkit-transform:translate(50%, 50%);transform:translate(50%, 50%)}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder img{max-width:100%;height:auto;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .preview-holder span{width:auto;height:auto;font-size:60px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap .inner .title{position:absolute;width:100%;padding:5px 0;bottom:0;left:0;color:#fff;background:rgba(41,143,252,0.8);text-align:center;font-size:11px;overflow:hidden}.cherry-ui-media-wrap .cherry-upload-preview .cherry-image-wrap:hover .cherry-remove-image{display:block}.cherry-ui-media-wrap .cherry-upload-preview .cherry-media-thumb-sortable-placeholder{width:112px;height:112px;margin:3px;vertical-align:top;border:1px dashed #dcdcdc;display:inline-block;background-color:#f1f1f1}.cherry-ui-media-wrap .upload-button{float:left}.cherry-ui-media-wrap .cherry-remove-image{width:30px;height:30px;color:#e54343;display:block;position:absolute;top:0;right:0;cursor:pointer;text-decoration:none;outline:0;display:none}.cherry-ui-media-wrap .cherry-remove-image i{width:30px;height:30px;font-size:30px}.cherry-ui-media-wrap .cherry-remove-image:hover{color:#d71e1e}.cherry-ui-media-wrap .cherry-bgsetting{float:left;width:32%;margin-right:1%}.cherry-ui-media-wrap .cherry-bgsetting:nth-child(3n+1){width:34%;margin-right:0}.cherry-ui-media-wrap .cherry-bgsetting select{margin-bottom:10px}.button-default_{position:relative;display:inline-block;font-size:12px;line-height:18px;font-weight:900;letter-spacing:0.5px;text-decoration:none;padding:15px 20px;color:#23282d;text-transform:uppercase;border-radius:4px;border-width:1px;border-style:solid;outline:none;cursor:pointer;transition:all 200ms linear;color:#fff;border-color:#777879 #2f343a #2f343a #777879;background-color:#495159}.button-default_:before{position:absolute;display:block;width:100%;height:100%;top:0;left:0;border-radius:4px;background-image:linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);content:''}.button-default_:hover:before{background-image:linear-gradient(0deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%)}.button-default_:active:before{opacity:0}.button-default_:active{background-color:#495159;border-color:#181b1e #777879 #777879 #181b1e}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-media.scss CHANGED
@@ -1,6 +1,13 @@
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
 
3
 
 
 
 
 
 
 
4
  .cherry-ui-container {
5
  margin: 10px 0 20px 0;
6
  }
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
3
+ @import "../../../../assets/sass/lock";
4
 
5
+ .cherry-ui-elements-lock{
6
+ opacity: 0.5;
7
+ cursor: no-drop;
8
+ pointer-events: none;
9
+ filter: grayscale( 100% );
10
+ }
11
  .cherry-ui-container {
12
  margin: 10px 0 20px 0;
13
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/ui-media.php CHANGED
@@ -38,8 +38,18 @@ if ( ! class_exists( 'UI_Media' ) ) {
38
  'label' => '',
39
  'class' => '',
40
  'master' => '',
 
41
  );
42
 
 
 
 
 
 
 
 
 
 
43
  /**
44
  * Constructor method for the UI_Media class.
45
  *
@@ -49,6 +59,7 @@ if ( ! class_exists( 'UI_Media' ) ) {
49
 
50
  $this->defaults_settings['id'] = 'cherry-ui-media-' . uniqid();
51
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
 
52
 
53
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
54
  }
@@ -63,7 +74,13 @@ if ( ! class_exists( 'UI_Media' ) ) {
63
 
64
  if ( current_user_can( 'upload_files' ) ) {
65
 
66
- $class = $this->settings['class'] . ' ' . $this->settings['master'];
 
 
 
 
 
 
67
 
68
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
69
  if ( '' != $this->settings['value'] ) {
@@ -136,11 +153,12 @@ if ( ! class_exists( 'UI_Media' ) ) {
136
  $html .= '</div>';
137
  $html .= '</div>';
138
  $html .= '<div class="cherry-element-wrap">';
139
- $html .= '<input type="hidden" id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-upload-input" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '" >';
140
- $html .= '<button type="button" class="upload-button cherry-upload-button button-default_" value="' . esc_attr( $this->settings['upload_button_text'] ) . '" data-title="' . esc_attr( $this->settings['upload_button_text'] ) . '" data-multi-upload="' . esc_attr( $this->settings['multi_upload'] ) . '" data-library-type="' . esc_attr( $this->settings['library_type'] ) . '">' . esc_attr( $this->settings['upload_button_text'] ) . '</button>';
141
  $html .= '<div class="clear"></div>';
142
  $html .= '</div>';
143
  $html .= '</div>';
 
144
  $html .= '</div>';
145
  }
146
 
@@ -157,18 +175,18 @@ if ( ! class_exists( 'UI_Media' ) ) {
157
  wp_enqueue_media();
158
 
159
  wp_enqueue_script(
160
- 'ui-media-min',
161
- esc_url( Cherry_Core::base_url( 'assets/min/ui-media.min.js', __FILE__ ) ),
162
  array( 'jquery', 'jquery-ui-sortable' ),
163
- '1.3.2',
164
  true
165
  );
166
 
167
  wp_enqueue_style(
168
- 'ui-media-min',
169
- esc_url( Cherry_Core::base_url( 'assets/min/ui-media.min.css', __FILE__ ) ),
170
  array(),
171
- '1.3.2',
172
  'all'
173
  );
174
  }
38
  'label' => '',
39
  'class' => '',
40
  'master' => '',
41
+ 'lock' => false,
42
  );
43
 
44
+ /**
45
+ * Instance of this Cherry5_Lock_Element class.
46
+ *
47
+ * @since 1.0.0
48
+ * @var object
49
+ * @access private
50
+ */
51
+ private $lock_element = null;
52
+
53
  /**
54
  * Constructor method for the UI_Media class.
55
  *
59
 
60
  $this->defaults_settings['id'] = 'cherry-ui-media-' . uniqid();
61
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
62
+ $this->lock_element = new Cherry5_Lock_Element( $this->settings );
63
 
64
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
65
  }
74
 
75
  if ( current_user_can( 'upload_files' ) ) {
76
 
77
+ $class = implode( ' ',
78
+ array(
79
+ $this->settings['class'],
80
+ $this->settings['master'],
81
+ $this->lock_element->get_class( 'inline-block' ),
82
+ )
83
+ );
84
 
85
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
86
  if ( '' != $this->settings['value'] ) {
153
  $html .= '</div>';
154
  $html .= '</div>';
155
  $html .= '<div class="cherry-element-wrap">';
156
+ $html .= '<input type="hidden" id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-upload-input" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '"' . $this->lock_element->get_disabled_attr() . '>';
157
+ $html .= '<button type="button" class="upload-button cherry-upload-button button-default_" value="' . esc_attr( $this->settings['upload_button_text'] ) . '" data-title="' . esc_attr( $this->settings['upload_button_text'] ) . '" data-multi-upload="' . esc_attr( $this->settings['multi_upload'] ) . '" data-library-type="' . esc_attr( $this->settings['library_type'] ) . '"' . $this->lock_element->get_disabled_attr() . '>' . esc_attr( $this->settings['upload_button_text'] ) . '</button>';
158
  $html .= '<div class="clear"></div>';
159
  $html .= '</div>';
160
  $html .= '</div>';
161
+ $html .= $this->lock_element->get_html();
162
  $html .= '</div>';
163
  }
164
 
175
  wp_enqueue_media();
176
 
177
  wp_enqueue_script(
178
+ 'ui-media',
179
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-media/assets/min/ui-media.min.js', Cherry_UI_Elements::$module_path ) ),
180
  array( 'jquery', 'jquery-ui-sortable' ),
181
+ Cherry_UI_Elements::$core_version,
182
  true
183
  );
184
 
185
  wp_enqueue_style(
186
+ 'ui-media',
187
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-media/assets/min/ui-media.min.css', Cherry_UI_Elements::$module_path ) ),
188
  array(),
189
+ Cherry_UI_Elements::$core_version,
190
  'all'
191
  );
192
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/min/ui-radio.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}input.cherry-radio-input{display:none}.cherry-radio-item{margin-bottom:10px}.cherry-radio-item:last-child{margin-bottom:0}.cherry-radio-item label{display:inline-block;font-size:14px;line-height:22px;color:#23282d}.cherry-radio-item span{width:25px;height:25px;border-radius:25px;margin-right:10px;cursor:pointer;position:relative;background-color:#f1f1f1;display:inline-block;float:left}.cherry-radio-item span i{width:13px;height:13px;background-color:#298ffc;margin:6px;border-radius:20px;display:inline-block;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1)}.cherry-radio-item .cherry-radio-input:checked+label span i{-webkit-transform:scale(1);transform:scale(1)}.cherry-radio-img{float:left;margin:10px 5px 0 5px;text-align:center;max-width:80px;position:relative}.cherry-radio-img label{display:inline-block}.cherry-radio-img img{width:100%;height:auto;margin:0 0 5px 0;pointer-events:none}.cherry-radio-img .cherry-radio-input:checked+label{font-weight:bold}.cherry-radio-img .cherry-radio-input:checked+label .check{display:block}.cherry-radio-img .cherry-radio-input:checked+label img{box-shadow:0 0 0 2px #fffeff,0 0 0 5px #298ffc}
1
+ .cherry-lock-element{user-select:none;cursor:no-drop;position:relative;filter:grayscale(100%)}.cherry-lock-element.inline-block{display:inline-block}.cherry-lock-element label{position:relative}.cherry-lock-element .cherry-lable-content,.cherry-lock-element .cherry-checkbox-item,.cherry-lock-element .select2-container,.cherry-lock-element>*:first-child{opacity:0.5;pointer-events:none}.cherry-lock-element a.cherry-lock-element__area{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2000;cursor:no-drop}.cherry-lock-element a.cherry-lock-element__area:focus{outline:none;box-shadow:none}.cherry-lock-element a.cherry-lock-element__area:hover .cherry-lock-element__label{animation-name:lock_show;animation-duration:450ms;animation-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1)}.cherry-lock-element__label{opacity:0;display:inline-block;background-color:rgba(0,0,0,0.9);border-radius:5px;color:#fff;padding:8px 10px;position:absolute;white-space:nowrap;top:-10px;left:50%;box-shadow:2px 2px 5px 0px rgba(0,0,0,0.5);will-change:auto;pointer-events:none;font-size:14px;line-height:16px;animation-name:lock_hide;animation-duration:200ms;animation-timing-function:cubic-bezier(0.55, 0.055, 0.675, 0.19);animation-fill-mode:both;transform-origin:0% 0%}.cherry-lock-element__label *+*{margin-right:5px}.cherry-lock-element__label:after{border:solid;border-color:rgba(0,0,0,0.9) transparent;border-width:6px 6px 0 6px;bottom:-5px;margin-left:-6px;content:"";left:50%;position:absolute}@keyframes lock_show{0%{opacity:0;filter:blur(5px);transform:scale(0) translate(-50%, 200%)}60%{opacity:0.8;transform:scale(1.1) translate(-50%, -130%)}100%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}}@keyframes lock_hide{0%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}100%{opacity:0;filter:blur(3px);transform:scale(0) translate(-50%, 200%)}}.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}input.cherry-radio-input{display:none}.cherry-radio-item{margin-bottom:10px}.cherry-radio-item:last-child{margin-bottom:0}.cherry-radio-item label{display:inline-block;font-size:14px;line-height:22px;color:#23282d}.cherry-radio-item span.cherry-radio-item{width:25px;height:25px;border-radius:25px;margin-right:10px;cursor:pointer;position:relative;background-color:#f1f1f1;display:inline-block;float:left}.cherry-radio-item span.cherry-radio-item i{width:13px;height:13px;background-color:#298ffc;margin:6px;border-radius:20px;display:inline-block;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1)}.cherry-radio-item .cherry-radio-input:checked+label span i{-webkit-transform:scale(1);transform:scale(1)}.cherry-radio-img{float:left;margin:10px 5px 0 5px;text-align:center;max-width:80px;position:relative}.cherry-radio-img label{display:inline-block}.cherry-radio-img img{width:100%;height:auto;margin:0 0 5px 0;pointer-events:none}.cherry-radio-img .cherry-radio-input:checked+label{font-weight:bold}.cherry-radio-img .cherry-radio-input:checked+label .check{display:block}.cherry-radio-img .cherry-radio-input:checked+label img{box-shadow:0 0 0 2px #fffeff,0 0 0 5px #298ffc}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/min/ui-radio.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"use strict";e.utilites.namespace("ui_elements.radio"),e.ui_elements.radio={inputClass:'.cherry-radio-input:not([name*="__i__"])',containerClass:".cherry-ui-container",wrapperClass:".widget, .postbox, .cherry-form, .cherry-ui-repeater-item",init:function(){t(document).on("ready.cherry-ui-elements-init",this.addEvent.bind(this)).on("cherry-ui-elements-init",this.setState.bind(this))},addEvent:function(){t("body").on("click.masterSlave",this.inputClass,this.switchState.bind(this)),this.setState({_target:t("body")})},setState:function(e){this.switchState({currentTarget:t(this.inputClass,e._target)})},switchState:function(e){for(var i,s,n,a=t(e.currentTarget).closest(this.containerClass),r=t(this.inputClass,a),c=r.length-1;c>=0;c--)i=t(r[c]),n=i.data(),s=i.closest(this.wrapperClass),jQuery.isEmptyObject(n)||t("."+n.slave,s)[i[0].checked?"removeClass":"addClass"]("hide")}},e.ui_elements.radio.init()}(jQuery,window.CherryJsCore);
1
+ !function(t,e){"use strict";e.utilites.namespace("ui_elements.radio"),e.ui_elements.radio={inputClass:'.cherry-radio-input:not([name*="__i__"])',containerClass:".cherry-ui-container",wrapperClass:".widget, .postbox, .cherry-form, .cherry-ui-repeater-item",init:function(){t(document).on("ready.cherry-ui-elements-init",this.addEvent.bind(this)).on("cherry-ui-elements-init",this.setState.bind(this))},addEvent:function(){t("body").on("click.masterSlave",this.inputClass,this.switchState.bind(this)),this.setState({_target:t("body")})},setState:function(e){this.switchState({currentTarget:t(this.inputClass,e._target)})},switchState:function(e){for(var i,s,n,r=t(e.currentTarget).closest(this.containerClass),a=t(this.inputClass,r),c=a.length-1;c>=0;c--)i=t(a[c]),n=i.data(),s=i.closest(this.wrapperClass),jQuery.isEmptyObject(n)||t("."+n.slave,s)[i[0].checked?"removeClass":"addClass"]("hide")}},e.ui_elements.radio.init()}(jQuery,window.CherryJsCore);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/ui-radio.scss CHANGED
@@ -1,5 +1,6 @@
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
 
3
 
4
  .cherry-ui-container{
5
  margin: 10px 0 20px 0;
@@ -25,7 +26,7 @@ input.cherry-radio-input{
25
  line-height: 22px;
26
  color: $dark_color_1;
27
  }
28
- span{
29
  width: 25px;
30
  height: 25px;
31
  border-radius: 25px;
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
3
+ @import "../../../../assets/sass/lock";
4
 
5
  .cherry-ui-container{
6
  margin: 10px 0 20px 0;
26
  line-height: 22px;
27
  color: $dark_color_1;
28
  }
29
+ span.cherry-radio-item{
30
  width: 25px;
31
  height: 25px;
32
  border-radius: 25px;
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/ui-radio.php CHANGED
@@ -37,6 +37,11 @@ if ( ! class_exists( 'UI_Radio' ) ) {
37
  'label' => 'Radio 1',
38
  'img_src' => '',
39
  'slave' => '',
 
 
 
 
 
40
  ),
41
  'radio-2' => array(
42
  'label' => 'Radio 2',
@@ -55,6 +60,15 @@ if ( ! class_exists( 'UI_Radio' ) ) {
55
  'master' => '',
56
  );
57
 
 
 
 
 
 
 
 
 
 
58
  /**
59
  * Constructor method for the UI_Radio class.
60
  *
@@ -63,6 +77,7 @@ if ( ! class_exists( 'UI_Radio' ) ) {
63
  function __construct( $args = array() ) {
64
  $this->defaults_settings['id'] = 'cherry-ui-radio-' . uniqid();
65
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
 
66
 
67
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
68
 
@@ -75,33 +90,41 @@ if ( ! class_exists( 'UI_Radio' ) ) {
75
  * @since 1.0.0
76
  */
77
  public function render() {
78
- $html = '';
79
- $class = $this->settings['class'];
80
- $class .= ' ' . $this->settings['master'];
 
 
 
 
 
81
 
82
- $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
83
  if ( $this->settings['options'] && ! empty( $this->settings['options'] ) && is_array( $this->settings['options'] ) ) {
84
  if ( '' !== $this->settings['label'] ) {
85
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . $this->settings['label'] . '</label> ';
86
  }
87
  $html .= '<div class="cherry-radio-group">';
88
  foreach ( $this->settings['options'] as $option => $option_value ) {
89
- $checked = $option == $this->settings['value'] ? ' checked' : '';
90
- $radio_id = $this->settings['id'] . '-' . $option;
91
- $img = isset( $option_value['img_src'] ) && ! empty( $option_value['img_src'] ) ? '<img src="' . esc_url( $option_value['img_src'] ) . '" alt="' . esc_html( $option_value['label'] ) . '">' : '<span class="cherry-radio-item"><i></i></span>';
 
 
92
  $data_slave = isset( $option_value['slave'] ) && ! empty( $option_value['slave'] ) ? ' data-slave="' . $option_value['slave'] . '"' : '';
93
- $class_box = isset( $option_value['img_src'] ) && ! empty( $option_value['img_src'] ) ? ' cherry-radio-img' : ' cherry-radio-item' ;
 
94
 
95
  $html .= '<div class="' . $class_box . '">';
96
- $html .= '<input type="radio" id="' . esc_attr( $radio_id ) . '" class="cherry-radio-input" name="' . esc_attr( $this->settings['name'] ) . '" ' . checked( $option, $this->settings['value'], false ) . ' value="' . esc_attr( $option ) . '"' . $data_slave . '>';
97
- $label_content = $img . $option_value['label'];
98
- $html .= '<label for="' . esc_attr( $radio_id ) . '">' . $label_content . '</label> ';
99
  $html .= '</div>';
100
  }
101
  $html .= '<div class="clear"></div>';
102
  $html .= '</div>';
103
  }
104
- $html .= '</div>';
105
 
106
  return $html;
107
  }
@@ -113,18 +136,18 @@ if ( ! class_exists( 'UI_Radio' ) ) {
113
  */
114
  public static function enqueue_assets() {
115
  wp_enqueue_style(
116
- 'ui-radio-min',
117
- esc_url( Cherry_Core::base_url( 'assets/min/ui-radio.min.css', __FILE__ ) ),
118
  array(),
119
- '1.3.2',
120
  'all'
121
  );
122
 
123
  wp_enqueue_script(
124
  'ui-radio-min',
125
- esc_url( Cherry_Core::base_url( 'assets/min/ui-radio.min.js', __FILE__ ) ),
126
  array( 'jquery' ),
127
- '1.3.2',
128
  true
129
  );
130
  }
37
  'label' => 'Radio 1',
38
  'img_src' => '',
39
  'slave' => '',
40
+ 'lock' => array(
41
+ 'label' => '',
42
+ 'url' => '',
43
+ 'icon' => '',
44
+ ),
45
  ),
46
  'radio-2' => array(
47
  'label' => 'Radio 2',
60
  'master' => '',
61
  );
62
 
63
+ /**
64
+ * Instance of this Cherry5_Lock_Element class.
65
+ *
66
+ * @since 1.0.0
67
+ * @var object
68
+ * @access private
69
+ */
70
+ private $lock_element = null;
71
+
72
  /**
73
  * Constructor method for the UI_Radio class.
74
  *
77
  function __construct( $args = array() ) {
78
  $this->defaults_settings['id'] = 'cherry-ui-radio-' . uniqid();
79
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
80
+ $this->lock_element = new Cherry5_Lock_Element( $this->settings );
81
 
82
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
83
 
90
  * @since 1.0.0
91
  */
92
  public function render() {
93
+ $html = '';
94
+ $class = implode( ' ',
95
+ array(
96
+ $this->settings['class'],
97
+ $this->settings['master'],
98
+ $this->lock_element->get_class( 'inline-block' ),
99
+ )
100
+ );
101
 
102
+ $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '" >';
103
  if ( $this->settings['options'] && ! empty( $this->settings['options'] ) && is_array( $this->settings['options'] ) ) {
104
  if ( '' !== $this->settings['label'] ) {
105
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . $this->settings['label'] . '</label> ';
106
  }
107
  $html .= '<div class="cherry-radio-group">';
108
  foreach ( $this->settings['options'] as $option => $option_value ) {
109
+ $lock_option = new Cherry5_Lock_Element( $option_value );
110
+
111
+ $checked = $option == $this->settings['value'] ? ' checked' : '';
112
+ $radio_id = $this->settings['id'] . '-' . $option;
113
+ $img = isset( $option_value['img_src'] ) && ! empty( $option_value['img_src'] ) ? '<img src="' . esc_url( $option_value['img_src'] ) . '" alt="' . esc_html( $option_value['label'] ) . '">' : '<span class="cherry-radio-item"><i></i></span>';
114
  $data_slave = isset( $option_value['slave'] ) && ! empty( $option_value['slave'] ) ? ' data-slave="' . $option_value['slave'] . '"' : '';
115
+ $class_box = isset( $option_value['img_src'] ) && ! empty( $option_value['img_src'] ) ? ' cherry-radio-img' : ' cherry-radio-item' ;
116
+ $class_box .= $lock_option->get_class();
117
 
118
  $html .= '<div class="' . $class_box . '">';
119
+ $html .= '<input type="radio" id="' . esc_attr( $radio_id ) . '" class="cherry-radio-input" name="' . esc_attr( $this->settings['name'] ) . '" ' . checked( $option, $this->settings['value'], false ) . ' value="' . esc_attr( $option ) . '"' . $data_slave . ' ' . $lock_option->get_disabled_attr() . '/>';
120
+ $label_content = $img . $option_value['label'];
121
+ $html .= '<label for="' . esc_attr( $radio_id ) . '"><span class="cherry-lable-content">' . $label_content . '</span>' . $lock_option->get_html() . '</label> ';
122
  $html .= '</div>';
123
  }
124
  $html .= '<div class="clear"></div>';
125
  $html .= '</div>';
126
  }
127
+ $html .= $this->lock_element->get_html() . '</div>';
128
 
129
  return $html;
130
  }
136
  */
137
  public static function enqueue_assets() {
138
  wp_enqueue_style(
139
+ 'ui-radio',
140
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-radio/assets/min/ui-radio.min.css', Cherry_UI_Elements::$module_path ) ),
141
  array(),
142
+ Cherry_UI_Elements::$core_version,
143
  'all'
144
  );
145
 
146
  wp_enqueue_script(
147
  'ui-radio-min',
148
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-radio/assets/min/ui-radio.min.js', Cherry_UI_Elements::$module_path ) ),
149
  array( 'jquery' ),
150
+ Cherry_UI_Elements::$core_version,
151
  true
152
  );
153
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/ui-repeater.php CHANGED
@@ -120,6 +120,8 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
120
  $value = ! empty( $this->settings['value'] ) ? count( $this->settings['value'] ) : 0 ;
121
  $title_field = ! empty( $this->settings['title_field'] ) ? 'data-title-field="' . $this->settings['title_field'] . '"' : '' ;
122
 
 
 
123
  $html .= sprintf( '<div class="cherry-ui-repeater-container cherry-ui-container %1$s %2$s">',
124
  $ui_kit,
125
  esc_attr( $class )
@@ -149,9 +151,38 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
149
  esc_html( $this->settings['add_label'] )
150
  );
151
  $html .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  return $html;
153
  }
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  /**
156
  * Render single row for repeater
157
  *
@@ -218,9 +249,11 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
218
  return '"type" and "name" are required fields for UI_Repeater items';
219
  }
220
 
221
- $field = wp_parse_args( $field, array( 'value' => '' ) );
222
- $parent_name = str_replace( '__i__', $widget_index, $this->settings['name'] );
 
223
 
 
224
  $field['id'] = sprintf( '%s-%s', $field['id'], $index );
225
  $field['value'] = isset( $this->data[ $field['name'] ] ) ? $this->data[ $field['name'] ] : $field['value'];
226
  $field['name'] = sprintf( '%1$s[item-%2$s][%3$s]', $parent_name, $index, $field['name'] );
@@ -244,17 +277,17 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
244
  public static function enqueue_assets() {
245
  wp_enqueue_style(
246
  'ui-repeater',
247
- esc_url( Cherry_Core::base_url( 'assets/min/ui-repeater.min.css', __FILE__ ) ),
248
  array(),
249
- '1.3.2',
250
  'all'
251
  );
252
 
253
  wp_enqueue_script(
254
  'ui-repeater',
255
- esc_url( Cherry_Core::base_url( 'assets/min/ui-repeater.min.js', __FILE__ ) ),
256
  array( 'wp-util', 'jquery-ui-sortable' ),
257
- '1.3.2',
258
  true
259
  );
260
 
120
  $value = ! empty( $this->settings['value'] ) ? count( $this->settings['value'] ) : 0 ;
121
  $title_field = ! empty( $this->settings['title_field'] ) ? 'data-title-field="' . $this->settings['title_field'] . '"' : '' ;
122
 
123
+ add_filter( 'cherry_ui_is_repeater', '__return_true' );
124
+
125
  $html .= sprintf( '<div class="cherry-ui-repeater-container cherry-ui-container %1$s %2$s">',
126
  $ui_kit,
127
  esc_attr( $class )
151
  esc_html( $this->settings['add_label'] )
152
  );
153
  $html .= '</div>';
154
+
155
+ /**
156
+ * Maybe add js repeater template to response
157
+ *
158
+ * @var bool
159
+ */
160
+ $add_js_to_response = apply_filters( 'cherry_ui_add_data_to_element', false );
161
+
162
+ if ( $add_js_to_response ) {
163
+ $html .= $this->get_js_template();
164
+ }
165
+
166
+ $html .= $this->get_additional_data();
167
+
168
+ remove_all_filters( 'cherry_ui_is_repeater' );
169
+
170
  return $html;
171
  }
172
 
173
+ /**
174
+ * Get additional data to return
175
+ * @return [type] [description]
176
+ */
177
+ public function get_additional_data() {
178
+ $data = apply_filters( 'cherry_ui_add_repater_data', array() );
179
+
180
+ if ( ! empty( $data ) ) {
181
+ return implode( ' ', $data );
182
+ }
183
+
184
+ }
185
+
186
  /**
187
  * Render single row for repeater
188
  *
249
  return '"type" and "name" are required fields for UI_Repeater items';
250
  }
251
 
252
+ $field = wp_parse_args( $field, array(
253
+ 'value' => '',
254
+ ) );
255
 
256
+ $parent_name = str_replace( '__i__', $widget_index, $this->settings['name'] );
257
  $field['id'] = sprintf( '%s-%s', $field['id'], $index );
258
  $field['value'] = isset( $this->data[ $field['name'] ] ) ? $this->data[ $field['name'] ] : $field['value'];
259
  $field['name'] = sprintf( '%1$s[item-%2$s][%3$s]', $parent_name, $index, $field['name'] );
277
  public static function enqueue_assets() {
278
  wp_enqueue_style(
279
  'ui-repeater',
280
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-repeater/assets/min/ui-repeater.min.css', Cherry_UI_Elements::$module_path ) ),
281
  array(),
282
+ Cherry_UI_Elements::$core_version,
283
  'all'
284
  );
285
 
286
  wp_enqueue_script(
287
  'ui-repeater',
288
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-repeater/assets/min/ui-repeater.min.js', Cherry_UI_Elements::$module_path ) ),
289
  array( 'wp-util', 'jquery-ui-sortable' ),
290
+ Cherry_UI_Elements::$core_version,
291
  true
292
  );
293
 
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}select.cherry-ui-select{width:100%;outline:0 none;color:#23282d;font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none}select.cherry-ui-select:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}select.cherry-ui-select:focus{border-color:none;box-shadow:none}select.select2-hidden-accessible{display:none}.select2{color:#23282d;background-color:#f1f1f1;border-radius:2px;border:1px solid #dcdcdc}.select2 .selection .select2-selection.select2-selection--single{background-color:transparent;border:none;border-radius:2px;height:50px}.select2 .selection .select2-selection.select2-selection--single .select2-selection__rendered{padding:15px 20px;font-size:14px;line-height:20px}.select2 .selection .select2-selection.select2-selection--single .select2-selection__arrow{height:50px}.select2 .selection .select2-selection.select2-selection--multiple{background-color:transparent;border:none;border-radius:2px}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered{font-size:14px;line-height:20px;padding:0;display:block}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-selection__choice{line-height:20px;margin:5px;border:none;background-color:#23282d;border-radius:2px;color:#fff;padding:10px}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove{color:#e64545;margin-right:10px}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-search{margin:0}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-search .select2-search__field{padding:0;margin:15px 10px;border:none;box-shadow:none;line-height:20px}.select2-container .select2-dropdown{background-color:#e5e5e5;border:none;border-radius:2px;margin:5px 0;box-shadow:0px 5px 21px rgba(0,0,0,0.1);z-index:500001}.select2-container .select2-dropdown .select2-search__field{border:none;box-shadow:none;border-radius:2px;margin:0}.select2-container .select2-dropdown .select2-search__field:focus{outline:none}.select2-container .select2-dropdown .select2-results .select2-results__options .select2-results__option[aria-selected=true]{color:#fff;background-color:#2a90fc}.select2-container .select2-dropdown .select2-results .select2-results__options .select2-results__option--highlighted{color:#fff;background-color:#23282d}.select2-container .select2-dropdown .select2-results .select2-results__options .li[aria-disabled=true]{display:none}
1
+ .cherry-lock-element{user-select:none;cursor:no-drop;position:relative;filter:grayscale(100%)}.cherry-lock-element.inline-block{display:inline-block}.cherry-lock-element label{position:relative}.cherry-lock-element .cherry-lable-content,.cherry-lock-element .cherry-checkbox-item,.cherry-lock-element .select2-container,.cherry-lock-element>*:first-child{opacity:0.5;pointer-events:none}.cherry-lock-element a.cherry-lock-element__area{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2000;cursor:no-drop}.cherry-lock-element a.cherry-lock-element__area:focus{outline:none;box-shadow:none}.cherry-lock-element a.cherry-lock-element__area:hover .cherry-lock-element__label{animation-name:lock_show;animation-duration:450ms;animation-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1)}.cherry-lock-element__label{opacity:0;display:inline-block;background-color:rgba(0,0,0,0.9);border-radius:5px;color:#fff;padding:8px 10px;position:absolute;white-space:nowrap;top:-10px;left:50%;box-shadow:2px 2px 5px 0px rgba(0,0,0,0.5);will-change:auto;pointer-events:none;font-size:14px;line-height:16px;animation-name:lock_hide;animation-duration:200ms;animation-timing-function:cubic-bezier(0.55, 0.055, 0.675, 0.19);animation-fill-mode:both;transform-origin:0% 0%}.cherry-lock-element__label *+*{margin-right:5px}.cherry-lock-element__label:after{border:solid;border-color:rgba(0,0,0,0.9) transparent;border-width:6px 6px 0 6px;bottom:-5px;margin-left:-6px;content:"";left:50%;position:absolute}@keyframes lock_show{0%{opacity:0;filter:blur(5px);transform:scale(0) translate(-50%, 200%)}60%{opacity:0.8;transform:scale(1.1) translate(-50%, -130%)}100%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}}@keyframes lock_hide{0%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}100%{opacity:0;filter:blur(3px);transform:scale(0) translate(-50%, 200%)}}.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}select.cherry-ui-select{width:100%;outline:0 none;color:#23282d;font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none}select.cherry-ui-select:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}select.cherry-ui-select:focus{border-color:none;box-shadow:none}select.select2-hidden-accessible{display:none}.select2{color:#23282d;background-color:#f1f1f1;border-radius:2px;border:1px solid #dcdcdc}.select2 .selection .select2-selection.select2-selection--single{background-color:transparent;border:none;border-radius:2px;height:50px}.select2 .selection .select2-selection.select2-selection--single .select2-selection__rendered{padding:15px 20px;font-size:14px;line-height:20px}.select2 .selection .select2-selection.select2-selection--single .select2-selection__arrow{height:50px}.select2 .selection .select2-selection.select2-selection--multiple{background-color:transparent;border:none;border-radius:2px}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered{font-size:14px;line-height:20px;padding:0;display:block}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-selection__choice{line-height:20px;margin:5px;border:none;background-color:#23282d;border-radius:2px;color:#fff;padding:10px}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove{color:#e64545;margin-right:10px}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-search{margin:0}.select2 .selection .select2-selection.select2-selection--multiple .select2-selection__rendered .select2-search .select2-search__field{padding:0;margin:15px 10px;border:none;box-shadow:none;line-height:20px}.select2-container .select2-dropdown{background-color:#e5e5e5;border:none;border-radius:2px;margin:5px 0;box-shadow:0px 5px 21px rgba(0,0,0,0.1);z-index:500001}.select2-container .select2-dropdown .select2-search__field{border:none;box-shadow:none;border-radius:2px;margin:0}.select2-container .select2-dropdown .select2-search__field:focus{outline:none}.select2-container .select2-dropdown .select2-results .select2-results__options .select2-results__option[aria-selected=true]{color:#fff;background-color:#2a90fc}.select2-container .select2-dropdown .select2-results .select2-results__options .select2-results__option--highlighted{color:#fff;background-color:#23282d}.select2-container .select2-dropdown .select2-results .select2-results__options .li[aria-disabled=true]{display:none}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"use strict";t.utilites.namespace("ui_elements.select"),t.ui_elements.select={selectClass:'.cherry-ui-select[data-filter="true"]:not([name*="__i__"]), .cherry-ui-select[multiple]:not([name*="__i__"])',wrapperClass:".widget, .postbox, .cherry-form, .cherry-ui-repeater-item",init:function(){e(document).on("ready.cherry-ui-elements-init",this.render.bind(this)).on("cherry-ui-elements-init",this.render.bind(this))},render:function(t){var i=t._target?t._target:e("body");e(this.selectClass,i).each(this.select2Init.bind(this))},select2Init:function(t,i){var s=e(i),r={placeholder:s.attr("placeholder")};s.select2(r).on("change.cherrySelect2",this.changeEvent.bind(this)).trigger("change.cherrySelect2")},changeEvent:function(e){this.switchState(e.currentTarget)},switchState:function(t){for(var i,s,r,n=e(t),c=n[0].length;c>=0;c--)i=e(n[0][c]),s=i.data(),r=e(n[0]).closest(this.wrapperClass),jQuery.isEmptyObject(s)||e("."+s.slave,r)[i[0].selected?"removeClass":"addClass"]("hide")}},t.ui_elements.select.init()}(jQuery,window.CherryJsCore);
1
+ !function(e,t){"use strict";t.utilites.namespace("ui_elements.select"),t.ui_elements.select={selectClass:'.cherry-ui-select[data-filter="true"]:not([name*="__i__"]), .cherry-ui-select[multiple]:not([name*="__i__"])',wrapperClass:".widget, .postbox, .cherry-form, .cherry-ui-repeater-item",init:function(){e(document).on("ready.cherry-ui-elements-init",this.render.bind(this)).on("cherry-ui-elements-init",this.render.bind(this))},render:function(t){var i=t._target?t._target:e("body");e(this.selectClass,i).each(this.select2Init.bind(this))},select2Init:function(t,i){var r=e(i),s={placeholder:r.data("placeholder")};r.select2(s).on("change.cherrySelect2",this.changeEvent.bind(this)).trigger("change.cherrySelect2")},changeEvent:function(e){this.switchState(e.currentTarget)},switchState:function(t){for(var i,r,s,n=e(t),c=n[0].length;c>=0;c--)i=e(n[0][c]),r=i.data(),s=e(n[0]).closest(this.wrapperClass),jQuery.isEmptyObject(r)||e("."+r.slave,s)[i[0].selected?"removeClass":"addClass"]("hide")}},t.ui_elements.select.init()}(jQuery,window.CherryJsCore);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.js CHANGED
@@ -23,7 +23,7 @@
23
  select2Init: function ( index, element ) {
24
  var $this = $( element ),
25
  options = {
26
- placeholder: $this.attr('placeholder')
27
  };
28
 
29
  $this
23
  select2Init: function ( index, element ) {
24
  var $this = $( element ),
25
  options = {
26
+ placeholder: $this.data('placeholder')
27
  };
28
 
29
  $this
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.scss CHANGED
@@ -1,5 +1,6 @@
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
 
3
 
4
  .cherry-ui-container{
5
  margin: 10px 0 20px 0;
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
3
+ @import "../../../../assets/sass/lock";
4
 
5
  .cherry-ui-container{
6
  margin: 10px 0 20px 0;
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/ui-select.php CHANGED
@@ -36,6 +36,8 @@ if ( ! class_exists( 'UI_Select' ) ) {
36
  'size' => 1,
37
  'inline_style' => 'width: 100%',
38
  'value' => 'select-8',
 
 
39
  'options' => array(
40
  'select-1' => 'select 1',
41
  'select-2' => 'select 2',
@@ -62,12 +64,20 @@ if ( ! class_exists( 'UI_Select' ) ) {
62
  ),
63
  ),
64
  ),
65
- 'placeholder' => 'Select',
66
- 'label' => '',
67
- 'class' => '',
68
- 'master' => '',
69
  );
70
 
 
 
 
 
 
 
 
 
 
71
  /**
72
  * Constructor method for the UI_Select class.
73
  *
@@ -75,7 +85,8 @@ if ( ! class_exists( 'UI_Select' ) ) {
75
  */
76
  function __construct( $args = array() ) {
77
  $this->defaults_settings['id'] = 'cherry-ui-select-' . uniqid();
78
- $this->settings = wp_parse_args( $args, $this->defaults_settings );
 
79
 
80
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
81
  }
@@ -87,65 +98,75 @@ if ( ! class_exists( 'UI_Select' ) ) {
87
  */
88
  public function render() {
89
  $html = '';
90
- $class = $this->settings['class'];
91
- $class .= ' ' . $this->settings['master'];
 
 
 
 
92
 
93
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
 
 
94
 
95
- ( $this->settings['filter'] ) ? $filter_state = 'data-filter="true"' : $filter_state = 'data-filter="false"' ;
 
96
 
97
- ( $this->settings['multiple'] ) ? $multi_state = 'multiple="multiple"' : $multi_state = '' ;
98
- ( $this->settings['multiple'] ) ? $name = $this->settings['name'] . '[]' : $name = $this->settings['name'] ;
 
99
 
100
- if ( '' !== $this->settings['label'] ) {
101
- $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . $this->settings['label'] . '</label> ';
102
- }
103
 
104
- $inline_style = $this->settings['inline_style'] ? 'style="' . esc_attr( $this->settings['inline_style'] ) . '"' : '' ;
105
 
106
- $html .= '<select id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-ui-select" name="' . esc_attr( $name ) . '" size="' . esc_attr( $this->settings['size'] ) . '" ' . $multi_state . ' ' . $filter_state . ' placeholder="' . $this->settings['placeholder'] . '" ' . $inline_style . ' >';
107
- if ( $this->settings['options'] && ! empty( $this->settings['options'] ) && is_array( $this->settings['options'] ) ) {
108
- foreach ( $this->settings['options'] as $option => $option_value ) {
109
- if ( ! is_array( $this->settings['value'] ) ) {
110
- $this->settings['value'] = array( $this->settings['value'] );
111
- }
112
- if ( false === strpos( $option, 'optgroup' ) ) {
113
- $selected_state = '';
114
- if ( $this->settings['value'] && ! empty( $this->settings['value'] ) ) {
115
- foreach ( $this->settings['value'] as $key => $value ) {
116
- $selected_state = selected( $value, $option, false );
117
- if ( " selected='selected'" == $selected_state ) {
118
- break;
119
- }
120
- }
121
- }
122
 
123
- if ( is_array( $option_value ) ) {
124
- $lable = $option_value['label'];
125
- $data = 'data-slave="' . $option_value['slave'] . '"';
126
- } else {
127
- $lable = $option_value;
128
- $data = '';
129
  }
130
 
131
- $html .= '<option value="' . esc_attr( $option ) . '" ' . $selected_state . ' ' . $data . '>' . esc_html( $lable ) . '</option>';
132
- } else {
133
- $html .= '<optgroup label="' . esc_attr( $option_value['label'] ) . '">';
134
  $selected_state = '';
135
- foreach ( $option_value['group_options'] as $group_item => $group_value ) {
136
  foreach ( $this->settings['value'] as $key => $value ) {
137
- $selected_state = selected( $value, $group_item, false );
138
  if ( " selected='selected'" == $selected_state ) {
139
  break;
140
  }
141
  }
142
- $html .= '<option value="' . esc_attr( $group_item ) . '" ' . $selected_state . '>' . esc_html( $group_value ) . '</option>';
143
  }
144
- $html .= '</optgroup>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  }
146
  }
147
- }
148
- $html .= '</select>';
 
149
  $html .= '</div>';
150
 
151
  return $html;
@@ -159,33 +180,33 @@ if ( ! class_exists( 'UI_Select' ) ) {
159
  public static function enqueue_assets() {
160
  wp_enqueue_script(
161
  'ui-select-select2',
162
- esc_url( Cherry_Core::base_url( 'assets/min/select2.min.js', __FILE__ ) ),
163
  array( 'jquery' ),
164
  '4.0.3',
165
  true
166
  );
167
 
168
  wp_enqueue_script(
169
- 'ui-select-min',
170
- esc_url( Cherry_Core::base_url( 'assets/min/ui-select.min.js', __FILE__ ) ),
171
  array( 'jquery' ),
172
- '1.3.2',
173
  true
174
  );
175
 
176
  wp_enqueue_style(
177
  'ui-select-select2',
178
- esc_url( Cherry_Core::base_url( 'assets/min/select2.min.css', __FILE__ ) ),
179
  array(),
180
  '4.0.3',
181
  'all'
182
  );
183
 
184
  wp_enqueue_style(
185
- 'ui-select-min',
186
- esc_url( Cherry_Core::base_url( 'assets/min/ui-select.min.css', __FILE__ ) ),
187
  array(),
188
- '1.3.2',
189
  'all'
190
  );
191
  }
36
  'size' => 1,
37
  'inline_style' => 'width: 100%',
38
  'value' => 'select-8',
39
+ 'placeholder' => null,
40
+ 'lock' => false,
41
  'options' => array(
42
  'select-1' => 'select 1',
43
  'select-2' => 'select 2',
64
  ),
65
  ),
66
  ),
67
+ 'label' => '',
68
+ 'class' => '',
69
+ 'master' => '',
 
70
  );
71
 
72
+ /**
73
+ * Instance of this Cherry5_Lock_Element class.
74
+ *
75
+ * @since 1.0.0
76
+ * @var object
77
+ * @access private
78
+ */
79
+ private $lock_element = null;
80
+
81
  /**
82
  * Constructor method for the UI_Select class.
83
  *
85
  */
86
  function __construct( $args = array() ) {
87
  $this->defaults_settings['id'] = 'cherry-ui-select-' . uniqid();
88
+ $this->settings = wp_parse_args( $args, $this->defaults_settings );
89
+ $this->lock_element = new Cherry5_Lock_Element( $this->settings );
90
 
91
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
92
  }
98
  */
99
  public function render() {
100
  $html = '';
101
+ $class = implode( ' ',
102
+ array(
103
+ $this->settings['class'],
104
+ $this->settings['master'],
105
+ )
106
+ );
107
 
108
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
109
+ $html .= '<div class="cherry-ui-select-wrapper' . $this->lock_element->get_class() .'">';
110
+ ( $this->settings['filter'] ) ? $filter_state = 'data-filter="true"' : $filter_state = 'data-filter="false"' ;
111
 
112
+ ( $this->settings['multiple'] ) ? $multi_state = 'multiple="multiple"' : $multi_state = '' ;
113
+ ( $this->settings['multiple'] ) ? $name = $this->settings['name'] . '[]' : $name = $this->settings['name'] ;
114
 
115
+ if ( '' !== $this->settings['label'] ) {
116
+ $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . $this->settings['label'] . '</label> ';
117
+ }
118
 
119
+ $inline_style = $this->settings['inline_style'] ? 'style="' . esc_attr( $this->settings['inline_style'] ) . '"' : '' ;
 
 
120
 
121
+ $html .= '<select id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-ui-select" name="' . esc_attr( $name ) . '" size="' . esc_attr( $this->settings['size'] ) . '" ' . $multi_state . ' ' . $filter_state . ' data-placeholder="' . esc_attr( $this->settings['placeholder'] ) . '" ' . $inline_style . $this->lock_element->get_disabled_attr(). '>';
122
 
123
+ if ( $this->settings['options'] && ! empty( $this->settings['options'] ) && is_array( $this->settings['options'] ) ) {
124
+ foreach ( $this->settings['options'] as $option => $option_value ) {
125
+ $lock_element = new Cherry5_Lock_Element( $option_value );
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
127
+ if ( ! is_array( $this->settings['value'] ) ) {
128
+ $this->settings['value'] = array( $this->settings['value'] );
 
 
 
 
129
  }
130
 
131
+ if ( false === strpos( $option, 'optgroup' ) ) {
 
 
132
  $selected_state = '';
133
+ if ( $this->settings['value'] && ! empty( $this->settings['value'] ) ) {
134
  foreach ( $this->settings['value'] as $key => $value ) {
135
+ $selected_state = selected( $value, $option, false );
136
  if ( " selected='selected'" == $selected_state ) {
137
  break;
138
  }
139
  }
 
140
  }
141
+
142
+ if ( is_array( $option_value ) ) {
143
+ $lable = $option_value['label'];
144
+ $data = !empty( $option_value['slave'] ) ? 'data-slave="' . $option_value['slave'] . '"' : '' ;
145
+ } else {
146
+ $lable = $option_value;
147
+ $data = '';
148
+ }
149
+
150
+ $html .= '<option value="' . esc_attr( $option ) . '" ' . $selected_state . ' ' . $data . ' ' . $lock_element->get_disabled_attr() . '>' . esc_html( $lable ) . '</option>';
151
+ } else {
152
+ $html .= '<optgroup label="' . esc_attr( $option_value['label'] ) . '">';
153
+ $selected_state = '';
154
+ foreach ( $option_value['group_options'] as $group_item => $group_value ) {
155
+ foreach ( $this->settings['value'] as $key => $value ) {
156
+ $selected_state = selected( $value, $group_item, false );
157
+ if ( " selected='selected'" == $selected_state ) {
158
+ break;
159
+ }
160
+ }
161
+ $html .= '<option value="' . esc_attr( $group_item ) . '" ' . $selected_state . ' ' . $lock_element->get_disabled_attr() . '>' . esc_html( $group_value ) . '</option>';
162
+ }
163
+ $html .= '</optgroup>';
164
+ }
165
  }
166
  }
167
+ $html .= '</select>';
168
+ $html .= $this->lock_element->get_html();
169
+ $html .= '</div>';
170
  $html .= '</div>';
171
 
172
  return $html;
180
  public static function enqueue_assets() {
181
  wp_enqueue_script(
182
  'ui-select-select2',
183
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-select/assets/min/select2.min.js', Cherry_UI_Elements::$module_path ) ),
184
  array( 'jquery' ),
185
  '4.0.3',
186
  true
187
  );
188
 
189
  wp_enqueue_script(
190
+ 'ui-select',
191
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-select/assets/min/ui-select.min.js', Cherry_UI_Elements::$module_path ) ),
192
  array( 'jquery' ),
193
+ Cherry_UI_Elements::$core_version,
194
  true
195
  );
196
 
197
  wp_enqueue_style(
198
  'ui-select-select2',
199
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-select/assets/min/select2.min.css', Cherry_UI_Elements::$module_path ) ),
200
  array(),
201
  '4.0.3',
202
  'all'
203
  );
204
 
205
  wp_enqueue_style(
206
+ 'ui-select',
207
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-select/assets/min/ui-select.min.css', Cherry_UI_Elements::$module_path ) ),
208
  array(),
209
+ Cherry_UI_Elements::$core_version,
210
  'all'
211
  );
212
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/min/ui-slider.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-container{margin:10px 0 20px 0}.cherry-ui-container .cherry-ui-container{margin:0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-slider-wrap{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.cherry-slider-wrap .cherry-slider-input{-webkit-box-flex:0;-ms-flex:0 1 10%;flex:0 1 10%;min-width:100px;max-width:200px}.cherry-slider-wrap .cherry-slider-holder{-webkit-box-flex:0;-ms-flex:0 1 90%;flex:0 1 90%;min-width:200px;max-width:300px;margin-right:20px}.cherry-slider-wrap .cherry-slider-holder input[type=range]{-webkit-appearance:none;width:100%;margin:20px 0}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus{outline:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-webkit-slider-runnable-track{width:100%;height:5px;cursor:pointer;box-shadow:none;background:#48c569;border-radius:25px;border:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-webkit-slider-thumb{box-shadow:5px 5px 13px rgba(0,0,0,0.18);border:5px solid #48c569;height:20px;width:20px;margin-top:-7px;border-radius:15px;background:#48c569;cursor:pointer;-webkit-appearance:none;-webkit-transition:all 250ms cubic-bezier(0.645, 0.045, 0.355, 1);transition:all 250ms cubic-bezier(0.645, 0.045, 0.355, 1)}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-webkit-slider-thumb{background:#f1f1f1;height:28px;width:28px;margin-top:-11.5px}.cherry-slider-wrap .cherry-slider-holder input[type=range]:hover::-webkit-slider-thumb{background:#f1f1f1;height:28px;width:28px;margin-top:-11.5px}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-webkit-slider-runnable-track{background:#48c569}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-moz-range-track{width:100%;height:5px;cursor:pointer;box-shadow:none;background:#48c569;border-radius:25px;border:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-moz-range-thumb{box-shadow:none;border:none;height:28px;width:28px;border-radius:15px;background:#48c569;cursor:pointer}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-track{width:100%;height:10px;cursor:pointer;background:#f1f1f1;border-color:transparent;color:transparent}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-fill-lower{background:#f1f1f1;border:none;border-radius:50px;box-shadow:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-fill-upper{background:#48c569;border:none;border-radius:50px;box-shadow:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-thumb{box-shadow:none;border:none;height:10px;width:10px;border-radius:15px;background:#495159;cursor:pointer}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-ms-fill-lower{background:#f1f1f1}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-ms-fill-upper{background:#48c569}.cherry-slider-wrap .cherry-input{margin:0;width:100%}
1
+ .cherry-lock-element{user-select:none;cursor:no-drop;position:relative;filter:grayscale(100%)}.cherry-lock-element.inline-block{display:inline-block}.cherry-lock-element label{position:relative}.cherry-lock-element .cherry-lable-content,.cherry-lock-element .cherry-checkbox-item,.cherry-lock-element .select2-container,.cherry-lock-element>*:first-child{opacity:0.5;pointer-events:none}.cherry-lock-element a.cherry-lock-element__area{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2000;cursor:no-drop}.cherry-lock-element a.cherry-lock-element__area:focus{outline:none;box-shadow:none}.cherry-lock-element a.cherry-lock-element__area:hover .cherry-lock-element__label{animation-name:lock_show;animation-duration:450ms;animation-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1)}.cherry-lock-element__label{opacity:0;display:inline-block;background-color:rgba(0,0,0,0.9);border-radius:5px;color:#fff;padding:8px 10px;position:absolute;white-space:nowrap;top:-10px;left:50%;box-shadow:2px 2px 5px 0px rgba(0,0,0,0.5);will-change:auto;pointer-events:none;font-size:14px;line-height:16px;animation-name:lock_hide;animation-duration:200ms;animation-timing-function:cubic-bezier(0.55, 0.055, 0.675, 0.19);animation-fill-mode:both;transform-origin:0% 0%}.cherry-lock-element__label *+*{margin-right:5px}.cherry-lock-element__label:after{border:solid;border-color:rgba(0,0,0,0.9) transparent;border-width:6px 6px 0 6px;bottom:-5px;margin-left:-6px;content:"";left:50%;position:absolute}@keyframes lock_show{0%{opacity:0;filter:blur(5px);transform:scale(0) translate(-50%, 200%)}60%{opacity:0.8;transform:scale(1.1) translate(-50%, -130%)}100%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}}@keyframes lock_hide{0%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}100%{opacity:0;filter:blur(3px);transform:scale(0) translate(-50%, 200%)}}.cherry-ui-elements-lock{opacity:0.5;cursor:no-drop;pointer-events:none;-webkit-filter:grayscale(100%);filter:grayscale(100%)}.cherry-ui-container{margin:10px 0 20px 0}.cherry-ui-container .cherry-ui-container{margin:0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-slider-wrap{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.cherry-slider-wrap .cherry-slider-input{-webkit-box-flex:0;-ms-flex:0 1 10%;flex:0 1 10%;min-width:100px;max-width:200px}.cherry-slider-wrap .cherry-slider-holder{-webkit-box-flex:0;-ms-flex:0 1 90%;flex:0 1 90%;min-width:200px;max-width:300px;margin-right:20px}.cherry-slider-wrap .cherry-slider-holder input[type=range]{-webkit-appearance:none;width:100%;margin:20px 0}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus{outline:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-webkit-slider-runnable-track{width:100%;height:5px;cursor:pointer;box-shadow:none;background:#48c569;border-radius:25px;border:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-webkit-slider-thumb{box-shadow:5px 5px 13px rgba(0,0,0,0.18);border:5px solid #48c569;height:20px;width:20px;margin-top:-7px;border-radius:15px;background:#48c569;cursor:pointer;-webkit-appearance:none;-webkit-transition:all 250ms cubic-bezier(0.645, 0.045, 0.355, 1);transition:all 250ms cubic-bezier(0.645, 0.045, 0.355, 1)}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-webkit-slider-thumb{background:#f1f1f1;height:28px;width:28px;margin-top:-11.5px}.cherry-slider-wrap .cherry-slider-holder input[type=range]:hover::-webkit-slider-thumb{background:#f1f1f1;height:28px;width:28px;margin-top:-11.5px}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-webkit-slider-runnable-track{background:#48c569}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-moz-range-track{width:100%;height:5px;cursor:pointer;box-shadow:none;background:#48c569;border-radius:25px;border:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-moz-range-thumb{box-shadow:none;border:none;height:28px;width:28px;border-radius:15px;background:#48c569;cursor:pointer}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-track{width:100%;height:10px;cursor:pointer;background:#f1f1f1;border-color:transparent;color:transparent}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-fill-lower{background:#f1f1f1;border:none;border-radius:50px;box-shadow:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-fill-upper{background:#48c569;border:none;border-radius:50px;box-shadow:none}.cherry-slider-wrap .cherry-slider-holder input[type=range]::-ms-thumb{box-shadow:none;border:none;height:10px;width:10px;border-radius:15px;background:#495159;cursor:pointer}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-ms-fill-lower{background:#f1f1f1}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-ms-fill-upper{background:#48c569}.cherry-slider-wrap .cherry-input{margin:0;width:100%}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/ui-slider.scss CHANGED
@@ -1,6 +1,13 @@
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
 
3
 
 
 
 
 
 
 
4
  .cherry-ui-container{
5
  margin: 10px 0 20px 0;
6
  .cherry-ui-container{
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
3
+ @import "../../../../assets/sass/lock";
4
 
5
+ .cherry-ui-elements-lock{
6
+ opacity: 0.5;
7
+ cursor: no-drop;
8
+ pointer-events: none;
9
+ filter: grayscale( 100% );
10
+ }
11
  .cherry-ui-container{
12
  margin: 10px 0 20px 0;
13
  .cherry-ui-container{
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/ui-slider.php CHANGED
@@ -38,8 +38,18 @@ if ( ! class_exists( 'UI_Slider' ) ) {
38
  'label' => '',
39
  'class' => '',
40
  'master' => '',
 
41
  );
42
 
 
 
 
 
 
 
 
 
 
43
  /**
44
  * Constructor method for the UI_Slider class.
45
  *
@@ -48,6 +58,7 @@ if ( ! class_exists( 'UI_Slider' ) ) {
48
  function __construct( $args = array() ) {
49
  $this->defaults_settings['id'] = 'cherry-ui-slider-' . uniqid();
50
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
 
51
 
52
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
53
  }
@@ -59,8 +70,13 @@ if ( ! class_exists( 'UI_Slider' ) ) {
59
  */
60
  public function render() {
61
  $html = '';
62
- $class = $this->settings['class'];
63
- $class .= ' ' . $this->settings['master'];
 
 
 
 
 
64
 
65
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
66
 
@@ -81,12 +97,13 @@ if ( ! class_exists( 'UI_Slider' ) ) {
81
  }
82
  $html .= '<div class="cherry-slider-wrap">';
83
  $html .= '<div class="cherry-slider-holder">';
84
- $html .= '<input type="range" class="cherry-slider-unit" step="' . esc_attr( $this->settings['step_value'] ) . '" min="' . esc_attr( $this->settings['min_value'] ) . '" max="' . esc_attr( $this->settings['max_value'] ) . '" value="' . esc_attr( $this->settings['value'] ) . '">';
85
  $html .= '</div>';
86
  $html .= '<div class="cherry-slider-input">';
87
  $html .= $ui_stepper_html;
88
  $html .= '</div>';
89
  $html .= '</div>';
 
90
  $html .= '</div>';
91
 
92
  return $html;
@@ -99,18 +116,18 @@ if ( ! class_exists( 'UI_Slider' ) ) {
99
  */
100
  public static function enqueue_assets() {
101
  wp_enqueue_script(
102
- 'ui-slider-min',
103
- esc_url( Cherry_Core::base_url( 'assets/min/ui-slider.min.js', __FILE__ ) ),
104
  array( 'jquery' ),
105
- '1.3.2',
106
  true
107
  );
108
 
109
  wp_enqueue_style(
110
- 'ui-slider-min',
111
- esc_url( Cherry_Core::base_url( 'assets/min/ui-slider.min.css', __FILE__ ) ),
112
  array(),
113
- '1.3.2',
114
  'all'
115
  );
116
  }
38
  'label' => '',
39
  'class' => '',
40
  'master' => '',
41
+ 'lock' => false,
42
  );
43
 
44
+ /**
45
+ * Instance of this Cherry5_Lock_Element class.
46
+ *
47
+ * @since 1.0.0
48
+ * @var object
49
+ * @access private
50
+ */
51
+ private $lock_element = null;
52
+
53
  /**
54
  * Constructor method for the UI_Slider class.
55
  *
58
  function __construct( $args = array() ) {
59
  $this->defaults_settings['id'] = 'cherry-ui-slider-' . uniqid();
60
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
61
+ $this->lock_element = new Cherry5_Lock_Element( $this->settings );
62
 
63
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
64
  }
70
  */
71
  public function render() {
72
  $html = '';
73
+ $class = implode( ' ',
74
+ array(
75
+ $this->settings['class'],
76
+ $this->settings['master'],
77
+ $this->lock_element->get_class(),
78
+ )
79
+ );
80
 
81
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
82
 
97
  }
98
  $html .= '<div class="cherry-slider-wrap">';
99
  $html .= '<div class="cherry-slider-holder">';
100
+ $html .= '<input type="range" class="cherry-slider-unit" step="' . esc_attr( $this->settings['step_value'] ) . '" min="' . esc_attr( $this->settings['min_value'] ) . '" max="' . esc_attr( $this->settings['max_value'] ) . '" value="' . esc_attr( $this->settings['value'] ) . '"' . $this->lock_element->get_disabled_attr() . '>';
101
  $html .= '</div>';
102
  $html .= '<div class="cherry-slider-input">';
103
  $html .= $ui_stepper_html;
104
  $html .= '</div>';
105
  $html .= '</div>';
106
+ $html .= $this->lock_element->get_html();
107
  $html .= '</div>';
108
 
109
  return $html;
116
  */
117
  public static function enqueue_assets() {
118
  wp_enqueue_script(
119
+ 'ui-slider',
120
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-slider/assets/min/ui-slider.min.js', Cherry_UI_Elements::$module_path ) ),
121
  array( 'jquery' ),
122
+ Cherry_UI_Elements::$core_version,
123
  true
124
  );
125
 
126
  wp_enqueue_style(
127
+ 'ui-slider',
128
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-slider/assets/min/ui-slider.min.css', Cherry_UI_Elements::$module_path ) ),
129
  array(),
130
+ Cherry_UI_Elements::$core_version,
131
  'all'
132
  );
133
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/min/ui-stepper.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-stepper{position:relative;max-width:100px}.cherry-ui-stepper input[type=number]{font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none}.cherry-ui-stepper input[type=number]:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}.cherry-ui-stepper-input{min-width:90px;max-width:90px;text-align:center}
1
+ .cherry-lock-element{user-select:none;cursor:no-drop;position:relative;filter:grayscale(100%)}.cherry-lock-element.inline-block{display:inline-block}.cherry-lock-element label{position:relative}.cherry-lock-element .cherry-lable-content,.cherry-lock-element .cherry-checkbox-item,.cherry-lock-element .select2-container,.cherry-lock-element>*:first-child{opacity:0.5;pointer-events:none}.cherry-lock-element a.cherry-lock-element__area{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2000;cursor:no-drop}.cherry-lock-element a.cherry-lock-element__area:focus{outline:none;box-shadow:none}.cherry-lock-element a.cherry-lock-element__area:hover .cherry-lock-element__label{animation-name:lock_show;animation-duration:450ms;animation-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1)}.cherry-lock-element__label{opacity:0;display:inline-block;background-color:rgba(0,0,0,0.9);border-radius:5px;color:#fff;padding:8px 10px;position:absolute;white-space:nowrap;top:-10px;left:50%;box-shadow:2px 2px 5px 0px rgba(0,0,0,0.5);will-change:auto;pointer-events:none;font-size:14px;line-height:16px;animation-name:lock_hide;animation-duration:200ms;animation-timing-function:cubic-bezier(0.55, 0.055, 0.675, 0.19);animation-fill-mode:both;transform-origin:0% 0%}.cherry-lock-element__label *+*{margin-right:5px}.cherry-lock-element__label:after{border:solid;border-color:rgba(0,0,0,0.9) transparent;border-width:6px 6px 0 6px;bottom:-5px;margin-left:-6px;content:"";left:50%;position:absolute}@keyframes lock_show{0%{opacity:0;filter:blur(5px);transform:scale(0) translate(-50%, 200%)}60%{opacity:0.8;transform:scale(1.1) translate(-50%, -130%)}100%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}}@keyframes lock_hide{0%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}100%{opacity:0;filter:blur(3px);transform:scale(0) translate(-50%, 200%)}}.cherry-ui-elements-lock{opacity:0.5;cursor:no-drop;pointer-events:none;-webkit-filter:grayscale(100%);filter:grayscale(100%)}.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.cherry-ui-stepper{position:relative;max-width:100px}.cherry-ui-stepper input[type=number]{font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none}.cherry-ui-stepper input[type=number]:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}.cherry-ui-stepper-input{min-width:90px;max-width:90px;text-align:center}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/assets/ui-stepper.scss CHANGED
@@ -1,6 +1,13 @@
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
 
3
 
 
 
 
 
 
 
4
  .cherry-ui-container{
5
  margin: 10px 0 20px 0;
6
  }
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
3
+ @import "../../../../assets/sass/lock";
4
 
5
+ .cherry-ui-elements-lock{
6
+ opacity: 0.5;
7
+ cursor: no-drop;
8
+ pointer-events: none;
9
+ filter: grayscale( 100% );
10
+ }
11
  .cherry-ui-container{
12
  margin: 10px 0 20px 0;
13
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/ui-stepper.php CHANGED
@@ -39,8 +39,18 @@ if ( ! class_exists( 'UI_Stepper' ) ) {
39
  'class' => '',
40
  'master' => '',
41
  'placeholder' => '',
 
42
  );
43
 
 
 
 
 
 
 
 
 
 
44
  /**
45
  * Constructor method for the UI_Stepper class.
46
  *
@@ -49,6 +59,7 @@ if ( ! class_exists( 'UI_Stepper' ) ) {
49
  function __construct( $args = array() ) {
50
  $this->defaults_settings['id'] = 'cherry-ui-stepper-' . uniqid();
51
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
 
52
 
53
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
54
  }
@@ -61,8 +72,15 @@ if ( ! class_exists( 'UI_Stepper' ) ) {
61
  */
62
  public function render() {
63
  $html = '';
64
- $class = $this->settings['class'];
65
- $class .= ' ' . $this->settings['master'];
 
 
 
 
 
 
 
66
 
67
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
68
 
@@ -70,8 +88,9 @@ if ( ! class_exists( 'UI_Stepper' ) ) {
70
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
71
  }
72
  $html .= '<div class="cherry-ui-stepper">';
73
- $html .= '<input type="number" id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-ui-stepper-input" pattern="[0-5]+([\.,][0-5]+)?" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '" min="' . esc_html( $this->settings['min_value'] ) . '" max="' . esc_html( $this->settings['max_value'] ) . '" step="' . esc_html( $this->settings['step_value'] ) . '" placeholder="' . esc_attr( $this->settings['placeholder'] ) . '">';
74
  $html .= '</div>';
 
75
  $html .= '</div>';
76
 
77
  return $html;
@@ -84,10 +103,10 @@ if ( ! class_exists( 'UI_Stepper' ) ) {
84
  */
85
  public static function enqueue_assets() {
86
  wp_enqueue_style(
87
- 'ui-stepper-min',
88
- esc_url( Cherry_Core::base_url( 'assets/min/ui-stepper.min.css', __FILE__ ) ),
89
  array(),
90
- '1.3.2',
91
  'all'
92
  );
93
  }
39
  'class' => '',
40
  'master' => '',
41
  'placeholder' => '',
42
+ 'lock' => false,
43
  );
44
 
45
+ /**
46
+ * Instance of this Cherry5_Lock_Element class.
47
+ *
48
+ * @since 1.0.0
49
+ * @var object
50
+ * @access private
51
+ */
52
+ private $lock_element = null;
53
+
54
  /**
55
  * Constructor method for the UI_Stepper class.
56
  *
59
  function __construct( $args = array() ) {
60
  $this->defaults_settings['id'] = 'cherry-ui-stepper-' . uniqid();
61
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
62
+ $this->lock_element = new Cherry5_Lock_Element( $this->settings );
63
 
64
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
65
  }
72
  */
73
  public function render() {
74
  $html = '';
75
+ $input_lock = ( ! empty( $this->settings['lock'] ) ) ? 'disabled' : '' ;
76
+ $lock_lable = ! empty( $this->settings['lock']['label'] )? sprintf('<div class="cherry-lock-label">%1$s</div>', $this->settings['lock']['label'] ) : '' ;
77
+ $class = implode( ' ',
78
+ array(
79
+ $this->settings['class'],
80
+ $this->settings['master'],
81
+ $this->lock_element->get_class( 'inline-block' ),
82
+ )
83
+ );
84
 
85
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
86
 
88
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
89
  }
90
  $html .= '<div class="cherry-ui-stepper">';
91
+ $html .= '<input type="number" id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-ui-stepper-input" pattern="[0-5]+([\.,][0-5]+)?" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '" min="' . esc_html( $this->settings['min_value'] ) . '" max="' . esc_html( $this->settings['max_value'] ) . '" step="' . esc_html( $this->settings['step_value'] ) . '" placeholder="' . esc_attr( $this->settings['placeholder'] ) . $this->lock_element->get_disabled_attr() . '">';
92
  $html .= '</div>';
93
+ $html .= $this->lock_element->get_html();
94
  $html .= '</div>';
95
 
96
  return $html;
103
  */
104
  public static function enqueue_assets() {
105
  wp_enqueue_style(
106
+ 'ui-stepper',
107
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-stepper/assets/min/ui-stepper.min.css', Cherry_UI_Elements::$module_path ) ),
108
  array(),
109
+ Cherry_UI_Elements::$core_version,
110
  'all'
111
  );
112
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/min/ui-switcher.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}.cherry-switcher-wrap{height:47px;border-radius:25px;display:inline-block;overflow:hidden;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid #dcdcdc}.cherry-switcher-wrap label{background-color:#f1f1f1;display:block;float:left;-webkit-transition:all 0.4s ease;transition:all 0.4s ease}.cherry-switcher-wrap label span{font-size:12px;line-height:18px;font-weight:900;text-transform:uppercase;color:#23282d;text-align:center;display:block;opacity:1;-webkit-transition:all 0.4s ease;transition:all 0.4s ease}.cherry-switcher-wrap .sw-enable{padding:15px 10px 15px 20px}.cherry-switcher-wrap .sw-enable span{opacity:0}.cherry-switcher-wrap .sw-disable{padding:15px 20px 15px 10px}.cherry-switcher-wrap .sw-disable span{opacity:1}.cherry-switcher-wrap .state-marker{background-color:#e64545;display:block;position:absolute;width:41px;height:41px;margin:3px;top:0;left:0;margin-left:4px;border-radius:25px;border-style:solid;border-width:1px;border-color:#e54545 #c13b3b #c13b3b #e54545;-webkit-transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);box-sizing:border-box}.cherry-switcher-wrap .state-marker:before{position:absolute;display:block;width:100%;height:100%;top:0;left:0;border-radius:50%;background-image:-webkit-linear-gradient(top, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);background-image:linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);content:''}.cherry-switcher-wrap .cherry-input-switcher{display:none}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .sw-enable span{opacity:1}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .sw-disable span{opacity:0}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .state-marker{left:100%;margin-left:-45px;border-color:#43b05f #3b9b54 #3b9b54 #43b05f;background-color:#49c66a}.cherry-switcher-wrap.size-small{height:23px}.cherry-switcher-wrap.size-small label{height:23px;padding:0}.cherry-switcher-wrap.size-small label span{font-size:10px;line-height:15px;padding:5px}.cherry-switcher-wrap.size-small .state-marker{width:17px;height:17px;margin-left:4px}.cherry-switcher-wrap.size-small .cherry-input-switcher-true:checked ~ .state-marker{margin-left:-22px}
1
+ .cherry-lock-element{user-select:none;cursor:no-drop;position:relative;filter:grayscale(100%)}.cherry-lock-element.inline-block{display:inline-block}.cherry-lock-element label{position:relative}.cherry-lock-element .cherry-lable-content,.cherry-lock-element .cherry-checkbox-item,.cherry-lock-element .select2-container,.cherry-lock-element>*:first-child{opacity:0.5;pointer-events:none}.cherry-lock-element a.cherry-lock-element__area{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2000;cursor:no-drop}.cherry-lock-element a.cherry-lock-element__area:focus{outline:none;box-shadow:none}.cherry-lock-element a.cherry-lock-element__area:hover .cherry-lock-element__label{animation-name:lock_show;animation-duration:450ms;animation-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1)}.cherry-lock-element__label{opacity:0;display:inline-block;background-color:rgba(0,0,0,0.9);border-radius:5px;color:#fff;padding:8px 10px;position:absolute;white-space:nowrap;top:-10px;left:50%;box-shadow:2px 2px 5px 0px rgba(0,0,0,0.5);will-change:auto;pointer-events:none;font-size:14px;line-height:16px;animation-name:lock_hide;animation-duration:200ms;animation-timing-function:cubic-bezier(0.55, 0.055, 0.675, 0.19);animation-fill-mode:both;transform-origin:0% 0%}.cherry-lock-element__label *+*{margin-right:5px}.cherry-lock-element__label:after{border:solid;border-color:rgba(0,0,0,0.9) transparent;border-width:6px 6px 0 6px;bottom:-5px;margin-left:-6px;content:"";left:50%;position:absolute}@keyframes lock_show{0%{opacity:0;filter:blur(5px);transform:scale(0) translate(-50%, 200%)}60%{opacity:0.8;transform:scale(1.1) translate(-50%, -130%)}100%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}}@keyframes lock_hide{0%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}100%{opacity:0;filter:blur(3px);transform:scale(0) translate(-50%, 200%)}}.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.hide{display:none !important}.cherry-switcher-wrap{height:47px;border-radius:25px;display:inline-block;overflow:hidden;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid #dcdcdc}.cherry-switcher-wrap label{background-color:#f1f1f1;display:block;float:left;-webkit-transition:all 0.4s ease;transition:all 0.4s ease}.cherry-switcher-wrap label span{font-size:12px;line-height:18px;font-weight:900;text-transform:uppercase;color:#23282d;text-align:center;display:block;opacity:1;-webkit-transition:all 0.4s ease;transition:all 0.4s ease}.cherry-switcher-wrap .sw-enable{padding:15px 10px 15px 20px}.cherry-switcher-wrap .sw-enable span{opacity:0}.cherry-switcher-wrap .sw-disable{padding:15px 20px 15px 10px}.cherry-switcher-wrap .sw-disable span{opacity:1}.cherry-switcher-wrap .state-marker{background-color:#e64545;display:block;position:absolute;width:41px;height:41px;margin:3px;top:0;left:0;margin-left:4px;border-radius:25px;border-style:solid;border-width:1px;border-color:#e54545 #c13b3b #c13b3b #e54545;-webkit-transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);transition:all 0.4s cubic-bezier(0.77, 0, 0.175, 1);box-sizing:border-box}.cherry-switcher-wrap .state-marker:before{position:absolute;display:block;width:100%;height:100%;top:0;left:0;border-radius:50%;background-image:-webkit-linear-gradient(top, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);background-image:linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);content:''}.cherry-switcher-wrap .cherry-input-switcher{display:none}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .sw-enable span{opacity:1}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .sw-disable span{opacity:0}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .state-marker{left:100%;margin-left:-45px;border-color:#43b05f #3b9b54 #3b9b54 #43b05f;background-color:#49c66a}.cherry-switcher-wrap.size-small{height:23px}.cherry-switcher-wrap.size-small label{height:23px;padding:0}.cherry-switcher-wrap.size-small label span{font-size:10px;line-height:15px;padding:5px}.cherry-switcher-wrap.size-small .state-marker{width:17px;height:17px;margin-left:4px}.cherry-switcher-wrap.size-small .cherry-input-switcher-true:checked ~ .state-marker{margin-left:-22px}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-switcher.scss CHANGED
@@ -1,4 +1,5 @@
1
  @import "ui-kit/variables";
 
2
 
3
  .cherry-ui-container{
4
  margin: 10px 0 20px 0;
1
  @import "ui-kit/variables";
2
+ @import "../../../../assets/sass/lock";
3
 
4
  .cherry-ui-container{
5
  margin: 10px 0 20px 0;
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/ui-switcher.php CHANGED
@@ -44,6 +44,15 @@ if ( ! class_exists( 'UI_Switcher' ) ) {
44
  'master' => '',
45
  );
46
 
 
 
 
 
 
 
 
 
 
47
  /**
48
  * Constructor method for the UI_Switcher class.
49
  *
@@ -52,6 +61,7 @@ if ( ! class_exists( 'UI_Switcher' ) ) {
52
  function __construct( $args = array() ) {
53
  $this->defaults_settings['id'] = 'cherry-ui-swither-' . uniqid();
54
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
 
55
 
56
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
57
  }
@@ -67,8 +77,13 @@ if ( ! class_exists( 'UI_Switcher' ) ) {
67
  $master_true = $data_slave_true || $data_slave_false ? 'data-master="true"' : '' ;
68
 
69
  $html = '';
70
- $class = $this->settings['class'];
71
- $class .= ' ' . $this->settings['master'];
 
 
 
 
 
72
 
73
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
74
  if ( '' !== $this->settings['label'] ) {
@@ -78,12 +93,15 @@ if ( ! class_exists( 'UI_Switcher' ) ) {
78
  $value = filter_var( $this->settings['value'], FILTER_VALIDATE_BOOLEAN );
79
 
80
  $html .= '<div class="cherry-switcher-wrap size-' . esc_attr( $this->settings['style'] ) . '" ' . $master_true . '>';
81
- $html .= '<input type="radio" id="' . esc_attr( $this->settings['id'] ) . '-true" class="cherry-input-switcher cherry-input-switcher-true" name="' . esc_attr( $this->settings['name'] ) . '" ' . checked( true, $value, false ) . ' value="true" ' . $data_slave_true . '>';
82
- $html .= '<input type="radio" id="' . esc_attr( $this->settings['id'] ) . '-false" class="cherry-input-switcher cherry-input-switcher-false" name="' . esc_attr( $this->settings['name'] ) . '" ' . checked( false, $value, false ) . ' value="false" ' . $data_slave_false . '>';
 
83
  $html .= '<label class="sw-enable"><span>' . esc_html( $this->settings['toggle']['true_toggle'] ) . '</span></label>';
84
  $html .= '<label class="sw-disable"><span>' . esc_html( $this->settings['toggle']['false_toggle'] ) . '</span></label>';
85
  $html .= '<span class="state-marker"></span>';
 
86
  $html .= '</div>';
 
87
  $html .= '</div>';
88
 
89
  return $html;
@@ -96,18 +114,18 @@ if ( ! class_exists( 'UI_Switcher' ) ) {
96
  */
97
  public static function enqueue_assets() {
98
  wp_enqueue_script(
99
- 'ui-switcher-min',
100
- esc_url( Cherry_Core::base_url( 'assets/min/ui-switcher.min.js', __FILE__ ) ),
101
  array( 'jquery' ),
102
- '1.3.2',
103
  true
104
  );
105
 
106
  wp_enqueue_style(
107
- 'ui-switcher-min',
108
- esc_url( Cherry_Core::base_url( 'assets/min/ui-switcher.min.css', __FILE__ ) ),
109
  array(),
110
- '1.3.2',
111
  'all'
112
  );
113
  }
44
  'master' => '',
45
  );
46
 
47
+ /**
48
+ * Instance of this Cherry5_Lock_Element class.
49
+ *
50
+ * @since 1.0.0
51
+ * @var object
52
+ * @access private
53
+ */
54
+ private $lock_element = null;
55
+
56
  /**
57
  * Constructor method for the UI_Switcher class.
58
  *
61
  function __construct( $args = array() ) {
62
  $this->defaults_settings['id'] = 'cherry-ui-swither-' . uniqid();
63
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
64
+ $this->lock_element = new Cherry5_Lock_Element( $this->settings );
65
 
66
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
67
  }
77
  $master_true = $data_slave_true || $data_slave_false ? 'data-master="true"' : '' ;
78
 
79
  $html = '';
80
+ $class = implode( ' ',
81
+ array(
82
+ $this->settings['class'],
83
+ $this->settings['master'],
84
+ $this->lock_element->get_class( 'inline-block' ),
85
+ )
86
+ );
87
 
88
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
89
  if ( '' !== $this->settings['label'] ) {
93
  $value = filter_var( $this->settings['value'], FILTER_VALIDATE_BOOLEAN );
94
 
95
  $html .= '<div class="cherry-switcher-wrap size-' . esc_attr( $this->settings['style'] ) . '" ' . $master_true . '>';
96
+ $html .= '<input type="radio" id="' . esc_attr( $this->settings['id'] ) . '-true" class="cherry-input-switcher cherry-input-switcher-true" name="' . esc_attr( $this->settings['name'] ) . '" ' . checked( true, $value, false ) . ' value="true" ' . $data_slave_true . ' ' . $this->lock_element->get_disabled_attr() . '>';
97
+ $html .= '<input type="radio" id="' . esc_attr( $this->settings['id'] ) . '-false" class="cherry-input-switcher cherry-input-switcher-false" name="' . esc_attr( $this->settings['name'] ) . '" ' . checked( false, $value, false ) . ' value="false" ' . $data_slave_false . ' ' . $this->lock_element->get_disabled_attr() . '>';
98
+ //$html .= '<span class="cherry-lable-content">';
99
  $html .= '<label class="sw-enable"><span>' . esc_html( $this->settings['toggle']['true_toggle'] ) . '</span></label>';
100
  $html .= '<label class="sw-disable"><span>' . esc_html( $this->settings['toggle']['false_toggle'] ) . '</span></label>';
101
  $html .= '<span class="state-marker"></span>';
102
+ // $html .= '</span>';
103
  $html .= '</div>';
104
+ $html .= $this->lock_element->get_html();
105
  $html .= '</div>';
106
 
107
  return $html;
114
  */
115
  public static function enqueue_assets() {
116
  wp_enqueue_script(
117
+ 'ui-switcher',
118
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-switcher/assets/min/ui-switcher.min.js', Cherry_UI_Elements::$module_path ) ),
119
  array( 'jquery' ),
120
+ Cherry_UI_Elements::$core_version,
121
  true
122
  );
123
 
124
  wp_enqueue_style(
125
+ 'ui-switcher',
126
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-switcher/assets/min/ui-switcher.min.css', Cherry_UI_Elements::$module_path ) ),
127
  array(),
128
+ Cherry_UI_Elements::$core_version,
129
  'all'
130
  );
131
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/min/ui-text.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}input.cherry-ui-text{font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none}input.cherry-ui-text:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}
1
+ .cherry-lock-element{user-select:none;cursor:no-drop;position:relative;filter:grayscale(100%)}.cherry-lock-element.inline-block{display:inline-block}.cherry-lock-element label{position:relative}.cherry-lock-element .cherry-lable-content,.cherry-lock-element .cherry-checkbox-item,.cherry-lock-element .select2-container,.cherry-lock-element>*:first-child{opacity:0.5;pointer-events:none}.cherry-lock-element a.cherry-lock-element__area{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2000;cursor:no-drop}.cherry-lock-element a.cherry-lock-element__area:focus{outline:none;box-shadow:none}.cherry-lock-element a.cherry-lock-element__area:hover .cherry-lock-element__label{animation-name:lock_show;animation-duration:450ms;animation-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1)}.cherry-lock-element__label{opacity:0;display:inline-block;background-color:rgba(0,0,0,0.9);border-radius:5px;color:#fff;padding:8px 10px;position:absolute;white-space:nowrap;top:-10px;left:50%;box-shadow:2px 2px 5px 0px rgba(0,0,0,0.5);will-change:auto;pointer-events:none;font-size:14px;line-height:16px;animation-name:lock_hide;animation-duration:200ms;animation-timing-function:cubic-bezier(0.55, 0.055, 0.675, 0.19);animation-fill-mode:both;transform-origin:0% 0%}.cherry-lock-element__label *+*{margin-right:5px}.cherry-lock-element__label:after{border:solid;border-color:rgba(0,0,0,0.9) transparent;border-width:6px 6px 0 6px;bottom:-5px;margin-left:-6px;content:"";left:50%;position:absolute}@keyframes lock_show{0%{opacity:0;filter:blur(5px);transform:scale(0) translate(-50%, 200%)}60%{opacity:0.8;transform:scale(1.1) translate(-50%, -130%)}100%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}}@keyframes lock_hide{0%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}100%{opacity:0;filter:blur(3px);transform:scale(0) translate(-50%, 200%)}}.cherry-ui-elements-lock{opacity:0.5;cursor:no-drop;pointer-events:none;-webkit-filter:grayscale(100%);filter:grayscale(100%)}.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}input.cherry-ui-text{font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none}input.cherry-ui-text:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/assets/ui-text.scss CHANGED
@@ -1,6 +1,13 @@
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
 
3
 
 
 
 
 
 
 
4
  .cherry-ui-container{
5
  margin: 10px 0 20px 0;
6
  }
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
3
+ @import "../../../../assets/sass/lock";
4
 
5
+ .cherry-ui-elements-lock{
6
+ opacity: 0.5;
7
+ cursor: no-drop;
8
+ pointer-events: none;
9
+ filter: grayscale( 100% );
10
+ }
11
  .cherry-ui-container{
12
  margin: 10px 0 20px 0;
13
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/ui-text.php CHANGED
@@ -38,8 +38,18 @@ if ( ! class_exists( 'UI_Text' ) ) {
38
  'class' => '',
39
  'master' => '',
40
  'required' => false,
 
41
  );
42
 
 
 
 
 
 
 
 
 
 
43
  /**
44
  * Constructor method for the UI_Text class.
45
  *
@@ -48,6 +58,7 @@ if ( ! class_exists( 'UI_Text' ) ) {
48
  function __construct( $args = array() ) {
49
  $this->defaults_settings['id'] = 'cherry-ui-input-text-' . uniqid();
50
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
 
51
 
52
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
53
  }
@@ -74,14 +85,20 @@ if ( ! class_exists( 'UI_Text' ) ) {
74
  */
75
  public function render() {
76
  $html = '';
77
- $class = $this->settings['class'];
78
- $class .= ' ' . $this->settings['master'];
 
 
 
 
 
79
 
80
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
81
  if ( '' !== $this->settings['label'] ) {
82
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
83
  }
84
- $html .= '<input type="' . esc_attr( $this->settings['type'] ) . '" id="' . esc_attr( $this->settings['id'] ) . '" class="widefat cherry-ui-text" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '" placeholder="' . esc_attr( $this->settings['placeholder'] ) . '" ' . $this->get_required() . '>';
 
85
  $html .= '</div>';
86
  return $html;
87
  }
@@ -94,9 +111,9 @@ if ( ! class_exists( 'UI_Text' ) ) {
94
  public static function enqueue_assets() {
95
  wp_enqueue_style(
96
  'ui-text',
97
- esc_url( Cherry_Core::base_url( 'assets/min/ui-text.min.css', __FILE__ ) ),
98
  array(),
99
- '1.3.2',
100
  'all'
101
  );
102
  }
38
  'class' => '',
39
  'master' => '',
40
  'required' => false,
41
+ 'lock' => false,
42
  );
43
 
44
+ /**
45
+ * Instance of this Cherry5_Lock_Element class.
46
+ *
47
+ * @since 1.0.0
48
+ * @var object
49
+ * @access private
50
+ */
51
+ private $lock_element = null;
52
+
53
  /**
54
  * Constructor method for the UI_Text class.
55
  *
58
  function __construct( $args = array() ) {
59
  $this->defaults_settings['id'] = 'cherry-ui-input-text-' . uniqid();
60
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
61
+ $this->lock_element = new Cherry5_Lock_Element( $this->settings );
62
 
63
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
64
  }
85
  */
86
  public function render() {
87
  $html = '';
88
+ $class = implode( ' ',
89
+ array(
90
+ $this->settings['class'],
91
+ $this->settings['master'],
92
+ $this->lock_element->get_class(),
93
+ )
94
+ );
95
 
96
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
97
  if ( '' !== $this->settings['label'] ) {
98
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
99
  }
100
+ $html .= '<input type="' . esc_attr( $this->settings['type'] ) . '" id="' . esc_attr( $this->settings['id'] ) . '" class="widefat cherry-ui-text" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '" placeholder="' . esc_attr( $this->settings['placeholder'] ) . '" ' . $this->get_required() . $this->lock_element->get_disabled_attr() . '>';
101
+ $html .= $this->lock_element->get_html();
102
  $html .= '</div>';
103
  return $html;
104
  }
111
  public static function enqueue_assets() {
112
  wp_enqueue_style(
113
  'ui-text',
114
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-text/assets/min/ui-text.min.css', Cherry_UI_Elements::$module_path ) ),
115
  array(),
116
+ Cherry_UI_Elements::$core_version,
117
  'all'
118
  );
119
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/min/ui-textarea.min.css CHANGED
@@ -1 +1 @@
1
- .cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}textarea.cherry-ui-textarea{width:100%;font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none;height:200px}textarea.cherry-ui-textarea:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}
1
+ .cherry-lock-element{user-select:none;cursor:no-drop;position:relative;filter:grayscale(100%)}.cherry-lock-element.inline-block{display:inline-block}.cherry-lock-element label{position:relative}.cherry-lock-element .cherry-lable-content,.cherry-lock-element .cherry-checkbox-item,.cherry-lock-element .select2-container,.cherry-lock-element>*:first-child{opacity:0.5;pointer-events:none}.cherry-lock-element a.cherry-lock-element__area{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2000;cursor:no-drop}.cherry-lock-element a.cherry-lock-element__area:focus{outline:none;box-shadow:none}.cherry-lock-element a.cherry-lock-element__area:hover .cherry-lock-element__label{animation-name:lock_show;animation-duration:450ms;animation-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1)}.cherry-lock-element__label{opacity:0;display:inline-block;background-color:rgba(0,0,0,0.9);border-radius:5px;color:#fff;padding:8px 10px;position:absolute;white-space:nowrap;top:-10px;left:50%;box-shadow:2px 2px 5px 0px rgba(0,0,0,0.5);will-change:auto;pointer-events:none;font-size:14px;line-height:16px;animation-name:lock_hide;animation-duration:200ms;animation-timing-function:cubic-bezier(0.55, 0.055, 0.675, 0.19);animation-fill-mode:both;transform-origin:0% 0%}.cherry-lock-element__label *+*{margin-right:5px}.cherry-lock-element__label:after{border:solid;border-color:rgba(0,0,0,0.9) transparent;border-width:6px 6px 0 6px;bottom:-5px;margin-left:-6px;content:"";left:50%;position:absolute}@keyframes lock_show{0%{opacity:0;filter:blur(5px);transform:scale(0) translate(-50%, 200%)}60%{opacity:0.8;transform:scale(1.1) translate(-50%, -130%)}100%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}}@keyframes lock_hide{0%{opacity:1;filter:blur(0px);transform:scale(1) translate(-50%, -100%)}100%{opacity:0;filter:blur(3px);transform:scale(0) translate(-50%, 200%)}}.cherry-ui-elements-lock{opacity:0.5;cursor:no-drop;pointer-events:none;-webkit-filter:grayscale(100%);filter:grayscale(100%)}.cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}textarea.cherry-ui-textarea{width:100%;font-size:14px;line-height:20px;color:#23282d;background-color:#f1f1f1;border-radius:2px;padding:10px 20px;min-height:50px;border:1px solid #dcdcdc;box-shadow:none;height:200px}textarea.cherry-ui-textarea:focus{border-color:rgba(41,143,252,0.6);box-shadow:0 0 2px rgba(41,143,252,0.6)}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/assets/ui-textarea.scss CHANGED
@@ -1,6 +1,13 @@
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
 
3
 
 
 
 
 
 
 
4
  .cherry-ui-container{
5
  margin: 10px 0 20px 0;
6
  }
1
  @import "ui-kit/variables";
2
  @import "ui-kit/mixins";
3
+ @import "../../../../assets/sass/lock";
4
 
5
+ .cherry-ui-elements-lock{
6
+ opacity: 0.5;
7
+ cursor: no-drop;
8
+ pointer-events: none;
9
+ filter: grayscale( 100% );
10
+ }
11
  .cherry-ui-container{
12
  margin: 10px 0 20px 0;
13
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/ui-textarea.php CHANGED
@@ -38,8 +38,18 @@ if ( ! class_exists( 'UI_Textarea' ) ) {
38
  'label' => '',
39
  'class' => '',
40
  'master' => '',
 
41
  );
42
 
 
 
 
 
 
 
 
 
 
43
  /**
44
  * Constructor method for the UI_Textarea class.
45
  *
@@ -48,6 +58,7 @@ if ( ! class_exists( 'UI_Textarea' ) ) {
48
  function __construct( $args = array() ) {
49
  $this->defaults_settings['id'] = 'cherry-ui-textarea-' . uniqid();
50
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
 
51
 
52
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
53
  }
@@ -59,14 +70,20 @@ if ( ! class_exists( 'UI_Textarea' ) ) {
59
  */
60
  public function render() {
61
  $html = '';
62
- $class = $this->settings['class'];
63
- $class .= ' ' . $this->settings['master'];
 
 
 
 
 
64
 
65
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
66
  if ( '' !== $this->settings['label'] ) {
67
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . $this->settings['label'] . '</label> ';
68
  }
69
- $html .= '<textarea id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-ui-textarea" name="' . esc_attr( $this->settings['name'] ) . '" rows="' . esc_attr( $this->settings['rows'] ) . '" cols="' . esc_attr( $this->settings['cols'] ) . '" placeholder="' . esc_attr( $this->settings['placeholder'] ) . '">' . esc_html( $this->settings['value'] ) . '</textarea>';
 
70
  $html .= '</div>';
71
 
72
  return $html;
@@ -78,11 +95,12 @@ if ( ! class_exists( 'UI_Textarea' ) ) {
78
  * @since 1.0.0
79
  */
80
  public static function enqueue_assets() {
 
81
  wp_enqueue_style(
82
  'ui-textarea',
83
- esc_url( Cherry_Core::base_url( 'assets/min/ui-textarea.min.css', __FILE__ ) ),
84
  array(),
85
- '1.3.2',
86
  'all'
87
  );
88
  }
38
  'label' => '',
39
  'class' => '',
40
  'master' => '',
41
+ 'lock' => false,
42
  );
43
 
44
+ /**
45
+ * Instance of this Cherry5_Lock_Element class.
46
+ *
47
+ * @since 1.0.0
48
+ * @var object
49
+ * @access private
50
+ */
51
+ private $lock_element = null;
52
+
53
  /**
54
  * Constructor method for the UI_Textarea class.
55
  *
58
  function __construct( $args = array() ) {
59
  $this->defaults_settings['id'] = 'cherry-ui-textarea-' . uniqid();
60
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
61
+ $this->lock_element = new Cherry5_Lock_Element( $this->settings );
62
 
63
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
64
  }
70
  */
71
  public function render() {
72
  $html = '';
73
+ $class = implode( ' ',
74
+ array(
75
+ $this->settings['class'],
76
+ $this->settings['master'],
77
+ $this->lock_element->get_class(),
78
+ )
79
+ );
80
 
81
  $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
82
  if ( '' !== $this->settings['label'] ) {
83
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . $this->settings['label'] . '</label> ';
84
  }
85
+ $html .= '<textarea id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-ui-textarea" name="' . esc_attr( $this->settings['name'] ) . '" rows="' . esc_attr( $this->settings['rows'] ) . '" cols="' . esc_attr( $this->settings['cols'] ) . '" placeholder="' . esc_attr( $this->settings['placeholder'] ) . '" ' . $this->lock_element->get_disabled_attr() . '>' . esc_html( $this->settings['value'] ) . '</textarea>';
86
+ $html .= $this->lock_element->get_html();
87
  $html .= '</div>';
88
 
89
  return $html;
95
  * @since 1.0.0
96
  */
97
  public static function enqueue_assets() {
98
+
99
  wp_enqueue_style(
100
  'ui-textarea',
101
+ esc_url( Cherry_Core::base_url( 'inc/ui-elements/ui-textarea/assets/min/ui-textarea.min.css', Cherry_UI_Elements::$module_path ) ),
102
  array(),
103
+ Cherry_UI_Elements::$core_version,
104
  'all'
105
  );
106
  }
cherry-framework/modules/cherry-ui-elements/ui-element.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Framework
6
  * @subpackage Abstract Class
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.en.html
11
  */
@@ -30,21 +30,6 @@ if ( ! class_exists( 'UI_Element' ) ) {
30
  */
31
  protected $settings = array();
32
 
33
- /**
34
- * Get current file URL
35
- *
36
- * @since 1.0.0
37
- * @deprecated 1.0.3 Use `Cherry_Core::base_url()` method
38
- */
39
- public static function get_current_file_url( $file ) {
40
- $assets_url = dirname( $file );
41
- $site_url = site_url();
42
- $assets_url = str_replace( untrailingslashit( ABSPATH ), $site_url, $assets_url );
43
- $assets_url = str_replace( '\\', '/', $assets_url );
44
-
45
- return $assets_url;
46
- }
47
-
48
  /**
49
  * Get control value
50
  *
5
  * @package Cherry_Framework
6
  * @subpackage Abstract Class
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.en.html
11
  */
30
  */
31
  protected $settings = array();
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  /**
34
  * Get control value
35
  *
cherry-framework/modules/cherry-utility/cherry-utility.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Utility
4
  * Description: Multiple utility functions
5
- * Version: 1.1.6
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.1.6
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
@@ -57,6 +55,15 @@ if ( ! class_exists( 'Cherry_Utility' ) ) {
57
  ),
58
  );
59
 
 
 
 
 
 
 
 
 
 
60
  /**
61
  * Utilit class.
62
  *
@@ -71,7 +78,9 @@ if ( ! class_exists( 'Cherry_Utility' ) ) {
71
  * @since 1.0.0
72
  */
73
  public function __construct( $core, $args = array() ) {
74
- $this->args = array_merge( $this->args, $args );
 
 
75
  $this->utility_require( $core );
76
  }
77
 
@@ -79,7 +88,6 @@ if ( ! class_exists( 'Cherry_Utility' ) ) {
79
  * Require utility.
80
  *
81
  * @since 1.0.0
82
- * @since 1.1.1 Using dirname( __FILE__ ) instead of __DIR__.
83
  * @return void
84
  */
85
  public function utility_require() {
@@ -92,7 +100,7 @@ if ( ! class_exists( 'Cherry_Utility' ) ) {
92
 
93
  foreach ( $utility as $utilit ) {
94
 
95
- require_once( dirname( __FILE__ ) . '/inc/cherry-' . $utilit . '-utilit.php' );
96
 
97
  $utilit = str_replace( '-', ' ', $utilit );
98
  $class_name = ucwords( $utilit );
@@ -100,7 +108,9 @@ if ( ! class_exists( 'Cherry_Utility' ) ) {
100
  $utilit = str_replace( ' ', '_', $utilit );
101
  $class_name = 'Cherry_' . $class_name . '_Utilit';
102
 
103
- $this->utility->$utilit = new $class_name( $this );
 
 
104
  }
105
  }
106
  }
2
  /**
3
  * Module Name: Utility
4
  * Description: Multiple utility functions
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
55
  ),
56
  );
57
 
58
+ /**
59
+ * Module directory path.
60
+ *
61
+ * @since 1.5.0
62
+ * @access protected
63
+ * @var srting.
64
+ */
65
+ protected $module_path;
66
+
67
  /**
68
  * Utilit class.
69
  *
78
  * @since 1.0.0
79
  */
80
  public function __construct( $core, $args = array() ) {
81
+ $this->args = array_merge( $this->args, $args );
82
+ $this->module_path = $args['module_path'];
83
+
84
  $this->utility_require( $core );
85
  }
86
 
88
  * Require utility.
89
  *
90
  * @since 1.0.0
 
91
  * @return void
92
  */
93
  public function utility_require() {
100
 
101
  foreach ( $utility as $utilit ) {
102
 
103
+ require_once( $this->module_path . '/inc/cherry-' . $utilit . '-utilit.php' );
104
 
105
  $utilit = str_replace( '-', ' ', $utilit );
106
  $class_name = ucwords( $utilit );
108
  $utilit = str_replace( ' ', '_', $utilit );
109
  $class_name = 'Cherry_' . $class_name . '_Utilit';
110
 
111
+ $instance = new $class_name( $this );
112
+
113
+ $this->utility->{$utilit} = $instance;
114
  }
115
  }
116
  }
cherry-framework/modules/cherry-utility/inc/cherry-attributes-utilit.php CHANGED
@@ -52,10 +52,13 @@ if ( ! class_exists( 'Cherry_Attributes_Utilit' ) ) {
52
  $html = '' ;
53
 
54
  if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) && 0 !== $args['length'] ) {
55
- $title = $title_cut = ( 'post' === $type ) ? $object->post_title : $object->name ;
56
- $title = ( $args['title'] ) ? 'title="' . $args['title'] . '"' : 'title="' . $title . '"' ;
 
 
57
  $title_cut = $this->cut_text( $title_cut, $args['length'], $args['trimmed_type'], $args['ending'] );
58
- $link = ( 'post' === $type ) ? $this->get_post_permalink() : $this->get_term_permalink( $object->term_id );
 
59
  $html_class = ( $args['class'] ) ? 'class="' . $args['class'] . '"' : '' ;
60
 
61
  $html = sprintf( $args['html'], $html_class, $link, $title, $title_cut );
52
  $html = '' ;
53
 
54
  if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) && 0 !== $args['length'] ) {
55
+ $title = ( 'post' === $type ) ? $object->post_title : $object->name;
56
+ $title_cut = $title;
57
+
58
+ $title = ( $args['title'] ) ? 'title="' . $args['title'] . '"' : 'title="' . $title . '"';
59
  $title_cut = $this->cut_text( $title_cut, $args['length'], $args['trimmed_type'], $args['ending'] );
60
+
61
+ $link = ( 'post' === $type ) ? $this->get_post_permalink() : $this->get_term_permalink( $object->term_id );
62
  $html_class = ( $args['class'] ) ? 'class="' . $args['class'] . '"' : '' ;
63
 
64
  $html = sprintf( $args['html'], $html_class, $link, $title, $title_cut );
cherry-framework/modules/cherry-utility/inc/cherry-media-utilit.php CHANGED
@@ -196,7 +196,9 @@ if ( ! class_exists( 'Cherry_Media_Utilit' ) ) {
196
  return '';
197
  }
198
 
199
- $html = wp_oembed_get( $url_array[0], array( 'width' => $size_array['width'] ) );
 
 
200
 
201
  if ( ! $html ) {
202
  $url_array = $this->sorted_array( $url_array );
196
  return '';
197
  }
198
 
199
+ $html = wp_oembed_get( $url_array[0], array(
200
+ 'width' => $size_array['width'],
201
+ ) );
202
 
203
  if ( ! $html ) {
204
  $url_array = $this->sorted_array( $url_array );
cherry-framework/modules/cherry-utility/inc/cherry-meta-data-utilit.php CHANGED
@@ -127,7 +127,8 @@ if ( ! class_exists( 'Cherry_Meta_Data_Utilit' ) ) {
127
 
128
  $args['suffix'] = ( isset( $args['sufix'] ) ) ? $args['sufix'] : $args['suffix'];
129
 
130
- $html = $count = '' ;
 
131
 
132
  if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
133
  $post_type = get_post_type( $object->ID );
127
 
128
  $args['suffix'] = ( isset( $args['sufix'] ) ) ? $args['sufix'] : $args['suffix'];
129
 
130
+ $html = '';
131
+ $count = '';
132
 
133
  if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
134
  $post_type = get_post_type( $object->ID );
cherry-framework/modules/cherry-utility/inc/cherry-satellite-utilit.php CHANGED
@@ -180,10 +180,10 @@ if ( ! class_exists( 'Cherry_Satellite_Utilit' ) ) {
180
  *
181
  * @since 1.0.0
182
  * @param [type] $tax - category, post_tag, post_format.
183
- * @param [type] $key - slug, term_id.
184
  * @return array
185
  */
186
- public function get_terms_array( $tax = array( 'category' ), $key = 'slug' ) {
187
  $terms = array();
188
  $tax = is_array( $tax ) ? $tax : array( $tax ) ;
189
 
@@ -193,13 +193,17 @@ if ( ! class_exists( 'Cherry_Satellite_Utilit' ) ) {
193
  }
194
  }
195
 
196
- $all_terms = (array) get_terms( $tax, array( 'hide_empty' => 0, 'hierarchical' => 0 ) );
 
 
 
 
197
  if ( empty( $all_terms ) || is_wp_error( $all_terms ) ) {
198
  return '';
199
  }
200
 
201
  foreach ( $all_terms as $term ) {
202
- $terms[ $term->slug ] = $term->name;
203
  }
204
 
205
  return $terms;
180
  *
181
  * @since 1.0.0
182
  * @param [type] $tax - category, post_tag, post_format.
183
+ * @param [type] $return_key - slug, term_id.
184
  * @return array
185
  */
186
+ public function get_terms_array( $tax = array( 'category' ), $return_key = 'slug' ) {
187
  $terms = array();
188
  $tax = is_array( $tax ) ? $tax : array( $tax ) ;
189
 
193
  }
194
  }
195
 
196
+ $all_terms = (array) get_terms( $tax, array(
197
+ 'hide_empty' => 0,
198
+ 'hierarchical' => 0,
199
+ ) );
200
+
201
  if ( empty( $all_terms ) || is_wp_error( $all_terms ) ) {
202
  return '';
203
  }
204
 
205
  foreach ( $all_terms as $term ) {
206
+ $terms[ $term->$return_key ] = $term->name;
207
  }
208
 
209
  return $terms;
cherry-framework/modules/cherry-widget-factory/cherry-widget-factory.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Widget Factory
4
  * Description: Base widget class that simplifies creating of your own widgets.
5
- * Version: 1.2.1
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.2.1
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
@@ -50,6 +48,15 @@ if ( ! class_exists( 'Cherry_Widget_Factory' ) ) {
50
  */
51
  public $core = null;
52
 
 
 
 
 
 
 
 
 
 
53
  /**
54
  * A reference to an instance of this class.
55
  *
@@ -62,9 +69,10 @@ if ( ! class_exists( 'Cherry_Widget_Factory' ) ) {
62
  * Constructor for the module
63
  */
64
  function __construct( $core, $args ) {
 
 
 
65
 
66
- $this->core = $core;
67
- $this->args = $args;
68
  $this->include_abstract_widget();
69
  add_filter( 'cherry_widget_factory_core', array( $this, 'pass_core_to_widgets' ), 10, 2 );
70
  }
@@ -79,7 +87,7 @@ if ( ! class_exists( 'Cherry_Widget_Factory' ) ) {
79
  public function pass_core_to_widgets( $core, $path ) {
80
 
81
  $path = str_replace( '\\', '/', $path );
82
- $current_core = str_replace( '\\', '/', $this->core->settings['extra_base_dir'] );
83
 
84
  if ( false !== strpos( $path, $current_core ) ) {
85
  return $this->core;
@@ -92,11 +100,10 @@ if ( ! class_exists( 'Cherry_Widget_Factory' ) ) {
92
  * Include abstract widget class
93
  *
94
  * @since 1.0.0
95
- * @since 1.1.2 Using dirname( __FILE__ ) instead of __DIR__.
96
  * @return void
97
  */
98
  public function include_abstract_widget() {
99
- require_once( dirname( __FILE__ ) . '/inc/class-cherry-abstract-widget.php' );
100
  }
101
 
102
  /**
2
  /**
3
  * Module Name: Widget Factory
4
  * Description: Base widget class that simplifies creating of your own widgets.
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
48
  */
49
  public $core = null;
50
 
51
+ /**
52
+ * Module directory path.
53
+ *
54
+ * @since 1.5.0
55
+ * @access protected
56
+ * @var srting.
57
+ */
58
+ public static $module_path;
59
+
60
  /**
61
  * A reference to an instance of this class.
62
  *
69
  * Constructor for the module
70
  */
71
  function __construct( $core, $args ) {
72
+ $this->core = $core;
73
+ $this->args = $args;
74
+ self::$module_path = $args['module_path'];
75
 
 
 
76
  $this->include_abstract_widget();
77
  add_filter( 'cherry_widget_factory_core', array( $this, 'pass_core_to_widgets' ), 10, 2 );
78
  }
87
  public function pass_core_to_widgets( $core, $path ) {
88
 
89
  $path = str_replace( '\\', '/', $path );
90
+ $current_core = str_replace( '\\', '/', $this->core->settings['base_dir'] );
91
 
92
  if ( false !== strpos( $path, $current_core ) ) {
93
  return $this->core;
100
  * Include abstract widget class
101
  *
102
  * @since 1.0.0
 
103
  * @return void
104
  */
105
  public function include_abstract_widget() {
106
+ require_once( self::$module_path . '/inc/class-cherry-abstract-widget.php' );
107
  }
108
 
109
  /**
cherry-framework/modules/cherry-widget-factory/inc/class-cherry-abstract-widget.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Framework
6
  * @subpackage Class
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.en.html
11
  */
@@ -58,18 +58,11 @@ if ( ! class_exists( 'Cherry_Abstract_Widget' ) ) {
58
  public $settings;
59
 
60
  /**
61
- * Existing field types
62
- *
63
- * @var array
64
- */
65
- public $field_types = array();
66
-
67
- /**
68
- * UI builder instance
69
  *
70
  * @var object
71
  */
72
- public $ui_builder;
73
 
74
  /**
75
  * Temporary arguments holder
@@ -208,19 +201,13 @@ if ( ! class_exists( 'Cherry_Abstract_Widget' ) ) {
208
  return false;
209
  }
210
 
211
- array_walk( $this->settings, array( $this, 'set_field_types' ) );
212
-
213
- if ( in_array( 'slider', $this->field_types ) ) {
214
- $this->field_types[] = 'stepper';
215
- }
216
-
217
  $core = $this->get_core();
218
 
219
  if ( ! $core ) {
220
  return false;
221
  }
222
 
223
- $this->ui_builder = $core->init_module( 'cherry-ui-elements', array( 'ui_elements' => $this->field_types ) );
224
 
225
  return true;
226
  }
@@ -267,7 +254,7 @@ if ( ! class_exists( 'Cherry_Abstract_Widget' ) ) {
267
  public function get_core() {
268
 
269
  if ( null == $this->core ) {
270
- $this->core = apply_filters( 'cherry_widget_factory_core', false, dirname( __FILE__ ) );
271
  }
272
 
273
  return $this->core;
@@ -283,7 +270,9 @@ if ( ! class_exists( 'Cherry_Abstract_Widget' ) ) {
283
  * @return string the content that was cached
284
  */
285
  public function cache_widget( $args, $content ) {
286
- wp_cache_set( $this->get_cache_id(), array( $args['widget_id'] => $content ), 'widget' );
 
 
287
 
288
  return $content;
289
  }
@@ -398,96 +387,6 @@ if ( ! class_exists( 'Cherry_Abstract_Widget' ) ) {
398
  }
399
  }
400
 
401
- /**
402
- * Store field types used in this widget into class property
403
- *
404
- * @since 1.0.0
405
- * @param array $field field data.
406
- * @param [type] $id field key.
407
- * @return bool
408
- */
409
- public function set_field_types( $field, $id ) {
410
-
411
- if ( ! is_array( $field ) || ! isset( $field['type'] ) ) {
412
- return false;
413
- }
414
-
415
- if ( ! in_array( $field['type'], $this->field_types ) ) {
416
- $this->field_types[] = $field['type'];
417
- }
418
-
419
- $this->maybe_add_repeater_fields( $field );
420
-
421
- return true;
422
-
423
- }
424
-
425
- /**
426
- * Maybe add reapeater sub-fields to required elements list
427
- *
428
- * @since 1.0.1
429
- * @param array $field field data.
430
- * @return bool
431
- */
432
- public function maybe_add_repeater_fields( $field ) {
433
-
434
- if ( 'repeater' !== $field['type'] || empty( $field['fields'] ) ) {
435
- return false;
436
- }
437
-
438
- foreach ( $field['fields'] as $repeater_field ) {
439
- $this->set_field_types( $repeater_field, null );
440
- }
441
-
442
- return true;
443
-
444
- }
445
-
446
- /**
447
- * Render single from control.
448
- *
449
- * @param array $args control arguments.
450
- * @return void|null
451
- */
452
- public function render_control( $args ) {
453
-
454
- $allowed_controls = array(
455
- 'text',
456
- 'textarea',
457
- 'checkbox',
458
- 'colorpicker',
459
- 'media',
460
- 'radio',
461
- 'select',
462
- 'slider',
463
- 'stepper',
464
- 'switcher',
465
- 'slider',
466
- 'collection',
467
- 'chooseicons',
468
- 'repeater',
469
- 'iconpicker',
470
- );
471
-
472
- if ( ! in_array( $args['type'], $allowed_controls ) ) {
473
- do_action( 'cherry_widget_factory_control', $args );
474
- return;
475
- }
476
-
477
- if ( ! is_object( $this->ui_builder ) ) {
478
- return;
479
- }
480
-
481
- $current_element = $this->ui_builder->get_ui_element_instance( $args['type'], $args );
482
-
483
- ?>
484
- <div>
485
- <?php echo $current_element->render(); ?>
486
- </div>
487
- <?php
488
-
489
- }
490
-
491
  /**
492
  * Show widget form
493
  *
@@ -502,54 +401,40 @@ if ( ! class_exists( 'Cherry_Abstract_Widget' ) ) {
502
  return;
503
  }
504
 
505
- foreach ( $this->settings as $key => $setting ) {
506
 
507
- $value = isset( $instance[ $key ] ) ? $instance[ $key ] : Cherry_Toolkit::get_arg( $setting, 'value', '' );
508
 
509
  if ( isset( $setting['options_callback'] ) ) {
510
 
511
- $callback = $this->get_callback_data( $setting['options_callback'] );
512
- $options = call_user_func_array( $callback['callback'], $callback['args'] );
 
 
513
 
514
- } else {
515
- $options = Cherry_Toolkit::get_arg( $setting, 'options', array() );
516
  }
517
 
518
- $args = array(
519
- 'type' => Cherry_Toolkit::get_arg( $setting, 'type', 'text' ),
520
- 'id' => $this->get_field_id( $key ),
521
- 'name' => $this->get_field_name( $key ),
522
- 'value' => $value,
523
- 'label' => Cherry_Toolkit::get_arg( $setting, 'label', '' ),
524
- 'options' => $options,
525
- 'multiple' => Cherry_Toolkit::get_arg( $setting, 'multiple', false ),
526
- 'filter' => Cherry_Toolkit::get_arg( $setting, 'filter', false ),
527
- 'size' => Cherry_Toolkit::get_arg( $setting, 'size', 1 ),
528
- 'null_option' => Cherry_Toolkit::get_arg( $setting, 'null_option', 'None' ),
529
- 'multi_upload' => Cherry_Toolkit::get_arg( $setting, 'multi_upload', true ),
530
- 'library_type' => Cherry_Toolkit::get_arg( $setting, 'library_type', 'image' ),
531
- 'upload_button_text' => Cherry_Toolkit::get_arg( $setting, 'upload_button_text', 'Choose' ),
532
- 'max_value' => Cherry_Toolkit::get_arg( $setting, 'max_value', '100' ),
533
- 'min_value' => Cherry_Toolkit::get_arg( $setting, 'min_value', '0' ),
534
- 'step_value' => Cherry_Toolkit::get_arg( $setting, 'step_value', '1' ),
535
- 'style' => Cherry_Toolkit::get_arg( $setting, 'style', 'normal' ),
536
- 'placeholder' => Cherry_Toolkit::get_arg( $setting, 'placeholder', '' ),
537
- 'toggle' => Cherry_Toolkit::get_arg( $setting, 'toggle', array(
538
- 'true_toggle' => 'On',
539
- 'false_toggle' => 'Off',
540
- 'true_slave' => '',
541
- 'false_slave' => '',
542
- ) ),
543
- 'master' => Cherry_Toolkit::get_arg( $setting, 'master', '' ),
544
- 'icon_data' => Cherry_Toolkit::get_arg( $setting, 'icon_data', array() ),
545
- 'title_field' => Cherry_Toolkit::get_arg( $setting, 'title_field' ),
546
- 'add_label' => Cherry_Toolkit::get_arg( $setting, 'add_label', '' ),
547
- 'fields' => Cherry_Toolkit::get_arg( $setting, 'fields', array() ),
548
- 'ui_kit' => Cherry_Toolkit::get_arg( $setting, 'ui_kit', true ),
549
- );
550
 
551
- $this->render_control( $args );
552
  }
 
 
553
  }
554
 
555
  /**
@@ -588,7 +473,7 @@ if ( ! class_exists( 'Cherry_Abstract_Widget' ) ) {
588
  */
589
  public function setup_widget_data( $args, $instance ) {
590
  $this->args = $args;
591
- $this->instance = $instance;
592
  }
593
 
594
  /**
5
  * @package Cherry_Framework
6
  * @subpackage Class
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.en.html
11
  */
58
  public $settings;
59
 
60
  /**
61
+ * Interface builder instance.
 
 
 
 
 
 
 
62
  *
63
  * @var object
64
  */
65
+ public $builder = null;
66
 
67
  /**
68
  * Temporary arguments holder
201
  return false;
202
  }
203
 
 
 
 
 
 
 
204
  $core = $this->get_core();
205
 
206
  if ( ! $core ) {
207
  return false;
208
  }
209
 
210
+ $this->builder = $core->init_module( 'cherry-interface-builder', array() );
211
 
212
  return true;
213
  }
254
  public function get_core() {
255
 
256
  if ( null == $this->core ) {
257
+ $this->core = apply_filters( 'cherry_widget_factory_core', false, Cherry_Widget_Factory::$module_path );
258
  }
259
 
260
  return $this->core;
270
  * @return string the content that was cached
271
  */
272
  public function cache_widget( $args, $content ) {
273
+ wp_cache_set( $this->get_cache_id(), array(
274
+ $args['widget_id'] => $content,
275
+ ), 'widget' );
276
 
277
  return $content;
278
  }
387
  }
388
  }
389
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  /**
391
  * Show widget form
392
  *
401
  return;
402
  }
403
 
404
+ $this->builder->reset_structure();
405
 
406
+ foreach ( $this->settings as $key => $setting ) {
407
 
408
  if ( isset( $setting['options_callback'] ) ) {
409
 
410
+ $callback = $this->get_callback_data( $setting['options_callback'] );
411
+ $setting['options'] = call_user_func_array( $callback['callback'], $callback['args'] );
412
+
413
+ unset( $setting['options_callback'] );
414
 
 
 
415
  }
416
 
417
+ $value = isset( $instance[ $key ] ) ? $instance[ $key ] : Cherry_Toolkit::get_arg( $setting, 'value', '' );
418
+
419
+ $element = Cherry_Toolkit::get_arg( $setting, 'element', 'control' );
420
+ $setting['id'] = $this->get_field_id( $key );
421
+ $setting['name'] = $this->get_field_name( $key );
422
+ $setting['type'] = Cherry_Toolkit::get_arg( $setting, 'type', '' );
423
+ $setting['value'] = $value;
424
+
425
+ if ( 'select' === $setting['type'] && ! isset( $setting['placeholder'] ) ) {
426
+ $setting['placeholder'] = '';
427
+ }
428
+
429
+ $register_callback = 'register_' . $element;
430
+
431
+ if ( method_exists( $this->builder, $register_callback ) ) {
432
+ call_user_func( array( $this->builder, $register_callback ), array( $key => $setting ) );
433
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
 
 
435
  }
436
+
437
+ $this->builder->render();
438
  }
439
 
440
  /**
473
  */
474
  public function setup_widget_data( $args, $instance ) {
475
  $this->args = $args;
476
+ $this->instance = $this->prepare_instance( $instance, $this );
477
  }
478
 
479
  /**
cherry-framework/modules/cherry5-assets-loader/assets/append.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Handler for Assets loader
3
+ */
4
+ function CherryAssetsLoader( tags, context ) {
5
+
6
+ 'use strict';
7
+
8
+ tags.forEach( function( item ) {
9
+ if ( 'body' === context ) {
10
+ jQuery( 'body' ).append( item );
11
+ } else {
12
+ jQuery( 'head' ).append( item );
13
+ }
14
+ } );
15
+
16
+ }
cherry-framework/modules/cherry5-assets-loader/assets/min/append.min.js ADDED
@@ -0,0 +1 @@
 
1
+ function CherryAssetsLoader(a,b){"use strict";a.forEach(function(a){"body"===b?jQuery("body").append(a):jQuery("head").append(a)})}
cherry-framework/modules/cherry5-assets-loader/assets/var.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ var cherryAssets%1$s = %2$s;
2
+ CherryAssetsLoader( cherryAssets%1$s, '%3$s' );
cherry-framework/modules/cherry5-assets-loader/cherry5-assets-loader.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Module Name: Assets Loader
4
+ * Description: The module allows you deferred loading scripts and styles.
5
+ * Author: Cherry Team
6
+ * Author URI: http://www.cherryframework.com/
7
+ * License: GPLv3
8
+ * License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
+ *
10
+ * @package Cherry_Framework
11
+ * @subpackage Modules
12
+ * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
+ * @link http://www.cherryframework.com/
15
+ * @license http://www.gnu.org/licenses/gpl-3.0.html
16
+ */
17
+
18
+ // If this file is called directly, abort.
19
+ if ( ! defined( 'WPINC' ) ) {
20
+ die;
21
+ }
22
+
23
+ // If class `Cherry5_Assets_Loader` doesn't exists yet.
24
+ if ( ! class_exists( 'Cherry5_Assets_Loader' ) ) {
25
+
26
+ /**
27
+ * Cherry5_Assets_Loader class.
28
+ */
29
+ class Cherry5_Assets_Loader {
30
+
31
+ /**
32
+ * Module slug
33
+ *
34
+ * @var string
35
+ */
36
+ public $module_slug = 'cherry5-assets-loader';
37
+
38
+ /**
39
+ * Module arguments
40
+ *
41
+ * @since 1.0.0
42
+ * @var array
43
+ * @access private
44
+ */
45
+ private $args = array();
46
+
47
+ /**
48
+ * Core instance
49
+ *
50
+ * @since 1.0.0
51
+ * @var object
52
+ * @access private
53
+ */
54
+ private $core = null;
55
+
56
+ /**
57
+ * CSS handle object for deferred loading.
58
+ *
59
+ * @var array
60
+ */
61
+ public static $css_handle = array();
62
+
63
+ /**
64
+ * JS handle object for deferred loading.
65
+ *
66
+ * @var array
67
+ */
68
+ public static $js_handle = array();
69
+
70
+ /**
71
+ * Is module hooks initialized or not.
72
+ *
73
+ * @var boolean
74
+ */
75
+ public static $initialized = false;
76
+
77
+ /**
78
+ * Class constructor.
79
+ *
80
+ * @since 1.0.0
81
+ * @access public
82
+ * @return void
83
+ */
84
+ public function __construct( $core = null, $args = array() ) {
85
+
86
+ $this->args = $args;
87
+ $this->init();
88
+
89
+ if ( ! empty( $this->args['css'] ) && is_array( $this->args['css'] ) ) {
90
+ self::$css_handle->add_handles( $this->args['css'] );
91
+ }
92
+
93
+ if ( ! empty( $this->args['js'] ) && is_array( $this->args['js'] ) ) {
94
+ self::$js_handle->add_handles( $this->args['js'] );
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Initialize module hooks
100
+ *
101
+ * @return bool|void
102
+ */
103
+ public function init() {
104
+
105
+ if ( true === self::$initialized ) {
106
+ return null;
107
+ }
108
+
109
+ require_once 'inc/cherry5-assets-loader-handle.php';
110
+ require_once 'inc/cherry5-assets-loader-handle-css.php';
111
+ require_once 'inc/cherry5-assets-loader-handle-js.php';
112
+
113
+ self::$css_handle = new Cherry5_Assets_Loader_Handle_CSS();
114
+ self::$js_handle = new Cherry5_Assets_Loader_Handle_JS();
115
+
116
+ self::$initialized = true;
117
+
118
+ ob_start();
119
+ include 'assets/min/append.min.js';
120
+ $append_handler = ob_get_clean();
121
+ wp_add_inline_script( 'cherry-js-core', $append_handler );
122
+
123
+ }
124
+
125
+ /**
126
+ * Returns new module instance.
127
+ *
128
+ * @since 1.0.0
129
+ * @return object
130
+ */
131
+ public static function get_instance( $core, $args ) {
132
+ return new self( $core, $args );
133
+ }
134
+
135
+ }
136
+ }
cherry-framework/modules/cherry5-assets-loader/inc/cherry5-assets-loader-handle-css.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CSS lodaer handler class
4
+ *
5
+ * @package Cherry_Framework
6
+ * @author Cherry Team <cherryframework@gmail.com>
7
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
8
+ * @link http://www.cherryframework.com/
9
+ * @license http://www.gnu.org/licenses/gpl-3.0.html
10
+ */
11
+
12
+ // If this file is called directly, abort.
13
+ if ( ! defined( 'WPINC' ) ) {
14
+ die;
15
+ }
16
+
17
+ if ( ! class_exists( 'Cherry5_Assets_Loader_Handle_CSS' ) ) {
18
+
19
+ /**
20
+ * Define Cherry5_Assets_Loader_Handle_CSS class
21
+ */
22
+ class Cherry5_Assets_Loader_Handle_CSS extends Cherry5_Assets_Loader_Handle {
23
+
24
+ /**
25
+ * Handles list
26
+ *
27
+ * @var array
28
+ */
29
+ public $handles = array();
30
+
31
+ /**
32
+ * Handles list
33
+ *
34
+ * @var array
35
+ */
36
+ public $prepared_handles = array();
37
+
38
+ /**
39
+ * Define required properies
40
+ */
41
+ public function __construct() {
42
+
43
+ $this->context = 'style';
44
+ $this->init();
45
+
46
+ }
47
+
48
+ }
49
+
50
+ }
cherry-framework/modules/cherry5-assets-loader/inc/cherry5-assets-loader-handle-js.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JS lodaer handler class
4
+ *
5
+ * @package Cherry_Framework
6
+ * @author Cherry Team <cherryframework@gmail.com>
7
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
8
+ * @link http://www.cherryframework.com/
9
+ * @license http://www.gnu.org/licenses/gpl-3.0.html
10
+ */
11
+
12
+ // If this file is called directly, abort.
13
+ if ( ! defined( 'WPINC' ) ) {
14
+ die;
15
+ }
16
+
17
+ if ( ! class_exists( 'Cherry5_Assets_Loader_Handle_JS' ) ) {
18
+
19
+ /**
20
+ * Define Cherry5_Assets_Loader_Handle_JS class
21
+ */
22
+ class Cherry5_Assets_Loader_Handle_JS extends Cherry5_Assets_Loader_Handle {
23
+
24
+ /**
25
+ * Handles list
26
+ *
27
+ * @var array
28
+ */
29
+ public $handles = array();
30
+
31
+ /**
32
+ * Handles list
33
+ *
34
+ * @var array
35
+ */
36
+ public $prepared_handles = array();
37
+
38
+ /**
39
+ * Define required properies
40
+ */
41
+ public function __construct() {
42
+
43
+ $this->context = 'script';
44
+ $this->init();
45
+
46
+ }
47
+
48
+ }
49
+
50
+ }
cherry-framework/modules/cherry5-assets-loader/inc/cherry5-assets-loader-handle.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Base lodaer handler class
4
+ *
5
+ * @package Cherry_Framework
6
+ * @author Cherry Team <cherryframework@gmail.com>
7
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
8
+ * @link http://www.cherryframework.com/
9
+ * @license http://www.gnu.org/licenses/gpl-3.0.html
10
+ */
11
+
12
+ // If this file is called directly, abort.
13
+ if ( ! defined( 'WPINC' ) ) {
14
+ die;
15
+ }
16
+
17
+ if ( ! class_exists( 'Cherry5_Assets_Loader_Handle' ) ) {
18
+
19
+ /**
20
+ * Define Cherry5_Assets_Loader_Handle class
21
+ */
22
+ class Cherry5_Assets_Loader_Handle {
23
+
24
+ /**
25
+ * Handles list
26
+ *
27
+ * @var array
28
+ */
29
+ public $handles = array();
30
+
31
+ /**
32
+ * Handles list
33
+ *
34
+ * @var array
35
+ */
36
+ public $prepared_handles = array();
37
+
38
+ /**
39
+ * Handlex context (defined in child classes)
40
+ *
41
+ * @var string
42
+ */
43
+ public $context = null;
44
+
45
+ /**
46
+ * Initalize defer loading
47
+ *
48
+ * @return void
49
+ */
50
+ public function init() {
51
+
52
+ if ( null !== $this->context ) {
53
+ add_filter( $this->context . '_loader_tag', array( $this, 'defer' ), 10, 3 );
54
+ add_action( 'wp_footer', array( $this, 'print_tags_var' ), 99 );
55
+ }
56
+
57
+ }
58
+
59
+ /**
60
+ * Store tag for deferred loading.
61
+ *
62
+ * @return string
63
+ */
64
+ public function defer( $tag, $handle, $src ) {
65
+
66
+ if ( in_array( $handle, $this->handles ) ) {
67
+ $this->prepared_handles[] = $tag;
68
+ $tag = '';
69
+ }
70
+
71
+ return $tag;
72
+ }
73
+
74
+ /**
75
+ * Add new handles into list before processing
76
+ */
77
+ public function add_handles( $handles = array() ) {
78
+ $this->handles = array_merge( $this->handles, $handles );
79
+ $this->handles = array_unique( $this->handles );
80
+ }
81
+
82
+ /**
83
+ * Print stored handles.
84
+ *
85
+ * @return void|null
86
+ */
87
+ public function print_tags_var() {
88
+
89
+ if ( empty( $this->prepared_handles ) || null === $this->context ) {
90
+ return;
91
+ }
92
+
93
+ $path = preg_replace( '/[\\\\\/]inc$/', '/assets/var.js', $this->module_path );
94
+
95
+ ob_start();
96
+ include $path;
97
+ $var_template = ob_get_clean();
98
+
99
+ $js_context = ( 'style' === $this->context ) ? 'head' : 'body';
100
+
101
+ $var = sprintf(
102
+ $var_template,
103
+ ucfirst( $this->context ),
104
+ json_encode( $this->prepared_handles ),
105
+ $js_context
106
+ );
107
+
108
+ echo '<script type="text/javascript">' . $var . '</script>';
109
+ }
110
+
111
+ }
112
+
113
+ }
cherry-framework/modules/cherry5-insert-shortcode/assets/cherry-insert-shortcode.scss CHANGED
@@ -22,7 +22,6 @@ $border: 1px solid rgba(0, 0, 0, 0.1) ;
22
  text-transform: capitalize;
23
  box-sizing: border-box;
24
  white-space: nowrap;
25
- //height: 28px;
26
  text-decoration: none;
27
  font-weight: normal;
28
  line-height: 26px;
22
  text-transform: capitalize;
23
  box-sizing: border-box;
24
  white-space: nowrap;
 
25
  text-decoration: none;
26
  font-weight: normal;
27
  line-height: 26px;
cherry-framework/modules/cherry5-insert-shortcode/cherry5-insert-shortcode.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * Module Name: Insert Shortcode
4
  * Description: The module allows you to add shortcodes from editor tinyMCE.
5
- * Version: 1.0.1
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,9 +9,8 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.0.1
14
  * @author Cherry Team <cherryframework@gmail.com>
15
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
17
  * @license http://www.gnu.org/licenses/gpl-3.0.html
18
  */
@@ -31,12 +29,22 @@ if ( ! class_exists( 'Cherry5_Insert_Shortcode' ) ) {
31
  class Cherry5_Insert_Shortcode {
32
 
33
  /**
34
- * Module version.
35
  *
36
- * @since 1.0.0
 
37
  * @var string
38
  */
39
- private $module_version = '1.0.1';
 
 
 
 
 
 
 
 
 
40
 
41
  /**
42
  * A reference to an instance of this class.
@@ -48,7 +56,7 @@ if ( ! class_exists( 'Cherry5_Insert_Shortcode' ) ) {
48
  private static $instance = null;
49
 
50
  /**
51
- * Module arguments
52
  *
53
  * @since 1.0.0
54
  * @var array
@@ -57,7 +65,7 @@ if ( ! class_exists( 'Cherry5_Insert_Shortcode' ) ) {
57
  private $args = array();
58
 
59
  /**
60
- * Core instance
61
  *
62
  * @since 1.0.0
63
  * @var object
@@ -68,8 +76,8 @@ if ( ! class_exists( 'Cherry5_Insert_Shortcode' ) ) {
68
  /**
69
  * UI element instance.
70
  *
71
- * @since 1.0.0
72
- * @var object
73
  * @access public
74
  */
75
  public $ui_elements = null;
@@ -77,8 +85,8 @@ if ( ! class_exists( 'Cherry5_Insert_Shortcode' ) ) {
77
  /**
78
  * Cherry Interface Builder instance.
79
  *
80
- * @since 1.0.0
81
- * @var object
82
  * @access public
83
  */
84
  public $cherry_interface_builder = null;
@@ -104,8 +112,8 @@ if ( ! class_exists( 'Cherry5_Insert_Shortcode' ) ) {
104
  /**
105
  * Shortcode list.
106
  *
107
- * @since 1.0.0
108
- * @var object
109
  * @access private
110
  */
111
  private $added_shortcodes = array();
@@ -120,10 +128,12 @@ if ( ! class_exists( 'Cherry5_Insert_Shortcode' ) ) {
120
  public function __construct( $core = null, $args = array(), $init = true ) {
121
  if ( $init ) {
122
  $this->core = $core;
 
 
 
123
  $this->args = array_merge_recursive(
124
  $args,
125
  array(
126
- 'module_dir' => trailingslashit( dirname( __FILE__ ) ),
127
  'in_screen' => array( 'post' ),
128
  )
129
  );
@@ -154,8 +164,8 @@ if ( ! class_exists( 'Cherry5_Insert_Shortcode' ) ) {
154
  * @return void
155
  */
156
  private function includes() {
157
- require_once( dirname( __FILE__ ) . '/inc/class-cherry5-insertion-button.php' );
158
- require_once( dirname( __FILE__ ) . '/inc/class-cherry5-insertion-popup.php' );
159
  }
160
 
161
  /**
@@ -167,10 +177,22 @@ if ( ! class_exists( 'Cherry5_Insert_Shortcode' ) ) {
167
  */
168
  public function register_assets() {
169
  // Register stylesheets.
170
- wp_register_style( 'cherry5-insert-shortcode', esc_url( Cherry_Core::base_url( 'assets/min/cherry-insert-shortcode.min.css', __FILE__ ) ), array(), $this->module_version, 'all' );
 
 
 
 
 
 
171
 
172
  // Register JavaScripts.
173
- wp_register_script( 'cherry5-insert-shortcode-js', esc_url( Cherry_Core::base_url( 'assets/min/cherry-insert-shortcode.min.js', __FILE__ ) ), array( 'cherry-js-core' ), $this->module_version, true );
 
 
 
 
 
 
174
  }
175
 
176
  /**
@@ -187,8 +209,10 @@ if ( ! class_exists( 'Cherry5_Insert_Shortcode' ) ) {
187
  wp_enqueue_style( 'cherry5-insert-shortcode' );
188
  wp_enqueue_script( 'cherry5-insert-shortcode-js' );
189
 
190
- $dev_mode = ( constant( 'WP_DEBUG' ) ) ? 'true' : 'false' ;
191
- wp_localize_script( 'cherry-js-core', 'cherry5InsertShortcode', array( 'devMode' => $dev_mode ) );
 
 
192
  }
193
  }
194
 
2
  /**
3
  * Module Name: Insert Shortcode
4
  * Description: The module allows you to add shortcodes from editor tinyMCE.
 
5
  * Author: Cherry Team
6
  * Author URI: http://www.cherryframework.com/
7
  * License: GPLv3
9
  *
10
  * @package Cherry_Framework
11
  * @subpackage Modules
 
12
  * @author Cherry Team <cherryframework@gmail.com>
13
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
14
  * @link http://www.cherryframework.com/
15
  * @license http://www.gnu.org/licenses/gpl-3.0.html
16
  */
29
  class Cherry5_Insert_Shortcode {
30
 
31
  /**
32
+ * Core version.
33
  *
34
+ * @since 1.5.0
35
+ * @access public
36
  * @var string
37
  */
38
+ public $core_version = '';
39
+
40
+ /**
41
+ * Module directory path.
42
+ *
43
+ * @since 1.5.0
44
+ * @access protected
45
+ * @var srting.
46
+ */
47
+ protected $module_path;
48
 
49
  /**
50
  * A reference to an instance of this class.
56
  private static $instance = null;
57
 
58
  /**
59
+ * Module arguments.
60
  *
61
  * @since 1.0.0
62
  * @var array
65
  private $args = array();
66
 
67
  /**
68
+ * Core instance.
69
  *
70
  * @since 1.0.0
71
  * @var object
76
  /**
77
  * UI element instance.
78
  *
79
+ * @since 1.0.0
80
+ * @var object
81
  * @access public
82
  */
83
  public $ui_elements = null;
85
  /**
86
  * Cherry Interface Builder instance.
87
  *
88
+ * @since 1.0.0
89
+ * @var object
90
  * @access public
91
  */
92
  public $cherry_interface_builder = null;
112
  /**
113
  * Shortcode list.
114
  *
115
+ * @since 1.0.0
116
+ * @var object
117
  * @access private
118
  */
119
  private $added_shortcodes = array();
128
  public function __construct( $core = null, $args = array(), $init = true ) {
129
  if ( $init ) {
130
  $this->core = $core;
131
+ $this->core_version = $core->get_core_version();
132
+ $this->module_path = $args['module_path'];
133
+
134
  $this->args = array_merge_recursive(
135
  $args,
136
  array(
 
137
  'in_screen' => array( 'post' ),
138
  )
139
  );
164
  * @return void
165
  */
166
  private function includes() {
167
+ require_once( $this->module_path . 'inc/class-cherry5-insertion-button.php' );
168
+ require_once( $this->module_path . 'inc/class-cherry5-insertion-popup.php' );
169
  }
170
 
171
  /**
177
  */
178
  public function register_assets() {
179
  // Register stylesheets.
180
+ wp_register_style(
181
+ 'cherry5-insert-shortcode',
182
+ esc_url( Cherry_Core::base_url( 'assets/min/cherry-insert-shortcode.min.css', $this->module_path ) ),
183
+ array(),
184
+ $this->core_version,
185
+ 'all'
186
+ );
187
 
188
  // Register JavaScripts.
189
+ wp_register_script(
190
+ 'cherry5-insert-shortcode-js',
191
+ esc_url( Cherry_Core::base_url( 'assets/min/cherry-insert-shortcode.min.js', $this->module_path ) ),
192
+ array( 'cherry-js-core' ),
193
+ $this->core_version,
194
+ true
195
+ );
196
  }
197
 
198
  /**
209
  wp_enqueue_style( 'cherry5-insert-shortcode' );
210
  wp_enqueue_script( 'cherry5-insert-shortcode-js' );
211
 
212
+ $dev_mode = ( constant( 'WP_DEBUG' ) ) ? 'true' : 'false';
213
+ wp_localize_script( 'cherry-js-core', 'cherry5InsertShortcode', array(
214
+ 'devMode' => $dev_mode,
215
+ ) );
216
  }
217
  }
218
 
cherry-framework/modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-button.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Framework
6
  * @subpackage Modules
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package Cherry_Framework
6
  * @subpackage Modules
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package Cherry_Framework
6
  * @subpackage Modules
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
@@ -30,8 +30,8 @@ if ( ! class_exists( 'Cherry5_Insertion_Popup' ) ) {
30
  /**
31
  * Module arguments
32
  *
33
- * @since 1.0.0
34
- * @var array
35
  * @access private
36
  */
37
  private $args = array();
@@ -39,8 +39,8 @@ if ( ! class_exists( 'Cherry5_Insertion_Popup' ) ) {
39
  /**
40
  * Core instance
41
  *
42
- * @since 1.0.0
43
- * @var object
44
  * @access private
45
  */
46
  private $core = null;
@@ -48,8 +48,8 @@ if ( ! class_exists( 'Cherry5_Insertion_Popup' ) ) {
48
  /**
49
  * Shortcode list.
50
  *
51
- * @since 1.0.0
52
- * @var array
53
  * @access private
54
  */
55
  private $shortcode_list = array(
@@ -131,7 +131,7 @@ if ( ! class_exists( 'Cherry5_Insertion_Popup' ) ) {
131
 
132
  $insert_button = $this->parent_self->ui_elements->get_ui_element_instance( 'button', $args )->render();
133
 
134
- require_once( apply_filters( 'cherry5-is__popup-template', $this->args['module_dir'] . 'inc/views/insert-shortcode-pop-up.php' ) );
135
  }
136
  }
137
 
@@ -228,6 +228,10 @@ if ( ! class_exists( 'Cherry5_Insertion_Popup' ) ) {
228
  if ( ! array_key_exists( 'id', $settings ) ) {
229
  $shortcode_attr['options'][ $key ]['id'] = $shortcode_slug . '_' . $key;
230
  }
 
 
 
 
231
  }
232
 
233
  $shortcode_options_html = $this->parent_self->cherry_interface_builder->render( false, $shortcode_attr['options'] );
@@ -235,7 +239,7 @@ if ( ! class_exists( 'Cherry5_Insertion_Popup' ) ) {
235
  $shortcode_options_html = $this->get_empty_layer();
236
  }
237
 
238
- $shortcode_option_template = apply_filters( 'cherry5-is__options-template', Cherry_Toolkit::get_file( $this->args['module_dir'] . 'inc/views/shortcode-options.php' ) );
239
  $output_html = sprintf( $shortcode_option_template, $plugin_slug, $shortcode_slug, $shortcode_attr['title'], $shortcode_attr['description'], $shortcode_attr['content_area'], $shortcode_options_html );
240
 
241
  return array(
@@ -249,6 +253,26 @@ if ( ! class_exists( 'Cherry5_Insertion_Popup' ) ) {
249
  }
250
  }
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  /**
253
  * The function returns content area HTML.
254
  *
@@ -257,7 +281,7 @@ if ( ! class_exists( 'Cherry5_Insertion_Popup' ) ) {
257
  * @return string
258
  */
259
  private function get_shortcode_content_editor( $content = '', $plugin_slug = '', $shortcode_slug = '' ) {
260
- $template = apply_filters( 'cherry5-is__content-area-template', Cherry_Toolkit::get_file( $this->args['module_dir'] . 'inc/views/shortcode-content-area.php' ) );
261
  $title = apply_filters( 'cherry5-is__content-title', esc_html__( 'Shortcode content.', 'cherry-framework' ) );
262
  $placeholder = apply_filters( 'cherry5-is__content-placeholder', esc_html__( 'Input shortcode content.', 'cherry-framework' ) );
263
 
@@ -275,7 +299,7 @@ if ( ! class_exists( 'Cherry5_Insertion_Popup' ) ) {
275
  */
276
  private function get_empty_layer() {
277
  $text = apply_filters( 'cherry5-is__empty_layer-text', esc_html__( 'Shortcode not a have options.', 'cherry-framework' ) );
278
- $template = apply_filters( 'cherry5-is__empty_layer-template', Cherry_Toolkit::get_file( $this->args['module_dir'] . 'inc/views/shortcode-has-not-option.php' ) );
279
  $output = sprintf( $template, $text );
280
 
281
  return $output;
5
  * @package Cherry_Framework
6
  * @subpackage Modules
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
30
  /**
31
  * Module arguments
32
  *
33
+ * @since 1.0.0
34
+ * @var array
35
  * @access private
36
  */
37
  private $args = array();
39
  /**
40
  * Core instance
41
  *
42
+ * @since 1.0.0
43
+ * @var object
44
  * @access private
45
  */
46
  private $core = null;
48
  /**
49
  * Shortcode list.
50
  *
51
+ * @since 1.0.0
52
+ * @var array
53
  * @access private
54
  */
55
  private $shortcode_list = array(
131
 
132
  $insert_button = $this->parent_self->ui_elements->get_ui_element_instance( 'button', $args )->render();
133
 
134
+ require_once( apply_filters( 'cherry5-is__popup-template', $this->args['module_path'] . 'inc/views/insert-shortcode-pop-up.php' ) );
135
  }
136
  }
137
 
228
  if ( ! array_key_exists( 'id', $settings ) ) {
229
  $shortcode_attr['options'][ $key ]['id'] = $shortcode_slug . '_' . $key;
230
  }
231
+
232
+ if ( isset( $settings['options'] ) ) {
233
+ $shortcode_attr['options'][ $key ]['options'] = $this->apply_options_cb( $settings );
234
+ }
235
  }
236
 
237
  $shortcode_options_html = $this->parent_self->cherry_interface_builder->render( false, $shortcode_attr['options'] );
239
  $shortcode_options_html = $this->get_empty_layer();
240
  }
241
 
242
+ $shortcode_option_template = apply_filters( 'cherry5-is__options-template', Cherry_Toolkit::get_file( $this->args['module_path'] . 'inc/views/shortcode-options.php' ) );
243
  $output_html = sprintf( $shortcode_option_template, $plugin_slug, $shortcode_slug, $shortcode_attr['title'], $shortcode_attr['description'], $shortcode_attr['content_area'], $shortcode_options_html );
244
 
245
  return array(
253
  }
254
  }
255
 
256
+ /**
257
+ * Apply shortcode options callback if required.
258
+ *
259
+ * @since 1.0.2
260
+ * @param array $atts Shortcode field parameters.
261
+ * @return array
262
+ */
263
+ private function apply_options_cb( $atts ) {
264
+
265
+ if ( ! empty( $atts['options'] ) ) {
266
+ return $atts['options'];
267
+ }
268
+
269
+ if ( empty( $atts['options_cb'] ) || ! is_callable( $atts['options_cb'] ) ) {
270
+ return array();
271
+ }
272
+
273
+ return call_user_func( $atts['options_cb'] );
274
+ }
275
+
276
  /**
277
  * The function returns content area HTML.
278
  *
281
  * @return string
282
  */
283
  private function get_shortcode_content_editor( $content = '', $plugin_slug = '', $shortcode_slug = '' ) {
284
+ $template = apply_filters( 'cherry5-is__content-area-template', Cherry_Toolkit::get_file( $this->args['module_path'] . 'inc/views/shortcode-content-area.php' ) );
285
  $title = apply_filters( 'cherry5-is__content-title', esc_html__( 'Shortcode content.', 'cherry-framework' ) );
286
  $placeholder = apply_filters( 'cherry5-is__content-placeholder', esc_html__( 'Input shortcode content.', 'cherry-framework' ) );
287
 
299
  */
300
  private function get_empty_layer() {
301
  $text = apply_filters( 'cherry5-is__empty_layer-text', esc_html__( 'Shortcode not a have options.', 'cherry-framework' ) );
302
+ $template = apply_filters( 'cherry5-is__empty_layer-template', Cherry_Toolkit::get_file( $this->args['module_path'] . 'inc/views/shortcode-has-not-option.php' ) );
303
  $output = sprintf( $template, $text );
304
 
305
  return $output;
cherry-framework/modules/cherry5-insert-shortcode/inc/views/insert-shortcode-pop-up.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package cherry5_insert_shortcode
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package cherry5_insert_shortcode
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-content-area.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package cherry5_insert_shortcode
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package cherry5_insert_shortcode
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-has-not-option.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package cherry5_insert_shortcode
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package cherry5_insert_shortcode
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/modules/cherry5-insert-shortcode/inc/views/shortcode-options.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package cherry5_insert_shortcode
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
5
  * @package cherry5_insert_shortcode
6
  * @subpackage Views
7
  * @author Cherry Team <cherryframework@gmail.com>
8
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
9
  * @link http://www.cherryframework.com/
10
  * @license http://www.gnu.org/licenses/gpl-3.0.html
11
  */
cherry-framework/setup-theme.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Setup function that used for checking latest version of the core.
4
+ * It creates `$chery_core_version` global variable and writes the latest core version
5
+ * and it's path into it.
6
+ *
7
+ * @package Cherry_Framework
8
+ * @author Cherry Team <cherryframework@gmail.com>
9
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
10
+ * @link http://www.cherryframework.com/
11
+ * @license http://www.gnu.org/licenses/gpl-3.0.en.html
12
+ */
13
+
14
+ return create_function( '', '
15
+ global $chery_core_version;
16
+
17
+ $path = get_template_directory() . \'/cherry-framework/cherry-core.php\';
18
+
19
+ $data = get_file_data( $path, array(
20
+ \'version\' => \'Version\'
21
+ ) );
22
+
23
+ if ( isset( $data[\'version\'] ) ) {
24
+ $version = $data[\'version\'];
25
+ }
26
+
27
+ $old_versions = null;
28
+
29
+ if ( null !== $chery_core_version ) {
30
+ $old_versions = array_keys( $chery_core_version );
31
+ }
32
+
33
+ if ( is_array( $old_versions ) && isset( $old_versions[0] ) ) {
34
+ $compare = version_compare( $old_versions[0], $version, \'<\' );
35
+
36
+ if ( $compare ) {
37
+ $chery_core_version = array();
38
+ $chery_core_version[ $version ] = $path;
39
+ }
40
+ } else {
41
+ $chery_core_version = array();
42
+ $chery_core_version[ $version ] = $path;
43
+ }
44
+ ' );
cherry-framework/setup.php CHANGED
@@ -6,7 +6,7 @@
6
  *
7
  * @package Cherry_Framework
8
  * @author Cherry Team <cherryframework@gmail.com>
9
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
10
  * @link http://www.cherryframework.com/
11
  * @license http://www.gnu.org/licenses/gpl-3.0.en.html
12
  */
6
  *
7
  * @package Cherry_Framework
8
  * @author Cherry Team <cherryframework@gmail.com>
9
+ * @copyright Copyright (c) 2012 - 2017, Cherry Team
10
  * @link http://www.cherryframework.com/
11
  * @license http://www.gnu.org/licenses/gpl-3.0.en.html
12
  */
cherry-projects.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Cherry Projects
4
  * Plugin URI: http://www.cherryframework.com/
5
  * Description: A projects plugin for WordPress.
6
- * Version: 1.2.4
7
  * Author: Cherry Team
8
  * Author URI: http://www.cherryframework.com/
9
  * Text Domain: cherry-projects
@@ -138,7 +138,7 @@ if ( ! class_exists( 'Cherry_Projects' ) ) {
138
  *
139
  * @since 1.0.0
140
  */
141
- define( 'CHERRY_PROJECTS_VERSION', '1.2.4' );
142
 
143
  /**
144
  * Set the slug of the plugin.
3
  * Plugin Name: Cherry Projects
4
  * Plugin URI: http://www.cherryframework.com/
5
  * Description: A projects plugin for WordPress.
6
+ * Version: 1.2.5
7
  * Author: Cherry Team
8
  * Author URI: http://www.cherryframework.com/
9
  * Text Domain: cherry-projects
138
  *
139
  * @since 1.0.0
140
  */
141
+ define( 'CHERRY_PROJECTS_VERSION', '1.2.5' );
142
 
143
  /**
144
  * Set the slug of the plugin.
public/assets/js/cherry-projects-plugin.js CHANGED
@@ -285,8 +285,8 @@
285
 
286
  Waypoint.refreshAll();
287
 
288
- CherryJsCore.cherryProjectsFrontScripts.magnificIconInit();
289
- CherryJsCore.variable.$document.trigger( 'getNewProjectsListAjaxSuccess' );
290
  } );
291
 
292
  }
@@ -357,9 +357,9 @@
357
 
358
  Waypoint.refreshAll();
359
 
360
- CherryJsCore.cherryProjectsFrontScripts.magnificIconInit();
361
 
362
- CherryJsCore.variable.$document.trigger( 'getMoreProjectsAjaxSuccess' );
363
  } );
364
 
365
  }
285
 
286
  Waypoint.refreshAll();
287
 
288
+ window.cherryProjectsFrontScripts.magnificIconInit();
289
+ $( document ).trigger( 'getNewProjectsListAjaxSuccess' );
290
  } );
291
 
292
  }
357
 
358
  Waypoint.refreshAll();
359
 
360
+ window.cherryProjectsFrontScripts.magnificIconInit();
361
 
362
+ $( document ).trigger( 'getMoreProjectsAjaxSuccess' );
363
  } );
364
 
365
  }
public/assets/js/cherry-projects-scripts.js CHANGED
@@ -1,10 +1,30 @@
1
- (function($){
 
 
2
  "use strict";
3
 
4
- CherryJsCore.utilites.namespace('cherryProjectsFrontScripts');
5
- CherryJsCore.cherryProjectsFrontScripts = {
6
  init: function () {
7
- CherryJsCore.variable.$document.on( 'ready', this.readyRender.bind( this ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  },
9
 
10
  readyRender: function () {
@@ -44,14 +64,14 @@
44
  });
45
  },
46
 
47
- projectsTermsInit: function() {
48
- var self = this,
49
- $projectsTermWrapper = $( '.cherry-projects-terms-wrapper' ),
50
  $projectsTermInstance = $( '.projects-terms-container', $projectsTermWrapper ),
51
  $loader = $( '.cherry-projects-ajax-loader' , $projectsTermWrapper );
52
 
53
  $loader.css( { 'display': 'block' } ).fadeTo( 500, 1 );
54
-
55
  $projectsTermInstance.each( function( index ) {
56
  var $instance = $( this ),
57
  instanceSettings = $instance.data( 'settings' ),
@@ -253,9 +273,12 @@
253
 
254
  return widthLayout;
255
  },
 
256
 
 
257
 
258
- }
259
- CherryJsCore.cherryProjectsFrontScripts.init();
260
- }(jQuery));
 
261
 
1
+ var cherryProjectsFrontScripts = null;
2
+
3
+ (function($, elementor){
4
  "use strict";
5
 
6
+ cherryProjectsFrontScripts = {
 
7
  init: function () {
8
+ $( document ).on( 'ready', this.readyRender.bind( this ) );
9
+ },
10
+
11
+ elementorInit: function () {
12
+ // Elementor compatibility hooks init
13
+ if ( elementor ) {
14
+ elementor.hooks.addAction(
15
+ 'frontend/element_ready/cherry_projects.default',
16
+ function( $scope ) {
17
+ $( '.cherry-projects-wrapper', $scope ).cherryProjectsPlugin();
18
+ }
19
+ );
20
+
21
+ elementor.hooks.addAction(
22
+ 'frontend/element_ready/cherry_projects_terms.default',
23
+ function( $scope ) {
24
+ cherryProjectsFrontScripts.projectsTermsInit( $( '.cherry-projects-terms-wrapper', $scope ) );
25
+ }
26
+ );
27
+ }
28
  },
29
 
30
  readyRender: function () {
64
  });
65
  },
66
 
67
+ projectsTermsInit: function( selector ) {
68
+ var self = cherryProjectsFrontScripts,
69
+ $projectsTermWrapper = selector || $( '.cherry-projects-terms-wrapper' ),
70
  $projectsTermInstance = $( '.projects-terms-container', $projectsTermWrapper ),
71
  $loader = $( '.cherry-projects-ajax-loader' , $projectsTermWrapper );
72
 
73
  $loader.css( { 'display': 'block' } ).fadeTo( 500, 1 );
74
+ console.log($projectsTermInstance);
75
  $projectsTermInstance.each( function( index ) {
76
  var $instance = $( this ),
77
  instanceSettings = $instance.data( 'settings' ),
273
 
274
  return widthLayout;
275
  },
276
+ }
277
 
278
+ cherryProjectsFrontScripts.init();
279
 
280
+ $( window ).on( 'elementor/frontend/init', cherryProjectsFrontScripts.elementorInit );
281
+
282
+
283
+ }(jQuery, window.elementorFrontend ));
284
 
public/includes/class-projects-data.php CHANGED
@@ -60,6 +60,9 @@ class Cherry_Project_Data {
60
  $this->set_default_options();
61
 
62
  $this->set_cherry_utility();
 
 
 
63
  }
64
 
65
  /**
@@ -129,11 +132,11 @@ class Cherry_Project_Data {
129
  * @return string html string
130
  */
131
  public function render_projects( $options = array() ) {
 
132
  $this->enqueue_styles();
133
  $this->enqueue_scripts();
134
 
135
  $this->options = wp_parse_args( $options, $this->default_options );
136
-
137
  // The Query.
138
  $filter_type = CHERRY_PROJECTS_NAME . '_' . $this->options['filter-type'];
139
  $posts_query = $this->get_query_projects_items(
@@ -185,7 +188,7 @@ class Cherry_Project_Data {
185
 
186
  $html = '<div class="cherry-projects-wrapper">';
187
 
188
- if ( 'true' == $this->options['filter-visible'] && $posts_query->have_posts() ) {
189
  $html .= $this->render_ajax_filter( array() );
190
  }
191
 
@@ -466,7 +469,7 @@ class Cherry_Project_Data {
466
  $tax_list = ( 'category' === $this->options['filter-type'] ) ? $this->options['category-list'] : $this->options['tags-list'];
467
 
468
  // $tax_list is array checking or convert to array.
469
- if ( ! is_array( $tax_list ) && is_string( $tax_list ) ) {
470
  $tax_list = explode( ',', $tax_list );
471
  }
472
 
@@ -513,8 +516,7 @@ class Cherry_Project_Data {
513
  $_tax_list = $this->prepare_to_wpml( $tax_list );
514
 
515
  foreach ( $terms as $term ) {
516
-
517
- if ( in_array( $term->slug, $_tax_list ) || empty( $_tax_list ) ) {
518
 
519
  $html .= '<li><span data-cat-id="' . $term->cat_ID . '" data-slug="' . $term->slug . '">'. $term->name .'</span></li>';
520
  }
@@ -532,7 +534,7 @@ class Cherry_Project_Data {
532
  */
533
  $html .= apply_filters( 'cherry-projects-after-filters-html', '' );
534
 
535
- if ( 'true' == $this->options['order-filter-visible'] ) {
536
  $html .= '<div class="projects-order-filters-wrapper">';
537
  $html .= '<ul class="order-filters">';
538
  $html .= '<li data-filter-type="order" data-desc-label="' . esc_html__( 'Desc', 'cherry-projects' ) . '" data-asc-label="' . esc_html__( 'Asc', 'cherry-projects' ) . '">';
@@ -866,7 +868,6 @@ class Cherry_Project_Data {
866
  $term_obj = get_term_by( 'slug', $slug, 'projects_category' );
867
  $translated_tax_list[] = $term_obj->slug;
868
  }
869
-
870
  return $translated_tax_list;
871
  }
872
 
60
  $this->set_default_options();
61
 
62
  $this->set_cherry_utility();
63
+
64
+ // Elementor compatibility editor enqueue scripts
65
+ add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
66
  }
67
 
68
  /**
132
  * @return string html string
133
  */
134
  public function render_projects( $options = array() ) {
135
+
136
  $this->enqueue_styles();
137
  $this->enqueue_scripts();
138
 
139
  $this->options = wp_parse_args( $options, $this->default_options );
 
140
  // The Query.
141
  $filter_type = CHERRY_PROJECTS_NAME . '_' . $this->options['filter-type'];
142
  $posts_query = $this->get_query_projects_items(
188
 
189
  $html = '<div class="cherry-projects-wrapper">';
190
 
191
+ if ( filter_var( $this->options['filter-visible'], FILTER_VALIDATE_BOOLEAN ) && $posts_query->have_posts() ) {
192
  $html .= $this->render_ajax_filter( array() );
193
  }
194
 
469
  $tax_list = ( 'category' === $this->options['filter-type'] ) ? $this->options['category-list'] : $this->options['tags-list'];
470
 
471
  // $tax_list is array checking or convert to array.
472
+ if ( is_string( $tax_list ) && ! empty( $tax_list ) ) {
473
  $tax_list = explode( ',', $tax_list );
474
  }
475
 
516
  $_tax_list = $this->prepare_to_wpml( $tax_list );
517
 
518
  foreach ( $terms as $term ) {
519
+ if ( ( is_array( $_tax_list ) && in_array( $term->slug, $_tax_list ) ) || empty( $_tax_list ) ) {
 
520
 
521
  $html .= '<li><span data-cat-id="' . $term->cat_ID . '" data-slug="' . $term->slug . '">'. $term->name .'</span></li>';
522
  }
534
  */
535
  $html .= apply_filters( 'cherry-projects-after-filters-html', '' );
536
 
537
+ if ( filter_var( $this->options['order-filter-visible'], FILTER_VALIDATE_BOOLEAN ) ) {
538
  $html .= '<div class="projects-order-filters-wrapper">';
539
  $html .= '<ul class="order-filters">';
540
  $html .= '<li data-filter-type="order" data-desc-label="' . esc_html__( 'Desc', 'cherry-projects' ) . '" data-asc-label="' . esc_html__( 'Asc', 'cherry-projects' ) . '">';
868
  $term_obj = get_term_by( 'slug', $slug, 'projects_category' );
869
  $translated_tax_list[] = $term_obj->slug;
870
  }
 
871
  return $translated_tax_list;
872
  }
873
 
public/includes/class-projects-shortcode.php CHANGED
@@ -22,7 +22,7 @@ class Cherry_Projects_Shortcode {
22
  * @since 1.0.0
23
  * @var string
24
  */
25
- public static $name = 'projects';
26
 
27
  /**
28
  * A reference to an instance of this class.
@@ -40,15 +40,21 @@ class Cherry_Projects_Shortcode {
40
  public function __construct() {
41
 
42
  // Register shortcode on 'init'.
43
- add_action( 'init', array( $this, 'register_shortcode' ) );
 
 
 
 
 
44
  }
45
 
46
  /**
47
- * Registers the [$this->name] shortcode.
48
  *
49
- * @since 1.0.0
50
  */
51
- public function register_shortcode() {
 
52
  /**
53
  * Filters a shortcode name.
54
  *
@@ -57,7 +63,491 @@ class Cherry_Projects_Shortcode {
57
  */
58
  $tag = apply_filters( self::$name . '_shortcode_name', self::$name );
59
 
60
- add_shortcode( 'cherry_' . $tag, array( $this, 'do_shortcode' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  /**
22
  * @since 1.0.0
23
  * @var string
24
  */
25
+ public static $name = 'cherry_projects';
26
 
27
  /**
28
  * A reference to an instance of this class.
40
  public function __construct() {
41
 
42
  // Register shortcode on 'init'.
43
+ add_action( 'init', array( $this, 'register_shortcode' ), -1 );
44
+
45
+ // Shortcode insert module registration
46
+ if ( is_admin() ) {
47
+ add_action( 'after_setup_theme', array( $this, 'shortcode_registration' ), 11 );
48
+ }
49
  }
50
 
51
  /**
52
+ * Returns shortcode tag.
53
  *
54
+ * @return string
55
  */
56
+ public function tag() {
57
+
58
  /**
59
  * Filters a shortcode name.
60
  *
63
  */
64
  $tag = apply_filters( self::$name . '_shortcode_name', self::$name );
65
 
66
+ return $tag;
67
+ }
68
+
69
+ /**
70
+ * Registers the [$this->name] shortcode.
71
+ *
72
+ * @since 1.0.0
73
+ */
74
+ public function register_shortcode() {
75
+
76
+ add_shortcode( $this->tag(), array( $this, 'do_shortcode' ) );
77
+
78
+ if ( defined( 'ELEMENTOR_VERSION' ) ) {
79
+
80
+ require_once( CHERRY_PROJECTS_DIR . 'public/includes/ext/class-cherry-projects-elementor-compat.php' );
81
+
82
+ cherry_projects_elementor_compat()->add_shortcode( $this->tag(), array(
83
+ 'title' => esc_html__( 'Cherry Projects', 'cherry-projects' ),
84
+ 'file' => CHERRY_PROJECTS_DIR . 'public/includes/ext/class-cherry-projects-elementor-module.php',
85
+ 'class' => 'Cherry_Projects_Elementor_Widget',
86
+ 'icon' => 'eicon-gallery-grid',
87
+ 'atts' => $this->shortcode_args(),
88
+ ));
89
+
90
+ /*cherry_projects_elementor_compat( array(
91
+ $this->tag() => array(
92
+ 'title' => esc_html__( 'Cherry Projects', 'cherry-projects' ),
93
+ 'file' => CHERRY_PROJECTS_DIR . 'public/includes/ext/class-cherry-projects-elementor-module.php',
94
+ 'class' => 'Cherry_Projects_Elementor_Widget',
95
+ 'icon' => 'eicon-gallery-grid',
96
+ 'atts' => $this->shortcode_args(),
97
+ ),
98
+ ) );*/
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Shortcode registration
104
+ *
105
+ * @return void
106
+ */
107
+ public function shortcode_registration() {
108
+ cherry_projects()->get_core()->init_module( 'cherry5-insert-shortcode', array() );
109
+
110
+ cherry5_register_shortcode(
111
+ array(
112
+ 'title' => esc_html__( 'Projects', 'cherry-projects' ),
113
+ 'description' => esc_html__( 'Showcase your projects using a variety of layouts with Cherry Projects plugin', 'cherry-projects' ),
114
+ 'icon' => '<span class="dashicons dashicons-layout"></span>',
115
+ 'slug' => 'cherry-prijects-plugin',
116
+ 'shortcodes' => array(
117
+ array(
118
+ 'title' => esc_html__( 'Projects', 'cherry-projects' ),
119
+ 'description' => esc_html__( 'Shortcode is used to display the projects list with set parameters.', 'cherry-projects' ),
120
+ 'icon' => '<span class="dashicons dashicons-layout"></span>',
121
+ 'slug' => 'cherry_projects',
122
+ 'options' => $this->shortcode_args(),
123
+ ),
124
+ ),
125
+ )
126
+ );
127
+ }
128
+
129
+ /**
130
+ * Register shortcode arguments.
131
+ *
132
+ * @return array
133
+ */
134
+ public function shortcode_args() {
135
+ $utility = cherry_projects()->get_core()->modules['cherry-utility']->utility;
136
+
137
+ $category_list = $utility->satellite->get_terms_array( CHERRY_PROJECTS_NAME . '_category', 'slug' );
138
+ $tag_list = $utility->satellite->get_terms_array( CHERRY_PROJECTS_NAME . '_tag', 'slug' );
139
+
140
+ return apply_filters( 'cherry_projects_shortcode_arguments', array(
141
+ 'listing_layout' => array(
142
+ 'type' => 'radio',
143
+ 'title' => esc_html__( 'Projects listing layout', 'cherry-projects' ),
144
+ 'description' => esc_html__( 'Choose projects listing view layout.', 'cherry-projects' ),
145
+ 'value' => 'grid-layout',
146
+ 'display_input' => false,
147
+ 'options' => array(
148
+ 'grid-layout' => array(
149
+ 'label' => esc_html__( 'Grid', 'cherry-projects' ),
150
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-grid.svg',
151
+ 'slave' => 'projects-listing-layout-grid-layout',
152
+ ),
153
+ 'masonry-layout' => array(
154
+ 'label' => esc_html__( 'Masonry', 'cherry-projects' ),
155
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-masonry.svg',
156
+ 'slave' => 'projects-listing-layout-masonry-layout',
157
+ ),
158
+ 'justified-layout' => array(
159
+ 'label' => esc_html__( 'Justified', 'cherry-projects' ),
160
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-justified.svg',
161
+ 'slave' => 'projects-listing-layout-justified-layout',
162
+ ),
163
+ 'cascading-grid-layout' => array(
164
+ 'label' => esc_html__( 'Cascading grid', 'cherry-projects' ),
165
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-cascading-grid.svg',
166
+ 'slave' => 'projects-listing-layout-cascading-grid-layout',
167
+ ),
168
+ 'list-layout' => array(
169
+ 'label' => esc_html__( 'List', 'cherry-projects' ),
170
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-listing.svg',
171
+ 'slave' => 'projects-listing-layout-list-layout',
172
+ ),
173
+ ),
174
+ ),
175
+
176
+ 'loading_mode' => array(
177
+ 'type' => 'radio',
178
+ 'title' => esc_html__( 'Pagination mode', 'cherry-projects' ),
179
+ 'description' => esc_html__( 'Choose projects pagination mode', 'cherry-projects' ),
180
+ 'value' => 'ajax-pagination-mode',
181
+ 'class' => '',
182
+ 'display_input' => false,
183
+ 'options' => array(
184
+ 'ajax-pagination-mode' => array(
185
+ 'label' => esc_html__( 'Ajax pagination', 'cherry-projects' ),
186
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/loading-mode-ajax-pagination.svg',
187
+ ),
188
+ 'more-button-mode' => array(
189
+ 'label' => esc_html__( 'More button', 'cherry-projects' ),
190
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/loading-mode-ajax-more-button.svg',
191
+ ),
192
+ 'lazy-loading-mode' => array(
193
+ 'label' => esc_html__( 'Lazy loading', 'cherry-projects' ),
194
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/loading-mode-lazy-loading.svg',
195
+ ),
196
+ 'none-mode' => array(
197
+ 'label' => esc_html__( 'None', 'cherry-projects' ),
198
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/loading-mode-none.svg',
199
+ ),
200
+ ),
201
+ ),
202
+
203
+ 'loading_animation' => array(
204
+ 'type' => 'radio',
205
+ 'title' => esc_html__( 'Loading animation', 'cherry-projects' ),
206
+ 'description' => esc_html__( 'Choose posts loading animation', 'cherry-projects' ),
207
+ 'value' => 'loading-animation-move-up',
208
+ 'class' => '',
209
+ 'display_input' => false,
210
+ 'options' => array(
211
+ 'loading-animation-fade' => array(
212
+ 'label' => esc_html__( 'Fade animation', 'cherry-projects' ),
213
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-fade.svg',
214
+ ),
215
+ 'loading-animation-scale' => array(
216
+ 'label' => esc_html__( 'Scale animation', 'cherry-projects' ),
217
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-scale.svg',
218
+ ),
219
+ 'loading-animation-move-up' => array(
220
+ 'label' => esc_html__( 'Move Up animation', 'cherry-projects' ),
221
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-move-up.svg',
222
+ ),
223
+ 'loading-animation-flip' => array(
224
+ 'label' => esc_html__( 'Flip animation', 'cherry-projects' ),
225
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-flip.svg',
226
+ ),
227
+ 'loading-animation-helix' => array(
228
+ 'label' => esc_html__( 'Helix animation', 'cherry-projects' ),
229
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-helix.svg',
230
+ ),
231
+ 'loading-animation-fall-perspective' => array(
232
+ 'label' => esc_html__( 'Fall perspective animation', 'cherry-projects' ),
233
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-fall-perspective.svg',
234
+ ),
235
+ ),
236
+ ),
237
+
238
+ 'hover_animation' => array(
239
+ 'type' => 'radio',
240
+ 'title' => esc_html__( 'Hover animation', 'cherry-projects' ),
241
+ 'description' => esc_html__( 'Choose posts images hover animation', 'cherry-projects' ),
242
+ 'value' => 'simple-scale',
243
+ 'class' => '',
244
+ 'display_input' => false,
245
+ 'options' => array(
246
+ 'simple-fade' => array(
247
+ 'label' => esc_html__( 'Fade', 'cherry-projects' ),
248
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/hover-fade.svg',
249
+ ),
250
+ 'simple-scale' => array(
251
+ 'label' => esc_html__( 'Scale', 'cherry-projects' ),
252
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/hover-scale.svg',
253
+ ),
254
+ 'custom' => array(
255
+ 'label' => esc_html__( 'Custom', 'cherry-projects' ),
256
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/inherit.svg',
257
+ ),
258
+ ),
259
+ ),
260
+
261
+ 'filter_visible' => array(
262
+ 'type' => 'switcher',
263
+ 'title' => esc_html__( 'Filters', 'cherry-projects' ),
264
+ 'description' => esc_html__( 'Enable/disable listing filters', 'cherry-projects' ),
265
+ 'value' => 'true',
266
+ 'toggle' => array(
267
+ 'true_toggle' => esc_html__( 'Show', 'cherry-projects' ),
268
+ 'false_toggle' => esc_html__( 'Hide', 'cherry-projects' ),
269
+ ),
270
+ ),
271
+
272
+ 'filter_type' => array(
273
+ 'type' => 'radio',
274
+ 'title' => esc_html__( 'Filter type', 'cherry-projects' ),
275
+ 'description' => esc_html__( 'Select if you want to filter posts by tag or by category.', 'cherry-projects' ),
276
+ 'value' => 'category',
277
+ 'display-input' => true,
278
+ 'options' => array(
279
+ 'category' => array(
280
+ 'label' => esc_html__( 'Category', 'cherry-projects' ),
281
+ 'slave' => 'projects-filter-type-category',
282
+ ),
283
+ 'tag' => array(
284
+ 'label' => esc_html__( 'Tag', 'cherry-projects' ),
285
+ 'slave' => 'projects-filter-type-tag',
286
+ ),
287
+ ),
288
+ ),
289
+
290
+ 'category_list' => array(
291
+ 'type' => 'select',
292
+ 'title' => esc_html__( 'Projects filter categories list', 'cherry-projects' ),
293
+ 'multiple' => true,
294
+ 'value' => array(),
295
+ 'class' => 'cherry-multi-select',
296
+ 'options' => $category_list,
297
+ 'master' => 'projects-filter-type-category',
298
+ ),
299
+
300
+ 'tags_list' => array(
301
+ 'type' => 'select',
302
+ 'title' => esc_html__( 'Projects filter tags list', 'cherry-projects' ),
303
+ 'multiple' => true,
304
+ 'value' => array(),
305
+ 'class' => 'cherry-multi-select',
306
+ 'options' => $tag_list,
307
+ 'master' => 'projects-filter-type-tag',
308
+ ),
309
+
310
+ 'order_filter_visible' => array(
311
+ 'type' => 'switcher',
312
+ 'title' => esc_html__( 'Order filters', 'cherry-projects' ),
313
+ 'description' => esc_html__( 'Enable/disable order filters', 'cherry-projects' ),
314
+ 'value' => 'false',
315
+ 'toggle' => array(
316
+ 'true_toggle' => 'On',
317
+ 'false_toggle' => 'Off',
318
+ 'true_slave' => 'projects-order-filter-visible-true',
319
+ 'false_slave' => 'projects-order-filter-visible-false',
320
+ ),
321
+ ),
322
+
323
+ 'order_filter_default_value' => array(
324
+ 'type' => 'radio',
325
+ 'title' => esc_html__( 'Order filter default value', 'cherry-projects' ),
326
+ 'value' => 'desc',
327
+ 'display-input' => true,
328
+ 'options' => array(
329
+ 'desc' => array(
330
+ 'label' => esc_html__( 'DESC', 'cherry-projects' ),
331
+ ),
332
+ 'asc' => array(
333
+ 'label' => esc_html__( 'ASC', 'cherry-projects' ),
334
+ ),
335
+ ),
336
+ 'master' => 'projects-order-filter-visible-true',
337
+ ),
338
+
339
+ 'orderby_filter_default_value' => array(
340
+ 'type' => 'radio',
341
+ 'title' => esc_html__( 'Order by filter default value', 'cherry-projects' ),
342
+ 'value' => 'date',
343
+ 'display-input' => true,
344
+ 'options' => array(
345
+ 'date' => array(
346
+ 'label' => esc_html__( 'Date', 'cherry-projects' ),
347
+ ),
348
+ 'name' => array(
349
+ 'label' => esc_html__( 'Name', 'cherry-projects' ),
350
+ ),
351
+ 'modified' => array(
352
+ 'label' => esc_html__( 'Modified', 'cherry-projects' ),
353
+ ),
354
+ 'comment_count' => array(
355
+ 'label' => esc_html__( 'Comments', 'cherry-projects' ),
356
+ ),
357
+ ),
358
+ 'master' => 'projects-order-filter-visible-true',
359
+ ),
360
+
361
+ 'posts_format' => array(
362
+ 'type' => 'radio',
363
+ 'title' => esc_html__( 'Post Format', 'cherry-projects' ),
364
+ 'value' => 'post-format-all',
365
+ 'display-input' => true,
366
+ 'options' => array(
367
+ 'post-format-all' => array(
368
+ 'label' => esc_html__( 'All formats', 'cherry-projects' ),
369
+ ),
370
+ 'post-format-standard' => array(
371
+ 'label' => esc_html__( 'Standard', 'cherry-projects' ),
372
+ ),
373
+ 'post-format-image' => array(
374
+ 'label' => esc_html__( 'Image', 'cherry-projects' ),
375
+ ),
376
+ 'post-format-gallery' => array(
377
+ 'label' => esc_html__( 'Gallery', 'cherry-projects' ),
378
+ ),
379
+ 'post-format-audio' => array(
380
+ 'label' => esc_html__( 'Audio', 'cherry-projects' ),
381
+ ),
382
+ 'post-format-video' => array(
383
+ 'label' => esc_html__( 'Video', 'cherry-projects' ),
384
+ ),
385
+ ),
386
+ ),
387
+
388
+ 'single_term' => array(
389
+ 'type' => 'text',
390
+ 'title' => esc_html__( 'Single term slug', 'cherry-projects' ),
391
+ 'value' => '',
392
+ ),
393
+
394
+ 'device_layout_column_number' => array(
395
+ 'type' => 'component-tab-horizontal',
396
+ ),
397
+
398
+ 'column_number_desktop_layout' => array(
399
+ 'type' => 'settings',
400
+ 'parent' => 'device_layout_column_number',
401
+ 'title' => esc_html__( 'Desktop', 'cherry-projects' ),
402
+ 'description' => esc_html__( 'Define column number for desktop layout', 'cherry-projects' ),
403
+ ),
404
+
405
+ 'column_number_laptop_layout' => array(
406
+ 'type' => 'settings',
407
+ 'parent' => 'device_layout_column_number',
408
+ 'title' => esc_html__( 'Laptop', 'cherry-projects' ),
409
+ 'description' => esc_html__( 'Define column number for laptop layout', 'cherry-projects' ),
410
+ ),
411
+
412
+ 'column_number_album_tablet_layout' => array(
413
+ 'type' => 'settings',
414
+ 'parent' => 'device_layout_column_number',
415
+ 'title' => esc_html__( 'Album Tablet', 'cherry-projects' ),
416
+ 'description' => esc_html__( 'Define column number for tablet layout', 'cherry-projects' ),
417
+ ),
418
+
419
+ 'column_number_portrait_tablet_layout' => array(
420
+ 'type' => 'settings',
421
+ 'parent' => 'device_layout_column_number',
422
+ 'title' => esc_html__( 'Portrait Tablet', 'cherry-projects' ),
423
+ 'description' => esc_html__( 'Define column number for tablet layout', 'cherry-projects' ),
424
+ ),
425
+
426
+ 'column_number_mobile_layout' => array(
427
+ 'type' => 'settings',
428
+ 'parent' => 'device_layout_column_number',
429
+ 'title' => esc_html__( 'Mobile', 'cherry-projects' ),
430
+ 'description' => esc_html__( 'Define column number for mobile layout', 'cherry-projects' ),
431
+ ),
432
+
433
+ 'column_number' => array(
434
+ 'type' => 'slider',
435
+ 'parent' => 'column_number_desktop_layout',
436
+ 'title' => esc_html__( 'Column number', 'cherry-projects' ),
437
+ 'description' => esc_html__( 'Select number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
438
+ 'max_value' => 6,
439
+ 'min_value' => 1,
440
+ 'value' => 4,
441
+ ),
442
+
443
+ 'column_number_laptop' => array(
444
+ 'type' => 'slider',
445
+ 'parent' => 'column_number_laptop_layout',
446
+ 'title' => esc_html__( 'Labtop column number', 'cherry-projects' ),
447
+ 'description' => esc_html__( 'Select laptop number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
448
+ 'max_value' => 6,
449
+ 'min_value' => 1,
450
+ 'value' => 3,
451
+ ),
452
+
453
+ 'column_number_album_tablet' => array(
454
+ 'type' => 'slider',
455
+ 'parent' => 'column_number_album_tablet_layout',
456
+ 'title' => esc_html__( 'Album Tablet column number', 'cherry-projects' ),
457
+ 'description' => esc_html__( 'Select album tablet number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
458
+ 'max_value' => 6,
459
+ 'min_value' => 1,
460
+ 'value' => 2,
461
+ ),
462
+
463
+ 'column_number_portrait_tablet' => array(
464
+ 'type' => 'slider',
465
+ 'parent' => 'column_number_portrait_tablet_layout',
466
+ 'title' => esc_html__( 'Portrait Tablet column number', 'cherry-projects' ),
467
+ 'description' => esc_html__( 'Select portrait tablet number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
468
+ 'max_value' => 6,
469
+ 'min_value' => 1,
470
+ 'value' => 2,
471
+ ),
472
+
473
+ 'column_number_mobile' => array(
474
+ 'type' => 'slider',
475
+ 'parent' => 'column_number_mobile_layout',
476
+ 'title' => esc_html__( 'Tablet column number', 'cherry-projects' ),
477
+ 'description' => esc_html__( 'Select mobile number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
478
+ 'max_value' => 6,
479
+ 'min_value' => 1,
480
+ 'value' => 1,
481
+ ),
482
+
483
+ 'post_per_page' => array(
484
+ 'type' => 'slider',
485
+ 'title' => esc_html__( 'Posts per page', 'cherry-projects' ),
486
+ 'description' => esc_html__( 'Select how many posts per page do you want to display(-1 means that will show all projects)', 'cherry-projects' ),
487
+ 'max_value' => 50,
488
+ 'min_value' => -1,
489
+ 'value' => 9,
490
+ ),
491
+
492
+ 'item_margin' => array(
493
+ 'type' => 'slider',
494
+ 'title' => esc_html__( 'Item margin', 'cherry-projects' ),
495
+ 'description' => esc_html__( 'Select projects item margin (outer indent) value.', 'cherry-projects' ),
496
+ 'max_value' => 50,
497
+ 'min_value' => 0,
498
+ 'value' => 4,
499
+ ),
500
+
501
+ 'justified_fixed_height' => array(
502
+ 'type' => 'slider',
503
+ 'title' => esc_html__( 'Justified fixed height', 'cherry-projects' ),
504
+ 'description' => esc_html__( 'Select projects item justified height value.', 'cherry-projects' ),
505
+ 'max_value' => 1000,
506
+ 'min_value' => 50,
507
+ 'value' => 300,
508
+ 'master' => 'projects-listing-layout-justified-layout',
509
+ ),
510
+
511
+ 'grid_template' => array(
512
+ 'type' => 'text',
513
+ 'title' => esc_html__( 'Grid template', 'cherry-projects' ),
514
+ 'description' => esc_html__( 'Grid content template', 'cherry-projects' ),
515
+ 'value' => 'grid-default.tmpl',
516
+ 'master' => 'projects-listing-layout-grid-layout',
517
+ ),
518
+
519
+ 'masonry_template' => array(
520
+ 'type' => 'text',
521
+ 'title' => esc_html__( 'Masonry template', 'cherry-projects' ),
522
+ 'description' => esc_html__( 'Masonry content template', 'cherry-projects' ),
523
+ 'value' => 'masonry-default.tmpl',
524
+ 'master' => 'projects-listing-layout-masonry-layout',
525
+ ),
526
+
527
+ 'justified_template' => array(
528
+ 'type' => 'text',
529
+ 'title' => esc_html__( 'Justified template', 'cherry-projects' ),
530
+ 'description' => esc_html__( 'Justified content template', 'cherry-projects' ),
531
+ 'value' => 'justified-default.tmpl',
532
+ 'master' => 'projects-listing-layout-justified-layout',
533
+ ),
534
+
535
+ 'cascading_grid_template' => array(
536
+ 'type' => 'text',
537
+ 'title' => esc_html__( 'Cascading grid template', 'cherry-projects' ),
538
+ 'description' => esc_html__( 'Cascading grid template', 'cherry-projects' ),
539
+ 'value' => 'cascading-grid-default.tmpl',
540
+ 'master' => 'projects-listing-layout-cascading-grid-layout',
541
+ ),
542
+
543
+ 'list_template' => array(
544
+ 'type' => 'text',
545
+ 'title' => esc_html__( 'List template', 'cherry-projects' ),
546
+ 'description' => esc_html__( 'List content template', 'cherry-projects' ),
547
+ 'value' => 'list-default.tmpl',
548
+ 'master' => 'projects-listing-layout-list-layout',
549
+ ),
550
+ ) );
551
  }
552
 
553
  /**
public/includes/class-projects-term-data.php CHANGED
@@ -127,7 +127,6 @@ class Cherry_Project_Term_Data extends Cherry_Project_Data {
127
  );
128
 
129
  $html = '<div class="cherry-projects-terms-wrapper">';
130
-
131
  $container_class = 'projects-terms-container cherry-animation-container ' . $this->options['listing-layout'] . ' ' . $this->options['loading-animation'];
132
 
133
  $html .= sprintf( '<div class="%1$s" data-settings=\'%2$s\'>', $container_class, $settings );
127
  );
128
 
129
  $html = '<div class="cherry-projects-terms-wrapper">';
 
130
  $container_class = 'projects-terms-container cherry-animation-container ' . $this->options['listing-layout'] . ' ' . $this->options['loading-animation'];
131
 
132
  $html .= sprintf( '<div class="%1$s" data-settings=\'%2$s\'>', $container_class, $settings );
public/includes/class-projects-term-shortcode.php CHANGED
@@ -22,7 +22,7 @@ class Cherry_Projects_Term_Shortcode {
22
  * @since 1.0.0
23
  * @var string
24
  */
25
- public static $name = 'projects_terms';
26
 
27
  /**
28
  * A reference to an instance of this class.
@@ -41,14 +41,20 @@ class Cherry_Projects_Term_Shortcode {
41
 
42
  // Register shortcode on 'init'.
43
  add_action( 'init', array( $this, 'register_shortcode' ) );
 
 
 
 
 
44
  }
45
 
46
  /**
47
- * Registers the [$this->name] shortcode.
48
  *
49
- * @since 1.0.0
50
  */
51
- public function register_shortcode() {
 
52
  /**
53
  * Filters a shortcode name.
54
  *
@@ -57,7 +63,58 @@ class Cherry_Projects_Term_Shortcode {
57
  */
58
  $tag = apply_filters( self::$name . '_shortcode_name', self::$name );
59
 
60
- add_shortcode( 'cherry_' . $tag, array( $this, 'do_shortcode' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  /**
@@ -94,6 +151,232 @@ class Cherry_Projects_Term_Shortcode {
94
  return cherry_projects()->projects_term_data->render_projects_term( $atts );
95
  }
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  /**
98
  * Returns the instance.
99
  *
@@ -111,4 +394,4 @@ class Cherry_Projects_Term_Shortcode {
111
 
112
  }
113
 
114
- Cherry_Projects_Term_Shortcode::get_instance();
22
  * @since 1.0.0
23
  * @var string
24
  */
25
+ public static $name = 'cherry_projects_terms';
26
 
27
  /**
28
  * A reference to an instance of this class.
41
 
42
  // Register shortcode on 'init'.
43
  add_action( 'init', array( $this, 'register_shortcode' ) );
44
+
45
+ // Shortcode insert module registration
46
+ if ( is_admin() ) {
47
+ add_action( 'after_setup_theme', array( $this, 'shortcode_registration' ), 11 );
48
+ }
49
  }
50
 
51
  /**
52
+ * Returns shortcode tag.
53
  *
54
+ * @return string
55
  */
56
+ public function tag() {
57
+
58
  /**
59
  * Filters a shortcode name.
60
  *
63
  */
64
  $tag = apply_filters( self::$name . '_shortcode_name', self::$name );
65
 
66
+ return $tag;
67
+ }
68
+
69
+ /**
70
+ * Registers the [$this->name] shortcode.
71
+ *
72
+ * @since 1.0.0
73
+ */
74
+ public function register_shortcode() {
75
+
76
+ add_shortcode( $this->tag(), array( $this, 'do_shortcode' ) );
77
+
78
+ if ( defined( 'ELEMENTOR_VERSION' ) ) {
79
+
80
+ require_once( CHERRY_PROJECTS_DIR . 'public/includes/ext/class-cherry-projects-elementor-compat.php' );
81
+
82
+ cherry_projects_elementor_compat()->add_shortcode( $this->tag(), array(
83
+ 'title' => esc_html__( 'Cherry Projects Terms', 'cherry-projects' ),
84
+ 'file' => CHERRY_PROJECTS_DIR . 'public/includes/ext/class-cherry-projects-terms-elementor-module.php',
85
+ 'class' => 'Cherry_Projects_Terms_Elementor_Widget',
86
+ 'icon' => 'eicon-gallery-grid',
87
+ 'atts' => $this->shortcode_args(),
88
+ ));
89
+
90
+ }
91
+ }
92
+
93
+ /**
94
+ * Shortcode registration
95
+ *
96
+ * @return void
97
+ */
98
+ public function shortcode_registration() {
99
+ cherry_projects()->get_core()->init_module( 'cherry5-insert-shortcode', array() );
100
+
101
+ cherry5_register_shortcode(
102
+ array(
103
+ 'title' => esc_html__( 'Projects', 'cherry-projects' ),
104
+ 'description' => esc_html__( 'Showcase your projects using a variety of layouts with Cherry Projects plugin', 'cherry-projects' ),
105
+ 'icon' => '<span class="dashicons dashicons-layout"></span>',
106
+ 'slug' => 'cherry-prijects-plugin',
107
+ 'shortcodes' => array(
108
+ array(
109
+ 'title' => esc_html__( 'Projects Terms', 'cherry-projects' ),
110
+ 'description' => esc_html__( 'The shortcode displays Category and Tag sections content listing with set parameters.', 'cherry-projects' ),
111
+ 'icon' => '<span class="dashicons dashicons-category"></span>',
112
+ 'slug' => 'cherry_projects_terms',
113
+ 'options' => $this->shortcode_args(),
114
+ ),
115
+ ),
116
+ )
117
+ );
118
  }
119
 
120
  /**
151
  return cherry_projects()->projects_term_data->render_projects_term( $atts );
152
  }
153
 
154
+ /**
155
+ * Register shortcode arguments.
156
+ *
157
+ * @return array
158
+ */
159
+ public function shortcode_args() {
160
+
161
+ return apply_filters( 'cherry_projects_terms_shortcode_arguments', array(
162
+ 'term_type' => array(
163
+ 'type' => 'radio',
164
+ 'title' => esc_html__( 'Filter type', 'cherry-projects' ),
165
+ 'description' => esc_html__( 'Select if you want to filter posts by tag or by category.', 'cherry-projects' ),
166
+ 'value' => 'category',
167
+ 'display-input' => true,
168
+ 'options' => array(
169
+ 'category' => array(
170
+ 'label' => esc_html__( 'Category', 'cherry-projects' ),
171
+ ),
172
+ 'tag' => array(
173
+ 'label' => esc_html__( 'Tag', 'cherry-projects' ),
174
+ ),
175
+ ),
176
+ ),
177
+
178
+ 'listing_layout' => array(
179
+ 'type' => 'radio',
180
+ 'title' => esc_html__( 'Terms listing layout', 'cherry-projects' ),
181
+ 'description' => esc_html__( 'Choose terms listing view layout.', 'cherry-projects' ),
182
+ 'value' => 'grid-layout',
183
+ 'display_input' => false,
184
+ 'options' => array(
185
+ 'grid-layout' => array(
186
+ 'label' => esc_html__( 'Grid', 'cherry-projects' ),
187
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-grid.svg',
188
+ 'slave' => 'projects-listing-layout-grid-layout',
189
+ ),
190
+ 'masonry-layout' => array(
191
+ 'label' => esc_html__( 'Masonry', 'cherry-projects' ),
192
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-masonry.svg',
193
+ 'slave' => 'projects-listing-layout-masonry-layout',
194
+ ),
195
+ 'cascading-grid-layout' => array(
196
+ 'label' => esc_html__( 'Cascading grid', 'cherry-projects' ),
197
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-cascading-grid.svg',
198
+ 'slave' => 'projects-listing-layout-cascading-grid-layout',
199
+ ),
200
+ 'list-layout' => array(
201
+ 'label' => esc_html__( 'List', 'cherry-projects' ),
202
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-listing.svg',
203
+ 'slave' => 'projects-listing-layout-list-layout',
204
+ ),
205
+ ),
206
+ ),
207
+
208
+ 'loading_animation' => array(
209
+ 'type' => 'radio',
210
+ 'title' => esc_html__( 'Loading animation', 'cherry-projects' ),
211
+ 'description' => esc_html__( 'Choose terms loading animation', 'cherry-projects' ),
212
+ 'value' => 'loading-animation-move-up',
213
+ 'class' => '',
214
+ 'display_input' => false,
215
+ 'options' => array(
216
+ 'loading-animation-fade' => array(
217
+ 'label' => esc_html__( 'Fade animation', 'cherry-projects' ),
218
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-fade.svg',
219
+ ),
220
+ 'loading-animation-scale' => array(
221
+ 'label' => esc_html__( 'Scale animation', 'cherry-projects' ),
222
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-scale.svg',
223
+ ),
224
+ 'loading-animation-move-up' => array(
225
+ 'label' => esc_html__( 'Move Up animation', 'cherry-projects' ),
226
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-move-up.svg',
227
+ ),
228
+ 'loading-animation-flip' => array(
229
+ 'label' => esc_html__( 'Flip animation', 'cherry-projects' ),
230
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-flip.svg',
231
+ ),
232
+ 'loading-animation-helix' => array(
233
+ 'label' => esc_html__( 'Helix animation', 'cherry-projects' ),
234
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-helix.svg',
235
+ ),
236
+ 'loading-animation-fall-perspective' => array(
237
+ 'label' => esc_html__( 'Fall perspective animation', 'cherry-projects' ),
238
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/animation-fall-perspective.svg',
239
+ ),
240
+ ),
241
+ ),
242
+
243
+ 'device_layout_column_number' => array(
244
+ 'type' => 'component-tab-horizontal',
245
+ ),
246
+
247
+ 'column_number_desktop_layout' => array(
248
+ 'type' => 'settings',
249
+ 'parent' => 'device_layout_column_number',
250
+ 'title' => esc_html__( 'Desktop', 'cherry-projects' ),
251
+ 'description' => esc_html__( 'Define column number for desktop layout', 'cherry-projects' ),
252
+ ),
253
+
254
+ 'column_number_laptop_layout' => array(
255
+ 'type' => 'settings',
256
+ 'parent' => 'device_layout_column_number',
257
+ 'title' => esc_html__( 'Laptop', 'cherry-projects' ),
258
+ 'description' => esc_html__( 'Define column number for laptop layout', 'cherry-projects' ),
259
+ ),
260
+
261
+ 'column_number_album_tablet_layout' => array(
262
+ 'type' => 'settings',
263
+ 'parent' => 'device_layout_column_number',
264
+ 'title' => esc_html__( 'Album Tablet', 'cherry-projects' ),
265
+ 'description' => esc_html__( 'Define column number for tablet layout', 'cherry-projects' ),
266
+ ),
267
+
268
+ 'column_number_portrait_tablet_layout' => array(
269
+ 'type' => 'settings',
270
+ 'parent' => 'device_layout_column_number',
271
+ 'title' => esc_html__( 'Portrait Tablet', 'cherry-projects' ),
272
+ 'description' => esc_html__( 'Define column number for tablet layout', 'cherry-projects' ),
273
+ ),
274
+
275
+ 'column_number_mobile_layout' => array(
276
+ 'type' => 'settings',
277
+ 'parent' => 'device_layout_column_number',
278
+ 'title' => esc_html__( 'Mobile', 'cherry-projects' ),
279
+ 'description' => esc_html__( 'Define column number for mobile layout', 'cherry-projects' ),
280
+ ),
281
+
282
+ 'column_number' => array(
283
+ 'type' => 'slider',
284
+ 'parent' => 'column_number_desktop_layout',
285
+ 'title' => esc_html__( 'Column number', 'cherry-projects' ),
286
+ 'description' => esc_html__( 'Select number of columns for masonry and grid projects layouts. (Min 2, max 6)', 'cherry-projects' ),
287
+ 'max_value' => 6,
288
+ 'min_value' => 1,
289
+ 'value' => 3,
290
+ ),
291
+
292
+ 'column_number_laptop' => array(
293
+ 'type' => 'slider',
294
+ 'parent' => 'column_number_laptop_layout',
295
+ 'title' => esc_html__( 'Labtop column number', 'cherry-projects' ),
296
+ 'description' => esc_html__( 'Select laptop number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
297
+ 'max_value' => 6,
298
+ 'min_value' => 1,
299
+ 'value' => 3,
300
+ ),
301
+
302
+ 'column_number_album_tablet' => array(
303
+ 'type' => 'slider',
304
+ 'parent' => 'column_number_album_tablet_layout',
305
+ 'title' => esc_html__( 'Album Tablet column number', 'cherry-projects' ),
306
+ 'description' => esc_html__( 'Select album tablet number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
307
+ 'max_value' => 6,
308
+ 'min_value' => 1,
309
+ 'value' => 2,
310
+ ),
311
+
312
+ 'column_number_portrait_tablet' => array(
313
+ 'type' => 'slider',
314
+ 'parent' => 'column_number_portrait_tablet_layout',
315
+ 'title' => esc_html__( 'Portrait Tablet column number', 'cherry-projects' ),
316
+ 'description' => esc_html__( 'Select portrait tablet number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
317
+ 'max_value' => 6,
318
+ 'min_value' => 1,
319
+ 'value' => 2,
320
+ ),
321
+
322
+ 'column_number_mobile' => array(
323
+ 'type' => 'slider',
324
+ 'parent' => 'column_number_mobile_layout',
325
+ 'title' => esc_html__( 'Tablet column number', 'cherry-projects' ),
326
+ 'description' => esc_html__( 'Select mobile number of columns for masonry and grid projects layouts. (Min 1, max 6)', 'cherry-projects' ),
327
+ 'max_value' => 6,
328
+ 'min_value' => 1,
329
+ 'value' => 1,
330
+ ),
331
+
332
+ 'post_per_page' => array(
333
+ 'type' => 'slider',
334
+ 'title' => esc_html__( 'Posts per page', 'cherry-projects' ),
335
+ 'description' => esc_html__( 'Select how many posts per page do you want to display(-1 means that will show all projects)', 'cherry-projects' ),
336
+ 'max_value' => 50,
337
+ 'min_value' => -1,
338
+ 'value' => 6,
339
+ ),
340
+
341
+ 'item_margin' => array(
342
+ 'type' => 'slider',
343
+ 'title' => esc_html__( 'Item margin', 'cherry-projects' ),
344
+ 'description' => esc_html__( 'Select projects item margin (outer indent) value.', 'cherry-projects' ),
345
+ 'max_value' => 50,
346
+ 'min_value' => 0,
347
+ 'value' => 4,
348
+ ),
349
+
350
+ 'grid_template' => array(
351
+ 'type' => 'text',
352
+ 'title' => esc_html__( 'Grid template', 'cherry-projects' ),
353
+ 'description' => esc_html__( 'Grid content template', 'cherry-projects' ),
354
+ 'value' => 'terms-grid-default.tmpl',
355
+ ),
356
+
357
+ 'masonry_template' => array(
358
+ 'type' => 'text',
359
+ 'title' => esc_html__( 'Masonry template', 'cherry-projects' ),
360
+ 'description' => esc_html__( 'Masonry content template', 'cherry-projects' ),
361
+ 'value' => 'terms-masonry-default.tmpl',
362
+ ),
363
+
364
+ 'cascading_grid_template' => array(
365
+ 'type' => 'text',
366
+ 'title' => esc_html__( 'Cascading grid template', 'cherry-projects' ),
367
+ 'description' => esc_html__( 'Cascading grid template', 'cherry-projects' ),
368
+ 'value' => 'terms-cascading-grid-default.tmpl',
369
+ ),
370
+
371
+ 'list_template' => array(
372
+ 'type' => 'text',
373
+ 'title' => esc_html__( 'List template', 'cherry-projects' ),
374
+ 'description' => esc_html__( 'List content template', 'cherry-projects' ),
375
+ 'value' => 'terms-list-default.tmpl',
376
+ ),
377
+ ) );
378
+ }
379
+
380
  /**
381
  * Returns the instance.
382
  *
394
 
395
  }
396
 
397
+ Cherry_Projects_Term_Shortcode::get_instance();
public/includes/ext/class-cherry-projects-elementor-compat.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class description
4
+ *
5
+ * @package package_name
6
+ * @author Cherry Team
7
+ * @license GPL-2.0+
8
+ */
9
+
10
+ // If this file is called directly, abort.
11
+ if ( ! defined( 'WPINC' ) ) {
12
+ die;
13
+ }
14
+
15
+ if ( ! class_exists( 'Cherry_Projects_Elementor_Compat' ) ) {
16
+
17
+ /**
18
+ * Define Cherry_Projects_Elementor_Compat class
19
+ */
20
+ class Cherry_Projects_Elementor_Compat {
21
+
22
+ /**
23
+ * A reference to an instance of this class.
24
+ *
25
+ * @since 1.0.0
26
+ * @var object
27
+ */
28
+ private static $instance = null;
29
+
30
+ /**
31
+ * Registered shortcodes array
32
+ *
33
+ * @var array
34
+ */
35
+ public $shortcodes = array();
36
+
37
+ /**
38
+ * Constructor for the class
39
+ */
40
+ function __construct( $shortcodes ) {
41
+
42
+ $this->shortcodes = $shortcodes;
43
+
44
+ add_action( 'elementor/init', array( $this, 'register_category' ) );
45
+ add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_widgets' ) );
46
+
47
+ }
48
+
49
+ /**
50
+ * Register elementor widget
51
+ *
52
+ * @return void
53
+ */
54
+ public function register_widgets( $widgets_manager ) {
55
+
56
+ foreach ( $this->shortcodes as $data ) {
57
+ require $data['file'];
58
+ unset( $data['file'] );
59
+ $widgets_manager->register_widget_type( call_user_func( array( $data['class'], 'get_instance' ) ) );
60
+ }
61
+
62
+ }
63
+
64
+ /**
65
+ * Register cherry category for elementor if not exists
66
+ *
67
+ * @return void
68
+ */
69
+ public function register_category() {
70
+
71
+ $elements_manager = Elementor\Plugin::instance()->elements_manager;
72
+ $existing = $elements_manager->get_categories();
73
+ $cherry_cat = 'cherry';
74
+
75
+ if ( array_key_exists( $cherry_cat, $existing ) ) {
76
+ return;
77
+ }
78
+
79
+ $elements_manager->add_category(
80
+ $cherry_cat,
81
+ array(
82
+ 'title' => esc_html__( 'Cherry Addons', 'cherry-projects' ),
83
+ 'icon' => 'font',
84
+ ),
85
+ 1
86
+ );
87
+ }
88
+
89
+ /**
90
+ * Register shortcode function
91
+ *
92
+ * @return void
93
+ */
94
+ public function add_shortcode( $shortcode_slug, $shortcode_data = array() ) {
95
+ $this->shortcodes[ $shortcode_slug ] = $shortcode_data;
96
+ }
97
+
98
+ /**
99
+ * Returns the instance.
100
+ *
101
+ * @since 1.0.0
102
+ * @return object
103
+ */
104
+ public static function get_instance( $shortcodes = array() ) {
105
+
106
+ // If the single instance hasn't been set, set it now.
107
+ if ( null == self::$instance ) {
108
+ self::$instance = new self( $shortcodes );
109
+ }
110
+ return self::$instance;
111
+ }
112
+ }
113
+
114
+ }
115
+
116
+ /**
117
+ * Returns instance of Cherry_Projects_Elementor_Compat
118
+ *
119
+ * @return object
120
+ */
121
+ function cherry_projects_elementor_compat( $shortcodes = array() ) {
122
+ return Cherry_Projects_Elementor_Compat::get_instance( $shortcodes );
123
+ }
public/includes/ext/class-cherry-projects-elementor-module.php ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ class Cherry_Projects_Elementor_Widget extends Elementor\Widget_Base {
6
+
7
+ /**
8
+ * Shortcode tag
9
+ *
10
+ * @var string
11
+ */
12
+ protected $tag = 'cherry_projects';
13
+
14
+ /**
15
+ * Rewritten shortcode arguments
16
+ *
17
+ * @var array
18
+ */
19
+ protected $rewrite = array(
20
+ 'id' => 'post_id',
21
+ );
22
+
23
+ /**
24
+ * Get shortcode data by name
25
+ *
26
+ * @param string $name Data name to get.
27
+ * @return mixed
28
+ */
29
+ public function get_shortcode( $name ) {
30
+
31
+ if ( ! isset( cherry_projects_elementor_compat()->shortcodes[ $this->tag ] ) ) {
32
+ return;
33
+ }
34
+
35
+ $shortcode = wp_parse_args( cherry_projects_elementor_compat()->shortcodes[ $this->tag ], array(
36
+ 'title' => null,
37
+ 'icon' => 'eicon-shortcode',
38
+ 'atts' => array(),
39
+ ) );
40
+
41
+ return isset( $shortcode[ $name ] ) ? $shortcode[ $name ] : false;
42
+ }
43
+
44
+ public function get_name() {
45
+ return $this->tag;
46
+ }
47
+
48
+ public function get_title() {
49
+ return $this->get_shortcode( 'title' );
50
+ }
51
+
52
+ public function get_icon() {
53
+ return $this->get_shortcode( 'icon' );
54
+ }
55
+
56
+ public function get_categories() {
57
+ return array( 'cherry' );
58
+ }
59
+
60
+ public function is_reload_preview_required() {
61
+ return true;
62
+ }
63
+
64
+ /**
65
+ * Map controls
66
+ *
67
+ * @param string $name Default control name.
68
+ * @return string
69
+ */
70
+ protected function _get_mapped_control( $name = null ) {
71
+
72
+ $mapped_controls = array(
73
+ 'media' => Elementor\Controls_Manager::MEDIA,
74
+ 'text' => Elementor\Controls_Manager::TEXT,
75
+ 'textarea' => Elementor\Controls_Manager::TEXTAREA,
76
+ 'select' => Elementor\Controls_Manager::SELECT2,
77
+ 'switcher' => Elementor\Controls_Manager::SWITCHER,
78
+ 'slider' => Elementor\Controls_Manager::SLIDER,
79
+ 'radio' => Elementor\Controls_Manager::SELECT,
80
+ );
81
+
82
+ if ( array_key_exists( $name, $mapped_controls ) ) {
83
+ return $mapped_controls[ $name ];
84
+ } else {
85
+ return false;
86
+ }
87
+
88
+ }
89
+
90
+ /**
91
+ * Sanitize attribute arguments data.
92
+ *
93
+ * @param array $data Input arguments.
94
+ * @param string $type Attribute control type.
95
+ * @return array
96
+ */
97
+ protected function _sanitize_attr_data( $data ) {
98
+
99
+ $type = $this->_get_mapped_control( $data['type'] );
100
+
101
+ if ( ! $type ) {
102
+ return false;
103
+ }
104
+
105
+ $mapped_args = array(
106
+ 'label' => $data['title'],
107
+ 'type' => $type,
108
+ 'default' => array( $data['value'] ),
109
+ );
110
+
111
+ if ( 'switcher' === $data['type'] ) {
112
+ $mapped_args['default'] = ( 'true' === $data['value'] ) ? 'yes' : '';
113
+
114
+ if ( array_key_exists( 'toggle', $data ) ) {
115
+ $mapped_args[ 'label_off' ] = esc_html__( 'No', 'cherry-projects' );
116
+ $mapped_args[ 'label_on' ] = esc_html__( 'Yes', 'cherry-projects' );
117
+ }
118
+ }
119
+
120
+ if ( isset( $data['options'] ) ) {
121
+ $mapped_args['options'] = $data['options'];
122
+ }
123
+
124
+ if ( isset( $data['options_cb'] ) ) {
125
+ $mapped_args['options'] = call_user_func( $data['options_cb'] );
126
+ }
127
+
128
+ if ( 'radio' === $data['type'] ) {
129
+ foreach ( $mapped_args['options'] as $option => $data ) {
130
+ $mapped_args['options'][ $option ] = $data[ 'label' ];
131
+ }
132
+ }
133
+
134
+ if ( array_key_exists( 'multiple', $data ) && filter_var( $data[ 'multiple' ], FILTER_VALIDATE_BOOLEAN ) ) {
135
+ $mapped_args['multiple'] = true;
136
+ }
137
+
138
+ if ( isset( $data['min_value'] ) && isset( $data['max_value'] ) ) {
139
+ $mapped_args['default'] = array(
140
+ 'size' => $data['value'],
141
+ );
142
+ $mapped_args['range'] = array(
143
+ 'px' => array(
144
+ 'min' => $data['min_value'],
145
+ 'max' => $data['max_value'],
146
+ ),
147
+ );
148
+ }
149
+
150
+ return $mapped_args;
151
+ }
152
+
153
+ /**
154
+ * Sanitize attribute name
155
+ *
156
+ * @param string $name Attribute name.
157
+ * @return string
158
+ */
159
+ protected function _sanitize_attr_name( $name ) {
160
+ return isset( $this->rewrite[ $name ] ) ? $this->rewrite[ $name ] : $name;
161
+ }
162
+
163
+ protected function _register_controls() {
164
+
165
+ $args = $this->get_shortcode( 'atts' );
166
+
167
+ if ( ! $args ) {
168
+ return;
169
+ }
170
+
171
+ $this->start_controls_section(
172
+ 'section_main',
173
+ array(
174
+ 'label' => $this->get_shortcode( 'title' ),
175
+ )
176
+ );
177
+
178
+ foreach ( $args as $name => $arg ) {
179
+
180
+ $name = $this->_sanitize_attr_name( $name );
181
+ $mapped_args = $this->_sanitize_attr_data( $arg );
182
+
183
+ if ( ! $mapped_args ) {
184
+ continue;
185
+ }
186
+
187
+ $this->add_control( $name, $mapped_args );
188
+
189
+ }
190
+
191
+ $this->end_controls_section();
192
+
193
+ }
194
+
195
+ protected function render() {
196
+
197
+ $settings = $this->get_settings();
198
+ $shortcode = '[%1$s%2$s]';
199
+ $shortcode_atts = '';
200
+ $args = $this->get_shortcode( 'atts' );
201
+
202
+ foreach ( $args as $name => $arg ) {
203
+
204
+ if ( empty( $settings[ $name ] ) ) {
205
+
206
+ if ( 'switcher' === $arg['type'] ) {
207
+ $shortcode_atts .= sprintf( ' %1$s="%2$s"', $name, 'false' );
208
+ }
209
+
210
+ continue;
211
+ }
212
+
213
+ if ( ! is_array( $settings[ $name ] ) ) {
214
+ $val = $settings[ $name ];
215
+ } else {
216
+ if ( isset( $settings[ $name ]['size'] ) ) {
217
+ $val = $settings[ $name ]['size'];
218
+ } else {
219
+ $val = $settings[ $name ][0];
220
+ }
221
+ }
222
+
223
+ if ( is_array( $val ) ) {
224
+ $val = implode( ',', $val );
225
+ }
226
+ $shortcode_atts .= sprintf( ' %1$s="%2$s"', $name, $val );
227
+ }
228
+
229
+ ?>
230
+ <div class="elementor-<?php $this->tag; ?>"><?php
231
+ echo do_shortcode( sprintf( $shortcode, $this->tag, $shortcode_atts ) );
232
+ ?></div>
233
+ <?php
234
+ }
235
+
236
+ protected function _content_template() {}
237
+
238
+ /**
239
+ * Returns widget instance for register function
240
+ *
241
+ * @return object
242
+ */
243
+ public static function get_instance() {
244
+ return new self();
245
+ }
246
+
247
+ }
public/includes/ext/class-cherry-projects-terms-elementor-module.php ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ class Cherry_Projects_Terms_Elementor_Widget extends Elementor\Widget_Base {
6
+
7
+ /**
8
+ * Shortcode tag
9
+ *
10
+ * @var string
11
+ */
12
+ protected $tag = 'cherry_projects_terms';
13
+
14
+ /**
15
+ * Rewritten shortcode arguments
16
+ *
17
+ * @var array
18
+ */
19
+ protected $rewrite = array(
20
+ 'id' => 'post_id',
21
+ );
22
+
23
+ /**
24
+ * Get shortcode data by name
25
+ *
26
+ * @param string $name Data name to get.
27
+ * @return mixed
28
+ */
29
+ public function get_shortcode( $name ) {
30
+
31
+ if ( ! isset( cherry_projects_elementor_compat()->shortcodes[ $this->tag ] ) ) {
32
+ return;
33
+ }
34
+
35
+ $shortcode = wp_parse_args( cherry_projects_elementor_compat()->shortcodes[ $this->tag ], array(
36
+ 'title' => null,
37
+ 'icon' => 'eicon-shortcode',
38
+ 'atts' => array(),
39
+ ) );
40
+
41
+ return isset( $shortcode[ $name ] ) ? $shortcode[ $name ] : false;
42
+ }
43
+
44
+ public function get_name() {
45
+ return $this->tag;
46
+ }
47
+
48
+ public function get_title() {
49
+ return $this->get_shortcode( 'title' );
50
+ }
51
+
52
+ public function get_icon() {
53
+ return $this->get_shortcode( 'icon' );
54
+ }
55
+
56
+ public function get_categories() {
57
+ return array( 'cherry' );
58
+ }
59
+
60
+ public function is_reload_preview_required() {
61
+ return true;
62
+ }
63
+
64
+ /**
65
+ * Map controls
66
+ *
67
+ * @param string $name Default control name.
68
+ * @return string
69
+ */
70
+ protected function _get_mapped_control( $name = null ) {
71
+
72
+ $mapped_controls = array(
73
+ 'media' => Elementor\Controls_Manager::MEDIA,
74
+ 'text' => Elementor\Controls_Manager::TEXT,
75
+ 'textarea' => Elementor\Controls_Manager::TEXTAREA,
76
+ 'select' => Elementor\Controls_Manager::SELECT2,
77
+ 'switcher' => Elementor\Controls_Manager::SWITCHER,
78
+ 'slider' => Elementor\Controls_Manager::SLIDER,
79
+ 'radio' => Elementor\Controls_Manager::SELECT,
80
+ );
81
+
82
+ if ( array_key_exists( $name, $mapped_controls ) ) {
83
+ return $mapped_controls[ $name ];
84
+ } else {
85
+ return false;
86
+ }
87
+
88
+ }
89
+
90
+ /**
91
+ * Sanitize attribute arguments data.
92
+ *
93
+ * @param array $data Input arguments.
94
+ * @param string $type Attribute control type.
95
+ * @return array
96
+ */
97
+ protected function _sanitize_attr_data( $data ) {
98
+
99
+ $type = $this->_get_mapped_control( $data['type'] );
100
+
101
+ if ( ! $type ) {
102
+ return false;
103
+ }
104
+
105
+ $mapped_args = array(
106
+ 'label' => $data['title'],
107
+ 'type' => $type,
108
+ 'default' => array( $data['value'] ),
109
+ );
110
+
111
+ if ( 'switcher' === $data['type'] ) {
112
+ $mapped_args['default'] = ( 'true' === $data['value'] ) ? 'yes' : '';
113
+
114
+ if ( array_key_exists( 'toggle', $data ) ) {
115
+ $mapped_args[ 'label_off' ] = esc_html__( 'No', 'cherry-projects' );
116
+ $mapped_args[ 'label_on' ] = esc_html__( 'Yes', 'cherry-projects' );
117
+ }
118
+ }
119
+
120
+ if ( isset( $data['options'] ) ) {
121
+ $mapped_args['options'] = $data['options'];
122
+ }
123
+
124
+ if ( isset( $data['options_cb'] ) ) {
125
+ $mapped_args['options'] = call_user_func( $data['options_cb'] );
126
+ }
127
+
128
+ if ( 'radio' === $data['type'] ) {
129
+ foreach ( $mapped_args['options'] as $option => $data ) {
130
+ $mapped_args['options'][ $option ] = $data[ 'label' ];
131
+ }
132
+ }
133
+
134
+ if ( array_key_exists( 'multiple', $data ) && filter_var( $data[ 'multiple' ], FILTER_VALIDATE_BOOLEAN ) ) {
135
+ $mapped_args['multiple'] = true;
136
+ }
137
+
138
+ if ( isset( $data['min_value'] ) && isset( $data['max_value'] ) ) {
139
+ $mapped_args['default'] = array(
140
+ 'size' => $data['value'],
141
+ );
142
+ $mapped_args['range'] = array(
143
+ 'px' => array(
144
+ 'min' => $data['min_value'],
145
+ 'max' => $data['max_value'],
146
+ ),
147
+ );
148
+ }
149
+ //var_dump($mapped_args);
150
+
151
+ return $mapped_args;
152
+ }
153
+
154
+ /**
155
+ * Sanitize attribute name
156
+ *
157
+ * @param string $name Attribute name.
158
+ * @return string
159
+ */
160
+ protected function _sanitize_attr_name( $name ) {
161
+ return isset( $this->rewrite[ $name ] ) ? $this->rewrite[ $name ] : $name;
162
+ }
163
+
164
+ protected function _register_controls() {
165
+
166
+ $args = $this->get_shortcode( 'atts' );
167
+
168
+ if ( ! $args ) {
169
+ return;
170
+ }
171
+
172
+ $this->start_controls_section(
173
+ 'section_main',
174
+ array(
175
+ 'label' => $this->get_shortcode( 'title' ),
176
+ )
177
+ );
178
+
179
+ foreach ( $args as $name => $arg ) {
180
+
181
+ $name = $this->_sanitize_attr_name( $name );
182
+ $mapped_args = $this->_sanitize_attr_data( $arg );
183
+
184
+ if ( ! $mapped_args ) {
185
+ continue;
186
+ }
187
+
188
+ $this->add_control( $name, $mapped_args );
189
+
190
+ }
191
+
192
+ $this->end_controls_section();
193
+
194
+ }
195
+
196
+ protected function render() {
197
+
198
+ $settings = $this->get_settings();
199
+ $shortcode = '[%1$s%2$s]';
200
+ $shortcode_atts = '';
201
+ $args = $this->get_shortcode( 'atts' );
202
+
203
+ foreach ( $args as $name => $arg ) {
204
+
205
+ if ( empty( $settings[ $name ] ) ) {
206
+
207
+ if ( 'switcher' === $arg['type'] ) {
208
+ $shortcode_atts .= sprintf( ' %1$s="%2$s"', $name, 'false' );
209
+ }
210
+
211
+ continue;
212
+ }
213
+
214
+ if ( ! is_array( $settings[ $name ] ) ) {
215
+ $val = $settings[ $name ];
216
+ } else {
217
+ if ( isset( $settings[ $name ]['size'] ) ) {
218
+ $val = $settings[ $name ]['size'];
219
+ } else {
220
+ $val = $settings[ $name ][0];
221
+ }
222
+ }
223
+
224
+ if ( is_array( $val ) ) {
225
+ $val = implode( ',', $val );
226
+ }
227
+ $shortcode_atts .= sprintf( ' %1$s="%2$s"', $name, $val );
228
+ }
229
+
230
+ ?>
231
+ <div class="elementor-<?php $this->tag; ?>"><?php
232
+ echo do_shortcode( sprintf( $shortcode, $this->tag, $shortcode_atts ) );
233
+ ?></div>
234
+ <?php
235
+ }
236
+
237
+ protected function _content_template() {}
238
+
239
+ /**
240
+ * Returns widget instance for register function
241
+ *
242
+ * @return object
243
+ */
244
+ public static function get_instance() {
245
+ return new self();
246
+ }
247
+
248
+ }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Cherry Projects ===
2
 
3
  Contributors: TemplateMonster 2002
4
- Tags: custom post type, projects, portfolio, cherry framework
5
  Requires at least: 4.5
6
  Tested up to: 4.8.0
7
- Stable tag: 1.2.4
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -159,3 +159,8 @@ Standard templates can be rewritten in the theme. For that you need to create ch
159
 
160
  * Add responsive layouts for masonry and grid layout for terms shortcode
161
  * Fixed bugs
 
 
 
 
 
1
  === Cherry Projects ===
2
 
3
  Contributors: TemplateMonster 2002
4
+ Tags: custom post type, projects, portfolio, cherry framework, elementor, elementor page builder
5
  Requires at least: 4.5
6
  Tested up to: 4.8.0
7
+ Stable tag: 1.2.5
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
159
 
160
  * Add responsive layouts for masonry and grid layout for terms shortcode
161
  * Fixed bugs
162
+
163
+ = 1.2.5 =
164
+
165
+ * Elementor page builder compatibility
166
+ * Fixed bugs