Cherry Projects - Version 1.1.0

Version Description

  • Updated editing interface types of projects
  • Fixed archive template
  • Fixed bugs
  • Added new filters
  • Add new macros "termattachments" for projects_terms shortcode
Download this release

Release Info

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

Code changes from version 1.0.0 to 1.1.0

Files changed (140) hide show
  1. admin/assets/css/admin-style.css +10 -8
  2. admin/assets/scss/admin-style.scss +9 -4
  3. admin/includes/class-projects-meta-boxes.php +294 -4
  4. cherry-framework/cherry-core.php +6 -5
  5. cherry-framework/config.json +53 -68
  6. cherry-framework/modules/cherry-breadcrumbs/cherry-breadcrumbs.php +8 -13
  7. cherry-framework/modules/cherry-creator/cherry-creator.php +0 -122
  8. cherry-framework/modules/cherry-creator/inc/cherry-creator-term.php +0 -126
  9. cherry-framework/modules/cherry-customizer/cherry-customizer.php +58 -15
  10. cherry-framework/modules/cherry-dynamic-css/assets/cherry-css-collector.js +24 -0
  11. cherry-framework/modules/cherry-dynamic-css/assets/min/cherry-css-collector.min.js +1 -0
  12. cherry-framework/modules/cherry-dynamic-css/cherry-dynamic-css.php +55 -29
  13. cherry-framework/modules/cherry-dynamic-css/inc/class-cherry-dynamic-css-collector.php +281 -0
  14. cherry-framework/modules/cherry-dynamic-css/inc/class-cherry-dynamic-css-utilities.php +1 -1
  15. cherry-framework/modules/cherry-handler/assets/css/cherry-handler-styles.min.css +1 -0
  16. cherry-framework/modules/cherry-handler/assets/js/cherry-handler.js +286 -0
  17. cherry-framework/modules/cherry-handler/assets/js/min/cherry-handler.min.js +1 -0
  18. cherry-framework/modules/cherry-handler/assets/scss/cherry-handler-styles.scss +65 -0
  19. cherry-framework/modules/cherry-handler/cherry-handler.php +233 -0
  20. cherry-framework/modules/cherry-interface-builder/cherry-interface-builder.php +471 -0
  21. cherry-framework/modules/cherry-interface-builder/inc/assets/_use-in-js.scss +17 -0
  22. cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.js +189 -0
  23. cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.scss +463 -0
  24. cherry-framework/modules/cherry-interface-builder/inc/assets/min/cherry-interface-builder.min.css +1 -0
  25. cherry-framework/modules/cherry-interface-builder/inc/assets/min/cherry-interface-builder.min.js +1 -0
  26. cherry-framework/modules/cherry-interface-builder/inc/views/component-accordion.php +30 -0
  27. cherry-framework/modules/cherry-interface-builder/inc/views/component-repeater.php +30 -0
  28. cherry-framework/modules/cherry-interface-builder/inc/views/component-tab-horizontal.php +35 -0
  29. cherry-framework/modules/cherry-interface-builder/inc/views/component-tab-vertical.php +35 -0
  30. cherry-framework/modules/cherry-interface-builder/inc/views/component-toggle.php +30 -0
  31. cherry-framework/modules/cherry-interface-builder/inc/views/control.php +34 -0
  32. cherry-framework/modules/cherry-interface-builder/inc/views/form.php +24 -0
  33. cherry-framework/modules/cherry-interface-builder/inc/views/html.php +24 -0
  34. cherry-framework/modules/cherry-interface-builder/inc/views/section.php +36 -0
  35. cherry-framework/modules/cherry-interface-builder/inc/views/settings-children-title.php +18 -0
  36. cherry-framework/modules/cherry-interface-builder/inc/views/settings.php +32 -0
  37. cherry-framework/modules/cherry-interface-builder/inc/views/tab-children-title.php +20 -0
  38. cherry-framework/modules/cherry-interface-builder/inc/views/toggle-children-title.php +22 -0
  39. cherry-framework/modules/cherry-js-core/assets/js/cherry-js-core.js +1 -56
  40. cherry-framework/modules/cherry-js-core/assets/js/min/cherry-js-core.min.js +1 -1
  41. cherry-framework/modules/cherry-page-builder/assets/css/min/page-settings.min.css +0 -18
  42. cherry-framework/modules/cherry-page-builder/assets/js/min/page-settings.min.js +0 -1
  43. cherry-framework/modules/cherry-page-builder/assets/js/page-settings.js +0 -92
  44. cherry-framework/modules/cherry-page-builder/assets/scss/page-setting.scss +0 -80
  45. cherry-framework/modules/cherry-page-builder/cherry-page-builder.php +0 -406
  46. cherry-framework/modules/cherry-page-builder/views/page.php +0 -46
  47. cherry-framework/modules/cherry-page-builder/views/section.php +0 -10
  48. cherry-framework/modules/cherry-plugin-updater/cherry-plugin-updater.php +0 -143
  49. cherry-framework/modules/cherry-plugin-updater/inc/cherry-base-updater.php +0 -156
  50. cherry-framework/modules/cherry-post-formats-api/cherry-post-formats-api.php +23 -6
  51. cherry-framework/modules/cherry-post-formats-api/inc/class-cherry-facebook-embed.php +1 -1
  52. cherry-framework/modules/cherry-post-meta/cherry-post-meta.php +239 -146
  53. cherry-framework/modules/cherry-post-meta/views/meta.php +0 -20
  54. cherry-framework/modules/cherry-post-types/cherry-post-types.php +0 -155
  55. cherry-framework/modules/cherry-post-types/inc/cherry-post-type.php +0 -112
  56. cherry-framework/modules/cherry-taxonomies/cherry-taxonomies.php +0 -132
  57. cherry-framework/modules/cherry-taxonomies/inc/cherry-taxonomy.php +0 -210
  58. cherry-framework/modules/cherry-template-manager/cherry-template-manager.php +129 -0
  59. cherry-framework/modules/cherry-template-manager/inc/cherry-template-loader.php +223 -0
  60. cherry-framework/modules/cherry-template-manager/inc/cherry-template-parser.php +219 -0
  61. cherry-framework/modules/cherry-term-meta/cherry-term-meta.php +19 -9
  62. cherry-framework/modules/cherry-theme-updater/cherry-theme-updater.php +0 -141
  63. cherry-framework/modules/cherry-theme-updater/inc/cherry-base-updater.php +0 -156
  64. cherry-framework/modules/cherry-toolkit/cherry-toolkit.php +19 -8
  65. cherry-framework/modules/cherry-ui-elements/cherry-ui-elements.php +7 -5
  66. cherry-framework/modules/cherry-ui-elements/i-ui.php +1 -1
  67. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/min/ui-button.min.css +1 -0
  68. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-button.scss +52 -0
  69. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-kit/_mixins.scss +182 -0
  70. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-kit/_variables.scss +25 -0
  71. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/ui-button.php +87 -0
  72. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/view/button-view.php +31 -0
  73. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.css +1 -56
  74. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.js +1 -1
  75. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-checkbox.js +40 -57
  76. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-checkbox.scss +14 -8
  77. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/ui-checkbox.php +8 -7
  78. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/min/ui-colorpicker.min.css +1 -41
  79. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/min/ui-colorpicker.min.js +1 -1
  80. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-colorpicker.js +3 -2
  81. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-colorpicker.scss +2 -2
  82. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/ui-colorpicker.php +6 -6
  83. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/min/ui-iconpicker.min.css +1 -326
  84. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/min/ui-iconpicker.min.js +1 -1
  85. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-iconpicker.js +4 -2
  86. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-iconpicker.scss +6 -8
  87. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/ui-iconpicker.php +5 -3
  88. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/min/ui-media.min.js +156 -1
  89. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-media.js +98 -101
  90. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/ui-media.php +99 -88
  91. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/min/ui-radio.min.css +1 -67
  92. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/min/ui-radio.min.js +1 -1
  93. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/ui-radio.js +35 -40
  94. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/ui-radio.scss +24 -13
  95. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/ui-radio.php +14 -14
  96. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/min/ui-repeater.min.js +1 -1
  97. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/ui-repeater.js +4 -2
  98. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/ui-repeater.php +12 -13
  99. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/select2.min.css +7 -7
  100. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select.min.css +1 -1
  101. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select.min.js +1 -1
  102. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.js +41 -9
  103. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.scss +18 -5
  104. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/ui-select.php +26 -15
  105. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/min/ui-slider.min.css +1 -1
  106. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/min/ui-slider.min.js +1 -1
  107. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/ui-slider.js +3 -3
  108. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/ui-slider.scss +11 -8
  109. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/ui-slider.php +6 -6
  110. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/ui-stepper.php +6 -6
  111. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/min/ui-switcher.min.css +1 -80
  112. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/min/ui-switcher.min.js +1 -1
  113. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-switcher.js +46 -36
  114. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-switcher.scss +30 -24
  115. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/ui-switcher.php +12 -10
  116. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/ui-text.php +6 -4
  117. cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/ui-textarea.php +6 -6
  118. cherry-framework/modules/cherry-ui-elements/ui-element.php +2 -2
  119. cherry-framework/modules/cherry-utility/cherry-utility.php +4 -3
  120. cherry-framework/modules/cherry-utility/inc/cherry-attributes-utilit.php +26 -28
  121. cherry-framework/modules/cherry-utility/inc/cherry-media-utilit.php +42 -3
  122. cherry-framework/modules/cherry-utility/inc/cherry-meta-data-utilit.php +13 -7
  123. cherry-framework/modules/cherry-utility/inc/cherry-satellite-utilit.php +9 -7
  124. cherry-framework/modules/cherry-widget-factory/cherry-widget-factory.php +4 -3
  125. cherry-framework/modules/cherry-widget-factory/inc/class-cherry-abstract-widget.php +25 -1
  126. cherry-framework/setup.php +1 -1
  127. cherry-projects.php +6 -3
  128. public/assets/css/styles.css +21 -0
  129. public/assets/js/cherry-projects-plugin.js +21 -2
  130. public/assets/js/cherry-projects-scripts.js +43 -1
  131. public/assets/scss/_projects-terms.scss +13 -1
  132. public/includes/class-cherry-projects-template-callbacks.php +33 -4
  133. public/includes/class-projects-data.php +43 -18
  134. public/includes/class-projects-shortcode.php +1 -1
  135. public/includes/class-projects-term-data.php +23 -11
  136. readme.txt +11 -3
  137. templates/shortcodes/projects-terms/terms-cascading-grid-default.tmpl +11 -0
  138. templates/shortcodes/projects-terms/terms-grid-default.tmpl +2 -1
  139. templates/shortcodes/projects-terms/terms-list-default.tmpl +1 -0
  140. templates/shortcodes/projects-terms/terms-masonry-default.tmpl +2 -1
admin/assets/css/admin-style.css CHANGED
@@ -184,6 +184,9 @@
184
  50% {
185
  -webkit-transform: scale(1);
186
  transform: scale(1); } }
 
 
 
187
  .cherry-ui-repeater-container .cheryr-ui-repeater-content-box {
188
  display: -webkit-box;
189
  display: -webkit-flex;
@@ -206,16 +209,15 @@
206
  margin-left: 1%; }
207
  .cherry-ui-repeater-container .cheryr-ui-repeater-content-box .skill_label-wrap {
208
  -webkit-box-flex: 0;
209
- -webkit-flex: 0 1 49%;
210
- -ms-flex: 0 1 49%;
211
- flex: 0 1 49%;
212
- margin-right: 1%; }
213
  .cherry-ui-repeater-container .cheryr-ui-repeater-content-box .skill_value-wrap {
214
  -webkit-box-flex: 0;
215
- -webkit-flex: 0 1 49%;
216
- -ms-flex: 0 1 49%;
217
- flex: 0 1 49%;
218
- margin-left: 1%; }
219
  .cherry-ui-repeater-container .cheryr-ui-repeater-content-box .video_type-wrap {
220
  -webkit-box-flex: 0;
221
  -webkit-flex: 0 1 100%;
184
  50% {
185
  -webkit-transform: scale(1);
186
  transform: scale(1); } }
187
+ .cherry-project-tabs-wrapper.cherry-component {
188
+ padding: 5px 0; }
189
+
190
  .cherry-ui-repeater-container .cheryr-ui-repeater-content-box {
191
  display: -webkit-box;
192
  display: -webkit-flex;
209
  margin-left: 1%; }
210
  .cherry-ui-repeater-container .cheryr-ui-repeater-content-box .skill_label-wrap {
211
  -webkit-box-flex: 0;
212
+ -webkit-flex: 0 1 100%;
213
+ -ms-flex: 0 1 100%;
214
+ flex: 0 1 100%;
215
+ margin-bottom: 20px; }
216
  .cherry-ui-repeater-container .cheryr-ui-repeater-content-box .skill_value-wrap {
217
  -webkit-box-flex: 0;
218
+ -webkit-flex: 0 1 100%;
219
+ -ms-flex: 0 1 100%;
220
+ flex: 0 1 100%; }
 
221
  .cherry-ui-repeater-container .cheryr-ui-repeater-content-box .video_type-wrap {
222
  -webkit-box-flex: 0;
223
  -webkit-flex: 0 1 100%;
admin/assets/scss/admin-style.scss CHANGED
@@ -225,6 +225,12 @@
225
  }
226
  }
227
 
 
 
 
 
 
 
228
  .cherry-ui-repeater-container{
229
  .cheryr-ui-repeater-content-box{
230
  display: flex;
@@ -238,12 +244,11 @@
238
  margin-left: 1%;
239
  }
240
  .skill_label-wrap{
241
- flex: 0 1 49%;
242
- margin-right: 1%;
243
  }
244
  .skill_value-wrap{
245
- flex: 0 1 49%;
246
- margin-left: 1%;
247
  }
248
  .video_type-wrap{
249
  flex: 0 1 100%;
225
  }
226
  }
227
 
228
+ .cherry-project-tabs-wrapper{
229
+ &.cherry-component{
230
+ padding: 5px 0;
231
+ }
232
+ }
233
+
234
  .cherry-ui-repeater-container{
235
  .cheryr-ui-repeater-content-box{
236
  display: flex;
244
  margin-left: 1%;
245
  }
246
  .skill_label-wrap{
247
+ flex: 0 1 100%;
248
+ margin-bottom: 20px;
249
  }
250
  .skill_value-wrap{
251
+ flex: 0 1 100%;
 
252
  }
253
  .video_type-wrap{
254
  flex: 0 1 100%;
admin/includes/class-projects-meta-boxes.php CHANGED
@@ -39,12 +39,302 @@ class Cherry_Projects_Meta_Boxes {
39
  /**
40
  * Run initialization of modules.
41
  *
42
- * @since 1.0.0
43
  */
44
  public function init() {
45
  $prefix = CHERRY_PROJECTS_POSTMETA;
46
 
47
- cherry_projects()->get_core()->init_module( 'cherry-post-meta', array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  'id' => 'projects-settings',
49
  'title' => esc_html__( 'Projects settings', '__tm' ),
50
  'page' => array( CHERRY_PROJECTS_NAME ),
@@ -304,7 +594,7 @@ class Cherry_Projects_Meta_Boxes {
304
  ),
305
  ),
306
  ),
307
- ) );
308
  }
309
 
310
  /**
@@ -324,4 +614,4 @@ class Cherry_Projects_Meta_Boxes {
324
  }
325
  }
326
 
327
- Cherry_Projects_Meta_Boxes::get_instance();
39
  /**
40
  * Run initialization of modules.
41
  *
42
+ * @since 1.1.0
43
  */
44
  public function init() {
45
  $prefix = CHERRY_PROJECTS_POSTMETA;
46
 
47
+ cherry_projects()->get_core()->init_module( 'cherry-post-meta',
48
+ array(
49
+ 'id' => 'projects-settings',
50
+ 'title' => esc_html__( 'Popup settings', 'cherry-projects' ),
51
+ 'page' => array( CHERRY_PROJECTS_NAME ),
52
+ 'context' => 'normal',
53
+ 'priority' => 'high',
54
+ 'callback_args' => false,
55
+ 'fields' => array(
56
+ 'project_meta_data' => array(
57
+ 'type' => 'settings',
58
+ 'element' => 'settings',
59
+ ),
60
+ 'tab_vertical' => array(
61
+ 'type' => 'component-tab-horizontal',
62
+ 'element' => 'component',
63
+ 'parent' => 'project_meta_data',
64
+ 'class' => 'cherry-project-tabs-wrapper',
65
+ ),
66
+ 'general_tab' => array(
67
+ 'element' => 'settings',
68
+ 'parent' => 'tab_vertical',
69
+ 'title' => esc_html__( 'General', 'cherry-projects' ),
70
+ 'description' => esc_html__( 'General project settings', 'cherry-projects' ),
71
+ ),
72
+ 'image_format_tab' => array(
73
+ 'element' => 'settings',
74
+ 'parent' => 'tab_vertical',
75
+ 'title' => esc_html__( 'Image Format', 'cherry-projects' ),
76
+ 'description' => esc_html__( 'Project options for Image format', 'cherry-projects' ),
77
+ ),
78
+ 'gallery_format_tab' => array(
79
+ 'element' => 'settings',
80
+ 'parent' => 'tab_vertical',
81
+ 'title' => esc_html__( 'Gallery Format', 'cherry-projects' ),
82
+ 'description' => esc_html__( 'Project options for Gallery format', 'cherry-projects' ),
83
+ ),
84
+ 'audio_format_tab' => array(
85
+ 'element' => 'settings',
86
+ 'parent' => 'tab_vertical',
87
+ 'title' => esc_html__( 'Audio Format', 'cherry-projects' ),
88
+ 'description' => esc_html__( 'Project options for Audio format', 'cherry-projects' ),
89
+ ),
90
+ 'video_format_tab' => array(
91
+ 'element' => 'settings',
92
+ 'parent' => 'tab_vertical',
93
+ 'title' => esc_html__( 'Video Format', 'cherry-projects' ),
94
+ 'description' => esc_html__( 'Project options for Video format', 'cherry-projects' ),
95
+ ),
96
+ $prefix . '_external_link' => array(
97
+ 'type' => 'text',
98
+ 'parent' => 'general_tab',
99
+ 'title' => esc_html__( 'External link', 'cherry-projects' ),
100
+ 'description' => esc_html__( 'Input external link address', 'cherry-projects' ),
101
+ 'value' => '#',
102
+ ),
103
+ $prefix . '_external_link_text' => array(
104
+ 'type' => 'text',
105
+ 'parent' => 'general_tab',
106
+ 'title' => esc_html__( 'External link text', 'cherry-projects' ),
107
+ 'description' => esc_html__( 'Text for external link', 'cherry-projects' ),
108
+ 'value' => '',
109
+ ),
110
+ $prefix . '_external_link_target' => array(
111
+ 'type' => 'radio',
112
+ 'parent' => 'general_tab',
113
+ 'title' => esc_html__( 'External link target', 'cherry-projects' ),
114
+ 'description' => esc_html__( 'Target for external link', 'cherry-projects' ),
115
+ 'value' => 'blank',
116
+ 'display-input' => true,
117
+ 'options' => array(
118
+ 'blank' => array(
119
+ 'label' => esc_html__( 'Blank', 'cherry-projects' ),
120
+ ),
121
+ 'self' => array(
122
+ 'label' => esc_html__( 'Self', 'cherry-projects' ),
123
+ ),
124
+ ),
125
+ ),
126
+ $prefix . '_details' => array(
127
+ 'type' => 'repeater',
128
+ 'parent' => 'general_tab',
129
+ 'title' => esc_html__( 'Projects Details', 'cherry-projects' ),
130
+ 'description' => esc_html__( 'Here you can create a list of project details', 'cherry-projects' ),
131
+ 'add_label' => esc_html__( 'Add Projects Details', 'cherry-projects' ),
132
+ 'title_field' => 'detail_label',
133
+ 'fields' => array(
134
+ 'detail_label' => array(
135
+ 'type' => 'text',
136
+ 'id' => 'detail_label',
137
+ 'name' => 'detail_label',
138
+ 'placeholder' => esc_html__( 'Enter label', 'cherry-projects' ),
139
+ 'label' => esc_html__( 'Detail Label', 'cherry-projects' ),
140
+ ),
141
+ 'detail_info' => array(
142
+ 'type' => 'text',
143
+ 'id' => 'detail_info',
144
+ 'name' => 'detail_info',
145
+ 'placeholder' => esc_html__( 'Enter info', 'cherry-projects' ),
146
+ 'label' => esc_html__( 'Detail Info', 'cherry-projects' ),
147
+ ),
148
+ ),
149
+ ),
150
+ $prefix . '_skills' => array(
151
+ 'type' => 'repeater',
152
+ 'parent' => 'general_tab',
153
+ 'title' => esc_html__( 'Projects skills', 'cherry-projects' ),
154
+ 'description' => esc_html__( 'Here you can create a list of participants in the creation of the project', 'cherry-projects' ),
155
+ 'add_label' => esc_html__( 'Add Skill', 'cherry-projects' ),
156
+ 'title_field' => 'skill_label',
157
+ 'fields' => array(
158
+ 'skill_label' => array(
159
+ 'type' => 'text',
160
+ 'id' => 'skill_label',
161
+ 'name' => 'skill_label',
162
+ 'placeholder' => esc_html__( 'Skill label', 'cherry-projects' ),
163
+ 'label' => esc_html__( 'Skill Label', 'cherry-projects' ),
164
+ ),
165
+ 'skill_value' => array(
166
+ 'type' => 'slider',
167
+ 'id' => 'skill_value',
168
+ 'name' => 'skill_value',
169
+ 'label' => esc_html__( 'Skill Value', 'cherry-projects' ),
170
+ ),
171
+ ),
172
+ ),
173
+ $prefix . '_image_attachments_ids' => array(
174
+ 'type' => 'media',
175
+ 'parent' => 'image_format_tab',
176
+ 'title' => esc_html__( 'Additional images', 'cherry-projects' ),
177
+ 'description' => esc_html__( 'Select attachments images', 'cherry-projects' ),
178
+ 'display_image' => true,
179
+ 'multi_upload' => true,
180
+ 'upload_button_text' => __( 'Add images', 'cherry-projects' ),
181
+ 'library_type' => 'image',
182
+ ),
183
+ $prefix . '_listing_layout' => array(
184
+ 'type' => 'radio',
185
+ 'parent' => 'image_format_tab',
186
+ 'title' => esc_html__( 'Image listing layout', 'cherry-projects' ),
187
+ 'description' => esc_html__( 'Select listing layout', 'cherry-projects' ),
188
+ 'value' => 'grid-layout',
189
+ 'class' => '',
190
+ 'display_input' => false,
191
+ 'options' => array(
192
+ 'grid-layout' => array(
193
+ 'label' => esc_html__( 'Grid', 'cherry-projects' ),
194
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-grid.svg',
195
+ 'slave' => 'projects-listing-layout-grid-layout',
196
+ ),
197
+ 'masonry-layout' => array(
198
+ 'label' => esc_html__( 'Masonry', 'cherry-projects' ),
199
+ 'img_src' => CHERRY_PROJECTS_URI . 'public/assets/images/svg/list-layout-masonry.svg',
200
+ 'slave' => 'projects-listing-layout-masonry-layout',
201
+ ),
202
+ ),
203
+ ),
204
+ $prefix . '_column_number' => array(
205
+ 'type' => 'slider',
206
+ 'parent' => 'image_format_tab',
207
+ 'title' => esc_html__( 'Column number', 'cherry-projects' ),
208
+ 'description' => esc_html__( 'Select number of columns for masonry and grid projects layouts.', 'cherry-projects' ),
209
+ 'max_value' => 10,
210
+ 'min_value' => 1,
211
+ 'value' => 3,
212
+ ),
213
+ $prefix . '_image_margin' => array(
214
+ 'type' => 'slider',
215
+ 'parent' => 'image_format_tab',
216
+ 'title' => esc_html__( 'Image margin', 'cherry-projects' ),
217
+ 'description' => esc_html__( 'Select projects item margin (outer indent) value.(px)', 'cherry-projects' ),
218
+ 'max_value' => 30,
219
+ 'min_value' => 0,
220
+ 'value' => 10,
221
+ ),
222
+ $prefix . '_slider_attachments_ids' => array(
223
+ 'type' => 'media',
224
+ 'parent' => 'gallery_format_tab',
225
+ 'title' => esc_html__( 'Gallery images', 'cherry-projects' ),
226
+ 'description' => esc_html__( 'Select gallery images', 'cherry-projects' ),
227
+ 'display_image' => true,
228
+ 'multi_upload' => true,
229
+ 'upload_button_text' => __( 'Add images', 'cherry-projects' ),
230
+ 'library_type' => 'image',
231
+ ),
232
+ $prefix . '_slider_navigation' => array(
233
+ 'type' => 'switcher',
234
+ 'parent' => 'gallery_format_tab',
235
+ 'value' => 'true',
236
+ 'title' => esc_html__( 'Use navigation?', 'cherry-projects' ),
237
+ 'description' => esc_html__( 'Set the value to true if you want to use navigation', 'cherry-projects' ),
238
+ ),
239
+ $prefix . '_slider_loop' => array(
240
+ 'type' => 'switcher',
241
+ 'parent' => 'gallery_format_tab',
242
+ 'value' => 'true',
243
+ 'title' => esc_html__( 'Use infinite scrolling?', 'cherry-projects' ),
244
+ 'description' => esc_html__( 'Set the value to true if you want to use infinite scrolling', 'cherry-projects' ),
245
+ ),
246
+ $prefix . '_slider_thumbnails_position' => array(
247
+ 'type' => 'radio',
248
+ 'parent' => 'gallery_format_tab',
249
+ 'title' => esc_html__( 'Thumbnails position', 'cherry-projects' ),
250
+ 'description' => esc_html__( 'Select position for Thumbnails list', 'cherry-projects' ),
251
+ 'value' => 'bottom',
252
+ 'display-input' => true,
253
+ 'options' => array(
254
+ 'top' => array(
255
+ 'label' => esc_html__( 'Top', 'cherry-projects' ),
256
+ ),
257
+ 'bottom' => array(
258
+ 'label' => esc_html__( 'Bottom', 'cherry-projects' ),
259
+ ),
260
+ 'right' => array(
261
+ 'label' => esc_html__( 'Right', 'cherry-projects' ),
262
+ ),
263
+ 'left' => array(
264
+ 'label' => esc_html__( 'Left', 'cherry-projects' ),
265
+ ),
266
+ ),
267
+ ),
268
+ $prefix . '_audio_attachments_ids' => array(
269
+ 'type' => 'media',
270
+ 'parent' => 'audio_format_tab',
271
+ 'title' => esc_html__( 'Audio source', 'cherry-projects' ),
272
+ 'description' => esc_html__( 'Select audio source( mp3, m4a, ogg, wav, wma )', 'cherry-projects' ),
273
+ 'display_image' => true,
274
+ 'multi_upload' => true,
275
+ 'upload_button_text' => esc_html__( 'Add sound', 'cherry-projects' ),
276
+ 'library_type' => 'audio',
277
+ ),
278
+ $prefix . '_video_list' => array(
279
+ 'type' => 'repeater',
280
+ 'parent' => 'video_format_tab',
281
+ 'title' => esc_html__( 'Video list', 'cherry-projects' ),
282
+ 'description' => esc_html__( 'Select video source', 'cherry-projects' ),
283
+ 'add_label' => esc_html__( 'Add New Video', 'cherry-projects' ),
284
+ 'title_field' => 'detail_label',
285
+ 'fields' => array(
286
+ 'video_type' => array(
287
+ 'type' => 'radio',
288
+ 'label' => esc_html__( 'Video source type', 'cherry-projects' ),
289
+ 'id' => 'video_type',
290
+ 'name' => 'video_type',
291
+ 'display-input' => true,
292
+ 'options' => array(
293
+ 'embed' => array(
294
+ 'label' => esc_html__( 'Embed video type', 'cherry-projects' ),
295
+ ),
296
+ 'html5' => array(
297
+ 'label' => esc_html__( 'HTML5 video type', 'cherry-projects' ),
298
+ ),
299
+ ),
300
+ ),
301
+ 'video_embed' => array(
302
+ 'type' => 'text',
303
+ 'id' => 'video_embed',
304
+ 'name' => 'video_embed',
305
+ 'placeholder' => esc_html__( 'Select embed url', 'cherry-projects' ),
306
+ 'label' => esc_html__( 'Video embed url', 'cherry-projects' ),
307
+ ),
308
+ 'video_src' => array(
309
+ 'type' => 'media',
310
+ 'id' => 'video_src',
311
+ 'name' => 'video_src',
312
+ 'label' => esc_html__( 'HTML5 Video source', 'cherry-projects' ),
313
+ 'display_image' => true,
314
+ 'multi_upload' => false,
315
+ 'upload_button_text' => esc_html__( 'Add Video', 'cherry-projects' ),
316
+ 'library_type' => 'video',
317
+ ),
318
+ 'poster_src' => array(
319
+ 'type' => 'media',
320
+ 'id' => 'poster_src',
321
+ 'name' => 'poster_src',
322
+ 'label' => esc_html__( 'HTML5 video poster', 'cherry-projects' ),
323
+ 'display_image' => true,
324
+ 'multi_upload' => false,
325
+ 'upload_button_text' => esc_html__( 'Add Poster', 'cherry-projects' ),
326
+ 'library_type' => 'image',
327
+ ),
328
+ ),
329
+ ),
330
+ //
331
+ )
332
+ )
333
+ );
334
+
335
+
336
+
337
+ /*cherry_projects()->get_core()->init_module( 'cherry-post-meta', array(
338
  'id' => 'projects-settings',
339
  'title' => esc_html__( 'Projects settings', '__tm' ),
340
  'page' => array( CHERRY_PROJECTS_NAME ),
594
  ),
595
  ),
596
  ),
597
+ ) );*/
598
  }
599
 
600
  /**
614
  }
615
  }
616
 
617
+ Cherry_Projects_Meta_Boxes::get_instance();
cherry-framework/cherry-core.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Class Cherry Core
4
- * Version: 1.1.1
5
  *
6
  * @package Cherry_Framework
7
  * @subpackage Class
@@ -59,9 +59,10 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
59
  * Constructor.
60
  *
61
  * @since 1.0.0
 
62
  */
63
  public function __construct( $settings = array() ) {
64
- $base_dir = trailingslashit( __DIR__ );
65
  $base_url = trailingslashit( $this->base_url( '', __FILE__ ) );
66
 
67
  $defaults = array(
@@ -405,8 +406,8 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
405
  if ( 0 === strpos( $module_path, $plugin_dir ) ) {
406
  $url = plugin_dir_url( $module_path );
407
  } else if ( false !== strpos( $module_path, $theme_dir ) ) {
408
- $explode = explode( $theme_dir, $module_dir, 2 );
409
- $url = get_stylesheet_directory_uri() . $explode[1];
410
  } else {
411
  $site_url = site_url();
412
  $abs_path = wp_normalize_path( ABSPATH );
@@ -444,7 +445,7 @@ if ( ! class_exists( 'Cherry_Core' ) ) {
444
  * Get path to the core directory.
445
  *
446
  * @since 1.0.0
447
- * @deprecated 1.1.0 Use constant `__DIR__`
448
  * @return string
449
  */
450
  public function get_core_dir() {
1
  <?php
2
  /**
3
  * Class Cherry Core
4
+ * Version: 1.3.0
5
  *
6
  * @package Cherry_Framework
7
  * @subpackage Class
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(
406
  if ( 0 === strpos( $module_path, $plugin_dir ) ) {
407
  $url = plugin_dir_url( $module_path );
408
  } else if ( false !== strpos( $module_path, $theme_dir ) ) {
409
+ $explode = explode( $theme_dir, $module_dir );
410
+ $url = get_stylesheet_directory_uri() . end( $explode );
411
  } else {
412
  $site_url = site_url();
413
  $abs_path = wp_normalize_path( ABSPATH );
445
  * Get path to the core directory.
446
  *
447
  * @since 1.0.0
448
+ * @deprecated 1.1.0 Use constant `dirname( __FILE__ )`
449
  * @return string
450
  */
451
  public function get_core_dir() {
cherry-framework/config.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name" : "Cherry Framework",
3
- "version" : "1.1.1",
4
  "description" : "",
5
  "doc_link" : "",
6
  "git_link" : "https://github.com/CherryFramework/cherry-framework",
@@ -8,6 +8,7 @@
8
  "cherry-breadcrumbs" : {
9
  "name" : "Breadcrumb Trail",
10
  "description" : "A breadcrumb menu script for WordPress.",
 
11
  "doc_link" : "",
12
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-breadcrumbs",
13
  "compatible" : ["theme", "plugin"],
@@ -15,19 +16,10 @@
15
  "required" : false,
16
  "dependencies" : []
17
  },
18
- "cherry-creator" : {
19
- "name" : "Creator.",
20
- "description" : "Creator.",
21
- "doc_link" : "",
22
- "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-creator",
23
- "compatible" : ["theme", "plugin"],
24
- "wordpress_org" : true,
25
- "required" : false,
26
- "dependencies" : []
27
- },
28
  "cherry-customizer" : {
29
- "name" : "Customizer",
30
  "description" : "Customizer functionality.",
 
31
  "doc_link" : "",
32
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-customizer",
33
  "compatible" : ["theme", "plugin"],
@@ -36,8 +28,9 @@
36
  "dependencies" : []
37
  },
38
  "cherry-dynamic-css" : {
39
- "name" : "Dynamic Css",
40
- "description" : "Generate Css.",
 
41
  "doc_link" : "",
42
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-dynamic-css",
43
  "compatible" : ["theme", "plugin"],
@@ -47,7 +40,8 @@
47
  },
48
  "cherry-google-fonts-loader" : {
49
  "name" : "Google Fonts Loader",
50
- "description" : "Enqueue Google font.",
 
51
  "doc_link" : "",
52
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-google-fonts-loader",
53
  "compatible" : ["theme", "plugin"],
@@ -55,39 +49,43 @@
55
  "required" : false,
56
  "dependencies" : []
57
  },
58
- "cherry-js-core" : {
59
- "name" : "JS Core",
60
- "description" : "Initializes global JS object which provides additional plugin functionality.",
 
61
  "doc_link" : "",
62
- "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-js-core",
63
  "compatible" : ["theme", "plugin"],
64
  "wordpress_org" : true,
65
  "required" : false,
66
- "dependencies" : []
67
  },
68
- "cherry-page-builder" : {
69
- "name" : "Page Builder",
70
- "description" : "Provides functionality for building custom options pages.",
 
71
  "doc_link" : "",
72
- "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-page-builder",
73
- "compatible" : ["plugin"],
74
  "wordpress_org" : true,
75
  "required" : false,
76
- "dependencies" : []
77
  },
78
- "cherry-plugin-updater" : {
79
- "name" : "Plugin Updater",
80
- "description" : "Provides functionality for updating plugins.",
 
81
  "doc_link" : "",
82
- "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-plugin-updater",
83
- "compatible" : ["plugin"],
84
- "wordpress_org" : false,
85
  "required" : false,
86
  "dependencies" : []
87
  },
88
  "cherry-post-formats-api" : {
89
  "name" : "Post Formats API",
90
  "description" : "API for post formats specific content.",
 
91
  "doc_link" : "",
92
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-post-formats-api",
93
  "compatible" : ["theme", "plugin"],
@@ -98,29 +96,21 @@
98
  "cherry-post-meta" : {
99
  "name" : "Post Meta",
100
  "description" : "Manage post meta.",
 
101
  "doc_link" : "",
102
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-post-meta",
103
  "compatible" : ["theme", "plugin"],
104
  "wordpress_org" : true,
105
  "required" : false,
106
- "dependencies" : [ "cherry-ui-elements" ]
107
- },
108
- "cherry-post-types" : {
109
- "name" : "Post Types",
110
- "description" : "Provides functionality for creating custom post types.",
111
- "doc_link" : "",
112
- "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-post-types",
113
- "compatible" : ["plugin"],
114
- "wordpress_org" : true,
115
- "required" : false,
116
- "dependencies" : [ "cherry-ui-elements" ]
117
  },
118
- "cherry-taxonomies" : {
119
- "name" : "Taxanomies",
120
- "description" : "Provides functionality for creating custom taxanomies.",
 
121
  "doc_link" : "",
122
- "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-taxonomies",
123
- "compatible" : ["plugin"],
124
  "wordpress_org" : true,
125
  "required" : false,
126
  "dependencies" : []
@@ -128,6 +118,7 @@
128
  "cherry-term-meta" : {
129
  "name" : "Term Meta",
130
  "description" : "Manage term metadata.",
 
131
  "doc_link" : "",
132
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-term-meta",
133
  "compatible" : ["theme", "plugin"],
@@ -135,19 +126,21 @@
135
  "required" : false,
136
  "dependencies" : [ "cherry-ui-elements" ]
137
  },
138
- "cherry-theme-updater" : {
139
- "name" : "Theme Updater",
140
- "description" : "Provides functionality for updating themes.",
141
- "doc_link" : "",
142
- "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-theme-updater",
143
- "compatible" : ["theme"],
144
- "wordpress_org" : false,
145
- "required" : false,
146
- "dependencies" : []
 
147
  },
148
  "cherry-ui-elements" : {
149
  "name" : "UI Elements",
150
  "description" : "UI Elements",
 
151
  "doc_link" : "",
152
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-ui-elements",
153
  "compatible" : ["theme", "plugin"],
@@ -158,6 +151,7 @@
158
  "cherry-utility" : {
159
  "name" : "Utility",
160
  "description" : "Multiple utility functions.",
 
161
  "doc_link" : "",
162
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-utility",
163
  "compatible" : ["theme", "plugin"],
@@ -166,24 +160,15 @@
166
  "dependencies" : []
167
  },
168
  "cherry-widget-factory" : {
169
- "name" : "Widget Factory.",
170
  "description" : "Base widget class that simplifies creating of your own widgets.",
 
171
  "doc_link" : "",
172
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-widget-factory",
173
  "compatible" : ["theme", "plugin"],
174
  "wordpress_org" : true,
175
  "required" : false,
176
  "dependencies" : [ "cherry-ui-elements" ]
177
- },
178
- "cherry-toolkit": {
179
- "name": "Framework Toolkit",
180
- "description": "Framework Toolkit contains various PHP utilities",
181
- "doc_link": "",
182
- "git_link": "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-toolkit",
183
- "compatible": ["theme", "plugin"],
184
- "wordpress_org": true,
185
- "required": true,
186
- "dependencies": []
187
  }
188
  }
189
  }
1
  {
2
  "name" : "Cherry Framework",
3
+ "version" : "1.3.0",
4
  "description" : "",
5
  "doc_link" : "",
6
  "git_link" : "https://github.com/CherryFramework/cherry-framework",
8
  "cherry-breadcrumbs" : {
9
  "name" : "Breadcrumb Trail",
10
  "description" : "A breadcrumb menu script for WordPress.",
11
+ "version" : "1.1.1",
12
  "doc_link" : "",
13
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-breadcrumbs",
14
  "compatible" : ["theme", "plugin"],
16
  "required" : false,
17
  "dependencies" : []
18
  },
 
 
 
 
 
 
 
 
 
 
19
  "cherry-customizer" : {
20
+ "name" : "Customizer API",
21
  "description" : "Customizer functionality.",
22
+ "version" : "1.1.4",
23
  "doc_link" : "",
24
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-customizer",
25
  "compatible" : ["theme", "plugin"],
28
  "dependencies" : []
29
  },
30
  "cherry-dynamic-css" : {
31
+ "name" : "Dynamic CSS",
32
+ "description" : "Generate CSS.",
33
+ "version" : "1.2.0",
34
  "doc_link" : "",
35
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-dynamic-css",
36
  "compatible" : ["theme", "plugin"],
40
  },
41
  "cherry-google-fonts-loader" : {
42
  "name" : "Google Fonts Loader",
43
+ "description" : "Enqueue Google fonts.",
44
+ "version" : "1.1.0",
45
  "doc_link" : "",
46
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-google-fonts-loader",
47
  "compatible" : ["theme", "plugin"],
49
  "required" : false,
50
  "dependencies" : []
51
  },
52
+ "cherry-handler" : {
53
+ "name" : "Cherry handler",
54
+ "description" : "Initialize handlers.",
55
+ "version" : "1.0.0",
56
  "doc_link" : "",
57
+ "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-handler",
58
  "compatible" : ["theme", "plugin"],
59
  "wordpress_org" : true,
60
  "required" : false,
61
+ "dependencies" : [ "cherry-js-core" ]
62
  },
63
+ "cherry-interface-builder" : {
64
+ "name" : "Interface Builder",
65
+ "description" : "The module for the creation of interfaces in the WordPress admin panel.",
66
+ "version" : "1.0.3",
67
  "doc_link" : "",
68
+ "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-interface-builder",
69
+ "compatible" : ["theme", "plugin"],
70
  "wordpress_org" : true,
71
  "required" : false,
72
+ "dependencies" : [ "cherry-ui-elements" ]
73
  },
74
+ "cherry-js-core" : {
75
+ "name" : "JS Core",
76
+ "description" : "Initialize global JS object which provides additional plugin functionality.",
77
+ "version" : "1.1.2",
78
  "doc_link" : "",
79
+ "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-js-core",
80
+ "compatible" : ["theme", "plugin"],
81
+ "wordpress_org" : true,
82
  "required" : false,
83
  "dependencies" : []
84
  },
85
  "cherry-post-formats-api" : {
86
  "name" : "Post Formats API",
87
  "description" : "API for post formats specific content.",
88
+ "version" : "1.1.2",
89
  "doc_link" : "",
90
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-post-formats-api",
91
  "compatible" : ["theme", "plugin"],
96
  "cherry-post-meta" : {
97
  "name" : "Post Meta",
98
  "description" : "Manage post meta.",
99
+ "version" : "1.2.1",
100
  "doc_link" : "",
101
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-post-meta",
102
  "compatible" : ["theme", "plugin"],
103
  "wordpress_org" : true,
104
  "required" : false,
105
+ "dependencies" : [ "cherry-interface-builder" ]
 
 
 
 
 
 
 
 
 
 
106
  },
107
+ "cherry-template-manager" : {
108
+ "name" : "Template Manager",
109
+ "description" : "Module for load and parse *.tmpl files.",
110
+ "version" : "1.0.0",
111
  "doc_link" : "",
112
+ "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-template-manager",
113
+ "compatible" : ["theme", "plugin"],
114
  "wordpress_org" : true,
115
  "required" : false,
116
  "dependencies" : []
118
  "cherry-term-meta" : {
119
  "name" : "Term Meta",
120
  "description" : "Manage term metadata.",
121
+ "version" : "1.1.4",
122
  "doc_link" : "",
123
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-term-meta",
124
  "compatible" : ["theme", "plugin"],
126
  "required" : false,
127
  "dependencies" : [ "cherry-ui-elements" ]
128
  },
129
+ "cherry-toolkit": {
130
+ "name": "Framework Toolkit",
131
+ "description": "Framework Toolkit contains various PHP utilities",
132
+ "version" : "1.2.0",
133
+ "doc_link": "",
134
+ "git_link": "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-toolkit",
135
+ "compatible": ["theme", "plugin"],
136
+ "wordpress_org": true,
137
+ "required": true,
138
+ "dependencies": []
139
  },
140
  "cherry-ui-elements" : {
141
  "name" : "UI Elements",
142
  "description" : "UI Elements",
143
+ "version" : "1.3.0",
144
  "doc_link" : "",
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.4",
155
  "doc_link" : "",
156
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-utility",
157
  "compatible" : ["theme", "plugin"],
160
  "dependencies" : []
161
  },
162
  "cherry-widget-factory" : {
163
+ "name" : "Widget Factory",
164
  "description" : "Base widget class that simplifies creating of your own widgets.",
165
+ "version" : "1.2.0",
166
  "doc_link" : "",
167
  "git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-widget-factory",
168
  "compatible" : ["theme", "plugin"],
169
  "wordpress_org" : true,
170
  "required" : false,
171
  "dependencies" : [ "cherry-ui-elements" ]
 
 
 
 
 
 
 
 
 
 
172
  }
173
  }
174
  }
cherry-framework/modules/cherry-breadcrumbs/cherry-breadcrumbs.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Module Name: Breadcrumb Trail
4
  * Description: A breadcrumb menu script for WordPress
5
- * Version: 1.1.0
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -35,18 +35,10 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
35
  * Breadcrumbs builder class.
36
  * Class is based on Breadcrumb Trail plugin by Justin Tadlock.
37
  *
38
- * @since 4.0.0
39
  */
40
  class Cherry_Breadcrumbs {
41
 
42
- /**
43
- * Module version.
44
- *
45
- * @since 1.0.0
46
- * @var string
47
- */
48
- public $module_version = '1.1.0';
49
-
50
  /**
51
  * A reference to an instance of this class.
52
  *
@@ -657,7 +649,7 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
657
  return;
658
  }
659
 
660
- $url = network_home_url();
661
  $label = $this->args['labels']['home'];
662
 
663
  $this->_add_item( 'home_format', $label, $url );
@@ -676,7 +668,7 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
676
  ? 'link_format'
677
  : 'home_format';
678
 
679
- $url = home_url( '/' );
680
  $label = ( is_multisite() && ! is_main_site() && true === $this->args['network'] )
681
  ? get_bloginfo( 'name' )
682
  : $this->args['labels']['home'];
@@ -1125,7 +1117,10 @@ if ( ! class_exists( 'Cherry_Breadcrumbs' ) ) {
1125
  $this->_add_item(
1126
  'link_format',
1127
  $week,
1128
- add_query_arg( array( 'm' => get_the_time( 'Y' ), 'w' => get_the_time( 'W' ) ), home_url( '/' ) )
 
 
 
1129
  );
1130
 
1131
  }
2
  /**
3
  * Module Name: Breadcrumb Trail
4
  * Description: A breadcrumb menu script for WordPress
5
+ * Version: 1.1.1
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
35
  * Breadcrumbs builder class.
36
  * Class is based on Breadcrumb Trail plugin by Justin Tadlock.
37
  *
38
+ * @since 1.0.0
39
  */
40
  class Cherry_Breadcrumbs {
41
 
 
 
 
 
 
 
 
 
42
  /**
43
  * A reference to an instance of this class.
44
  *
649
  return;
650
  }
651
 
652
+ $url = esc_url( network_home_url() );
653
  $label = $this->args['labels']['home'];
654
 
655
  $this->_add_item( 'home_format', $label, $url );
668
  ? 'link_format'
669
  : 'home_format';
670
 
671
+ $url = esc_url( home_url( '/' ) );
672
  $label = ( is_multisite() && ! is_main_site() && true === $this->args['network'] )
673
  ? get_bloginfo( 'name' )
674
  : $this->args['labels']['home'];
1117
  $this->_add_item(
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
  );
1125
 
1126
  }
cherry-framework/modules/cherry-creator/cherry-creator.php DELETED
@@ -1,122 +0,0 @@
1
- <?php
2
- /**
3
- * Creator
4
- *
5
- * Module Name: Creator
6
- * Description: Creator
7
- * Version: 1.1.0
8
- * Author: Cherry Team
9
- * Author URI: http://www.cherryframework.com/
10
- * License: GPLv3
11
- * License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
- *
13
- * @package Cherry_Framework
14
- * @subpackage Modules
15
- * @version 1.1.0
16
- * @author Cherry Team <cherryframework@gmail.com>
17
- * @copyright Copyright (c) 2012 - 2016, Cherry Team
18
- * @link http://www.cherryframework.com/
19
- * @license http://www.gnu.org/licenses/gpl-3.0.html
20
- */
21
-
22
- // If this file is called directly, abort.
23
- if ( ! defined( 'WPINC' ) ) {
24
- die;
25
- }
26
-
27
- if ( ! class_exists( 'Cherry_Creator' ) ) {
28
-
29
- /**
30
- * Cherry post types class
31
- */
32
- class Cherry_Creator {
33
-
34
- /**
35
- * Module version
36
- *
37
- * @var string
38
- */
39
- public $module_version = '1.1.0';
40
-
41
- /**
42
- * Module slug
43
- *
44
- * @var string
45
- */
46
- public $module_slug = 'cherry-creator';
47
-
48
- /**
49
- * Default post type arguments
50
- *
51
- * @var null
52
- */
53
- private $defaults = null;
54
-
55
- /**
56
- * Module directory
57
- *
58
- * @since 1.0.0
59
- * @var string
60
- */
61
- private $module_directory = '';
62
-
63
- /**
64
- * Cherry_Post_Type class constructor
65
- */
66
- public function __construct( $core, $args = array() ) {
67
- $this->defaults = $args;
68
- $this->module_directory = $core->settings['base_dir'] . '/modules/' . $this->module_slug;
69
-
70
- // Load Creator Term
71
- if ( ! class_exists( 'Cherry_Creator_Term' ) ) {
72
- require_once( $this->module_directory . '/inc/cherry-creator-term.php' );
73
- }
74
- }
75
-
76
- /**
77
- * Create Chery_Creator_Term object
78
- *
79
- * @param [type] $title term.
80
- * @param [string] $tax taxonomy.
81
- * @param array $args arguments.
82
- * @return Chery_Creator_Term
83
- */
84
- public static function term( $title, $tax = 'category', $args = array() ) {
85
- // Load Creator Term
86
- if ( ! class_exists( 'Cherry_Creator_Term' ) ) {
87
- require_once( 'cherry-creator-term.php' );
88
- }
89
- return new Cherry_Creator_Term( $title, $tax, $args );
90
- }
91
-
92
- /**
93
- * New / Update post
94
- *
95
- * @param array $properties new or update post properties.
96
- * @return post id or 0.
97
- */
98
- public static function post( $properties = array(), $unique = false ) {
99
- if ( $unique && array_key_exists( 'post_title', $properties ) ) {
100
- $post_type = 'page';
101
- if ( array_key_exists( 'post_type', $properties ) ) {
102
- $post_type = $properties['post_type'];
103
- }
104
- $post = get_page_by_path( sanitize_title( $properties['post_title'] ), OBJECT, $post_type );
105
- if ( null !== $post ) {
106
- $properties['ID'] = $post->ID;
107
- }
108
- }
109
- return wp_insert_post( $properties );
110
- }
111
-
112
- /**
113
- * Returns the instance.
114
- *
115
- * @since 1.0.0
116
- * @return object
117
- */
118
- public static function get_instance( $core, $args ) {
119
- return new self( $core, $args );
120
- }
121
- }
122
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-creator/inc/cherry-creator-term.php DELETED
@@ -1,126 +0,0 @@
1
- <?php
2
- /**
3
- * Creator term
4
- *
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/old-licenses/gpl-2.0.html
11
- */
12
-
13
- /**
14
- * Cherry_Creator_Term class
15
- */
16
- class Cherry_Creator_Term {
17
-
18
- /**
19
- * Term title
20
- *
21
- * @var string
22
- */
23
- private $title;
24
-
25
- /**
26
- * Term taxonomy
27
- *
28
- * @var string
29
- */
30
- private $taxonomy = 'category';
31
-
32
- /**
33
- * Term arguments
34
- *
35
- * @var array
36
- */
37
- private $arguments = array();
38
-
39
- /**
40
- * Inserted term
41
- *
42
- * @var null
43
- */
44
- private $inserted = null;
45
-
46
- /**
47
- * Cherry_Creator_Term
48
- *
49
- * @param [type] $title term title.
50
- * @param [string] $tax taxonomy.
51
- * @param array $args arguments.
52
- */
53
- public function __construct( $title, $tax = 'category', $args = array() ) {
54
- $this->title = $title;
55
- $this->taxonomy = $tax;
56
- $this->arguments = $args;
57
- }
58
-
59
- /**
60
- * Insert term
61
- *
62
- * @return Cherry_Creator_Term
63
- */
64
- public function insert( $unique = false ) {
65
- if ( ! is_array( $this->inserted ) ) {
66
- if ( $unique ) {
67
- if ( ! term_exists( $this->get_term_slug(), $this->taxonomy ) ) {
68
- $this->_insert();
69
- }
70
- } else {
71
- $this->_insert();
72
- }
73
- }
74
- return $this;
75
- }
76
-
77
- /**
78
- * Insert term without checking
79
- *
80
- * @return Cherry_Creator_Term
81
- */
82
- private function _insert() {
83
- $this->inserted = wp_insert_term(
84
- $this->title,
85
- $this->taxonomy,
86
- $this->arguments
87
- );
88
- return $this;
89
- }
90
-
91
- /**
92
- * Set parent by slug
93
- *
94
- * @param [type] $parent_slug parent.
95
- */
96
- public function set_parent_by_slug( $parent_slug = null ) {
97
- if ( null !== $parent_slug ) {
98
- $term = get_term_by( 'slug', $parent_slug, $this->taxonomy );
99
- if ( $term ) {
100
- $this->arguments['parent'] = $term->term_id;
101
- }
102
- }
103
- return $this;
104
- }
105
-
106
- /**
107
- * Get inserted object
108
- *
109
- * @return mixed.
110
- */
111
- public function get_inserted() {
112
- return $this->inserted;
113
- }
114
-
115
- /**
116
- * Get term slug
117
- *
118
- * @return [type] term slug.
119
- */
120
- public function get_term_slug() {
121
- if ( array_key_exists( 'slug', $this->arguments ) ) {
122
- return $this->arguments['slug'];
123
- }
124
- return sanitize_title( $this->title );
125
- }
126
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-customizer/cherry-customizer.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Module Name: Customizer
4
  * Description: Customizer functionality.
5
- * Version: 1.1.3
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,7 +10,7 @@
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/
@@ -207,11 +207,12 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
207
  * Include advanced customizer controls classes
208
  *
209
  * @since 1.1.0
 
210
  */
211
  private function include_custom_controls() {
212
 
213
  if ( ! class_exists( 'Cherry_WP_Customize_Iconpicker' ) ) {
214
- require_once( trailingslashit( __DIR__ ) . '/inc/class-cherry-wp-customize-iconpicker.php' );
215
  }
216
 
217
  }
@@ -909,8 +910,8 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
909
  * @param object $this Cherry_Customiser instance.
910
  */
911
  return apply_filters( 'cherry_customizer_get_fonts_data', array(
912
- 'standard' => __DIR__ . '/assets/fonts/standard.json',
913
- 'google' => __DIR__ . '/assets/fonts/google.json',
914
  ), $this );
915
  }
916
 
@@ -940,12 +941,36 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
940
  * Retrieve a data from font's file.
941
  *
942
  * @since 1.0.0
943
- * @global object $wp_filesystem
944
- * @param [string] $file File path.
945
  * @return array Fonts data.
946
  */
947
  public function read_font_file( $file ) {
948
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
949
  if ( ! function_exists( 'WP_Filesystem' ) ) {
950
  include_once( ABSPATH . '/wp-admin/includes/file.php' );
951
  }
@@ -953,20 +978,38 @@ if ( ! class_exists( 'Cherry_Customizer' ) ) {
953
  WP_Filesystem();
954
  global $wp_filesystem;
955
 
956
- if ( ! $wp_filesystem->exists( $file ) ) {
957
- return false;
 
 
958
  }
 
959
 
960
- // Read the file.
961
- $json = $wp_filesystem->get_contents( $file );
 
 
 
 
 
 
962
 
963
- if ( ! $json ) {
964
- return new WP_Error( 'reading_error', 'Error when reading file' );
965
  }
966
 
967
- $content = json_decode( $json, true );
 
 
 
 
 
 
 
 
 
968
 
969
- return is_array( $content ) ? $content['items'] : false;
970
  }
971
 
972
  /**
2
  /**
3
  * Module Name: Customizer
4
  * Description: Customizer functionality.
5
+ * Version: 1.1.4
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
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/
207
  * Include advanced customizer controls classes
208
  *
209
  * @since 1.1.0
210
+ * @since 1.1.4 Using dirname( __FILE__ ) instead of __DIR__.
211
  */
212
  private function include_custom_controls() {
213
 
214
  if ( ! class_exists( 'Cherry_WP_Customize_Iconpicker' ) ) {
215
+ require_once( trailingslashit( dirname( __FILE__ ) ) . '/inc/class-cherry-wp-customize-iconpicker.php' );
216
  }
217
 
218
  }
910
  * @param object $this Cherry_Customiser instance.
911
  */
912
  return apply_filters( 'cherry_customizer_get_fonts_data', array(
913
+ 'standard' => dirname( __FILE__ ) . '/assets/fonts/standard.json',
914
+ 'google' => dirname( __FILE__ ) . '/assets/fonts/google.json',
915
  ), $this );
916
  }
917
 
941
  * Retrieve a data from font's file.
942
  *
943
  * @since 1.0.0
944
+ * @param string $file File path.
 
945
  * @return array Fonts data.
946
  */
947
  public function read_font_file( $file ) {
948
 
949
+ if ( ! $this->file_exists( $file ) ) {
950
+ return false;
951
+ }
952
+
953
+ // Read the file.
954
+ $json = $this->get_file( $file );
955
+
956
+ if ( ! $json ) {
957
+ return new WP_Error( 'reading_error', 'Error when reading file' );
958
+ }
959
+
960
+ $content = json_decode( $json, true );
961
+
962
+ return $content['items'];
963
+ }
964
+
965
+ /**
966
+ * Safely checks exists file or not
967
+ *
968
+ * @global object $wp_filesystem
969
+ * @param string $file File path.
970
+ * @return bool
971
+ */
972
+ public function file_exists( $file ) {
973
+
974
  if ( ! function_exists( 'WP_Filesystem' ) ) {
975
  include_once( ABSPATH . '/wp-admin/includes/file.php' );
976
  }
978
  WP_Filesystem();
979
  global $wp_filesystem;
980
 
981
+ if ( $wp_filesystem->abspath() ) {
982
+ return $wp_filesystem->exists( $file );
983
+ } else {
984
+ return file_exists( $file );
985
  }
986
+ }
987
 
988
+ /**
989
+ * Safely get file content.
990
+ *
991
+ * @global object $wp_filesystem
992
+ * @param string $file File path.
993
+ * @return bool
994
+ */
995
+ public function get_file( $file ) {
996
 
997
+ if ( ! function_exists( 'WP_Filesystem' ) ) {
998
+ include_once( ABSPATH . '/wp-admin/includes/file.php' );
999
  }
1000
 
1001
+ WP_Filesystem();
1002
+ global $wp_filesystem;
1003
+
1004
+ $result = '';
1005
+
1006
+ if ( $wp_filesystem->abspath() ) {
1007
+ $result = $wp_filesystem->get_contents( $file );
1008
+ } else {
1009
+ $result = Cherry_Toolkit::get_file( $file );
1010
+ }
1011
 
1012
+ return $result;
1013
  }
1014
 
1015
  /**
cherry-framework/modules/cherry-dynamic-css/assets/cherry-css-collector.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Handler for CSS Collector
3
+ */
4
+ function CherryCSSCollector() {
5
+
6
+ 'use strict';
7
+
8
+ var style,
9
+ collectedCSS = window.CherryCollectedCSS;
10
+
11
+ if ( undefined !== collectedCSS ) {
12
+
13
+ style = document.createElement( 'style' );
14
+
15
+ style.setAttribute( 'title', collectedCSS.title );
16
+ style.setAttribute( 'type', collectedCSS.type );
17
+
18
+ style.textContent = collectedCSS.css;
19
+
20
+ document.head.appendChild( style );
21
+ }
22
+ }
23
+
24
+ CherryCSSCollector();
cherry-framework/modules/cherry-dynamic-css/assets/min/cherry-css-collector.min.js ADDED
@@ -0,0 +1 @@
 
1
+ function CherryCSSCollector(){"use strict";var t,e=window.CherryCollectedCSS;void 0!==e&&(t=document.createElement("style"),t.setAttribute("title",e.title),t.setAttribute("type",e.type),t.textContent=e.css,document.head.appendChild(t))}CherryCSSCollector();
cherry-framework/modules/cherry-dynamic-css/cherry-dynamic-css.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Module Name: Dynamic CSS
4
  * Description: CSS parser which uses variables & functions for CSS code optimization
5
- * Version: 1.1.0
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,7 +10,7 @@
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/
@@ -29,13 +29,6 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
29
  */
30
  class Cherry_Dynamic_Css {
31
 
32
- /**
33
- * Module version
34
- *
35
- * @var string
36
- */
37
- public $module_version = '1.1.0';
38
-
39
  /**
40
  * Module arguments
41
  *
@@ -71,6 +64,14 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
71
  */
72
  public $func_pattern = '/@(([a-zA-Z_]+)\(([^@\)]*)?\))/';
73
 
 
 
 
 
 
 
 
 
74
  /**
75
  * Constructor for the module
76
  */
@@ -86,6 +87,50 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
86
  ) );
87
 
88
  add_action( 'wp_head', array( $this, 'print_inline_css' ), 99 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
90
 
91
  /**
@@ -192,25 +237,6 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
192
 
193
  }
194
 
195
- /**
196
- * Get path inside of current module
197
- *
198
- * @since 1.0.0
199
- * @param [type] $path file inside module directory to get path for.
200
- * @return string
201
- */
202
- public function get_path( $path = null ) {
203
-
204
- $result = trailingslashit( __DIR__ );
205
-
206
- if ( null !== $path ) {
207
- $result .= $path;
208
- }
209
-
210
- return $result;
211
-
212
- }
213
-
214
  /**
215
  * Get avaliable functions into array
216
  *
@@ -219,7 +245,7 @@ if ( ! class_exists( 'Cherry_Dynamic_Css' ) ) {
219
  */
220
  public function get_css_functions() {
221
 
222
- require_once $this->get_path( 'inc/class-cherry-dynamic-css-utilities.php' );
223
  $utilities = Cherry_Dynamic_Css_Utilities::get_instance();
224
 
225
  $func_list = array(
2
  /**
3
  * Module Name: Dynamic CSS
4
  * Description: CSS parser which uses variables & functions for CSS code optimization
5
+ * Version: 1.2.0
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
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/
29
  */
30
  class Cherry_Dynamic_Css {
31
 
 
 
 
 
 
 
 
32
  /**
33
  * Module arguments
34
  *
64
  */
65
  public $func_pattern = '/@(([a-zA-Z_]+)\(([^@\)]*)?\))/';
66
 
67
+ /**
68
+ * Collector instance holder
69
+ *
70
+ * @since 1.2.0
71
+ * @var object
72
+ */
73
+ public static $collector = null;
74
+
75
  /**
76
  * Constructor for the module
77
  */
87
  ) );
88
 
89
  add_action( 'wp_head', array( $this, 'print_inline_css' ), 99 );
90
+
91
+ $this->init_collector();
92
+ }
93
+
94
+ /**
95
+ * Initalize CSS collector class
96
+ *
97
+ * @since 1.2.0
98
+ * @return bool
99
+ */
100
+ public function init_collector() {
101
+
102
+ if ( null !== self::$collector ) {
103
+ return true;
104
+ }
105
+
106
+ require_once 'inc/class-cherry-dynamic-css-collector.php';
107
+
108
+ ob_start();
109
+ include 'assets/min/cherry-css-collector.min.js';
110
+ $handler = ob_get_clean();
111
+
112
+ self::$collector = Cherry_Dynamic_Css_Collector::get_instance( $handler );
113
+ add_action( 'wp_footer', array( self::$collector, 'print_style' ), 11 );
114
+ add_action( 'wp_footer', array( self::$collector, 'add_js_handler' ), 11 );
115
+
116
+ return true;
117
+
118
+ }
119
+
120
+ /**
121
+ * Add new style to collector
122
+ *
123
+ * @since 1.2.0
124
+ * @param string $selector CSS selector to add styles for.
125
+ * @param array $style Styles array to add.
126
+ * @param array $media Media breakpoints.
127
+ * @return void
128
+ */
129
+ public function add_style( $selector, $style = array(), $media = array() ) {
130
+ if ( ! $selector ) {
131
+ return;
132
+ }
133
+ self::$collector->add_style( $selector, $style, $media );
134
  }
135
 
136
  /**
237
 
238
  }
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  /**
241
  * Get avaliable functions into array
242
  *
245
  */
246
  public function get_css_functions() {
247
 
248
+ require_once 'inc/class-cherry-dynamic-css-utilities.php';
249
  $utilities = Cherry_Dynamic_Css_Utilities::get_instance();
250
 
251
  $func_list = array(
cherry-framework/modules/cherry-dynamic-css/inc/class-cherry-dynamic-css-collector.php ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Dynamic CSS collector class.
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
+ */
11
+
12
+ // If this file is called directly, abort.
13
+ if ( ! defined( 'WPINC' ) ) {
14
+ die;
15
+ }
16
+
17
+ if ( ! class_exists( 'Cherry_Dynamic_Css_Collector' ) ) {
18
+
19
+ /**
20
+ * Define Cherry_Dynamic_Css_Collector class
21
+ */
22
+ class Cherry_Dynamic_Css_Collector {
23
+
24
+ /**
25
+ * A reference to an instance of this class.
26
+ *
27
+ * @since 1.2.0
28
+ * @var object
29
+ */
30
+ private static $instance = null;
31
+
32
+ /**
33
+ * Array with sorted css
34
+ *
35
+ * @var array
36
+ */
37
+ public static $sorted_css = array();
38
+
39
+ /**
40
+ * Apropriate JS handle name
41
+ *
42
+ * @var string
43
+ */
44
+ public static $js_handle = 'cherry-js-core';
45
+
46
+ /**
47
+ * Passed handler file content
48
+ *
49
+ * @var string
50
+ */
51
+ public static $handler_file = null;
52
+
53
+ /**
54
+ * Set handler file on construct
55
+ */
56
+ function __construct( $handler_file = null ) {
57
+ self::$handler_file = $handler_file;
58
+ }
59
+
60
+ /**
61
+ * Add new style to collector
62
+ *
63
+ * @param string $selector CSS selector to add styles for.
64
+ * @param array $style Styles array to add.
65
+ * @param array $media Media breakpoints.
66
+ * @return void
67
+ */
68
+ public function add_style( $selector, $style = array(), $media = array() ) {
69
+
70
+ $this->prepare_rule(
71
+ $selector,
72
+ array(
73
+ 'style' => $style,
74
+ 'media' => $media,
75
+ )
76
+ );
77
+
78
+ }
79
+
80
+ /**
81
+ * Return JS handle name
82
+ *
83
+ * @return string
84
+ */
85
+ public function get_handle() {
86
+ return apply_filters( 'cherry_dynamic_css_collector_handle', self::$js_handle );
87
+ }
88
+
89
+ /**
90
+ * Add inline JS handler
91
+ *
92
+ * @return void
93
+ */
94
+ public function add_js_handler() {
95
+
96
+ if ( ! self::$handler_file ) {
97
+ return;
98
+ }
99
+
100
+ wp_add_inline_script( $this->get_handle(), self::$handler_file );
101
+ }
102
+
103
+ /**
104
+ * Print grabbed CSS
105
+ *
106
+ * @return void
107
+ */
108
+ public function print_style() {
109
+
110
+ self::$sorted_css = apply_filters(
111
+ 'cherry_dynamic_css_collected_styles',
112
+ self::$sorted_css
113
+ );
114
+
115
+ if ( empty( self::$sorted_css ) || ! is_array( self::$sorted_css ) ) {
116
+ return;
117
+ }
118
+
119
+ ob_start();
120
+
121
+ do_action( 'cherry_dynamic_css_before_print_collected' );
122
+
123
+ array_walk( self::$sorted_css, array( $this, 'print_breakpoint' ) );
124
+
125
+ do_action( 'cherry_dynamic_css_after_print_collected' );
126
+
127
+ $styles = ob_get_clean();
128
+
129
+ $localize_var = apply_filters( 'cherry_dynamic_css_collector_localize_object', array(
130
+ 'type' => 'text/css',
131
+ 'title' => 'cherry-collected-dynamic-style',
132
+ 'css' => $styles,
133
+ ) );
134
+
135
+ wp_localize_script( $this->get_handle(), 'CherryCollectedCSS', $localize_var );
136
+
137
+ }
138
+
139
+ /**
140
+ * Print single breakpoint
141
+ *
142
+ * @param array $rules Rules array.
143
+ * @param string $breakpoint Breakpoint name.
144
+ * @return void
145
+ */
146
+ public function print_breakpoint( $rules, $breakpoint ) {
147
+
148
+ if ( empty( $rules ) ) {
149
+ return;
150
+ }
151
+
152
+ if ( 'all' !== $breakpoint ) {
153
+ echo '@' . $breakpoint . ' {';
154
+ }
155
+
156
+ do_action( 'cherry_dynamic_css_breakpoint_start', $breakpoint );
157
+
158
+ array_walk( $rules, array( $this, 'print_rules' ) );
159
+
160
+ do_action( 'cherry_dynamic_css_breakpoint_end', $breakpoint );
161
+
162
+ if ( 'all' !== $breakpoint ) {
163
+ echo '}';
164
+ }
165
+
166
+ }
167
+
168
+ /**
169
+ * Print rules for selector.
170
+ *
171
+ * @param array $rule Single rule.
172
+ * @param string $selector Selector name.
173
+ * @return void
174
+ */
175
+ public function print_rules( $rule, $selector ) {
176
+
177
+ echo $selector . ' {';
178
+
179
+ do_action( 'cherry_dynamic_css_rule_start', $selector );
180
+
181
+ array_walk( $rule, array( $this, 'print_property' ) );
182
+
183
+ do_action( 'cherry_dynamic_css_rule_end', $selector );
184
+
185
+ echo '}';
186
+
187
+ }
188
+
189
+ /**
190
+ * Print single rule.
191
+ *
192
+ * @param string $value Property value.
193
+ * @param string $name Property name.
194
+ * @return void
195
+ */
196
+ public function print_property( $value, $name ) {
197
+ printf( '%1$s:%2$s; ', $name, $value );
198
+ }
199
+
200
+ /**
201
+ * Print passed rule.
202
+ *
203
+ * @param string $selector Selector name.
204
+ * @param array $rule CSS rule data.
205
+ * @return void|bool
206
+ */
207
+ public function prepare_rule( $selector, $rule ) {
208
+
209
+ $rule = array_merge( array(
210
+ 'style' => array(),
211
+ 'media' => array(),
212
+ ), $rule );
213
+
214
+ if ( empty( $rule['style'] ) ) {
215
+ return false;
216
+ }
217
+
218
+ $breakpoint = $this->breakpoint_name( $rule['media'] );
219
+
220
+ if ( ! isset( self::$sorted_css[ $breakpoint ] ) ) {
221
+ self::$sorted_css[ $breakpoint ] = array();
222
+ }
223
+
224
+ if ( isset( self::$sorted_css[ $breakpoint ][ $selector ] ) ) {
225
+ self::$sorted_css[ $breakpoint ][ $selector ] = array_merge(
226
+ self::$sorted_css[ $breakpoint ][ $selector ],
227
+ $rule['style']
228
+ );
229
+ } else {
230
+ self::$sorted_css[ $breakpoint ][ $selector ] = $rule['style'];
231
+ }
232
+
233
+ }
234
+
235
+ /**
236
+ * Generate media rule name
237
+ *
238
+ * @param array $media Media breakpoints.
239
+ * @return string
240
+ */
241
+ public function breakpoint_name( $media ) {
242
+
243
+ $has_media = false;
244
+ $min = '';
245
+ $max = '';
246
+
247
+ if ( ! empty( $media['min'] ) ) {
248
+ $has_media = true;
249
+ $min = sprintf( '(min-width: %1$s)', esc_attr( $media['min'] ) );
250
+ }
251
+
252
+ if ( ! empty( $media['max'] ) ) {
253
+ $sep = true === $has_media ? ' and ' : '';
254
+ $has_media = true;
255
+ $max = sprintf( '(max-width: %1$s)', esc_attr( $media['max'] ) );
256
+ }
257
+
258
+ if ( ! $has_media ) {
259
+ return 'all';
260
+ }
261
+
262
+ return sprintf( 'media %1$s%3$s%2$s', $min, $max, $sep );
263
+ }
264
+
265
+ /**
266
+ * Returns the instance.
267
+ *
268
+ * @since 1.2.0
269
+ * @return object
270
+ */
271
+ public static function get_instance( $handler_file = null ) {
272
+
273
+ // If the single instance hasn't been set, set it now.
274
+ if ( null == self::$instance ) {
275
+ self::$instance = new self( $handler_file );
276
+ }
277
+ return self::$instance;
278
+ }
279
+ }
280
+
281
+ }
cherry-framework/modules/cherry-dynamic-css/inc/class-cherry-dynamic-css-utilities.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package package_name
6
  * @author Cherry Team
7
- * @license GPL-2.0+
8
  */
9
 
10
  // If this file is called directly, abort.
4
  *
5
  * @package package_name
6
  * @author Cherry Team
7
+ * @license GPL-3.0+
8
  */
9
 
10
  // If this file is called directly, abort.
cherry-framework/modules/cherry-handler/assets/css/cherry-handler-styles.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .cherry-handler-notice{background:#23282d;position:fixed;margin:5px 0;box-shadow:1px 1px 5px rgba(0,0,0,0.2);box-sizing:border-box;padding:8px 15px 8px 8px;min-width:200px;overflow:hidden;color:#fff;z-index:999;border-radius:2px;-webkit-transition:all 250ms cubic-bezier(0.85, 0.04, 1, 1);transition:all 250ms cubic-bezier(0.85, 0.04, 1, 1)}.cherry-handler-notice span.dashicons{position:relative;margin-right:10px}.cherry-handler-notice span.dashicons:before{position:absolute;font-size:30px;left:-6px;top:-4px}.cherry-handler-notice.success-notice span.dashicons{color:#48c569}.cherry-handler-notice.success-notice span.dashicons:before{content:"\f147"}.cherry-handler-notice.success-notice .inner b{color:#48c569}.cherry-handler-notice.info-notice span.dashicons{color:#faa730}.cherry-handler-notice.info-notice span.dashicons:before{content:"\f534"}.cherry-handler-notice.info-notice .inner b{color:#faa730}.cherry-handler-notice.error-notice span.dashicons{color:#e54343}.cherry-handler-notice.error-notice span.dashicons:before{content:"\f158"}.cherry-handler-notice.show-state{-webkit-transition:all 500ms cubic-bezier(0.1, 0.67, 0.26, 1);transition:all 500ms cubic-bezier(0.1, 0.67, 0.26, 1)}.cherry-handler-notice .inner{display:inline-block}
cherry-framework/modules/cherry-handler/assets/js/cherry-handler.js ADDED
@@ -0,0 +1,286 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $, CherryJsCore ) {
2
+ 'use strict';
3
+
4
+ /**
5
+ * CherryAjaxHandler class
6
+ *
7
+ * @param {object} options Handler options
8
+ */
9
+
10
+ CherryJsCore.utilites.namespace( 'CherryAjaxHandler' );
11
+ CherryJsCore.CherryAjaxHandler = function( options ) {
12
+
13
+ /**
14
+ * General default settings
15
+ *
16
+ * @type {Object}
17
+ */
18
+ var self = this,
19
+ settings = {
20
+ 'handlerId': '',
21
+ 'cache': false,
22
+ 'processData': true,
23
+ 'url': '',
24
+ 'beforeSendCallback': function() {},
25
+ 'errorCallback': function() {},
26
+ 'successCallback': function() {},
27
+ 'completeCallback': function() {}
28
+ };
29
+
30
+ /**
31
+ * Checking options, settings and options merging
32
+ *
33
+ */
34
+ if ( options ) {
35
+ $.extend( settings, options );
36
+ }
37
+
38
+ /**
39
+ * Check if handlerId ready to using
40
+ *
41
+ */
42
+ if ( ! window[ settings.handlerId ] ) {
43
+ if ( window.console ) {
44
+ window.console.warn( 'Handler id not found' );
45
+ }
46
+ return false;
47
+ }
48
+
49
+ /**
50
+ * Set handler settings from localized global variable
51
+ *
52
+ * @type {Object}
53
+ */
54
+ self.handlerSettings = window[ settings.handlerId ] || {};
55
+
56
+ /**
57
+ * Ajax request instance
58
+ *
59
+ * @type {Object}
60
+ */
61
+ self.ajaxRequest = null;
62
+
63
+ /**
64
+ * Ajax processing state
65
+ *
66
+ * @type {Boolean}
67
+ */
68
+ self.ajaxProcessing = false;
69
+
70
+ /**
71
+ * Set ajax request data
72
+ *
73
+ * @type {Object}
74
+ */
75
+ self.data = {
76
+ 'action': self.handlerSettings.action,
77
+ 'nonce': self.handlerSettings.nonce
78
+ };
79
+
80
+ /**
81
+ * Check ajax url is empty
82
+ */
83
+ if ( '' === settings.url ) {
84
+
85
+ // Check public request
86
+ if ( 'false' === self.handlerSettings.is_public ) {
87
+ settings.url = window.ajaxurl;
88
+ } else {
89
+ settings.url = window.cherryHandlerAjaxUrl.ajax_url;
90
+ }
91
+ }
92
+
93
+ /**
94
+ * Init ajax request
95
+ *
96
+ * @return {Void}
97
+ */
98
+ self.send = function() {
99
+ if ( self.ajaxProcessing ) {
100
+ CherryJsCore.cherryHandlerUtils.noticeCreate( 'error-notice', self.handlerSettings.sys_messages.wait_processing );
101
+ }
102
+ self.ajaxProcessing = true;
103
+
104
+ self.ajaxRequest = jQuery.ajax( {
105
+ type: self.handlerSettings.type.toUpperCase(),
106
+ url: settings.url,
107
+ data: self.data,
108
+ cache: settings.cache,
109
+ dataType: self.handlerSettings.data_type,
110
+ processData: settings.processData,
111
+ beforeSend: function( jqXHR, ajaxSettings ) {
112
+ if ( null !== self.ajaxRequest ) {
113
+ self.ajaxRequest.abort();
114
+ }
115
+
116
+ if ( settings.beforeSendCallback && 'function' === typeof( settings.beforeSendCallback ) ) {
117
+ settings.beforeSendCallback( jqXHR, ajaxSettings );
118
+ }
119
+ },
120
+ error: function( jqXHR, textStatus, errorThrown ) {
121
+ if ( settings.errorCallback && 'function' === typeof( settings.errorCallback ) ) {
122
+ settings.errorCallback( jqXHR, textStatus, errorThrown );
123
+ }
124
+ },
125
+ success: function( data, textStatus, jqXHR ) {
126
+ self.ajaxProcessing = false;
127
+ if ( settings.successCallback && 'function' === typeof( settings.successCallback ) ) {
128
+ settings.successCallback( data, textStatus, jqXHR );
129
+ }
130
+
131
+ CherryJsCore.cherryHandlerUtils.noticeCreate( data.type, data.message );
132
+ },
133
+ complete: function( jqXHR, textStatus ) {
134
+ if ( settings.completeCallback && 'function' === typeof( settings.completeCallback ) ) {
135
+ settings.completeCallback( jqXHR, textStatus );
136
+ }
137
+ }
138
+
139
+ } );
140
+ };
141
+
142
+ /**
143
+ * Send data ajax request
144
+ *
145
+ * @param {Object} data User data
146
+ * @return {Void}
147
+ */
148
+ self.sendData = function( data ) {
149
+ var sendData = data || {};
150
+ self.data = {
151
+ 'action': self.handlerSettings.action,
152
+ 'nonce': self.handlerSettings.nonce,
153
+ 'data': sendData
154
+ };
155
+
156
+ self.send();
157
+ };
158
+
159
+ /**
160
+ * Send form serialized data
161
+ * @param {String} formId Form selector
162
+ * @return {Void}
163
+ */
164
+ self.sendFormData = function( formId ) {
165
+ var form = $( formId ),
166
+ data;
167
+
168
+ data = CherryJsCore.cherryHandlerUtils.serializeObject( form );
169
+
170
+ self.sendData( data );
171
+ };
172
+ };
173
+
174
+ CherryJsCore.utilites.namespace( 'cherryHandlerUtils' );
175
+ CherryJsCore.cherryHandlerUtils = {
176
+ /**
177
+ * Rendering notice message
178
+ *
179
+ * @param {String} type Message type
180
+ * @param {String} message Message content
181
+ * @return {Void}
182
+ */
183
+ noticeCreate: function( type, message ) {
184
+ var notice,
185
+ rightDelta = 0,
186
+ timeoutId;
187
+
188
+ if ( ! message ) {
189
+ return false;
190
+ }
191
+
192
+ notice = $( '<div class="cherry-handler-notice ' + type + '"><span class="dashicons"></span><div class="inner">' + message + '</div></div>' );
193
+
194
+ $( 'body' ).prepend( notice );
195
+ reposition();
196
+ rightDelta = -1 * ( notice.outerWidth( true ) + 10 );
197
+ notice.css( { 'right': rightDelta } );
198
+
199
+ timeoutId = setTimeout( function() {
200
+ notice.css( { 'right': 10 } ).addClass( 'show-state' );
201
+ }, 100 );
202
+ timeoutId = setTimeout( function() {
203
+ rightDelta = -1 * ( notice.outerWidth( true ) + 10 );
204
+ notice.css( { right: rightDelta } ).removeClass( 'show-state' );
205
+ }, 4000 );
206
+ timeoutId = setTimeout( function() {
207
+ notice.remove();
208
+ clearTimeout( timeoutId );
209
+ }, 4500 );
210
+
211
+ function reposition() {
212
+ var topDelta = 100;
213
+
214
+ $( '.cherry-handler-notice' ).each( function() {
215
+ $( this ).css( { top: topDelta } );
216
+ topDelta += $( this ).outerHeight( true );
217
+ } );
218
+ }
219
+ },
220
+
221
+ /**
222
+ * Serialize form into
223
+ *
224
+ * @return {Object}
225
+ */
226
+ serializeObject: function( form ) {
227
+
228
+ var self = this,
229
+ json = {},
230
+ pushCounters = {},
231
+ patterns = {
232
+ 'validate': /^[a-zA-Z][a-zA-Z0-9_-]*(?:\[(?:\d*|[a-zA-Z0-9_-]+)\])*$/,
233
+ 'key': /[a-zA-Z0-9_-]+|(?=\[\])/g,
234
+ 'push': /^$/,
235
+ 'fixed': /^\d+$/,
236
+ 'named': /^[a-zA-Z0-9_-]+$/
237
+ };
238
+
239
+ this.build = function( base, key, value ) {
240
+ base[ key ] = value;
241
+
242
+ return base;
243
+ };
244
+
245
+ this.push_counter = function( key ) {
246
+ if ( undefined === pushCounters[ key ] ) {
247
+ pushCounters[ key ] = 0;
248
+ }
249
+
250
+ return pushCounters[ key ]++;
251
+ };
252
+
253
+ $.each( form.serializeArray(), function() {
254
+ var k, keys, merge, reverseKey;
255
+
256
+ // Skip invalid keys
257
+ if ( ! patterns.validate.test( this.name ) ) {
258
+ return;
259
+ }
260
+
261
+ keys = this.name.match( patterns.key );
262
+ merge = this.value;
263
+ reverseKey = this.name;
264
+
265
+ while ( undefined !== ( k = keys.pop() ) ) {
266
+
267
+ // Adjust reverseKey
268
+ reverseKey = reverseKey.replace( new RegExp( '\\[' + k + '\\]$' ), '' );
269
+
270
+ // Push
271
+ if ( k.match( patterns.push ) ) {
272
+ merge = self.build( [], self.push_counter( reverseKey ), merge );
273
+ } else if ( k.match( patterns.fixed ) ) {
274
+ merge = self.build( [], k, merge );
275
+ } else if ( k.match( patterns.named ) ) {
276
+ merge = self.build( {}, k, merge );
277
+ }
278
+ }
279
+
280
+ json = $.extend( true, json, merge );
281
+ });
282
+
283
+ return json;
284
+ }
285
+ };
286
+ }( jQuery, window.CherryJsCore ) );
cherry-framework/modules/cherry-handler/assets/js/min/cherry-handler.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e,a){"use strict";a.utilites.namespace("CherryAjaxHandler"),a.CherryAjaxHandler=function(n){var t=this,r={handlerId:"",cache:!1,processData:!0,url:"",beforeSendCallback:function(){},errorCallback:function(){},successCallback:function(){},completeCallback:function(){}};return n&&e.extend(r,n),window[r.handlerId]?(t.handlerSettings=window[r.handlerId]||{},t.ajaxRequest=null,t.ajaxProcessing=!1,t.data={action:t.handlerSettings.action,nonce:t.handlerSettings.nonce},""===r.url&&(r.url="false"===t.handlerSettings.is_public?window.ajaxurl:window.cherryHandlerAjaxUrl.ajax_url),t.send=function(){t.ajaxProcessing&&a.cherryHandlerUtils.noticeCreate("error-notice",t.handlerSettings.sys_messages.wait_processing),t.ajaxProcessing=!0,t.ajaxRequest=jQuery.ajax({type:t.handlerSettings.type.toUpperCase(),url:r.url,data:t.data,cache:r.cache,dataType:t.handlerSettings.data_type,processData:r.processData,beforeSend:function(e,a){null!==t.ajaxRequest&&t.ajaxRequest.abort(),r.beforeSendCallback&&"function"==typeof r.beforeSendCallback&&r.beforeSendCallback(e,a)},error:function(e,a,n){r.errorCallback&&"function"==typeof r.errorCallback&&r.errorCallback(e,a,n)},success:function(e,n,c){t.ajaxProcessing=!1,r.successCallback&&"function"==typeof r.successCallback&&r.successCallback(e,n,c),a.cherryHandlerUtils.noticeCreate(e.type,e.message)},complete:function(e,a){r.completeCallback&&"function"==typeof r.completeCallback&&r.completeCallback(e,a)}})},t.sendData=function(e){var a=e||{};t.data={action:t.handlerSettings.action,nonce:t.handlerSettings.nonce,data:a},t.send()},void(t.sendFormData=function(n){var r,c=e(n);r=a.cherryHandlerUtils.serializeObject(c),t.sendData(r)})):(window.console&&window.console.warn("Handler id not found"),!1)},a.utilites.namespace("cherryHandlerUtils"),a.cherryHandlerUtils={noticeCreate:function(a,n){function t(){var a=100;e(".cherry-handler-notice").each(function(){e(this).css({top:a}),a+=e(this).outerHeight(!0)})}var r,c,s=0;return n?(r=e('<div class="cherry-handler-notice '+a+'"><span class="dashicons"></span><div class="inner">'+n+"</div></div>"),e("body").prepend(r),t(),s=-1*(r.outerWidth(!0)+10),r.css({right:s}),c=setTimeout(function(){r.css({right:10}).addClass("show-state")},100),c=setTimeout(function(){s=-1*(r.outerWidth(!0)+10),r.css({right:s}).removeClass("show-state")},4e3),void(c=setTimeout(function(){r.remove(),clearTimeout(c)},4500))):!1},serializeObject:function(a){var n=this,t={},r={},c={validate:/^[a-zA-Z][a-zA-Z0-9_-]*(?:\[(?:\d*|[a-zA-Z0-9_-]+)\])*$/,key:/[a-zA-Z0-9_-]+|(?=\[\])/g,push:/^$/,fixed:/^\d+$/,named:/^[a-zA-Z0-9_-]+$/};return this.build=function(e,a,n){return e[a]=n,e},this.push_counter=function(e){return void 0===r[e]&&(r[e]=0),r[e]++},e.each(a.serializeArray(),function(){var a,r,s,i;if(c.validate.test(this.name)){for(r=this.name.match(c.key),s=this.value,i=this.name;void 0!==(a=r.pop());)i=i.replace(new RegExp("\\["+a+"\\]$"),""),a.match(c.push)?s=n.build([],n.push_counter(i),s):a.match(c.fixed)?s=n.build([],a,s):a.match(c.named)&&(s=n.build({},a,s));t=e.extend(!0,t,s)}}),t}}}(jQuery,window.CherryJsCore);
cherry-framework/modules/cherry-handler/assets/scss/cherry-handler-styles.scss ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cherry-handler-notice{
2
+ background: #23282d;
3
+ position: fixed;
4
+ margin: 5px 0;
5
+ box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
6
+ box-sizing: border-box;
7
+ padding: 8px 15px 8px 8px;
8
+ min-width: 200px;
9
+ overflow: hidden;
10
+ color: #fff;
11
+ z-index: 999;
12
+ border-radius: 2px;
13
+ transition: all 250ms cubic-bezier(0.85, 0.04, 1, 1);
14
+ span.dashicons{
15
+ position: relative;
16
+ margin-right: 10px;
17
+ &:before{
18
+ position: absolute;
19
+ font-size: 30px;
20
+ left: -6px;
21
+ top: -4px;
22
+ }
23
+ }
24
+ &.success-notice{
25
+ span.dashicons{
26
+ color: #48c569;
27
+ &:before{
28
+ content: "\f147";
29
+ }
30
+ }
31
+ .inner{
32
+ b{
33
+ color: #48c569;
34
+ }
35
+ }
36
+ }
37
+ &.info-notice{
38
+ span.dashicons{
39
+ color: #faa730;
40
+ &:before{
41
+ content: "\f534";
42
+ }
43
+ }
44
+ .inner{
45
+ b{
46
+ color: #faa730;
47
+ }
48
+ }
49
+ }
50
+ &.error-notice{
51
+ span.dashicons{
52
+ color: #e54343;
53
+ &:before{
54
+ content: "\f158";
55
+ }
56
+ }
57
+ }
58
+ &.show-state{
59
+ -webkit-transition: all 500ms cubic-bezier(0.1, 0.67, 0.26, 1);
60
+ transition: all 500ms cubic-bezier(0.1, 0.67, 0.26, 1);
61
+ }
62
+ .inner{
63
+ display: inline-block;
64
+ }
65
+ }
cherry-framework/modules/cherry-handler/cherry-handler.php ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Module Name: Cherry handler
4
+ * Description: Initializes handlers
5
+ * Version: 1.0.0
6
+ * Author: Cherry Team
7
+ * Author URI: http://www.cherryframework.com/
8
+ * License: GPLv3
9
+ * License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
+ *
11
+ * @package Cherry_Framework
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
+ */
19
+
20
+ // If this file is called directly, abort.
21
+ if ( ! defined( 'WPINC' ) ) {
22
+ die;
23
+ }
24
+
25
+ if ( ! class_exists( 'Cherry_Handler' ) ) {
26
+
27
+ /**
28
+ * Cherry_Handler class.
29
+ *
30
+ * @since 1.0.0
31
+ */
32
+ class Cherry_Handler {
33
+
34
+ /**
35
+ * A reference to an instance of this class.
36
+ *
37
+ * @since 1.0.0
38
+ * @access private
39
+ * @var object
40
+ */
41
+ private static $handlers_list = array();
42
+
43
+ /**
44
+ * Default settings.
45
+ *
46
+ * @since 1.0.0
47
+ * @var array
48
+ */
49
+ private $settings = array(
50
+ 'id' => '',
51
+ 'action' => '',
52
+ 'capability' => '',
53
+ 'is_public' => false,
54
+ 'callback' => '',
55
+ 'type' => 'post',
56
+ 'data_type' => 'json',
57
+ 'sys_messages' => array(
58
+ 'invalid_base_data' => 'Unable to process the request without nonce or server error',
59
+ 'no_right' => 'No right for this action',
60
+ 'invalid_nonce' => 'Stop CHEATING!!!',
61
+ 'access_is_allowed' => 'Access is allowed',
62
+ 'wait_processing' => 'Please wait, processing the previous request',
63
+ ),
64
+ );
65
+
66
+ /**
67
+ * Class constructor.
68
+ *
69
+ * @since 1.0.0
70
+ * @param object $core Core instance.
71
+ * @param array $args Class args.
72
+ */
73
+ public function __construct( $core, $args = array() ) {
74
+ $this->settings = array_merge( $this->settings, $args );
75
+
76
+ if ( empty( $this->settings['id'] ) ) {
77
+ echo '<h3>ID is required attr</h3>';
78
+ return false;
79
+ }
80
+
81
+ if ( empty( $this->settings['action'] ) ) {
82
+ echo '<h3>Action is required attr</h3>';
83
+ return false;
84
+ }
85
+
86
+ // Action empty check
87
+ if ( ! empty( $this->settings['action'] ) ) {
88
+ add_action( 'wp_ajax_' . $this->settings['action'], array( $this, 'handler_init' ) );
89
+
90
+ // Public action check
91
+ if ( filter_var( $this->settings['is_public'], FILTER_VALIDATE_BOOLEAN ) ) {
92
+ add_action( 'wp_ajax_nopriv_' . $this->settings['action'], array( $this, 'handler_init' ) );
93
+ }
94
+ }
95
+
96
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
97
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
98
+ add_action( 'wp_print_scripts', array( $this, 'localize_script' ) );
99
+ }
100
+
101
+ /**
102
+ * Handler initialization
103
+ *
104
+ * @since 1.0.0
105
+ * @return void
106
+ */
107
+ public function handler_init() {
108
+ if ( ! empty( $_POST ) && array_key_exists( 'nonce', $_POST ) ) {
109
+
110
+ $nonce = $_POST['nonce'];
111
+
112
+ $nonce_action = ! empty( $this->settings['action'] ) ? $this->settings['action'] : 'cherry_ajax_nonce';
113
+
114
+ if ( ! wp_verify_nonce( $nonce, $nonce_action ) ) {
115
+ $response = array(
116
+ 'message' => $this->settings['sys_messages']['invalid_nonce'],
117
+ 'type' => 'error-notice',
118
+ );
119
+
120
+ wp_send_json( $response );
121
+ }
122
+
123
+ if ( ! empty( $this->settings['capability'] ) && ! current_user_can( $this->settings['capability'] ) ) {
124
+ $response = array(
125
+ 'message' => $this->settings['sys_messages']['no_right'],
126
+ 'type' => 'error-notice',
127
+ );
128
+
129
+ wp_send_json( $response );
130
+ }
131
+
132
+ if ( ! empty( $this->settings['callback'] ) && is_callable( $this->settings['callback'] ) ) {
133
+
134
+ ob_start();
135
+ $data = call_user_func( $this->settings['callback'] );
136
+
137
+ if ( ! $data ) {
138
+ $data = ob_get_contents();
139
+ }
140
+ ob_end_clean();
141
+
142
+ $response = array(
143
+ 'message' => $this->settings['sys_messages']['access_is_allowed'],
144
+ 'type' => 'success-notice',
145
+ 'data' => $data,
146
+ );
147
+
148
+ wp_send_json( $response );
149
+ }
150
+ } else {
151
+ $response = array(
152
+ 'message' => $this->settings['sys_messages']['invalid_base_data'],
153
+ 'type' => 'error-notice',
154
+ );
155
+
156
+ wp_send_json( $response );
157
+ }
158
+ }
159
+
160
+ /**
161
+ * Register and enqueue handlers js.
162
+ *
163
+ * @since 1.0.0
164
+ */
165
+ public function enqueue_scripts() {
166
+ wp_enqueue_script(
167
+ 'cherry-handler-js',
168
+ esc_url( Cherry_Core::base_url( 'assets/js/min/cherry-handler.min.js', __FILE__ ) ),
169
+ array( 'jquery' ),
170
+ '1.0.0',
171
+ true
172
+ );
173
+
174
+ wp_enqueue_style(
175
+ 'cherry-handler-css',
176
+ esc_url( Cherry_Core::base_url( 'assets/css/cherry-handler-styles.min.css', __FILE__ ) ),
177
+ array(),
178
+ '1.0.0',
179
+ 'all'
180
+ );
181
+ }
182
+
183
+ /**
184
+ * Prepare data for henler script.
185
+ *
186
+ * @since 1.0.0
187
+ * @return void
188
+ */
189
+ public function localize_script() {
190
+
191
+ $nonce = $this->create_nonce( $this->settings['action'] );
192
+
193
+ wp_localize_script( 'cherry-handler-js', $this->settings['id'],
194
+ array(
195
+ 'action' => $this->settings['action'],
196
+ 'nonce' => $nonce,
197
+ 'type' => $this->settings['type'],
198
+ 'data_type' => $this->settings['data_type'],
199
+ 'is_public' => $this->settings['is_public'] ? 'true' : 'false',
200
+ 'sys_messages' => $this->settings['sys_messages'],
201
+ )
202
+ );
203
+
204
+ if ( $this->settings['is_public'] ) {
205
+ wp_localize_script( 'cherry-handler-js', 'cherryHandlerAjaxUrl', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Create nonce by action
211
+ *
212
+ * @param string $action Nonce name.
213
+ * @return string
214
+ */
215
+ public function create_nonce( $action = '' ) {
216
+ if ( ! empty( $action ) ) {
217
+ return wp_create_nonce( $action );
218
+ }
219
+
220
+ return wp_create_nonce( 'cherry_ajax_nonce' );
221
+ }
222
+
223
+ /**
224
+ * Returns the instance.
225
+ *
226
+ * @since 1.0.0
227
+ * @return object
228
+ */
229
+ public static function get_instance( $core, $args ) {
230
+ return new self( $core, $args );
231
+ }
232
+ }
233
+ }
cherry-framework/modules/cherry-interface-builder/cherry-interface-builder.php ADDED
@@ -0,0 +1,471 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Module Name: Interface Builder
4
+ * Description: The module for the creation of interfaces in the WordPress admin panel
5
+ * Version: 1.0.3
6
+ * Author: Cherry Team
7
+ * Author URI: http://www.cherryframework.com/
8
+ * License: GPLv3
9
+ * License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
+ *
11
+ * @package Cherry_Framework
12
+ * @subpackage Modules
13
+ * @version 1.0.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
+ */
19
+
20
+ // If this file is called directly, abort.
21
+ if ( ! defined( 'WPINC' ) ) {
22
+ die;
23
+ }
24
+
25
+ if ( ! class_exists( 'Cherry_Interface_Builder' ) ) {
26
+
27
+ /**
28
+ * Class Cherry Interface Builder.
29
+ *
30
+ * @since 1.0.0
31
+ */
32
+ class Cherry_Interface_Builder {
33
+ /**
34
+ * Module settings.
35
+ *
36
+ * @since 1.0.0
37
+ * @access private
38
+ * @var array
39
+ */
40
+ private $args = array(
41
+ 'views' => array(
42
+ 'section' => 'inc/views/section.php',
43
+ 'component-tab-vertical' => 'inc/views/component-tab-vertical.php',
44
+ 'component-tab-horizontal' => 'inc/views/component-tab-horizontal.php',
45
+ 'component-toggle' => 'inc/views/component-toggle.php',
46
+ 'component-accordion' => 'inc/views/component-accordion.php',
47
+ 'component-repeater' => 'inc/views/component-repeater.php',
48
+ 'settings' => 'inc/views/settings.php',
49
+ 'control' => 'inc/views/control.php',
50
+ 'settings-children-title' => 'inc/views/settings-children-title.php',
51
+ 'tab-children-title' => 'inc/views/tab-children-title.php',
52
+ 'toggle-children-title' => 'inc/views/toggle-children-title.php',
53
+ 'form' => 'inc/views/form.php',
54
+ 'html' => 'inc/views/html.php',
55
+ ),
56
+ 'views_args' => array(
57
+ 'parent' => '',
58
+ 'type' => '',
59
+ 'view' => '',
60
+ 'view_wrapping' => true,
61
+ 'html' => '',
62
+ 'scroll' => false,
63
+ 'master' => false,
64
+ 'title' => '',
65
+ 'description' => '',
66
+ ),
67
+ );
68
+
69
+ /**
70
+ * A reference to an instance of this class.
71
+ *
72
+ * @since 1.0.0
73
+ * @access private
74
+ * @var object
75
+ */
76
+ private static $instance = null;
77
+
78
+ /**
79
+ * UI element instance.
80
+ *
81
+ * @since 1.0.0
82
+ * @access public
83
+ * @var object
84
+ */
85
+ public $ui_elements = null;
86
+
87
+ /**
88
+ * The structure of the interface elements.
89
+ *
90
+ * @since 1.0.0
91
+ * @access private
92
+ * @var array
93
+ */
94
+ private $structure = array();
95
+
96
+ /**
97
+ * Cherry_Interface_Builder constructor.
98
+ *
99
+ * @since 1.0.0
100
+ * @access public
101
+ * @return void
102
+ */
103
+ public function __construct( $core, array $args = array() ) {
104
+ $this->args = array_merge_recursive(
105
+ $args,
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
+ }
113
+
114
+ /**
115
+ * Register element type section.
116
+ *
117
+ * @since 1.0.0
118
+ * @access public
119
+ * @param array $args Options section.
120
+ * @return void
121
+ */
122
+ public function register_section( array $args = array() ) {
123
+ $this->add_new_element( $args, 'section' );
124
+ }
125
+
126
+ /**
127
+ * Register element type component.
128
+ *
129
+ * @since 1.0.0
130
+ * @access public
131
+ * @param array $args Options component.
132
+ * @return void
133
+ */
134
+ public function register_component( array $args = array() ) {
135
+ $this->add_new_element( $args, 'component' );
136
+ }
137
+
138
+ /**
139
+ * Register element type settings.
140
+ *
141
+ * @since 1.0.0
142
+ * @access public
143
+ * @param array $args Options settings.
144
+ * @return void
145
+ */
146
+ public function register_settings( array $args = array() ) {
147
+ $this->add_new_element( $args, 'settings' );
148
+ }
149
+
150
+ /**
151
+ * Register element type control.
152
+ *
153
+ * @since 1.0.0
154
+ * @access public
155
+ * @param array $args Options control.
156
+ * @return void
157
+ */
158
+ public function register_control( array $args = array() ) {
159
+ $this->add_new_element( $args, 'control' );
160
+ }
161
+
162
+ /**
163
+ * Register element type form.
164
+ *
165
+ * @since 1.0.0
166
+ * @access public
167
+ * @param array $args Options form.
168
+ * @return void
169
+ */
170
+ public function register_form( array $args = array() ) {
171
+ $this->add_new_element( $args, 'form' );
172
+ }
173
+
174
+ /**
175
+ * Register element type html.
176
+ *
177
+ * @since 1.0.0
178
+ * @access public
179
+ * @param array $args Options control.
180
+ * @return void
181
+ */
182
+ public function register_html( array $args = array() ) {
183
+ $this->add_new_element( $args, 'html' );
184
+ }
185
+
186
+ /**
187
+ * This function adds a new element to the structure.
188
+ *
189
+ * @since 1.0.0
190
+ * @access protected
191
+ * @param array $args Options new element.
192
+ * @param string $type Type new element.
193
+ * @return void
194
+ */
195
+ protected function add_new_element( array $args = array(), $type = 'section' ) {
196
+ if ( ! isset( $args[0] ) && ! is_array( current( $args ) ) ) {
197
+
198
+ if ( 'control' !== $type && 'component' !== $type ) {
199
+ $args['type'] = $type;
200
+ }
201
+
202
+ $this->structure[ $args['id'] ] = $args;
203
+ } else {
204
+ foreach ( $args as $key => $value ) {
205
+
206
+ if ( 'control' !== $type && 'component' !== $type ) {
207
+ $value['type'] = $type;
208
+ }
209
+
210
+ $this->structure[ $key ] = $value;
211
+ }
212
+ }
213
+ }
214
+
215
+ /**
216
+ * Sorts the elements of the structure, adding child items to the parent.
217
+ *
218
+ * @since 1.0.0
219
+ * @access protected
220
+ * @param array $structure The original structure of the elements.
221
+ * @param string $parent_key The key of the parent element.
222
+ * @return array
223
+ */
224
+ protected function sort_structure( array $structure = array(), $parent_key = null ) {
225
+ $new_array = array();
226
+
227
+ foreach ( $structure as $key => $value ) {
228
+ if (
229
+ ( null === $parent_key && ! isset( $value['parent'] ) )
230
+ || null === $parent_key && ! isset( $structure[ $value['parent'] ] )
231
+ || ( isset( $value['parent'] ) && $value['parent'] === $parent_key )
232
+ ) {
233
+
234
+ if ( ! isset( $value['id'] ) ) {
235
+ $value['id'] = $key;
236
+ }
237
+ if ( ! isset( $value['name'] ) ) {
238
+ $value['name'] = $key;
239
+ }
240
+ $new_array[ $key ] = $value;
241
+
242
+ $children = $this->sort_structure( $structure, $key );
243
+ if ( ! empty( $children ) ) {
244
+ $new_array[ $key ]['children'] = $children;
245
+ }
246
+ }
247
+ }
248
+
249
+ return $new_array;
250
+ }
251
+
252
+ /**
253
+ * Reset structure array.
254
+ * Call this method only after render.
255
+ *
256
+ * @since 1.0.1
257
+ * @return void
258
+ */
259
+ public function reset_structure() {
260
+ $this->structure = array();
261
+ }
262
+
263
+ /**
264
+ * Get view for interface elements.
265
+ *
266
+ * @since 1.0.0
267
+ * @access protected
268
+ * @param string $type View type.
269
+ * @param array $args Input data.
270
+ * @return string
271
+ */
272
+ protected function get_view( $type = 'control', array $args = array() ) {
273
+
274
+ if ( empty( $view ) ) {
275
+ $path = dirname( __FILE__ ) . '/';
276
+ $path .= ( array_key_exists( $type, $this->args['views'] ) ) ? $this->args['views'][ $type ] : $this->args['views']['control'] ;
277
+ } else {
278
+ $path = $view;
279
+ }
280
+
281
+ $view = Cherry_Toolkit::render_view( $path, $args );
282
+
283
+ return $view;
284
+ }
285
+
286
+ /**
287
+ * Render HTML elements.
288
+ *
289
+ * @since 1.0.0
290
+ * @access public
291
+ * @param bool $echo Input data.
292
+ * @param array $args The original structure of the elements.
293
+ * @return string
294
+ */
295
+ public function render( $echo = true, array $args = array() ) {
296
+
297
+ if ( empty( $args ) ) {
298
+ $args = $this->structure;
299
+ }
300
+
301
+ if ( empty( $args ) ) {
302
+ return false;
303
+ }
304
+
305
+ $sorted_structure = $this->sort_structure( $args );
306
+
307
+ $output = $this->build( $sorted_structure );
308
+ $output = str_replace( array( "\r\n", "\r", "\n", "\t" ), '', $output );
309
+
310
+ $this->reset_structure();
311
+
312
+ return $this->output_method( $output, $echo );
313
+ }
314
+
315
+ /**
316
+ * Render HTML elements.
317
+ *
318
+ * @since 1.0.0
319
+ * @access protected
320
+ * @param array $args Input data.
321
+ * @return string
322
+ */
323
+ protected function build( array $args = array() ) {
324
+ $output = '';
325
+ $views = $this->args['views'];
326
+
327
+ foreach ( $args as $key => $value ) {
328
+ $value = wp_parse_args(
329
+ $value,
330
+ $this->args['views_args']
331
+ );
332
+
333
+ $value['class'] = isset( $value['class'] ) ? $value['class'] . ' ' : '' ;
334
+ $value['class'] .= $value['id'] . ' ' ;
335
+ if ( $value['scroll'] ) {
336
+ $value['class'] .= 'cherry-scroll ';
337
+ }
338
+ if ( $value['master'] ) {
339
+ $value['class'] .= $value['master'] . ' ' ;
340
+ }
341
+
342
+ $type = array_key_exists( $value['type'], $views ) ? $value['type'] : 'field' ;
343
+ $has_child = isset( $value['children'] ) && is_array( $value['children'] ) && ! empty( $value['children'] );
344
+
345
+ switch ( $type ) {
346
+ case 'component-tab-vertical':
347
+ case 'component-tab-horizontal':
348
+ if ( $has_child ) {
349
+ $value['tabs'] = '';
350
+
351
+ foreach ( $value['children'] as $key_children => $value_children ) {
352
+ $value['tabs'] .= $this->get_view( 'tab-children-title', $value_children );
353
+
354
+ unset( $value['children'][ $key_children ]['title'] );
355
+ }
356
+ }
357
+ break;
358
+
359
+ case 'component-toggle':
360
+ case 'component-accordion':
361
+ if ( $has_child ) {
362
+ foreach ( $value['children'] as $key_children => $value_children ) {
363
+ $value['children'][ $key_children ]['title_in_view'] = $this->get_view( 'toggle-children-title', $value_children );
364
+ }
365
+ }
366
+ break;
367
+
368
+ case 'settings':
369
+ if ( isset( $value['title'] ) && $value['title'] ) {
370
+ $value['title'] = isset( $value['title_in_view'] ) ? $value['title_in_view'] : $this->get_view( 'settings-children-title', $value );
371
+ }
372
+ break;
373
+
374
+ case 'html':
375
+ $value['children'] = $value['html'];
376
+ break;
377
+
378
+ case 'form':
379
+ $value['accept-charset'] = isset( $value['accept-charset'] ) ? 'accept-charset="' . $value['accept-charset'] . '" ' : 'accept-charset="utf-8"';
380
+ $value['action'] = isset( $value['action'] ) ? 'action="' . $value['action'] . '" ' : '' ;
381
+ $value['autocomplete'] = isset( $value['autocomplete'] ) ? 'autocomplete="' . $value['autocomplete'] . '" ' : 'autocomplete="on"';
382
+ $value['enctype'] = isset( $value['enctype'] ) ? 'enctype="' . $value['enctype'] . '" ' : 'enctype="application/x-www-form-urlencoded"';
383
+ $value['method'] = isset( $value['method'] ) ? 'method="' . $value['method'] . '" ' : 'method="post"';
384
+ $value['novalidate'] = ( isset( $value['novalidate'] ) && $value['novalidate'] ) ? 'novalidate' : '';
385
+ $value['target'] = isset( $value['target'] ) ? 'target="' . $value['target'] . '" ' : '';
386
+ break;
387
+
388
+ case 'field':
389
+ $ui_args = $value;
390
+
391
+ $ui_args['class'] = isset( $ui_args['child_class'] ) ? $ui_args['child_class'] : '' ;
392
+
393
+ if ( isset( $ui_args['options_callback'] ) ) {
394
+ $ui_args['options'] = call_user_func( $ui_args['options_callback'] );
395
+ }
396
+
397
+ unset( $ui_args['master'] );
398
+
399
+ $value['children'] = $this->ui_elements->get_ui_element_instance( $ui_args['type'], $ui_args )->render();
400
+ break;
401
+ }
402
+
403
+ if ( $has_child ) {
404
+ $value['children'] = $this->build( $value['children'] );
405
+ }
406
+
407
+ $output .= ( $value['view_wrapping'] ) ? $this->get_view( $type, $value ) : $value['children'];
408
+ }
409
+
410
+ return $output;
411
+ }
412
+
413
+ /**
414
+ * Output HTML.
415
+ *
416
+ * @since 1.0.0
417
+ * @access protected
418
+ * @param string $output Output HTML.
419
+ * @param boolean $echo Output type.
420
+ * @return string
421
+ */
422
+ protected function output_method( $output = '', $echo = true ) {
423
+ if ( ! filter_var( $echo, FILTER_VALIDATE_BOOLEAN ) ) {
424
+ return $output;
425
+ } else {
426
+ echo $output;
427
+ }
428
+ }
429
+
430
+ /**
431
+ * Enqueue javascript and stylesheet interface builder.
432
+ *
433
+ * @since 4.0.0
434
+ * @access public
435
+ * @return void
436
+ */
437
+ public function enqueue_assets() {
438
+ wp_enqueue_script(
439
+ 'cherry-interface-builder',
440
+ esc_url( Cherry_Core::base_url( 'inc/assets/min/cherry-interface-builder.min.js', __FILE__ ) ),
441
+ array( 'jquery' ),
442
+ '1.0.0',
443
+ true
444
+ );
445
+ wp_enqueue_style(
446
+ 'cherry-interface-builder',
447
+ esc_url( Cherry_Core::base_url( 'inc/assets/min/cherry-interface-builder.min.css', __FILE__ ) ),
448
+ array(),
449
+ '1.0.0',
450
+ 'all'
451
+ );
452
+ }
453
+
454
+ /**
455
+ * Returns the instance.
456
+ *
457
+ * @since 1.0.0
458
+ * @access public
459
+ * @return object
460
+ */
461
+ public static function get_instance( $core, $args ) {
462
+
463
+ // If the single instance hasn't been set, set it now.
464
+ if ( null == self::$instance ) {
465
+ self::$instance = new self( $core, $args );
466
+ }
467
+
468
+ return self::$instance;
469
+ }
470
+ }
471
+ }
cherry-framework/modules/cherry-interface-builder/inc/assets/_use-in-js.scss ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cherry-ui-kit{
2
+ button{
3
+ *{
4
+ pointer-events: none;
5
+ }
6
+ }
7
+ }
8
+ .cherry-component{
9
+ &__content{
10
+ .cherry-settings__content{
11
+ display: none;
12
+ &.show{
13
+ display: inherit;
14
+ }
15
+ }
16
+ }
17
+ }
cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.js ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Interface Builder
3
+ */
4
+ ;( function( $, CherryJsCore ) {
5
+ 'use strict';
6
+
7
+ CherryJsCore.utilites.namespace( 'interfaceBuilder' );
8
+
9
+ CherryJsCore.interfaceBuilder = {
10
+ init: function() {
11
+ this.component.init();
12
+ },
13
+ component: {
14
+ tabClass: '.cherry-tab',
15
+ accordionClass: '.cherry-accordion',
16
+ toggleClass: '.cherry-toggle',
17
+
18
+ buttonClass: '.cherry-component__button',
19
+ contentClass: '.cherry-settings__content',
20
+
21
+ buttonActiveClass: 'active',
22
+ showClass: 'show',
23
+
24
+ localStorage: {},
25
+
26
+ init: function () {
27
+ this.localStorage = this.getState() || {};
28
+
29
+ this.componentInit( this.tabClass );
30
+ this.componentInit( this.accordionClass );
31
+ this.componentInit( this.toggleClass );
32
+
33
+ this.addEvent();
34
+ },
35
+
36
+ addEvent: function() {
37
+ $( 'body' )
38
+ .on( 'click',
39
+ this.tabClass + ' ' + this.buttonClass + ', ' +
40
+ this.toggleClass + ' ' + this.buttonClass + ', ' +
41
+ this.accordionClass + ' ' + this.buttonClass,
42
+
43
+ this.componentClick.bind( this )
44
+ );
45
+ },
46
+
47
+ componentInit: function( componentClass ) {
48
+ var _this = this,
49
+ components = $( componentClass ),
50
+ componentId = null,
51
+ button = null,
52
+ contentId = null,
53
+ notShow = '';
54
+
55
+ components.each( function( index, component ) {
56
+ component = $( component );
57
+ componentId = component.data( 'compotent-id' );
58
+
59
+ switch ( componentClass ) {
60
+ case _this.toggleClass:
61
+ if ( _this.localStorage[ componentId ] && _this.localStorage[ componentId ].length ) {
62
+ notShow = _this.localStorage[ componentId ].join( ', ' );
63
+ }
64
+
65
+ $( _this.contentClass, component )
66
+ .not( notShow )
67
+ .addClass( _this.showClass )
68
+ .prevAll( _this.buttonClass )
69
+ .addClass( _this.buttonActiveClass );
70
+ break;
71
+
72
+ case _this.tabClass:
73
+ case _this.accordionClass:
74
+ if ( _this.localStorage[ componentId ] ) {
75
+ contentId = _this.localStorage[ componentId ][ 0 ];
76
+ button = $( '[data-content-id="' + contentId + '"]', component );
77
+ } else {
78
+ button = $( _this.buttonClass, component ).eq( 0 );
79
+ contentId = button.data( 'content-id' );
80
+ }
81
+
82
+ _this.showElement( button, component, contentId );
83
+ break;
84
+ }
85
+ } );
86
+ },
87
+
88
+ componentClick: function( event ) {
89
+ var $target = $( event.target ),
90
+ $parent = $target.closest( this.tabClass + ', ' + this.accordionClass + ', ' + this.toggleClass ),
91
+ expr = new RegExp( this.tabClass + '|' + this.accordionClass + '|' + this.toggleClass ),
92
+ componentName = $parent[0].className.match( expr )[ 0 ].replace( ' ', '.' ),
93
+ contentId = $target.data( 'content-id' ),
94
+ componentId = $parent.data( 'compotent-id' ),
95
+ activeFlag = $target.hasClass( this.buttonActiveClass ),
96
+ itemClosed;
97
+
98
+ switch ( componentName ) {
99
+ case this.tabClass:
100
+ if ( ! activeFlag ) {
101
+ this.hideElement( $parent );
102
+ this.showElement( $target, $parent, contentId );
103
+
104
+ this.localStorage[ componentId ] = new Array( contentId );
105
+ this.setState();
106
+ }
107
+ break;
108
+
109
+ case this.accordionClass:
110
+ this.hideElement( $parent );
111
+
112
+ if ( ! activeFlag ) {
113
+ this.showElement( $target, $parent, contentId );
114
+
115
+ this.localStorage[ componentId ] = new Array( contentId );
116
+ } else {
117
+ this.localStorage[ componentId ] = {};
118
+ }
119
+ this.setState();
120
+ break;
121
+
122
+ case this.toggleClass:
123
+ $target
124
+ .toggleClass( this.buttonActiveClass )
125
+ .nextAll( contentId )
126
+ .toggleClass( this.showClass );
127
+
128
+ if ( Array.isArray( this.localStorage[ componentId ] ) ) {
129
+ itemClosed = this.localStorage[ componentId ].indexOf( contentId );
130
+
131
+ if ( -1 !== itemClosed ) {
132
+ this.localStorage[ componentId ].splice( itemClosed, 1 );
133
+ } else {
134
+ this.localStorage[ componentId ].push( contentId );
135
+ }
136
+
137
+ } else {
138
+ this.localStorage[ componentId ] = new Array( contentId );
139
+ }
140
+
141
+ this.setState();
142
+ break;
143
+ }
144
+ $target.blur();
145
+
146
+ return false;
147
+ },
148
+
149
+ showElement: function ( button, holder, contentId ) {
150
+ button
151
+ .addClass( this.buttonActiveClass );
152
+
153
+ holder
154
+ .data( 'content-id', contentId );
155
+
156
+ $( contentId, holder )
157
+ .addClass( this.showClass );
158
+ },
159
+
160
+ hideElement: function ( holder ) {
161
+ var contsntId = holder.data( 'content-id' );
162
+
163
+ $( '[data-content-id="' + contsntId + '"]', holder )
164
+ .removeClass( this.buttonActiveClass );
165
+
166
+ $( contsntId, holder )
167
+ .removeClass( this.showClass );
168
+ },
169
+
170
+ getState: function() {
171
+ try {
172
+ return JSON.parse( localStorage.getItem( 'interface-builder' ) );
173
+ } catch ( e ) {
174
+ return false;
175
+ }
176
+ },
177
+
178
+ setState: function() {
179
+ try {
180
+ localStorage.setItem( 'interface-builder', JSON.stringify( this.localStorage ) );
181
+ } catch ( e ) {
182
+ return false;
183
+ }
184
+ }
185
+ }
186
+ };
187
+
188
+ CherryJsCore.interfaceBuilder.init();
189
+ }( jQuery, window.CherryJsCore ) );
cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.scss ADDED
@@ -0,0 +1,463 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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; //
5
+ $color-5: #f1f1f1; // Scrollbar background
6
+ $color-6: #e5e5e5; // Hover scrollbar background
7
+ $color-7: #495159; // Scrollbar track background
8
+ $link-color: #298ffc; // link color.
9
+ $link-hover-color: #23282d; // link hover color.
10
+
11
+ $shadow: 0px 5px 21px rgba(0, 0, 0, 0.1); //Shadow.
12
+ $border: 1px solid rgba(0, 0, 0, 0.1) ;
13
+
14
+ $br-radius: 5px; // Border radius.
15
+
16
+ $padding: 10px;
17
+ $margin: 10px;
18
+ $max-heught: 700px;
19
+
20
+ @import "use-in-js";
21
+
22
+ html{
23
+ font-size: 13px;
24
+ }
25
+ .cherry-ui-kit{
26
+ h1{
27
+ font-weight: 700;
28
+ font-size: 2.308rem;
29
+ line-height: 2.308rem;
30
+ .dashicons{
31
+ font-size: 3rem;
32
+ line-height: inherit;
33
+ width: 20px;
34
+ margin: 0 $margin * 2 0 $margin * -0.5;
35
+ }
36
+ }
37
+ h2{
38
+ font-weight: 600;
39
+ font-size: 1.538rem;
40
+ line-height: 1.538rem;
41
+ .dashicons{
42
+ font-size: 2rem;
43
+ line-height: inherit;
44
+ width: 20px;
45
+ margin-right: $margin * 2;
46
+ }
47
+ }
48
+ h3{
49
+ font-weight: 600;
50
+ font-size: 1.231rem;
51
+ line-height: 1.231rem;
52
+ .dashicons{
53
+ font-size: 1.7rem;
54
+ line-height: inherit;
55
+ margin-right: $margin * 0.5;
56
+ }
57
+ }
58
+ h4{
59
+ font-weight: 500;
60
+ font-size: 1.077rem;
61
+ line-height: 1.077rem;
62
+
63
+ }
64
+ h5{
65
+ font-weight: 500;
66
+ font-size: 1.077rem;
67
+ line-height: 1.077rem;
68
+ }
69
+ h6{
70
+ font-weight: 400;
71
+ font-size: 1rem;
72
+ line-height: 1rem;
73
+ }
74
+ a{
75
+ color: $link-color;
76
+ text-decoration: none;
77
+ &:hover{
78
+ color: $link-hover-color;
79
+ }
80
+ &:focus{
81
+ outline: 1px solid $link-hover-color;
82
+ }
83
+ }
84
+ &__description{
85
+ font-style: 1rem;
86
+ color: $color-3;
87
+ margin: $margin 0;
88
+ }
89
+ &__title{
90
+ margin: $margin*2 0;
91
+ }
92
+ &.hide{
93
+ display: none;
94
+ }
95
+ }
96
+
97
+ .cherry-control + .cherry-control, .cherry-settings + .cherry-control{
98
+ border-top: $border;
99
+ }
100
+
101
+ .cherry-section{
102
+ padding: $padding;
103
+ background-color: $color-1;
104
+ margin-left: -10px;
105
+ &__title, &__description{
106
+ margin: $margin 0 0 0;
107
+ }
108
+ & + .cherry-ui-kit {
109
+ border-top: $border;
110
+ }
111
+ @media ( min-width: 783px ) {
112
+ box-shadow:$shadow;
113
+ border-radius: $br-radius;
114
+ border: $border;
115
+ padding: $padding * 1.5;
116
+ margin: $margin * 1.5 $margin * 1.5 0 0;
117
+ &__holder{
118
+ background-color: $color-2;
119
+ border-radius: $br-radius;
120
+ padding: $padding * 1.5;
121
+ }
122
+ &__inner{
123
+
124
+ }
125
+ &__info{
126
+ background-color: $color-1;
127
+ border-radius: $br-radius;
128
+ padding: $padding * 1.5;
129
+ box-shadow: $shadow;
130
+ margin-bottom: $padding * 1.5;
131
+ }
132
+ .cherry-settings{
133
+ box-shadow: $shadow;
134
+ border-radius: $br-radius;
135
+ border: $border;
136
+ background-color: $color-1;
137
+ margin-top: $padding * 1.5;
138
+ &:first-child{
139
+ margin-top: 0;
140
+ }
141
+ }
142
+ }
143
+ @media ( min-width: 961px ) {
144
+ padding: $padding * 3;
145
+ margin: $margin * 2 $margin * 2 0 0;
146
+ &__info{
147
+ padding: $padding * 3;
148
+ margin-bottom: $padding * 3;
149
+ }
150
+ &__holder{
151
+ padding: $padding * 3;
152
+ }
153
+ .cherry-settings{
154
+ margin-top: $padding * 3;
155
+ }
156
+ }
157
+ }
158
+
159
+ .cherry-component{
160
+ padding: $padding * 2 0;
161
+ @media ( min-width: 783px ) {
162
+ padding: $padding * 1.5;
163
+ }
164
+ @media ( min-width: 961px ) {
165
+ padding: $padding * 3;
166
+ }
167
+ & + * {
168
+ border-top: $border;
169
+ }
170
+ &__title{
171
+ margin-top: 0;
172
+ }
173
+ & &__content{
174
+ .cherry-settings{
175
+ padding: 0;
176
+ border-top: none;
177
+ }
178
+ }
179
+ &__button{
180
+ display: block;
181
+ min-height: 45px;
182
+ .cherry-ui-kit__title {
183
+ color: inherit;
184
+ }
185
+ &.active, &:hover{
186
+ color: $link-color;
187
+ transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
188
+ }
189
+ &:focus{
190
+ outline: none;
191
+ box-shadow: inset 0px 0px 10px rgba(41,143,252,0.5);
192
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
193
+ }
194
+ transition: all 300ms cubic-bezier(0.55, 0.055, 0.675, 0.19);
195
+ }
196
+ &.cherry-accordion, &.cherry-toggle{
197
+ .cherry-component__button{
198
+ width: 100%;
199
+ padding: $padding * 1.5 $padding * 2;
200
+ border:0;
201
+ background: none;
202
+ cursor: pointer;
203
+ .cherry-toggle__title {
204
+ font-weight: 700;
205
+ font-size: 14px;
206
+ float: left;
207
+ margin: 0;
208
+ }
209
+ span{
210
+ font-size: 25px;
211
+ color: $color-4;
212
+ float: right;
213
+ padding: 5px 5px;
214
+ width: 10px;
215
+ height: 9px;
216
+ text-align: left;
217
+ margin-right: -6px;
218
+ &.hide-icon{
219
+ &:before{
220
+ position: relative;
221
+ top: -8px;
222
+ left: -9px;
223
+ }
224
+ transform:scaleX(1);
225
+ transition: all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
226
+ }
227
+ &.show-icon{
228
+ &:before{
229
+ position: relative;
230
+ top: -7px;
231
+ left: -9px;
232
+ }
233
+ position: relative;
234
+ left: 14px;
235
+ transform:scaleX(0);
236
+ transition: all 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
237
+ }
238
+ }
239
+ &.active{
240
+ span{
241
+ &.show-icon{
242
+ transform:scaleX(1);
243
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
244
+ }
245
+ &.hide-icon{
246
+ transform:scaleX(0);
247
+ transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
248
+ }
249
+ }
250
+ }
251
+ }
252
+ .cherry-component__button + .cherry-settings__content{
253
+ border-top: $border;
254
+ }
255
+ > .cherry-ui-kit__content{
256
+ & > .cherry-settings + .cherry-settings{
257
+ margin-top: $margin;
258
+ }
259
+ > .cherry-settings{
260
+ box-shadow:$shadow;
261
+ border-radius: $br-radius;
262
+ border: $border;
263
+ }
264
+ }
265
+ }
266
+ &.cherry-tab{
267
+ .cherry-tab__tabs{
268
+ display: flex;
269
+ flex-flow: row wrap;
270
+ justify-content: flex-start;
271
+ align-items: flex-start;
272
+ align-content: flex-start;
273
+ border-bottom: $border;
274
+ .cherry-component__button{
275
+ order: 0;
276
+ flex: 0 1 100%;
277
+ align-self: auto;
278
+ padding: $padding * 1.5 $padding * 2;
279
+ border: 0;
280
+ background: none;
281
+ cursor: pointer;
282
+ &.active{
283
+ -ms-box-shadow: inset 0px -3px 0px 0px $link-color;
284
+ box-shadow: inset 0px -3px 0px 0px $link-color;
285
+ }
286
+ .cherry-tab__title {
287
+ font-weight: 700;
288
+ font-size: 14px;
289
+ float: left;
290
+ margin: 0;
291
+ }
292
+ & + button{
293
+ border-top: $border;
294
+ }
295
+ }
296
+ }
297
+ .cherry-tab__body{
298
+ box-shadow:$shadow;
299
+ border-radius: $br-radius;
300
+ border: $border;
301
+ background-color: $color-1;
302
+ .cherry-settings{
303
+ box-shadow: none;
304
+ border-radius: 0;
305
+ border: none;
306
+ background-color: inherit;
307
+ margin: 0;
308
+ }
309
+ }
310
+ @media ( min-width: 783px ) {
311
+ .cherry-tab__tabs{
312
+ border: solid 1px rgba(0,0,0,0.1);
313
+ .cherry-component__button{
314
+ & + button{
315
+ border-top: none;
316
+ }
317
+ }
318
+ }
319
+ .cherry-tab__body{
320
+ border: none;
321
+ .cherry-tab__content{
322
+ border: $border;
323
+ }
324
+ }
325
+ &--horizontal{
326
+ >.cherry-tab__body{
327
+ border-radius: none;
328
+ >.cherry-tab__tabs{
329
+ flex-wrap: nowrap;
330
+ flex-direction: row;
331
+ border-radius:$br-radius $br-radius 0 0;
332
+ border-bottom: none;
333
+ .cherry-component__button{
334
+ flex: 0 1 auto;
335
+ }
336
+ }
337
+ >.cherry-tab__content{
338
+ border-radius: 0 0 $br-radius $br-radius;
339
+ }
340
+ }
341
+ }
342
+ &--vertical{
343
+ >.cherry-tab__body{
344
+ display: flex;
345
+ border-radius: none;
346
+ >.cherry-tab__tabs{
347
+ flex-direction: row;
348
+ -webkit-box-flex: 0;
349
+ flex: 0 1 25%;
350
+ border-radius:$br-radius 0 0 $br-radius;
351
+ border-right: none;
352
+ .cherry-component__button{
353
+ text-align: right;
354
+ .cherry-tab__title {
355
+ width: 100%;
356
+ }
357
+ &.active{
358
+ box-shadow: inset -3px 0px 0px $link-color;
359
+ }
360
+ }
361
+ }
362
+ >.cherry-tab__content{
363
+ -webkit-box-flex: 0;
364
+ flex: 0 1 75%;
365
+ border-radius: 0 $br-radius $br-radius 0;
366
+ }
367
+ }
368
+ }
369
+ }
370
+ @media ( min-width: 1200px ) {
371
+ &--vertical{
372
+ .cherry-tab__tabs{
373
+ flex: 0 1 20%;
374
+ }
375
+ .cherry-tab__content{
376
+ flex: 0 1 80%;
377
+ }
378
+ }
379
+ }
380
+ }
381
+ }
382
+ .cherry-settings{
383
+ & + & {
384
+ border-top: $border;
385
+ }
386
+ & &__title{
387
+ margin-bottom: $margin;
388
+ }
389
+ &__description, & &__title{
390
+ margin-left: $margin;
391
+ @media ( min-width: 783px ) {
392
+ margin-left: $margin * 1.5;
393
+ }
394
+ @media ( min-width: 961px ) {
395
+ margin-left: $margin * 3;
396
+ }
397
+ }
398
+ }
399
+ .cherry-control{
400
+ padding: $padding * 1.5 $padding * 2;
401
+ &__title{
402
+ margin: 0 0 $margin 0 ;
403
+ }
404
+ &__description{
405
+ margin-top: 0;
406
+ }
407
+ .cherry-ui-container {
408
+ margin: 0;
409
+ }
410
+ @media (min-width: 783px) {
411
+ padding: $padding * 1.5;
412
+ display: flex;
413
+ flex-flow: row nowrap;
414
+ &__info{
415
+ -webkit-box-flex: 0;
416
+ flex: 0 1 30%;
417
+ padding-right: $padding * 1.5;
418
+ }
419
+ &__content{
420
+ -webkit-box-flex: 0;
421
+ flex: 0 1 70%;
422
+ }
423
+ }
424
+ @media ( min-width: 961px ) {
425
+ padding: $padding * 3;
426
+ }
427
+ }
428
+
429
+ .cherry-section.cherry-scroll > .cherry-section__holder > .cherry-section__inner,
430
+ .cherry-tab__content > .cherry-scroll,
431
+ .cherry-accordion__content > .cherry-scroll > .cherry-settings__content,
432
+ .cherry-toggle__content > .cherry-scroll > .cherry-settings__content,
433
+ {
434
+ @media ( min-width: 783px ) {
435
+ max-height: $max-heught;
436
+ overflow-y: scroll;
437
+ position: relative;
438
+ &::-webkit-scrollbar {
439
+ width: 10px;
440
+ height: 10px;
441
+ &-button {
442
+ width: 0px;
443
+ height: 0px;
444
+ }
445
+ &-thumb {
446
+ background-color: $link-color;
447
+ border: none;
448
+ border-radius: $br-radius;
449
+ &:hover, &:active {
450
+ background: #206ff4;
451
+ }
452
+ }
453
+ &-track {
454
+ background-color: $color-1;
455
+ border: none;
456
+ border-radius: $br-radius;
457
+ }
458
+ &-corner {
459
+ background: transparent;
460
+ }
461
+ }
462
+ }
463
+ }
cherry-framework/modules/cherry-interface-builder/inc/assets/min/cherry-interface-builder.min.css ADDED
@@ -0,0 +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 #23282d}.cherry-ui-kit__description{font-style:1rem;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}.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,.cherry-component.cherry-toggle .cherry-component__button span{font-size:25px;color:#b4b7ba;float:right;padding:5px 5px;width:10px;height:9px;text-align:left;margin-right:-6px}.cherry-component.cherry-accordion .cherry-component__button span.hide-icon,.cherry-component.cherry-toggle .cherry-component__button span.hide-icon{-webkit-transform:scaleX(1);-ms-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.hide-icon:before,.cherry-component.cherry-toggle .cherry-component__button span.hide-icon:before{position:relative;top:-8px;left:-9px}.cherry-component.cherry-accordion .cherry-component__button span.show-icon,.cherry-component.cherry-toggle .cherry-component__button span.show-icon{position:relative;left:14px;-webkit-transform:scaleX(0);-ms-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.show-icon:before,.cherry-component.cherry-toggle .cherry-component__button span.show-icon:before{position:relative;top:-7px;left:-9px}.cherry-component.cherry-accordion .cherry-component__button.active span.show-icon,.cherry-component.cherry-toggle .cherry-component__button.active span.show-icon{-webkit-transform:scaleX(1);-ms-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.hide-icon,.cherry-component.cherry-toggle .cherry-component__button.active span.hide-icon{-webkit-transform:scaleX(0);-ms-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:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;-webkit-align-content: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;-webkit-order:0;-ms-flex-order:0;order:0;-webkit-box-flex:0;-webkit-flex:0 1 100%;-ms-flex:0 1 100%;flex:0 1 100%;-webkit-align-self:auto;-ms-flex-item-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{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-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;-webkit-flex:0 1 auto;-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:-webkit-flex;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;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:0;-webkit-flex:0 1 25%;-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;-webkit-flex:0 1 75%;-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;-webkit-flex:0 1 20%;-ms-flex:0 1 20%;flex:0 1 20%}.cherry-component.cherry-tab--vertical .cherry-tab__content{-webkit-box-flex:0;-webkit-flex:0 1 80%;-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:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap}.cherry-control__info{-webkit-box-flex:0;-webkit-flex:0 1 30%;-ms-flex:0 1 30%;flex:0 1 30%;padding-right:15px}.cherry-control__content{-webkit-box-flex:0;-webkit-flex:0 1 70%;-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:scroll;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/assets/min/cherry-interface-builder.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t,s){"use strict";s.utilites.namespace("interfaceBuilder"),s.interfaceBuilder={init:function(){this.component.init()},component:{tabClass:".cherry-tab",accordionClass:".cherry-accordion",toggleClass:".cherry-toggle",buttonClass:".cherry-component__button",contentClass:".cherry-settings__content",buttonActiveClass:"active",showClass:"show",localStorage:{},init:function(){this.localStorage=this.getState()||{},this.componentInit(this.tabClass),this.componentInit(this.accordionClass),this.componentInit(this.toggleClass),this.addEvent()},addEvent:function(){t("body").on("click",this.tabClass+" "+this.buttonClass+", "+this.toggleClass+" "+this.buttonClass+", "+this.accordionClass+" "+this.buttonClass,this.componentClick.bind(this))},componentInit:function(s){var a=this,e=t(s),o=null,i=null,l=null,n="";e.each(function(e,c){switch(c=t(c),o=c.data("compotent-id"),s){case a.toggleClass:a.localStorage[o]&&a.localStorage[o].length&&(n=a.localStorage[o].join(", ")),t(a.contentClass,c).not(n).addClass(a.showClass).prevAll(a.buttonClass).addClass(a.buttonActiveClass);break;case a.tabClass:case a.accordionClass:a.localStorage[o]?(l=a.localStorage[o][0],i=t('[data-content-id="'+l+'"]',c)):(i=t(a.buttonClass,c).eq(0),l=i.data("content-id")),a.showElement(i,c,l)}})},componentClick:function(s){var a,e=t(s.target),o=e.closest(this.tabClass+", "+this.accordionClass+", "+this.toggleClass),i=new RegExp(this.tabClass+"|"+this.accordionClass+"|"+this.toggleClass),l=o[0].className.match(i)[0].replace(" ","."),n=e.data("content-id"),c=o.data("compotent-id"),r=e.hasClass(this.buttonActiveClass);switch(l){case this.tabClass:r||(this.hideElement(o),this.showElement(e,o,n),this.localStorage[c]=new Array(n),this.setState());break;case this.accordionClass:this.hideElement(o),r?this.localStorage[c]={}:(this.showElement(e,o,n),this.localStorage[c]=new Array(n)),this.setState();break;case this.toggleClass:e.toggleClass(this.buttonActiveClass).nextAll(n).toggleClass(this.showClass),Array.isArray(this.localStorage[c])?(a=this.localStorage[c].indexOf(n),-1!==a?this.localStorage[c].splice(a,1):this.localStorage[c].push(n)):this.localStorage[c]=new Array(n),this.setState()}return e.blur(),!1},showElement:function(s,a,e){s.addClass(this.buttonActiveClass),a.data("content-id",e),t(e,a).addClass(this.showClass)},hideElement:function(s){var a=s.data("content-id");t('[data-content-id="'+a+'"]',s).removeClass(this.buttonActiveClass),t(a,s).removeClass(this.showClass)},getState:function(){try{return JSON.parse(localStorage.getItem("interface-builder"))}catch(t){return!1}},setState:function(){try{localStorage.setItem("interface-builder",JSON.stringify(this.localStorage))}catch(t){return!1}}}},s.interfaceBuilder.init()}(jQuery,window.CherryJsCore);
cherry-framework/modules/cherry-interface-builder/inc/views/component-accordion.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Accordion template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <div class="cherry-ui-kit cherry-component cherry-accordion <?php echo $__data['class']; ?>" data-compotent-id="#<?php echo $__data['id'] ?>">
19
+ <?php if ( ! empty( $__data['title'] ) ) { ?>
20
+ <h2 class="cherry-ui-kit__title cherry-component__title" role="banner" ><?php echo $__data['title'] ?></h2>
21
+ <?php } ?>
22
+ <?php if ( ! empty( $__data['description'] ) ) { ?>
23
+ <div class="cherry-ui-kit__description cherry-component__description" role="note" ><?php echo $__data['description'] ?></div>
24
+ <?php } ?>
25
+ <?php if ( ! empty( $__data['children'] ) ) { ?>
26
+ <div class="cherry-ui-kit__content cherry-component__content cherry-accordion__content" role="group" >
27
+ <?php echo $__data['children'] ?>
28
+ </div>
29
+ <?php } ?>
30
+ </div>
cherry-framework/modules/cherry-interface-builder/inc/views/component-repeater.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Repeater template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <div class="cherry-ui-kit cherry-component cherry-repeater <?php echo $__data['class']; ?>" data-compotent-id="#<?php echo $__data['id']; ?>">
19
+ <?php if ( ! empty( $__data['title'] ) ) { ?>
20
+ <h2 class="cherry-ui-kit__title cherry-component__title" role="banner" ><?php echo $__data['title']; ?></h2>
21
+ <?php } ?>
22
+ <?php if ( ! empty( $__data['description'] ) ) { ?>
23
+ <div class="cherry-ui-kit__description cherry-component__description" role="note" ><?php echo $__data['description']; ?></div>
24
+ <?php } ?>
25
+ <?php if ( ! empty( $__data['children'] ) ) { ?>
26
+ <div class="cherry-ui-kit__content cherry-component__content" role="group" >
27
+ <?php echo $__data['children']; ?>
28
+ </div>
29
+ <?php } ?>
30
+ </div>
cherry-framework/modules/cherry-interface-builder/inc/views/component-tab-horizontal.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Horizontal tab template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <div class="cherry-ui-kit cherry-component cherry-tab cherry-tab--horizontal <?php echo $__data['class'] ?>" data-compotent-id="#<?php echo $__data['id'] ?>">
19
+ <?php if ( ! empty( $__data['title'] ) ) { ?>
20
+ <h2 class="cherry-ui-kit__title cherry-component__title" role="banner" ><?php echo $__data['title']; ?></h2>
21
+ <?php } ?>
22
+ <?php if ( ! empty( $__data['description'] ) ) { ?>
23
+ <div class="cherry-ui-kit__description cherry-component__description" role="note" ><?php echo $__data['description']; ?></div>
24
+ <?php } ?>
25
+ <?php if ( ! empty( $__data['children'] ) ) { ?>
26
+ <div class="cherry-tab__body" >
27
+ <div class="cherry-tab__tabs" role="navigation" >
28
+ <?php echo $__data['tabs']; ?>
29
+ </div>
30
+ <div class="cherry-ui-kit__content cherry-component__content cherry-tab__content" role="group" >
31
+ <?php echo $__data['children']; ?>
32
+ </div>
33
+ </div>
34
+ <?php } ?>
35
+ </div>
cherry-framework/modules/cherry-interface-builder/inc/views/component-tab-vertical.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Verticall tab template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <div class="cherry-ui-kit cherry-component cherry-tab cherry-tab--vertical <?php echo $__data['class']; ?>" data-compotent-id="#<?php echo $__data['id']; ?>">
19
+ <?php if ( ! empty( $__data['title'] ) ) { ?>
20
+ <h2 class="cherry-ui-kit__title cherry-component__title" role="banner" ><?php echo $__data['title']; ?></h2>
21
+ <?php } ?>
22
+ <?php if ( ! empty( $__data['description'] ) ) { ?>
23
+ <div class="cherry-ui-kit__description cherry-component__description" role="note" ><?php echo $__data['description']; ?></div>
24
+ <?php } ?>
25
+ <?php if ( ! empty( $__data['children'] ) ) { ?>
26
+ <div class="cherry-tab__body" >
27
+ <div class="cherry-tab__tabs" role="navigation" >
28
+ <?php echo $__data['tabs'] ?>
29
+ </div>
30
+ <div class="cherry-ui-kit__content cherry-component__content cherry-tab__content" role="group" >
31
+ <?php echo $__data['children']; ?>
32
+ </div>
33
+ </div>
34
+ <?php } ?>
35
+ </div>
cherry-framework/modules/cherry-interface-builder/inc/views/component-toggle.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toggle template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <div class="cherry-ui-kit cherry-component cherry-toggle <?php echo $__data['class']; ?>" data-compotent-id="#<?php echo $__data['id'] ?>">
19
+ <?php if ( ! empty( $__data['title'] ) ) { ?>
20
+ <h2 class="cherry-ui-kit__title cherry-component__title" role="banner" ><?php echo $__data['title']; ?></h2>
21
+ <?php } ?>
22
+ <?php if ( ! empty( $__data['description'] ) ) { ?>
23
+ <div class="cherry-ui-kit__description cherry-component__description" role="note" ><?php echo $__data['description']; ?></div>
24
+ <?php } ?>
25
+ <?php if ( ! empty( $__data['children'] ) ) { ?>
26
+ <div class="cherry-ui-kit__content cherry-component__content cherry-toggle__content" role="group" >
27
+ <?php echo $__data['children']; ?>
28
+ </div>
29
+ <?php } ?>
30
+ </div>
cherry-framework/modules/cherry-interface-builder/inc/views/control.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Control template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <div class="cherry-ui-kit cherry-control <?php echo $__data['class']; ?>">
19
+ <?php if ( ! empty( $__data['title'] ) || ! empty( $__data['description'] ) ) { ?>
20
+ <div class="cherry-control__info">
21
+ <?php if ( ! empty( $__data['title'] ) ) { ?>
22
+ <h4 class="cherry-ui-kit__title cherry-control__title" role="banner" ><?php echo $__data['title']; ?></h4>
23
+ <?php } ?>
24
+ <?php if ( ! empty( $__data['description'] ) ) { ?>
25
+ <div class="cherry-ui-kit__description cherry-control__description" role="note" ><?php echo $__data['description']; ?></div>
26
+ <?php } ?>
27
+ </div>
28
+ <?php } ?>
29
+ <?php if ( ! empty( $__data['children'] ) ) { ?>
30
+ <div class="cherry-ui-kit__content cherry-control__content" role="group" >
31
+ <?php echo $__data['children']; ?>
32
+ </div>
33
+ <?php } ?>
34
+ </div>
cherry-framework/modules/cherry-interface-builder/inc/views/form.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Form template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <form class="cherry-form <?php echo $__data['class']; ?>" id="<?php echo $__data['id']; ?>" name="<?php echo $__data['id']; ?>" <?php echo $__data['accept-charset'] . $__data['action'] . $__data['autocomplete'] . $__data['enctype'] . $__data['method'] . $__data['novalidate'] . $__data['target']; ?>>
19
+ <?php
20
+ if ( ! empty( $__data['children'] ) ) {
21
+ echo $__data['children'];
22
+ }
23
+ ?>
24
+ </form>
cherry-framework/modules/cherry-interface-builder/inc/views/html.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * HTML template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <div class="cherry-ui-kit <?php echo $__data['class']; ?>">
19
+ <?php if ( ! empty( $__data['children'] ) ) { ?>
20
+ <div class="cherry-ui-kit__content" role="group" >
21
+ <?php echo $__data['children']; ?>
22
+ </div>
23
+ <?php } ?>
24
+ </div>
cherry-framework/modules/cherry-interface-builder/inc/views/section.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Section template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <div class="cherry-ui-kit cherry-section <?php echo $__data['class']; ?>" onclick="void(0)">
19
+ <div class="cherry-section__holder">
20
+ <div class="cherry-section__inner">
21
+ <div class="cherry-section__info">
22
+ <?php if ( ! empty( $__data['title'] ) ) { ?>
23
+ <h1 class="cherry-ui-kit__title cherry-section__title" role="banner" ><?php echo $__data['title']; ?></h1>
24
+ <?php } ?>
25
+ <?php if ( ! empty( $__data['description'] ) ) { ?>
26
+ <div class="cherry-ui-kit__description cherry-section__description " role="note" ><?php echo $__data['description']; ?></div>
27
+ <?php } ?>
28
+ </div>
29
+ <?php if ( ! empty( $__data['children'] ) ) { ?>
30
+ <div class="cherry-ui-kit__content cherry-section__content" role="group" >
31
+ <?php echo $__data['children']; ?>
32
+ </div>
33
+ <?php } ?>
34
+ </div>
35
+ </div>
36
+ </div>
cherry-framework/modules/cherry-interface-builder/inc/views/settings-children-title.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings title template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <h3 class="cherry-ui-kit__title cherry-settings__title" role="banner" ><?php echo $__data['title']; ?></h3>
cherry-framework/modules/cherry-interface-builder/inc/views/settings.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <div class="cherry-ui-kit cherry-settings <?php echo $__data['class']; ?>">
19
+ <?php if ( ! empty( $__data['title'] ) ) {
20
+ echo $__data['title'];
21
+ } ?>
22
+ <?php if ( ! empty( $__data['children'] ) || ! empty( $__data['description'] ) ) { ?>
23
+ <div class="cherry-ui-kit__content cherry-settings__content" role="group" id="<?php echo $__data['id']; ?>" >
24
+ <?php if ( ! empty( $__data['description'] ) ) { ?>
25
+ <div class="cherry-ui-kit__description cherry-settings__description" role="note" ><?php echo $__data['description']; ?></div>
26
+ <?php } ?>
27
+ <?php if ( ! empty( $__data['children'] ) ) { ?>
28
+ <?php echo $__data['children']; ?>
29
+ <?php } ?>
30
+ </div>
31
+ <?php } ?>
32
+ </div>
cherry-framework/modules/cherry-interface-builder/inc/views/tab-children-title.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Tabs title template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <button class="cherry-tab__button cherry-component__button" role="button" title="<?php echo $__data['title']; ?>" aria-expanded="false" data-content-id="#<?php echo $__data['id'] ?>">
19
+ <h3 class="cherry-ui-kit__title cherry-tab__title" aria-grabbed="true" role="banner" ><?php echo $__data['title']; ?></h3>
20
+ </button>
cherry-framework/modules/cherry-interface-builder/inc/views/toggle-children-title.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toggle title template.
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+ ?>
18
+ <button class="cherry-toggle__header cherry-component__button" role="button" aria-expanded="false" data-content-id="#<?php echo $__data['id'] ?>">
19
+ <h3 class="cherry-ui-kit__title cherry-toggle__title" aria-grabbed="true" role="banner" ><?php echo $__data['title']; ?></h3>
20
+ <span class="dashicons dashicons-arrow-down hide-icon"></span>
21
+ <span class="dashicons dashicons-arrow-up show-icon"></span>
22
+ </button>
cherry-framework/modules/cherry-js-core/assets/js/cherry-js-core.js CHANGED
@@ -70,7 +70,7 @@ var CherryJsCore = {};
70
  expressions: {
71
  widget_ui_init: function() {
72
  $( document ).on( 'widget-added widget-updated', function( event, data ) {
73
- $( window ).trigger( {
74
  type: 'cherry-ui-elements-init',
75
  _target: data
76
  } );
@@ -92,61 +92,6 @@ var CherryJsCore = {};
92
  parent = parent[ parts[ i ] ];
93
  }
94
  return parent;
95
- },
96
- get_compress_assets: function( url, callback ) {
97
- var data = {
98
- action: 'get_compress_assets',
99
- security: CherryJsCore.variable.security,
100
- style: [],
101
- script: []
102
- },
103
- reg_name = /([\S.]+\/)/gmi,
104
- reg_type = /(\.js|\.css)/gmi,
105
- callback_function = callback || function() {};
106
-
107
- if( !$.isArray( url ) ){
108
- url = [ url ];
109
- }
110
-
111
- for( var index in url ){
112
- var file_url = url[ index ],
113
- file_name = file_url.replace( reg_name, '' ),
114
- file_type = file_url.match( reg_type )[ 0 ];
115
-
116
- if( '.js' === file_type && -1 === $.inArray( file_name, CherryJsCore.variable.loaded_assets.script ) ){
117
- data.script.push( file_url );
118
- CherryJsCore.variable.loaded_assets.script.push( file_name );
119
- }
120
-
121
- if( '.css' === file_type && -1 === $.inArray( file_name, CherryJsCore.variable.loaded_assets.style ) ){
122
- data.style.push( file_url );
123
- CherryJsCore.variable.loaded_assets.style.push( file_name );
124
- }
125
- }
126
-
127
- $.get( window.ajaxurl, data, function( response ) {
128
- var json = $.parseJSON(response),
129
- compressStyle = json.style,
130
- compressScript = json.script,
131
- script = null;
132
-
133
- if(compressStyle){
134
- var style = document.createElement('style');
135
-
136
- style.type = 'text/css';
137
- style.media = 'all';
138
- style.innerHTML = compressStyle;
139
-
140
- $('body', document).append(style);
141
-
142
- }
143
-
144
- if ( compressScript ) {
145
- script = new Function( compressScript ) ();
146
- }
147
-
148
- return callback_function();
149
- });
150
  }
151
  }
152
  };
70
  expressions: {
71
  widget_ui_init: function() {
72
  $( document ).on( 'widget-added widget-updated', function( event, data ) {
73
+ $( 'body' ).trigger( {
74
  type: 'cherry-ui-elements-init',
75
  _target: data
76
  } );
92
  parent = parent[ parts[ i ] ];
93
  }
94
  return parent;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  }
96
  }
97
  };
cherry-framework/modules/cherry-js-core/assets/js/min/cherry-js-core.min.js CHANGED
@@ -1 +1 @@
1
- var CherryJsCore={};!function(e){"use strict";CherryJsCore={name:"Cherry Js Core",version:"1.0.0",author:"Cherry Team",variable:{$document:e(document),$window:e(window),browser:e.browser,browser_supported:!0,security:window.cherry_ajax,loaded_assets:{script:window.wp_load_script,style:window.wp_load_style},ui_auto_init:"true"===window.ui_init_object.auto_init?!0:!1,ui_auto_target:window.ui_init_object.targets},status:{on_load:!1,is_ready:!1},init:function(){CherryJsCore.set_variable(),e(document).on("ready",CherryJsCore.ready),e(window).on("load",CherryJsCore.load)},set_variable:function(){CherryJsCore.variable.browser_supported=function(){var e=CherryJsCore.variable.browser,r={msie:[8]};for(var s in r)if("undefined"!==e.browser)for(var t in r[s])if(e.version<=r[s][t])return!1;return!0}()},ready:function(){CherryJsCore.status.is_ready=!0,CherryJsCore.expressions.widget_ui_init()},load:function(){CherryJsCore.status.on_load=!0},expressions:{widget_ui_init:function(){e(document).on("widget-added widget-updated",function(r,s){e(window).trigger({type:"cherry-ui-elements-init",_target:s})})}},utilites:{namespace:function(e){var r=e.split("."),s=CherryJsCore,t=r.length,i=0;for(i=0;t>i;i+=1)"undefined"==typeof s[r[i]]&&(s[r[i]]={}),s=s[r[i]];return s},get_compress_assets:function(r,s){var t={action:"get_compress_assets",security:CherryJsCore.variable.security,style:[],script:[]},i=/([\S.]+\/)/gim,o=/(\.js|\.css)/gim,a=s||function(){};e.isArray(r)||(r=[r]);for(var n in r){var d=r[n],u=d.replace(i,""),y=d.match(o)[0];".js"===y&&-1===e.inArray(u,CherryJsCore.variable.loaded_assets.script)&&(t.script.push(d),CherryJsCore.variable.loaded_assets.script.push(u)),".css"===y&&-1===e.inArray(u,CherryJsCore.variable.loaded_assets.style)&&(t.style.push(d),CherryJsCore.variable.loaded_assets.style.push(u))}e.get(window.ajaxurl,t,function(r){var s=e.parseJSON(r),t=s.style,i=s.script,o=null;if(t){var n=document.createElement("style");n.type="text/css",n.media="all",n.innerHTML=t,e("body",document).append(n)}return i&&(o=new Function(i)()),a()})}}},CherryJsCore.init()}(jQuery);
1
+ var CherryJsCore={};!function(r){"use strict";CherryJsCore={name:"Cherry Js Core",version:"1.0.0",author:"Cherry Team",variable:{$document:r(document),$window:r(window),browser:r.browser,browser_supported:!0,security:window.cherry_ajax,loaded_assets:{script:window.wp_load_script,style:window.wp_load_style},ui_auto_init:"true"===window.ui_init_object.auto_init?!0:!1,ui_auto_target:window.ui_init_object.targets},status:{on_load:!1,is_ready:!1},init:function(){CherryJsCore.set_variable(),r(document).on("ready",CherryJsCore.ready),r(window).on("load",CherryJsCore.load)},set_variable:function(){CherryJsCore.variable.browser_supported=function(){var r=CherryJsCore.variable.browser,e={msie:[8]};for(var i in e)if("undefined"!==r.browser)for(var o in e[i])if(r.version<=e[i][o])return!1;return!0}()},ready:function(){CherryJsCore.status.is_ready=!0,CherryJsCore.expressions.widget_ui_init()},load:function(){CherryJsCore.status.on_load=!0},expressions:{widget_ui_init:function(){r(document).on("widget-added widget-updated",function(e,i){r("body").trigger({type:"cherry-ui-elements-init",_target:i})})}},utilites:{namespace:function(r){var e=r.split("."),i=CherryJsCore,o=e.length,t=0;for(t=0;o>t;t+=1)"undefined"==typeof i[e[t]]&&(i[e[t]]={}),i=i[e[t]];return i}}},CherryJsCore.init()}(jQuery);
cherry-framework/modules/cherry-page-builder/assets/css/min/page-settings.min.css DELETED
@@ -1,18 +0,0 @@
1
- .cherry-settings-page .description:after { content: ' '; clear: both; height: 10px; width: 100%; }
2
-
3
- .notice-box { background: #222222; position: fixed; margin: 5px 0; border-left: 5px solid #2a445d; box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3); box-sizing: border-box; padding: 15px 20px 15px 15px; min-width: 200px; overflow: hidden; z-index: 999; -webkit-transition: all 250ms cubic-bezier(0.85, 0.04, 1, 1); transition: all 250ms cubic-bezier(0.85, 0.04, 1, 1); }
4
- .notice-box span.dashicons { position: relative; margin-right: 20px; }
5
- .notice-box span.dashicons:before { position: absolute; font-size: 40px; left: -10px; top: -10px; }
6
- .notice-box.success-notice { border-color: #8bc735; }
7
- .notice-box.success-notice span.dashicons { color: #8bc735; }
8
- .notice-box.success-notice span.dashicons:before { content: "\f147"; }
9
- .notice-box.success-notice .inner b { color: #8bc735; }
10
- .notice-box.info-notice { border-color: #ffcc00; }
11
- .notice-box.info-notice span.dashicons { color: #ffcc00; }
12
- .notice-box.info-notice span.dashicons:before { content: "\f348"; }
13
- .notice-box.info-notice .inner b { color: #ffcc00; }
14
- .notice-box.error-notice { border-color: #f62e46; }
15
- .notice-box.error-notice span.dashicons { color: #f62e46; }
16
- .notice-box.error-notice span.dashicons:before { content: "\f158"; }
17
- .notice-box.show-state { -webkit-transition: all 500ms cubic-bezier(0.1, 0.67, 0.26, 1); transition: all 500ms cubic-bezier(0.1, 0.67, 0.26, 1); }
18
- .notice-box .inner { display: inline-block; color: #fff; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-page-builder/assets/js/min/page-settings.min.js DELETED
@@ -1 +0,0 @@
1
- !function(e){"use strict";window.CherryJsCore.utilites.namespace("page_builder"),window.CherryJsCore.page_builder={init:function(){var e=this;e.tabs(".cherry-settings-tabs").saveEvent(".cherry-settings-tabs form")},tabs:function(e){return jQuery(e+" .tabs-section a").each(function(t){var s=jQuery(this),i=s.attr("href");t?jQuery(e+" .section"+i).hide():s.addClass("nav-tab-active")}),jQuery(e+" .tabs-section a").on("click",function(t){var s=jQuery(this),i=s.attr("href");jQuery(e+" .section").hide(),jQuery(e+" .section"+i).show(),jQuery(e+" .tabs-section a").removeClass("nav-tab-active"),s.addClass("nav-tab-active"),t.preventDefault()}),this},saveEvent:function(e){var t=this;return jQuery(e).submit(function(e){var s=jQuery(this);s.ajaxSubmit({success:function(){t.noticeCreate("success",window.TMRealEstateMessage.success)},error:function(){t.noticeCreate("failed",window.TMRealEstateMessage.failed)},timeout:5e3}),e.preventDefault()}),this},noticeCreate:function(t,s){function i(){var t=100;e(".notice-box").each(function(){e(this).css({top:t}),t+=e(this).outerHeight(!0)})}var a,n=e('<div class="notice-box '+t+'-notice"><span class="dashicons"></span><div class="inner">'+s+"</div></div>"),r=0;return jQuery("body").prepend(n),i(),r=-1*(n.outerWidth(!0)+10),n.css({right:r}),a=setTimeout(function(){n.css({right:10}).addClass("show-state")},100),a=setTimeout(function(){r=-1*(n.outerWidth(!0)+10),n.css({right:r}).removeClass("show-state")},4e3),a=setTimeout(function(){n.remove(),clearTimeout(a)},4500),this}},window.CherryJsCore.page_builder.init()}(jQuery);
 
cherry-framework/modules/cherry-page-builder/assets/js/page-settings.js DELETED
@@ -1,92 +0,0 @@
1
- /**
2
- * Page settings
3
- */
4
- (function( $ ) {
5
- 'use strict';
6
-
7
- window.CherryJsCore.utilites.namespace( 'page_builder' );
8
- window.CherryJsCore.page_builder = {
9
-
10
- init: function() {
11
- var self = this;
12
- self.tabs( '.cherry-settings-tabs' ).saveEvent( '.cherry-settings-tabs form' );
13
- },
14
-
15
- tabs: function( selectors ) {
16
- jQuery( selectors + ' .tabs-section a' ).each( function( index ) {
17
- var $this = jQuery( this );
18
- var id = $this.attr( 'href' );
19
- if ( ! index ) {
20
- $this.addClass( 'nav-tab-active' );
21
- } else {
22
- jQuery( selectors + ' .section' + id ).hide();
23
- }
24
- });
25
- jQuery( selectors + ' .tabs-section a' ).on( 'click', function( e ) {
26
- var $this = jQuery( this );
27
- var id = $this.attr( 'href' );
28
- jQuery( selectors + ' .section' ).hide();
29
- jQuery( selectors + ' .section' + id ).show();
30
- jQuery( selectors + ' .tabs-section a' ).removeClass( 'nav-tab-active' );
31
- $this.addClass( 'nav-tab-active' );
32
- e.preventDefault();
33
- });
34
- return this;
35
- },
36
-
37
- saveEvent: function( selectors ) {
38
- var self = this;
39
- jQuery( selectors ).submit( function( e ) {
40
- var $this = jQuery( this );
41
- $this.ajaxSubmit({
42
- success: function() {
43
- self.noticeCreate( 'success', window.TMRealEstateMessage.success );
44
- },
45
- error: function() {
46
- self.noticeCreate( 'failed', window.TMRealEstateMessage.failed );
47
- },
48
- timeout: 5000
49
- });
50
-
51
- e.preventDefault();
52
- });
53
- return this;
54
- },
55
-
56
- noticeCreate: function( type, message ) {
57
- var
58
- notice = $( '<div class="notice-box ' + type + '-notice"><span class="dashicons"></span><div class="inner">' + message + '</div></div>' ),
59
- rightDelta = 0,
60
- timeoutId;
61
-
62
- jQuery( 'body' ).prepend( notice );
63
- reposition();
64
- rightDelta = -1 * ( notice.outerWidth( true ) + 10 );
65
- notice.css( { 'right': rightDelta } );
66
-
67
- timeoutId = setTimeout( function() {
68
- notice.css( { 'right': 10 } ).addClass( 'show-state' );
69
- }, 100 );
70
- timeoutId = setTimeout( function() {
71
- rightDelta = -1 * ( notice.outerWidth( true ) + 10 );
72
- notice.css( { right: rightDelta } ).removeClass( 'show-state' );
73
- }, 4000 );
74
- timeoutId = setTimeout( function() {
75
- notice.remove();
76
- clearTimeout( timeoutId );
77
- }, 4500 );
78
-
79
- function reposition() {
80
- var
81
- topDelta = 100;
82
- $( '.notice-box' ).each(function() {
83
- $( this ).css( { top: topDelta } );
84
- topDelta += $( this ).outerHeight( true );
85
- });
86
- }
87
- return this;
88
- }
89
- };
90
-
91
- window.CherryJsCore.page_builder.init();
92
- }( jQuery ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-page-builder/assets/scss/page-setting.scss DELETED
@@ -1,80 +0,0 @@
1
- .cherry-settings-page {
2
- .description {
3
- &:after {
4
- content: ' ';
5
- clear: both;
6
- height: 10px;
7
- width: 100%;
8
- }
9
- }
10
- }
11
-
12
- .notice-box{
13
- background: #222222;
14
- position: fixed;
15
- margin: 5px 0;
16
- border-left: 5px solid #2a445d;
17
- box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3);
18
- box-sizing: border-box;
19
- padding: 15px 20px 15px 15px;
20
- min-width: 200px;
21
- overflow: hidden;
22
- z-index: 999;
23
- -webkit-transition: all 250ms cubic-bezier(0.85, 0.04, 1, 1);
24
- transition: all 250ms cubic-bezier(0.85, 0.04, 1, 1);
25
- span.dashicons{
26
- position: relative;
27
- margin-right: 20px;
28
- &:before{
29
- position: absolute;
30
- font-size: 40px;
31
- left: -10px;
32
- top: -10px;
33
- }
34
- }
35
- &.success-notice{
36
- border-color: #8bc735;
37
- span.dashicons{
38
- color: #8bc735;
39
- &:before{
40
- content: "\f147";
41
- }
42
- }
43
- .inner{
44
- b{
45
- color: #8bc735;
46
- }
47
- }
48
- }
49
- &.info-notice{
50
- border-color: #ffcc00;
51
- span.dashicons{
52
- color: #ffcc00;
53
- &:before{
54
- content: "\f348";
55
- }
56
- }
57
- .inner{
58
- b{
59
- color: #ffcc00;
60
- }
61
- }
62
- }
63
- &.error-notice{
64
- border-color: #f62e46;
65
- span.dashicons{
66
- color: #f62e46;
67
- &:before{
68
- content: "\f158";
69
- }
70
- }
71
- }
72
- &.show-state{
73
- -webkit-transition: all 500ms cubic-bezier(0.1, 0.67, 0.26, 1);
74
- transition: all 500ms cubic-bezier(0.1, 0.67, 0.26, 1);
75
- }
76
- .inner{
77
- display: inline-block;
78
- color: #fff;
79
- }
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-page-builder/cherry-page-builder.php DELETED
@@ -1,406 +0,0 @@
1
- <?php
2
- /**
3
- * Module Name: Page Builder
4
- * Description: Provides functionality for building custom options pages
5
- * Version: 1.1.0
6
- * Author: Cherry Team
7
- * Author URI: http://www.cherryframework.com/
8
- * License: GPLv3
9
- * License URI: http://www.gnu.org/licenses/gpl-3.0.html
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
- */
19
-
20
- // If this file is called directly, abort.
21
- if ( ! defined( 'WPINC' ) ) {
22
- die;
23
- }
24
-
25
- if ( ! class_exists( 'Cherry_Page_Builder' ) ) {
26
-
27
- /**
28
- * Create options page
29
- */
30
- class Cherry_Page_Builder {
31
-
32
- /**
33
- * Module version
34
- *
35
- * @var string
36
- */
37
- public $module_version = '1.1.0';
38
-
39
- /**
40
- * Module slug
41
- *
42
- * @var string
43
- */
44
- public $module_slug = 'cherry-page-builder';
45
-
46
- /**
47
- * Module arguments
48
- *
49
- * @var array
50
- */
51
- public $args = array();
52
-
53
- /**
54
- * Page data
55
- *
56
- * @var array
57
- */
58
- public $data = array();
59
-
60
- /**
61
- * Core instance
62
- *
63
- * @var object
64
- */
65
- public $core = null;
66
-
67
- /**
68
- * Current nonce name to check
69
- *
70
- * @var string
71
- */
72
- public $nonce = 'cherry-admin-menu-nonce';
73
-
74
- /**
75
- * The page properties.
76
- *
77
- * @var DataContainer
78
- */
79
- public $views;
80
-
81
- /**
82
- * The page sections.
83
- *
84
- * @var array
85
- */
86
- protected $sections;
87
-
88
- /**
89
- * The page settings.
90
- *
91
- * @var array
92
- */
93
- protected $settings;
94
-
95
- /**
96
- * Constructor for the module
97
- */
98
- function __construct( $core, $args = array() ) {
99
-
100
- $this->core = $core;
101
- $this->args = wp_parse_args(
102
- $args,
103
- array(
104
- 'capability' => 'manage_options',
105
- 'position' => 20,
106
- 'icon' => 'dashicons-admin-site',
107
- 'sections' => array(),
108
- 'settings' => array(),
109
- 'before' => '',
110
- 'after' => '',
111
- 'before_button' => '',
112
- 'after_button' => '',
113
- )
114
- );
115
-
116
- $this->views = __DIR__ . '/views/';
117
- add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) );
118
- }
119
-
120
- /**
121
- * Add admin menu page
122
- */
123
- function add_admin_page() {
124
- $page = $this->make( $this->args['slug'], $this->args['title'], $this->args['parent'], $this->args['views'] )->set(
125
- array(
126
- 'capability' => $this->args['capability'],
127
- 'icon' => $this->args['icon'],
128
- 'position' => $this->args['position'],
129
- 'tabs' => $this->args['tabs'],
130
- 'sections' => $this->args['sections'],
131
- 'settings' => $this->args['settings'],
132
- )
133
- );
134
- $page->add_sections( $this->args['sections'] );
135
- $page->add_settings( $this->args['settings'] );
136
- }
137
-
138
- /**
139
- * Set base data of page
140
- *
141
- * @param type string $slug The page slug name.
142
- * @param type string $title The page display title.
143
- * @param type string $parent The parent's page slug if a subpage.
144
- *
145
- * @return object
146
- */
147
- public function make( $slug, $title, $parent = null ) {
148
- $page = new Cherry_Page_Builder( $this->core, $this->args );
149
-
150
- // Set the page properties.
151
- $page->data['slug'] = $slug;
152
- $page->data['title'] = $title;
153
- $page->data['parent'] = $parent;
154
- $page->data['args'] = array(
155
- 'capability' => 'manage_options',
156
- 'icon' => '',
157
- 'position' => null,
158
- 'tabs' => true,
159
- 'menu' => $title,
160
- );
161
- $page->data['rules'] = array();
162
-
163
- return $page;
164
- }
165
-
166
- /**
167
- * Set the custom page. Allow user to override
168
- * the default page properties and add its own
169
- * properties.
170
- *
171
- * @param array $params Base parameter.
172
- * @return object
173
- */
174
- public function set( array $params = array() ) {
175
- $this->args = $params;
176
-
177
- $this->add_sections( $params['sections'] );
178
- $this->add_settings( $params['settings'] );
179
-
180
- add_action( 'admin_menu', array( $this, 'build' ) );
181
-
182
- return $this;
183
- }
184
-
185
- /**
186
- * Triggered by the 'admin_menu' action event.
187
- * Register/display the custom page in the WordPress admin.
188
- *
189
- * @return void
190
- */
191
- public function build() {
192
- if ( ! is_null( $this->data['parent'] ) ) {
193
- add_submenu_page( $this->data['parent'], $this->data['title'], $this->data['args']['menu'], $this->data['args']['capability'], $this->data['slug'], array( $this, 'render' ) );
194
- } else {
195
- add_menu_page( $this->data['title'], $this->data['args']['menu'], $this->data['args']['capability'], $this->data['slug'], array( $this, 'render' ), $this->data['args']['icon'], $this->args['position'] );
196
- }
197
- }
198
-
199
- /**
200
- * Triggered by the 'add_menu_page' or 'add_submenu_page'.
201
- *
202
- * @return void
203
- */
204
- public function render() {
205
- $title = ! empty( $this->data['title'] ) ? $this->data['title'] : '';
206
- $page_slug = ! empty( $this->data['slug'] ) ? $this->data['slug'] : '';
207
- $page_before = ! empty( $this->args['before'] ) ? $this->args['before'] : '';
208
- $page_after = ! empty( $this->args['after'] ) ? $this->args['after'] : '';
209
- $button_before = ! empty( $this->args['button_before'] ) ? $this->args['button_before'] : '';
210
- $button_after = ! empty( $this->args['button_after'] ) ? $this->args['button_after'] : '';
211
- $sections = ( ! empty( $this->sections ) && is_array( $this->sections ) ) ? $this->sections : array();
212
-
213
- $html = Cherry_Toolkit::render_view(
214
- $this->views . 'page.php',
215
- array(
216
- 'title' => $title,
217
- 'page_slug' => $page_slug,
218
- 'page_before' => $page_before,
219
- 'page_after' => $page_after,
220
- 'button_before' => $button_before,
221
- 'button_after' => $button_after,
222
- 'sections' => $sections,
223
- )
224
- );
225
-
226
- echo $html;
227
- }
228
-
229
- /**
230
- * Add custom sections for your settings.
231
- *
232
- * @param array $sections List of sections.
233
- * @return void
234
- */
235
- public function add_sections( array $sections = array() ) {
236
- $this->sections = $sections;
237
- }
238
-
239
- /**
240
- * Check if the page has sections.
241
- *
242
- * @return bool
243
- */
244
- public function has_sections() {
245
- return count( $this->sections ) ? true : false;
246
- }
247
-
248
- /**
249
- * Check if the page has settings.
250
- *
251
- * @return bool
252
- */
253
- public function has_settings() {
254
- return count( $this->settings ) ? true : false;
255
- }
256
-
257
- /**
258
- * Add settings to the page. Define settings per section
259
- * by setting the 'key' name equal to a registered section and
260
- * pass it an array of 'settings' fields.
261
- *
262
- * @param array $settings The page settings.
263
- * @return object
264
- */
265
- public function add_settings( array $settings = array() ) {
266
- $this->settings = $settings;
267
-
268
- add_action( 'admin_init', array( $this, 'install_settings' ) );
269
-
270
- return $this;
271
- }
272
-
273
- /**
274
- * Triggered by the 'admin_init' action.
275
- * Perform the WordPress settings API.
276
- *
277
- * @return void
278
- */
279
- public function install_settings() {
280
- if ( $this->has_sections() ) {
281
- foreach ( $this->sections as $section ) {
282
- if ( false === get_option( $section['slug'] ) ) {
283
- add_option( $section['slug'] );
284
- }
285
- add_settings_section( $section['slug'], $section['name'], array( $this, 'display_sections' ), $section['slug'] );
286
- }
287
- }
288
-
289
- if ( $this->has_settings() ) {
290
- foreach ( $this->settings as $section => $settings ) {
291
- foreach ( $settings as &$setting ) {
292
- $setting['section'] = $section;
293
- add_settings_field( $setting['slug'], $setting['title'], array( $this, 'display_settings' ), $section, $section, $setting );
294
- }
295
- register_setting( $section, $section );
296
- }
297
- }
298
- }
299
-
300
- /**
301
- * Clear sections
302
- */
303
- public function clear_sections() {
304
- if ( $this->has_sections() ) {
305
- foreach ( $this->sections as $section ) {
306
- delete_option( $section['slug'] );
307
- }
308
- }
309
- }
310
-
311
- /**
312
- * Handle section display of the Settings API.
313
- *
314
- * @param array $args Page parameter.
315
- * @return void
316
- */
317
- public function display_sections( array $args ) {
318
- $description = '';
319
- if ( ! empty( $this->sections[ $args['id'] ] ) ) {
320
- if ( ! empty( $this->sections[ $args['id'] ]['description'] ) ) {
321
- $description = $this->sections[ $args['id'] ]['description'];
322
- }
323
- }
324
-
325
- $html = Cherry_Toolkit::render_view(
326
- $this->views . 'section.php',
327
- array(
328
- 'description' => $description,
329
- )
330
- );
331
- echo $html;
332
- }
333
-
334
- /**
335
- * Handle setting display of the Settings API.
336
- *
337
- * @param array $setting Fields setting.
338
- * @return void
339
- */
340
- public function display_settings( $setting ) {
341
-
342
- // Check if a registered value exists.
343
- $value = get_option( $setting['section'] );
344
-
345
- if ( isset( $value[ $setting['slug'] ] ) ) {
346
- $setting['field']['value'] = $value[ $setting['slug'] ];
347
- } else {
348
- $setting['field']['value'] = '';
349
- }
350
-
351
- // Set the name attribute.
352
- $setting['field']['name'] = $setting['section'] . '[' . $setting['slug'] . ']';
353
-
354
- if ( isset( $setting['custom_callback'] ) && is_callable( $setting['custom_callback'] ) ) {
355
- echo call_user_func( $setting['custom_callback'], $setting['field'] );
356
-
357
- } else if ( class_exists( 'UI_' . ucfirst( $setting['type'] ) ) ) {
358
- $ui_class = 'UI_' . ucfirst( $setting['type'] );
359
- $ui_element = new $ui_class( $setting['field'] );
360
-
361
- // Display the field.
362
- echo $ui_element->render();
363
- }
364
- }
365
-
366
- /**
367
- * Add styles and scripts
368
- *
369
- * @return void
370
- */
371
- public function assets() {
372
- wp_enqueue_script( 'jquery-form' );
373
-
374
- wp_localize_script( 'cherry-settings-page', 'TMRealEstateMessage', array(
375
- 'success' => 'Successfully',
376
- 'failed' => 'Failed',
377
- ) );
378
-
379
- wp_enqueue_script(
380
- 'cherry-settings-page',
381
- Cherry_Core::base_url( 'assets/js/min/page-settings.min.js', __FILE__ ),
382
- array( 'jquery' ),
383
- '0.2.0',
384
- true
385
- );
386
-
387
- wp_enqueue_style(
388
- 'cherry-settings-page',
389
- Cherry_Core::base_url( 'assets/css/min/page-settings.min.css', __FILE__ ),
390
- array(),
391
- '0.1.0',
392
- 'all'
393
- );
394
- }
395
-
396
- /**
397
- * Returns the instance.
398
- *
399
- * @since 1.0.0
400
- * @return object
401
- */
402
- public static function get_instance( $core, $args ) {
403
- return new self( $core, $args );
404
- }
405
- }
406
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-page-builder/views/page.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
- /**
3
- * View for options page
4
- *
5
- * @package TM Real Estate
6
- * @author Guriev Eugen & Sergyj Osadchij
7
- * @license GPL-2.0+
8
- */
9
- ?>
10
- <div class="wrap cherry-settings-page">
11
- <h2><?php echo $__data['title'] ?></h2>
12
- <?php if ( ! empty( $__data['page_before'] ) ) : ?>
13
- <div class="description"><?php echo $__data['page_before'] ?></div>
14
- <?php endif; ?>
15
- <?php if ( ! empty( $__data['sections'] ) && is_array( $__data['sections'] ) ) : ?>
16
- <div class="cherry-settings-tabs">
17
- <h2 class="nav-tab-wrapper tabs-section">
18
- <?php foreach ( $__data['sections'] as $section_slug => $section ) : ?>
19
- <a href="#<?php echo $section_slug ?>" class="nav-tab"><?php echo $section['name'] ?></a>
20
- <?php endforeach; ?>
21
- </h2>
22
-
23
- <?php foreach ( $__data['sections'] as $section_slug => $section ) : ?>
24
- <div id="<?php echo $section_slug ?>" class="section">
25
- <form method="POST" action="options.php" id="form-<?php echo $section_slug ?>">
26
- <?php settings_fields( $section_slug ); ?>
27
- <?php do_settings_sections( $section_slug ); ?>
28
-
29
- <?php if ( ! empty( $__data['button_before'] ) ) : ?>
30
- <?php echo $__data['button_before'] ?>
31
- <?php endif; ?>
32
-
33
- <?php submit_button( 'Save ' . $section['name'], 'primary small', null, true, array( 'data-ajax' => true ) ); ?>
34
-
35
- <?php if ( ! empty( $__data['button_after'] ) ) : ?>
36
- <?php echo $__data['button_after'] ?>
37
- <?php endif; ?>
38
- </form>
39
- </div>
40
- <?php endforeach; ?>
41
- </div>
42
- <?php endif; ?>
43
- <?php if ( ! empty( $__data['page_after'] ) ) : ?>
44
- <div class="description"><?php echo $__data['page_after'] ?></div>
45
- <?php endif; ?>
46
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-page-builder/views/section.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- /**
3
- * View for section of settings
4
- *
5
- * @package TM Real Estate
6
- * @author Guriev Eugen & Sergyj Osadchij
7
- * @license GPL-2.0+
8
- */
9
- ?>
10
- <div class="description"><?php echo $__data['description'] ?></div>
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-plugin-updater/cherry-plugin-updater.php DELETED
@@ -1,143 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * Module Name: Plugin Updater
5
- * Description: Provides functionality for updating plugins
6
- * Version: 1.1.0
7
- * Author: Cherry Team
8
- * Author URI: http://www.cherryframework.com/
9
- * License: GPLv3
10
- * License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
- *
12
- * @package Cherry_Framework
13
- * @subpackage Modules
14
- * @version 1.1.0
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
- */
20
-
21
- // If this file is called directly, abort.
22
- if ( ! defined( 'WPINC' ) ) {
23
- die;
24
- }
25
-
26
- if ( ! class_exists( 'Cherry_Plugin_Updater' ) ) {
27
- require_once( '/inc/cherry-base-updater.php' );
28
-
29
- /**
30
- * Define plugin updater class.
31
- *
32
- * @since 1.0.0
33
- */
34
- class Cherry_Plugin_Updater extends Cherry_Base_Updater {
35
- /**
36
- * Updater settings.
37
- *
38
- * @var array
39
- */
40
- protected $settings = array();
41
-
42
- /**
43
- * A reference to an instance of this class.
44
- *
45
- * @since 1.0.0
46
- * @var object
47
- */
48
- private static $instance = null;
49
-
50
- /**
51
- * Init class parameters.
52
- *
53
- * @since 1.0.0
54
- * @param object $core Core of framework.
55
- * @param array $args Argument of base init.
56
- * @return void
57
- */
58
- public function __construct( $core, $args = array() ) {
59
- $this->base_init( $args );
60
-
61
- /**
62
- * Need for test update - set_site_transient( 'update_plugins', null );
63
- */
64
- add_action( 'pre_set_site_transient_update_plugins', array( $this, 'update' ) );
65
- add_filter( 'upgrader_source_selection', array( $this, 'rename_github_folder' ), 11, 3 );
66
- add_action( 'admin_footer', array( $this, 'change_details_url' ) );
67
- }
68
-
69
- /**
70
- * Process update.
71
- *
72
- * @since 1.0.0
73
- * @param object $data Update data.
74
- * @return object
75
- */
76
- public function update( $data ) {
77
- $new_update = $this->check_update();
78
-
79
- if ( $new_update['version'] ) {
80
- $this->settings['plugin'] = $this->settings['slug'] . '/' . $this->settings['slug'] . '.php';
81
-
82
- $update = new stdClass();
83
-
84
- $update->slug = $this->settings['slug'];
85
- $update->plugin = $this->settings['plugin'];
86
- $update->new_version = $new_update['version'];
87
- $update->url = $this->settings['details_url'];
88
- $update->package = $new_update['package'];
89
-
90
- $data->response[ $this->settings['plugin'] ] = $update;
91
-
92
- }
93
-
94
- return $data;
95
- }
96
-
97
- /**
98
- * Change plugin detail URL.
99
- *
100
- * @since 1.0.0
101
- * @return void
102
- */
103
- public function change_details_url() {
104
- global $change_details_plugin_url_script, $pagenow;
105
-
106
- $plugins = get_plugin_updates();
107
-
108
- if ( ! $change_details_plugin_url_script && in_array( $pagenow, array( 'update-core.php', 'plugins.php' ) ) && ! empty( $plugins ) ) {
109
-
110
- $plugins_string = '';
111
-
112
- foreach ( $plugins as $plugin_key => $plugin_value ) {
113
- $plugin_key = strtolower( $plugin_key );
114
- if ( strpos( $plugin_key, 'cherry' ) !== false ) {
115
- $plugins_string .= '"' . $plugin_value ->update ->slug . '" : "' . $plugin_value ->update ->url .'", ';
116
- }
117
- }
118
-
119
- ?>
120
- <script>
121
- ( function( $ ){
122
- var plugin_updates = {<?php echo $plugins_string; ?>};
123
- for ( var plugin in plugin_updates ) {
124
- $('[href*="' + plugin + '"].thickbox').removeClass('thickbox').attr( {'href': plugin_updates[plugin], 'target' : "_blank" } );
125
- };
126
- }( jQuery ) )
127
- </script>
128
- <?php
129
- }
130
-
131
- $change_details_plugin_url_script = true;
132
- }
133
- /**
134
- * Returns the instance.
135
- *
136
- * @since 1.0.0
137
- * @return object
138
- */
139
- public static function get_instance( $core, $args ) {
140
- return new self( $core, $args );
141
- }
142
- }
143
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-plugin-updater/inc/cherry-base-updater.php DELETED
@@ -1,156 +0,0 @@
1
- <?php
2
- /**
3
- * Class for the base update.
4
- *
5
- * @package Cherry_Base_Updater
6
- * @subpackage Base_Update
7
- * @author Cherry Team <support@cherryframework.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
- */
12
-
13
- // If this file is called directly, abort.
14
- if ( ! defined( 'WPINC' ) ) {
15
- die;
16
- }
17
-
18
- if ( ! class_exists( 'Cherry_Base_Updater' ) ) {
19
-
20
- /**
21
- * Test definitions to allow alpha and beta updates
22
- *
23
- * Disable updates - define('CHERRY_UPDATE', false);
24
- * Enable auto updates - define('CHERRY_ALPHA_UPDATE', true);
25
- * Enable beta updates - define('CHERRY_BETA_UPDATE', true);
26
- */
27
-
28
- /**
29
- * Base updater class.
30
- *
31
- * @since 4.0.0
32
- */
33
- class Cherry_Base_Updater {
34
-
35
- /**
36
- * Default Settings.
37
- *
38
- * @since 4.0.0
39
- * @access protected
40
- * @var array
41
- */
42
- protected $default_settings = array(
43
- 'version' => '',
44
- 'slug' => '',
45
- 'cloud_url' => 'https://cloud.cherryframework.com/cherry-update/',
46
- 'product_name' => 'CherryFramework',
47
- 'repository_name' => '',
48
- );
49
-
50
- /**
51
- * Init class parameters.
52
- *
53
- * @since 4.0.0
54
- * @param array $settings Settings array.
55
- * @return void
56
- */
57
- protected function base_init( $settings = array() ) {
58
- $this->settings = array_merge( $this->default_settings, $settings );
59
- }
60
-
61
- /**
62
- * Check if update are avaliable.
63
- *
64
- * @since 4.0.0
65
- * @return array
66
- */
67
- protected function check_update() {
68
- $args = array(
69
- 'user-agent' => 'WordPress',
70
- 'github_repository' => $this->settings['product_name'] . '/' . $this->settings['repository_name'],
71
- 'current_version' => $this->settings['version'],
72
- 'up_query_limit' => false,
73
- 'get_alpha' => false,
74
- 'get_beta' => false,
75
- );
76
-
77
- if ( defined( 'CHERRY_ALPHA_UPDATE' ) ) {
78
- $args['get_alpha'] = true;
79
- }
80
-
81
- if ( defined( 'CHERRY_BETA_UPDATE' ) ) {
82
- $args['get_beta'] = true;
83
- }
84
-
85
- if ( defined( 'CHERRY_UP_QUERY_LIMIT' ) ) {
86
- $args['up_query_limit'] = true;
87
- }
88
-
89
- $response = $this -> remote_query( $args );
90
-
91
- if ( $response && 'not_update' !== $response ) {
92
- $this->settings['details_url'] = $response->details_url;
93
- return array( 'version' => $response->new_version, 'package' => $response->package );
94
- }
95
-
96
- return array( 'version' => false );
97
- }
98
-
99
- /**
100
- * Remote request to updater API.
101
- *
102
- * @since 4.0.0
103
- * @param array $args Request paprams.
104
- * @return array|bool
105
- */
106
- protected function remote_query( $args ) {
107
- $query = add_query_arg( $args, $this->settings['cloud_url'] );
108
-
109
- $response = wp_remote_get( $query );
110
-
111
- if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != '200' ) {
112
- return false;
113
- }
114
-
115
- $response = json_decode( $response['body'] );
116
-
117
- return $response;
118
- }
119
-
120
- /**
121
- * Rename github folder on update.
122
- *
123
- * @since 4.0.0
124
- * @param [type] $upgrate_dir Theme folder name.
125
- * @param [type] $remote_dir Remote folder name.
126
- * @param object $skin_upgrader Upgrader object instance.
127
- * @return string
128
- */
129
- public function rename_github_folder( $upgrate_dir, $remote_dir, $skin_upgrader ) {
130
-
131
- $slug = $this->settings['slug'];
132
- $is_theme = isset( $skin_upgrader->skin->theme ) || isset( $skin_upgrader->skin->theme_info ) ? true : false ;
133
- $is_plugin = isset( $skin_upgrader->skin->plugin_info ) ? true : false ;
134
- $domain_plugin = $is_plugin ? $skin_upgrader->skin->plugin_info['TextDomain'] : '' ;
135
- $title_plugin = $is_plugin ? str_replace( ' ', '-', strtolower( $skin_upgrader->skin->plugin_info['Title'] ) ) : '' ;
136
- $name_plugin = $is_plugin ? str_replace( ' ', '-', strtolower( $skin_upgrader->skin->plugin_info['Name'] ) ) : '' ;
137
-
138
- if ( $is_theme && strpos( $upgrate_dir, $slug ) !== false
139
- || $is_plugin && $domain_plugin === $slug
140
- || $is_plugin && $title_plugin === $slug
141
- || $is_plugin && $name_plugin === $slug
142
- ) {
143
- $upgrate_dir_path = pathinfo( $upgrate_dir );
144
- $new_upgrate_dir = trailingslashit( $upgrate_dir_path['dirname'] ) . trailingslashit( $slug );
145
-
146
- rename( $upgrate_dir, $new_upgrate_dir );
147
-
148
- $upgrate_dir = $new_upgrate_dir;
149
-
150
- remove_filter( 'upgrader_source_selection', array( $this, 'rename_github_folder' ), 11, 3 );
151
- }
152
-
153
- return $upgrate_dir;
154
- }
155
- }
156
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-post-formats-api/cherry-post-formats-api.php CHANGED
@@ -3,7 +3,7 @@
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.0
7
  * Author: Cherry Team
8
  * Author URI: http://www.cherryframework.com/
9
  * License: GPLv3
@@ -11,7 +11,7 @@
11
  *
12
  * @package Cherry_Framework
13
  * @subpackage Modules
14
- * @version 1.1.0
15
  * @author Cherry Team <cherryframework@gmail.com>
16
  * @copyright Copyright (c) 2012 - 2016, Cherry Team
17
  * @link http://www.cherryframework.com/
@@ -199,10 +199,11 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
199
  * Include required API files
200
  *
201
  * @since 1.0.0
 
202
  * @return void
203
  */
204
  public function includes() {
205
- require_once __DIR__ . '/inc/class-cherry-facebook-embed.php';
206
 
207
  // Register Facebook Embed.
208
  if ( class_exists( 'Cherry_Facebook_Embed' ) ) {
@@ -755,7 +756,7 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
755
 
756
  if ( ! empty( $atts['include'] ) ) {
757
 
758
- $attachments = explode( ',', str_replace( ' ', '', $atts['include'] ) );
759
 
760
  } elseif ( ! empty( $atts['exclude'] ) ) {
761
 
@@ -960,6 +961,23 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
960
  return $result;
961
  }
962
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
963
  /**
964
  * Prepare attributes string from array
965
  *
@@ -1020,8 +1038,7 @@ if ( ! class_exists( 'Cherry_Post_Formats_Api' ) ) {
1020
  $image_src = preg_replace( '/^(.+)(-\d+x\d+)(\..+)$/', '$1$3', $image_src );
1021
 
1022
  // Try to get current image ID.
1023
- $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
1024
- $id = $wpdb->get_var( $query );
1025
 
1026
  if ( ! $id ) {
1027
  $result[] = $image_src;
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
  *
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/
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' ) ) {
756
 
757
  if ( ! empty( $atts['include'] ) ) {
758
 
759
+ $attachments = $this->esc_include_ids( $atts['include'] );
760
 
761
  } elseif ( ! empty( $atts['exclude'] ) ) {
762
 
961
  return $result;
962
  }
963
 
964
+ /**
965
+ * Include IDs set (array or string).
966
+ *
967
+ * @since 1.1.2
968
+ * @param mixed $ids ID's set.
969
+ * @return array
970
+ */
971
+ public function esc_include_ids( $ids ) {
972
+
973
+ if ( is_array( $ids ) ) {
974
+ return $ids;
975
+ } else {
976
+ return explode( ',', str_replace( ' ', '', $ids ) );
977
+ }
978
+
979
+ }
980
+
981
  /**
982
  * Prepare attributes string from array
983
  *
1038
  $image_src = preg_replace( '/^(.+)(-\d+x\d+)(\..+)$/', '$1$3', $image_src );
1039
 
1040
  // Try to get current image ID.
1041
+ $id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid = %s", $image_src ) );
 
1042
 
1043
  if ( ! $id ) {
1044
  $result[] = $image_src;
cherry-framework/modules/cherry-post-formats-api/inc/class-cherry-facebook-embed.php CHANGED
@@ -7,7 +7,7 @@
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
  */
12
 
13
  // If this file is called directly, abort.
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-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
cherry-framework/modules/cherry-post-meta/cherry-post-meta.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Module Name: Post Meta
4
  * Description: Manage post meta
5
- * Version: 1.1.3
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,7 +10,7 @@
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/
@@ -33,49 +33,35 @@ if ( ! class_exists( 'Cherry_Post_Meta' ) ) {
33
  class Cherry_Post_Meta {
34
 
35
  /**
36
- * Module version
37
- *
38
- * @var string
39
- */
40
- public $module_version = '1.1.3';
41
-
42
- /**
43
- * Module slug
44
  *
45
  * @var string
46
  */
47
  public $module_slug = 'cherry-post-meta';
48
 
49
  /**
50
- * Module arguments
51
  *
52
  * @var array
53
  */
54
  public $args = array();
55
 
56
  /**
57
- * Existing field types
58
- *
59
- * @var array
60
- */
61
- public $field_types = array();
62
-
63
- /**
64
- * UI builder instance
65
  *
66
  * @var object
67
  */
68
- public $ui_builder = null;
69
 
70
  /**
71
- * Core instance
72
  *
73
  * @var object
74
  */
75
  public $core = null;
76
 
77
  /**
78
- * Current nonce name to check
79
  *
80
  * @var null
81
  */
@@ -114,28 +100,103 @@ if ( ! class_exists( 'Cherry_Post_Meta' ) ) {
114
  return;
115
  }
116
 
117
- add_action( 'admin_enqueue_scripts', array( $this, 'init_ui' ), 1 );
 
 
 
 
 
 
 
118
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 10, 2 );
119
  add_action( 'save_post', array( $this, 'save_meta' ), 10, 2 );
 
120
  }
121
 
122
  /**
123
- * Init UI builder.
124
  *
125
- * @since 1.0.0
126
- * @return bool
127
  */
128
- public function init_ui() {
129
 
130
- if ( ! $this->is_allowed_page() ) {
131
  return;
132
  }
133
 
134
- array_walk( $this->args['fields'], array( $this, 'set_field_types' ) );
 
 
 
 
135
 
136
- $this->ui_builder = $this->core->init_module( 'cherry-ui-elements', array( 'ui_elements' => $this->field_types ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
- return true;
139
  }
140
 
141
  /**
@@ -198,133 +259,86 @@ if ( ! class_exists( 'Cherry_Post_Meta' ) ) {
198
  */
199
  public function render_metabox( $post, $metabox ) {
200
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  wp_nonce_field( $this->nonce, $this->nonce );
202
- echo $this->get_fields( $post, '<div style="padding:10px 0">%s</div>' );
 
 
 
 
 
 
 
 
 
 
 
 
203
  }
204
 
205
  /**
206
  * Get registered control fields
207
  *
208
  * @since 1.0.0
209
- * @param mixed $post Current post object.
210
- * @param [type] $format Current format name.
211
- * @return string
 
 
212
  */
213
- public function get_fields( $post, $format = '%s' ) {
214
-
215
- $elements = array();
216
 
217
  if ( is_array( $this->args['single'] ) && isset( $this->args['single']['key'] ) ) {
218
  $this->meta_values = get_post_meta( $post->ID, $this->args['single']['key'], true );
219
  }
220
 
221
- foreach ( $this->args['fields'] as $key => $field ) {
222
- $value = $this->get_meta( $post, $key );
223
- $value = ( false !== $value ) ? $value : Cherry_Toolkit::get_arg( $field, 'value', '' );
224
-
225
- if ( isset( $field['options_callback'] ) ) {
226
- $options = call_user_func( $field['options_callback'] );
227
- } else {
228
- $options = Cherry_Toolkit::get_arg( $field, 'options', array() );
229
- }
230
-
231
- $args = array(
232
- 'type' => Cherry_Toolkit::get_arg( $field, 'type', 'text' ),
233
- 'id' => Cherry_Toolkit::get_arg( $field, 'id', $key ),
234
- 'name' => Cherry_Toolkit::get_arg( $field, 'name', $key ),
235
- 'value' => $value,
236
- 'label' => Cherry_Toolkit::get_arg( $field, 'label', '' ),
237
- 'add_label' => Cherry_Toolkit::get_arg( $field, 'add_label', '' ),
238
- 'options' => $options,
239
- 'multiple' => Cherry_Toolkit::get_arg( $field, 'multiple', false ),
240
- 'filter' => Cherry_Toolkit::get_arg( $field, 'filter', false ),
241
- 'size' => Cherry_Toolkit::get_arg( $field, 'size', 1 ),
242
- 'null_option' => Cherry_Toolkit::get_arg( $field, 'null_option', 'None' ),
243
- 'multi_upload' => Cherry_Toolkit::get_arg( $field, 'multi_upload', true ),
244
- 'library_type' => Cherry_Toolkit::get_arg( $field, 'library_type', 'image' ),
245
- 'upload_button_text' => Cherry_Toolkit::get_arg( $field, 'upload_button_text', 'Choose' ),
246
- 'max_value' => Cherry_Toolkit::get_arg( $field, 'max_value', '100' ),
247
- 'min_value' => Cherry_Toolkit::get_arg( $field, 'min_value', '0' ),
248
- 'max' => Cherry_Toolkit::get_arg( $field, 'max', '100' ),
249
- 'min' => Cherry_Toolkit::get_arg( $field, 'min', '0' ),
250
- 'step_value' => Cherry_Toolkit::get_arg( $field, 'step_value', '1' ),
251
- 'style' => Cherry_Toolkit::get_arg( $field, 'style', 'normal' ),
252
- 'display_input' => Cherry_Toolkit::get_arg( $field, 'display_input', true ),
253
- 'controls' => Cherry_Toolkit::get_arg( $field, 'controls', array() ),
254
- 'fields' => Cherry_Toolkit::get_arg( $field, 'fields', array() ),
255
- 'auto_parse' => Cherry_Toolkit::get_arg( $field, 'auto_parse', false ),
256
- 'icon_data' => Cherry_Toolkit::get_arg( $field, 'icon_data', array() ),
257
- 'toggle' => Cherry_Toolkit::get_arg( $field, 'toggle', array(
258
- 'true_toggle' => 'On',
259
- 'false_toggle' => 'Off',
260
- 'true_slave' => '',
261
- 'false_slave' => '',
262
- ) ),
263
- 'required' => Cherry_Toolkit::get_arg( $field, 'required', false ),
264
- 'placeholder' => Cherry_Toolkit::get_arg( $field, 'placeholder' ),
265
- 'master' => Cherry_Toolkit::get_arg( $field, 'master' ),
266
- 'title_field' => Cherry_Toolkit::get_arg( $field, 'title_field' ),
267
- );
268
-
269
- $current_element = $this->ui_builder->get_ui_element_instance( $args['type'], $args );
270
-
271
- $elements[] = array(
272
- 'html' => $current_element->render(),
273
- 'field' => $field,
274
- );
275
-
276
- }
277
- return Cherry_Toolkit::render_view(
278
- __DIR__ . '/views/meta.php',
279
  array(
280
- 'elements' => $elements,
 
281
  )
282
  );
283
- }
284
-
285
- /**
286
- * Store field types used in this widget into class property
287
- *
288
- * @since 1.0.0
289
- * @param array $field field data.
290
- * @param [type] $id field key.
291
- * @return bool
292
- */
293
- public function set_field_types( $field, $id ) {
294
 
295
- if ( ! is_array( $field ) || ! isset( $field['type'] ) ) {
296
- return false;
297
- }
298
 
299
- if ( ! in_array( $field['type'], $this->field_types ) ) {
300
- $this->field_types[] = $field['type'];
301
- }
302
 
303
- $this->maybe_add_repeater_fields( $field );
 
 
304
 
305
- return true;
 
 
 
 
306
 
307
- }
 
 
 
308
 
309
- /**
310
- * Maybe add reapeater sub-fields to required elements list
311
- *
312
- * @since 1.0.1
313
- * @param array $field field data.
314
- * @return bool
315
- */
316
- public function maybe_add_repeater_fields( $field ) {
317
 
318
- if ( 'repeater' !== $field['type'] || empty( $field['fields'] ) ) {
319
- return false;
320
- }
321
-
322
- foreach ( $field['fields'] as $repeater_field ) {
323
- $this->set_field_types( $repeater_field, null );
324
  }
325
 
326
- return true;
327
-
328
  }
329
 
330
  /**
@@ -345,7 +359,30 @@ if ( ! class_exists( 'Cherry_Post_Meta' ) ) {
345
  return;
346
  }
347
 
348
- if ( ! current_user_can( 'edit_posts' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  return;
350
  }
351
 
@@ -357,11 +394,17 @@ if ( ! class_exists( 'Cherry_Post_Meta' ) ) {
357
  $post = get_post();
358
  }
359
 
 
 
 
 
 
360
  if ( is_array( $this->args['single'] ) && isset( $this->args['single']['key'] ) ) {
361
  $this->save_meta_mod( $post_id );
362
  } else {
363
  $this->save_meta_option( $post_id );
364
  }
 
365
  }
366
 
367
  /**
@@ -376,10 +419,13 @@ if ( ! class_exists( 'Cherry_Post_Meta' ) ) {
376
  // Array of new post meta value.
377
  $new_meta_value = array();
378
 
 
 
 
 
379
  foreach ( $_POST[ $meta_key ] as $key => $value ) {
380
 
381
- // @TODO - add sanitation by element type & hook for custom sanitation method.
382
- $new_meta_value[ $key ] = sanitize_text_field( $value );
383
  }
384
 
385
  // Get current post meta data.
@@ -389,7 +435,7 @@ if ( ! class_exists( 'Cherry_Post_Meta' ) ) {
389
  add_post_meta( $post_id, $meta_key, $new_meta_value, true );
390
  } elseif ( $new_meta_value && $new_meta_value != $meta_value ) {
391
  update_post_meta( $post_id, $meta_key, $new_meta_value );
392
- } elseif ( '' == $new_meta_value && $meta_value ) {
393
  delete_post_meta( $post_id, $meta_key, $meta_value );
394
  }
395
  }
@@ -401,39 +447,86 @@ if ( ! class_exists( 'Cherry_Post_Meta' ) ) {
401
  * @param int $post_id Post ID.
402
  */
403
  public function save_meta_option( $post_id ) {
 
404
  foreach ( $this->args['fields'] as $key => $field ) {
405
 
 
 
 
 
406
  if ( empty( $_POST[ $key ] ) ) {
407
  update_post_meta( $post_id, $key, false );
408
  continue;
409
  }
410
 
411
- // @TODO - add sanitation by element type & hook for custom sanitation method.
412
- update_post_meta( $post_id, $key, $_POST[ $key ] );
413
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  }
415
 
416
  /**
417
  * Retrieve post meta field.
418
  *
419
  * @since 1.1.0
420
- * @param object $post Current post object.
421
- * @param string $key The meta key to retrieve.
 
 
 
422
  * @return string
423
  */
424
- public function get_meta( $post, $key ) {
425
 
426
  if ( ! is_object( $post ) ) {
427
  return '';
428
  }
429
 
430
  if ( is_array( $this->args['single'] ) && isset( $this->args['single']['key'] ) ) {
431
- $meta = isset( $this->meta_values[ $key ] ) ? $this->meta_values[ $key ] : '';
432
- } else {
433
- $meta = get_post_meta( $post->ID, $key, true );
434
  }
435
 
436
- return $meta;
 
 
437
  }
438
 
439
  /**
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
  *
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/
33
  class Cherry_Post_Meta {
34
 
35
  /**
36
+ * Module slug.
 
 
 
 
 
 
 
37
  *
38
  * @var string
39
  */
40
  public $module_slug = 'cherry-post-meta';
41
 
42
  /**
43
+ * Module arguments.
44
  *
45
  * @var array
46
  */
47
  public $args = array();
48
 
49
  /**
50
+ * Interface builder instance.
 
 
 
 
 
 
 
51
  *
52
  * @var object
53
  */
54
+ public $builder = null;
55
 
56
  /**
57
+ * Core instance.
58
  *
59
  * @var object
60
  */
61
  public $core = null;
62
 
63
  /**
64
+ * Current nonce name to check.
65
  *
66
  * @var null
67
  */
100
  return;
101
  }
102
 
103
+ $this->builder = $this->core->init_module( 'cherry-interface-builder', array() );
104
+
105
+ $this->init_columns_actions();
106
+
107
+ if ( ! $this->builder ) {
108
+ return;
109
+ }
110
+
111
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 10, 2 );
112
  add_action( 'save_post', array( $this, 'save_meta' ), 10, 2 );
113
+
114
  }
115
 
116
  /**
117
+ * Initalize admin columns
118
  *
119
+ * @return void
 
120
  */
121
+ public function init_columns_actions() {
122
 
123
+ if ( empty( $this->args['admin_columns'] ) ) {
124
  return;
125
  }
126
 
127
+ if ( ! is_array( $this->args['page'] ) ) {
128
+ $pages = array( $this->args['page'] );
129
+ } else {
130
+ $pages = $this->args['page'];
131
+ }
132
 
133
+ foreach ( $pages as $page ) {
134
+ add_filter( 'manage_edit-' . $page . '_columns', array( $this, 'edit_columns' ) );
135
+ add_action( 'manage_' . $page . '_posts_custom_column', array( $this, 'manage_columns' ), 10, 2 );
136
+ }
137
+
138
+ }
139
+
140
+ /**
141
+ * Edit admin columns
142
+ *
143
+ * @since 1.1.3
144
+ * @param array $columns current post table columns.
145
+ * @return array
146
+ */
147
+ public function edit_columns( $columns ) {
148
+
149
+ foreach ( $this->args['admin_columns'] as $column_key => $column_data ) {
150
+
151
+ if ( empty( $column_data['label'] ) ) {
152
+ continue;
153
+ }
154
+
155
+ if ( ! empty( $column_data['position'] ) && 0 !== (int) $column_data['position'] ) {
156
+
157
+ $length = count( $columns );
158
+
159
+ if ( (int) $column_data['position'] > $length ) {
160
+ $columns[ $column_key ] = $column_data['label'];
161
+ }
162
+
163
+ $columns_before = array_slice( $columns, 0, (int) $column_data['position'] );
164
+ $columns_after = array_slice( $columns, (int) $column_data['position'], $length - (int) $column_data['position'] );
165
+
166
+ $columns = array_merge(
167
+ $columns_before,
168
+ array( $column_key => $column_data['label'] ),
169
+ $columns_after
170
+ );
171
+ } else {
172
+ $columns[ $column_key ] = $column_data['label'];
173
+ }
174
+ }
175
+
176
+ return $columns;
177
+
178
+ }
179
+
180
+ /**
181
+ * Add output for custom columns.
182
+ *
183
+ * @since 1.1.3
184
+ * @param string $column current post list categories.
185
+ * @param int $post_id current post ID.
186
+ * @return void
187
+ */
188
+ public function manage_columns( $column, $post_id ) {
189
+
190
+ if ( empty( $this->args['admin_columns'][ $column ] ) ) {
191
+ return;
192
+ }
193
+
194
+ if ( ! empty( $this->args['admin_columns'][ $column ]['callback'] ) && is_callable( $this->args['admin_columns'][ $column ]['callback'] ) ) {
195
+ call_user_func( $this->args['admin_columns'][ $column ]['callback'], $column, $post_id );
196
+ } else {
197
+ echo get_post_meta( $post_id, $column, true );
198
+ }
199
 
 
200
  }
201
 
202
  /**
259
  */
260
  public function render_metabox( $post, $metabox ) {
261
 
262
+ /**
263
+ * Filter custom metabox output. Prevent from showing main box, if user output passed
264
+ *
265
+ * @var string
266
+ */
267
+ $custom_box = apply_filters( 'cherry_post_meta_custom_box', false, $post, $metabox );
268
+
269
+ if ( false !== $custom_box ) {
270
+ echo $custom_box;
271
+ return;
272
+ }
273
+
274
  wp_nonce_field( $this->nonce, $this->nonce );
275
+
276
+ /**
277
+ * Hook fires before metabox output started.
278
+ */
279
+ do_action( 'cherry_post_meta_box_before' );
280
+
281
+ $this->get_fields( $post );
282
+
283
+ /**
284
+ * Hook fires after metabox output finished.
285
+ */
286
+ do_action( 'cherry_post_meta_box_after' );
287
+
288
  }
289
 
290
  /**
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
  */
300
+ public function get_fields( $post ) {
 
 
301
 
302
  if ( is_array( $this->args['single'] ) && isset( $this->args['single']['key'] ) ) {
303
  $this->meta_values = get_post_meta( $post->ID, $this->args['single']['key'], true );
304
  }
305
 
306
+ $zero_allowed = apply_filters(
307
+ 'cherry_zero_allowed_controls',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  array(
309
+ 'stepper',
310
+ 'slider',
311
  )
312
  );
 
 
 
 
 
 
 
 
 
 
 
313
 
314
+ foreach ( $this->args['fields'] as $key => $field ) {
 
 
315
 
316
+ $default = Cherry_Toolkit::get_arg( $field, 'value', '' );
317
+ $value = $this->get_meta( $post, $key, $default );
 
318
 
319
+ if ( isset( $field['options_callback'] ) ) {
320
+ $field['options'] = call_user_func( $field['options_callback'] );
321
+ }
322
 
323
+ $element = Cherry_Toolkit::get_arg( $field, 'element', 'control' );
324
+ $field['id'] = Cherry_Toolkit::get_arg( $field, 'id', $key );
325
+ $field['name'] = Cherry_Toolkit::get_arg( $field, 'name', $key );
326
+ $field['type'] = Cherry_Toolkit::get_arg( $field, 'type', '' );
327
+ $field['value'] = $value;
328
 
329
+ // Fix zero values for stepper and slider
330
+ if ( ! $value && in_array( $field['type'], $zero_allowed ) ) {
331
+ $field['value'] = 0;
332
+ }
333
 
334
+ $register_callback = 'register_' . $element;
 
 
 
 
 
 
 
335
 
336
+ if ( method_exists( $this->builder, $register_callback ) ) {
337
+ call_user_func( array( $this->builder, $register_callback ), $field );
338
+ }
 
 
 
339
  }
340
 
341
+ $this->builder->render();
 
342
  }
343
 
344
  /**
359
  return;
360
  }
361
 
362
+ $posts = ! empty( $this->args['page'] ) ? $this->args['page'] : array( 'post' );
363
+ $posts = is_array( $posts ) ? $posts : array( $posts );
364
+
365
+ $maybe_break = false;
366
+
367
+ foreach ( $posts as $post_type ) {
368
+
369
+ if ( get_post_type( $post_id ) !== $post_type ) {
370
+ $maybe_break = true;
371
+ continue;
372
+ }
373
+
374
+ $maybe_break = false;
375
+ $obj = get_post_type_object( $post_type );
376
+
377
+ if ( ! isset( $obj->cap->edit_posts ) || ! current_user_can( $obj->cap->edit_posts ) ) {
378
+ $maybe_break = true;
379
+ continue;
380
+ }
381
+
382
+ break;
383
+ }
384
+
385
+ if ( true === $maybe_break ) {
386
  return;
387
  }
388
 
394
  $post = get_post();
395
  }
396
 
397
+ /**
398
+ * Hook on current metabox saving
399
+ */
400
+ do_action( 'cherry_save_meta_' . $this->args['id'] );
401
+
402
  if ( is_array( $this->args['single'] ) && isset( $this->args['single']['key'] ) ) {
403
  $this->save_meta_mod( $post_id );
404
  } else {
405
  $this->save_meta_option( $post_id );
406
  }
407
+
408
  }
409
 
410
  /**
419
  // Array of new post meta value.
420
  $new_meta_value = array();
421
 
422
+ if ( empty( $_POST[ $meta_key ] ) ) {
423
+ return;
424
+ }
425
+
426
  foreach ( $_POST[ $meta_key ] as $key => $value ) {
427
 
428
+ $new_meta_value[ $key ] = $this->sanitize_meta( $key, $value );
 
429
  }
430
 
431
  // Get current post meta data.
435
  add_post_meta( $post_id, $meta_key, $new_meta_value, true );
436
  } elseif ( $new_meta_value && $new_meta_value != $meta_value ) {
437
  update_post_meta( $post_id, $meta_key, $new_meta_value );
438
+ } elseif ( empty( $new_meta_value ) && $meta_value ) {
439
  delete_post_meta( $post_id, $meta_key, $meta_value );
440
  }
441
  }
447
  * @param int $post_id Post ID.
448
  */
449
  public function save_meta_option( $post_id ) {
450
+
451
  foreach ( $this->args['fields'] as $key => $field ) {
452
 
453
+ if ( isset( $field['element'] ) && 'control' !== $field['element'] ) {
454
+ continue;
455
+ }
456
+
457
  if ( empty( $_POST[ $key ] ) ) {
458
  update_post_meta( $post_id, $key, false );
459
  continue;
460
  }
461
 
462
+ $value = $this->sanitize_meta( $key, $_POST[ $key ] );
463
+ update_post_meta( $post_id, $key, $value );
464
  }
465
+
466
+ }
467
+
468
+ /**
469
+ * Sanitize passed meta value
470
+ *
471
+ * @since 1.1.3
472
+ * @param string $key Meta key to sanitize.
473
+ * @param mixed $value Meta value.
474
+ * @return mixed
475
+ */
476
+ public function sanitize_meta( $key, $value ) {
477
+
478
+ if ( empty( $this->args['fields'][ $key ]['sanitize_callback'] ) ) {
479
+ return $this->sanitize_deafult( $value );
480
+ }
481
+
482
+ if ( ! is_callable( $this->args['fields'][ $key ]['sanitize_callback'] ) ) {
483
+ return $this->sanitize_deafult( $value );
484
+ }
485
+
486
+ return call_user_func(
487
+ $this->args['fields'][ $key ]['sanitize_callback'],
488
+ $value,
489
+ $key,
490
+ $this->args['fields'][ $key ]
491
+ );
492
+
493
+ }
494
+
495
+ /**
496
+ * Cleare value with sanitize_text_field if not is array
497
+ *
498
+ * @since 1.1.3
499
+ * @param mixed $value Passed value.
500
+ * @return mixed
501
+ */
502
+ public function sanitize_deafult( $value ) {
503
+ return is_array( $value ) ? $value : sanitize_text_field( $value );
504
  }
505
 
506
  /**
507
  * Retrieve post meta field.
508
  *
509
  * @since 1.1.0
510
+ * @since 1.2.0 Process default value.
511
+ *
512
+ * @param object $post Current post object.
513
+ * @param string $key The meta key to retrieve.
514
+ * @param mixed $default Default value.
515
  * @return string
516
  */
517
+ public function get_meta( $post, $key, $default = false ) {
518
 
519
  if ( ! is_object( $post ) ) {
520
  return '';
521
  }
522
 
523
  if ( is_array( $this->args['single'] ) && isset( $this->args['single']['key'] ) ) {
524
+ return isset( $this->meta_values[ $key ] ) ? $this->meta_values[ $key ] : $default;
 
 
525
  }
526
 
527
+ $meta = get_post_meta( $post->ID, $key, false );
528
+
529
+ return ( empty( $meta ) ) ? $default : $meta[0];
530
  }
531
 
532
  /**
cherry-framework/modules/cherry-post-meta/views/meta.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- /**
3
- * POst meta view
4
- *
5
- * @package Cherry_Framework
6
- */?>
7
- <?php if ( is_array( $__data['elements'] ) && count( $__data['elements'] ) ) : ?>
8
- <table class="form-table">
9
- <tbody>
10
- <?php foreach ( $__data['elements'] as $el ) : ?>
11
- <tr>
12
- <?php if ( array_key_exists( 'name', $el['field'] ) && array_key_exists( 'left_label', $el['field'] ) ) : ?>
13
- <th><label for="<?php echo $el['field']['name']; ?>"><?php echo $el['field']['left_label']; ?></label></th>
14
- <?php endif; ?>
15
- <td><?php echo $el['html']; ?></td>
16
- </tr>
17
- <?php endforeach; ?>
18
- </tbody>
19
- </table>
20
- <?php endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-post-types/cherry-post-types.php DELETED
@@ -1,155 +0,0 @@
1
- <?php
2
- /**
3
- * Create custom post type
4
- * Module Name: Post Types
5
- * Description: Provides functionality for creating custom post types
6
- * Version: 1.1.0
7
- * Author: Cherry Team
8
- * Author URI: http://www.cherryframework.com/
9
- * License: GPLv3
10
- * License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
- *
12
- * @package Cherry_Framework
13
- * @subpackage Modules
14
- * @version 1.1.0
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
- */
20
-
21
- // If this file is called directly, abort.
22
- if ( ! defined( 'WPINC' ) ) {
23
- die;
24
- }
25
-
26
- if ( ! class_exists( 'Cherry_Post_Types' ) ) {
27
-
28
- /**
29
- * Cherry Post Types.
30
- *
31
- * @since 1.0.0
32
- * @since 1.0.1 Removed `module_directory` property.
33
- */
34
- class Cherry_Post_Types {
35
- /**
36
- * Module version
37
- *
38
- * @var string
39
- */
40
- public $module_version = '1.1.0';
41
-
42
- /**
43
- * Module slug
44
- *
45
- * @var string
46
- */
47
- public $module_slug = 'cherry-post-types';
48
-
49
- /**
50
- * Default post type arguments
51
- *
52
- * @var null
53
- */
54
- private $defaults = null;
55
-
56
- /**
57
- * Created popst types list
58
- *
59
- * @var array
60
- */
61
- public static $created_post_types = array();
62
-
63
- /**
64
- * Cherry_Post_Type class constructor
65
- */
66
- public function __construct( $core, $args = array() ) {
67
- $this->defaults = $args;
68
-
69
- if ( ! class_exists( 'Cherry_Post_Type' ) ) {
70
- require_once( __DIR__ . '/inc/cherry-post-type.php' );
71
- }
72
- }
73
-
74
- /**
75
- * Create new Post Type.
76
- *
77
- * @param [type] $slug The post type slug name.
78
- * @param [type] $plural The post type plural name for display.
79
- * @param [type] $singular The post type singular name for display.
80
- * @param array $args The custom post type arguments.
81
- * @throws Exception Invalid custom post type parameter.
82
- * @return Cherry_Post_Type
83
- */
84
- public function create( $slug, $plural, $singular, $args = array() ) {
85
- $params = array(
86
- 'slug' => $slug,
87
- 'plural' => $plural,
88
- 'singular' => $singular,
89
- );
90
-
91
- foreach ( $params as $name => $param ) {
92
- if ( ! is_string( $param ) ) {
93
- throw new Exception( 'Invalid custom post type parameter "'.$name.'". Accepts string only.' );
94
- }
95
- }
96
-
97
- // Set main properties.
98
- $this->defaults = array_merge(
99
- $this->get_default_arguments( $plural, $singular ),
100
- $this->defaults
101
- );
102
- $args = array_merge( $this->defaults, $args );
103
- // Register post type
104
- self::$created_post_types[ $slug ] = new Cherry_Post_Type( $slug, $args );
105
-
106
- return self::$created_post_types[ $slug ];
107
- }
108
-
109
- /**
110
- * Get the custom post type default arguments.
111
- *
112
- * @param [type] $plural The post type plural display name.
113
- * @param [type] $singular The post type singular display name.
114
- * @return array
115
- */
116
- private function get_default_arguments( $plural, $singular ) {
117
- $labels = array(
118
- 'name' => 'cherry',
119
- 'singular_name' => $singular,
120
- 'add_new' => 'Add New',
121
- 'add_new_item' => 'Add New '. $singular,
122
- 'edit_item' => 'Edit '. $singular,
123
- 'new_item' => 'New ' . $singular,
124
- 'all_items' => 'All ' . $plural,
125
- 'view_item' => 'View ' . $singular,
126
- 'search_items' => 'Search ' . $singular,
127
- 'not_found' => 'No '. $singular .' found',
128
- 'not_found_in_trash' => 'No '. $singular .' found in Trash',
129
- 'parent_item_colon' => '',
130
- 'menu_name' => $plural,
131
- );
132
-
133
- $defaults = array(
134
- 'label' => $plural,
135
- 'labels' => $labels,
136
- 'description' => '',
137
- 'public' => true,
138
- 'menu_position' => 20,
139
- 'has_archive' => true,
140
- );
141
-
142
- return $defaults;
143
- }
144
-
145
- /**
146
- * Returns the instance.
147
- *
148
- * @since 1.0.0
149
- * @return object
150
- */
151
- public static function get_instance( $core, $args ) {
152
- return new self( $core, $args );
153
- }
154
- }
155
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-post-types/inc/cherry-post-type.php DELETED
@@ -1,112 +0,0 @@
1
- <?php
2
- /**
3
- * Custom post type
4
- *
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/old-licenses/gpl-2.0.html
11
- */
12
-
13
- /**
14
- * Cherry_Post_Type class
15
- */
16
- class Cherry_Post_Type {
17
-
18
- /**
19
- * Post type slug
20
- *
21
- * @var null
22
- */
23
- private $slug = null;
24
-
25
- /**
26
- * Post type arguments
27
- *
28
- * @var null
29
- */
30
- private $args = null;
31
-
32
- /**
33
- * The registered custom post type.
34
- *
35
- * @var Object|\WP_Error
36
- */
37
- private $post_type;
38
-
39
- /**
40
- * Font awesome icon name.
41
- *
42
- * @var null
43
- */
44
- private $icon = null;
45
-
46
- /**
47
- * Cherry Post Type Builder class constructor
48
- *
49
- * @param [type] $slug post type slug.
50
- * @param [type] $args post type arguments.
51
- */
52
- public function __construct( $slug, $args ) {
53
-
54
- $this->slug = $slug;
55
- $this->args = $args;
56
-
57
- // Register post type
58
- add_action( 'init', array( &$this, 'register' ) );
59
- }
60
-
61
- /**
62
- * Triggered by the 'init' action event.
63
- * Register a WordPress custom post type.
64
- *
65
- * @return void
66
- */
67
- public function register() {
68
- $this->post_type = register_post_type(
69
- $this->slug,
70
- $this->args
71
- );
72
- }
73
-
74
- /**
75
- * Add font awesome icon to menu
76
- *
77
- * @param [type] $icon font awesome icon code.
78
- * @return boolen true if succes | false if not.
79
- */
80
- public function font_awesome_icon( $icon = '' ) {
81
- if ( '' === $icon ) {
82
- return false;
83
- }
84
-
85
- $this->icon = $icon;
86
-
87
- add_action( 'admin_enqueue_scripts', array( &$this, 'load_font_awesome' ) );
88
-
89
- return true;
90
- }
91
-
92
- /**
93
- * Load font awesome fonts to admin menu.
94
- *
95
- * @return void
96
- */
97
- public function load_font_awesome() {
98
- wp_enqueue_style(
99
- 'font-awesome',
100
- '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'
101
- );
102
-
103
- ?>
104
- <style type='text/css' media='screen'>
105
- #adminmenu .menu-icon-<?php echo $this->slug; ?> div.wp-menu-image:before {
106
- font-family: Fontawesome !important;
107
- content: '\<?php echo $this->icon; ?>';
108
- }
109
- </style>
110
- <?php
111
- }
112
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-taxonomies/cherry-taxonomies.php DELETED
@@ -1,132 +0,0 @@
1
- <?php
2
- /**
3
- * Module Name: Taxanomies
4
- * Description: Provides functionality for creating custom taxanomies
5
- * Version: 1.1.0
6
- * Author: Cherry Team
7
- * Author URI: http://www.cherryframework.com/
8
- * License: GPLv3
9
- * License URI: http://www.gnu.org/licenses/gpl-3.0.html
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
- */
19
-
20
- // If this file is called directly, abort.
21
- if ( ! defined( 'WPINC' ) ) {
22
- die;
23
- }
24
-
25
- if ( ! class_exists( 'Cherry_Taxonomies' ) ) {
26
-
27
- /**
28
- * Cherry Taxonomies.
29
- *
30
- * @since 1.0.0
31
- * @since 1.0.1 Removed `module_directory` property.
32
- */
33
- class Cherry_Taxonomies {
34
- /**
35
- * Module version
36
- *
37
- * @var string
38
- */
39
- public $module_version = '1.1.0';
40
-
41
- /**
42
- * Module slug
43
- *
44
- * @var string
45
- */
46
- public $module_slug = 'cherry-taxonomies';
47
-
48
- /**
49
- * Default post type arguments
50
- *
51
- * @var null
52
- */
53
- private $defaults = null;
54
-
55
- /**
56
- * Cherry_Post_Type class constructor
57
- */
58
- public function __construct( $core, $args = array() ) {
59
- $this->defaults = $args;
60
-
61
- if ( ! class_exists( 'Cherry_Taxonomy' ) ) {
62
- require_once( __DIR__ . '/inc/cherry-taxonomy.php' );
63
- }
64
- }
65
-
66
- /**
67
- * Create new Post Type.
68
- *
69
- * @param [type] $single name.
70
- * @param [type] $post_type_slug post types slug.
71
- * @param [type] $plural name.
72
- * @return Cherry_Post_Type
73
- */
74
- public function create( $single, $post_type_slug = 'post', $plural = '' ) {
75
- $tax = new Cherry_Taxonomy( $single, $post_type_slug, $plural );
76
-
77
- $this->defaults = array_merge(
78
- $this->defaults,
79
- $this->get_default_arguments(
80
- $tax->get_single(),
81
- $tax->get_plural(),
82
- $tax->get_post_type_slug()
83
- )
84
- );
85
- $tax->set_arguments( $this->defaults );
86
-
87
- return $tax;
88
- }
89
-
90
- /**
91
- * Get the taxonomy default arguments.
92
- *
93
- * @param [type] $plural The post type plural display name.
94
- * @param [type] $singular The post type singular display name.
95
- * @return array
96
- */
97
- public function get_default_arguments( $plural, $singular, $post_type_slug ) {
98
- $labels = array(
99
- 'name' => $plural,
100
- 'singular_name' => $singular,
101
- 'search_items' => 'Search ' . $plural,
102
- 'all_items' => 'All ' . $plural,
103
- 'parent_item' => 'Parent ' . $singular,
104
- 'parent_item_colon' => 'Parent ' . $singular . ' :',
105
- 'edit_item' => 'Edit ' . $singular,
106
- 'update_item' => 'Update ' . $singular,
107
- 'add_new_item' => 'Add New ' . $singular,
108
- 'new_item_name' => 'New ' . $singular . ' Name',
109
- 'menu_name' => $plural,
110
- );
111
-
112
- return array(
113
- 'hierarchical' => true,
114
- 'labels' => $labels,
115
- 'show_ui' => true,
116
- 'show_admin_column' => true,
117
- 'query_var' => true,
118
- 'rewrite' => array( 'slug' => $post_type_slug ),
119
- );
120
- }
121
-
122
- /**
123
- * Returns the instance.
124
- *
125
- * @since 1.0.0
126
- * @return object
127
- */
128
- public static function get_instance( $core, $args ) {
129
- return new self( $core, $args );
130
- }
131
- }
132
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-taxonomies/inc/cherry-taxonomy.php DELETED
@@ -1,210 +0,0 @@
1
- <?php
2
- /**
3
- * Custom taxonomy
4
- *
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/old-licenses/gpl-2.0.html
11
- */
12
-
13
- /**
14
- * Cherry_Taxonomy class
15
- */
16
- class Cherry_Taxonomy {
17
-
18
- /**
19
- * Single taxonomy name.
20
- *
21
- * @var null
22
- */
23
- private $single = null;
24
-
25
- /**
26
- * Taxonomy slug
27
- *
28
- * @var null
29
- */
30
- private $slug = null;
31
-
32
- /**
33
- * Post type slug
34
- *
35
- * @var null
36
- */
37
- private $post_type_slug = null;
38
-
39
- /**
40
- * Plural taxonomy name.
41
- *
42
- * @var null
43
- */
44
- private $plural = null;
45
-
46
- /**
47
- * Taxonomy arguments
48
- *
49
- * @var array
50
- */
51
- private $arguments = array();
52
-
53
- /**
54
- * Cherry taxonomy
55
- *
56
- * @param [type] $single name.
57
- * @param [type] $post_type_slug post type slug.
58
- * @param [type] $plural name.
59
- * @param array $args arguments.
60
- */
61
- public function __construct( $single, $post_type_slug = 'post', $plural = '', $args = array() ) {
62
- $this->set_single( $single );
63
- $this->set_plural( $plural );
64
- $this->set_post_type_slug( $post_type_slug );
65
- $this->set_slug();
66
- $this->set_arguments( $args );
67
- }
68
-
69
- /**
70
- * Init actions
71
- *
72
- * @return Cherry_Taxonomy object
73
- */
74
- public function init() {
75
- // Register Taxonomy
76
- add_action( 'init', array( &$this, 'register' ), 0 );
77
- return $this;
78
- }
79
-
80
- /**
81
- * Set single property
82
- *
83
- * @param [type] $single property.
84
- * @return Cherry_Taxonomy object
85
- */
86
- public function set_single( $single ) {
87
- if ( '' !== $single ) {
88
- $this->single = $single;
89
- }
90
- return $this;
91
- }
92
-
93
- /**
94
- * Get single property
95
- *
96
- * @return string property.
97
- */
98
- public function get_single() {
99
- return $this->single;
100
- }
101
-
102
- /**
103
- * Set plural property
104
- *
105
- * @param [type] $plural property.
106
- * @return Cherry_Taxonomy object
107
- */
108
- public function set_plural( $plural = '' ) {
109
- if ( '' != $plural ) {
110
- $this->plural = $plural;
111
- } else {
112
- $this->plural = $this->get_single() . 's';
113
- }
114
- return $this;
115
- }
116
-
117
- /**
118
- * Get plural property
119
- *
120
- * @return string plural property.
121
- */
122
- public function get_plural() {
123
- return $this->plural;
124
- }
125
-
126
- /**
127
- * Set slug
128
- *
129
- * @param type string $slug taxonomy slug.
130
- * @return Cherry_Taxonomy object
131
- */
132
- public function set_slug( $slug = '' ) {
133
- if ( '' != $slug ) {
134
- $this->slug = $slug;
135
- } else {
136
- $slug = $this->get_single();
137
- $slug = strtolower( $slug );
138
- $slug = str_replace( ' ', '_', $slug );
139
- $this->slug = $slug;
140
- }
141
- return $this;
142
- }
143
-
144
- /**
145
- * Get slug taxonomy
146
- *
147
- * @return string taxonomy slug.
148
- */
149
- public function get_slug() {
150
- return $this->slug;
151
- }
152
-
153
- /**
154
- * Set post type slug
155
- *
156
- * @param type string $slug post types slug.
157
- * @return Cherry_Taxonomy object
158
- */
159
- public function set_post_type_slug( $slug = '' ) {
160
- if ( '' != $slug ) {
161
- $this->post_type_slug = $slug;
162
- } else {
163
- $this->post_type_slug = 'post';
164
- }
165
- return $this;
166
- }
167
-
168
- /**
169
- * Get post type slug
170
- *
171
- * @return string post type slug.
172
- */
173
- public function get_post_type_slug() {
174
- return $this->post_type_slug;
175
- }
176
-
177
- /**
178
- * Set arguments
179
- *
180
- * @param array $args arguments.
181
- */
182
- public function set_arguments( $args = array() ) {
183
- $this->arguments = array_merge( $this->arguments, (array) $args );
184
- return $this;
185
- }
186
-
187
- /**
188
- * Get arguments
189
- *
190
- * @return array taxonomy arguments.
191
- */
192
- public function get_arguments() {
193
- return (array) $this->arguments;
194
- }
195
-
196
- /**
197
- * Triggered by the 'init' action event.
198
- * Register a WordPress custom taxonomy.
199
- *
200
- * @return Cherry_Taxonomy object
201
- */
202
- public function register() {
203
- register_taxonomy(
204
- $this->slug,
205
- $this->post_type_slug,
206
- $this->arguments
207
- );
208
- return $this;
209
- }
210
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-template-manager/cherry-template-manager.php ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Module Name: Template Manager
4
+ * Description: Module load and parse tmpl files.
5
+ * Version: 1.0.0
6
+ * Author: Cherry Team
7
+ * Author URI: http://www.cherryframework.com/
8
+ * License: GPLv3
9
+ * License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
+ *
11
+ * @package Cherry_Framework
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
+ */
19
+
20
+ // If this file is called directly, abort.
21
+ if ( ! defined( 'WPINC' ) ) {
22
+ die;
23
+ }
24
+
25
+ if ( ! class_exists( 'Cherry_Template_Manager' ) ) {
26
+
27
+ /**
28
+ * Class Cherry Template Manager.
29
+ *
30
+ * @since 1.0.0
31
+ */
32
+ class Cherry_Template_Manager {
33
+
34
+ /**
35
+ * A reference to an instance of this class.
36
+ *
37
+ * @since 1.0.0
38
+ * @access private
39
+ * @var object
40
+ */
41
+ private static $instance = null;
42
+
43
+ /**
44
+ * Module arguments.
45
+ *
46
+ * @since 1.0.0
47
+ * @access private
48
+ * @var array
49
+ */
50
+ private $args = array();
51
+
52
+ /**
53
+ * It contains a class Cherry_Template_Parser.
54
+ *
55
+ * @since 1.0.0
56
+ * @access public
57
+ * @var object
58
+ */
59
+ public $parser = null;
60
+
61
+ /**
62
+ * It contains a class Cherry_Template_Loader.
63
+ *
64
+ * @since 1.0.0
65
+ * @access public
66
+ * @var object
67
+ */
68
+ public $loader = null;
69
+
70
+ /**
71
+ * Cherry_Template_Manager constructor.
72
+ *
73
+ * @since 1.0.0
74
+ * @access public
75
+ * @return void
76
+ */
77
+ public function __construct( $core = null, $args = array() ) {
78
+ $this->include_class();
79
+
80
+ $this->args = array_merge_recursive(
81
+ $args,
82
+ $this->args
83
+ );
84
+
85
+ $this->set_class();
86
+ }
87
+
88
+ /**
89
+ * Include abstract widget class
90
+ *
91
+ * @since 1.0.0
92
+ * @access public
93
+ * @return void
94
+ */
95
+ public function include_class() {
96
+ require_once( dirname( __FILE__ ) . '/inc/cherry-template-loader.php' );
97
+ require_once( dirname( __FILE__ ) . '/inc/cherry-template-parser.php' );
98
+ }
99
+
100
+ /**
101
+ * Function set the child classes.
102
+ *
103
+ * @since 1.0.0
104
+ * @access public
105
+ * @return void
106
+ */
107
+ public function set_class() {
108
+ $this->loader = Cherry_Template_Loader::get_instance( $this->args, $this );
109
+ $this->parser = Cherry_Template_Parser::get_instance( $this->args, $this );
110
+ }
111
+
112
+ /**
113
+ * Returns the instance.
114
+ *
115
+ * @since 1.0.0
116
+ * @access public
117
+ * @return object
118
+ */
119
+ public static function get_instance() {
120
+
121
+ // If the single instance hasn't been set, set it now.
122
+ if ( null == self::$instance ) {
123
+ self::$instance = new self;
124
+ }
125
+
126
+ return self::$instance;
127
+ }
128
+ }
129
+ }
cherry-framework/modules/cherry-template-manager/inc/cherry-template-loader.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Module Name: Template Loader
4
+ * Description: Module load tmpl files.
5
+ * Version: 1.0.0
6
+ * Author: Cherry Team
7
+ * Author URI: http://www.cherryframework.com/
8
+ * License: GPLv3
9
+ * License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
+ *
11
+ * @package Cherry_Framework
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
+ */
19
+
20
+ // If this file is called directly, abort.
21
+ if ( ! defined( 'WPINC' ) ) {
22
+ die;
23
+ }
24
+
25
+ if ( ! class_exists( 'Cherry_Template_Loader' ) ) {
26
+
27
+ /**
28
+ * Class Cherry Template Loader.
29
+ *
30
+ * @since 1.0.0
31
+ */
32
+ class Cherry_Template_Loader {
33
+
34
+ /**
35
+ * A reference to an instance of this class.
36
+ *
37
+ * @since 1.0.0
38
+ * @access private
39
+ * @var object
40
+ */
41
+ private static $instance = null;
42
+
43
+ /**
44
+ * A reference to an instance of this Cherry_Template_Manager class.
45
+ *
46
+ * @since 1.0.0
47
+ * @access private
48
+ * @var object
49
+ */
50
+ private $cherry_template_manager_class = null;
51
+
52
+ /**
53
+ * Module arguments.
54
+ *
55
+ * @since 1.0.0
56
+ * @access private
57
+ * @var array
58
+ */
59
+ private $args = array(
60
+ 'template_dir' => 'templates/%1$s/%2$s.tmpl',
61
+ 'slug' => '',
62
+ 'upload_dir' => '',
63
+ );
64
+
65
+ /**
66
+ * Cherry_Template_Loader constructor.
67
+ *
68
+ * @since 1.0.0
69
+ * @access public
70
+ * @return void
71
+ */
72
+ public function __construct( $args = array(), $main_class = null ) {
73
+
74
+ $this->args = array_merge_recursive(
75
+ $args,
76
+ $this->args
77
+ );
78
+
79
+ $this->cherry_template_manager_class = $main_class;
80
+
81
+ $this->set_default_variable();
82
+ $this->includes_file_system();
83
+
84
+ }
85
+
86
+ /**
87
+ * Set the default variables.
88
+ *
89
+ * @since 1.0.0
90
+ * @access private
91
+ * @return void
92
+ */
93
+ private function set_default_variable() {
94
+ if ( ! $this->args['slug'] ) {
95
+ $this->args['slug'] = $this->get_slug();
96
+ }
97
+
98
+ if ( ! $this->args['upload_dir'] ) {
99
+ $get_upload_dir = wp_upload_dir();
100
+ $this->args['upload_dir'] = trailingslashit( $get_upload_dir['basedir'] );
101
+ }
102
+ }
103
+
104
+ /**
105
+ * Function Include file with class WP_Filesystem.
106
+ *
107
+ * @since 1.0.0
108
+ * @access private
109
+ * @return void
110
+ */
111
+ private function includes_file_system() {
112
+ if ( ! function_exists( 'WP_Filesystem' ) ) {
113
+ include_once( ABSPATH . '/wp-admin/includes/file.php' );
114
+ }
115
+
116
+ WP_Filesystem();
117
+ }
118
+
119
+ /**
120
+ * Return product slug.
121
+ *
122
+ * @since 1.0.0
123
+ * @access private
124
+ * @return string
125
+ */
126
+ private function get_slug() {
127
+ $file_dir = wp_normalize_path( __DIR__ );
128
+ $product_dir = $this->get_project_root();
129
+
130
+ $slug = str_replace( $product_dir, '', $file_dir );
131
+ preg_match( '/^[a-zA-Z-]*/' , $slug, $slug );
132
+
133
+ return $slug[0];
134
+ }
135
+
136
+ /**
137
+ * Function return the project root dir, themes or plugins.
138
+ *
139
+ * @since 1.0.0
140
+ * @access private
141
+ * @return string
142
+ */
143
+ private function get_project_root() {
144
+ $themes_dir = wp_normalize_path( get_theme_root() );
145
+ $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
146
+ $file_dir = wp_normalize_path( __DIR__ );
147
+ $project_root = ( false === strpos( $file_dir, $themes_dir ) ) ? $plugin_dir : $themes_dir;
148
+
149
+ return trailingslashit( $project_root );
150
+ }
151
+
152
+ /**
153
+ * Retrieve a *.tmpl file content.
154
+ *
155
+ * @since 1.0.0
156
+ * @param string $name File name.
157
+ * @access private
158
+ * @return string|bool
159
+ */
160
+ public function get_template_by_name( $name ) {
161
+ $file = '';
162
+ $template_dir = sprintf( $this->args['template_dir'], $this->args['slug'], $name );
163
+ $in_uploads = $this->args['upload_dir'] . $template_dir ;
164
+ $in_project = trailingslashit( $this->get_project_root() . $this->args['slug'] ) . $template_dir;
165
+
166
+ if ( file_exists( $in_uploads ) ) {
167
+ $file = $in_uploads;
168
+ } elseif ( $theme_template = locate_template( $template_dir ) ) {
169
+ $file = $theme_template;
170
+ } else {
171
+ $file = $in_project;
172
+ }
173
+
174
+ if ( ! empty( $file ) ) {
175
+ return $this->get_contents( $file );
176
+ } else {
177
+ return false;
178
+ }
179
+ }
180
+
181
+ /**
182
+ * Read template (static).
183
+ *
184
+ * @since 1.0.0
185
+ * @param string $file Correct file path.
186
+ * @access public
187
+ * @return string|bool
188
+ */
189
+ public function get_contents( $file ) {
190
+ global $wp_filesystem;
191
+
192
+ $file = wp_normalize_path( $file );
193
+
194
+ // Check for existence.
195
+ if ( ! $content = $wp_filesystem->get_contents( $file ) ) {
196
+ return false;
197
+ }
198
+
199
+ if ( ! $content ) {
200
+ // Return error object.
201
+ return new WP_Error( 'reading_error', 'Error when reading file' );
202
+ }
203
+
204
+ return $content;
205
+ }
206
+
207
+ /**
208
+ * Returns the instance.
209
+ *
210
+ * @since 1.0.0
211
+ * @return object
212
+ */
213
+ public static function get_instance( $args, $main_class ) {
214
+
215
+ // If the single instance hasn't been set, set it now.
216
+ if ( null == self::$instance ) {
217
+ self::$instance = new self( $args, $main_class );
218
+ }
219
+
220
+ return self::$instance;
221
+ }
222
+ }
223
+ }
cherry-framework/modules/cherry-template-manager/inc/cherry-template-parser.php ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Module Name: Template Parser
4
+ * Description: Module parsed tmpl files.
5
+ * Version: 1.0.0
6
+ * Author: Cherry Team
7
+ * Author URI: http://www.cherryframework.com/
8
+ * License: GPLv3
9
+ * License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
+ *
11
+ * @package Cherry_Framework
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
+ */
19
+
20
+ // If this file is called directly, abort.
21
+ if ( ! defined( 'WPINC' ) ) {
22
+ die;
23
+ }
24
+
25
+ if ( ! class_exists( 'Cherry_Template_Parser' ) ) {
26
+
27
+ /**
28
+ * Class Cherry Template Parser.
29
+ *
30
+ * @since 1.0.0
31
+ */
32
+ class Cherry_Template_Parser {
33
+
34
+ /**
35
+ * A reference to an instance of this class.
36
+ *
37
+ * @since 1.0.0
38
+ * @access private
39
+ * @var object
40
+ */
41
+ private static $instance = null;
42
+
43
+ /**
44
+ * A reference to an instance of this Cherry_Template_Manager class.
45
+ *
46
+ * @since 1.0.0
47
+ * @access private
48
+ * @var object
49
+ */
50
+ private $cherry_template_manager_class = null;
51
+
52
+ /**
53
+ * Module arguments.
54
+ *
55
+ * @since 1.0.0
56
+ * @access private
57
+ * @var array
58
+ */
59
+ private $args = array(
60
+ 'macros_callback' => '/%%.+?%%/',
61
+ 'macros_variable' => '/\$\$.+?\$\$/',
62
+ );
63
+
64
+ /**
65
+ * Keeps the user callbacks class.
66
+ *
67
+ * @since 1.0.0
68
+ * @access private
69
+ * @var object
70
+ */
71
+ private static $callbacks_class = null;
72
+
73
+ /**
74
+ * Cherry_Template_Parser constructor.
75
+ *
76
+ * @since 1.0.0
77
+ * @access public
78
+ * @return void
79
+ */
80
+ public function __construct( $args = array(), $main_class = null ) {
81
+ $this->args = array_merge_recursive(
82
+ $args,
83
+ $this->args
84
+ );
85
+
86
+ $this->cherry_template_manager_class = $main_class;
87
+ }
88
+
89
+ /**
90
+ * Function parsed template.
91
+ *
92
+ * @since 1.0.0
93
+ * @param string $template_name Template Name.
94
+ * @param string|stdClass $class An instance or class name.
95
+ * @param string $macros_callback The regular expression for the callback.
96
+ * @param string $macros_variable The regular expression for the variable.
97
+ * @access public
98
+ * @return string|bool
99
+ */
100
+ public function parsed_template( $template_name = false, $class = false, $macros_callback = false, $macros_variable = false ) {
101
+ if ( $template_name && $class ) {
102
+
103
+ if ( ! $macros_callback ) {
104
+ $macros_callback = $this->args['macros_callback'];
105
+ }
106
+
107
+ if ( ! $macros_variable ) {
108
+ $macros_variable = $this->args['macros_variable'];
109
+ }
110
+
111
+ $search_form_template = $this->cherry_template_manager_class->loader->get_template_by_name( $template_name );
112
+
113
+ if ( ! $search_form_template ) {
114
+ return false;
115
+ }
116
+
117
+ if ( 'string' === gettype( $class ) && class_exists( $class ) ) {
118
+ $class = new $class();
119
+ }
120
+
121
+ if ( $class !== self::$callbacks_class ) {
122
+ self::$callbacks_class = $class;
123
+ }
124
+
125
+ $ouput = preg_replace_callback( $macros_callback, array( $this, 'replace_callback' ), $search_form_template );
126
+ $ouput = preg_replace_callback( $macros_variable, array( $this, 'replace_variable' ), $ouput );
127
+
128
+ return $ouput;
129
+ } else {
130
+ return false;
131
+ }
132
+
133
+ }
134
+
135
+ /**
136
+ * Callback to replace macros with data.
137
+ *
138
+ * @since 1.0.0
139
+ * @param array $matches Founded macros.
140
+ * @access private
141
+ * @return string
142
+ */
143
+ private function replace_callback( $matches ) {
144
+
145
+ if ( ! is_array( $matches ) ) {
146
+ return false;
147
+ }
148
+
149
+ if ( empty( $matches ) ) {
150
+ return false;
151
+ }
152
+
153
+ $item = trim( $matches[0], '%%' );
154
+ $arr = explode( ' ', $item, 2 );
155
+ $macros = strtolower( $arr[0] );
156
+ $attr = isset( $arr[1] ) ? shortcode_parse_atts( $arr[1] ) : array();
157
+
158
+ $callback = array( self::$callbacks_class, 'get_' . $macros );
159
+
160
+ if ( ! is_callable( $callback ) ) {
161
+ return false;
162
+ }
163
+
164
+ if ( ! empty( $attr ) ) {
165
+ // Call a WordPress function.
166
+ return call_user_func( $callback, $attr );
167
+ }
168
+
169
+ return call_user_func( $callback );
170
+ }
171
+
172
+ /**
173
+ * Callback to replace macros with data.
174
+ *
175
+ * @since 1.0.0
176
+ * @param array $matches Founded macros.
177
+ * @access private
178
+ * @return string
179
+ */
180
+ private function replace_variable( $matches ) {
181
+
182
+ if ( ! is_array( $matches ) ) {
183
+ return;
184
+ }
185
+
186
+ if ( empty( $matches ) ) {
187
+ return;
188
+ }
189
+
190
+ $item = trim( $matches[0], '$$' );
191
+ $arr = explode( ' ', $item, 2 );
192
+ $macros = strtoupper( $arr[0] );
193
+
194
+ if ( isset( self::$callbacks_class->variable ) && array_key_exists( $macros, self::$callbacks_class->variable ) ) {
195
+ $variable = self::$callbacks_class->variable[ $macros ];
196
+ } else {
197
+ return;
198
+ }
199
+
200
+ return $variable;
201
+ }
202
+
203
+ /**
204
+ * Returns the instance.
205
+ *
206
+ * @since 1.0.0
207
+ * @return object
208
+ */
209
+ public static function get_instance( $args, $main_class ) {
210
+
211
+ // If the single instance hasn't been set, set it now.
212
+ if ( null == self::$instance ) {
213
+ self::$instance = new self( $args, $main_class );
214
+ }
215
+
216
+ return self::$instance;
217
+ }
218
+ }
219
+ }
cherry-framework/modules/cherry-term-meta/cherry-term-meta.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Module Name: Term Meta
4
  * Description: Manage term metadata
5
- * Version: 1.1.1
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,7 +10,7 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.1.1
14
  * @author Cherry Team <cherryframework@gmail.com>
15
  * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
@@ -29,13 +29,6 @@ if ( ! class_exists( 'Cherry_Term_Meta' ) ) {
29
  */
30
  class Cherry_Term_Meta {
31
 
32
- /**
33
- * Module version
34
- *
35
- * @var string
36
- */
37
- public $module_version = '1.1.1';
38
-
39
  /**
40
  * Module slug
41
  *
@@ -123,6 +116,10 @@ if ( ! class_exists( 'Cherry_Term_Meta' ) ) {
123
 
124
  array_walk( $this->args['fields'], array( $this, 'set_field_types' ) );
125
 
 
 
 
 
126
  $this->ui_builder = $this->core->init_module( 'cherry-ui-elements', $this->field_types );
127
 
128
  return true;
@@ -205,14 +202,27 @@ if ( ! class_exists( 'Cherry_Term_Meta' ) ) {
205
  'upload_button_text' => Cherry_Toolkit::get_arg( $field, 'upload_button_text', 'Choose' ),
206
  'max_value' => Cherry_Toolkit::get_arg( $field, 'max_value', '100' ),
207
  'min_value' => Cherry_Toolkit::get_arg( $field, 'min_value', '0' ),
 
 
208
  'step_value' => Cherry_Toolkit::get_arg( $field, 'step_value', '1' ),
209
  'style' => Cherry_Toolkit::get_arg( $field, 'style', 'normal' ),
 
 
 
 
 
210
  'toggle' => Cherry_Toolkit::get_arg( $field, 'toggle', array(
211
  'true_toggle' => 'On',
212
  'false_toggle' => 'Off',
213
  'true_slave' => '',
214
  'false_slave' => '',
215
  ) ),
 
 
 
 
 
 
216
  );
217
 
218
  $current_element = $this->ui_builder->get_ui_element_instance( $args['type'], $args );
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
  *
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/
29
  */
30
  class Cherry_Term_Meta {
31
 
 
 
 
 
 
 
 
32
  /**
33
  * Module slug
34
  *
116
 
117
  array_walk( $this->args['fields'], array( $this, 'set_field_types' ) );
118
 
119
+ if ( in_array( 'slider', $this->field_types ) ) {
120
+ $this->field_types[] = 'stepper';
121
+ }
122
+
123
  $this->ui_builder = $this->core->init_module( 'cherry-ui-elements', $this->field_types );
124
 
125
  return true;
202
  'upload_button_text' => Cherry_Toolkit::get_arg( $field, 'upload_button_text', 'Choose' ),
203
  'max_value' => Cherry_Toolkit::get_arg( $field, 'max_value', '100' ),
204
  'min_value' => Cherry_Toolkit::get_arg( $field, 'min_value', '0' ),
205
+ 'max' => Cherry_Toolkit::get_arg( $field, 'max', '100' ),
206
+ 'min' => Cherry_Toolkit::get_arg( $field, 'min', '0' ),
207
  'step_value' => Cherry_Toolkit::get_arg( $field, 'step_value', '1' ),
208
  'style' => Cherry_Toolkit::get_arg( $field, 'style', 'normal' ),
209
+ 'display_input' => Cherry_Toolkit::get_arg( $field, 'display_input', true ),
210
+ 'controls' => Cherry_Toolkit::get_arg( $field, 'controls', array() ),
211
+ 'fields' => Cherry_Toolkit::get_arg( $field, 'fields', array() ),
212
+ 'auto_parse' => Cherry_Toolkit::get_arg( $field, 'auto_parse', false ),
213
+ 'icon_data' => Cherry_Toolkit::get_arg( $field, 'icon_data', array() ),
214
  'toggle' => Cherry_Toolkit::get_arg( $field, 'toggle', array(
215
  'true_toggle' => 'On',
216
  'false_toggle' => 'Off',
217
  'true_slave' => '',
218
  'false_slave' => '',
219
  ) ),
220
+ 'class' => Cherry_Toolkit::get_arg( $field, 'class' ),
221
+ 'required' => Cherry_Toolkit::get_arg( $field, 'required', false ),
222
+ 'placeholder' => Cherry_Toolkit::get_arg( $field, 'placeholder' ),
223
+ 'master' => Cherry_Toolkit::get_arg( $field, 'master' ),
224
+ 'title_field' => Cherry_Toolkit::get_arg( $field, 'title_field' ),
225
+ 'ui_kit' => Cherry_Toolkit::get_arg( $field, 'ui_kit', true ),
226
  );
227
 
228
  $current_element = $this->ui_builder->get_ui_element_instance( $args['type'], $args );
cherry-framework/modules/cherry-theme-updater/cherry-theme-updater.php DELETED
@@ -1,141 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * Module Name: Theme Updater
5
- * Description: Provides functionality for updating themes
6
- * Version: 1.1.0
7
- * Author: Cherry Team
8
- * Author URI: http://www.cherryframework.com/
9
- * License: GPLv3
10
- * License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
- *
12
- * @package Cherry_Framework
13
- * @subpackage Modules
14
- * @version 1.1.0
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
- */
20
-
21
- // If this file is called directly, abort.
22
- if ( ! defined( 'WPINC' ) ) {
23
- die;
24
- }
25
-
26
- if ( ! class_exists( 'Cherry_Theme_Updater' ) ) {
27
- require_once( '/inc/cherry-base-updater.php' );
28
-
29
- /**
30
- * Define theme updater class.
31
- *
32
- * @since 1.0.0
33
- */
34
- class Cherry_Theme_Updater extends Cherry_Base_Updater {
35
- /**
36
- * Updater settings.
37
- *
38
- * @var array
39
- */
40
- protected $settings = array();
41
-
42
- /**
43
- * A reference to an instance of this class.
44
- *
45
- * @since 1.0.0
46
- * @var object
47
- */
48
- private static $instance = null;
49
-
50
- /**
51
- * Init class parameters.
52
- *
53
- * @since 1.0.0
54
- * @param object $core core.
55
- * @param array $args Input attributes array.
56
- * @return void
57
- */
58
- public function __construct( $core, $args = array() ) {
59
- /**
60
- * Set default settings
61
- */
62
- $theme_headers = wp_get_theme();
63
-
64
- $this->default_settings['slug'] = $theme_headers->get( 'Name' );
65
- $this->default_settings['repository_name'] = $theme_headers->get( 'Name' );
66
- $this->default_settings['version'] = $theme_headers->get( 'Version' );
67
-
68
- $this->base_init( $args );
69
-
70
- /**
71
- * Need for test update - set_site_transient( 'pre_set_site_transient_', null );
72
- */
73
- add_action( 'pre_set_site_transient_update_themes', array( $this, 'update' ), 1, 1 );
74
- add_filter( 'upgrader_source_selection', array( $this, 'rename_github_folder' ), 11, 3 );
75
- add_filter( 'wp_prepare_themes_for_js', array( $this, 'change_details_url' ) );
76
- }
77
-
78
- /**
79
- * Process update.
80
- *
81
- * @since 1.0.0
82
- * @param object $data Update data.
83
- * @return object
84
- */
85
- public function update( $data ) {
86
- $new_update = $this->check_update();
87
-
88
- if ( $new_update['version'] ) {
89
-
90
- $update = array(
91
- 'theme' => $this->settings['slug'],
92
- 'new_version' => $new_update['version'],
93
- 'url' => $this->settings['details_url'],
94
- 'package' => $new_update['package'],
95
- );
96
-
97
- $data->response[ $this->settings['slug'] ] = $update;
98
- }
99
- return $data;
100
- }
101
-
102
- /**
103
- * Change theme detail URL.
104
- *
105
- * @since 1.0.0
106
- * @param array $prepared_themes array with update parametr.
107
- *
108
- * @return array
109
- */
110
- public function change_details_url( $prepared_themes ) {
111
-
112
- if ( ! empty( $prepared_themes ) ) {
113
-
114
- foreach ( $prepared_themes as $theme_key => $theme_value ) {
115
-
116
- if ( 'cherryframework4' === $theme_key || 'Cherry Framework' === $theme_value['parent'] ) {
117
-
118
- if ( $theme_value['hasUpdate'] ) {
119
-
120
- $prepared_themes[ $theme_key ]['update'] = str_replace( 'class="thickbox"', 'target ="_blank"', $theme_value['update'] );
121
- }
122
-
123
- remove_filter( 'wp_prepare_themes_for_js', array( $this, 'change_details_url' ) );
124
- }
125
- }
126
- }
127
-
128
- return $prepared_themes;
129
- }
130
-
131
- /**
132
- * Returns the instance.
133
- *
134
- * @since 1.0.0
135
- * @return object
136
- */
137
- public static function get_instance( $core, $args ) {
138
- return new self( $core, $args );
139
- }
140
- }
141
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-theme-updater/inc/cherry-base-updater.php DELETED
@@ -1,156 +0,0 @@
1
- <?php
2
- /**
3
- * Class for the base update.
4
- *
5
- * @package Cherry_Base_Updater
6
- * @subpackage Base_Update
7
- * @author Cherry Team <support@cherryframework.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
- */
12
-
13
- // If this file is called directly, abort.
14
- if ( ! defined( 'WPINC' ) ) {
15
- die;
16
- }
17
-
18
- if ( ! class_exists( 'Cherry_Base_Updater' ) ) {
19
-
20
- /**
21
- * Test definitions to allow alpha and beta updates
22
- *
23
- * Disable updates - define('CHERRY_UPDATE', false);
24
- * Enable auto updates - define('CHERRY_ALPHA_UPDATE', true);
25
- * Enable beta updates - define('CHERRY_BETA_UPDATE', true);
26
- */
27
-
28
- /**
29
- * Base updater class.
30
- *
31
- * @since 4.0.0
32
- */
33
- class Cherry_Base_Updater {
34
-
35
- /**
36
- * Default Settings.
37
- *
38
- * @since 4.0.0
39
- * @access protected
40
- * @var array
41
- */
42
- protected $default_settings = array(
43
- 'version' => '',
44
- 'slug' => '',
45
- 'cloud_url' => 'https://cloud.cherryframework.com/cherry-update/',
46
- 'product_name' => 'CherryFramework',
47
- 'repository_name' => '',
48
- );
49
-
50
- /**
51
- * Init class parameters.
52
- *
53
- * @since 4.0.0
54
- * @param array $settings Input attributes array.
55
- * @return void
56
- */
57
- protected function base_init( $settings = array() ) {
58
- $this->settings = array_merge( $this->default_settings, $settings );
59
- }
60
-
61
- /**
62
- * Check if update are avaliable.
63
- *
64
- * @since 4.0.0
65
- * @return array
66
- */
67
- protected function check_update() {
68
- $args = array(
69
- 'user-agent' => 'WordPress',
70
- 'github_repository' => $this->settings['product_name'] . '/' . $this->settings['repository_name'],
71
- 'current_version' => $this->settings['version'],
72
- 'up_query_limit' => false,
73
- 'get_alpha' => false,
74
- 'get_beta' => false,
75
- );
76
-
77
- if ( defined( 'CHERRY_ALPHA_UPDATE' ) ) {
78
- $args['get_alpha'] = true;
79
- }
80
-
81
- if ( defined( 'CHERRY_BETA_UPDATE' ) ) {
82
- $args['get_beta'] = true;
83
- }
84
-
85
- if ( defined( 'CHERRY_UP_QUERY_LIMIT' ) ) {
86
- $args['up_query_limit'] = true;
87
- }
88
-
89
- $response = $this -> remote_query( $args );
90
-
91
- if ( $response && 'not_update' !== $response ) {
92
- $this->settings['details_url'] = $response->details_url;
93
- return array( 'version' => $response->new_version, 'package' => $response->package );
94
- }
95
-
96
- return array( 'version' => false );
97
- }
98
-
99
- /**
100
- * Remote request to updater API.
101
- *
102
- * @since 4.0.0
103
- * @param array $args Request paprams.
104
- * @return array|bool
105
- */
106
- protected function remote_query( $args ) {
107
- $query = add_query_arg( $args, $this->settings['cloud_url'] );
108
-
109
- $response = wp_remote_get( $query );
110
-
111
- if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != '200' ) {
112
- return false;
113
- }
114
-
115
- $response = json_decode( $response['body'] );
116
-
117
- return $response;
118
- }
119
-
120
- /**
121
- * Rename github folder on update.
122
- *
123
- * @since 4.0.0
124
- * @param [type] $upgrate_dir Theme folder name.
125
- * @param [type] $remote_dir Remote folder name.
126
- * @param object $skin_upgrader Upgrader object instance.
127
- * @return string
128
- */
129
- public function rename_github_folder( $upgrate_dir, $remote_dir, $skin_upgrader ) {
130
-
131
- $slug = $this->settings['slug'];
132
- $is_theme = isset( $skin_upgrader->skin->theme ) || isset( $skin_upgrader->skin->theme_info ) ? true : false ;
133
- $is_plugin = isset( $skin_upgrader->skin->plugin_info ) ? true : false ;
134
- $domain_plugin = $is_plugin ? $skin_upgrader->skin->plugin_info['TextDomain'] : '' ;
135
- $title_plugin = $is_plugin ? str_replace( ' ', '-', strtolower( $skin_upgrader->skin->plugin_info['Title'] ) ) : '' ;
136
- $name_plugin = $is_plugin ? str_replace( ' ', '-', strtolower( $skin_upgrader->skin->plugin_info['Name'] ) ) : '' ;
137
-
138
- if ( $is_theme && strpos( $upgrate_dir, $slug ) !== false
139
- || $is_plugin && $domain_plugin === $slug
140
- || $is_plugin && $title_plugin === $slug
141
- || $is_plugin && $name_plugin === $slug
142
- ) {
143
- $upgrate_dir_path = pathinfo( $upgrate_dir );
144
- $new_upgrate_dir = trailingslashit( $upgrate_dir_path['dirname'] ) . trailingslashit( $slug );
145
-
146
- rename( $upgrate_dir, $new_upgrate_dir );
147
-
148
- $upgrate_dir = $new_upgrate_dir;
149
-
150
- remove_filter( 'upgrader_source_selection', array( $this, 'rename_github_folder' ), 11, 3 );
151
- }
152
-
153
- return $upgrate_dir;
154
- }
155
- }
156
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-toolkit/cherry-toolkit.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Module Name: Framework Toolkit
4
  * Description: Framework Toolkit contains various PHP utilities
5
- * Version: 1.1.0
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,6 +10,7 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Class
 
13
  * @author Cherry Team <cherryframework@gmail.com>
14
  * @copyright Copyright (c) 2012 - 2016, Cherry Team
15
  * @link http://www.cherryframework.com/
@@ -28,13 +29,6 @@ if ( ! class_exists( 'Cherry_Toolkit' ) ) {
28
  */
29
  class Cherry_Toolkit {
30
 
31
- /**
32
- * Module version
33
- *
34
- * @var string Module version
35
- */
36
- public $module_version = '1.1.0';
37
-
38
  /**
39
  * Module slug
40
  *
@@ -185,6 +179,23 @@ if ( ! class_exists( 'Cherry_Toolkit' ) ) {
185
  return $array;
186
  }
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  /**
189
  * Remove some keys form array
190
  *
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
  *
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/
29
  */
30
  class Cherry_Toolkit {
31
 
 
 
 
 
 
 
 
32
  /**
33
  * Module slug
34
  *
179
  return $array;
180
  }
181
 
182
+ /**
183
+ * Safely get file content by path
184
+ *
185
+ * @param string $filepath Path to file.
186
+ * @return mixed
187
+ */
188
+ public static function get_file( $filepath ) {
189
+
190
+ if ( ! file_exists( $filepath ) ) {
191
+ return false;
192
+ }
193
+
194
+ ob_start();
195
+ include $filepath;
196
+ return ob_get_clean();
197
+ }
198
+
199
  /**
200
  * Remove some keys form array
201
  *
cherry-framework/modules/cherry-ui-elements/cherry-ui-elements.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Module Name: UI Elements
4
  * Description: Class for the building ui elements
5
- * Version: 1.1.3
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,7 +10,7 @@
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/
@@ -52,6 +52,7 @@ if ( ! class_exists( 'Cherry_UI_Elements' ) ) {
52
  'slider',
53
  'repeater',
54
  'iconpicker',
 
55
  ),
56
  );
57
 
@@ -104,22 +105,23 @@ if ( ! class_exists( 'Cherry_UI_Elements' ) ) {
104
  * Require UI-elements.
105
  *
106
  * @since 1.0.0
 
107
  * @return void
108
  */
109
  public function ui_elements_require() {
110
 
111
  // Add I_UI interface.
112
  if ( ! interface_exists( 'I_UI' ) ) {
113
- require_once( __DIR__ . '/i-ui.php' );
114
  }
115
 
116
  if ( ! class_exists( 'UI_Element' ) ) {
117
- require_once( __DIR__ . '/ui-element.php' );
118
  }
119
 
120
  if ( ! empty( $this->args['ui_elements'] ) ) {
121
  foreach ( $this->args['ui_elements'] as $ui_element ) {
122
- require_once( __DIR__ . '/inc/ui-elements/ui-' . $ui_element . '/ui-' . $ui_element . '.php' );
123
  }
124
  }
125
  }
2
  /**
3
  * Module Name: UI Elements
4
  * Description: Class for the building ui elements
5
+ * Version: 1.3.0
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
+ * @version 1.3.0
14
  * @author Cherry Team <cherryframework@gmail.com>
15
  * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
52
  'slider',
53
  'repeater',
54
  'iconpicker',
55
+ 'button',
56
  ),
57
  );
58
 
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
  }
cherry-framework/modules/cherry-ui-elements/i-ui.php CHANGED
@@ -7,7 +7,7 @@
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
  */
12
 
13
  /**
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-3.0.html
11
  */
12
 
13
  /**
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/min/ui-button.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .ui-button{padding:16px 30px;display:inline-block;background-color:#96989a;font-weight:900;text-transform:uppercase;color:#fff;box-shadow:0px 0px 13px rgba(0,0,0,0.2);cursor:pointer;border-radius:4px;border:none;-webkit-transition:background 300ms ease-in-out;transition:background 300ms ease-in-out}.ui-button:hover{background-color:#b4b7ba}.ui-button:focus{outline:none}.ui-button.ui-button-normal-style{background-color:#495159}.ui-button.ui-button-normal-style:hover{background-color:#393f45}.ui-button.ui-button-success-style{background-color:#48c569}.ui-button.ui-button-success-style:hover{background-color:#3ba956}.ui-button.ui-button-primary-style{background-color:#298ffc}.ui-button.ui-button-primary-style:hover{background-color:#206ff4}.ui-button.ui-button-danger-style{background-color:#e54343}.ui-button.ui-button-danger-style:hover{background-color:#c73434}.ui-button.ui-button-warning-style{background-color:#faa730}.ui-button.ui-button-warning-style:hover{background-color:#ee8425}
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-button.scss ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import "ui-kit/variables";
2
+ @import "ui-kit/mixins";
3
+
4
+ .ui-button{
5
+ padding: 16px 30px;
6
+ display: inline-block;
7
+ background-color: $grey_color_1;
8
+ font-weight: 900;
9
+ text-transform: uppercase;
10
+ color: #fff;
11
+ box-shadow: 0px 0px 13px rgba(0, 0, 0, 0.2);
12
+ cursor: pointer;
13
+ border-radius: 4px;
14
+ border: none;
15
+ transition: background 300ms ease-in-out;
16
+ &:hover{
17
+ background-color: $grey_color_4;
18
+ }
19
+ &:focus{
20
+ outline: none;
21
+ }
22
+ &.ui-button-normal-style{
23
+ background-color: $normal_color;
24
+ &:hover{
25
+ background-color: $normal_color_h;
26
+ }
27
+ }
28
+ &.ui-button-success-style{
29
+ background-color: $green_color;
30
+ &:hover{
31
+ background-color: $green_color_h;
32
+ }
33
+ }
34
+ &.ui-button-primary-style{
35
+ background-color: $blue_color;
36
+ &:hover{
37
+ background-color: $blue_color_h;
38
+ }
39
+ }
40
+ &.ui-button-danger-style{
41
+ background-color: $red_color;
42
+ &:hover{
43
+ background-color: $red_color_h;
44
+ }
45
+ }
46
+ &.ui-button-warning-style{
47
+ background-color: $orange_color;
48
+ &:hover{
49
+ background-color: $orange_color_h;
50
+ }
51
+ }
52
+ }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-kit/_mixins.scss ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @mixin button_base() {
2
+ display: inline-block;
3
+ text-decoration: none;
4
+ font-size: 12px;
5
+ line-height: 20px;
6
+ font-weight: bold;
7
+ padding: 15px 20px;
8
+ color: #fff;
9
+ text-transform: uppercase;
10
+ border-radius: $border_radius_small;
11
+ transition: all 200ms linear;
12
+ box-shadow: $box_shadow;
13
+ &:hover {
14
+ color: #fff;
15
+ box-shadow: none;
16
+ }
17
+ &:focus,
18
+ &:active {
19
+ outline: none;
20
+ box-shadow: none;
21
+ color: #fff;
22
+ }
23
+ }
24
+
25
+ @mixin button_normal() {
26
+ background: $dark_color_2;
27
+ &:hover {
28
+ background: $dark_color_2_h;
29
+ }
30
+ }
31
+
32
+ @mixin button_primary() {
33
+ background: $blue_color;
34
+ &:hover {
35
+ background: $blue_color_h;
36
+ }
37
+ }
38
+
39
+ @mixin button_success() {
40
+ background: $green_color;
41
+ &:hover {
42
+ background: $green_color_h;
43
+ }
44
+ }
45
+
46
+ @mixin button_danger() {
47
+ background: $red_color;
48
+ &:hover {
49
+ background: $red_color_h;
50
+ }
51
+ }
52
+
53
+ @mixin button_warning() {
54
+ background: $orange_color;
55
+ &:hover {
56
+ background: $orange_color_h;
57
+ }
58
+ }
59
+
60
+ @mixin input() {
61
+ font-size: 14px;
62
+ line-height: 20px;
63
+ color: $dark_color_1;
64
+ background-color: $grey_color_3;
65
+ border-radius: $border_radius_extra_small;
66
+ padding: 10px 20px;
67
+ min-height: 50px;
68
+ border: 1px solid $grey_color_3;
69
+ box-shadow: none;
70
+ &:focus{
71
+ border-color: rgba(72,197,105,.6);
72
+ box-shadow: 0 0 2px rgba(72,197,105,.6);
73
+ }
74
+ }
75
+
76
+ @mixin button_icon( $icon ) {
77
+ content: $icon;
78
+ display: inline-block;
79
+ font-family: dashicons;
80
+ font-size: 16px;
81
+ font-style: normal;
82
+ font-weight: 400;
83
+ height: 18px;
84
+ line-height: 18px;
85
+ text-align: center;
86
+ text-decoration: inherit;
87
+ transition: all 200ms linear;
88
+ vertical-align: middle;
89
+ }
90
+
91
+ @mixin button_icon_before( $icon ) {
92
+ &:before {
93
+ @include button_icon( $icon );
94
+ padding: 0 5px 0 0;
95
+ }
96
+ }
97
+
98
+ @mixin button_icon_after( $icon ) {
99
+ &:after {
100
+ @include button_icon( $icon );
101
+ padding: 0 0 0 5px;
102
+ }
103
+ }
104
+
105
+ @mixin button_icon_middle( $icon ) {
106
+ &:before {
107
+ @include button_icon( $icon );
108
+ margin: 0 -5px;
109
+ }
110
+ }
111
+
112
+ @mixin link() {
113
+ display: inline-block;
114
+ text-decoration: none;
115
+ font-size: 12px;
116
+ line-height: 20px;
117
+ font-weight: bold;
118
+ color: $blue_color;
119
+ text-transform: uppercase;
120
+ transition: all 200ms linear;
121
+ &:hover {
122
+ color: $dark_color_1;
123
+ box-shadow: none;
124
+ }
125
+ &:focus,
126
+ &:active {
127
+ outline: none;
128
+ box-shadow: none;
129
+ color: $blue_color;
130
+ }
131
+ }
132
+
133
+ @mixin link_icon_before( $icon ) {
134
+ &:before {
135
+ @include button_icon( $icon );
136
+ padding: 0 5px 0 0;
137
+ color: $grey_color_4;
138
+ }
139
+ &:hover {
140
+ &:before {
141
+ color: $blue_color;
142
+ }
143
+ }
144
+ }
145
+
146
+ @mixin container() {
147
+ padding: 30px;
148
+ border: 2px solid $grey_color_2;
149
+ background: $grey_color_3;
150
+ border-radius: $border_radius_large;
151
+ }
152
+
153
+ @mixin container_heading() {
154
+ margin: -30px -30px 30px -30px;
155
+ border-radius: $border_radius_large $border_radius_large 0 0;
156
+ border-bottom: 1px solid $grey_color_2;
157
+ padding: 20px 30px;
158
+ font-weight: bold;
159
+ font-size: 16px;
160
+ line-height: 18px;
161
+ text-align: center;
162
+ background: #fff;
163
+ }
164
+
165
+ @mixin box() {
166
+ margin: 0 0 30px;
167
+ padding: 20px;
168
+ background: #fff;
169
+ box-shadow: $box_shadow_box;
170
+ border-radius: $border_radius;
171
+ }
172
+
173
+ @mixin box_heading() {
174
+ margin: -20px -20px 20px -20px;
175
+ border-radius: $border_radius_small $border_radius_small 0 0;
176
+ border-bottom: 1px solid $grey_color_2;
177
+ padding: 20px 30px;
178
+ font-weight: bold;
179
+ font-size: 16px;
180
+ line-height: 18px;
181
+ background: #fff;
182
+ }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-kit/_variables.scss ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $dark_color_1: #23282d;
2
+ $dark_color_2: #495159;
3
+ $dark_color_2_h: #393f45;
4
+ $grey_color_1: #96989a;
5
+ $grey_color_2: #e5e5e5;
6
+ $grey_color_3: #f1f1f1;
7
+ $grey_color_4: #b4b7ba;
8
+ $normal_color: #495159;
9
+ $normal_color_h: #393f45;
10
+ $blue_color: #298ffc;
11
+ $blue_color_h: #206ff4;
12
+ $green_color: #48c569;
13
+ $green_color_h: #3ba956;
14
+ $red_color: #e54343;
15
+ $red_color_h: #c73434;
16
+ $orange_color: #faa730;
17
+ $orange_color_h: #ee8425;
18
+
19
+ $border_radius_extra_small: 2px;
20
+ $border_radius_small: 4px;
21
+ $border_radius_medium: 6px;
22
+ $border_radius_large: 8px;
23
+
24
+ $box_shadow: 0 5px 13px rgba(0,0,0,.18);
25
+ $box_shadow_box: 0 8px 21px rgba(0,0,0,.1);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/ui-button.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class for the building ui-button elements.
4
+ *
5
+ * @package Cherry_Framework
6
+ * @subpackage Class
7
+ * @author Cherry Team <support@cherryframework.com>
8
+ * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
+ * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+
18
+ if ( ! class_exists( 'UI_Button' ) ) {
19
+
20
+ /**
21
+ * Class for the building ui-text elements.
22
+ */
23
+ class UI_Button extends UI_Element implements I_UI {
24
+
25
+ /**
26
+ * Default settings
27
+ *
28
+ * @var array
29
+ */
30
+ private $defaults_settings = array(
31
+ 'type' => 'text',
32
+ 'id' => 'cherry-ui-button-id',
33
+ 'name' => 'cherry-ui-button-name',
34
+ 'value' => 'button',
35
+ 'disabled' => false,
36
+ 'form' => '',
37
+ 'formaction' => '',
38
+ 'type' => 'button',
39
+ 'style' => 'normal',
40
+ 'content' => 'Button',
41
+ 'class' => '',
42
+ 'master' => '',
43
+ );
44
+
45
+ /**
46
+ * Constructor method for the UI_Text class.
47
+ *
48
+ * @since 4.0.0
49
+ */
50
+ function __construct( $args = array() ) {
51
+ $this->defaults_settings['id'] = 'cherry-ui-button-' . uniqid();
52
+ $this->settings = wp_parse_args( $args, $this->defaults_settings );
53
+
54
+ add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
55
+ }
56
+
57
+ /**
58
+ * Render html UI_Text.
59
+ *
60
+ * @since 4.0.0
61
+ */
62
+ public function render() {
63
+ $html = Cherry_Toolkit::render_view(
64
+ dirname( __FILE__ ) . '/view/button-view.php',
65
+ $this->settings
66
+ );
67
+
68
+ return $html;
69
+ }
70
+
71
+ /**
72
+ * Enqueue javascript and stylesheet UI_Text
73
+ *
74
+ * @since 4.0.0
75
+ */
76
+ public static function enqueue_assets() {
77
+
78
+ wp_enqueue_style(
79
+ 'ui-button',
80
+ esc_url( Cherry_Core::base_url( 'assets/min/ui-button.min.css', __FILE__ ) ),
81
+ array(),
82
+ '1.0.0',
83
+ 'all'
84
+ );
85
+ }
86
+ }
87
+ }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/view/button-view.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ui-Button view
4
+ *
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
+ */
12
+
13
+ // If this file is called directly, abort.
14
+ if ( ! defined( 'WPINC' ) ) {
15
+ die;
16
+ }
17
+
18
+ $attrs = Cherry_Toolkit::join(
19
+ array(
20
+ 'type' => $__data['type'],
21
+ 'id' => $__data['id'],
22
+ 'name' => $__data['name'],
23
+ 'class' => 'ui-button ui-button-' . $__data['style'] . '-style ' . $__data['master'] . $__data['class'],
24
+ 'disabled' => filter_var( $__data['disabled'], FILTER_VALIDATE_BOOLEAN ),
25
+ 'form' => $__data['form'],
26
+ 'formaction' => $__data['formaction'],
27
+ )
28
+ );
29
+ ?>
30
+
31
+ <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,56 +1 @@
1
- .cherry-ui-container {
2
- margin: 10px 0 20px 0; }
3
-
4
- label.cherry-label {
5
- margin: 0 0 5px 0;
6
- display: block; }
7
-
8
- .cherry-checkbox-item {
9
- width: 26px;
10
- height: 26px;
11
- display: inline-block;
12
- border-radius: 2px;
13
- margin-right: 10px;
14
- margin-bottom: 6px;
15
- cursor: pointer;
16
- position: relative;
17
- background-color: #f1f1f1;
18
- -webkit-user-select: none;
19
- -moz-user-select: none;
20
- -ms-user-select: none;
21
- user-select: none;
22
- -webkit-transition: all 0.2s ease-out;
23
- transition: all 0.2s ease-out; }
24
- .cherry-checkbox-item .marker {
25
- position: absolute;
26
- width: 26px;
27
- height: 26px;
28
- top: 0px;
29
- left: 0px;
30
- color: #fff;
31
- font-size: 28px;
32
- -webkit-transform: scale(0);
33
- -ms-transform: scale(0);
34
- transform: scale(0);
35
- -webkit-transition: all 0.3s cubic-bezier(0.27, 0.63, 0.54, 0.96);
36
- transition: all 0.3s cubic-bezier(0.27, 0.63, 0.54, 0.96); }
37
- .cherry-checkbox-item .marker:before {
38
- position: relative;
39
- left: -2px; }
40
- .cherry-checkbox-item.checked {
41
- background-color: #48c569; }
42
- .cherry-checkbox-item.checked .marker {
43
- -webkit-transform: scale(1);
44
- -ms-transform: scale(1);
45
- transform: scale(1); }
46
-
47
- .cherry-checkbox-label {
48
- display: inline-block;
49
- vertical-align: top;
50
- font-size: 14px;
51
- line-height: 26px;
52
- color: #23282d;
53
- -webkit-user-select: none;
54
- -moz-user-select: none;
55
- -ms-user-select: none;
56
- user-select: none; }
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);-ms-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);-ms-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-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,c){"use strict";c.utilites.namespace("ui_elements.checkbox"),c.ui_elements.checkbox={init:function(){e(document).on("ready",this.render),e(window).on("cherry-ui-elements-init",this.render)},render:function(c){var i=c._target?c._target:e("body");e('.cherry-checkbox-input[type="hidden"]',i).each(function(){var c=e(this),t=c.data("slave"),s="true"===c.val();s||e("."+t,i).stop().hide()}),e(".cherry-checkbox-item",i).on("click",function(){var c=e(this).siblings('.cherry-checkbox-input[type="hidden"]'),t=c.data("slave"),s="true"===c.val();e(this).hasClass("checked")?(e(this).removeClass("checked"),c.val("false"),s=!1,e("."+t,i).hide()):(e(this).addClass("checked"),c.val("true"),s=!0,e("."+t,i).show()),c.trigger("change")}),e(".cherry-checkbox-label",i).on("click",function(){var c=e(this).siblings('.cherry-checkbox-input[type="hidden"]'),t=e(this).siblings(".cherry-checkbox-item"),s=c.data("slave"),h="true"===c.val();t.hasClass("checked")?(t.removeClass("checked"),c.val("false"),h=!1,e("."+s,i).hide()):(t.addClass("checked"),c.val("true"),h=!0,e("."+s,i).show()),c.trigger("change")})}},c.ui_elements.checkbox.init()}(jQuery,window.CherryJsCore);
1
+ !function(e,t){"use strict";t.utilites.namespace("ui_elements.checkbox"),t.ui_elements.checkbox={inputClass:'.cherry-checkbox-input[type="hidden"]:not([name*="__i__"])',labelClass:".cherry-checkbox-label, .cherry-checkbox-item",wrapperClass:".widget, .postbox, .cherry-form",init:function(){e(document).on("ready.cherry-ui-elements-init",this.addEvent.bind(this)).on("cherry-ui-elements-init",this.initState.bind(this))},addEvent:function(){e("body").on("click.masterSlave",this.labelClass,this.switchState.bind(this)),this.initState()},initState:function(){for(var t,i,s=e(this.inputClass),a=s.length-1;a>=0;a--)t=e(s[a]),i=t.data(),jQuery.isEmptyObject(i)||e("."+i.slave)[t[0].checked?"removeClass":"addClass"]("hide")},switchState:function(t){var i=e(t.currentTarget).siblings(this.inputClass),s=i.data(),a=i[0].checked,n=i.closest(this.wrapperClass);i.val(a?"false":"true").attr("checked",a?!1:!0).trigger("change"),jQuery.isEmptyObject(s)||e("."+s.slave,n)[a?"addClass":"removeClass"]("hide")}},t.ui_elements.checkbox.init()}(jQuery,window.CherryJsCore);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-checkbox.js CHANGED
@@ -6,67 +6,50 @@
6
 
7
  CherryJsCore.utilites.namespace('ui_elements.checkbox');
8
  CherryJsCore.ui_elements.checkbox = {
 
 
 
 
9
  init: function () {
10
- $( document ).on( 'ready', this.render );
11
- $( window ).on( 'cherry-ui-elements-init', this.render );
 
12
  },
13
- render: function ( event ) {
14
- var target = ( event._target ) ? event._target : $( 'body' );
15
-
16
- $( '.cherry-checkbox-input[type="hidden"]', target ).each( function() {
17
- var $this = $( this ),
18
- this_slave = $this.data( 'slave' ),
19
- state = ( $this.val() === 'true' );
20
-
21
- if ( ! state ) {
22
- $( '.'+ this_slave, target ).stop().hide();
23
- }
24
- });
25
-
26
- $( '.cherry-checkbox-item', target ).on( 'click', function() {
27
- var input = $( this ).siblings( '.cherry-checkbox-input[type="hidden"]' ),
28
- slave = input.data( 'slave' ),
29
- state = ( input.val() === 'true' );
30
-
31
- if ( $( this ).hasClass( 'checked' ) ) {
32
- $( this ).removeClass( 'checked' );
33
- input.val( 'false' );
34
- state = false;
35
-
36
- $( '.' + slave, target ).hide();
37
- } else {
38
- $( this ).addClass( 'checked' );
39
- input.val( 'true' );
40
- state = true;
41
-
42
- $( '.' + slave, target ).show();
43
- }
44
-
45
- input.trigger( 'change' );
46
- } );
47
-
48
- $( '.cherry-checkbox-label', target ).on( 'click', function() {
49
- var input = $( this ).siblings( '.cherry-checkbox-input[type="hidden"]' ),
50
- item = $( this ).siblings( '.cherry-checkbox-item' ),
51
- slave = input.data( 'slave' ),
52
- state = ( input.val() === 'true' );
53
-
54
- if ( item.hasClass( 'checked' ) ) {
55
- item.removeClass( 'checked' );
56
- input.val( 'false' );
57
- state = false;
58
-
59
- $( '.' + slave, target ).hide();
60
  } else {
61
- item.addClass( 'checked' );
62
- input.val( 'true' );
63
- state = true;
64
-
65
- $( '.' + slave, target ).show();
66
  }
67
-
68
- input.trigger( 'change' );
69
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  }
71
  };
72
 
6
 
7
  CherryJsCore.utilites.namespace('ui_elements.checkbox');
8
  CherryJsCore.ui_elements.checkbox = {
9
+ inputClass: '.cherry-checkbox-input[type="hidden"]:not([name*="__i__"])',
10
+ labelClass: '.cherry-checkbox-label, .cherry-checkbox-item',
11
+ wrapperClass: '.widget, .postbox, .cherry-form',
12
+
13
  init: function () {
14
+ $( document )
15
+ .on( 'ready.cherry-ui-elements-init', this.addEvent.bind( this ) )
16
+ .on( 'cherry-ui-elements-init', this.initState.bind( this ) );
17
  },
18
+ addEvent: function () {
19
+ $( 'body' ).on( 'click.masterSlave', this.labelClass, this.switchState.bind( this ) );
20
+ this.initState();
21
+ },
22
+ initState: function (){
23
+ var $_input = $( this.inputClass ),
24
+ i = $_input.length - 1,
25
+ $_target,
26
+ data;
27
+
28
+ for (; i >= 0; i--) {
29
+ $_target = $( $_input[ i ] );
30
+ data = $_target.data();
31
+
32
+ if ( jQuery.isEmptyObject( data ) ) {
33
+ continue;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  } else {
35
+ $( '.' + data.slave )[ ( $_target[ 0 ].checked ) ? 'removeClass' : 'addClass' ]( 'hide' );
 
 
 
 
36
  }
37
+ }
38
+ },
39
+ switchState: function ( event ) {
40
+ var $_input = $( event.currentTarget ).siblings( this.inputClass ),
41
+ data = $_input.data(),
42
+ flag = $_input[0].checked,
43
+ wrapper = $_input.closest( this.wrapperClass );
44
+
45
+ $_input
46
+ .val( ( flag ) ? 'false' : 'true' )
47
+ .attr( 'checked', ( flag ) ? false : true )
48
+ .trigger('change');
49
+
50
+ if ( ! jQuery.isEmptyObject( data ) ) {
51
+ $( '.' + data.slave, wrapper )[ ( flag ) ? 'addClass' : 'removeClass' ]( 'hide' );
52
+ }
53
  }
54
  };
55
 
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-checkbox.scss CHANGED
@@ -8,6 +8,9 @@ label.cherry-label{
8
  margin: 0 0 5px 0;
9
  display: block;
10
  }
 
 
 
11
  .cherry-checkbox-item{
12
  width: 26px;
13
  height: 26px;
@@ -19,7 +22,7 @@ label.cherry-label{
19
  position: relative;
20
  background-color: $grey_color_3;
21
  user-select: none;
22
- transition: all 0.2s ease-out;
23
  .marker{
24
  position: absolute;
25
  width: 26px;
@@ -28,19 +31,22 @@ label.cherry-label{
28
  left: 0px;
29
  color: #fff;
30
  font-size: 28px;
 
31
  transform: scale(0);
32
- transition: all 0.3s cubic-bezier(.27,.63,.54,.96);
33
  &:before{
 
34
  position: relative;
35
  left: -2px;
36
  }
37
  }
38
- &.checked{
39
- background-color: $green_color;
40
- .marker{
41
- transform: scale(1);
42
- }
 
43
  }
 
44
  }
45
  .cherry-checkbox-label{
46
  display: inline-block;
@@ -49,4 +55,4 @@ label.cherry-label{
49
  line-height: 26px;
50
  color: $dark_color_1;
51
  user-select: none;
52
- }
8
  margin: 0 0 5px 0;
9
  display: block;
10
  }
11
+ .hide{
12
+ display: none !important;
13
+ }
14
  .cherry-checkbox-item{
15
  width: 26px;
16
  height: 26px;
22
  position: relative;
23
  background-color: $grey_color_3;
24
  user-select: none;
25
+ transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
26
  .marker{
27
  position: absolute;
28
  width: 26px;
31
  left: 0px;
32
  color: #fff;
33
  font-size: 28px;
34
+ transition:inherit;
35
  transform: scale(0);
 
36
  &:before{
37
+ transition:inherit;
38
  position: relative;
39
  left: -2px;
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
  }
51
  .cherry-checkbox-label{
52
  display: inline-block;
55
  line-height: 26px;
56
  color: $dark_color_1;
57
  user-select: none;
58
+ }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/ui-checkbox.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -50,7 +50,7 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
50
  * @since 4.0.0
51
  */
52
  function __construct( $args = array() ) {
53
- $this->defaults_settings['id'] = 'cherry-ui-checkbox-'.uniqid();
54
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
55
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
56
  }
@@ -62,9 +62,10 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
62
  */
63
  public function render() {
64
  $html = '';
65
- $master_class = ! empty( $this->settings['master'] ) && isset( $this->settings['master'] ) ? esc_html( $this->settings['master'] ) : '';
 
66
 
67
- $html .= '<div class="cherry-ui-container ' . $master_class . '">';
68
 
69
  $counter = 0;
70
  if ( $this->settings['options'] && ! empty( $this->settings['options'] ) && is_array( $this->settings['options'] ) ) {
@@ -90,9 +91,9 @@ if ( ! class_exists( 'UI_Checkbox' ) ) {
90
  $option_label = isset( $option_value ) && is_array( $option_value ) ? $option_value['label'] : $option_value;
91
  $data_slave = isset( $option_value['slave'] ) && ! empty( $option_value['slave'] ) ? ' data-slave="' . $option_value['slave'] . '"' : '';
92
 
93
- $html .= '<div class="cherry-checkbox-item-wrap ' . esc_attr( $this->settings['class'] ) . '">';
94
- $html .= '<div class="cherry-checkbox-item ' . $checked . '"><span class="marker dashicons dashicons-yes"></span></div>';
95
- $html .= '<input type="hidden" id="' . esc_attr( $this->settings['id'] ) . '-' . $counter . '" class="cherry-checkbox-input" name="' . esc_attr( $this->settings['name'] ) . '['. $option .']" value="' . esc_html( $item_value ) . '"' . $data_slave . '>';
96
  $html .= '<label class="cherry-checkbox-label" for="' . esc_attr( $this->settings['id'] ) . '-' . $counter . '">' . esc_html( $option_label ) . '</label> ';
97
  $html .= '</div>';
98
 
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
50
  * @since 4.0.0
51
  */
52
  function __construct( $args = array() ) {
53
+ $this->defaults_settings['id'] = 'cherry-ui-checkbox-' . uniqid();
54
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
55
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
56
  }
62
  */
63
  public function render() {
64
  $html = '';
65
+ $class = $this->settings['class'];
66
+ $class .= ' ' . $this->settings['master'];
67
 
68
+ $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
69
 
70
  $counter = 0;
71
  if ( $this->settings['options'] && ! empty( $this->settings['options'] ) && is_array( $this->settings['options'] ) ) {
91
  $option_label = isset( $option_value ) && is_array( $option_value ) ? $option_value['label'] : $option_value;
92
  $data_slave = isset( $option_value['slave'] ) && ! empty( $option_value['slave'] ) ? ' data-slave="' . $option_value['slave'] . '"' : '';
93
 
94
+ $html .= '<div class="cherry-checkbox-item-wrap">';
95
+ $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 . '>';
96
+ $html .= '<div class="cherry-checkbox-item"><span class="marker dashicons dashicons-yes"></span></div>';
97
  $html .= '<label class="cherry-checkbox-label" for="' . esc_attr( $this->settings['id'] ) . '-' . $counter . '">' . esc_html( $option_label ) . '</label> ';
98
  $html .= '</div>';
99
 
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/min/ui-colorpicker.min.css CHANGED
@@ -1,41 +1 @@
1
- .cherry-ui-container {
2
- margin: 10px 0 20px 0; }
3
-
4
- label.cherry-label {
5
- margin: 0 0 5px 0;
6
- display: block; }
7
-
8
- .wp-picker-container {
9
- display: block;
10
- background-color: #f1f1f1;
11
- border-radius: 2px;
12
- display: inline-block;
13
- padding: 8px;
14
- max-width: 380px; }
15
- .wp-picker-container a.wp-color-result {
16
- border: medium none;
17
- box-shadow: none;
18
- height: 36px;
19
- margin: 0;
20
- border-radius: 0;
21
- padding-left: 36px; }
22
- .wp-picker-container a.wp-color-result:after {
23
- background-color: #f1f1f1;
24
- border: medium none;
25
- border-radius: 0;
26
- line-height: 36px;
27
- font-size: 14px;
28
- color: #23282d;
29
- padding: 0 80px 0 20px; }
30
- @media screen and (max-width: 782px) {
31
- .wp-picker-container a.wp-color-result {
32
- height: 36px; }
33
- .wp-picker-container a.wp-color-result:after {
34
- line-height: 36px; } }
35
- .wp-picker-container .wp-picker-holder {
36
- position: absolute;
37
- z-index: 1000; }
38
- .wp-picker-container .wp-picker-input-wrap input[type="text"] {
39
- padding: 7px 4px; }
40
- .wp-picker-container .wp-picker-input-wrap input.wp-picker-clear {
41
- height: 32px; }
1
+ .cherry-ui-container{margin:10px 0 20px 0}label.cherry-label{margin:0 0 5px 0;display:block}.wp-picker-container{display:block;background-color:#f1f1f1;border-radius:2px;display:inline-block;padding:8px;max-width:380px}.wp-picker-container a.wp-color-result{border:medium none;box-shadow:none;height:35px;margin:0;border-radius:0;padding-left:36px}.wp-picker-container a.wp-color-result:after{background-color:#f1f1f1;border:medium none;border-radius:0;line-height:36px;font-size:14px;color:#23282d;padding:0 80px 0 20px}@media screen and (max-width: 782px){.wp-picker-container a.wp-color-result{height:36px}.wp-picker-container a.wp-color-result:after{line-height:36px}}.wp-picker-container .wp-picker-holder{position:absolute;z-index:1000}.wp-picker-container .wp-picker-input-wrap input[type="text"]{padding:7px 4px}.wp-picker-container .wp-picker-input-wrap input.wp-picker-clear{height:32px}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/min/ui-colorpicker.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,r){"use strict";r.utilites.namespace("ui_elements.colorpicker"),r.ui_elements.colorpicker={init:function(){e(document).on("ready",this.render),e(window).on("cherry-ui-elements-init",this.render)},render:function(r){var i=r._target?r._target:e("body"),n=e('input.cherry-ui-colorpicker:not([name*="__i__"])',i);n[0]&&n.wpColorPicker()}},r.ui_elements.colorpicker.init()}(jQuery,window.CherryJsCore);
1
+ !function(e,r){"use strict";r.utilites.namespace("ui_elements.colorpicker"),r.ui_elements.colorpicker={init:function(){e(document).on("ready",this.render).on("cherry-ui-elements-init",this.render)},render:function(r){var i=r._target?r._target:e("body"),n=e('input.cherry-ui-colorpicker:not([name*="__i__"])',i);n[0]&&n.wpColorPicker()}},r.ui_elements.colorpicker.init()}(jQuery,window.CherryJsCore);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-colorpicker.js CHANGED
@@ -7,8 +7,9 @@
7
  CherryJsCore.utilites.namespace('ui_elements.colorpicker');
8
  CherryJsCore.ui_elements.colorpicker = {
9
  init: function () {
10
- $( document ).on( 'ready', this.render );
11
- $( window ).on( 'cherry-ui-elements-init', this.render );
 
12
  },
13
  render: function ( event ) {
14
  var target = ( event._target ) ? event._target : $( 'body' ),
7
  CherryJsCore.utilites.namespace('ui_elements.colorpicker');
8
  CherryJsCore.ui_elements.colorpicker = {
9
  init: function () {
10
+ $( document )
11
+ .on( 'ready', this.render )
12
+ .on( 'cherry-ui-elements-init', this.render );
13
  },
14
  render: function ( event ) {
15
  var target = ( event._target ) ? event._target : $( 'body' ),
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-colorpicker.scss CHANGED
@@ -18,7 +18,7 @@ label.cherry-label{
18
  a.wp-color-result{
19
  border: medium none;
20
  box-shadow: none;
21
- height: 36px;
22
  margin: 0;
23
  border-radius: 0;
24
  padding-left: 36px;
@@ -50,4 +50,4 @@ label.cherry-label{
50
  height: 32px;
51
  }
52
  }
53
- }
18
  a.wp-color-result{
19
  border: medium none;
20
  box-shadow: none;
21
+ height: 35px;
22
  margin: 0;
23
  border-radius: 0;
24
  padding-left: 36px;
50
  height: 32px;
51
  }
52
  }
53
+ }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/ui-colorpicker.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -43,7 +43,7 @@ if ( ! class_exists( 'UI_Colorpicker' ) ) {
43
  */
44
  function __construct( $args = array() ) {
45
 
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' ) );
@@ -56,15 +56,15 @@ if ( ! class_exists( 'UI_Colorpicker' ) ) {
56
  */
57
  public function render() {
58
  $html = '';
 
 
59
 
60
- $master_class = ! empty( $this->settings['master'] ) && isset( $this->settings['master'] ) ? esc_html( $this->settings['master'] ) : '';
61
-
62
- $html .= '<div class="cherry-ui-container ' . $master_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 '. esc_attr( $this->settings['class'] ) . '" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '"/>';
68
  $html .= '</div>';
69
  $html .= '</div>';
70
 
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
43
  */
44
  function __construct( $args = array() ) {
45
 
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' ) );
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
 
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/min/ui-iconpicker.min.css CHANGED
@@ -1,326 +1 @@
1
- .cherry-ui-iconpicker-group {
2
- max-width: 230px;
3
- position: relative; }
4
- .cherry-ui-iconpicker-group .input-group-addon {
5
- position: absolute;
6
- width: 36px;
7
- height: 36px;
8
- left: 0px;
9
- top: 0px;
10
- background: #f1f1f1;
11
- font-size: 14px;
12
- line-height: 36px;
13
- text-align: center;
14
- border-radius: 3px 0 0 3px;
15
- border-right: 1px solid #dddcdc;
16
- margin: 7px; }
17
- .cherry-ui-iconpicker-group .cherry-ui-text {
18
- font-size: 14px;
19
- line-height: 20px;
20
- color: #23282d;
21
- background-color: #f1f1f1;
22
- border-radius: 2px;
23
- padding: 10px 20px;
24
- height: 50px;
25
- border: 1px solid #f1f1f1;
26
- box-shadow: none;
27
- padding-left: 60px; }
28
- .cherry-ui-iconpicker-group .cherry-ui-text:focus {
29
- border-color: rgba(72, 197, 105, 0.6);
30
- box-shadow: 0 0 2px rgba(72, 197, 105, 0.6); }
31
-
32
- .iconpicker-popover.popover {
33
- position: absolute;
34
- top: 0;
35
- left: 0;
36
- display: none;
37
- max-width: none;
38
- padding: 1px;
39
- text-align: left;
40
- width: 242px;
41
- background: #f0f0f0;
42
- z-index: 999; }
43
-
44
- .iconpicker-popover.popover.top,
45
- .iconpicker-popover.popover.topLeftCorner,
46
- .iconpicker-popover.popover.topLeft,
47
- .iconpicker-popover.popover.topRight,
48
- .iconpicker-popover.popover.topRightCorner {
49
- margin-top: -10px; }
50
-
51
- .iconpicker-popover.popover.right,
52
- .iconpicker-popover.popover.rightTop,
53
- .iconpicker-popover.popover.rightBottom {
54
- margin-left: 10px; }
55
-
56
- .iconpicker-popover.popover.bottom,
57
- .iconpicker-popover.popover.bottomRightCorner,
58
- .iconpicker-popover.popover.bottomRight,
59
- .iconpicker-popover.popover.bottomLeft,
60
- .iconpicker-popover.popover.bottomLeftCorner {
61
- margin-top: 10px; }
62
-
63
- .iconpicker-popover.popover.left,
64
- .iconpicker-popover.popover.leftBottom,
65
- .iconpicker-popover.popover.leftTop {
66
- margin-left: -10px; }
67
-
68
- .iconpicker-popover.popover.inline {
69
- margin: 0 0 14px 0;
70
- position: relative;
71
- display: inline-block;
72
- opacity: 1;
73
- top: auto;
74
- left: auto;
75
- bottom: auto;
76
- right: auto;
77
- max-width: 100%;
78
- box-shadow: none;
79
- z-index: auto;
80
- vertical-align: top; }
81
-
82
- .iconpicker-popover.popover.inline > .arrow {
83
- display: none; }
84
-
85
- .dropdown-menu .iconpicker-popover.inline {
86
- margin: 0;
87
- border: none; }
88
-
89
- .dropdown-menu.iconpicker-container {
90
- padding: 0; }
91
-
92
- .iconpicker-popover.popover .popover-title {
93
- padding: 14px;
94
- font-size: 14px;
95
- line-height: 16px;
96
- border-bottom: 1px solid #ebebeb;
97
- background-color: #f0f0f0; }
98
-
99
- .iconpicker-popover.popover .popover-title input[type=search].iconpicker-search {
100
- margin: 0 0 2px 0; }
101
-
102
- .iconpicker-popover.popover .popover-title-text ~ input[type=search].iconpicker-search {
103
- margin-top: 14px; }
104
-
105
- .iconpicker-popover.popover .popover-content {
106
- padding: 0px;
107
- text-align: center; }
108
-
109
- .iconpicker-popover .popover-footer {
110
- float: none;
111
- clear: both;
112
- padding: 14px;
113
- text-align: right;
114
- margin: 0;
115
- border-top: 1px solid #ebebeb;
116
- background-color: #f0f0f0; }
117
-
118
- .iconpicker-popover .popover-footer:before,
119
- .iconpicker-popover .popover-footer:after {
120
- content: " ";
121
- display: table; }
122
-
123
- .iconpicker-popover .popover-footer:after {
124
- clear: both; }
125
-
126
- .iconpicker-popover .popover-footer .iconpicker-btn {
127
- margin-left: 10px; }
128
-
129
- .iconpicker-popover .popover-footer input[type=search].iconpicker-search {
130
- /*width:auto;
131
- float:left;*/
132
- margin-bottom: 14px; }
133
-
134
- .iconpicker-popover.popover > .arrow,
135
- .iconpicker-popover.popover > .arrow:after {
136
- position: absolute;
137
- display: block;
138
- width: 0;
139
- height: 0;
140
- border-color: transparent;
141
- border-style: solid; }
142
-
143
- .iconpicker-popover.popover > .arrow {
144
- border-width: 11px; }
145
-
146
- .iconpicker-popover.popover > .arrow:after {
147
- border-width: 10px;
148
- content: ""; }
149
-
150
- .iconpicker-popover.popover.top > .arrow,
151
- .iconpicker-popover.popover.topLeft > .arrow,
152
- .iconpicker-popover.popover.topRight > .arrow {
153
- left: 50%;
154
- margin-left: -11px;
155
- border-bottom-width: 0;
156
- border-top-color: #f0f0f0;
157
- bottom: -11px; }
158
-
159
- .iconpicker-popover.popover.top > .arrow:after,
160
- .iconpicker-popover.popover.topLeft > .arrow:after,
161
- .iconpicker-popover.popover.topRight > .arrow:after {
162
- content: " ";
163
- bottom: 1px;
164
- margin-left: -10px;
165
- border-bottom-width: 0;
166
- border-top-color: #ffffff; }
167
-
168
- .iconpicker-popover.popover.topLeft > .arrow {
169
- left: 14px;
170
- margin-left: 0; }
171
-
172
- .iconpicker-popover.popover.topRight > .arrow {
173
- left: auto;
174
- right: 14px;
175
- margin-left: 0; }
176
-
177
- .iconpicker-popover.popover.right > .arrow,
178
- .iconpicker-popover.popover.rightTop > .arrow,
179
- .iconpicker-popover.popover.rightBottom > .arrow {
180
- top: 50%;
181
- left: -11px;
182
- margin-top: -11px;
183
- border-left-width: 0;
184
- border-right-color: #f0f0f0; }
185
-
186
- .iconpicker-popover.popover.right > .arrow:after,
187
- .iconpicker-popover.popover.rightTop > .arrow:after,
188
- .iconpicker-popover.popover.rightBottom > .arrow:after {
189
- content: " ";
190
- left: 1px;
191
- bottom: -10px;
192
- border-left-width: 0;
193
- border-right-color: #ffffff; }
194
-
195
- .iconpicker-popover.popover.rightTop > .arrow {
196
- top: auto;
197
- bottom: 14px;
198
- margin-top: 0; }
199
-
200
- .iconpicker-popover.popover.rightBottom > .arrow {
201
- top: 14px;
202
- margin-top: 0; }
203
-
204
- .iconpicker-popover.popover.bottom > .arrow,
205
- .iconpicker-popover.popover.bottomRight > .arrow,
206
- .iconpicker-popover.popover.bottomLeft > .arrow {
207
- left: 50%;
208
- margin-left: -11px;
209
- border-top-width: 0;
210
- border-bottom-color: #f0f0f0;
211
- top: -11px; }
212
-
213
- .iconpicker-popover.popover.bottom > .arrow:after,
214
- .iconpicker-popover.popover.bottomRight > .arrow:after,
215
- .iconpicker-popover.popover.bottomLeft > .arrow:after {
216
- content: " ";
217
- top: 1px;
218
- margin-left: -10px;
219
- border-top-width: 0;
220
- border-bottom-color: #f0f0f0; }
221
-
222
- .iconpicker-popover.popover.bottomLeft > .arrow {
223
- left: 14px;
224
- margin-left: 0; }
225
-
226
- .iconpicker-popover.popover.bottomRight > .arrow {
227
- left: auto;
228
- right: 14px;
229
- margin-left: 0; }
230
-
231
- .iconpicker-popover.popover.left > .arrow,
232
- .iconpicker-popover.popover.leftBottom > .arrow,
233
- .iconpicker-popover.popover.leftTop > .arrow {
234
- top: 50%;
235
- right: -11px;
236
- margin-top: -11px;
237
- border-right-width: 0;
238
- border-left-color: #f0f0f0; }
239
-
240
- .iconpicker-popover.popover.left > .arrow:after,
241
- .iconpicker-popover.popover.leftBottom > .arrow:after,
242
- .iconpicker-popover.popover.leftTop > .arrow:after {
243
- content: " ";
244
- right: 1px;
245
- border-right-width: 0;
246
- border-left-color: #ffffff;
247
- bottom: -10px; }
248
-
249
- .iconpicker-popover.popover.leftBottom > .arrow {
250
- top: 14px;
251
- margin-top: 0; }
252
-
253
- .iconpicker-popover.popover.leftTop > .arrow {
254
- top: auto;
255
- bottom: 14px;
256
- margin-top: 0; }
257
-
258
- .iconpicker {
259
- position: relative;
260
- text-align: left;
261
- text-shadow: none;
262
- line-height: 0;
263
- display: block;
264
- margin: 0;
265
- overflow: hidden; }
266
-
267
- .iconpicker * {
268
- box-sizing: content-box;
269
- position: relative; }
270
-
271
- .iconpicker:before,
272
- .iconpicker:after {
273
- content: " ";
274
- display: table; }
275
-
276
- .iconpicker:after {
277
- clear: both; }
278
-
279
- .iconpicker .iconpicker-items {
280
- position: relative;
281
- clear: both;
282
- float: none;
283
- padding: 10px 0 0 10px;
284
- background: #fff;
285
- margin: 0;
286
- overflow: hidden;
287
- overflow-y: auto;
288
- min-height: 55px;
289
- max-height: 275px; }
290
-
291
- .iconpicker .iconpicker-items:before,
292
- .iconpicker .iconpicker-items:after {
293
- content: " ";
294
- display: table; }
295
-
296
- .iconpicker .iconpicker-items:after {
297
- clear: both; }
298
-
299
- .iconpicker .iconpicker-item {
300
- float: left;
301
- width: 28px;
302
- height: 28px;
303
- line-height: 28px;
304
- margin: 0 7px 7px 0;
305
- text-align: center;
306
- cursor: pointer;
307
- border-radius: 3px;
308
- font-size: 18px;
309
- color: #444;
310
- box-shadow: 0 0 0 1px #dddddd
311
- /*&:nth-child(4n+4) {
312
- margin-right: 0;
313
- }
314
- &:nth-last-child(-n+4) {
315
- margin-bottom: 0;
316
- }*/ }
317
-
318
- .iconpicker .iconpicker-item:hover:not(.iconpicker-selected) {
319
- background-color: #eeeeee; }
320
-
321
- .iconpicker .iconpicker-item.iconpicker-selected {
322
- box-shadow: none;
323
- background: #ddd; }
324
-
325
- .iconpicker-component {
326
- cursor: pointer; }
1
+ .cherry-ui-iconpicker-group{max-width:230px;position:relative}.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;height:50px;border:1px solid #f1f1f1;box-shadow:none;padding-left:60px}.cherry-ui-iconpicker-group .cherry-ui-text:focus{border-color:rgba(72,197,105,0.6);box-shadow:0 0 2px rgba(72,197,105,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/min/ui-iconpicker.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,i){"use strict";i.utilites.namespace("ui_elements.iconpicker"),i.ui_elements.iconpicker={init:function(){e(document).on("ready",this.render),e(window).on("cherry-ui-elements-init",this.render)},render:function(i){var n,t,c,r=i._target?i._target:e("body"),o=e('.cherry-ui-iconpicker:not([name*="__i__"])',r);o.each(function(){n=e(this),t=n.data("set"),c=window[t],n.length&&c.icons&&n.iconpicker({icons:c.icons,iconBaseClass:c.iconBase,iconClassPrefix:c.iconPrefix,fullClassFormatter:function(e){return c.iconBase+" "+c.iconPrefix+e}}).on("iconpickerUpdated",function(){e(this).trigger("change")}),c&&e("body").append('<link rel="stylesheet" type="text/css" href="'+c.iconCSS+'"">')})}},i.ui_elements.iconpicker.init()}(jQuery,window.CherryJsCore);
1
+ !function(e,i){"use strict";i.utilites.namespace("ui_elements.iconpicker"),i.ui_elements.iconpicker={init:function(){e(document).on("ready",this.render).on("cherry-ui-elements-init",this.render)},render:function(i){var n,t,c,r=i._target?i._target:e("body"),o=e('.cherry-ui-iconpicker:not([name*="__i__"])',r);o.each(function(){n=e(this),t=n.data("set"),c=window[t],n.length&&c.icons&&n.iconpicker({icons:c.icons,iconBaseClass:c.iconBase,iconClassPrefix:c.iconPrefix,animation:!1,fullClassFormatter:function(e){return c.iconBase+" "+c.iconPrefix+e}}).on("iconpickerUpdated",function(){e(this).trigger("change")}),c&&e("body").append('<link rel="stylesheet" type="text/css" href="'+c.iconCSS+'"">')})}},i.ui_elements.iconpicker.init()}(jQuery,window.CherryJsCore);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-iconpicker.js CHANGED
@@ -7,8 +7,9 @@
7
  CherryJsCore.utilites.namespace( 'ui_elements.iconpicker' );
8
  CherryJsCore.ui_elements.iconpicker = {
9
  init: function() {
10
- $( document ).on( 'ready', this.render );
11
- $( window ).on( 'cherry-ui-elements-init', this.render );
 
12
  },
13
  render: function( event ) {
14
  var target = ( event._target ) ? event._target : $( 'body' ),
@@ -27,6 +28,7 @@
27
  icons: setData.icons,
28
  iconBaseClass: setData.iconBase,
29
  iconClassPrefix: setData.iconPrefix,
 
30
  fullClassFormatter: function( val ) {
31
  return setData.iconBase + ' ' + setData.iconPrefix + val;
32
  }
7
  CherryJsCore.utilites.namespace( 'ui_elements.iconpicker' );
8
  CherryJsCore.ui_elements.iconpicker = {
9
  init: function() {
10
+ $( document )
11
+ .on( 'ready', this.render )
12
+ .on( 'cherry-ui-elements-init', this.render );
13
  },
14
  render: function( event ) {
15
  var target = ( event._target ) ? event._target : $( 'body' ),
28
  icons: setData.icons,
29
  iconBaseClass: setData.iconBase,
30
  iconClassPrefix: setData.iconPrefix,
31
+ animation: false,
32
  fullClassFormatter: function( val ) {
33
  return setData.iconBase + ' ' + setData.iconPrefix + val;
34
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/ui-iconpicker.scss CHANGED
@@ -17,6 +17,9 @@
17
  border-radius: 3px 0 0 3px;
18
  border-right: 1px solid #dddcdc;
19
  margin: 7px;
 
 
 
20
  }
21
  .cherry-ui-text{
22
  @include input();
@@ -122,8 +125,6 @@
122
  margin-left: 10px;
123
  }
124
  .iconpicker-popover .popover-footer input[type=search].iconpicker-search {
125
- /*width:auto;
126
- float:left;*/
127
  margin-bottom: 14px;
128
  }
129
  .iconpicker-popover.popover > .arrow,
@@ -305,12 +306,9 @@
305
  font-size: 18px;
306
  color: #444;
307
  box-shadow: 0 0 0 1px #dddddd;
308
- /*&:nth-child(4n+4) {
309
- margin-right: 0;
310
- }
311
- &:nth-last-child(-n+4) {
312
- margin-bottom: 0;
313
- }*/
314
  }
315
  .iconpicker .iconpicker-item:hover:not(.iconpicker-selected) {
316
  background-color: #eeeeee;
17
  border-radius: 3px 0 0 3px;
18
  border-right: 1px solid #dddcdc;
19
  margin: 7px;
20
+ .fa {
21
+ line-height: 36px;
22
+ }
23
  }
24
  .cherry-ui-text{
25
  @include input();
125
  margin-left: 10px;
126
  }
127
  .iconpicker-popover .popover-footer input[type=search].iconpicker-search {
 
 
128
  margin-bottom: 14px;
129
  }
130
  .iconpicker-popover.popover > .arrow,
306
  font-size: 18px;
307
  color: #444;
308
  box-shadow: 0 0 0 1px #dddddd;
309
+ .fa {
310
+ line-height: 28px;
311
+ }
 
 
 
312
  }
313
  .iconpicker .iconpicker-item:hover:not(.iconpicker-selected) {
314
  background-color: #eeeeee;
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/ui-iconpicker.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -81,7 +81,7 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
81
  * @since 4.0.0
82
  */
83
  function __construct( $args = array() ) {
84
- $this->defaults_settings['id'] = 'cherry-ui-input-icon-'.uniqid();
85
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
86
 
87
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
@@ -108,8 +108,10 @@ if ( ! class_exists( 'UI_Iconpicker' ) ) {
108
  */
109
  public function render() {
110
  $html = '';
 
 
111
 
112
- $html .= '<div class="cherry-ui-container ' . esc_attr( $this->settings['master'] ) . '">';
113
  if ( '' !== $this->settings['label'] ) {
114
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
115
  }
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
81
  * @since 4.0.0
82
  */
83
  function __construct( $args = array() ) {
84
+ $this->defaults_settings['id'] = 'cherry-ui-input-icon-' . uniqid();
85
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
86
 
87
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
108
  */
109
  public function render() {
110
  $html = '';
111
+ $class = $this->settings['class'];
112
+ $class .= ' ' . $this->settings['master'];
113
 
114
+ $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
115
  if ( '' !== $this->settings['label'] ) {
116
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
117
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/min/ui-media.min.js CHANGED
@@ -1 +1,156 @@
1
- !function(e,a){"use strict";a.utilites.namespace("ui_elements.media"),a.ui_elements.media={init:function(){e(document).on("ready",this.render),e(window).on("cherry-ui-elements-init",this.render)},render:function(a){var i=a._target?a._target:e("body"),r=e(".upload-button",i);r.each(function(){var a=e(this),i=a.closest(".cherry-ui-media-wrap"),r={input:e(".cherry-upload-input",i),img_holder:e(".cherry-upload-preview",i),title_text:a.data("title"),multiple:a.data("multi-upload"),library_type:a.data("library-type")},t=wp.media.frames.file_frame=wp.media({title:r.title_text,button:{text:r.title_text},multiple:r.multiple,library:{type:r.library_type}});a.on("click",function(){return t.open(),!1}),t.on("select",function(){var a=t.state().get("selection").toJSON(),i=0,n="",c=e(".cherry-all-images-wrap",r.img_holder),l="",o="";for(r.multiple&&(n=r.input.val(),o=",",l=c.html());a[i];){var d=a[i],u=d.id,p=d.mime,m="",h="";switch(p){case"image/jpeg":case"image/png":case"image/gif":void 0!==d.sizes&&(m=d.sizes.thumbnail?d.sizes.thumbnail.url:d.sizes.full.url),h='<img src="'+m+'" alt="" data-img-attr="'+u+'">';break;case"image/x-icon":h='<span class="dashicons dashicons-format-image"></span>';break;case"video/mpeg":case"video/mp4":case"video/quicktime":case"video/webm":case"video/ogg":h='<span class="dashicons dashicons-format-video"></span>';break;case"audio/mpeg":case"audio/wav":case"audio/ogg":h='<span class="dashicons dashicons-format-audio"></span>'}l+='<div class="cherry-image-wrap"><div class="inner"><div class="preview-holder" data-id-attr="'+u+'"><div class="centered">'+h+'</div></div><a class="cherry-remove-image" href="#"><i class="dashicons dashicons-no"></i></a><span class="title">'+d.title+"</span></div></div>",n+=o+u,i++}r.input.val(n.replace(/(^,)/,"")).trigger("change"),c.html(l),e(".cherry-remove-image").on("click",function(){return s(e(this)),!1})});var s=function(e){var a=e.closest(".cherry-ui-media-wrap"),i=jQuery(".cherry-upload-input",a),r=e.parent().parent(".cherry-image-wrap"),t=jQuery(".preview-holder",r).data("id-attr"),s=i.attr("value"),n=new RegExp(""+t+"(,*)","i");s=s.replace(n,""),s=s.replace(/(,$)/,""),i.attr({value:s}).trigger("change"),r.remove()};jQuery(".cherry-remove-image",i).on("click",function(){return s(jQuery(this)),!1})}),jQuery(".cherry-all-images-wrap",i).sortable({items:"div.cherry-image-wrap",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,placeholder:"cherry-media-thumb-sortable-placeholder",start:function(){},stop:function(){},update:function(){var e="";jQuery(".cherry-image-wrap",this).each(function(){var a=jQuery(".preview-holder",this).data("id-attr");e=e+a+","}),e=e.substr(0,e.lastIndexOf(",")),jQuery(this).parent().siblings(".cherry-element-wrap").find("input.cherry-upload-input").val(e).trigger("change")}})}},a.ui_elements.media.init()}(jQuery,window.CherryJsCore);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Media
3
+ */
4
+ (function( $, CherryJsCore){
5
+ 'use strict';
6
+
7
+ CherryJsCore.utilites.namespace('ui_elements.media');
8
+ CherryJsCore.ui_elements.media = {
9
+ init: function () {
10
+ $( document )
11
+ .on( 'ready', this.render )
12
+ .on( 'cherry-ui-elements-init', this.render );
13
+ },
14
+ render: function ( event ) {
15
+ var target = ( event._target ) ? event._target : $( 'body' ),
16
+ buttons = $('.cherry-upload-button', target);
17
+
18
+ buttons.each( function() {
19
+ var button = $( this ),
20
+ button_parent = button.closest('.cherry-ui-media-wrap'),
21
+ settings = {
22
+ input: $('.cherry-upload-input', button_parent),
23
+ img_holder: $('.cherry-upload-preview', button_parent),
24
+ title_text: button.data('title'),
25
+ multiple: button.data('multi-upload'),
26
+ library_type: button.data('library-type'),
27
+ },
28
+ cherry_uploader = wp.media.frames.file_frame = wp.media({
29
+ title: settings.title_text,
30
+ button: { text: settings.title_text },
31
+ multiple: settings.multiple,
32
+ library : { type : settings.library_type }
33
+ });
34
+
35
+ if ( ! button_parent.has('input[name*="__i__"]')[ 0 ] ) {
36
+ button.on( 'click', function() {
37
+ cherry_uploader.open();
38
+ return !1;
39
+ } ); // end click
40
+
41
+ cherry_uploader.on('select', function() {
42
+ var attachment = cherry_uploader.state().get('selection').toJSON(),
43
+ count = 0,
44
+ input_value = '',
45
+ new_img_object = $('.cherry-all-images-wrap', settings.img_holder),
46
+ new_img = '',
47
+ delimiter = '';
48
+
49
+ if ( settings.multiple ) {
50
+ input_value = settings.input.val();
51
+ delimiter = ',';
52
+ new_img = new_img_object.html();
53
+ }
54
+
55
+ while( attachment[ count ] ) {
56
+ var img_data = attachment[count],
57
+ return_data = img_data.id,
58
+ mimeType = img_data.mime,
59
+ img_src = '',
60
+ thumb = '';
61
+
62
+ switch (mimeType) {
63
+ case 'image/jpeg':
64
+ case 'image/png':
65
+ case 'image/gif':
66
+ if( img_data.sizes !== undefined){
67
+ img_src = img_data.sizes.thumbnail ? img_data.sizes.thumbnail.url : img_data.sizes.full.url;
68
+ }
69
+ thumb = '<img src="' + img_src + '" alt="" data-img-attr="'+return_data+'">';
70
+ break;
71
+ case 'image/x-icon':
72
+ thumb = '<span class="dashicons dashicons-format-image"></span>';
73
+ break;
74
+ case 'video/mpeg':
75
+ case 'video/mp4':
76
+ case 'video/quicktime':
77
+ case 'video/webm':
78
+ case 'video/ogg':
79
+ thumb = '<span class="dashicons dashicons-format-video"></span>';
80
+ break;
81
+ case 'audio/mpeg':
82
+ case 'audio/wav':
83
+ case 'audio/ogg':
84
+ thumb = '<span class="dashicons dashicons-format-audio"></span>';
85
+ break;
86
+ }
87
+
88
+ new_img += '<div class="cherry-image-wrap">'+
89
+ '<div class="inner">'+
90
+ '<div class="preview-holder" data-id-attr="' + return_data +'"><div class="centered">' + thumb + '</div></div>'+
91
+ '<a class="cherry-remove-image" href="#"><i class="dashicons dashicons-no"></i></a>'+
92
+ '<span class="title">' + img_data.title + '</span>'+
93
+ '</div>'+
94
+ '</div>';
95
+
96
+ input_value += delimiter+return_data;
97
+ count++;
98
+ }
99
+
100
+ settings.input.val(input_value.replace(/(^,)/, '')).trigger( 'change' );
101
+ new_img_object.html(new_img);
102
+ } );
103
+
104
+ var removeMediaPreview = function( item ) {
105
+ var button_parent = item.closest('.cherry-ui-media-wrap'),
106
+ input = $('.cherry-upload-input', button_parent),
107
+ img_holder = item.parent().parent('.cherry-image-wrap'),
108
+ img_attr = $('.preview-holder', img_holder).data('id-attr'),
109
+ input_value = input.attr('value'),
110
+ pattern = new RegExp(''+img_attr+'(,*)', 'i');
111
+
112
+ input_value = input_value.replace(pattern, '');
113
+ input_value = input_value.replace(/(,$)/, '');
114
+ input.attr({'value':input_value}).trigger( 'change' );
115
+ img_holder.remove();
116
+ };
117
+
118
+ // This function remove upload image
119
+ button_parent.on('click', '.cherry-remove-image', function () {
120
+ removeMediaPreview( $(this) );
121
+ return !1;
122
+ });
123
+ }
124
+ } ); // end each
125
+
126
+ // Image ordering
127
+ $('.cherry-all-images-wrap', target).sortable( {
128
+ items: 'div.cherry-image-wrap',
129
+ cursor: 'move',
130
+ scrollSensitivity: 40,
131
+ forcePlaceholderSize: true,
132
+ forceHelperSize: false,
133
+ helper: 'clone',
134
+ opacity: 0.65,
135
+ placeholder: 'cherry-media-thumb-sortable-placeholder',
136
+ start:function(){},
137
+ stop:function(){},
138
+ update: function() {
139
+ var attachment_ids = '';
140
+ $('.cherry-image-wrap', this).each(
141
+ function() {
142
+ var attachment_id = $('.preview-holder', this).data( 'id-attr' );
143
+ attachment_ids = attachment_ids + attachment_id + ',';
144
+ }
145
+ );
146
+ attachment_ids = attachment_ids.substr(0, attachment_ids.lastIndexOf(',') );
147
+ $(this).parent().siblings('.cherry-element-wrap').find('input.cherry-upload-input').val( attachment_ids ).trigger( 'change' );
148
+ }
149
+ } );
150
+ // End Image ordering
151
+ }
152
+ };
153
+
154
+ CherryJsCore.ui_elements.media.init();
155
+
156
+ }( jQuery , window.CherryJsCore ) );
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/assets/ui-media.js CHANGED
@@ -7,12 +7,13 @@
7
  CherryJsCore.utilites.namespace('ui_elements.media');
8
  CherryJsCore.ui_elements.media = {
9
  init: function () {
10
- $( document ).on( 'ready', this.render );
11
- $( window ).on( 'cherry-ui-elements-init', this.render );
 
12
  },
13
  render: function ( event ) {
14
  var target = ( event._target ) ? event._target : $( 'body' ),
15
- buttons = $('.upload-button', target);
16
 
17
  buttons.each( function() {
18
  var button = $( this ),
@@ -31,103 +32,99 @@
31
  library : { type : settings.library_type }
32
  });
33
 
34
- button.on( 'click', function() {
35
- cherry_uploader.open();
36
- return !1;
37
- } ); // end click
38
-
39
- cherry_uploader.on('select', function() {
40
- var attachment = cherry_uploader.state().get('selection').toJSON(),
41
- count = 0,
42
- input_value = '',
43
- new_img_object = $('.cherry-all-images-wrap', settings.img_holder),
44
- new_img = '',
45
- delimiter = '';
46
-
47
- if ( settings.multiple ) {
48
- input_value = settings.input.val();
49
- delimiter = ',';
50
- new_img = new_img_object.html();
51
- }
52
-
53
- while( attachment[ count ] ) {
54
- var img_data = attachment[count],
55
- return_data = img_data.id,
56
- mimeType = img_data.mime,
57
- img_src = '',
58
- thumb = '';
59
-
60
- switch (mimeType) {
61
- case 'image/jpeg':
62
- case 'image/png':
63
- case 'image/gif':
64
- if( img_data.sizes !== undefined){
65
- img_src = img_data.sizes.thumbnail ? img_data.sizes.thumbnail.url : img_data.sizes.full.url;
66
- }
67
- thumb = '<img src="' + img_src + '" alt="" data-img-attr="'+return_data+'">';
68
- break;
69
- case 'image/x-icon':
70
- thumb = '<span class="dashicons dashicons-format-image"></span>';
71
- break;
72
- case 'video/mpeg':
73
- case 'video/mp4':
74
- case 'video/quicktime':
75
- case 'video/webm':
76
- case 'video/ogg':
77
- thumb = '<span class="dashicons dashicons-format-video"></span>';
78
- break;
79
- case 'audio/mpeg':
80
- case 'audio/wav':
81
- case 'audio/ogg':
82
- thumb = '<span class="dashicons dashicons-format-audio"></span>';
83
- break;
84
- }
85
-
86
- new_img += '<div class="cherry-image-wrap">'+
87
- '<div class="inner">'+
88
- '<div class="preview-holder" data-id-attr="' + return_data +'"><div class="centered">' + thumb + '</div></div>'+
89
- '<a class="cherry-remove-image" href="#"><i class="dashicons dashicons-no"></i></a>'+
90
- '<span class="title">' + img_data.title + '</span>'+
91
- '</div>'+
92
- '</div>';
93
-
94
- input_value += delimiter+return_data;
95
- count++;
96
- }
97
-
98
- settings.input.val(input_value.replace(/(^,)/, '')).trigger( 'change' );
99
- new_img_object.html(new_img);
100
-
101
- $('.cherry-remove-image').on('click', function () {
102
- removeMediaPreview( $(this) );
103
- return !1;
104
- });
105
- } );
106
-
107
- var removeMediaPreview = function( item ) {
108
- var button_parent = item.closest('.cherry-ui-media-wrap'),
109
- input = jQuery('.cherry-upload-input', button_parent),
110
- img_holder = item.parent().parent('.cherry-image-wrap'),
111
- img_attr = jQuery('.preview-holder', img_holder).data('id-attr'),
112
- input_value = input.attr('value'),
113
- pattern = new RegExp(''+img_attr+'(,*)', 'i');
114
-
115
- input_value = input_value.replace(pattern, '');
116
- input_value = input_value.replace(/(,$)/, '');
117
- input.attr({'value':input_value}).trigger( 'change' );
118
- img_holder.remove();
119
-
120
- };
121
-
122
- // This function remove upload image
123
- jQuery('.cherry-remove-image', button_parent).on('click', function () {
124
- removeMediaPreview( jQuery(this) );
125
- return !1;
126
- });
127
  } ); // end each
128
 
129
  // Image ordering
130
- jQuery('.cherry-all-images-wrap', target).sortable( {
131
  items: 'div.cherry-image-wrap',
132
  cursor: 'move',
133
  scrollSensitivity: 40,
@@ -140,14 +137,14 @@
140
  stop:function(){},
141
  update: function() {
142
  var attachment_ids = '';
143
- jQuery('.cherry-image-wrap', this).each(
144
  function() {
145
- var attachment_id = jQuery('.preview-holder', this).data( 'id-attr' );
146
  attachment_ids = attachment_ids + attachment_id + ',';
147
  }
148
  );
149
  attachment_ids = attachment_ids.substr(0, attachment_ids.lastIndexOf(',') );
150
- jQuery(this).parent().siblings('.cherry-element-wrap').find('input.cherry-upload-input').val( attachment_ids ).trigger( 'change' );
151
  }
152
  } );
153
  // End Image ordering
@@ -156,4 +153,4 @@
156
 
157
  CherryJsCore.ui_elements.media.init();
158
 
159
- }(jQuery , window.CherryJsCore));
7
  CherryJsCore.utilites.namespace('ui_elements.media');
8
  CherryJsCore.ui_elements.media = {
9
  init: function () {
10
+ $( document )
11
+ .on( 'ready', this.render )
12
+ .on( 'cherry-ui-elements-init', this.render );
13
  },
14
  render: function ( event ) {
15
  var target = ( event._target ) ? event._target : $( 'body' ),
16
+ buttons = $('.cherry-upload-button', target);
17
 
18
  buttons.each( function() {
19
  var button = $( this ),
32
  library : { type : settings.library_type }
33
  });
34
 
35
+ if ( ! button_parent.has('input[name*="__i__"]')[ 0 ] ) {
36
+ button.on( 'click', function() {
37
+ cherry_uploader.open();
38
+ return !1;
39
+ } ); // end click
40
+
41
+ cherry_uploader.on('select', function() {
42
+ var attachment = cherry_uploader.state().get('selection').toJSON(),
43
+ count = 0,
44
+ input_value = '',
45
+ new_img_object = $('.cherry-all-images-wrap', settings.img_holder),
46
+ new_img = '',
47
+ delimiter = '';
48
+
49
+ if ( settings.multiple ) {
50
+ input_value = settings.input.val();
51
+ delimiter = ',';
52
+ new_img = new_img_object.html();
53
+ }
54
+
55
+ while( attachment[ count ] ) {
56
+ var img_data = attachment[count],
57
+ return_data = img_data.id,
58
+ mimeType = img_data.mime,
59
+ img_src = '',
60
+ thumb = '';
61
+
62
+ switch (mimeType) {
63
+ case 'image/jpeg':
64
+ case 'image/png':
65
+ case 'image/gif':
66
+ if( img_data.sizes !== undefined){
67
+ img_src = img_data.sizes.thumbnail ? img_data.sizes.thumbnail.url : img_data.sizes.full.url;
68
+ }
69
+ thumb = '<img src="' + img_src + '" alt="" data-img-attr="'+return_data+'">';
70
+ break;
71
+ case 'image/x-icon':
72
+ thumb = '<span class="dashicons dashicons-format-image"></span>';
73
+ break;
74
+ case 'video/mpeg':
75
+ case 'video/mp4':
76
+ case 'video/quicktime':
77
+ case 'video/webm':
78
+ case 'video/ogg':
79
+ thumb = '<span class="dashicons dashicons-format-video"></span>';
80
+ break;
81
+ case 'audio/mpeg':
82
+ case 'audio/wav':
83
+ case 'audio/ogg':
84
+ thumb = '<span class="dashicons dashicons-format-audio"></span>';
85
+ break;
86
+ }
87
+
88
+ new_img += '<div class="cherry-image-wrap">'+
89
+ '<div class="inner">'+
90
+ '<div class="preview-holder" data-id-attr="' + return_data +'"><div class="centered">' + thumb + '</div></div>'+
91
+ '<a class="cherry-remove-image" href="#"><i class="dashicons dashicons-no"></i></a>'+
92
+ '<span class="title">' + img_data.title + '</span>'+
93
+ '</div>'+
94
+ '</div>';
95
+
96
+ input_value += delimiter+return_data;
97
+ count++;
98
+ }
99
+
100
+ settings.input.val(input_value.replace(/(^,)/, '')).trigger( 'change' );
101
+ new_img_object.html(new_img);
102
+ } );
103
+
104
+ var removeMediaPreview = function( item ) {
105
+ var button_parent = item.closest('.cherry-ui-media-wrap'),
106
+ input = $('.cherry-upload-input', button_parent),
107
+ img_holder = item.parent().parent('.cherry-image-wrap'),
108
+ img_attr = $('.preview-holder', img_holder).data('id-attr'),
109
+ input_value = input.attr('value'),
110
+ pattern = new RegExp(''+img_attr+'(,*)', 'i');
111
+
112
+ input_value = input_value.replace(pattern, '');
113
+ input_value = input_value.replace(/(,$)/, '');
114
+ input.attr({'value':input_value}).trigger( 'change' );
115
+ img_holder.remove();
116
+ };
117
+
118
+ // This function remove upload image
119
+ button_parent.on('click', '.cherry-remove-image', function () {
120
+ removeMediaPreview( $(this) );
121
+ return !1;
122
+ });
123
+ }
 
 
 
 
124
  } ); // end each
125
 
126
  // Image ordering
127
+ $('.cherry-all-images-wrap', target).sortable( {
128
  items: 'div.cherry-image-wrap',
129
  cursor: 'move',
130
  scrollSensitivity: 40,
137
  stop:function(){},
138
  update: function() {
139
  var attachment_ids = '';
140
+ $('.cherry-image-wrap', this).each(
141
  function() {
142
+ var attachment_id = $('.preview-holder', this).data( 'id-attr' );
143
  attachment_ids = attachment_ids + attachment_id + ',';
144
  }
145
  );
146
  attachment_ids = attachment_ids.substr(0, attachment_ids.lastIndexOf(',') );
147
+ $(this).parent().siblings('.cherry-element-wrap').find('input.cherry-upload-input').val( attachment_ids ).trigger( 'change' );
148
  }
149
  } );
150
  // End Image ordering
153
 
154
  CherryJsCore.ui_elements.media.init();
155
 
156
+ }( jQuery , window.CherryJsCore ) );
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-media/ui-media.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -21,22 +21,22 @@ if ( ! class_exists( 'UI_Media' ) ) {
21
  * Class for the building UI_Media elements.
22
  */
23
  class UI_Media extends UI_Element implements I_UI {
 
24
  /**
25
  * Default settings
26
  *
27
  * @var array
28
  */
29
-
30
  private $defaults_settings = array(
31
- 'id' => 'cherry-ui-media-id',
32
- 'name' => 'cherry-ui-media-name',
33
- 'value' => '',
34
- 'multi_upload' => true,
35
- 'library_type' => '', // image, video
36
- 'upload_button_text' => 'Choose Media',
37
- 'label' => '',
38
- 'class' => '',
39
- 'master' => '',
40
  );
41
 
42
  /**
@@ -44,10 +44,10 @@ if ( ! class_exists( 'UI_Media' ) ) {
44
  *
45
  * @since 4.0.0
46
  */
47
- function __construct( $args = array() ) {
48
 
49
- $this->defaults_settings['id'] = 'cherry-ui-media-'.uniqid();
50
- $this->settings = wp_parse_args( $args, $this->defaults_settings );
51
 
52
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
53
  }
@@ -60,79 +60,88 @@ if ( ! class_exists( 'UI_Media' ) ) {
60
  public function render() {
61
  $html = '';
62
 
63
- $master_class = ! empty( $this->settings['master'] ) && isset( $this->settings['master'] ) ? esc_html( $this->settings['master'] ) : '';
64
 
65
- $html .= '<div class="cherry-ui-container ' . $master_class . '">';
66
- if ( '' != $this->settings['value'] ) {
67
- $this->settings['value'] = str_replace( ' ', '', $this->settings['value'] );
68
- $medias = explode( ',', $this->settings['value'] );
69
- } else {
70
- $this->settings['value'] = '';
71
- $medias = array();
72
- }
73
 
74
- $img_style = ! $this->settings['value'] ? 'style="display:none;"' : '' ;
75
-
76
- if ( '' !== $this->settings['label'] ) {
77
- $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
 
 
 
78
  }
79
- $html .= '<div class="cherry-ui-media-wrap">';
80
- $html .= '<div class="cherry-upload-preview" >';
81
- $html .= '<div class="cherry-all-images-wrap">';
82
- if ( is_array( $medias ) && ! empty( $medias ) ) {
83
- foreach ( $medias as $medias_key => $medias_value ) {
84
- $media_title = get_the_title( $medias_value );
85
- $mime_type = get_post_mime_type( $medias_value );
86
- $tmp = wp_get_attachment_metadata( $medias_value );
87
- $img_src = '';
88
- $thumb = '';
89
-
90
- switch ( $mime_type ) {
91
- case 'image/jpeg':
92
- case 'image/png':
93
- case 'image/gif':
94
- $img_src = wp_get_attachment_image_src( $medias_value, 'thumbnail' );
95
- $img_src = $img_src[0];
96
- $thumb = '<img src="' . esc_html( $img_src ) . '" alt="">';
 
 
 
 
 
 
 
 
 
97
  break;
98
- case 'image/x-icon':
99
- $thumb = '<span class="dashicons dashicons-format-image"></span>';
 
100
  break;
101
- case 'video/mpeg':
102
- case 'video/mp4':
103
- case 'video/quicktime':
104
- case 'video/webm':
105
- case 'video/ogg':
 
106
  $thumb = '<span class="dashicons dashicons-format-video"></span>';
107
  break;
108
- case 'audio/mpeg':
109
- case 'audio/wav':
110
- case 'audio/ogg':
 
111
  $thumb = '<span class="dashicons dashicons-format-audio"></span>';
112
  break;
113
- }
114
- $html .= '<div class="cherry-image-wrap">';
115
- $html .= '<div class="inner">';
116
- $html .= '<div class="preview-holder" data-id-attr="' . esc_attr( $medias_value ) . '">';
117
- $html .= '<div class="centered">';
118
- $html .= $thumb;
 
119
  $html .= '</div>';
 
 
120
  $html .= '</div>';
121
- $html .= '<span class="title">' . $media_title . '</span>';
122
- $html .= '<a class="cherry-remove-image" href="#" title=""><i class="dashicons dashicons-no"></i></a>';
123
  $html .= '</div>';
124
- $html .= '</div>';
125
  }
126
- }
 
 
 
 
 
127
  $html .= '</div>';
128
- $html .= '</div>';
129
- $html .= '<div class="cherry-element-wrap">';
130
- $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'] ) . '" >';
131
- $html .= '<input type="button" class="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'] ) . '"/>';
132
- $html .= '<div class="clear"></div>';
133
  $html .= '</div>';
134
  $html .= '</div>';
135
- $html .= '</div>';
136
 
137
  return $html;
138
  }
@@ -143,23 +152,25 @@ if ( ! class_exists( 'UI_Media' ) ) {
143
  * @since 4.0.0
144
  */
145
  public static function enqueue_assets() {
146
- wp_enqueue_media();
147
-
148
- wp_enqueue_script(
149
- 'ui-media-min',
150
- esc_url( Cherry_Core::base_url( 'assets/min/ui-media.min.js', __FILE__ ) ),
151
- array( 'jquery', 'jquery-ui-sortable' ),
152
- '1.0.0',
153
- true
154
- );
155
-
156
- wp_enqueue_style(
157
- 'ui-media-min',
158
- esc_url( Cherry_Core::base_url( 'assets/min/ui-media.min.css', __FILE__ ) ),
159
- array(),
160
- '1.0.0',
161
- 'all'
162
- );
 
 
163
  }
164
  }
165
  }
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
21
  * Class for the building UI_Media elements.
22
  */
23
  class UI_Media extends UI_Element implements I_UI {
24
+
25
  /**
26
  * Default settings
27
  *
28
  * @var array
29
  */
 
30
  private $defaults_settings = array(
31
+ 'id' => 'cherry-ui-media-id',
32
+ 'name' => 'cherry-ui-media-name',
33
+ 'value' => '',
34
+ 'multi_upload' => true,
35
+ 'library_type' => '', // image, video
36
+ 'upload_button_text' => 'Choose Media',
37
+ 'label' => '',
38
+ 'class' => '',
39
+ 'master' => '',
40
  );
41
 
42
  /**
44
  *
45
  * @since 4.0.0
46
  */
47
+ public function __construct( $args = array() ) {
48
 
49
+ $this->defaults_settings['id'] = 'cherry-ui-media-' . uniqid();
50
+ $this->settings = wp_parse_args( $args, $this->defaults_settings );
51
 
52
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
53
  }
60
  public function render() {
61
  $html = '';
62
 
63
+ if ( current_user_can( 'upload_files' ) ) {
64
 
65
+ $class = $this->settings['class'] . ' ' . $this->settings['master'];
 
 
 
 
 
 
 
66
 
67
+ $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
68
+ if ( '' != $this->settings['value'] ) {
69
+ $this->settings['value'] = str_replace( ' ', '', $this->settings['value'] );
70
+ $medias = explode( ',', $this->settings['value'] );
71
+ } else {
72
+ $this->settings['value'] = '';
73
+ $medias = array();
74
  }
75
+
76
+ $img_style = ! $this->settings['value'] ? 'style="display:none;"' : '' ;
77
+
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-media-wrap">';
82
+ $html .= '<div class="cherry-upload-preview" >';
83
+ $html .= '<div class="cherry-all-images-wrap">';
84
+
85
+ if ( is_array( $medias ) && ! empty( $medias ) ) {
86
+
87
+ foreach ( $medias as $medias_key => $medias_value ) {
88
+
89
+ $media_title = get_the_title( $medias_value );
90
+ $mime_type = get_post_mime_type( $medias_value );
91
+ $tmp = wp_get_attachment_metadata( $medias_value );
92
+ $img_src = '';
93
+ $thumb = '';
94
+
95
+ switch ( $mime_type ) {
96
+ case 'image/jpeg':
97
+ case 'image/png':
98
+ case 'image/gif':
99
+ $img_src = wp_get_attachment_image_src( $medias_value, 'thumbnail' );
100
+ $img_src = $img_src[0];
101
+ $thumb = '<img src="' . esc_html( $img_src ) . '" alt="">';
102
  break;
103
+
104
+ case 'image/x-icon':
105
+ $thumb = '<span class="dashicons dashicons-format-image"></span>';
106
  break;
107
+
108
+ case 'video/mpeg':
109
+ case 'video/mp4':
110
+ case 'video/quicktime':
111
+ case 'video/webm':
112
+ case 'video/ogg':
113
  $thumb = '<span class="dashicons dashicons-format-video"></span>';
114
  break;
115
+
116
+ case 'audio/mpeg':
117
+ case 'audio/wav':
118
+ case 'audio/ogg':
119
  $thumb = '<span class="dashicons dashicons-format-audio"></span>';
120
  break;
121
+ }
122
+ $html .= '<div class="cherry-image-wrap">';
123
+ $html .= '<div class="inner">';
124
+ $html .= '<div class="preview-holder" data-id-attr="' . esc_attr( $medias_value ) . '">';
125
+ $html .= '<div class="centered">';
126
+ $html .= $thumb;
127
+ $html .= '</div>';
128
  $html .= '</div>';
129
+ $html .= '<span class="title">' . $media_title . '</span>';
130
+ $html .= '<a class="cherry-remove-image" href="#" title=""><i class="dashicons dashicons-no"></i></a>';
131
  $html .= '</div>';
 
 
132
  $html .= '</div>';
133
+ }
134
  }
135
+ $html .= '</div>';
136
+ $html .= '</div>';
137
+ $html .= '<div class="cherry-element-wrap">';
138
+ $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'] ) . '" >';
139
+ $html .= '<input 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'] ) . '"/>';
140
+ $html .= '<div class="clear"></div>';
141
  $html .= '</div>';
 
 
 
 
 
142
  $html .= '</div>';
143
  $html .= '</div>';
144
+ }
145
 
146
  return $html;
147
  }
152
  * @since 4.0.0
153
  */
154
  public static function enqueue_assets() {
155
+ if ( current_user_can( 'upload_files' ) ) {
156
+ wp_enqueue_media();
157
+
158
+ wp_enqueue_script(
159
+ 'ui-media-min',
160
+ esc_url( Cherry_Core::base_url( 'assets/min/ui-media.min.js', __FILE__ ) ),
161
+ array( 'jquery', 'jquery-ui-sortable' ),
162
+ '1.0.0',
163
+ true
164
+ );
165
+
166
+ wp_enqueue_style(
167
+ 'ui-media-min',
168
+ esc_url( Cherry_Core::base_url( 'assets/min/ui-media.min.css', __FILE__ ) ),
169
+ array(),
170
+ '1.0.0',
171
+ 'all'
172
+ );
173
+ }
174
  }
175
  }
176
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/min/ui-radio.min.css CHANGED
@@ -1,67 +1 @@
1
- .cherry-ui-container {
2
- margin: 10px 0 20px 0; }
3
-
4
- label.cherry-label {
5
- margin: 0 0 5px 0;
6
- display: block; }
7
-
8
- input.cherry-radio-input {
9
- display: none; }
10
-
11
- .cherry-radio-item {
12
- margin-bottom: 10px; }
13
- .cherry-radio-item:last-child {
14
- margin-bottom: 0; }
15
- .cherry-radio-item label {
16
- display: inline-block;
17
- font-size: 14px;
18
- line-height: 22px;
19
- color: #23282d; }
20
- .cherry-radio-item span {
21
- width: 25px;
22
- height: 25px;
23
- border-radius: 25px;
24
- margin-right: 10px;
25
- cursor: pointer;
26
- position: relative;
27
- background-color: #f1f1f1;
28
- display: inline-block;
29
- float: left; }
30
- .cherry-radio-item span i {
31
- width: 13px;
32
- height: 13px;
33
- background-color: #298ffc;
34
- margin: 6px;
35
- border-radius: 20px;
36
- display: inline-block;
37
- -webkit-transform: scale(0);
38
- -ms-transform: scale(0);
39
- transform: scale(0);
40
- -webkit-transition: all 0.3s cubic-bezier(0.27, 0.63, 0.54, 0.96);
41
- transition: all 0.3s cubic-bezier(0.27, 0.63, 0.54, 0.96); }
42
-
43
- .cherry-radio-item.checked span i {
44
- -webkit-transform: scale(1);
45
- -ms-transform: scale(1);
46
- transform: scale(1); }
47
-
48
- .cherry-radio-img {
49
- float: left;
50
- margin: 10px 5px 0 5px;
51
- text-align: center;
52
- max-width: 80px;
53
- position: relative; }
54
- .cherry-radio-img label {
55
- display: inline-block; }
56
- .cherry-radio-img img {
57
- width: 100%;
58
- height: auto;
59
- margin: 0 0 5px 0;
60
- pointer-events: none; }
61
-
62
- .cherry-radio-img.checked {
63
- font-weight: bold; }
64
- .cherry-radio-img.checked .check {
65
- display: block; }
66
- .cherry-radio-img.checked img {
67
- box-shadow: 0 0 0 2px #fffeff, 0 0 0 5px #298ffc; }
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);-ms-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);-ms-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(e,r){"use strict";r.utilites.namespace("ui_elements.radio"),r.ui_elements.radio={init:function(){e(document).on("ready",this.render),e(window).on("cherry-ui-elements-init",this.render)},render:function(r){var i=r._target?r._target:e("body");e(".cherry-radio-group",i).each(function(){e('.cherry-radio-input[type="radio"]',this).each(function(){var r=e(this),t=r.data("slave");r.is(":checked")||e("."+t,i).stop().hide()})}),e('.cherry-radio-input[type="radio"]',i).on("change",function(){var r=e(this),t=r.data("slave"),a=r.parents(".cherry-radio-group"),n=e('.cherry-radio-input[type="radio"]',a);r.parents(".cherry-radio-group").find(".checked").removeClass("checked"),r.parent().addClass("checked"),e("."+t,i).show(),n.each(function(){var r=e(this),a=r.data("slave");a!==t&&e("."+a,i).hide()}),r.trigger("radio_change_event",[t,n])})}},r.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",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);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/ui-radio.js CHANGED
@@ -1,53 +1,48 @@
1
  /**
2
  * Radio
3
  */
4
- ( function( $, CherryJsCore ){
5
  'use strict';
6
 
7
  CherryJsCore.utilites.namespace('ui_elements.radio');
8
  CherryJsCore.ui_elements.radio = {
 
 
 
 
9
  init: function () {
10
- $( document ).on( 'ready', this.render );
11
- $( window ).on( 'cherry-ui-elements-init', this.render );
 
12
  },
13
- render: function ( event ) {
14
- var target = ( event._target ) ? event._target : $( 'body' );
15
-
16
- $( '.cherry-radio-group', target ).each( function() {
17
- $( '.cherry-radio-input[type="radio"]', this ).each( function() {
18
- var $this = $(this),
19
- this_slave = $this.data('slave');
20
-
21
- if ( ! $this.is( ':checked' ) ) {
22
- $( '.' + this_slave, target ).stop().hide();
23
- }
24
- } );
25
- } );
26
-
27
- $( '.cherry-radio-input[type="radio"]', target ).on( 'change', function() {
28
- var $this = $(this),
29
- slave = $this.data('slave'),
30
- radio_group = $this.parents('.cherry-radio-group'),
31
- radio_group_list = $('.cherry-radio-input[type="radio"]', radio_group);
32
-
33
- $this.parents('.cherry-radio-group').find('.checked').removeClass('checked');
34
- $this.parent().addClass('checked');
35
-
36
- $('.' + slave, target).show();
37
- radio_group_list.each(function(){
38
- var $this = $(this),
39
- this_slave = $this.data('slave');
40
-
41
- if( this_slave !== slave ){
42
- $('.' + this_slave, target).hide();
43
- }
44
- });
45
-
46
- $this.trigger( 'radio_change_event', [slave, radio_group_list] );
47
- });
48
  }
49
  };
50
 
51
  CherryJsCore.ui_elements.radio.init();
52
-
53
- }( jQuery, window.CherryJsCore ) );
1
  /**
2
  * Radio
3
  */
4
+ (function($, CherryJsCore){
5
  'use strict';
6
 
7
  CherryJsCore.utilites.namespace('ui_elements.radio');
8
  CherryJsCore.ui_elements.radio = {
9
+ inputClass: '.cherry-radio-input:not([name*="__i__"])',
10
+ containerClass: '.cherry-ui-container',
11
+ wrapperClass: '.widget, .postbox, .cherry-form',
12
+
13
  init: function () {
14
+ $( document )
15
+ .on( 'ready.cherry-ui-elements-init', this.addEvent.bind( this ) )
16
+ .on( 'cherry-ui-elements-init', this.setState.bind( this ) );
17
  },
18
+ addEvent: function () {
19
+ $( 'body' ).on( 'click.masterSlave', this.inputClass, this.switchState.bind( this ) );
20
+ this.setState( { '_target': $( 'body' ) } );
21
+ },
22
+ setState: function ( event ) {
23
+ this.switchState( { 'currentTarget': $( this.inputClass, event._target ) } );
24
+ },
25
+ switchState: function ( event ) {
26
+ var parent = $( event.currentTarget ).closest( this.containerClass ),
27
+ children = $( this.inputClass, parent ),
28
+ i = children.length - 1,
29
+ $_target,
30
+ wrapper,
31
+ data;
32
+
33
+ for (; i >= 0; i--) {
34
+ $_target = $( children[ i ] );
35
+ data = $_target.data();
36
+ wrapper = $_target.closest( this.wrapperClass );
37
+
38
+ if ( jQuery.isEmptyObject( data ) ) {
39
+ continue;
40
+ } else {
41
+ $( '.' + data.slave, wrapper )[ ( $_target[ 0 ].checked ) ? 'removeClass' : 'addClass' ]( 'hide' );
42
+ }
43
+ }
 
 
 
 
 
 
 
 
 
44
  }
45
  };
46
 
47
  CherryJsCore.ui_elements.radio.init();
48
+ }(jQuery, window.CherryJsCore));
 
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/assets/ui-radio.scss CHANGED
@@ -8,6 +8,9 @@ label.cherry-label{
8
  margin: 0 0 5px 0;
9
  display: block;
10
  }
 
 
 
11
  input.cherry-radio-input{
12
  display: none;
13
  }
@@ -40,14 +43,18 @@ input.cherry-radio-input{
40
  border-radius: 20px;
41
  display: inline-block;
42
  transform: scale(0);
43
- transition: all 0.3s cubic-bezier(.27,.63,.54,.96);
44
  }
45
  }
46
  }
47
- .cherry-radio-item.checked{
48
- span{
49
- i{
50
- transform: scale(1);
 
 
 
 
51
  }
52
  }
53
  }
@@ -67,12 +74,16 @@ input.cherry-radio-input{
67
  pointer-events: none;
68
  }
69
  }
70
- .cherry-radio-img.checked{
71
- font-weight: bold;
72
- .check{
73
- display: block;
74
- }
75
- img{
76
- box-shadow: 0 0 0 2px rgba(255, 254, 255, 1), 0 0 0 5px $blue_color;
 
 
 
 
77
  }
78
- }
8
  margin: 0 0 5px 0;
9
  display: block;
10
  }
11
+ .hide{
12
+ display: none !important;
13
+ }
14
  input.cherry-radio-input{
15
  display: none;
16
  }
43
  border-radius: 20px;
44
  display: inline-block;
45
  transform: scale(0);
46
+ transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
47
  }
48
  }
49
  }
50
+ .cherry-radio-item{
51
+ .cherry-radio-input:checked{
52
+ & + label{
53
+ span{
54
+ i{
55
+ transform: scale(1);
56
+ }
57
+ }
58
  }
59
  }
60
  }
74
  pointer-events: none;
75
  }
76
  }
77
+ .cherry-radio-img{
78
+ .cherry-radio-input:checked{
79
+ & + label{
80
+ font-weight: bold;
81
+ .check{
82
+ display: block;
83
+ }
84
+ img{
85
+ box-shadow: 0 0 0 2px rgba(255, 254, 255, 1), 0 0 0 5px $blue_color;
86
+ }
87
+ }
88
  }
89
+ }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-radio/ui-radio.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -60,7 +60,7 @@ if ( ! class_exists( 'UI_Radio' ) ) {
60
  */
61
  function __construct( $args = array() ) {
62
 
63
- $this->defaults_settings['id'] = 'cherry-ui-radio-'.uniqid();
64
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
65
 
66
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
@@ -75,9 +75,10 @@ if ( ! class_exists( 'UI_Radio' ) ) {
75
  */
76
  public function render() {
77
  $html = '';
78
- $master_class = ! empty( $this->settings['master'] ) && isset( $this->settings['master'] ) ? esc_html( $this->settings['master'] ) : '';
 
79
 
80
- $html .= '<div class="cherry-ui-container ' . $master_class . '">';
81
  if ( $this->settings['options'] && ! empty( $this->settings['options'] ) && is_array( $this->settings['options'] ) ) {
82
  if ( '' !== $this->settings['label'] ) {
83
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . $this->settings['label'] . '</label> ';
@@ -88,10 +89,10 @@ if ( ! class_exists( 'UI_Radio' ) ) {
88
  $radio_id = $this->settings['id'] . '-' . $option;
89
  $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>';
90
  $data_slave = isset( $option_value['slave'] ) && ! empty( $option_value['slave'] ) ? ' data-slave="' . $option_value['slave'] . '"' : '';
91
- $class_box = isset( $option_value['img_src'] ) && ! empty( $option_value['img_src'] ) ? ' cherry-radio-img' . $checked : ' cherry-radio-item' . $checked;
92
 
93
  $html .= '<div class="' . $class_box . '">';
94
- $html .= '<input type="radio" id="' . esc_attr( $radio_id ) . '" class="cherry-radio-input ' . sanitize_html_class( $this->settings['class'] ) . '" name="' . esc_attr( $this->settings['name'] ) . '" ' . checked( $option, $this->settings['value'], false ) . ' value="' . esc_attr( $option ) . '"' . $data_slave . '>';
95
  $label_content = $img . $option_value['label'];
96
  $html .= '<label for="' . esc_attr( $radio_id ) . '">' . $label_content . '</label> ';
97
  $html .= '</div>';
@@ -110,14 +111,6 @@ if ( ! class_exists( 'UI_Radio' ) ) {
110
  * @since 4.0.0
111
  */
112
  public static function enqueue_assets() {
113
- wp_enqueue_script(
114
- 'ui-radio-min',
115
- esc_url( Cherry_Core::base_url( 'assets/min/ui-radio.min.js', __FILE__ ) ),
116
- array( 'jquery' ),
117
- '1.0.0',
118
- true
119
- );
120
-
121
  wp_enqueue_style(
122
  'ui-radio-min',
123
  esc_url( Cherry_Core::base_url( 'assets/min/ui-radio.min.css', __FILE__ ) ),
@@ -125,6 +118,13 @@ if ( ! class_exists( 'UI_Radio' ) ) {
125
  '1.0.0',
126
  'all'
127
  );
 
 
 
 
 
 
 
128
  }
129
  }
130
  }
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
60
  */
61
  function __construct( $args = array() ) {
62
 
63
+ $this->defaults_settings['id'] = 'cherry-ui-radio-' . uniqid();
64
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
65
 
66
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
75
  */
76
  public function render() {
77
  $html = '';
78
+ $class = $this->settings['class'];
79
+ $class .= ' ' . $this->settings['master'];
80
 
81
+ $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
82
  if ( $this->settings['options'] && ! empty( $this->settings['options'] ) && is_array( $this->settings['options'] ) ) {
83
  if ( '' !== $this->settings['label'] ) {
84
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . $this->settings['label'] . '</label> ';
89
  $radio_id = $this->settings['id'] . '-' . $option;
90
  $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>';
91
  $data_slave = isset( $option_value['slave'] ) && ! empty( $option_value['slave'] ) ? ' data-slave="' . $option_value['slave'] . '"' : '';
92
+ $class_box = isset( $option_value['img_src'] ) && ! empty( $option_value['img_src'] ) ? ' cherry-radio-img' : ' cherry-radio-item' ;
93
 
94
  $html .= '<div class="' . $class_box . '">';
95
+ $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 . '>';
96
  $label_content = $img . $option_value['label'];
97
  $html .= '<label for="' . esc_attr( $radio_id ) . '">' . $label_content . '</label> ';
98
  $html .= '</div>';
111
  * @since 4.0.0
112
  */
113
  public static function enqueue_assets() {
 
 
 
 
 
 
 
 
114
  wp_enqueue_style(
115
  'ui-radio-min',
116
  esc_url( Cherry_Core::base_url( 'assets/min/ui-radio.min.css', __FILE__ ) ),
118
  '1.0.0',
119
  'all'
120
  );
121
+ wp_enqueue_script(
122
+ 'ui-radio-min',
123
+ esc_url( Cherry_Core::base_url( 'assets/min/ui-radio.min.js', __FILE__ ) ),
124
+ array( 'jquery' ),
125
+ '1.0.0',
126
+ true
127
+ );
128
  }
129
  }
130
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/min/ui-repeater.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"use strict";t.utilites.namespace("ui_elements.repeater"),t.ui_elements.repeater={repeaterContainerClass:".cherry-ui-repeater-container",repeaterListClass:".cherry-ui-repeater-list",repeaterItemClass:".cherry-ui-repeater-item",repeaterItemHandleClass:".cherry-ui-repeater-actions-box",repeaterTitleClass:".cherry-ui-repeater-title",addItemButtonClass:".cherry-ui-repeater-add",removeItemButtonClass:".cherry-ui-repeater-remove",toggleItemButtonClass:".cherry-ui-repeater-toggle",minItemClass:"cherry-ui-repeater-min",sortablePlaceholderClass:"sortable-placeholder",init:function(){e(document).on("ready",this.addEvents.bind(this))},addEvents:function(){e("body").on("click",this.addItemButtonClass,{self:this},this.addItem).on("click",this.removeItemButtonClass,{self:this},this.removeItem).on("click",this.toggleItemButtonClass,{self:this},this.toggleItem).on("change",this.repeaterListClass+" input, "+this.repeaterListClass+" textarea, "+this.repeaterListClass+" select",{self:this},this.changeWrapperLable).on("sortable-init",{self:this},this.sortableItem),e(window).on("cherry-ui-elements-init",{self:this},this.sortableItem),this.triggers()},triggers:function(t){return e("body").trigger("sortable-init"),t&&e(window).trigger("cherry-ui-elements-init",{target:t}),this},addItem:function(t){var s=t.data.self,a=e(this).prev(s.repeaterListClass),r=a.data("index"),i=a.data("name"),l=wp.template(i),n=a.data("widget-id"),o={index:r};n&&(o.widgetId=n),a.append(l(o)),r++,a.data("index",r),s.triggers(e(s.repeaterItemClass+":last",a)).stopDefaultEvent(t)},removeItem:function(t){var s=t.data.self,a=e(this).closest(s.repeaterListClass);s.applyChanges(a),e(this).closest(s.repeaterItemClass).remove(),s.triggers().stopDefaultEvent(t)},toggleItem:function(t){var s=t.data.self,a=e(this).closest(s.repeaterItemClass);a.toggleClass(s.minItemClass),s.stopDefaultEvent(t)},sortableItem:function(t){var s,a,r=t.data.self,i=e(r.repeaterListClass);i.each(function(t,i){s=e(i),a=e(i).data("sortable-init"),s.sortable(a?"refresh":{items:r.repeaterItemClass,handle:r.repeaterItemHandleClass,cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,placeholder:r.sortablePlaceholderClass,create:function(){s.data("sortable-init",!0)},update:function(t){var s=e(t.target);r.applyChanges(s)}})})},changeWrapperLable:function(t){var s,a,r=t.data.self,i=e(r.repeaterListClass),l=i.data("title-field"),n=e(this);l&&n.closest("."+l+"-wrap")[0]&&(s=n.val(),a=n.closest(r.repeaterItemClass),e(r.repeaterTitleClass,a).html(s)),r.stopDefaultEvent(t)},applyChanges:function(t){return void 0!==wp.customize&&e("input[name]:first, select[name]:first",t).change(),this},stopDefaultEvent:function(e){return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),this}},t.ui_elements.repeater.init()}(jQuery,window.CherryJsCore);
1
+ !function(e,t){"use strict";t.utilites.namespace("ui_elements.repeater"),t.ui_elements.repeater={repeaterContainerClass:".cherry-ui-repeater-container",repeaterListClass:".cherry-ui-repeater-list",repeaterItemClass:".cherry-ui-repeater-item",repeaterItemHandleClass:".cherry-ui-repeater-actions-box",repeaterTitleClass:".cherry-ui-repeater-title",addItemButtonClass:".cherry-ui-repeater-add",removeItemButtonClass:".cherry-ui-repeater-remove",toggleItemButtonClass:".cherry-ui-repeater-toggle",minItemClass:"cherry-ui-repeater-min",sortablePlaceholderClass:"sortable-placeholder",init:function(){e(document).on("ready",this.addEvents.bind(this))},addEvents:function(){e("body").on("click",this.addItemButtonClass,{self:this},this.addItem).on("click",this.removeItemButtonClass,{self:this},this.removeItem).on("click",this.toggleItemButtonClass,{self:this},this.toggleItem).on("change",this.repeaterListClass+" input, "+this.repeaterListClass+" textarea, "+this.repeaterListClass+" select",{self:this},this.changeWrapperLable).on("sortable-init",{self:this},this.sortableItem),e(document).on("cherry-ui-elements-init",{self:this},this.sortableItem),this.triggers()},triggers:function(t){return e("body").trigger("sortable-init"),t&&e(document).trigger("cherry-ui-elements-init",{target:t}),this},addItem:function(t){var s=t.data.self,a=e(this).prev(s.repeaterListClass),r=a.data("index"),i=a.data("name"),l=wp.template(i),n=a.data("widget-id"),o={index:r};n="__i__"!==n?n:a.attr("id"),n&&(o.widgetId=n),a.append(l(o)),r++,a.data("index",r),s.triggers(e(s.repeaterItemClass+":last",a)).stopDefaultEvent(t)},removeItem:function(t){var s=t.data.self,a=e(this).closest(s.repeaterListClass);s.applyChanges(a),e(this).closest(s.repeaterItemClass).remove(),s.triggers().stopDefaultEvent(t)},toggleItem:function(t){var s=t.data.self,a=e(this).closest(s.repeaterItemClass);a.toggleClass(s.minItemClass),s.stopDefaultEvent(t)},sortableItem:function(t){var s,a,r=t.data.self,i=e(r.repeaterListClass);i.each(function(t,i){s=e(i),a=e(i).data("sortable-init"),s.sortable(a?"refresh":{items:r.repeaterItemClass,handle:r.repeaterItemHandleClass,cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,placeholder:r.sortablePlaceholderClass,create:function(){s.data("sortable-init",!0)},update:function(t){var s=e(t.target);r.applyChanges(s)}})})},changeWrapperLable:function(t){var s,a,r=t.data.self,i=e(r.repeaterListClass),l=i.data("title-field"),n=e(this);l&&n.closest("."+l+"-wrap")[0]&&(s=n.val(),a=n.closest(r.repeaterItemClass),e(r.repeaterTitleClass,a).html(s)),r.stopDefaultEvent(t)},applyChanges:function(t){return void 0!==wp.customize&&e("input[name]:first, select[name]:first",t).change(),this},stopDefaultEvent:function(e){return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),this}},t.ui_elements.repeater.init()}(jQuery,window.CherryJsCore);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/assets/ui-repeater.js CHANGED
@@ -37,7 +37,7 @@
37
  // Custom events
38
  .on( 'sortable-init', { 'self': this }, this.sortableItem );
39
 
40
- $( window )
41
  .on( 'cherry-ui-elements-init', { 'self': this }, this.sortableItem );
42
 
43
  this.triggers();
@@ -47,7 +47,7 @@
47
  $( 'body' ).trigger( 'sortable-init' );
48
 
49
  if ( $target ) {
50
- $( window ).trigger( 'cherry-ui-elements-init', { 'target': $target } );
51
  }
52
 
53
  return this;
@@ -62,6 +62,8 @@
62
  widgetId = $list.data( 'widget-id' ),
63
  data = { index: index };
64
 
 
 
65
  if ( widgetId ) {
66
  data.widgetId = widgetId;
67
  }
37
  // Custom events
38
  .on( 'sortable-init', { 'self': this }, this.sortableItem );
39
 
40
+ $( document )
41
  .on( 'cherry-ui-elements-init', { 'self': this }, this.sortableItem );
42
 
43
  this.triggers();
47
  $( 'body' ).trigger( 'sortable-init' );
48
 
49
  if ( $target ) {
50
+ $( document ).trigger( 'cherry-ui-elements-init', { 'target': $target } );
51
  }
52
 
53
  return this;
62
  widgetId = $list.data( 'widget-id' ),
63
  data = { index: index };
64
 
65
+ widgetId = '__i__' !== widgetId ? widgetId : $list.attr( 'id' ) ;
66
+
67
  if ( widgetId ) {
68
  data.widgetId = widgetId;
69
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-repeater/ui-repeater.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -114,16 +114,15 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
114
  * @since 1.0.1
115
  */
116
  public function render() {
117
-
118
- $html = '';
119
-
120
- $master_class = ! empty( $this->settings['master'] ) && isset( $this->settings['master'] ) ? esc_html( $this->settings['master'] ) : '';
121
-
122
- $ui_kit = ! empty( $this->settings['ui_kit'] ) ? 'cherry-ui-kit' : '';
123
 
124
  $html .= sprintf( '<div class="cherry-ui-repeater-container cherry-ui-container %1$s %2$s">',
125
  $ui_kit,
126
- $master_class
127
  );
128
  if ( '' !== $this->settings['label'] ) {
129
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
@@ -132,8 +131,8 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
132
  $html .= sprintf(
133
  '<div class="cherry-ui-repeater-list" data-name="%1$s" data-index="%2$s" data-widget-id="__i__" %3$s id="%4$s">',
134
  $this->get_tmpl_name(),
135
- ( ! empty( $this->settings['value'] ) ) ? count( $this->settings['value'] ) : 0,
136
- ( ! empty( $this->settings['title_field'] ) ) ? 'data-title-field="' . $this->settings['title_field'] . '"': '',
137
  esc_attr( $this->settings['id'] )
138
  );
139
 
@@ -219,14 +218,14 @@ if ( ! class_exists( 'UI_Repeater' ) ) {
219
  return '"type" and "name" are required fields for UI_Repeater items';
220
  }
221
 
222
- $field = wp_parse_args( $field, array( 'value' => '' ) );
223
- $parent_name = str_replace( '__i__', $widget_index, $this->settings['name'] );
224
 
225
  $field['id'] = sprintf( '%s-%s', $field['id'], $index );
226
  $field['value'] = isset( $this->data[ $field['name'] ] ) ? $this->data[ $field['name'] ] : $field['value'];
227
  $field['name'] = sprintf( '%1$s[item-%2$s][%3$s]', $parent_name, $index, $field['name'] );
228
 
229
- $ui_class_name = 'UI_' . ucwords( $field['type'] );
230
 
231
  if ( ! class_exists( $ui_class_name ) ) {
232
  return '<p>Class <b>' . $ui_class_name . '</b> not exist!</p>';
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
114
  * @since 1.0.1
115
  */
116
  public function render() {
117
+ $html = '';
118
+ $class = $this->settings['class'] . ' ' . $this->settings['master'];
119
+ $ui_kit = ! empty( $this->settings['ui_kit'] ) ? 'cherry-ui-kit' : '';
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 )
126
  );
127
  if ( '' !== $this->settings['label'] ) {
128
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
131
  $html .= sprintf(
132
  '<div class="cherry-ui-repeater-list" data-name="%1$s" data-index="%2$s" data-widget-id="__i__" %3$s id="%4$s">',
133
  $this->get_tmpl_name(),
134
+ $value,
135
+ $title_field,
136
  esc_attr( $this->settings['id'] )
137
  );
138
 
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'] );
227
 
228
+ $ui_class_name = 'UI_' . ucwords( $field['type'] );
229
 
230
  if ( ! class_exists( $ui_class_name ) ) {
231
  return '<p>Class <b>' . $ui_class_name . '</b> not exist!</p>';
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/select2.min.css CHANGED
@@ -1,9 +1,9 @@
1
  .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}
2
- .select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}
3
  .select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
4
  .select2-container .select2-selection--single .select2-selection__clear{position:relative}
5
  .select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}
6
- .select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}
7
  .select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}
8
  .select2-container .select2-search--inline{float:left}
9
  .select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}
@@ -11,7 +11,7 @@
11
  .select2-dropdown{background-color:#fff;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}
12
  .select2-results{display:block}
13
  .select2-results__options{list-style:none;margin:0;padding:0}
14
- .select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}
15
  .select2-results__option[aria-selected]{cursor:pointer}
16
  .select2-container--open .select2-dropdown{left:0}
17
  .select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}
@@ -64,20 +64,20 @@
64
  .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}
65
  .select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:#fff}
66
  .select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}
67
- .select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top,#fff 50%,#eee 100%);background-image:-o-linear-gradient(top,#fff 50%,#eee 100%);background-image:linear-gradient(to bottom,#fff 50%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}
68
  .select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}
69
  .select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}
70
  .select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px}
71
  .select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}
72
- .select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top,#eee 50%,#ccc 100%);background-image:-o-linear-gradient(top,#eee 50%,#ccc 100%);background-image:linear-gradient(to bottom,#eee 50%,#ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}
73
  .select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}
74
  .select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}
75
  .select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}
76
  .select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}
77
  .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:0 0;border:none}
78
  .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}
79
- .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top,#fff 0,#eee 50%);background-image:-o-linear-gradient(top,#fff 0,#eee 50%);background-image:linear-gradient(to bottom,#fff 0,#eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}
80
- .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top,#eee 50%,#fff 100%);background-image:-o-linear-gradient(top,#eee 50%,#fff 100%);background-image:linear-gradient(to bottom,#eee 50%,#fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}
81
  .select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}
82
  .select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}
83
  .select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}
1
  .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}
2
+ .select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}
3
  .select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
4
  .select2-container .select2-selection--single .select2-selection__clear{position:relative}
5
  .select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}
6
+ .select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}
7
  .select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}
8
  .select2-container .select2-search--inline{float:left}
9
  .select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}
11
  .select2-dropdown{background-color:#fff;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}
12
  .select2-results{display:block}
13
  .select2-results__options{list-style:none;margin:0;padding:0}
14
+ .select2-results__option{padding:6px;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}
15
  .select2-results__option[aria-selected]{cursor:pointer}
16
  .select2-container--open .select2-dropdown{left:0}
17
  .select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}
64
  .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}
65
  .select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:#fff}
66
  .select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}
67
+ .select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top,#fff 50%,#eee 100%);background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom,#fff 50%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}
68
  .select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}
69
  .select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}
70
  .select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px}
71
  .select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}
72
+ .select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top,#eee 50%,#ccc 100%);background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom,#eee 50%,#ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}
73
  .select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}
74
  .select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}
75
  .select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}
76
  .select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}
77
  .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:0 0;border:none}
78
  .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}
79
+ .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top,#fff 0,#eee 50%);background-image:-webkit-linear-gradient(top, #fff 0, #eee 50%);background-image:linear-gradient(to bottom,#fff 0,#eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}
80
+ .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top,#eee 50%,#fff 100%);background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom,#eee 50%,#fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}
81
  .select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}
82
  .select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}
83
  .select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}
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}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;height:50px;border:1px solid #f1f1f1;box-shadow:none}select.cherry-ui-select:focus{border-color:rgba(72,197,105,0.6);box-shadow:0 0 2px rgba(72,197,105,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}.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:#495159;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:#e54343;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:#b4b7ba;border:none;border-radius:2px;margin:5px 0;z-index:500001}.select2-container .select2-dropdown .select2-results .select2-results__options .select2-results__option{color:#fff}.select2-container .select2-dropdown .select2-results .select2-results__options .select2-results__option[aria-selected=true]{background-color:#48c569}.select2-container .select2-dropdown .select2-results .select2-results__options .select2-results__option--highlighted{background-color:#495159}.select2-container .select2-dropdown .select2-results .select2-results__options .li[aria-disabled=true]{display:none}
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;height:50px;border:1px solid #f1f1f1;box-shadow:none}select.cherry-ui-select:focus{border-color:rgba(72,197,105,0.6);box-shadow:0 0 2px rgba(72,197,105,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}.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:#495159;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:#e54343;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:#48c569}.select2-container .select2-dropdown .select2-results .select2-results__options .select2-results__option--highlighted{color:#fff;background-color:#495159}.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={init:function(){e(document).on("ready",this.render),e(window).on("cherry-ui-elements-init",this.render)},render:function(t){var i=t._target?t._target:e("body");e('.cherry-ui-select[data-filter="true"]:not([name*="__i__"]), .cherry-ui-select[multiple]:not([name*="__i__"])',i).each(function(){var t=e(this);t.select2({placeholder:t.attr("placeholder")})})}},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",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);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.js CHANGED
@@ -6,21 +6,53 @@
6
 
7
  CherryJsCore.utilites.namespace('ui_elements.select');
8
  CherryJsCore.ui_elements.select = {
 
 
 
9
  init: function () {
10
- $( document ).on( 'ready', this.render );
11
- $( window ).on( 'cherry-ui-elements-init', this.render );
 
12
  },
13
- render: function ( event, data ) {
14
  var target = ( event._target ) ? event._target : $( 'body' );
15
 
16
  // init filter-select
17
- $( '.cherry-ui-select[data-filter="true"]:not([name*="__i__"]), .cherry-ui-select[multiple]:not([name*="__i__"])', target ).each( function() {
18
- var $this = $( this );
19
-
20
- $this.select2( {
 
21
  placeholder: $this.attr('placeholder')
22
- } );
23
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
  };
26
 
6
 
7
  CherryJsCore.utilites.namespace('ui_elements.select');
8
  CherryJsCore.ui_elements.select = {
9
+ selectClass: '.cherry-ui-select[data-filter="true"]:not([name*="__i__"]), .cherry-ui-select[multiple]:not([name*="__i__"])',
10
+ wrapperClass: '.widget, .postbox, .cherry-form',
11
+
12
  init: function () {
13
+ $( document )
14
+ .on( 'ready.cherry-ui-elements-init', this.render.bind( this ) )
15
+ .on( 'cherry-ui-elements-init', this.render.bind( this ) );
16
  },
17
+ render: function ( event ) {
18
  var target = ( event._target ) ? event._target : $( 'body' );
19
 
20
  // init filter-select
21
+ $( this.selectClass , target ).each( this.select2Init.bind( this ) );
22
+ },
23
+ select2Init: function ( index, element ) {
24
+ var $this = $( element ),
25
+ options = {
26
  placeholder: $this.attr('placeholder')
27
+ };
28
+
29
+ $this
30
+ .select2( options )
31
+ .on('change.cherrySelect2', this.changeEvent.bind( this ) )
32
+ .trigger('change.cherrySelect2');
33
+ },
34
+ changeEvent: function ( event ) {
35
+ this.switchState( event.currentTarget );
36
+ },
37
+ switchState: function ( item ) {
38
+ var items = $( item ),
39
+ i = items[0].length,
40
+ option,
41
+ data,
42
+ wrapper;
43
+
44
+ for (; i >= 0; i--) {
45
+ option = $( items[0][ i ] );
46
+ data = option.data();
47
+ wrapper = $( items[0] ).closest( this.wrapperClass );
48
+
49
+ if ( jQuery.isEmptyObject( data ) ) {
50
+ continue;
51
+ } else {
52
+ $( '.' + data.slave, wrapper )[ ( option[ 0 ].selected ) ? 'removeClass' : 'addClass' ]( 'hide' );
53
+ }
54
+ }
55
+
56
  }
57
  };
58
 
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ui-select.scss CHANGED
@@ -8,6 +8,9 @@ label.cherry-label{
8
  margin: 0 0 5px 0;
9
  display: block;
10
  }
 
 
 
11
  select.cherry-ui-select{
12
  width: 100%;
13
  outline: 0 none;
@@ -84,22 +87,32 @@ select.select2-hidden-accessible{
84
  }
85
  .select2-container{
86
  .select2-dropdown{
87
- background-color: $grey_color_4;
88
  border: none;
89
  border-radius: $border_radius_extra_small;
90
  margin: 5px 0;
 
91
  z-index: 500001;
92
- &.select2-container--open, &.select2-dropdown--below{
93
-
 
 
 
 
 
 
 
94
  }
95
  .select2-results{
96
  .select2-results__options{
97
  .select2-results__option{
98
- color: #fff;
99
  &[aria-selected=true]{
 
100
  background-color: $green_color;
101
  }
102
  &--highlighted{
 
103
  background-color: $dark_color_2;
104
  }
105
  }
@@ -109,4 +122,4 @@ select.select2-hidden-accessible{
109
  }
110
  }
111
  }
112
- }
8
  margin: 0 0 5px 0;
9
  display: block;
10
  }
11
+ .hide{
12
+ display: none !important;
13
+ }
14
  select.cherry-ui-select{
15
  width: 100%;
16
  outline: 0 none;
87
  }
88
  .select2-container{
89
  .select2-dropdown{
90
+ background-color: $grey_color_2;
91
  border: none;
92
  border-radius: $border_radius_extra_small;
93
  margin: 5px 0;
94
+ box-shadow: 0px 5px 21px rgba(0,0,0,0.1);
95
  z-index: 500001;
96
+ &.select2-container--open, &.select2-dropdown--below{}
97
+ .select2-search__field{
98
+ border: none;
99
+ box-shadow: none;
100
+ border-radius: $border_radius_extra_small;
101
+ margin: 0;
102
+ &:focus{
103
+ outline: none;
104
+ }
105
  }
106
  .select2-results{
107
  .select2-results__options{
108
  .select2-results__option{
109
+
110
  &[aria-selected=true]{
111
+ color: #fff;
112
  background-color: $green_color;
113
  }
114
  &--highlighted{
115
+ color: #fff;
116
  background-color: $dark_color_2;
117
  }
118
  }
122
  }
123
  }
124
  }
125
+ }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/ui-select.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -39,18 +39,21 @@ if ( ! class_exists( 'UI_Select' ) ) {
39
  'select-2' => 'select 2',
40
  'select-3' => 'select 3',
41
  'select-4' => 'select 4',
42
- 'select-5' => 'select 5',
43
- 'optgroup-1' => array(
44
- 'label' => 'Group 1',
45
- 'group_options' => array(
 
 
 
46
  'select-6' => 'select 6',
47
  'select-7' => 'select 7',
48
  'select-8' => 'select 8',
49
  ),
50
  ),
51
  'optgroup-2' => array(
52
- 'label' => 'Group 2',
53
- 'group_options' => array(
54
  'select-9' => 'select 9',
55
  'select-10' => 'select 10',
56
  'select-11' => 'select 11',
@@ -70,7 +73,7 @@ if ( ! class_exists( 'UI_Select' ) ) {
70
  */
71
  function __construct( $args = array() ) {
72
 
73
- $this->defaults_settings['id'] = 'cherry-ui-select-'.uniqid();
74
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
75
 
76
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
@@ -83,12 +86,11 @@ if ( ! class_exists( 'UI_Select' ) ) {
83
  * @since 4.0.0
84
  */
85
  public function render() {
86
-
87
  $html = '';
 
 
88
 
89
- $master_class = ! empty( $this->settings['master'] ) && isset( $this->settings['master'] ) ? esc_html( $this->settings['master'] ) : '';
90
-
91
- $html .= '<div class="cherry-ui-container ' . $master_class . '">';
92
 
93
  ( $this->settings['filter'] ) ? $filter_state = 'data-filter="true"' : $filter_state = 'data-filter="false"' ;
94
 
@@ -101,7 +103,7 @@ if ( ! class_exists( 'UI_Select' ) ) {
101
 
102
  $inline_style = $this->settings['inline_style'] ? 'style="' . esc_attr( $this->settings['inline_style'] ) . '"' : '' ;
103
 
104
- $html .= '<select id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-ui-select ' . esc_attr( $this->settings['class'] ) . '" name="' . esc_attr( $name ) . '" size="' . esc_attr( $this->settings['size'] ) . '" ' . $multi_state . ' ' . $filter_state . ' placeholder="' . $this->settings['placeholder'] . '" ' . $inline_style . ' >';
105
  if ( $this->settings['options'] && ! empty( $this->settings['options'] ) && is_array( $this->settings['options'] ) ) {
106
  foreach ( $this->settings['options'] as $option => $option_value ) {
107
  if ( ! is_array( $this->settings['value'] ) ) {
@@ -117,7 +119,16 @@ if ( ! class_exists( 'UI_Select' ) ) {
117
  }
118
  }
119
  }
120
- $html .= '<option value="' . esc_attr( $option ) . '" ' . $selected_state . '>'. esc_html( $option_value ) .'</option>';
 
 
 
 
 
 
 
 
 
121
  } else {
122
  $html .= '<optgroup label="' . esc_attr( $option_value['label'] ) . '">';
123
  $selected_state = '';
@@ -128,7 +139,7 @@ if ( ! class_exists( 'UI_Select' ) ) {
128
  break;
129
  }
130
  }
131
- $html .= '<option value="' . esc_attr( $group_item ) . '" ' . $selected_state . '>'. esc_html( $group_value ) .'</option>';
132
  }
133
  $html .= '</optgroup>';
134
  }
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
39
  'select-2' => 'select 2',
40
  'select-3' => 'select 3',
41
  'select-4' => 'select 4',
42
+ 'select-5' => array(
43
+ 'label' => 'Group 1',
44
+ 'slave' => 'slave',
45
+ ),
46
+ 'optgroup-1' => array(
47
+ 'label' => 'Group 1',
48
+ 'group_options' => array(
49
  'select-6' => 'select 6',
50
  'select-7' => 'select 7',
51
  'select-8' => 'select 8',
52
  ),
53
  ),
54
  'optgroup-2' => array(
55
+ 'label' => 'Group 2',
56
+ 'group_options' => array(
57
  'select-9' => 'select 9',
58
  'select-10' => 'select 10',
59
  'select-11' => 'select 11',
73
  */
74
  function __construct( $args = array() ) {
75
 
76
+ $this->defaults_settings['id'] = 'cherry-ui-select-' . uniqid();
77
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
78
 
79
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
86
  * @since 4.0.0
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
 
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'] ) ) {
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 = '';
139
  break;
140
  }
141
  }
142
+ $html .= '<option value="' . esc_attr( $group_item ) . '" ' . $selected_state . '>' . esc_html( $group_value ) . '</option>';
143
  }
144
  $html .= '</optgroup>';
145
  }
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:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.cherry-slider-wrap .cherry-slider-input{-webkit-box-flex:0;-webkit-flex:0 1 10%;-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;-webkit-flex:0 1 90%;-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:28px;width:28px;border-radius:15px;background:#48c569;cursor:pointer;-webkit-appearance:none;margin-top:-11.5px}.cherry-slider-wrap .cherry-slider-holder input[type=range]:focus::-webkit-slider-thumb{background:#f1f1f1}.cherry-slider-wrap .cherry-slider-holder input[type=range]:hover::-webkit-slider-thumb{background:#f1f1f1}.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-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:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.cherry-slider-wrap .cherry-slider-input{-webkit-box-flex:0;-webkit-flex:0 1 10%;-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;-webkit-flex:0 1 90%;-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/min/ui-slider.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,i){"use strict";i.utilites.namespace("ui_elements.slider"),i.ui_elements.slider={init:function(){e(document).on("ready",this.render.bind(this))},render:function(){e("body").on("input change",".cherry-slider-unit, .cherry-ui-stepper-input",this.changeHandler)},changeHandler:function(){var i=e(this),r=i.hasClass("cherry-slider-unit")?".cherry-ui-stepper-input":".cherry-slider-unit",n=i.closest(".cherry-slider-wrap");e(r,n).val(i.val())}},i.ui_elements.slider.init()}(jQuery,window.CherryJsCore);
1
+ !function(e,i){"use strict";i.utilites.namespace("ui_elements.slider"),i.ui_elements.slider={init:function(){e(document).on("ready.cherry-ui-elements-init",this.render.bind(this))},render:function(){e("body").on("input.cherry-ui-elements-init change.cherry-ui-elements-init",".cherry-slider-unit, .cherry-ui-stepper-input",this.changeHandler)},changeHandler:function(){var i=e(this),r=i.hasClass("cherry-slider-unit")?".cherry-ui-stepper-input":".cherry-slider-unit",n=i.closest(".cherry-slider-wrap");e(r,n).val(i.val())}},i.ui_elements.slider.init()}(jQuery,window.CherryJsCore);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/ui-slider.js CHANGED
@@ -7,10 +7,10 @@
7
  CherryJsCore.utilites.namespace('ui_elements.slider');
8
  CherryJsCore.ui_elements.slider = {
9
  init: function () {
10
- $( document ).on( 'ready', this.render.bind( this ) );
11
  },
12
- render: function ( event, data ) {
13
- $( 'body' ).on( 'input change', '.cherry-slider-unit, .cherry-ui-stepper-input', this.changeHandler );
14
  },
15
  changeHandler: function () {
16
  var $this = $( this ),
7
  CherryJsCore.utilites.namespace('ui_elements.slider');
8
  CherryJsCore.ui_elements.slider = {
9
  init: function () {
10
+ $( document ).on( 'ready.cherry-ui-elements-init', this.render.bind( this ) );
11
  },
12
+ render: function () {
13
+ $( 'body' ).on( 'input.cherry-ui-elements-init change.cherry-ui-elements-init', '.cherry-slider-unit, .cherry-ui-stepper-input', this.changeHandler );
14
  },
15
  changeHandler: function () {
16
  var $this = $( this ),
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/assets/ui-slider.scss CHANGED
@@ -44,19 +44,26 @@ label.cherry-label{
44
  input[type=range]::-webkit-slider-thumb {
45
  box-shadow: 5px 5px 13px rgba(0, 0, 0, 0.18);
46
  border: 5px solid $green_color;
47
- height: 28px;
48
- width: 28px;
 
49
  border-radius: 15px;
50
  background: $green_color;
51
  cursor: pointer;
52
  -webkit-appearance: none;
53
- margin-top: -11.5px;
54
  }
55
  input[type=range]:focus::-webkit-slider-thumb {
56
  background: $grey_color_3;
 
 
 
57
  }
58
  input[type=range]:hover::-webkit-slider-thumb {
59
  background: $grey_color_3;
 
 
 
60
  }
61
  input[type=range]:focus::-webkit-slider-runnable-track {
62
  background: $green_color;
@@ -114,13 +121,9 @@ label.cherry-label{
114
  input[type=range]:focus::-ms-fill-upper {
115
  background: $green_color;
116
  }
117
-
118
- .cherry-slider-unit{
119
-
120
- }
121
  }
122
  .cherry-input{
123
  margin: 0;
124
  width: 100%;
125
  }
126
- }
44
  input[type=range]::-webkit-slider-thumb {
45
  box-shadow: 5px 5px 13px rgba(0, 0, 0, 0.18);
46
  border: 5px solid $green_color;
47
+ height: 20px;
48
+ width: 20px;
49
+ margin-top: -7px;
50
  border-radius: 15px;
51
  background: $green_color;
52
  cursor: pointer;
53
  -webkit-appearance: none;
54
+ transition: all 250ms cubic-bezier(0.645, 0.045, 0.355, 1);
55
  }
56
  input[type=range]:focus::-webkit-slider-thumb {
57
  background: $grey_color_3;
58
+ height: 28px;
59
+ width: 28px;
60
+ margin-top: -11.5px;
61
  }
62
  input[type=range]:hover::-webkit-slider-thumb {
63
  background: $grey_color_3;
64
+ height: 28px;
65
+ width: 28px;
66
+ margin-top: -11.5px;
67
  }
68
  input[type=range]:focus::-webkit-slider-runnable-track {
69
  background: $green_color;
121
  input[type=range]:focus::-ms-fill-upper {
122
  background: $green_color;
123
  }
 
 
 
 
124
  }
125
  .cherry-input{
126
  margin: 0;
127
  width: 100%;
128
  }
129
+ }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-slider/ui-slider.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -44,7 +44,7 @@ if ( ! class_exists( 'UI_Slider' ) ) {
44
  * @since 4.0.0
45
  */
46
  function __construct( $args = array() ) {
47
- $this->defaults_settings['id'] = 'cherry-ui-slider-'.uniqid();
48
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
49
 
50
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
@@ -57,10 +57,10 @@ if ( ! class_exists( 'UI_Slider' ) ) {
57
  */
58
  public function render() {
59
  $html = '';
 
 
60
 
61
- $master_class = ! empty( $this->settings['master'] ) && isset( $this->settings['master'] ) ? esc_html( $this->settings['master'] ) : '';
62
-
63
- $html .= '<div class="cherry-ui-container ' . $master_class . '">';
64
 
65
  $ui_stepper = new UI_Stepper(
66
  array(
@@ -79,7 +79,7 @@ if ( ! class_exists( 'UI_Slider' ) ) {
79
  }
80
  $html .= '<div class="cherry-slider-wrap">';
81
  $html .= '<div class="cherry-slider-holder">';
82
- $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'] ) . '">';
83
  $html .= '</div>';
84
  $html .= '<div class="cherry-slider-input">';
85
  $html .= $ui_stepper_html;
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
44
  * @since 4.0.0
45
  */
46
  function __construct( $args = array() ) {
47
+ $this->defaults_settings['id'] = 'cherry-ui-slider-' . uniqid();
48
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
49
 
50
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
57
  */
58
  public function render() {
59
  $html = '';
60
+ $class = $this->settings['class'];
61
+ $class .= ' ' . $this->settings['master'];
62
 
63
+ $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
 
 
64
 
65
  $ui_stepper = new UI_Stepper(
66
  array(
79
  }
80
  $html .= '<div class="cherry-slider-wrap">';
81
  $html .= '<div class="cherry-slider-holder">';
82
+ $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'] ) . '">';
83
  $html .= '</div>';
84
  $html .= '<div class="cherry-slider-input">';
85
  $html .= $ui_stepper_html;
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-stepper/ui-stepper.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -45,7 +45,7 @@ if ( ! class_exists( 'UI_Stepper' ) ) {
45
  * @since 4.0.0
46
  */
47
  function __construct( $args = array() ) {
48
- $this->defaults_settings['id'] = 'cherry-ui-stepper-'.uniqid();
49
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
50
 
51
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
@@ -59,15 +59,15 @@ if ( ! class_exists( 'UI_Stepper' ) ) {
59
  */
60
  public function render() {
61
  $html = '';
 
 
62
 
63
- $master_class = ! empty( $this->settings['master'] ) && isset( $this->settings['master'] ) ? esc_html( $this->settings['master'] ) : '';
64
-
65
- $html .= '<div class="cherry-ui-container ' . $master_class . '">';
66
 
67
  if ( '' !== $this->settings['label'] ) {
68
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
69
  }
70
- $html .= '<div class="cherry-ui-stepper ' . esc_attr( $this->settings['class'] ) . '">';
71
  $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'] ) . '">';
72
  $html .= '</div>';
73
  $html .= '</div>';
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
45
  * @since 4.0.0
46
  */
47
  function __construct( $args = array() ) {
48
+ $this->defaults_settings['id'] = 'cherry-ui-stepper-' . uniqid();
49
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
50
 
51
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
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
 
67
  if ( '' !== $this->settings['label'] ) {
68
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
69
  }
70
+ $html .= '<div class="cherry-ui-stepper">';
71
  $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'] ) . '">';
72
  $html .= '</div>';
73
  $html .= '</div>';
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/min/ui-switcher.min.css CHANGED
@@ -1,80 +1 @@
1
- .cherry-ui-container {
2
- margin: 10px 0 20px 0; }
3
-
4
- label.cherry-label {
5
- margin: 0 0 5px 0;
6
- display: block; }
7
-
8
- .cherry-switcher-wrap {
9
- height: 49px;
10
- border-radius: 25px;
11
- display: inline-block;
12
- overflow: hidden;
13
- position: relative;
14
- cursor: pointer;
15
- -webkit-user-select: none;
16
- -moz-user-select: none;
17
- -ms-user-select: none;
18
- user-select: none; }
19
- .cherry-switcher-wrap label {
20
- height: 49px;
21
- background-color: #e54343;
22
- display: block;
23
- float: left;
24
- -webkit-transition: all 0.2s ease-in-out;
25
- transition: all 0.2s ease-in-out; }
26
- .cherry-switcher-wrap label span {
27
- font-size: 12px;
28
- line-height: 19px;
29
- font-weight: 800;
30
- text-transform: uppercase;
31
- color: #fff;
32
- padding: 15px;
33
- text-align: center;
34
- display: block;
35
- opacity: 1;
36
- -webkit-transition: all 0.2s ease-in-out;
37
- transition: all 0.2s ease-in-out; }
38
- .cherry-switcher-wrap .sw-enable span {
39
- opacity: 0; }
40
- .cherry-switcher-wrap .sw-disable span {
41
- opacity: 1; }
42
- .cherry-switcher-wrap .state-marker {
43
- background-color: #fff;
44
- display: block;
45
- position: absolute;
46
- width: 41px;
47
- height: 41px;
48
- margin: 4px;
49
- top: 0;
50
- left: 0;
51
- margin-left: 4px;
52
- border-radius: 25px;
53
- -webkit-transition: all 0.2s ease-in-out;
54
- transition: all 0.2s ease-in-out; }
55
- .cherry-switcher-wrap.selected .sw-enable {
56
- background-color: #48c569; }
57
- .cherry-switcher-wrap.selected .sw-enable span {
58
- opacity: 1; }
59
- .cherry-switcher-wrap.selected .sw-disable {
60
- background-color: #48c569; }
61
- .cherry-switcher-wrap.selected .sw-disable span {
62
- opacity: 0; }
63
- .cherry-switcher-wrap.selected .state-marker {
64
- left: 100%;
65
- margin-left: -45px; }
66
- .cherry-switcher-wrap.size-small {
67
- height: 25px; }
68
- .cherry-switcher-wrap.size-small label {
69
- height: 25px; }
70
- .cherry-switcher-wrap.size-small label span {
71
- font-size: 10px;
72
- line-height: 15px;
73
- padding: 5px; }
74
- .cherry-switcher-wrap.size-small .state-marker {
75
- width: 17px;
76
- height: 17px;
77
- margin-left: 4px; }
78
- .cherry-switcher-wrap.size-small.selected .state-marker {
79
- left: 0;
80
- margin-left: 33px; }
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:49px;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}.cherry-switcher-wrap label{height:49px;background-color:#e54343;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:19px;font-weight:800;text-transform:uppercase;color:#fff;padding:15px;text-align:center;display:block;opacity:1;-webkit-transition:all 0.4s ease;transition:all 0.4s ease}.cherry-switcher-wrap .sw-enable span{opacity:0}.cherry-switcher-wrap .sw-disable span{opacity:1}.cherry-switcher-wrap .state-marker{background-color:#fff;display:block;position:absolute;width:41px;height:41px;margin:4px;top:0;left:0;margin-left:4px;border-radius:25px;-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-switcher-wrap .cherry-input-switcher{display:none}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .sw-enable{background-color:#48c569}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .sw-enable span{opacity:1}.cherry-switcher-wrap .cherry-input-switcher-true:checked ~ .sw-disable{background-color:#48c569}.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}.cherry-switcher-wrap.size-small{height:25px}.cherry-switcher-wrap.size-small label{height:25px}.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/min/ui-switcher.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"use strict";t.utilites.namespace("ui_elements.switcher"),t.ui_elements.switcher={init:function(){e(document).on("ready",this.render.bind(this)),e(window).on("cherry-ui-elements-init",this.master_slave_init)},render:function(){e("body").on("click",".cherry-switcher-wrap",this.swiperHandler)},master_slave_init:function(t){var i=t._target?t._target:e("body");e(".cherry-switcher-wrap",i).each(function(){var t=e(this),r=e(".cherry-input-switcher",t),a="true"===r.val(),n="undefined"!=typeof r.data("true-slave")?r.data("true-slave"):null,s="undefined"!=typeof r.data("false-slave")?r.data("false-slave"):null;a?e("."+s,i)[0]&&e("."+s,i).hide():e("."+n,i)[0]&&e("."+n,i).hide()})},swiperHandler:function(){var t=e(this),i=e(".cherry-input-switcher",t),r=i.data("true-slave"),a=i.data("false-slave");t.toggleClass("selected"),i.attr("value","true"===i.val()?!1:!0).trigger("change").trigger("switcher_disabled_event",[r,a]),e("."+r).toggle(),e("."+a).toggle()}},t.ui_elements.switcher.init()}(jQuery,window.CherryJsCore);
1
+ !function(t,e){"use strict";e.utilites.namespace("ui_elements.switcher"),e.ui_elements.switcher={switcherClass:".cherry-switcher-wrap",inputTrueClass:".cherry-input-switcher-true",inputFalseClass:".cherry-input-switcher-false",containerClass:".cherry-ui-container",wrapperClass:".widget, .postbox, .cherry-form",init:function(){t(document).on("ready.cherry-ui-elements-init",this.addEvent.bind(this)).on("cherry-ui-elements-init",this.initState.bind(this))},addEvent:function(){t("body").on("click",this.switcherClass,this.switchState.bind(this)),this.initState()},initState:function(){for(var e,i=t(this.switcherClass),s=i.length-1;s>=0;s--)e=t(i[s]),this.switchState({currentTarget:e,initState:!0})},switchState:function(e){var i,s=t(e.currentTarget),r=t(this.inputTrueClass,s),a=t(this.inputFalseClass,s),n=r.data(),c=a.data(),h=s.closest(this.wrapperClass);e.initState||this.checkedRadio(r,a,r[0].checked),i=r[0].checked,jQuery.isEmptyObject(n)||t("."+n.slave,h)[i?"removeClass":"addClass"]("hide"),jQuery.isEmptyObject(c)||t("."+c.slave,h)[i?"addClass":"removeClass"]("hide")},checkedRadio:function(t,e,i){t.attr("checked",i?!1:!0),e.attr("checked",i?!0:!1).trigger("change")}},e.ui_elements.switcher.init()}(jQuery,window.CherryJsCore);
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-switcher.js CHANGED
@@ -6,50 +6,60 @@
6
 
7
  CherryJsCore.utilites.namespace('ui_elements.switcher');
8
  CherryJsCore.ui_elements.switcher = {
 
 
 
 
 
 
9
  init: function () {
10
- $( document ).on( 'ready', this.render.bind( this ) );
11
- $( window ).on( 'cherry-ui-elements-init', this.master_slave_init );
 
12
  },
13
- render: function ( event, data ) {
14
- $( 'body' ).on( 'click', '.cherry-switcher-wrap', this.swiperHandler );
 
15
  },
16
- master_slave_init: function ( event, data ) {
17
- var target = ( event._target ) ? event._target : $( 'body' );
18
-
19
- $( '.cherry-switcher-wrap', target ).each( function() {
20
- var $this = $( this ),
21
- $input = $( '.cherry-input-switcher', $this ),
22
- inputValue = ( $input.val() === 'true' ),
23
- true_slave = ( typeof $input.data('true-slave') !== 'undefined' ) ? $input.data( 'true-slave' ) : null,
24
- false_slave = ( typeof $input.data('false-slave') !== 'undefined' ) ? $input.data( 'false-slave' ) : null;
25
-
26
- if ( ! inputValue ) {
27
- if ( $( '.' + true_slave, target )[0] ) {
28
- $( '.' + true_slave, target ).hide();
29
- }
30
- } else {
31
- if ( $( '.' + false_slave, target )[0] ) {
32
- $( '.' + false_slave, target ).hide();
33
- }
34
- }
35
- });
36
  },
37
- swiperHandler: function ( event ) {
38
- var $this = $( this ),
39
- $input = $( '.cherry-input-switcher', $this ),
40
- true_slave = $input.data('true-slave'),
41
- false_slave = $input.data('false-slave');
 
 
 
42
 
43
- $this.toggleClass('selected');
 
 
44
 
45
- $input
46
- .attr( 'value', ( $input.val() === 'true' ) ? false : true )
47
- .trigger( 'change' )
48
- .trigger( 'switcher_disabled_event', [ true_slave, false_slave ] );
49
 
 
 
 
 
 
 
 
 
 
50
 
51
- $( '.' + true_slave ).toggle();
52
- $( '.' + false_slave ).toggle();
 
53
  }
54
  };
55
 
6
 
7
  CherryJsCore.utilites.namespace('ui_elements.switcher');
8
  CherryJsCore.ui_elements.switcher = {
9
+ switcherClass: '.cherry-switcher-wrap',
10
+ inputTrueClass: '.cherry-input-switcher-true',
11
+ inputFalseClass: '.cherry-input-switcher-false',
12
+ containerClass: '.cherry-ui-container',
13
+ wrapperClass: '.widget, .postbox, .cherry-form',
14
+
15
  init: function () {
16
+ $( document )
17
+ .on( 'ready.cherry-ui-elements-init', this.addEvent.bind( this ) )
18
+ .on( 'cherry-ui-elements-init', this.initState.bind( this ) );
19
  },
20
+ addEvent: function () {
21
+ $( 'body' ).on( 'click', this.switcherClass, this.switchState.bind( this ) );
22
+ this.initState();
23
  },
24
+ initState: function(){
25
+ var switchers = $( this.switcherClass ),
26
+ i = switchers.length - 1,
27
+ switcher;
28
+
29
+ for (; i >= 0; i--) {
30
+ switcher = $( switchers[ i ] );
31
+
32
+ this.switchState( { currentTarget: switcher, initState: true } );
33
+ }
 
 
 
 
 
 
 
 
 
 
34
  },
35
+ switchState: function ( event ) {
36
+ var switcher = $( event.currentTarget ),
37
+ inputTrue = $( this.inputTrueClass, switcher ),
38
+ inputFalse = $( this.inputFalseClass, switcher ),
39
+ dataTrue = inputTrue.data(),
40
+ dataFalse = inputFalse.data(),
41
+ flag,
42
+ wrapper = switcher.closest( this.wrapperClass );
43
 
44
+ if( ! event.initState ){
45
+ this.checkedRadio( inputTrue, inputFalse, inputTrue[ 0 ].checked );
46
+ }
47
 
48
+ flag = inputTrue[ 0 ].checked;
 
 
 
49
 
50
+ if ( ! jQuery.isEmptyObject( dataTrue ) ) {
51
+ $( '.' + dataTrue.slave, wrapper )[ ( flag ) ? 'removeClass' : 'addClass' ]( 'hide' );
52
+ }
53
+ if ( ! jQuery.isEmptyObject( dataFalse ) ) {
54
+ $( '.' + dataFalse.slave, wrapper )[ ( ! flag ) ? 'removeClass' : 'addClass' ]( 'hide' );
55
+ }
56
+ },
57
+ checkedRadio:function( inputTrue, inputFalse, flag ){
58
+ inputTrue.attr( 'checked', ( flag ) ? false : true );
59
 
60
+ inputFalse
61
+ .attr( 'checked', ( ! flag ) ? false : true )
62
+ .trigger('change');
63
  }
64
  };
65
 
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/assets/ui-switcher.scss CHANGED
@@ -8,6 +8,9 @@ label.cherry-label{
8
  margin: 0 0 5px 0;
9
  display: block;
10
  }
 
 
 
11
  .cherry-switcher-wrap{
12
  height: 49px;
13
  border-radius: 25px;
@@ -21,7 +24,7 @@ label.cherry-label{
21
  background-color: $red_color;
22
  display: block;
23
  float: left;
24
- transition: all 0.2s ease-in-out;
25
  span{
26
  font-size: 12px;
27
  line-height: 19px;
@@ -32,7 +35,7 @@ label.cherry-label{
32
  text-align: center;
33
  display: block;
34
  opacity: 1;
35
- transition: all 0.2s ease-in-out;
36
  }
37
  }
38
  .sw-enable{
@@ -56,46 +59,49 @@ label.cherry-label{
56
  left: 0;
57
  margin-left: 4px;
58
  border-radius: 25px;
59
- transition: all 0.2s ease-in-out;
 
 
 
60
  }
61
- &.selected{
62
- .sw-enable{
63
  background-color: $green_color;
64
  span{
65
  opacity: 1;
66
  }
67
  }
68
- .sw-disable{
69
  background-color: $green_color;
70
  span{
71
  opacity: 0;
72
  }
73
  }
74
- .state-marker{
75
  left: 100%;
76
  margin-left: -45px;
77
  }
78
  }
 
79
  &.size-small{
80
  height: 25px;
81
- label{
82
- height: 25px;
83
- span{
84
- font-size: 10px;
85
- line-height: 15px;
86
- padding: 5px;
87
- }
88
- }
89
- .state-marker{
90
- width: 17px;
91
- height: 17px;
92
- margin-left: 4px;
93
- }
94
- &.selected{
95
- .state-marker{
96
- left: 0;
97
- margin-left: 33px;
98
  }
 
 
 
 
 
 
 
 
 
99
  }
 
100
  }
101
  }
8
  margin: 0 0 5px 0;
9
  display: block;
10
  }
11
+ .hide{
12
+ display: none !important;
13
+ }
14
  .cherry-switcher-wrap{
15
  height: 49px;
16
  border-radius: 25px;
24
  background-color: $red_color;
25
  display: block;
26
  float: left;
27
+ transition: all 0.4s ease;
28
  span{
29
  font-size: 12px;
30
  line-height: 19px;
35
  text-align: center;
36
  display: block;
37
  opacity: 1;
38
+ transition: all 0.4s ease;
39
  }
40
  }
41
  .sw-enable{
59
  left: 0;
60
  margin-left: 4px;
61
  border-radius: 25px;
62
+ transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
63
+ }
64
+ .cherry-input-switcher{
65
+ display: none;
66
  }
67
+ .cherry-input-switcher-true:checked{
68
+ ~ .sw-enable{
69
  background-color: $green_color;
70
  span{
71
  opacity: 1;
72
  }
73
  }
74
+ ~ .sw-disable{
75
  background-color: $green_color;
76
  span{
77
  opacity: 0;
78
  }
79
  }
80
+ ~ .state-marker{
81
  left: 100%;
82
  margin-left: -45px;
83
  }
84
  }
85
+
86
  &.size-small{
87
  height: 25px;
88
+ label{
89
+ height: 25px;
90
+ span{
91
+ font-size: 10px;
92
+ line-height: 15px;
93
+ padding: 5px;
 
 
 
 
 
 
 
 
 
 
 
94
  }
95
+ }
96
+ .state-marker{
97
+ width: 17px;
98
+ height: 17px;
99
+ margin-left: 4px;
100
+ }
101
+ .cherry-input-switcher-true:checked{
102
+ ~ .state-marker{
103
+ margin-left: -22px;
104
  }
105
+ }
106
  }
107
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-switcher/ui-switcher.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -48,7 +48,7 @@ if ( ! class_exists( 'UI_Switcher' ) ) {
48
  * @since 4.0.0
49
  */
50
  function __construct( $args = array() ) {
51
- $this->defaults_settings['id'] = 'cherry-ui-swither-'.uniqid();
52
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
53
 
54
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
@@ -60,25 +60,27 @@ if ( ! class_exists( 'UI_Switcher' ) ) {
60
  * @since 4.0.0
61
  */
62
  public function render() {
63
- $data_attr_line = ( ! empty( $this->settings['toggle']['true_slave'] ) ) ? 'data-true-slave="' . $this->settings['toggle']['true_slave'] . '"' : '';
64
- $data_attr_line .= ( ! empty( $this->settings['toggle']['false_slave'] ) ) ? ' data-false-slave="' . $this->settings['toggle']['false_slave'] . '"' : '';
 
65
 
66
  $html = '';
 
 
67
 
68
- $master_class = ! empty( $this->settings['master'] ) && isset( $this->settings['master'] ) ? esc_html( $this->settings['master'] ) : '';
69
-
70
- $html .= '<div class="cherry-ui-container ' . $master_class . '">';
71
  if ( '' !== $this->settings['label'] ) {
72
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
73
  }
74
 
75
- $selected_class = filter_var( $this->settings['value'], FILTER_VALIDATE_BOOLEAN ) ? 'selected' : '';
76
 
77
- $html .= '<div class="cherry-switcher-wrap size-' . esc_attr( $this->settings['style'] ) . ' ' . esc_attr( $this->settings['class'] ) . ' ' . $selected_class .'">';
 
 
78
  $html .= '<label class="sw-enable"><span>' . esc_html( $this->settings['toggle']['true_toggle'] ) . '</span></label>';
79
  $html .= '<label class="sw-disable"><span>' . esc_html( $this->settings['toggle']['false_toggle'] ) . '</span></label>';
80
  $html .= '<span class="state-marker"></span>';
81
- $html .= '<input id="' . esc_attr( $this->settings['id'] ) . '" type="hidden" class="cherry-input-switcher" name="' . esc_attr( $this->settings['name'] ) . '" ' . checked( 'true', $this->settings['value'], false ) . ' value="' . esc_html( $this->settings['value'] ) . '" ' . $data_attr_line . '>';
82
  $html .= '</div>';
83
  $html .= '</div>';
84
 
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
48
  * @since 4.0.0
49
  */
50
  function __construct( $args = array() ) {
51
+ $this->defaults_settings['id'] = 'cherry-ui-swither-' . uniqid();
52
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
53
 
54
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
60
  * @since 4.0.0
61
  */
62
  public function render() {
63
+ $data_slave_true = ( ! empty( $this->settings['toggle']['true_slave'] ) ) ? 'data-slave="' . $this->settings['toggle']['true_slave'] . '" ' : '';
64
+ $data_slave_false = ( ! empty( $this->settings['toggle']['false_slave'] ) ) ? 'data-slave="' . $this->settings['toggle']['false_slave'] . '" ' : '';
65
+ $master_true = $data_slave_true || $data_slave_false ? 'data-master="true"' : '' ;
66
 
67
  $html = '';
68
+ $class = $this->settings['class'];
69
+ $class .= ' ' . $this->settings['master'];
70
 
71
+ $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
 
 
72
  if ( '' !== $this->settings['label'] ) {
73
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
74
  }
75
 
76
+ $value = filter_var( $this->settings['value'], FILTER_VALIDATE_BOOLEAN );
77
 
78
+ $html .= '<div class="cherry-switcher-wrap size-' . esc_attr( $this->settings['style'] ) . '" ' . $master_true . '>';
79
+ $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 . '>';
80
+ $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 . '>';
81
  $html .= '<label class="sw-enable"><span>' . esc_html( $this->settings['toggle']['true_toggle'] ) . '</span></label>';
82
  $html .= '<label class="sw-disable"><span>' . esc_html( $this->settings['toggle']['false_toggle'] ) . '</span></label>';
83
  $html .= '<span class="state-marker"></span>';
 
84
  $html .= '</div>';
85
  $html .= '</div>';
86
 
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-text/ui-text.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -45,7 +45,7 @@ if ( ! class_exists( 'UI_Text' ) ) {
45
  * @since 4.0.0
46
  */
47
  function __construct( $args = array() ) {
48
- $this->defaults_settings['id'] = 'cherry-ui-input-text-'.uniqid();
49
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
50
 
51
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
@@ -70,12 +70,14 @@ if ( ! class_exists( 'UI_Text' ) ) {
70
  */
71
  public function render() {
72
  $html = '';
 
 
73
 
74
- $html .= '<div class="cherry-ui-container ' . esc_attr( $this->settings['master'] ) . '">';
75
  if ( '' !== $this->settings['label'] ) {
76
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
77
  }
78
- $html .= '<input type="' . esc_attr( $this->settings['type'] ) . '" id="' . esc_attr( $this->settings['id'] ) . '" class="widefat cherry-ui-text ' . esc_attr( $this->settings['class'] ) . '" name="' . esc_attr( $this->settings['name'] ) . '" value="' . esc_html( $this->settings['value'] ) . '" placeholder="' . esc_attr( $this->settings['placeholder'] ) . '" '.$this->get_required().'>';
79
  $html .= '</div>';
80
  return $html;
81
  }
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
45
  * @since 4.0.0
46
  */
47
  function __construct( $args = array() ) {
48
+ $this->defaults_settings['id'] = 'cherry-ui-input-text-' . uniqid();
49
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
50
 
51
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
70
  */
71
  public function render() {
72
  $html = '';
73
+ $class = $this->settings['class'];
74
+ $class .= ' ' . $this->settings['master'];
75
 
76
+ $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
77
  if ( '' !== $this->settings['label'] ) {
78
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . esc_html( $this->settings['label'] ) . '</label> ';
79
  }
80
+ $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() . '>';
81
  $html .= '</div>';
82
  return $html;
83
  }
cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-textarea/ui-textarea.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -44,7 +44,7 @@ if ( ! class_exists( 'UI_Textarea' ) ) {
44
  * @since 4.0.0
45
  */
46
  function __construct( $args = array() ) {
47
- $this->defaults_settings['id'] = 'cherry-ui-textarea-'.uniqid();
48
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
49
 
50
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
@@ -57,14 +57,14 @@ if ( ! class_exists( 'UI_Textarea' ) ) {
57
  */
58
  public function render() {
59
  $html = '';
 
 
60
 
61
- $master_class = ! empty( $this->settings['master'] ) && isset( $this->settings['master'] ) ? esc_html( $this->settings['master'] ) : '';
62
-
63
- $html .= '<div class="cherry-ui-container ' . $master_class . '">';
64
  if ( '' !== $this->settings['label'] ) {
65
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . $this->settings['label'] . '</label> ';
66
  }
67
- $html .= '<textarea id="' . esc_attr( $this->settings['id'] ) . '" class="cherry-ui-textarea ' . esc_attr( $this->settings['class'] ) . '" 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>';
68
  $html .= '</div>';
69
 
70
  return $html;
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
44
  * @since 4.0.0
45
  */
46
  function __construct( $args = array() ) {
47
+ $this->defaults_settings['id'] = 'cherry-ui-textarea-' . uniqid();
48
  $this->settings = wp_parse_args( $args, $this->defaults_settings );
49
 
50
  add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ) );
57
  */
58
  public function render() {
59
  $html = '';
60
+ $class = $this->settings['class'];
61
+ $class .= ' ' . $this->settings['master'];
62
 
63
+ $html .= '<div class="cherry-ui-container ' . esc_attr( $class ) . '">';
 
 
64
  if ( '' !== $this->settings['label'] ) {
65
  $html .= '<label class="cherry-label" for="' . esc_attr( $this->settings['id'] ) . '">' . $this->settings['label'] . '</label> ';
66
  }
67
+ $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>';
68
  $html .= '</div>';
69
 
70
  return $html;
cherry-framework/modules/cherry-ui-elements/ui-element.php CHANGED
@@ -7,7 +7,7 @@
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
  */
12
 
13
  /**
@@ -87,7 +87,7 @@ if ( ! class_exists( 'UI_Element' ) ) {
87
  if ( '' !== $name ) {
88
  $this->settings['name'] = $name;
89
  } else {
90
- throw new Exception( "Invalid control name '".$name."'. Name can't be empty." );
91
  }
92
  }
93
  }
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-3.0.html
11
  */
12
 
13
  /**
87
  if ( '' !== $name ) {
88
  $this->settings['name'] = $name;
89
  } else {
90
+ throw new Exception( "Invalid control name '" . $name . "'. Name can't be empty." );
91
  }
92
  }
93
  }
cherry-framework/modules/cherry-utility/cherry-utility.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Module Name: Utility
4
  * Description: Multiple utility functions
5
- * Version: 1.1.0
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,7 +10,7 @@
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/
@@ -79,6 +79,7 @@ if ( ! class_exists( 'Cherry_Utility' ) ) {
79
  * Require utility.
80
  *
81
  * @since 1.0.0
 
82
  * @return void
83
  */
84
  public function utility_require() {
@@ -91,7 +92,7 @@ if ( ! class_exists( 'Cherry_Utility' ) ) {
91
 
92
  foreach ( $utility as $utilit ) {
93
 
94
- require_once( __DIR__ . '/inc/cherry-' . $utilit . '-utilit.php' );
95
 
96
  $utilit = str_replace( '-', ' ', $utilit );
97
  $class_name = ucwords( $utilit );
2
  /**
3
  * Module Name: Utility
4
  * Description: Multiple utility functions
5
+ * Version: 1.1.4
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
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/
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
 
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 );
cherry-framework/modules/cherry-utility/inc/cherry-attributes-utilit.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -39,14 +39,14 @@ if ( ! class_exists( 'Cherry_Attributes_Utilit' ) ) {
39
  }
40
 
41
  $default_args = array(
42
- 'visible' => true,
43
- 'length' => 9999,
44
- 'trimmed_type' => 'word',
45
- 'ending' => '&hellip;',
46
- 'html' => '<h3 %1$s><a href="%2$s" %3$s rel="bookmark">%4$s</a></h3>',
47
- 'class' => '',
48
- 'title' => '',
49
- 'echo' => false,
50
  );
51
  $args = wp_parse_args( $args, $default_args );
52
  $html = '' ;
@@ -54,9 +54,7 @@ if ( ! class_exists( 'Cherry_Attributes_Utilit' ) ) {
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
-
58
  $title_cut = $this->cut_text( $title_cut, $args['length'], $args['trimmed_type'], $args['ending'] );
59
-
60
  $link = ( 'post' === $type ) ? $this->get_post_permalink() : $this->get_term_permalink( $object->term_id );
61
  $html_class = ( $args['class'] ) ? 'class="' . $args['class'] . '"' : '' ;
62
 
@@ -83,14 +81,14 @@ if ( ! class_exists( 'Cherry_Attributes_Utilit' ) ) {
83
  }
84
 
85
  $default_args = array(
86
- 'visible' => true,
87
- 'content_type' => 'post_content',
88
- 'length' => 0,
89
- 'trimmed_type' => 'word',
90
- 'ending' => '&hellip;',
91
- 'html' => '<p %1$s>%2$s</p>',
92
- 'class' => '',
93
- 'echo' => false,
94
  );
95
  $args = wp_parse_args( $args, $default_args );
96
  $html = '' ;
@@ -98,13 +96,13 @@ if ( ! class_exists( 'Cherry_Attributes_Utilit' ) ) {
98
  if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
99
  if ( 'term' === $type ) {
100
  $text = $object->description;
101
- } elseif ( 'post_content' === $args['content_type'] || 'post_excerpt' === $args['content_type'] && ! $object->$args['content_type'] ) {
102
  $text = get_the_content();
103
  } else {
104
  $text = get_the_excerpt();
105
  }
106
 
107
- $text = $this->cut_text( $text, $args['length'], $args['trimmed_type'], $args['ending'] );
108
 
109
  if ( $text ) {
110
  $html_class = ( $args['class'] ) ? 'class="' . $args['class'] . '"' : '' ;
@@ -135,13 +133,13 @@ if ( ! class_exists( 'Cherry_Attributes_Utilit' ) ) {
135
  }
136
 
137
  $default_args = array(
138
- 'visible' => true,
139
- 'text' => '',
140
- 'icon' => '',
141
- 'html' => '<a href="%1$s" %2$s %3$s><span class="btn__text">%4$s</span>%5$s</a>',
142
- 'class' => 'btn',
143
- 'title' => '',
144
- 'echo' => false,
145
  );
146
  $args = wp_parse_args( $args, $default_args );
147
  $html = '' ;
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
39
  }
40
 
41
  $default_args = array(
42
+ 'visible' => true,
43
+ 'length' => -1,
44
+ 'trimmed_type' => 'word',
45
+ 'ending' => '&hellip;',
46
+ 'html' => '<h3 %1$s><a href="%2$s" %3$s rel="bookmark">%4$s</a></h3>',
47
+ 'class' => '',
48
+ 'title' => '',
49
+ 'echo' => false,
50
  );
51
  $args = wp_parse_args( $args, $default_args );
52
  $html = '' ;
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
 
81
  }
82
 
83
  $default_args = array(
84
+ 'visible' => true,
85
+ 'content_type' => 'post_content',
86
+ 'length' => -1,
87
+ 'trimmed_type' => 'word',
88
+ 'ending' => '&hellip;',
89
+ 'html' => '<p %1$s>%2$s</p>',
90
+ 'class' => '',
91
+ 'echo' => false,
92
  );
93
  $args = wp_parse_args( $args, $default_args );
94
  $html = '' ;
96
  if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
97
  if ( 'term' === $type ) {
98
  $text = $object->description;
99
+ } elseif ( 'post_content' === $args['content_type'] || 'post_excerpt' === $args['content_type'] && empty( $object->$args['content_type'] ) ) {
100
  $text = get_the_content();
101
  } else {
102
  $text = get_the_excerpt();
103
  }
104
 
105
+ $text = $this->cut_text( $text, $args['length'], $args['trimmed_type'], $args['ending'], true );
106
 
107
  if ( $text ) {
108
  $html_class = ( $args['class'] ) ? 'class="' . $args['class'] . '"' : '' ;
133
  }
134
 
135
  $default_args = array(
136
+ 'visible' => true,
137
+ 'text' => '',
138
+ 'icon' => '',
139
+ 'html' => '<a href="%1$s" %2$s %3$s><span class="btn__text">%4$s</span>%5$s</a>',
140
+ 'class' => 'btn',
141
+ 'title' => '',
142
+ 'echo' => false,
143
  );
144
  $args = wp_parse_args( $args, $default_args );
145
  $html = '' ;
cherry-framework/modules/cherry-utility/inc/cherry-media-utilit.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -102,11 +102,17 @@ if ( ! class_exists( 'Cherry_Media_Utilit' ) ) {
102
  $width = ( 4000 < intval( $attr['width'] ) ) ? 4000 : intval( $attr['width'] );
103
  $height = ( 4000 < intval( $attr['height'] ) ) ? 4000 : intval( $attr['height'] );
104
 
105
- $src = 'http://fakeimg.pl/' . $width . 'x' . $height . '/'. $attr['background'] .'/'. $attr['foreground'] . '/?text=' . $attr['title'] . '';
 
 
 
 
 
 
106
  }
107
 
108
  $class = ( $args['class'] ) ? 'class="' . $args['class'] . '"' : '' ;
109
- $html_tag_suze = ( filter_var( $args['html_tag_suze'], FILTER_VALIDATE_BOOLEAN ) ) ? 'width="' . $size_array['width'] . '" height="' . $size_array['height'] . '"' : '' ;
110
 
111
  if ( isset( $src ) ) {
112
  $html = sprintf( $args['html'], $link, $class, $src, $alt, $html_tag_suze );
@@ -116,6 +122,39 @@ if ( ! class_exists( 'Cherry_Media_Utilit' ) ) {
116
  return $this->output_method( $html, $args['echo'] );
117
  }
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
  /**
121
  * Get post embed
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
102
  $width = ( 4000 < intval( $attr['width'] ) ) ? 4000 : intval( $attr['width'] );
103
  $height = ( 4000 < intval( $attr['height'] ) ) ? 4000 : intval( $attr['height'] );
104
 
105
+ $src = $this->get_placeholder_url( array(
106
+ 'width' => $width,
107
+ 'height' => $height,
108
+ 'background' => $attr['background'],
109
+ 'foreground' => $attr['foreground'],
110
+ 'title' => $attr['title'],
111
+ ) );
112
  }
113
 
114
  $class = ( $args['class'] ) ? 'class="' . $args['class'] . '"' : '' ;
115
+ $html_tag_suze = ( filter_var( $args['html_tag_suze'], FILTER_VALIDATE_BOOLEAN ) ) ? 'width="' . $size_array['width'] . '" height="' . $size_array['height'] . '"' : '' ;
116
 
117
  if ( isset( $src ) ) {
118
  $html = sprintf( $args['html'], $link, $class, $src, $alt, $html_tag_suze );
122
  return $this->output_method( $html, $args['echo'] );
123
  }
124
 
125
+ /**
126
+ * Get placeholder image URL
127
+ *
128
+ * @param array $args Image argumnets.
129
+ * @return string
130
+ */
131
+ public function get_placeholder_url( $args = array() ) {
132
+
133
+ $args = wp_parse_args( $args, array(
134
+ 'width' => 300,
135
+ 'height' => 300,
136
+ 'background' => '000',
137
+ 'foreground' => 'fff',
138
+ 'title' => '',
139
+ ) );
140
+
141
+ $args = array_map( 'urlencode', $args );
142
+ $base_url = 'http://fakeimg.pl';
143
+ $format = '%1$s/%2$sx%3$s/%4$s/%5$s/?text=%6$s';
144
+ $image_url = sprintf(
145
+ $format,
146
+ $base_url, $args['width'], $args['height'], $args['background'], $args['foreground'], $args['title']
147
+ );
148
+
149
+ /**
150
+ * Filter image placeholder URL
151
+ *
152
+ * @param string $image_url Default URL.
153
+ * @param string $args Image arguments.
154
+ */
155
+ return apply_filters( 'cherry_utility_placeholder_image_url', esc_url( $image_url ), $args );
156
+ }
157
+
158
 
159
  /**
160
  * Get post embed
cherry-framework/modules/cherry-utility/inc/cherry-meta-data-utilit.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -117,20 +117,24 @@ if ( ! class_exists( 'Cherry_Meta_Data_Utilit' ) ) {
117
  'visible' => true,
118
  'icon' => '',
119
  'prefix' => '',
120
- 'sufix' => '%s',
121
  'html' => '%1$s<a href="%2$s" %3$s %4$s>%5$s%6$s</a>',
122
  'title' => '',
123
  'class' => 'post-comments-count',
124
  'echo' => false,
125
  );
 
126
  $args = wp_parse_args( $args, $default_args );
 
 
 
127
  $html = $count = '' ;
128
 
129
  if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
130
  $post_type = get_post_type( $object->ID );
131
  if ( post_type_supports( $post_type, 'comments' ) ) {
132
- $sufix = is_string( $args['sufix'] ) ? $args['sufix'] : translate_nooped_plural( $args['sufix'], $object->comment_count, $args['sufix']['domain'] );
133
- $count = sprintf( $sufix, $object->comment_count );
134
  }
135
 
136
  $html_class = ( $args['class'] ) ? 'class="' . $args['class'] . '"' : '';
@@ -204,13 +208,15 @@ if ( ! class_exists( 'Cherry_Meta_Data_Utilit' ) ) {
204
  'visible' => true,
205
  'icon' => '',
206
  'prefix' => '',
207
- 'sufix' => '%s',
208
  'html' => '%1$s<a href="%2$s" %3$s %4$s rel="bookmark">%5$s%6$s</a>',
209
  'title' => '',
210
  'class' => 'post-count',
211
  'echo' => false,
212
  );
213
  $args = wp_parse_args( $args, $default_args );
 
 
214
  $html = '' ;
215
 
216
  if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
@@ -219,8 +225,8 @@ if ( ! class_exists( 'Cherry_Meta_Data_Utilit' ) ) {
219
  $title = ( $args['title'] ) ? 'title="' . $args['title'] . '"' : 'title="' . $name . '"' ;
220
  $link = get_term_link( $object->term_id , $object->taxonomy );
221
 
222
- $sufix = is_string( $args['sufix'] ) ? $args['sufix'] : translate_nooped_plural( $args['sufix'], $object->count, $args['sufix']['domain'] );
223
- $count = sprintf( $sufix, $object->count );
224
 
225
  $html = sprintf( $args['html'], $args['prefix'], $link, $title, $html_class, $args['icon'], $count );
226
  }
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
117
  'visible' => true,
118
  'icon' => '',
119
  'prefix' => '',
120
+ 'suffix' => '%s',
121
  'html' => '%1$s<a href="%2$s" %3$s %4$s>%5$s%6$s</a>',
122
  'title' => '',
123
  'class' => 'post-comments-count',
124
  'echo' => false,
125
  );
126
+
127
  $args = wp_parse_args( $args, $default_args );
128
+
129
+ $args['suffix'] = ( isset( $args['sufix'] ) ) ? $args['sufix'] : $args['suffix'];
130
+
131
  $html = $count = '' ;
132
 
133
  if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
134
  $post_type = get_post_type( $object->ID );
135
  if ( post_type_supports( $post_type, 'comments' ) ) {
136
+ $suffix = is_string( $args['suffix'] ) ? $args['suffix'] : translate_nooped_plural( $args['suffix'], $object->comment_count, $args['suffix']['domain'] );
137
+ $count = sprintf( $suffix, $object->comment_count );
138
  }
139
 
140
  $html_class = ( $args['class'] ) ? 'class="' . $args['class'] . '"' : '';
208
  'visible' => true,
209
  'icon' => '',
210
  'prefix' => '',
211
+ 'suffix' => '%s',
212
  'html' => '%1$s<a href="%2$s" %3$s %4$s rel="bookmark">%5$s%6$s</a>',
213
  'title' => '',
214
  'class' => 'post-count',
215
  'echo' => false,
216
  );
217
  $args = wp_parse_args( $args, $default_args );
218
+ $args['suffix'] = ( isset( $args['sufix'] ) ) ? $args['sufix'] : $args['suffix'];
219
+
220
  $html = '' ;
221
 
222
  if ( filter_var( $args['visible'], FILTER_VALIDATE_BOOLEAN ) ) {
225
  $title = ( $args['title'] ) ? 'title="' . $args['title'] . '"' : 'title="' . $name . '"' ;
226
  $link = get_term_link( $object->term_id , $object->taxonomy );
227
 
228
+ $suffix = is_string( $args['suffix'] ) ? $args['suffix'] : translate_nooped_plural( $args['suffix'], $object->count, $args['suffix']['domain'] );
229
+ $count = sprintf( $suffix, $object->count );
230
 
231
  $html = sprintf( $args['html'], $args['prefix'], $link, $title, $html_class, $args['icon'], $count );
232
  }
cherry-framework/modules/cherry-utility/inc/cherry-satellite-utilit.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
@@ -87,13 +87,15 @@ if ( ! class_exists( 'Cherry_Satellite_Utilit' ) ) {
87
  * @since 1.0.0
88
  * @return string
89
  */
90
- public function cut_text( $text = '', $length = 0, $trimmed_type = 'word', $after ) {
91
- $length = (int) $length;
92
 
93
- if ( $length ) {
94
- $text = strip_shortcodes( $text );
95
- $text = apply_filters( 'the_content', $text );
96
- $text = str_replace( ']]>', ']]&gt;', $text );
 
 
 
97
 
98
  if ( 'word' === $trimmed_type ) {
99
  $text = wp_trim_words( $text, $length, $after );
7
  * @author Cherry Team <support@cherryframework.com>
8
  * @copyright Copyright (c) 2012 - 2015, Cherry Team
9
  * @link http://www.cherryframework.com/
10
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
87
  * @since 1.0.0
88
  * @return string
89
  */
90
+ public function cut_text( $text = '', $length = -1, $trimmed_type = 'word', $after, $content = false ) {
 
91
 
92
+ if ( -1 !== $length ) {
93
+
94
+ if ( $content ) {
95
+ $text = strip_shortcodes( $text );
96
+ $text = apply_filters( 'the_content', $text );
97
+ $text = str_replace( ']]>', ']]&gt;', $text );
98
+ }
99
 
100
  if ( 'word' === $trimmed_type ) {
101
  $text = wp_trim_words( $text, $length, $after );
cherry-framework/modules/cherry-widget-factory/cherry-widget-factory.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Module Name: Widget Factory
4
  * Description: Base widget class that simplifies creating of your own widgets.
5
- * Version: 1.1.1
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
@@ -10,7 +10,7 @@
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
13
- * @version 1.1.1
14
  * @author Cherry Team <cherryframework@gmail.com>
15
  * @copyright Copyright (c) 2012 - 2016, Cherry Team
16
  * @link http://www.cherryframework.com/
@@ -92,10 +92,11 @@ if ( ! class_exists( 'Cherry_Widget_Factory' ) ) {
92
  * Include abstract widget class
93
  *
94
  * @since 1.0.0
 
95
  * @return void
96
  */
97
  public function include_abstract_widget() {
98
- require_once( __DIR__ . '/inc/class-cherry-abstract-widget.php' );
99
  }
100
 
101
  /**
2
  /**
3
  * Module Name: Widget Factory
4
  * Description: Base widget class that simplifies creating of your own widgets.
5
+ * Version: 1.2.0
6
  * Author: Cherry Team
7
  * Author URI: http://www.cherryframework.com/
8
  * License: GPLv3
10
  *
11
  * @package Cherry_Framework
12
  * @subpackage Modules
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/
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
  /**
cherry-framework/modules/cherry-widget-factory/inc/class-cherry-abstract-widget.php CHANGED
@@ -7,7 +7,7 @@
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
  */
12
 
13
  // If this file is called directly, abort.
@@ -210,6 +210,10 @@ if ( ! class_exists( 'Cherry_Abstract_Widget' ) ) {
210
 
211
  array_walk( $this->settings, array( $this, 'set_field_types' ) );
212
 
 
 
 
 
213
  $core = $this->get_core();
214
 
215
  if ( ! $core ) {
@@ -541,6 +545,7 @@ if ( ! class_exists( 'Cherry_Abstract_Widget' ) ) {
541
  'title_field' => Cherry_Toolkit::get_arg( $setting, 'title_field' ),
542
  'add_label' => Cherry_Toolkit::get_arg( $setting, 'add_label', '' ),
543
  'fields' => Cherry_Toolkit::get_arg( $setting, 'fields', array() ),
 
544
  );
545
 
546
  $this->render_control( $args );
@@ -602,6 +607,25 @@ if ( ! class_exists( 'Cherry_Abstract_Widget' ) ) {
602
  do_action( 'cherry_widget_reset_data' );
603
  }
604
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
605
  /**
606
  * Retrieve a string translation via WPML.
607
  *
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-3.0.html
11
  */
12
 
13
  // If this file is called directly, abort.
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 ) {
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 );
607
  do_action( 'cherry_widget_reset_data' );
608
  }
609
 
610
+ /**
611
+ * Add widget_id-related CSS selector
612
+ *
613
+ * @since 1.2.0
614
+ * @param string $selector Selector inside widget.
615
+ * @param array $args widget arguments (optional, pass it only setup_widget_data not called before).
616
+ * @return string|bool
617
+ */
618
+ public function add_selector( $selector = null, $args = array() ) {
619
+
620
+ if ( null == $this->args && empty( $args ) ) {
621
+ return false;
622
+ }
623
+
624
+ $args = null !== $this->args ? $this->args : $args;
625
+
626
+ return sprintf( '#%1$s %2$s', $args['widget_id'], $selector );
627
+ }
628
+
629
  /**
630
  * Retrieve a string translation via WPML.
631
  *
cherry-framework/setup.php CHANGED
@@ -14,7 +14,7 @@
14
  return create_function( '', '
15
  global $chery_core_version;
16
 
17
- $path = trailingslashit( __DIR__ ) . \'cherry-core.php\';
18
 
19
  $data = get_file_data( $path, array(
20
  \'version\' => \'Version\'
14
  return create_function( '', '
15
  global $chery_core_version;
16
 
17
+ $path = trailingslashit( dirname( __FILE__ ) ) . \'cherry-core.php\';
18
 
19
  $data = get_file_data( $path, array(
20
  \'version\' => \'Version\'
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.0.0
7
  * Author: Cherry Team
8
  * Author URI: http://www.cherryframework.com/
9
  * Text Domain: cherry-projects
@@ -18,7 +18,7 @@ if ( !defined( 'WPINC' ) ) {
18
  }
19
 
20
  // If class 'Cherry_Projects' not exists.
21
- if ( !class_exists( 'Cherry_Projects' ) ) {
22
 
23
  /**
24
  * Sets up and initializes the Cherry Projects plugin.
@@ -269,6 +269,9 @@ if ( !class_exists( 'Cherry_Projects' ) ) {
269
  'cherry-post-meta' => array(
270
  'autoload' => false,
271
  ),
 
 
 
272
  ),
273
  ) );
274
 
@@ -497,4 +500,4 @@ if ( !class_exists( 'Cherry_Projects' ) ) {
497
 
498
  cherry_projects();
499
 
500
- }
3
  * Plugin Name: Cherry Projects
4
  * Plugin URI: http://www.cherryframework.com/
5
  * Description: A projects plugin for WordPress.
6
+ * Version: 1.1.0
7
  * Author: Cherry Team
8
  * Author URI: http://www.cherryframework.com/
9
  * Text Domain: cherry-projects
18
  }
19
 
20
  // If class 'Cherry_Projects' not exists.
21
+ if ( ! class_exists( 'Cherry_Projects' ) ) {
22
 
23
  /**
24
  * Sets up and initializes the Cherry Projects plugin.
269
  'cherry-post-meta' => array(
270
  'autoload' => false,
271
  ),
272
+ 'cherry-interface-builder' => array(
273
+ 'autoload' => false,
274
+ ),
275
  ),
276
  ) );
277
 
500
 
501
  cherry_projects();
502
 
503
+ }
public/assets/css/styles.css CHANGED
@@ -625,6 +625,27 @@ ul.order-filters {
625
  -ms-flex: 0 1 auto;
626
  flex: 0 1 auto;
627
  min-width: 70%; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
628
  .projects-terms-container .term-permalink span:before {
629
  content: "\f103"; }
630
 
625
  -ms-flex: 0 1 auto;
626
  flex: 0 1 auto;
627
  min-width: 70%; }
628
+ .projects-terms-container.cascading-grid-layout .projects-terms-list {
629
+ display: -webkit-box;
630
+ display: -webkit-flex;
631
+ display: -ms-flexbox;
632
+ display: flex;
633
+ -webkit-flex-flow: row wrap;
634
+ -ms-flex-flow: row wrap;
635
+ flex-flow: row wrap;
636
+ -webkit-box-align: stretch;
637
+ -webkit-align-items: stretch;
638
+ -ms-flex-align: stretch;
639
+ align-items: stretch;
640
+ -webkit-align-content: stretch;
641
+ -ms-flex-line-pack: stretch;
642
+ align-content: stretch; }
643
+ .projects-terms-container.cascading-grid-layout .projects-terms-list .projects-terms-item {
644
+ -webkit-box-flex: 0;
645
+ -webkit-flex: 0 1 auto;
646
+ -ms-flex: 0 1 auto;
647
+ flex: 0 1 auto;
648
+ height: auto; }
649
  .projects-terms-container .term-permalink span:before {
650
  content: "\f103"; }
651
 
public/assets/js/cherry-projects-plugin.js CHANGED
@@ -271,6 +271,9 @@
271
  case 'cascading-grid-layout':
272
  cascadingGridLayoutRender();
273
  break;
 
 
 
274
  }
275
 
276
  $projectsContainer.imagesLoaded( function() {
@@ -339,6 +342,9 @@
339
  case 'cascading-grid-layout':
340
  cascadingGridLayoutRender();
341
  break;
 
 
 
342
  }
343
 
344
  $projectsContainer.imagesLoaded( function() {
@@ -455,14 +461,27 @@
455
  'margin-left': -margin + 'px',
456
  'margin-right': -margin + 'px',
457
  } );
 
 
458
 
 
 
 
 
 
 
459
 
 
 
460
  } );
461
  }
462
 
 
 
 
463
  function getCascadingIndex( index ) {
464
  var index = index || 0,
465
- map = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4 ],
466
  counter = 0,
467
  mapIndex = 0;
468
 
@@ -578,4 +597,4 @@
578
  }
579
  }//end plugin
580
 
581
- })(jQuery)
271
  case 'cascading-grid-layout':
272
  cascadingGridLayoutRender();
273
  break;
274
+ case 'list-layout':
275
+ listLayoutRender();
276
+ break;
277
  }
278
 
279
  $projectsContainer.imagesLoaded( function() {
342
  case 'cascading-grid-layout':
343
  cascadingGridLayoutRender();
344
  break;
345
+ case 'list-layout':
346
+ listLayoutRender();
347
+ break;
348
  }
349
 
350
  $projectsContainer.imagesLoaded( function() {
461
  'margin-left': -margin + 'px',
462
  'margin-right': -margin + 'px',
463
  } );
464
+ } );
465
+ }
466
 
467
+ /*
468
+ * Render list layout
469
+ */
470
+ function listLayoutRender() {
471
+ var projectsListWrap = $('.projects-list', $projectsContainer ),
472
+ projectsList = $('.projects-item', $projectsContainer );
473
 
474
+ projectsList.css( {
475
+ 'margin-bottom': +projectsSettings['item-margin']
476
  } );
477
  }
478
 
479
+ /**
480
+ * GetCascadingIndex
481
+ */
482
  function getCascadingIndex( index ) {
483
  var index = index || 0,
484
+ map = cherryProjectsObjects.cascadingListMap || [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4 ],
485
  counter = 0,
486
  mapIndex = 0;
487
 
597
  }
598
  }//end plugin
599
 
600
+ })(jQuery)
public/assets/js/cherry-projects-scripts.js CHANGED
@@ -69,10 +69,13 @@
69
  case 'masonry-layout':
70
  self.masonryLayoutRender( $instance, columnNumber, instanceSettings['item-margin'] );
71
  break;
 
 
 
72
  }
73
 
74
  jQuery( window ).on( 'resize.projects_layout_resize', function() {
75
- var columnNumber = self.getResponsiveColumn( +instanceSettings['column-number'] );
76
 
77
  switch ( instanceSettings['list-layout'] ) {
78
  case 'grid-layout':
@@ -122,6 +125,45 @@
122
  } );
123
  },
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  showAnimation: function( itemlist, startIndex, delta ) {
126
  var counter = 1;
127
 
69
  case 'masonry-layout':
70
  self.masonryLayoutRender( $instance, columnNumber, instanceSettings['item-margin'] );
71
  break;
72
+ case 'cascading-grid-layout':
73
+ self.cascadingGridLayoutRender( $instance, instanceSettings['item-margin'] );
74
+ break;
75
  }
76
 
77
  jQuery( window ).on( 'resize.projects_layout_resize', function() {
78
+ var columnNumber = self.getResponsiveColumn( +instanceSettings['column-number'] );
79
 
80
  switch ( instanceSettings['list-layout'] ) {
81
  case 'grid-layout':
125
  } );
126
  },
127
 
128
+ cascadingGridLayoutRender: function( instance, marginItem ) {
129
+ var $itemlist = $( '.projects-terms-item', instance );
130
+
131
+ $itemlist.each( function( index ) {
132
+ var $this = $( this ),
133
+ newWidth = ( 100 / getCascadingIndex( index ) ).toFixed( 2 ),
134
+ margin = Math.ceil( +marginItem / 2 );
135
+
136
+ $this.css( {
137
+ 'width': +newWidth + '%',
138
+ 'max-width': +newWidth + '%'
139
+ } );
140
+
141
+ $('.inner-wrapper', $this ).css( {
142
+ 'margin': margin + 'px'
143
+ } );
144
+ }
145
+ );
146
+
147
+ function getCascadingIndex ( index ) {
148
+ var index = index || 0,
149
+ map = cherryProjectsTermObjects.cascadingListMap || [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4 ],
150
+ counter = 0,
151
+ mapIndex = 0;
152
+
153
+ for ( var i = 0; i < index; i++ ) {
154
+ counter++;
155
+
156
+ if ( counter === map.length ) {
157
+ counter = 0;
158
+ }
159
+
160
+ mapIndex = counter;
161
+ };
162
+
163
+ return map[ mapIndex ];
164
+ }
165
+ },
166
+
167
  showAnimation: function( itemlist, startIndex, delta ) {
168
  var counter = 1;
169
 
public/assets/scss/_projects-terms.scss CHANGED
@@ -44,6 +44,18 @@
44
  min-width: 70%;
45
  }
46
  }
 
 
 
 
 
 
 
 
 
 
 
 
47
  .term-permalink{
48
  span{
49
  &:before{
@@ -55,4 +67,4 @@
55
 
56
  .projects-terms-list{
57
  position: relative;
58
- }
44
  min-width: 70%;
45
  }
46
  }
47
+ &.cascading-grid-layout{
48
+ .projects-terms-list{
49
+ display: flex;
50
+ flex-flow: row wrap;
51
+ align-items: stretch;
52
+ align-content: stretch;
53
+ .projects-terms-item{
54
+ flex: 0 1 auto;
55
+ height: auto;
56
+ }
57
+ }
58
+ }
59
  .term-permalink{
60
  span{
61
  &:before{
67
 
68
  .projects-terms-list{
69
  position: relative;
70
+ }
public/includes/class-cherry-projects-template-callbacks.php CHANGED
@@ -472,6 +472,7 @@ class Cherry_Projects_Template_Callbacks {
472
  $attr = wp_parse_args( $attr, $default_attr );
473
 
474
  $type = ( 'category' === cherry_projects()->projects_data->default_options['filter-type'] ) ? CHERRY_PROJECTS_NAME .'_category' : CHERRY_PROJECTS_NAME .'_tag';
 
475
  $settings = array(
476
  'visible' => true,
477
  'type' => $attr['type'],
@@ -834,10 +835,11 @@ class Cherry_Projects_Template_Callbacks {
834
  $image_html = '<figure class="featured-image"><a href="' . $image_src . '" %2$s><span class="cover"></span>' . $image_tag . '</a></figure>';
835
  }
836
 
837
- $html = cherry_projects()->projects_data->cherry_utility->media->get_image( array(
838
- 'html' => $image_html,
839
- 'class' => 'term-img',
840
- 'size' => $attr['size'],
 
841
  ),
842
  'term',
843
  $this->term_data->term_id
@@ -927,6 +929,33 @@ class Cherry_Projects_Template_Callbacks {
927
  return $html;
928
  }
929
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
930
  /**
931
  * Get image tag by attachment id
932
  *
472
  $attr = wp_parse_args( $attr, $default_attr );
473
 
474
  $type = ( 'category' === cherry_projects()->projects_data->default_options['filter-type'] ) ? CHERRY_PROJECTS_NAME .'_category' : CHERRY_PROJECTS_NAME .'_tag';
475
+
476
  $settings = array(
477
  'visible' => true,
478
  'type' => $attr['type'],
835
  $image_html = '<figure class="featured-image"><a href="' . $image_src . '" %2$s><span class="cover"></span>' . $image_tag . '</a></figure>';
836
  }
837
 
838
+ $html = cherry_projects()->projects_data->cherry_utility->media->get_image(
839
+ array(
840
+ 'html' => $image_html,
841
+ 'class' => 'term-img',
842
+ 'size' => $attr['size'],
843
  ),
844
  'term',
845
  $this->term_data->term_id
929
  return $html;
930
  }
931
 
932
+ /**
933
+ * Get term attachments
934
+ *
935
+ * @since 1.0.0
936
+ */
937
+ public function get_term_attachments( $attr = array() ) {
938
+ $default_attr = array( 'prefix' => esc_html__( 'Posted by ', 'cherry-projects' ) );
939
+
940
+ $attr = wp_parse_args( $attr, $default_attr );
941
+
942
+ $html = cherry_projects()->projects_data->cherry_utility->meta_data->get_post_count_in_term(
943
+ array(
944
+ 'icon' => apply_filters( 'cherry_projects_term_attachments_icon', '' ),
945
+ 'sufix' => array(
946
+ 'singular' => '%s project',
947
+ 'plural' => '%s projects',
948
+ 'domain' => 'cherry-projects',
949
+ 'context' => false,
950
+ ),
951
+ 'echo' => false,
952
+ ),
953
+ $this->term_data->term_id
954
+ );
955
+
956
+ return $html;
957
+ }
958
+
959
  /**
960
  * Get image tag by attachment id
961
  *
public/includes/class-projects-data.php CHANGED
@@ -130,12 +130,13 @@ class Cherry_Project_Data {
130
 
131
  $this->options = wp_parse_args( $options, $this->default_options );
132
  // The Query.
 
133
  $posts_query = $this->get_query_projects_items(
134
  array(
135
- CHERRY_PROJECTS_NAME . '_' . $this->options['filter-type'] => '',
136
- 'posts_per_page' => $this->options['post-per-page'],
137
- 'order' => $this->options['order-filter-default-value'],
138
- 'orderby' => $this->options['orderby-filter-default-value'],
139
  )
140
  );
141
 
@@ -184,8 +185,24 @@ class Cherry_Project_Data {
184
  $html .= sprintf( '<div class="%1$s" data-settings=\'%2$s\'>', $container_class, $settings );
185
  $html .= '<div class="projects-list cherry-animation-list" data-all-posts-count="' . $this->posts_query->found_posts . '"></div>';
186
  $html .= '</div>';
187
- $html .= '<div class="projects-end-line-spinner"><div class="cherry-spinner cherry-spinner-double-bounce"><div class="cherry-double-bounce1"></div><div class="cherry-double-bounce2"></div></div></div>';
188
- $html .= '<div class="cherry-projects-ajax-loader"><div class="cherry-spinner cherry-spinner-double-bounce"><div class="cherry-double-bounce1"></div><div class="cherry-double-bounce2"></div></div></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  // Close wrapper.
190
  $html .= '</div>';
191
 
@@ -229,10 +246,10 @@ class Cherry_Project_Data {
229
 
230
  $query_args['tax_query'] = array(
231
  array(
232
- 'taxonomy' => 'post_format',
233
- 'field' => 'slug',
234
- 'terms' => $terms,
235
- 'operator' => $operator,
236
  ),
237
  );
238
  }
@@ -339,12 +356,12 @@ class Cherry_Project_Data {
339
 
340
  $defaults_query_args = apply_filters( 'cherry_projects_default_query_args',
341
  array(
342
- 'post_type' => CHERRY_PROJECTS_NAME,
343
- 'order' => 'DESC',
344
- 'orderby' => 'date',
345
- 'posts_per_page' => 9,
346
- 'paged' => $paged,
347
- 'post_status' => 'publish',
348
  )
349
  );
350
 
@@ -641,6 +658,7 @@ class Cherry_Project_Data {
641
  'termname' => array( $callbacks, 'get_term_name' ),
642
  'termdescription' => array( $callbacks, 'get_term_description' ),
643
  'termpermalink' => array( $callbacks, 'get_term_permalink' ),
 
644
  );
645
 
646
  /**
@@ -784,8 +802,15 @@ class Cherry_Project_Data {
784
  wp_enqueue_script( 'cherry-projects-plugin', trailingslashit( CHERRY_PROJECTS_URI ) . 'public/assets/js/cherry-projects-plugin.js', array( 'jquery' ), CHERRY_PROJECTS_VERSION, true );
785
  wp_enqueue_script( 'cherry-projects-scripts', trailingslashit( CHERRY_PROJECTS_URI ) . 'public/assets/js/cherry-projects-scripts.js', array( 'jquery' ), CHERRY_PROJECTS_VERSION, true );
786
 
 
 
787
  // Ajax js object portfolio_type_ajax.
788
- wp_localize_script( 'cherry-projects-scripts', 'cherryProjectsObjects', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
 
 
 
 
 
789
  }
790
 
791
- }
130
 
131
  $this->options = wp_parse_args( $options, $this->default_options );
132
  // The Query.
133
+ $filter_type = CHERRY_PROJECTS_NAME . '_' . $this->options['filter-type'];
134
  $posts_query = $this->get_query_projects_items(
135
  array(
136
+ $filter_type => '',
137
+ 'posts_per_page' => $this->options['post-per-page'],
138
+ 'order' => $this->options['order-filter-default-value'],
139
+ 'orderby' => $this->options['orderby-filter-default-value'],
140
  )
141
  );
142
 
185
  $html .= sprintf( '<div class="%1$s" data-settings=\'%2$s\'>', $container_class, $settings );
186
  $html .= '<div class="projects-list cherry-animation-list" data-all-posts-count="' . $this->posts_query->found_posts . '"></div>';
187
  $html .= '</div>';
188
+
189
+ /**
190
+ * End line spinner html filter
191
+ *
192
+ * @since 1.1.0
193
+ */
194
+ $line_spinner_html = apply_filters( 'cherry-projects-end-line-spinner-html', '<div class="projects-end-line-spinner"><div class="cherry-spinner cherry-spinner-double-bounce"><div class="cherry-double-bounce1"></div><div class="cherry-double-bounce2"></div></div></div>' );
195
+
196
+ $html .= $line_spinner_html;
197
+
198
+ /**
199
+ * Ajax loader html filter
200
+ *
201
+ * @since 1.1.0
202
+ */
203
+ $ajax_loader_html = apply_filters( 'cherry-projects-ajax-loader-html', '<div class="cherry-projects-ajax-loader"><div class="cherry-spinner cherry-spinner-double-bounce"><div class="cherry-double-bounce1"></div><div class="cherry-double-bounce2"></div></div></div>' );
204
+
205
+ $html .= $ajax_loader_html;
206
  // Close wrapper.
207
  $html .= '</div>';
208
 
246
 
247
  $query_args['tax_query'] = array(
248
  array(
249
+ 'taxonomy' => 'post_format',
250
+ 'field' => 'slug',
251
+ 'terms' => $terms,
252
+ 'operator' => $operator,
253
  ),
254
  );
255
  }
356
 
357
  $defaults_query_args = apply_filters( 'cherry_projects_default_query_args',
358
  array(
359
+ 'post_type' => CHERRY_PROJECTS_NAME,
360
+ 'order' => 'DESC',
361
+ 'orderby' => 'date',
362
+ 'posts_per_page' => 9,
363
+ 'paged' => $paged,
364
+ 'post_status' => 'publish',
365
  )
366
  );
367
 
658
  'termname' => array( $callbacks, 'get_term_name' ),
659
  'termdescription' => array( $callbacks, 'get_term_description' ),
660
  'termpermalink' => array( $callbacks, 'get_term_permalink' ),
661
+ 'termattachments' => array( $callbacks, 'get_term_attachments' ),
662
  );
663
 
664
  /**
802
  wp_enqueue_script( 'cherry-projects-plugin', trailingslashit( CHERRY_PROJECTS_URI ) . 'public/assets/js/cherry-projects-plugin.js', array( 'jquery' ), CHERRY_PROJECTS_VERSION, true );
803
  wp_enqueue_script( 'cherry-projects-scripts', trailingslashit( CHERRY_PROJECTS_URI ) . 'public/assets/js/cherry-projects-scripts.js', array( 'jquery' ), CHERRY_PROJECTS_VERSION, true );
804
 
805
+ $cascading_list_map = apply_filters( 'cherry_projects_cascading_list_map', array( 1, 2, 2, 3, 3, 3, 4, 4, 4, 4 ) );
806
+
807
  // Ajax js object portfolio_type_ajax.
808
+ wp_localize_script( 'cherry-projects-scripts', 'cherryProjectsObjects',
809
+ array(
810
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
811
+ 'cascadingListMap' => $cascading_list_map,
812
+ )
813
+ );
814
  }
815
 
816
+ }
public/includes/class-projects-shortcode.php CHANGED
@@ -111,4 +111,4 @@ class Cherry_Projects_Shortcode {
111
 
112
  }
113
 
114
- Cherry_Projects_Shortcode::get_instance();
111
 
112
  }
113
 
114
+ Cherry_Projects_Shortcode::get_instance();
public/includes/class-projects-term-data.php CHANGED
@@ -53,16 +53,17 @@ class Cherry_Project_Term_Data extends Cherry_Project_Data {
53
  */
54
  public function set_default_options() {
55
  $this->default_options = array(
56
- 'term-type' => 'category',
57
- 'listing-layout' => 'grid-layout',
58
- 'loading-animation' => 'loading-animation-fade',
59
- 'column-number' => 3,
60
- 'post-per-page' => 6,
61
- 'item-margin' => 10,
62
- 'grid-template' => 'terms-grid-default.tmpl',
63
- 'masonry-template' => 'terms-masonry-default.tmpl',
64
- 'list-template' => 'terms-list-default.tmpl',
65
- 'echo' => true,
 
66
  );
67
 
68
  /**
@@ -96,6 +97,9 @@ class Cherry_Project_Term_Data extends Cherry_Project_Data {
96
  case 'list-layout':
97
  $this->template = $this->options['list-template'];
98
  break;
 
 
 
99
  }
100
 
101
  $settings = array(
@@ -228,6 +232,14 @@ class Cherry_Project_Term_Data extends Cherry_Project_Data {
228
  wp_enqueue_script( 'imagesloaded', trailingslashit( CHERRY_PROJECTS_URI ) . 'public/assets/js/imagesloaded.pkgd.min.js', array( 'jquery' ), CHERRY_PROJECTS_VERSION, true );
229
  wp_enqueue_script( 'magnific-popup', trailingslashit( CHERRY_PROJECTS_URI ) . 'public/assets/js/jquery.magnific-popup.min.js', array( 'jquery' ), '1.1.0', true );
230
  wp_enqueue_script( 'cherry-projects-scripts', trailingslashit( CHERRY_PROJECTS_URI ) . 'public/assets/js/cherry-projects-scripts.js', array( 'jquery' ), CHERRY_PROJECTS_VERSION, true );
 
 
 
 
 
 
 
 
231
  }
232
 
233
- }
53
  */
54
  public function set_default_options() {
55
  $this->default_options = array(
56
+ 'term-type' => 'category',
57
+ 'listing-layout' => 'grid-layout',
58
+ 'loading-animation' => 'loading-animation-fade',
59
+ 'column-number' => 3,
60
+ 'post-per-page' => 6,
61
+ 'item-margin' => 10,
62
+ 'grid-template' => 'terms-grid-default.tmpl',
63
+ 'masonry-template' => 'terms-masonry-default.tmpl',
64
+ 'list-template' => 'terms-list-default.tmpl',
65
+ 'cascading-grid-template' => 'terms-cascading-grid-default.tmpl',
66
+ 'echo' => true,
67
  );
68
 
69
  /**
97
  case 'list-layout':
98
  $this->template = $this->options['list-template'];
99
  break;
100
+ case 'cascading-grid-layout':
101
+ $this->template = $this->options['cascading-grid-template'];
102
+ break;
103
  }
104
 
105
  $settings = array(
232
  wp_enqueue_script( 'imagesloaded', trailingslashit( CHERRY_PROJECTS_URI ) . 'public/assets/js/imagesloaded.pkgd.min.js', array( 'jquery' ), CHERRY_PROJECTS_VERSION, true );
233
  wp_enqueue_script( 'magnific-popup', trailingslashit( CHERRY_PROJECTS_URI ) . 'public/assets/js/jquery.magnific-popup.min.js', array( 'jquery' ), '1.1.0', true );
234
  wp_enqueue_script( 'cherry-projects-scripts', trailingslashit( CHERRY_PROJECTS_URI ) . 'public/assets/js/cherry-projects-scripts.js', array( 'jquery' ), CHERRY_PROJECTS_VERSION, true );
235
+
236
+ $cascading_list_map = apply_filters( 'cherry_projects_terms_cascading_list_map', array( 1, 2, 2, 3, 3, 3, 4, 4, 4, 4 ) );
237
+
238
+ wp_localize_script( 'cherry-projects-scripts', 'cherryProjectsTermObjects',
239
+ array(
240
+ 'cascadingListMap' => $cascading_list_map,
241
+ )
242
+ );
243
  }
244
 
245
+ }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Cherry Projects ===
2
 
3
  Contributors: TemplateMonster 2002
4
- Tags: custom post type, projects, portfolio
5
  Requires at least: 4.5
6
- Tested up to: 4.5.3
7
- Stable tag: 1.0.0
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -124,3 +124,11 @@ Standard templates can be rewritten in the theme. For that you need to create ch
124
  = 1.0.0 =
125
 
126
  * Initial release
 
 
 
 
 
 
 
 
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.6.1
7
+ Stable tag: 1.1.0
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
124
  = 1.0.0 =
125
 
126
  * Initial release
127
+
128
+ = 1.1.0 =
129
+
130
+ * Updated editing interface types of projects
131
+ * Fixed archive template
132
+ * Fixed bugs
133
+ * Added new filters
134
+ * Add new macros "termattachments" for projects_terms shortcode
templates/shortcodes/projects-terms/terms-cascading-grid-default.tmpl ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="project-terms-media">
2
+ %%TERMIMAGE%%
3
+ <div class="hover-content row-format">
4
+ %%TERMPERMALINK%%
5
+ </div>
6
+ </div>
7
+ <div class="project-terms-content">
8
+ %%TERMNAME%%
9
+ %%TERMDESCRIPTION%%
10
+ %%TERMATTACHMENTS%%
11
+ </div>
templates/shortcodes/projects-terms/terms-grid-default.tmpl CHANGED
@@ -7,4 +7,5 @@
7
  <div class="project-terms-content">
8
  %%TERMNAME%%
9
  %%TERMDESCRIPTION%%
10
- </div>
 
7
  <div class="project-terms-content">
8
  %%TERMNAME%%
9
  %%TERMDESCRIPTION%%
10
+ %%TERMATTACHMENTS%%
11
+ </div>
templates/shortcodes/projects-terms/terms-list-default.tmpl CHANGED
@@ -7,5 +7,6 @@
7
  <div class="project-terms-content">
8
  %%TERMNAME%%
9
  %%TERMDESCRIPTION%%
 
10
  </div>
11
 
7
  <div class="project-terms-content">
8
  %%TERMNAME%%
9
  %%TERMDESCRIPTION%%
10
+ %%TERMATTACHMENTS%%
11
  </div>
12
 
templates/shortcodes/projects-terms/terms-masonry-default.tmpl CHANGED
@@ -7,4 +7,5 @@
7
  <div class="project-terms-content">
8
  %%TERMNAME%%
9
  %%TERMDESCRIPTION%%
10
- </div>
 
7
  <div class="project-terms-content">
8
  %%TERMNAME%%
9
  %%TERMDESCRIPTION%%
10
+ %%TERMATTACHMENTS%%
11
+ </div>