YITH WooCommerce Ajax Product Filter - Version 3.4.6

Version Description

  • Released: 12 Oct, 2017 =

  • Fix: 500 internal server error if use with YITH WooCommerce Ajax Search plugin

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Ajax Product Filter
Version 3.4.6
Comparing to
See all releases

Code changes from version 3.4.5 to 3.4.6

Files changed (186) hide show
  1. README.txt +5 -1
  2. includes/class.yith-wcan.php +1 -1
  3. init.php +3 -3
  4. plugin-fw/assets/css/admin.css +76 -0
  5. plugin-fw/assets/css/chosen/chosen.css +0 -435
  6. plugin-fw/assets/css/metaboxes.css +507 -537
  7. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  8. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_flat_10_000000_40x100.png +0 -0
  9. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  10. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  11. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  12. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  13. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  14. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  15. plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_222222_256x240.png +0 -0
  16. plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_228ef1_256x240.png +0 -0
  17. plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ef8c08_256x240.png +0 -0
  18. plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ffd27a_256x240.png +0 -0
  19. plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ffffff_256x240.png +0 -0
  20. plugin-fw/assets/css/overcast/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  21. plugin-fw/assets/css/overcast/images/ui-bg_flat_0_eeeeee_40x100.png +0 -0
  22. plugin-fw/assets/css/overcast/images/ui-bg_flat_55_c0402a_40x100.png +0 -0
  23. plugin-fw/assets/css/overcast/images/ui-bg_flat_55_eeeeee_40x100.png +0 -0
  24. plugin-fw/assets/css/overcast/images/ui-bg_glass_100_f8f8f8_1x400.png +0 -0
  25. plugin-fw/assets/css/overcast/images/ui-bg_glass_35_dddddd_1x400.png +0 -0
  26. plugin-fw/assets/css/overcast/images/ui-bg_glass_60_eeeeee_1x400.png +0 -0
  27. plugin-fw/assets/css/overcast/images/ui-bg_inset-hard_75_999999_1x100.png +0 -0
  28. plugin-fw/assets/css/overcast/images/ui-bg_inset-soft_50_c9c9c9_1x100.png +0 -0
  29. plugin-fw/assets/css/overcast/images/ui-icons_3383bb_256x240.png +0 -0
  30. plugin-fw/assets/css/overcast/images/ui-icons_454545_256x240.png +0 -0
  31. plugin-fw/assets/css/overcast/images/ui-icons_70b2e1_256x240.png +0 -0
  32. plugin-fw/assets/css/overcast/images/ui-icons_999999_256x240.png +0 -0
  33. plugin-fw/assets/css/overcast/images/ui-icons_fbc856_256x240.png +0 -0
  34. plugin-fw/assets/css/overcast/jquery-ui-custom/jquery-ui-1.8.9.custom.css +0 -578
  35. plugin-fw/assets/css/yit-plugin-panel-sidebar.css +0 -388
  36. plugin-fw/assets/css/yit-plugin-panel.css +43 -267
  37. plugin-fw/assets/css/yit-upgrader.css +5 -1
  38. plugin-fw/assets/css/yith-fields.css +346 -0
  39. plugin-fw/assets/images/chosen/chosen-sprite.png +0 -0
  40. plugin-fw/assets/images/chosen/chosen-sprite@2x.png +0 -0
  41. plugin-fw/assets/images/off.png +0 -0
  42. plugin-fw/assets/images/on.png +0 -0
  43. plugin-fw/assets/images/select.png +0 -0
  44. plugin-fw/assets/images/slider/grey.gif +0 -0
  45. plugin-fw/assets/images/slider/handle.png +0 -0
  46. plugin-fw/assets/images/slider/orange.gif +0 -0
  47. plugin-fw/assets/images/slider/tooltip.png +0 -0
  48. plugin-fw/assets/images/widgets/box-icon.png +0 -0
  49. plugin-fw/assets/images/widgets/box-white-icon.png +0 -0
  50. plugin-fw/assets/images/widgets/despacho.png +0 -0
  51. plugin-fw/assets/images/widgets/info-icon.png +0 -0
  52. plugin-fw/assets/images/widgets/link-bg.png +0 -0
  53. plugin-fw/assets/images/widgets/link-bg2.png +0 -0
  54. plugin-fw/assets/images/widgets/link-icon.png +0 -0
  55. plugin-fw/assets/images/widgets/membership-bg.png +0 -0
  56. plugin-fw/assets/js/chosen/ajax-chosen.jquery.js +0 -81
  57. plugin-fw/assets/js/chosen/ajax-chosen.jquery.min.js +0 -2
  58. plugin-fw/assets/js/chosen/chosen.jquery.js +0 -1211
  59. plugin-fw/assets/js/how-to.js +4 -4
  60. plugin-fw/assets/js/how-to.min.js +1 -0
  61. plugin-fw/assets/js/jquery.colorbox.js +1 -1
  62. plugin-fw/assets/js/jquery.colorbox.min.js +24 -0
  63. plugin-fw/assets/js/metabox.js +43 -260
  64. plugin-fw/assets/js/metabox.min.js +4 -11
  65. plugin-fw/assets/js/multisite-updater.js +6 -0
  66. plugin-fw/assets/js/multisite-updater.min.js +4 -1
  67. plugin-fw/assets/js/panel.spinner.js +0 -139
  68. plugin-fw/assets/js/panel.spinner.min.js +0 -3
  69. plugin-fw/assets/js/yit-cptu-sortable-posts.js +0 -32
  70. plugin-fw/assets/js/yit-plugin-panel-sidebar.js +0 -56
  71. plugin-fw/assets/js/yit-plugin-panel-sidebar.min.js +0 -1
  72. plugin-fw/assets/js/yit-plugin-panel.js +100 -287
  73. plugin-fw/assets/js/yit-plugin-panel.min.js +7 -1
  74. plugin-fw/assets/js/yit-wp-pointer.js +0 -1
  75. plugin-fw/assets/js/yit-wp-pointer.min.js +3 -3
  76. plugin-fw/assets/js/yith-enhanced-select-wc-2.6.js +148 -0
  77. plugin-fw/assets/js/yith-enhanced-select-wc-2.6.min.js +5 -0
  78. plugin-fw/assets/js/yith-enhanced-select.js +136 -0
  79. plugin-fw/assets/js/yith-enhanced-select.min.js +5 -0
  80. plugin-fw/assets/js/yith-fields.js +350 -0
  81. plugin-fw/assets/js/yith-fields.min.js +15 -0
  82. plugin-fw/init.php +3 -4
  83. plugin-fw/lib/yit-ajax.php +211 -10
  84. plugin-fw/lib/yit-assets.php +92 -0
  85. plugin-fw/lib/yit-debug.php +271 -0
  86. plugin-fw/lib/yit-icons.php +1143 -0
  87. plugin-fw/lib/yit-metabox.php +149 -143
  88. plugin-fw/lib/yit-plugin-common.php +1 -1
  89. plugin-fw/lib/yit-plugin-panel-sidebar.php +0 -430
  90. plugin-fw/lib/yit-plugin-panel-wc.php +211 -121
  91. plugin-fw/lib/yit-plugin-panel.php +286 -213
  92. plugin-fw/lib/yit-plugin-subpanel.php +45 -35
  93. plugin-fw/lib/yit-upgrade.php +554 -546
  94. plugin-fw/licence/assets/css/yit-licence.css +5 -3
  95. plugin-fw/licence/lib/yit-licence.php +164 -153
  96. plugin-fw/licence/lib/yit-plugin-licence.php +47 -11
  97. plugin-fw/templates/fields/ajax-posts.php +111 -0
  98. plugin-fw/templates/fields/ajax-products.php +24 -0
  99. plugin-fw/templates/fields/ajax-terms.php +133 -0
  100. plugin-fw/templates/fields/buttons.php +27 -0
  101. plugin-fw/templates/fields/checkbox.php +28 -0
  102. plugin-fw/templates/fields/colorpicker.php +27 -0
  103. plugin-fw/templates/fields/customtabs.php +151 -0
  104. plugin-fw/templates/fields/datepicker.php +24 -0
  105. plugin-fw/templates/fields/hidden.php +29 -0
  106. plugin-fw/templates/{metaboxes/types/simple-text.php → fields/html.php} +5 -8
  107. plugin-fw/templates/fields/icons.php +63 -0
  108. plugin-fw/templates/fields/image-gallery.php +40 -0
  109. plugin-fw/templates/fields/number.php +36 -0
  110. plugin-fw/templates/fields/onoff.php +21 -0
  111. plugin-fw/templates/fields/preview.php +18 -0
  112. plugin-fw/templates/fields/select-buttons.php +44 -0
  113. plugin-fw/templates/fields/select-mailchimp.php +30 -0
  114. plugin-fw/templates/fields/select.php +46 -0
  115. plugin-fw/templates/{metaboxes/types → fields}/sep.php +2 -6
  116. plugin-fw/templates/fields/sidebarlist.php +28 -0
  117. plugin-fw/templates/fields/sidebars.php +62 -0
  118. plugin-fw/templates/fields/simple-text.php +19 -0
  119. plugin-fw/templates/fields/slider.php +28 -0
  120. plugin-fw/templates/fields/text-array.php +28 -0
  121. plugin-fw/templates/fields/text-button.php +49 -0
  122. plugin-fw/templates/fields/text.php +26 -0
  123. plugin-fw/templates/fields/textarea-codemirror.php +26 -0
  124. plugin-fw/templates/fields/textarea-editor.php +38 -0
  125. plugin-fw/templates/fields/textarea.php +24 -0
  126. plugin-fw/templates/{metaboxes/types/hidden.php → fields/title.php} +6 -7
  127. plugin-fw/templates/fields/upload.php +28 -0
  128. plugin-fw/templates/metaboxes/field-row.php +44 -0
  129. plugin-fw/templates/metaboxes/tab.php +60 -24
  130. plugin-fw/templates/metaboxes/types/ajax-products.php +0 -63
  131. plugin-fw/templates/metaboxes/types/categories.php +0 -88
  132. plugin-fw/templates/metaboxes/types/checkbox.php +0 -23
  133. plugin-fw/templates/metaboxes/types/chosen.php +0 -32
  134. plugin-fw/templates/metaboxes/types/colorpicker.php +0 -22
  135. plugin-fw/templates/metaboxes/types/contactform.php +0 -557
  136. plugin-fw/templates/metaboxes/types/customtabs.php +0 -152
  137. plugin-fw/templates/metaboxes/types/datepicker.php +0 -21
  138. plugin-fw/templates/metaboxes/types/icon-list.php +0 -135
  139. plugin-fw/templates/metaboxes/types/image-gallery.php +0 -48
  140. plugin-fw/templates/metaboxes/types/images.php +0 -90
  141. plugin-fw/templates/metaboxes/types/number.php +0 -50
  142. plugin-fw/templates/metaboxes/types/onoff.php +0 -30
  143. plugin-fw/templates/metaboxes/types/preview.php +0 -19
  144. plugin-fw/templates/metaboxes/types/responsivesliders.php +0 -31
  145. plugin-fw/templates/metaboxes/types/select-icon.php +0 -72
  146. plugin-fw/templates/metaboxes/types/select-mailchimp.php +0 -32
  147. plugin-fw/templates/metaboxes/types/select.php +0 -32
  148. plugin-fw/templates/metaboxes/types/sidebar-layout.php +0 -61
  149. plugin-fw/templates/metaboxes/types/sidebarlist.php +0 -29
  150. plugin-fw/templates/metaboxes/types/sidebars.php +0 -124
  151. plugin-fw/templates/metaboxes/types/slider.php +0 -35
  152. plugin-fw/templates/metaboxes/types/text-array.php +0 -30
  153. plugin-fw/templates/metaboxes/types/text.php +0 -24
  154. plugin-fw/templates/metaboxes/types/textarea-editor.php +0 -42
  155. plugin-fw/templates/metaboxes/types/textarea.php +0 -25
  156. plugin-fw/templates/metaboxes/types/title.php +0 -18
  157. plugin-fw/templates/metaboxes/types/typography.php +0 -255
  158. plugin-fw/templates/metaboxes/types/upload.php +0 -24
  159. plugin-fw/templates/panel/panel-field-container.php +41 -0
  160. plugin-fw/templates/panel/sidebar/sidebar.php +0 -20
  161. plugin-fw/templates/panel/sidebar/widget.php +0 -53
  162. plugin-fw/templates/panel/sidebar/widgets/badges/badge.php +0 -11
  163. plugin-fw/templates/panel/sidebar/widgets/widget-despacho.php +0 -19
  164. plugin-fw/templates/panel/sidebar/widgets/widget-links.php +0 -34
  165. plugin-fw/templates/panel/sidebar/widgets/widget-membership.php +0 -29
  166. plugin-fw/templates/panel/sidebar/widgets/widgets.php +0 -42
  167. plugin-fw/templates/panel/types/chosen.php +0 -36
  168. plugin-fw/templates/panel/types/colorpicker.php +0 -38
  169. plugin-fw/templates/panel/types/connected-list.php +0 -27
  170. plugin-fw/templates/panel/types/layout-panel.php +0 -0
  171. plugin-fw/templates/panel/types/number.php +0 -35
  172. plugin-fw/templates/panel/types/on-off.php +0 -34
  173. plugin-fw/templates/panel/types/select-mailchimp.php +0 -36
  174. plugin-fw/templates/panel/types/select.php +0 -41
  175. plugin-fw/templates/panel/types/slider.php +0 -40
  176. plugin-fw/templates/panel/types/text-button.php +0 -36
  177. plugin-fw/templates/panel/types/text.php +0 -35
  178. plugin-fw/templates/panel/types/textarea-codemirror.php +0 -40
  179. plugin-fw/templates/panel/types/textarea.php +0 -35
  180. plugin-fw/templates/panel/types/upload.php +0 -46
  181. plugin-fw/templates/panel/videobox.php +0 -83
  182. plugin-fw/templates/panel/woocommerce/woocommerce-form.php +1 -1
  183. plugin-fw/templates/panel/woocommerce/woocommerce-option-row.php +31 -0
  184. plugin-fw/templates/panel/woocommerce/woocommerce-upload.php +3 -3
  185. plugin-fw/yit-functions.php +360 -211
  186. plugin-fw/yit-plugin.php +3 -0
README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce ajax product filter download, woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
  Requires at least: 4.0
6
  Tested up to: 4.8.2
7
- Stable tag: 3.4.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -159,6 +159,10 @@ If you want to see a demonstration version of the premium plugin, you can see it
159
 
160
  == Changelog ==
161
 
 
 
 
 
162
  = 3.4.5 - Released: 10 Oct, 2017 =
163
 
164
  * New: Support to WooCommerce 3.2
4
  Tags: woocommerce ajax product filter download, woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
  Requires at least: 4.0
6
  Tested up to: 4.8.2
7
+ Stable tag: 3.4.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
159
 
160
  == Changelog ==
161
 
162
+ = 3.4.6 - Released: 12 Oct, 2017 =
163
+
164
+ * Fix: 500 internal server error if use with YITH WooCommerce Ajax Search plugin
165
+
166
  = 3.4.5 - Released: 10 Oct, 2017 =
167
 
168
  * New: Support to WooCommerce 3.2
includes/class.yith-wcan.php CHANGED
@@ -202,7 +202,7 @@ if ( ! class_exists( 'YITH_WCAN' ) ) {
202
  }
203
 
204
  public function init() {
205
- if ( is_admin() ) {
206
  $this->admin = new YITH_WCAN_Admin( $this->version );
207
  }
208
  else {
202
  }
203
 
204
  public function init() {
205
+ if ( is_admin() && ! is_ajax() ) {
206
  $this->admin = new YITH_WCAN_Admin( $this->version );
207
  }
208
  else {
init.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
- * Version: 3.4.5
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-navigation
10
  * Domain Path: /languages/
11
  *
12
  * WC requires at least: 2.2.0
13
- * WC tested up to: 3.2.0-rc2
14
  *
15
  * @author Your Inspiration Themes
16
  * @package YITH WooCommerce Ajax Navigation
@@ -67,7 +67,7 @@ load_plugin_textdomain( 'yith-woocommerce-ajax-navigation', false, dirname( plug
67
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
68
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
69
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
70
- ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.4.5' );
71
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
72
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
73
 
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
+ * Version: 3.4.6
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-navigation
10
  * Domain Path: /languages/
11
  *
12
  * WC requires at least: 2.2.0
13
+ * WC tested up to: 3.2.0
14
  *
15
  * @author Your Inspiration Themes
16
  * @package YITH WooCommerce Ajax Navigation
67
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
68
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
69
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
70
+ ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.4.6' );
71
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
72
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
73
 
plugin-fw/assets/css/admin.css ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*-----------------------
2
+ YITH Debug
3
+ ------------------------*/
4
+ #wpadminbar .yith-debug-admin-bar div,
5
+ #wpadminbar .yith-debug-admin-bar:hover div {
6
+ background : #05789c !important;
7
+ color : #fff !important;
8
+ }
9
+
10
+ #wpadminbar .yith-debug-admin-bar a,
11
+ #wpadminbar .yith-debug-admin-bar strong {
12
+ color : #fff !important;
13
+ }
14
+
15
+ #wpadminbar .yith-debug-admin-bar strong {
16
+ font-weight : 600;
17
+ }
18
+
19
+ #wpadminbar .yith-debug-admin-bar-post-meta .ab-empty-item,
20
+ #wpadminbar .yith-debug-admin-bar-option .ab-empty-item {
21
+ display : none;
22
+ }
23
+
24
+ #wpadminbar #wp-admin-bar-yith-debug-admin-bar-post-meta-default,
25
+ #wpadminbar #wp-admin-bar-yith-debug-admin-bar-option-default {
26
+ padding : 0;
27
+ max-height : 500px;
28
+ overflow-y : auto;
29
+ }
30
+
31
+ #wpadminbar .yith-debug-admin-bar pre {
32
+ padding : 10px;
33
+ line-height : 1.5em;
34
+ }
35
+
36
+ /*-----------------------
37
+ YITH Plugins Columns
38
+ ------------------------*/
39
+ @media screen and (min-width : 783px) {
40
+
41
+ .auto-fold #adminmenu .yith-plugin-fw-menu-2-columns.wp-not-current-submenu .wp-submenu-head {
42
+ width : 100%;
43
+ }
44
+
45
+ #adminmenu .yith-plugin-fw-menu-2-columns.wp-not-current-submenu .wp-submenu {
46
+ min-width : 320px;
47
+ display : flex;
48
+ flex-flow : row wrap;
49
+ }
50
+
51
+ #adminmenu .yith-plugin-fw-menu-2-columns.wp-not-current-submenu .wp-submenu li:not(.wp-submenu-head) {
52
+ width : 50%;
53
+ border-left : 1px solid #555;
54
+ box-sizing : border-box;
55
+ }
56
+
57
+ #adminmenu .yith-plugin-fw-menu-2-columns.wp-not-current-submenu .wp-submenu li:not(.wp-submenu-head):nth-child(2n) {
58
+ border-left : none;
59
+ }
60
+
61
+ #adminmenu .yith-plugin-fw-menu-3-columns.wp-not-current-submenu .wp-submenu {
62
+ min-width : 480px;
63
+ display : flex;
64
+ flex-flow : row wrap;
65
+ }
66
+
67
+ #adminmenu .yith-plugin-fw-menu-3-columns.wp-not-current-submenu .wp-submenu li:not(.wp-submenu-head) {
68
+ width : calc(100% / 3);
69
+ border-left : 1px solid #555;
70
+ box-sizing : border-box;
71
+ }
72
+
73
+ #adminmenu .yith-plugin-fw-menu-3-columns.wp-not-current-submenu .wp-submenu li:not(.wp-submenu-head):nth-child(3n + 2) {
74
+ border-left : none;
75
+ }
76
+ }
plugin-fw/assets/css/chosen/chosen.css DELETED
@@ -1,435 +0,0 @@
1
- /*!
2
- Chosen, a Select Box Enhancer for jQuery and Prototype
3
- by Patrick Filler for Harvest, http://getharvest.com
4
-
5
- Version 1.1.0
6
- Full source at https://github.com/harvesthq/chosen
7
- Copyright (c) 2011 Harvest http://getharvest.com
8
-
9
- MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
- This file is generated by `grunt build`, do not edit it by hand.
11
- */
12
-
13
- /* @group Base */
14
- .chosen-container {
15
- position: relative;
16
- display: inline-block;
17
- vertical-align: middle;
18
- font-size: 13px;
19
- zoom: 1;
20
- *display: inline;
21
- -webkit-user-select: none;
22
- -moz-user-select: none;
23
- user-select: none;
24
- }
25
- .chosen-container .chosen-drop {
26
- position: absolute;
27
- top: 100%;
28
- left: -9999px;
29
- z-index: 1010;
30
- -webkit-box-sizing: border-box;
31
- -moz-box-sizing: border-box;
32
- box-sizing: border-box;
33
- width: 100%;
34
- border: 1px solid #aaa;
35
- border-top: 0;
36
- background: #fff;
37
- box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
38
- }
39
- .chosen-container.chosen-with-drop .chosen-drop {
40
- left: 0;
41
- }
42
- .chosen-container a {
43
- cursor: pointer;
44
- }
45
-
46
- /* @end */
47
- /* @group Single Chosen */
48
- .chosen-container-single .chosen-single {
49
- position: relative;
50
- display: block;
51
- overflow: hidden;
52
- padding: 0 0 0 8px;
53
- height: 23px;
54
- border: 1px solid #aaa;
55
- border-radius: 5px;
56
- background-color: #fff;
57
- background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
58
- background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
59
- background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
60
- background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
61
- background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
62
- background-clip: padding-box;
63
- box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
64
- color: #444;
65
- text-decoration: none;
66
- white-space: nowrap;
67
- line-height: 24px;
68
- }
69
- .chosen-container-single .chosen-default {
70
- color: #999;
71
- }
72
- .chosen-container-single .chosen-single span {
73
- display: block;
74
- overflow: hidden;
75
- margin-right: 26px;
76
- text-overflow: ellipsis;
77
- white-space: nowrap;
78
- }
79
- .chosen-container-single .chosen-single-with-deselect span {
80
- margin-right: 38px;
81
- }
82
- .chosen-container-single .chosen-single abbr {
83
- position: absolute;
84
- top: 6px;
85
- right: 26px;
86
- display: block;
87
- width: 12px;
88
- height: 12px;
89
- background: url('../../images/chosen/chosen-sprite.png') -42px 1px no-repeat;
90
- font-size: 1px;
91
- }
92
- .chosen-container-single .chosen-single abbr:hover {
93
- background-position: -42px -10px;
94
- }
95
- .chosen-container-single.chosen-disabled .chosen-single abbr:hover {
96
- background-position: -42px -10px;
97
- }
98
- .chosen-container-single .chosen-single div {
99
- position: absolute;
100
- top: 0;
101
- right: 0;
102
- display: block;
103
- width: 18px;
104
- height: 100%;
105
- }
106
- .chosen-container-single .chosen-single div b {
107
- display: block;
108
- width: 100%;
109
- height: 100%;
110
- background: url('../../images/chosen/chosen-sprite.png') no-repeat 0px 2px;
111
- }
112
- .chosen-container-single .chosen-search {
113
- position: relative;
114
- z-index: 1010;
115
- margin: 0;
116
- padding: 3px 4px;
117
- white-space: nowrap;
118
- }
119
- .chosen-container-single .chosen-search input[type="text"] {
120
- -webkit-box-sizing: border-box;
121
- -moz-box-sizing: border-box;
122
- box-sizing: border-box;
123
- margin: 1px 0;
124
- padding: 4px 20px 4px 5px;
125
- width: 100%;
126
- height: auto;
127
- outline: 0;
128
- border: 1px solid #aaa;
129
- background: white url('../../images/chosen/chosen-sprite.png') no-repeat 100% -20px;
130
- background: url('../../images/chosen/chosen-sprite.png') no-repeat 100% -20px;
131
- font-size: 1em;
132
- font-family: sans-serif;
133
- line-height: normal;
134
- border-radius: 0;
135
- }
136
- .chosen-container-single .chosen-drop {
137
- margin-top: -1px;
138
- border-radius: 0 0 4px 4px;
139
- background-clip: padding-box;
140
- }
141
- .chosen-container-single.chosen-container-single-nosearch .chosen-search {
142
- position: absolute;
143
- left: -9999px;
144
- }
145
-
146
- /* @end */
147
- /* @group Results */
148
- .chosen-container .chosen-results {
149
- position: relative;
150
- overflow-x: hidden;
151
- overflow-y: auto;
152
- margin: 0 4px 4px 0;
153
- padding: 0 0 0 4px;
154
- max-height: 240px;
155
- -webkit-overflow-scrolling: touch;
156
- }
157
- .chosen-container .chosen-results li {
158
- display: none;
159
- margin: 0;
160
- padding: 5px 6px;
161
- list-style: none;
162
- line-height: 15px;
163
- -webkit-touch-callout: none;
164
- }
165
- .chosen-container .chosen-results li.active-result {
166
- display: list-item;
167
- cursor: pointer;
168
- }
169
- .chosen-container .chosen-results li.disabled-result {
170
- display: list-item;
171
- color: #ccc;
172
- cursor: default;
173
- }
174
- .chosen-container .chosen-results li.highlighted {
175
- background-color: #3875d7;
176
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
177
- background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
178
- background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
179
- background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
180
- background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
181
- color: #fff;
182
- }
183
- .chosen-container .chosen-results li.no-results {
184
- display: list-item;
185
- background: #f4f4f4;
186
- }
187
- .chosen-container .chosen-results li.group-result {
188
- display: list-item;
189
- font-weight: bold;
190
- cursor: default;
191
- }
192
- .chosen-container .chosen-results li.group-option {
193
- padding-left: 15px;
194
- }
195
- .chosen-container .chosen-results li em {
196
- font-style: normal;
197
- text-decoration: underline;
198
- }
199
-
200
- /* @end */
201
- /* @group Multi Chosen */
202
- .chosen-container-multi .chosen-choices {
203
- position: relative;
204
- overflow: hidden;
205
- -webkit-box-sizing: border-box;
206
- -moz-box-sizing: border-box;
207
- box-sizing: border-box;
208
- margin: 0;
209
- padding: 0;
210
- width: 100%;
211
- height: auto !important;
212
- height: 1%;
213
- border: 1px solid #aaa;
214
- background-color: #fff;
215
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
216
- background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);
217
- background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);
218
- background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);
219
- background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
220
- cursor: text;
221
- }
222
- .chosen-container-multi .chosen-choices li {
223
- float: left;
224
- list-style: none;
225
- }
226
- .chosen-container-multi .chosen-choices li.search-field {
227
- margin: 0;
228
- padding: 0;
229
- white-space: nowrap;
230
- }
231
- .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
232
- margin: 1px 0;
233
- padding: 5px;
234
- height: 15px;
235
- outline: 0;
236
- border: 0 !important;
237
- background: transparent !important;
238
- box-shadow: none;
239
- color: #666;
240
- font-size: 100%;
241
- font-family: sans-serif;
242
- line-height: normal;
243
- border-radius: 0;
244
- }
245
- .chosen-container-multi .chosen-choices li.search-field .default {
246
- color: #999;
247
- }
248
- .chosen-container-multi .chosen-choices li.search-choice {
249
- position: relative;
250
- margin: 3px 0 3px 5px;
251
- padding: 3px 20px 3px 5px;
252
- border: 1px solid #aaa;
253
- border-radius: 3px;
254
- background-color: #e4e4e4;
255
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
256
- background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
257
- background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
258
- background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
259
- background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
260
- background-clip: padding-box;
261
- box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
262
- color: #333;
263
- line-height: 13px;
264
- cursor: default;
265
- }
266
- .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
267
- position: absolute;
268
- top: 4px;
269
- right: 3px;
270
- display: block;
271
- width: 12px;
272
- height: 12px;
273
- background: url('../../images/chosen/chosen-sprite.png') -42px 1px no-repeat;
274
- font-size: 1px;
275
- }
276
- .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
277
- background-position: -42px -10px;
278
- }
279
- .chosen-container-multi .chosen-choices li.search-choice-disabled {
280
- padding-right: 5px;
281
- border: 1px solid #ccc;
282
- background-color: #e4e4e4;
283
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
284
- background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
285
- background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
286
- background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
287
- background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
288
- color: #666;
289
- }
290
- .chosen-container-multi .chosen-choices li.search-choice-focus {
291
- background: #d4d4d4;
292
- }
293
- .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
294
- background-position: -42px -10px;
295
- }
296
- .chosen-container-multi .chosen-results {
297
- margin: 0;
298
- padding: 0;
299
- }
300
- .chosen-container-multi .chosen-drop .result-selected {
301
- display: list-item;
302
- color: #ccc;
303
- cursor: default;
304
- }
305
-
306
- /* @end */
307
- /* @group Active */
308
- .chosen-container-active .chosen-single {
309
- border: 1px solid #5897fb;
310
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
311
- }
312
- .chosen-container-active.chosen-with-drop .chosen-single {
313
- border: 1px solid #aaa;
314
- -moz-border-radius-bottomright: 0;
315
- border-bottom-right-radius: 0;
316
- -moz-border-radius-bottomleft: 0;
317
- border-bottom-left-radius: 0;
318
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
319
- background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);
320
- background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);
321
- background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);
322
- background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
323
- box-shadow: 0 1px 0 #fff inset;
324
- }
325
- .chosen-container-active.chosen-with-drop .chosen-single div {
326
- border-left: none;
327
- background: transparent;
328
- }
329
- .chosen-container-active.chosen-with-drop .chosen-single div b {
330
- background-position: -18px 2px;
331
- }
332
- .chosen-container-active .chosen-choices {
333
- border: 1px solid #5897fb;
334
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
335
- }
336
- .chosen-container-active .chosen-choices li.search-field input[type="text"] {
337
- color: #111 !important;
338
- }
339
-
340
- /* @end */
341
- /* @group Disabled Support */
342
- .chosen-disabled {
343
- opacity: 0.5 !important;
344
- cursor: default;
345
- }
346
- .chosen-disabled .chosen-single {
347
- cursor: default;
348
- }
349
- .chosen-disabled .chosen-choices .search-choice .search-choice-close {
350
- cursor: default;
351
- }
352
-
353
- /* @end */
354
- /* @group Right to Left */
355
- .chosen-rtl {
356
- text-align: right;
357
- }
358
- .chosen-rtl .chosen-single {
359
- overflow: visible;
360
- padding: 0 8px 0 0;
361
- }
362
- .chosen-rtl .chosen-single span {
363
- margin-right: 0;
364
- margin-left: 26px;
365
- direction: rtl;
366
- }
367
- .chosen-rtl .chosen-single-with-deselect span {
368
- margin-left: 38px;
369
- }
370
- .chosen-rtl .chosen-single div {
371
- right: auto;
372
- left: 3px;
373
- }
374
- .chosen-rtl .chosen-single abbr {
375
- right: auto;
376
- left: 26px;
377
- }
378
- .chosen-rtl .chosen-choices li {
379
- float: right;
380
- }
381
- .chosen-rtl .chosen-choices li.search-field input[type="text"] {
382
- direction: rtl;
383
- }
384
- .chosen-rtl .chosen-choices li.search-choice {
385
- margin: 3px 5px 3px 0;
386
- padding: 3px 5px 3px 19px;
387
- }
388
- .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
389
- right: auto;
390
- left: 4px;
391
- }
392
- .chosen-rtl.chosen-container-single-nosearch .chosen-search,
393
- .chosen-rtl .chosen-drop {
394
- left: 9999px;
395
- }
396
- .chosen-rtl.chosen-container-single .chosen-results {
397
- margin: 0 0 4px 4px;
398
- padding: 0 4px 0 0;
399
- }
400
- .chosen-rtl .chosen-results li.group-option {
401
- padding-right: 15px;
402
- padding-left: 0;
403
- }
404
- .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
405
- border-right: none;
406
- }
407
- .chosen-rtl .chosen-search input[type="text"] {
408
- padding: 4px 5px 4px 20px;
409
- background: white url('../../images/chosen/chosen-sprite.png') no-repeat -30px -20px;
410
- background: url('../../images/chosen/chosen-sprite.png') no-repeat -30px -20px;
411
- direction: rtl;
412
- }
413
- .chosen-rtl.chosen-container-single .chosen-single div b {
414
- background-position: 6px 2px;
415
- }
416
- .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
417
- background-position: -12px 2px;
418
- }
419
-
420
- /* @end */
421
- /* @group Retina compatibility */
422
- @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
423
- .chosen-rtl .chosen-search input[type="text"],
424
- .chosen-container-single .chosen-single abbr,
425
- .chosen-container-single .chosen-single div b,
426
- .chosen-container-single .chosen-search input[type="text"],
427
- .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
428
- .chosen-container .chosen-results-scroll-down span,
429
- .chosen-container .chosen-results-scroll-up span {
430
- background-image: url('../../images/chosen/chosen-sprite@2x.png') !important;
431
- background-size: 52px 37px !important;
432
- background-repeat: no-repeat !important;
433
- }
434
- }
435
- /* @end */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/assets/css/metaboxes.css CHANGED
@@ -1,664 +1,634 @@
1
  /* self-clear floats */
2
- .clearfix:after { content:"."; display:block; height:0; clear:both; visibility:hidden; overflow:hidden; }
 
 
 
 
 
 
 
 
3
  /* ie.css */
4
  * html .clearfix { /* IE6 */
5
- height:1%;
6
  }
7
- *:first-child+html .clearfix { /* IE7 */
8
- min-height:1%;
 
9
  }
10
 
11
- .clearboth { clear: both }
 
 
12
 
13
  /* === TAB STYLE */
14
- .metaboxes-tab { margin:-6px -12px -8px; }
15
- .metaboxes-tab div.tabs-panel { height:auto; overflow:visible; margin-top:0px; padding:0 10px; background:none; border:0; border-top:1px solid #D4D4D4; }
16
- .metaboxes-tab ul.metaboxes-tabs { background:#F5F5F5; margin:0; padding:10px 0 0 5px; }
17
- .metaboxes-tab ul.metaboxes-tabs li { padding:8px 15px; border:1px solid #D4D4D4; float:left; background:#EDEDED; border-bottom-color:#EDEDED; margin:0 0 -1px 5px; box-shadow:1px 1px 1px 0 #FFFFFF inset; }
18
- .metaboxes-tab ul.metaboxes-tabs li a { color:#555; text-decoration:none; }
19
- .metaboxes-tab ul.metaboxes-tabs li.tabs { background:#F6F6F6; border-bottom:1px solid #F6F6F6; }
20
- .metaboxes-tab p.field-row { margin:20px 0; }
21
- .metaboxes-tab div.sep { height:1px; background:#DFDFDF; clear:both; margin-left:-10px; margin-right:-10px; }
22
- .metaboxes-tab label { font-weight:bold; width:160px; float:left; line-height:23px; margin-left:-184px; }
23
- .metaboxes-tab label small { font-weight:normal; line-height:15px; font-style:italic; color:#999; display:block; }
24
- .metaboxes-tab input[type="text"], .metaboxes-tab select, .metaboxes-tab textarea { width:30%; }
25
- .metaboxes-tab input[type="checkbox"] { vertical-align: middle }
26
- .metaboxes-tab select {padding:0;}
27
- .metaboxes-tab input.button-secondary, .metaboxes-tab input.checkbox { width:auto; }
28
- .metaboxes-tab .description { color:#AFAFAF; font-size:90%; font-style:italic; line-height:23px; padding-left:5px; }
29
- .metaboxes-tab p.field-row.textarea .description { vertical-align:top; }
30
- .metaboxes-tab p.field-row.checkbox {background:none;}
31
-
32
- .metaboxes-tab .the-metabox { margin:20px 0; margin-left:184px;}
33
- .metaboxes-tab .the-metabox.no-label { margin:20px 0; margin-left:0;}
34
- .metaboxes-tab hr { height: 0px; border-top: 1px solid #dadada; width: auto; margin-left: -10px; margin-right: -10px; }
35
- .metaboxes-tab .the-metabox p { margin:0;}
36
- .metaboxes-tab .the-metabox:last-child { border-bottom: 0px; }
37
- .metaboxes-tab .the-metabox.checkbox { background:none; }
38
- .metaboxes-tab .the-metabox.slider .ui-slider { margin-right:15px; }
39
-
40
- .metaboxes-tab span.desc { font-size: 11px; color: #AFAFAF; }
41
- .metaboxes-tab span.desc.inline { display: inline-block; vertical-align: top; line-height: 23px; }
42
- .metaboxes-tab .onoff span.desc, .metaboxes-tab .onoff label { padding:6px 0; }
43
- .metaboxes-tab .select span.desc, .metaboxes-tab .select label { padding:2px 0; }
44
- .metaboxes-tab .slider span.desc, .metaboxes-tab .slider label { padding:15px 0; }
45
- .metaboxes-tab .slider span.desc { display:block; padding:20px 0; }
46
 
47
  .metaboxes-tab ul.metaboxes-tabs li {
48
- -webkit-border-top-left-radius: 3px;
49
- -webkit-border-top-right-radius: 3px;
50
- -moz-border-radius-topleft: 3px;
51
- -moz-border-radius-topright: 3px;
52
- border-top-left-radius: 3px;
53
- border-top-right-radius: 3px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
 
56
- /* image gallery */
57
- .metaboxes-tab .image-gallery ul li{
58
- display: inline-block;
59
- width: 80px;
60
- margin-left: 10px;
61
- position: relative;
62
  }
63
- .metaboxes-tab .image-gallery ul li img{
64
- width: 80px;
65
- border: 1px solid #ccc;
66
  }
67
- .metaboxes-tab .image-gallery ul li ul{
68
- position: absolute;
69
- top: -6px;
70
- right: -1px;
71
- width: 20px;
72
- height: 20px;
73
  }
74
- .metaboxes-tab .image-gallery ul a.delete{
75
- background: url(../images/x.png) no-repeat;
76
- width: 20px;
77
- height: 20px;
78
- display: block;
79
- text-indent: -99999px;
 
 
 
 
 
80
  }
81
- /* sidebar layout */
82
- .yit-sidebar-layout input[type="radio"] {
83
- display: none;
84
- width: 0px;
 
 
 
 
 
85
  }
86
- .yit-sidebar-layout input[type="radio"]:first-child {
87
- margin-right: -2px;
 
88
  }
89
 
90
- .yit-sidebar-layout input[type="radio"] + img {
91
- border: 2px solid #fff;
92
- padding: 1px;
93
  }
94
 
95
- .yit-sidebar-layout input[type="radio"] + img:hover {
96
- cursor: pointer;
97
  }
98
 
99
- .yit-sidebar-layout input[checked] + img {
100
- border: 2px solid #f2ad35;
101
- padding: 1px;
 
 
 
 
 
 
 
 
 
 
 
 
102
  }
103
 
104
- .yit-sidebar-layout select {
105
- vertical-align: 12px;
106
- width: inherit !important;
107
  }
108
 
109
  /* wp editor */
110
  .the-metabox.textarea-editor .mceIframeContainer {
111
- background:#fff;
112
  }
 
113
  .the-metabox.textarea-editor label {
114
- margin-top:24px;
115
  }
116
 
117
  /* categories */
118
- .categories-panel { width:30%; float:left; margin-right:4px; }
119
- .categories-panel .box { height:200px; border:1px solid #DFDFDF; background:#fff; padding:6px 10px; overflow: auto; }
120
- .categories-panel ul { list-style:none; margin:0; }
121
- .categories-panel ul li { line-height: 19px; margin: 0; padding: 0; word-wrap: break-word; }
122
- .categories-panel ul li label { font-weight:normal !important; margin-left:0 !important; }
123
- .categories-panel input.newcategory { width:100%; margin-bottom:3px; }
124
 
125
- /* contact form */
126
- .contactform_item {
127
- border-style: solid;
128
- border-width: 1px;
129
- line-height: 1;
130
- margin-bottom: 20px;
131
- padding: 0;
132
- background-color: #F5F5F5;
133
- background-image: -moz-linear-gradient(center top , #F9F9F9, #F5F5F5);
134
- border-color: #DFDFDF;
135
- border-radius: 3px 3px 3px 3px;
136
- box-shadow: 0 1px 0 #FFFFFF inset;
137
- min-width: 255px;
138
- position: relative;
139
- }
140
- .contactform_item .handlediv { position:relative; top: -4px; }
141
- .contactform_item h3 { min-height: 21px }
142
- .contactform_item .inside { padding: 10px !important; }
143
- .contactform_item .deps { display: none; }
144
- .contactform_item .addoptions p.option { margin: 5px 0 5px 200px }
145
- .contactform_item .addoptions p label { width: 80px !important; }
146
- .contactform_item .add-field-option { margin-bottom: 10px !important; }
147
- .remove_item { float: right; }
148
- .metabox-sortable-placeholder { border: 1px dotted #dedede; margin: 10px 0 }
149
 
150
- /* features tab */
151
- .featurestab_item{
152
- border-style: solid;
153
- border-width: 1px;
154
- line-height: 1;
155
- margin-bottom: 20px;
156
- padding: 0;
157
- background-color: #F5F5F5;
158
- background-image: -moz-linear-gradient(center top , #F9F9F9, #F5F5F5);
159
- border-color: #DFDFDF;
160
- border-radius: 3px 3px 3px 3px;
161
- box-shadow: 0 1px 0 #FFFFFF inset;
162
- min-width: 255px;
163
- position: relative;
164
  }
165
- .featurestab_item .handlediv { position:relative; top: -4px; }
166
- .featurestab_item h3 { min-height: 21px }
167
- .featurestab_item .inside { padding: 10px !important; }
168
- .featurestab_item .deps { display: none; }
169
- .featurestab_item .addoptions p.option { margin: 5px 0 5px 200px }
170
- .featurestab_item .addoptions p label { width: 80px !important; }
171
- .featurestab_item .add-field-option { margin-bottom: 10px !important; }
172
 
173
- /* slider */
174
- .the-metabox.slider { padding-top:20px; }
 
 
 
 
175
 
176
- /* on off */
177
- .the-metabox .rm_onoff span.onoff { float:left; margin-right:5px; margin-left:-4px; /* image fix */ }
 
 
178
 
179
- /* onoff */
180
- .rm_onoff input {
181
- display: none;
182
  }
183
 
184
- .rm_onoff input + span {
185
- cursor: pointer;
186
- text-indent: -9999px;
187
- display: block;
188
- width: 85px;
189
- height: 37px;
190
- background: transparent url(../images/off.png);
 
 
 
 
 
 
 
191
  }
192
 
193
- .rm_onoff input:checked + span {
194
- background: transparent url(../images/on.png);
 
195
  }
196
 
197
- .rm_onoff input.onoffchecked + span {
198
- background: transparent url(../images/on.png);
 
199
  }
200
 
201
- .messages-panel.updated {
202
- margin: 10px 0px 10px !important;
203
- max-width: 1200px;
204
- border-radius: 5px;
205
- -webkit-box-sizing: border-box;
206
- box-sizing: border-box;
207
  }
208
 
209
- .ui-widget-overlay { background-image: none !important; }
 
 
210
 
 
 
 
211
 
 
 
 
212
 
213
- /* select */
214
- .the-metabox .select_wrapper { width:341px; background-color:#fff; }
215
- .the-metabox .select_wrapper select { width:100%; }
216
- .the-metabox .icon_type{ width:30%; float: left; margin-right: 40px }
217
- .the-metabox .icon_type select, .the-metabox div.option .select_wrapper select{ width: 100% }
218
 
219
- #post-type-settings .category-list label { width: 187px; }
220
- .remove_cat { float: right; text-align:center; display: block; width: 20px; height: 20px; border-radius: 20px; font-weight: bold; font-size: 10px; background: #efefef; text-decoration: none; }
 
221
 
222
- .the-metabox .select_wrapper {
223
- background: url("../images/select.png") no-repeat scroll right center #FAFAFA;
224
- border-color: #CCCCCC #EEEEEE #EEEEEE #CCCCCC;
225
- border-radius: 4px 4px 4px 4px;
226
- border-style: solid;
227
- border-width: 1px;
228
- color: #555555;
229
- display: block;
230
- float: left;
231
- font-family: sans-serif;
232
- font-size: 12px;
233
- min-height: 26px;
234
- margin-bottom: 9px !important;
235
- margin-left: 0;
236
- margin-right: 5px;
237
- margin-top: 0;
238
- width: 400px;
239
- position: relative;
240
  }
241
 
242
- /*chosen*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
 
244
- .chosen .select_wrapper {
245
- background: none;
246
- border: none;
247
  }
248
- .chosen .select_wrapper .chosen-container{
249
- width: 338px!important;
 
250
  }
251
- .chosen .select_wrapper .chosen-container .search-field input{
252
- height: 27px!important;
253
- color: #333;
254
  }
255
- .chosen .select_wrapper .chosen-container .chosen-choices{
256
- border: 1px solid #ddd;
257
- box-shadow: none;
258
  }
259
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice{
260
- height: 15px!important;
261
- min-width: 105px;
262
  }
263
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice span{
264
- line-height: 15px;
265
- height: 15px;
266
- padding-top: 2px;
267
  }
268
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice a.search-choice-close{
269
- top: 5px;
 
270
  }
271
- .chosen .select_wrapper .chosen-container .chosen-drop .chosen-search input{
272
- width: 100%!important;
 
 
 
 
 
273
  }
274
- .select_wrapper span {
275
- height: 26px;
276
- line-height: 26px;
277
- padding-left: 6px;
278
- position: absolute;
279
- z-index: 2;
280
- overflow: hidden;
281
  }
282
 
283
- .the-metabox .select_wrapper select {
284
- cursor: pointer;
285
- height: 28px;
286
- margin: 0;
287
- opacity: 0;
288
- padding: 0;
289
- position: relative;
290
- width: inherit;
291
- z-index: 4;
292
- background-color: #FAFAFA;
293
  }
294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
 
296
  /* typography */
297
- .the-metabox.typography .select_wrapper.font-family { width:200px; }
298
- .the-metabox.typography .spinner_container { float:left; margin-right:10px; }
 
 
 
 
 
 
 
299
  .the-metabox.typography .spinner_container input.number {
300
- width:50px !important;
301
- -webkit-border-top-right-radius: 0px;
302
- -webkit-border-bottom-right-radius: 0px;
303
- -moz-border-radius-topright: 0px;
304
- -moz-border-radius-bottomright: 0px;
305
- border-top-right-radius: 0px;
306
- border-bottom-right-radius: 0px;
307
  }
308
 
309
  /* number */
310
- .the-metabox.number input.number { width:50px !important; }
 
 
 
311
  /* number */
312
  .rm_number .number {
313
- width: 70px;
314
- text-align: right;
315
- -webkit-border-top-right-radius: 0px;
316
- -webkit-border-bottom-right-radius: 0px;
317
- -moz-border-radius-topright: 0px;
318
- -moz-border-radius-bottomright: 0px;
319
- border-top-right-radius: 0px;
320
- border-bottom-right-radius: 0px;
321
  }
322
 
323
- .spinner-wrapper { position: relative; height: 23px; overflow: hidden; }
324
- .spinner-wrapper input.number { float: left; }
325
- .spinner-wrapper .spinner-button { cursor:pointer; float: left; position: absolute; left: 69px; width: 15px; height: 12px; border: 1px solid #DFDFDF; background: #fff; margin: 0; padding: 0; line-height: 9999px; overflow: hidden; background: url('../images/spinner.png') no-repeat center -11px }
326
- .spinner-wrapper .spinner-button.button-plus { top: 0; -webkit-border-top-right-radius: 3px !important; -moz-border-radius-topright: 3px !important; border-top-right-radius: 3px !important; }
327
- .spinner-wrapper .spinner-button.button-minus { bottom: 0; background-position: center -30px; -webkit-border-bottom-right-radius: 3px !important; -moz-border-radius-bottomright: 3px !important; border-bottom-right-radius: 3px !important; }
328
 
 
 
 
329
 
330
- .spinner-wrapper .spinner-button.button-plus:active { background-position: center 0px; }
331
- .spinner-wrapper .spinner-button.button-minus:active { background-position: center -20px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
332
 
 
 
 
 
 
 
333
 
334
- .rm_typography .spinner_container { float: left; margin-right: 10px; }
335
- .rm_typography .spinner-wrapper { height: 28px; }
336
- .rm_typography .spinner-wrapper input.number { height: 28px; }
337
- .rm_typography .spinner-wrapper .spinner-button.button-plus { height: 15px; background-position: center -10px; }
338
- .rm_typography .spinner-wrapper .spinner-button.button-minus { height: 14px; }
 
 
339
 
340
- .the-metabox .spinner-wrapper .spinner-button { left: 49px; }
341
- .the-metabox.typography .spinner-wrapper .spinner-button { left: 35px; }
 
342
 
343
- /* colorpicker */
344
- .the-metabox.colorpicker { display:block; width: auto; height: auto; overflow: visible; background-image: none; position: static; font-family: inherit;}
345
- .the-metabox.colorpicker input { background-color: transparent; border: 1px solid #DFDFDF; position: static; font-size: inherit; font-family: inherit; color: inherit; text-align: center; margin: 0 5px 0px; padding: 0; outline: none; width: auto; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
 
347
  /* images */
348
- .the-metabox.images, .the-metabox.images label { margin-left:0; display:block; }
349
- .the-metabox.images .slides-wrapper { clear:both; }
350
- .the-metabox.images .slides-wrapper li { position:relative; }
351
- .the-metabox.images a.delete { display:block; margin-left:4px; text-decoration:none; font-weight:bold; color:red; position:absolute; top:0; right:0; width:10px; height:18px; z-index:10; cursor:pointer !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
 
353
  /* wp editor */
354
- .wp_themeSkin iframe { background: #fff !important; }
 
 
355
 
356
  /* custom tabs */
357
  .customtab_item {
358
- border-style: solid;
359
- border-width: 1px;
360
- line-height: 1;
361
- margin-bottom: 20px;
362
- padding: 0;
363
- background-color: #F5F5F5;
364
- background-image: -moz-linear-gradient(center top , #F9F9F9, #F5F5F5);
365
- border-color: #DFDFDF;
366
- border-radius: 3px 3px 3px 3px;
367
- box-shadow: 0 1px 0 #FFFFFF inset;
368
- min-width: 255px;
369
- position: relative;
370
- }
371
- .customtab_item .handlediv { position:relative; top: -4px; }
372
- .customtab_item h3 { min-height: 21px }
373
- .customtab_item .inside { padding: 10px !important; }
374
- .customtab_item .deps { display: none; }
375
- .customtab_item .addoptions p.option { margin: 5px 0 5px 200px }
376
- .customtab_item .addoptions p label { width: 80px !important; }
377
- .customtab_item .add-field-option { margin-bottom: 10px !important; }
378
- .customtab_item .remove_item { float: right; }
379
- .metabox-sortable-placeholder { border: 1px dotted #dedede; margin: 10px 0 }
380
 
381
- .the-metabox.customtabs {
382
- margin-left: 0;
 
383
  }
384
 
385
- #customtab_item_sample {
386
- display: none;
387
  }
388
 
389
- .the-metabox.customtabs .field-row {
390
- margin-bottom: 10px;
391
  }
392
 
393
- #yit_custom_tabs label {
394
- font-weight: normal;
395
- width: auto;
396
- float: none;
397
- line-height: auto;
398
- margin-left: 0;
399
  }
400
 
 
 
 
401
 
402
- .wp-admin p label input[type=radio]{
403
- width: 16px;
404
- margin-right: 10px;
405
- margin-top: 3px;
406
  }
407
- .wp-admin .form-field._preset_onsale_icon_field label input[type=radio]{
408
- margin-top: 0;
 
409
  }
410
 
411
- .the-metabox .spinner {
412
- margin-top: 5px;
413
- float: none;
414
  }
415
 
416
- /* slider */
417
- /*numbers*/
418
- .ui-slider .maxCaption, .ui-slider .minCaption {
419
- margin-bottom: 5px;
420
  }
421
- .ui-slider .feedback {
422
- background: url(../images/slider/tooltip.png) no-repeat center top;
423
- position: absolute;
424
- top: -25px;
425
- width: 35px;
426
- height: 43px;
427
- text-align: center;
428
- width: 100%;
429
- display: block;
430
  }
431
- .ui-slider .feedback strong {
432
- display: inline-block;
433
- padding-top: 4px;
434
- top: -30px;
435
  }
436
- /*handle*/
437
- .ui-slider-horizontal .ui-slider-handle{
438
- background: transparent url(../images/slider/handle.png) no-repeat left top !important;
439
- border: 0px !important;
440
- top: -.35em !important;
441
- width: 18px !important;
442
- height: 19px !important;
443
  }
444
 
445
- /*bg on the left:grey*/
446
- .ui-slider.ui-widget-content {
447
- background: url(../images/slider/grey.gif) repeat-x left center !important;
448
- border-color: #c1c1c0 !important;
449
- height: 10px !important;
 
450
  }
451
 
452
- .iris-slider-offset.ui-slider.ui-widget-content {
453
- background: transparent!important;
454
- height: auto!important;
 
455
  }
456
 
457
- /*bg on the right:orange*/
458
- .ui-slider.ui-widget-content .ui-widget-header {
459
- background: url(../images/slider/orange.gif) repeat-x left center !important;
460
- left: 2px !important;
461
- -webkit-border-radius: 15px;
462
- -moz-border-radius: 15px;
463
- -khtml-border-radius: 15px;
464
- border-radius: 15px;
465
  }
466
 
 
 
 
 
467
 
468
  /*sidebars*/
469
-
470
- #choose-sidebars.choose{
471
- margin-left: 0px;
472
  }
473
 
474
-
475
- #_active_page_options-container label, #_active_page_options-container p{
476
- display: inline-block;
477
- margin: 0px;
478
- }
479
- #_active_page_options-container label{
480
- margin-right: 10px;
481
- margin-top: 3px;
482
- }
483
- #_active_page_options-container {
484
- float: right;
485
- margin-right: 20px;
486
- margin-top: 5px;
487
  }
488
 
489
- /* sortable table posts */
 
 
 
490
 
491
- #the-list.ui-sortable tr:hover {
492
- cursor: move;
493
- }
494
-
495
-
496
- /*datepicker*/
497
- /*! jQuery UI - v1.11.2 - 2015-01-21
498
- * http://jqueryui.com
499
- * Includes: core.css, datepicker.css, theme.css
500
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=0px&bgColorHeader=%23dddddd&bgTextureHeader=flat&bgImgOpacityHeader=60&borderColorHeader=%23aaaaaa&fcHeader=%23222222&iconColorHeader=%23222222&bgColorContent=%23ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=%23aaaaaa&fcContent=%23222222&iconColorContent=%23222222&bgColorDefault=%23e9e9e9&bgTextureDefault=flat&bgImgOpacityDefault=75&borderColorDefault=%23d3d3d3&fcDefault=%23555555&iconColorDefault=%23888888&bgColorHover=%23dadada&bgTextureHover=flat&bgImgOpacityHover=75&borderColorHover=%23999999&fcHover=%23212121&iconColorHover=%23454545&bgColorActive=%23ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=%23aaaaaa&fcActive=%23212121&iconColorActive=%23454545&bgColorHighlight=%23fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=%2389b17e&fcHighlight=%23363636&iconColorHighlight=%232e83ff&bgColorError=%23fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=%23cd0a0a&fcError=%23cd0a0a&iconColorError=%23cd0a0a&bgColorOverlay=%23aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
501
- * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
502
-
503
- /* Layout helpers
504
- ----------------------------------*/
505
- .ui-helper-hidden {
506
- display: none;
507
- }
508
- .ui-helper-hidden-accessible {
509
- border: 0;
510
- clip: rect(0 0 0 0);
511
- height: 1px;
512
- margin: -1px;
513
- overflow: hidden;
514
- padding: 0;
515
- position: absolute;
516
- width: 1px;
517
- }
518
- .ui-helper-reset {
519
- margin: 0;
520
- padding: 0;
521
- border: 0;
522
- outline: 0;
523
- line-height: 1.3;
524
- text-decoration: none;
525
- font-size: 100%;
526
- list-style: none;
527
- }
528
- .ui-helper-clearfix:before,
529
- .ui-helper-clearfix:after {
530
- content: "";
531
- display: table;
532
- border-collapse: collapse;
533
- }
534
- .ui-helper-clearfix:after {
535
- clear: both;
536
- }
537
- .ui-helper-clearfix {
538
- min-height: 0; /* support: IE7 */
539
- }
540
- .ui-helper-zfix {
541
- width: 100%;
542
- height: 100%;
543
- top: 0;
544
- left: 0;
545
- position: absolute;
546
- opacity: 0;
547
- filter:Alpha(Opacity=0); /* support: IE8 */
548
- }
549
-
550
- .ui-front {
551
- z-index: 100;
552
- }
553
-
554
-
555
- /* Interaction Cues
556
- ----------------------------------*/
557
- .ui-state-disabled {
558
- cursor: default !important;
559
- }
560
-
561
-
562
- /* Icons
563
- ----------------------------------*/
564
-
565
- /* states and images */
566
- .ui-icon {
567
- display: block;
568
- text-indent: -99999px;
569
- overflow: hidden;
570
- background-repeat: no-repeat;
571
- }
572
-
573
-
574
- /* DATE PICKER
575
- ----------------------------------*/
576
-
577
- .ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}
578
- .ui-datepicker{width:17em;padding:.2em .2em 0;display:none;z-index:100!important;}
579
- .ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}
580
- .ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}
581
- .ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}
582
- .ui-datepicker .ui-datepicker-prev{left:2px}
583
- .ui-datepicker .ui-datepicker-next{right:2px}
584
- .ui-datepicker .ui-datepicker-prev-hover{left:1px}
585
- .ui-datepicker .ui-datepicker-next-hover{right:1px}
586
- .ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}
587
- .ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}
588
- .ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}
589
- .ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}
590
- .ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}
591
- .ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}
592
- .ui-datepicker td{border:0;padding:1px}
593
- .ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}
594
- .ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}
595
- .ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}
596
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}
597
- .ui-datepicker.ui-datepicker-multi{width:auto}
598
- .ui-datepicker-multi .ui-datepicker-group{float:left}
599
- .ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}
600
- .ui-datepicker-multi-2 .ui-datepicker-group{width:50%}
601
- .ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}
602
- .ui-datepicker-multi-4 .ui-datepicker-group{width:25%}
603
- .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}
604
- .ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}
605
- .ui-datepicker-row-break{clear:both;width:100%;font-size:0}
606
- .ui-datepicker-rtl{direction:rtl}
607
- .ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}
608
- .ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}
609
- .ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}
610
- .ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}
611
- .ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}
612
- .ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}
613
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}
614
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}
615
- .ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}
616
- .ui-widget .ui-widget{font-size:1em}
617
- .ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}
618
- .ui-widget-content{border:1px solid #aaa;background:#fff 50% 50% repeat-x;color:#222}
619
- .ui-widget-content a{color:#222}
620
- .ui-widget-header{border:1px solid #aaa;background:#ddd 50% 50% repeat-x;color:#222;font-weight:700}
621
- .ui-widget-header a{color:#222}
622
- .ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:0 solid #d3d3d3;background:#e9e9e9 50% 50% repeat-x;font-weight:400;color:#555}
623
- .ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}
624
- .ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:0 solid #999;background:#dadada 50% 50% repeat-x;font-weight:400;color:#212121}
625
- .ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}
626
- .ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:0 solid #aaa;background:#fff 50% 50% repeat-x;font-weight:400;color:#212121}
627
- .ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}
628
- .ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:0 solid #89b17e;background:#fbf9ee 50% 50% repeat-x;color:#363636}
629
- .ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}
630
- .ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:0 solid #cd0a0a;background:#fef1ec 50% 50% repeat-x;color:#cd0a0a}
631
- .ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}
632
- .ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}
633
- .ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}
634
- .ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}
635
- .ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}
636
- .ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}
637
- .ui-icon{width:16px;height:16px}
638
- .ui-icon,.ui-widget-content .ui-icon{background-image:url(../images/ui-icons_222222_256x240.png)}
639
- .ui-widget-header .ui-icon{background-image:url(../images/ui-icons_222222_256x240.png)}
640
- .ui-state-default .ui-icon{background-image:url(../images/ui-icons_888888_256x240.png)}
641
- .ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(../images/ui-icons_454545_256x240.png)}
642
- .ui-state-active .ui-icon{background-image:url(../images/ui-icons_454545_256x240.png)}
643
- .ui-state-highlight .ui-icon{background-image:url(../images/ui-icons_2e83ff_256x240.png)}
644
- .ui-icon-circle-triangle-e{background-position:-48px -192px}
645
- .ui-icon-circle-triangle-s{background-position:-64px -192px}
646
- .ui-icon-circle-triangle-w{background-position:-80px -192px}
647
- .ui-icon-circle-triangle-n{background-position:-96px -192px}
648
- .ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:0}
649
- .ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:0}
650
- .ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:0}
651
- .ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:0}
652
- .ui-widget-overlay{background:#aaa 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}
653
- .ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
654
-
655
-
656
- .the-metabox.preview{
657
- float: none;
658
- }
659
- .metaboxes-tab .the-metabox.no-label.preview{
660
- margin-left: 184px;
661
- }
662
- .metaboxes-tab .the-metabox.no-label.preview img{
663
- box-shadow: 0 1px 8px rgba(0,0,0,0.2);
664
  }
1
  /* self-clear floats */
2
+ .clearfix:after {
3
+ content : ".";
4
+ display : block;
5
+ height : 0;
6
+ clear : both;
7
+ visibility : hidden;
8
+ overflow : hidden;
9
+ }
10
+
11
  /* ie.css */
12
  * html .clearfix { /* IE6 */
13
+ height : 1%;
14
  }
15
+
16
+ *:first-child + html .clearfix { /* IE7 */
17
+ min-height : 1%;
18
  }
19
 
20
+ .clearboth {
21
+ clear : both
22
+ }
23
 
24
  /* === TAB STYLE */
25
+ .metaboxes-tab {
26
+ margin : -6px -12px -8px;
27
+ }
28
+
29
+ .metaboxes-tab div.tabs-panel {
30
+ height : auto;
31
+ overflow : visible;
32
+ margin-top : 0px;
33
+ padding : 0 10px;
34
+ background : none;
35
+ border : 0;
36
+ }
37
+
38
+ .metaboxes-tab ul.metaboxes-tabs {
39
+ background : #f1f1f1;
40
+ margin : 0;
41
+ padding : 10px 0 0 5px;
42
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  .metaboxes-tab ul.metaboxes-tabs li {
45
+ float : left;
46
+ background : #dedede;
47
+ margin : 0 0 0 5px;
48
+ }
49
+
50
+ .metaboxes-tab ul.metaboxes-tabs li a {
51
+ color : #555;
52
+ text-decoration : none;
53
+ padding : 8px 15px;
54
+ display : block;
55
+ box-shadow : none !important;
56
+ }
57
+
58
+ .metaboxes-tab ul.metaboxes-tabs li.tabs {
59
+ background : #fff;
60
+ }
61
+
62
+ .metaboxes-tab p.field-row {
63
+ margin : 20px 0;
64
+ }
65
+
66
+ .metaboxes-tab div.sep {
67
+ height : 1px;
68
+ background : #dfdfdf;
69
+ clear : both;
70
+ margin-left : -10px;
71
+ margin-right : -10px;
72
+ }
73
+
74
+ .metaboxes-tab label {
75
+ font-weight : bold;
76
+ width : 160px;
77
+ float : left;
78
+ line-height : 23px;
79
+ margin-left : -184px;
80
+ }
81
+
82
+ .metaboxes-tab label small {
83
+ font-weight : normal;
84
+ line-height : 15px;
85
+ font-style : italic;
86
+ color : #999;
87
+ display : block;
88
+ }
89
+
90
+ .metaboxes-tab .wp-picker-container label {
91
+ font-weight : inherit;
92
+ width : auto;
93
+ float : none;
94
+ line-height : inherit;
95
+ margin-left : 0;
96
+ }
97
+
98
+ .metaboxes-tab input[type="checkbox"] {
99
+ vertical-align : middle
100
+ }
101
+
102
+ .metaboxes-tab input.button-secondary, .metaboxes-tab input.checkbox {
103
+ width : auto;
104
+ }
105
+
106
+ .metaboxes-tab p.field-row.textarea .description {
107
+ vertical-align : top;
108
+ }
109
+
110
+ .metaboxes-tab p.field-row.checkbox {
111
+ background : none;
112
+ }
113
+
114
+ .metaboxes-tab .the-metabox {
115
+ margin : 20px 0;
116
+ margin-left : 184px;
117
+ }
118
+
119
+ .metaboxes-tab .the-metabox.no-label {
120
+ margin : 20px 0;
121
+ margin-left : 0;
122
  }
123
 
124
+ .metaboxes-tab hr {
125
+ height : 0px;
126
+ border-top : 1px solid #dadada;
127
+ width : auto;
128
+ margin-left : -10px;
129
+ margin-right : -10px;
130
  }
131
+
132
+ .metaboxes-tab .the-metabox p {
133
+ margin : 0;
134
  }
135
+
136
+ .metaboxes-tab .the-metabox:last-child {
137
+ border-bottom : 0px;
 
 
 
138
  }
139
+
140
+ .metaboxes-tab .the-metabox.checkbox {
141
+ background : none;
142
+ }
143
+
144
+ .metaboxes-tab span.description.inline {
145
+ display : inline-block;
146
+ line-height : 23px;
147
+ width : auto;
148
+ vertical-align : middle;
149
+ margin : 0;
150
  }
151
+
152
+ .metaboxes-tab .slider label {
153
+ padding : 15px 0;
154
+ }
155
+
156
+ /* sortable table posts */
157
+
158
+ #the-list.ui-sortable tr:hover {
159
+ cursor : move;
160
  }
161
+
162
+ .the-metabox.preview {
163
+ float : none;
164
  }
165
 
166
+ .metaboxes-tab .the-metabox.no-label.preview {
167
+ margin-left : 184px;
 
168
  }
169
 
170
+ .metaboxes-tab .the-metabox.no-label.preview img {
171
+ box-shadow : 0 1px 8px rgba(0, 0, 0, 0.2);
172
  }
173
 
174
+ /**************************************
175
+ FIELDS
176
+ ***************************************/
177
+
178
+ .metaboxes-tab select,
179
+ .metaboxes-tab input[type=text],
180
+ .metaboxes-tab input[type=number],
181
+ .metaboxes-tab textarea,
182
+ .metaboxes-tab .yith-plugin-fw-select,
183
+ .metaboxes-tab .yith-plugin-fw-slider-container,
184
+ .metaboxes-tab .yith-plugin-fw-text-input,
185
+ .metaboxes-tab .yith-plugin-fw-text-array-table,
186
+ .metaboxes-tab .yith-plugin-fw-textarea {
187
+ width : 400px;
188
+ max-width : 100%;
189
  }
190
 
191
+ .metaboxes-tab .yith-plugin-fw-text-array-table input[type=text] {
192
+ width : 100%;
 
193
  }
194
 
195
  /* wp editor */
196
  .the-metabox.textarea-editor .mceIframeContainer {
197
+ background : #fff;
198
  }
199
+
200
  .the-metabox.textarea-editor label {
201
+ margin-top : 24px;
202
  }
203
 
204
  /* categories */
205
+ .categories-panel {
206
+ width : 30%;
207
+ float : left;
208
+ margin-right : 4px;
209
+ }
 
210
 
211
+ .categories-panel .box {
212
+ height : 200px;
213
+ border : 1px solid #dfdfdf;
214
+ background : #fff;
215
+ padding : 6px 10px;
216
+ overflow : auto;
217
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
 
219
+ .categories-panel ul {
220
+ list-style : none;
221
+ margin : 0;
 
 
 
 
 
 
 
 
 
 
 
222
  }
 
 
 
 
 
 
 
223
 
224
+ .categories-panel ul li {
225
+ line-height : 19px;
226
+ margin : 0;
227
+ padding : 0;
228
+ word-wrap : break-word;
229
+ }
230
 
231
+ .categories-panel ul li label {
232
+ font-weight : normal !important;
233
+ margin-left : 0 !important;
234
+ }
235
 
236
+ .categories-panel input.newcategory {
237
+ width : 100%;
238
+ margin-bottom : 3px;
239
  }
240
 
241
+ /* contact form */
242
+ .contactform_item {
243
+ border-style : solid;
244
+ border-width : 1px;
245
+ line-height : 1;
246
+ margin-bottom : 20px;
247
+ padding : 0;
248
+ background-color : #f5f5f5;
249
+ background-image : -moz-linear-gradient(center top, #f9f9f9, #f5f5f5);
250
+ border-color : #dfdfdf;
251
+ border-radius : 3px 3px 3px 3px;
252
+ box-shadow : 0 1px 0 #fff inset;
253
+ min-width : 255px;
254
+ position : relative;
255
  }
256
 
257
+ .contactform_item .handlediv {
258
+ position : relative;
259
+ top : -4px;
260
  }
261
 
262
+ .contactform_item h3 {
263
+ min-height : 21px;
264
+ margin : 13px;
265
  }
266
 
267
+ .contactform_item .inside {
268
+ padding : 10px !important;
 
 
 
 
269
  }
270
 
271
+ .contactform_item .deps {
272
+ display : none;
273
+ }
274
 
275
+ .contactform_item .addoptions p.option {
276
+ margin : 5px 0 5px 200px
277
+ }
278
 
279
+ .contactform_item .addoptions p label {
280
+ width : 80px !important;
281
+ }
282
 
283
+ .contactform_item .add-field-option {
284
+ margin-bottom : 10px !important;
285
+ }
 
 
286
 
287
+ .remove_item {
288
+ float : right;
289
+ }
290
 
291
+ .metabox-sortable-placeholder {
292
+ border : 1px dotted #dedede;
293
+ margin : 10px 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  }
295
 
296
+ /* features tab */
297
+ .featurestab_item {
298
+ border-style : solid;
299
+ border-width : 1px;
300
+ line-height : 1;
301
+ margin-bottom : 20px;
302
+ padding : 0;
303
+ background-color : #f5f5f5;
304
+ background-image : -moz-linear-gradient(center top, #f9f9f9, #f5f5f5);
305
+ border-color : #dfdfdf;
306
+ border-radius : 3px 3px 3px 3px;
307
+ box-shadow : 0 1px 0 #fff inset;
308
+ min-width : 255px;
309
+ position : relative;
310
+ }
311
 
312
+ .featurestab_item .handlediv {
313
+ position : relative;
314
+ top : -4px;
315
  }
316
+
317
+ .featurestab_item h3 {
318
+ min-height : 21px
319
  }
320
+
321
+ .featurestab_item .inside {
322
+ padding : 10px !important;
323
  }
324
+
325
+ .featurestab_item .deps {
326
+ display : none;
327
  }
328
+
329
+ .featurestab_item .addoptions p.option {
330
+ margin : 5px 0 5px 200px
331
  }
332
+
333
+ .featurestab_item .addoptions p label {
334
+ width : 80px !important;
 
335
  }
336
+
337
+ .featurestab_item .add-field-option {
338
+ margin-bottom : 10px !important;
339
  }
340
+
341
+ .messages-panel.updated {
342
+ margin : 10px 0px 10px !important;
343
+ max-width : 1200px;
344
+ border-radius : 5px;
345
+ -webkit-box-sizing : border-box;
346
+ box-sizing : border-box;
347
  }
348
+
349
+ .ui-widget-overlay {
350
+ background-image : none !important;
 
 
 
 
351
  }
352
 
353
+ .the-metabox .icon_type {
354
+ width : 30%;
355
+ float : left;
356
+ margin-right : 40px
 
 
 
 
 
 
357
  }
358
 
359
+ #post-type-settings .category-list label {
360
+ width : 187px;
361
+ }
362
+
363
+ .remove_cat {
364
+ float : right;
365
+ text-align : center;
366
+ display : block;
367
+ width : 20px;
368
+ height : 20px;
369
+ border-radius : 20px;
370
+ font-weight : bold;
371
+ font-size : 10px;
372
+ background : #efefef;
373
+ text-decoration : none;
374
+ }
375
 
376
  /* typography */
377
+ .the-metabox.typography .select_wrapper.font-family {
378
+ width : 200px;
379
+ }
380
+
381
+ .the-metabox.typography .spinner_container {
382
+ float : left;
383
+ margin-right : 10px;
384
+ }
385
+
386
  .the-metabox.typography .spinner_container input.number {
387
+ width : 50px !important;
388
+ -webkit-border-top-right-radius : 0px;
389
+ -webkit-border-bottom-right-radius : 0px;
390
+ -moz-border-radius-topright : 0px;
391
+ -moz-border-radius-bottomright : 0px;
392
+ border-top-right-radius : 0px;
393
+ border-bottom-right-radius : 0px;
394
  }
395
 
396
  /* number */
397
+ .the-metabox.number input.number {
398
+ width : 50px !important;
399
+ }
400
+
401
  /* number */
402
  .rm_number .number {
403
+ width : 70px;
404
+ text-align : right;
405
+ -webkit-border-top-right-radius : 0px;
406
+ -webkit-border-bottom-right-radius : 0px;
407
+ -moz-border-radius-topright : 0px;
408
+ -moz-border-radius-bottomright : 0px;
409
+ border-top-right-radius : 0px;
410
+ border-bottom-right-radius : 0px;
411
  }
412
 
413
+ .spinner-wrapper {
414
+ position : relative;
415
+ height : 23px;
416
+ overflow : hidden;
417
+ }
418
 
419
+ .spinner-wrapper input.number {
420
+ float : left;
421
+ }
422
 
423
+ .spinner-wrapper .spinner-button {
424
+ cursor : pointer;
425
+ float : left;
426
+ position : absolute;
427
+ left : 69px;
428
+ width : 15px;
429
+ height : 12px;
430
+ border : 1px solid #dfdfdf;
431
+ background : #fff;
432
+ margin : 0;
433
+ padding : 0;
434
+ line-height : 9999px;
435
+ overflow : hidden;
436
+ background : url('../images/spinner.png') no-repeat center -11px
437
+ }
438
 
439
+ .spinner-wrapper .spinner-button.button-plus {
440
+ top : 0;
441
+ -webkit-border-top-right-radius : 3px !important;
442
+ -moz-border-radius-topright : 3px !important;
443
+ border-top-right-radius : 3px !important;
444
+ }
445
 
446
+ .spinner-wrapper .spinner-button.button-minus {
447
+ bottom : 0;
448
+ background-position : center -30px;
449
+ -webkit-border-bottom-right-radius : 3px !important;
450
+ -moz-border-radius-bottomright : 3px !important;
451
+ border-bottom-right-radius : 3px !important;
452
+ }
453
 
454
+ .spinner-wrapper .spinner-button.button-plus:active {
455
+ background-position : center 0px;
456
+ }
457
 
458
+ .spinner-wrapper .spinner-button.button-minus:active {
459
+ background-position : center -20px;
460
+ }
461
+
462
+ .rm_typography .spinner_container {
463
+ float : left;
464
+ margin-right : 10px;
465
+ }
466
+
467
+ .rm_typography .spinner-wrapper {
468
+ height : 28px;
469
+ }
470
+
471
+ .rm_typography .spinner-wrapper input.number {
472
+ height : 28px;
473
+ }
474
+
475
+ .rm_typography .spinner-wrapper .spinner-button.button-plus {
476
+ height : 15px;
477
+ background-position : center -10px;
478
+ }
479
+
480
+ .rm_typography .spinner-wrapper .spinner-button.button-minus {
481
+ height : 14px;
482
+ }
483
+
484
+ .the-metabox .spinner-wrapper .spinner-button {
485
+ left : 49px;
486
+ }
487
+
488
+ .the-metabox.typography .spinner-wrapper .spinner-button {
489
+ left : 35px;
490
+ }
491
 
492
  /* images */
493
+ .the-metabox.images, .the-metabox.images label {
494
+ margin-left : 0;
495
+ display : block;
496
+ }
497
+
498
+ .the-metabox.images .slides-wrapper {
499
+ clear : both;
500
+ }
501
+
502
+ .the-metabox.images .slides-wrapper li {
503
+ position : relative;
504
+ }
505
+
506
+ .the-metabox.images a.delete {
507
+ display : block;
508
+ margin-left : 4px;
509
+ text-decoration : none;
510
+ font-weight : bold;
511
+ color : red;
512
+ position : absolute;
513
+ top : 0;
514
+ right : 0;
515
+ width : 10px;
516
+ height : 18px;
517
+ z-index : 10;
518
+ cursor : pointer !important;
519
+ }
520
 
521
  /* wp editor */
522
+ .wp_themeSkin iframe {
523
+ background : #fff !important;
524
+ }
525
 
526
  /* custom tabs */
527
  .customtab_item {
528
+ border-style : solid;
529
+ border-width : 1px;
530
+ line-height : 1;
531
+ margin-bottom : 20px;
532
+ padding : 0;
533
+ background-color : #f5f5f5;
534
+ background-image : -moz-linear-gradient(center top, #f9f9f9, #f5f5f5);
535
+ border-color : #dfdfdf;
536
+ border-radius : 3px 3px 3px 3px;
537
+ box-shadow : 0 1px 0 #fff inset;
538
+ min-width : 255px;
539
+ position : relative;
540
+ }
 
 
 
 
 
 
 
 
 
541
 
542
+ .customtab_item .handlediv {
543
+ position : relative;
544
+ top : -4px;
545
  }
546
 
547
+ .customtab_item h3 {
548
+ min-height : 21px
549
  }
550
 
551
+ .customtab_item .inside {
552
+ padding : 10px !important;
553
  }
554
 
555
+ .customtab_item .deps {
556
+ display : none;
 
 
 
 
557
  }
558
 
559
+ .customtab_item .addoptions p.option {
560
+ margin : 5px 0 5px 200px
561
+ }
562
 
563
+ .customtab_item .addoptions p label {
564
+ width : 80px !important;
 
 
565
  }
566
+
567
+ .customtab_item .add-field-option {
568
+ margin-bottom : 10px !important;
569
  }
570
 
571
+ .customtab_item .remove_item {
572
+ float : right;
 
573
  }
574
 
575
+ .metabox-sortable-placeholder {
576
+ border : 1px dotted #dedede;
577
+ margin : 10px 0
 
578
  }
579
+
580
+ .the-metabox.customtabs {
581
+ margin-left : 0;
 
 
 
 
 
 
582
  }
583
+
584
+ #customtab_item_sample {
585
+ display : none;
 
586
  }
587
+
588
+ .the-metabox.customtabs .field-row {
589
+ margin-bottom : 10px;
 
 
 
 
590
  }
591
 
592
+ #yit_custom_tabs label {
593
+ font-weight : normal;
594
+ width : auto;
595
+ float : none;
596
+ line-height : auto;
597
+ margin-left : 0;
598
  }
599
 
600
+ .wp-admin p label input[type=radio] {
601
+ width : 16px;
602
+ margin-right : 10px;
603
+ margin-top : 3px;
604
  }
605
 
606
+ .wp-admin .form-field._preset_onsale_icon_field label input[type=radio] {
607
+ margin-top : 0;
 
 
 
 
 
 
608
  }
609
 
610
+ .the-metabox .spinner {
611
+ margin-top : 5px;
612
+ float : none;
613
+ }
614
 
615
  /*sidebars*/
616
+ #choose-sidebars.choose {
617
+ margin-left : 0px;
 
618
  }
619
 
620
+ #_active_page_options-container label, #_active_page_options-container p {
621
+ display : inline-block;
622
+ margin : 0px;
 
 
 
 
 
 
 
 
 
 
623
  }
624
 
625
+ #_active_page_options-container label {
626
+ margin-right : 10px;
627
+ margin-top : 3px;
628
+ }
629
 
630
+ #_active_page_options-container {
631
+ float : right;
632
+ margin-right : 20px;
633
+ margin-top : 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
634
  }
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_diagonals-thick_18_b81900_40x40.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_flat_10_000000_40x100.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_100_f6f6f6_1x400.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_100_fdf5ce_1x400.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_65_ffffff_1x400.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_gloss-wave_35_f6a828_500x100.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_highlight-soft_100_eeeeee_1x100.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_highlight-soft_75_ffe45c_1x100.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_222222_256x240.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_228ef1_256x240.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ef8c08_256x240.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ffd27a_256x240.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ffffff_256x240.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-bg_flat_0_aaaaaa_40x100.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-bg_flat_0_eeeeee_40x100.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-bg_flat_55_c0402a_40x100.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-bg_flat_55_eeeeee_40x100.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-bg_glass_100_f8f8f8_1x400.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-bg_glass_35_dddddd_1x400.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-bg_glass_60_eeeeee_1x400.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-bg_inset-hard_75_999999_1x100.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-bg_inset-soft_50_c9c9c9_1x100.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-icons_3383bb_256x240.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-icons_454545_256x240.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-icons_70b2e1_256x240.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-icons_999999_256x240.png DELETED
Binary file
plugin-fw/assets/css/overcast/images/ui-icons_fbc856_256x240.png DELETED
Binary file
plugin-fw/assets/css/overcast/jquery-ui-custom/jquery-ui-1.8.9.custom.css DELETED
@@ -1,578 +0,0 @@
1
- /*
2
- * jQuery UI CSS Framework 1.8.13
3
- *
4
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT or GPL Version 2 licenses.
6
- * http://jquery.org/license
7
- *
8
- * http://docs.jquery.com/UI/Theming/API
9
- */
10
-
11
- /* Layout helpers
12
- ----------------------------------*/
13
- .ui-helper-hidden { display: none; }
14
- .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
- .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
- .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
- .ui-helper-clearfix { display: inline-block; }
18
- /* required comment for clearfix to work in Opera \*/
19
- * html .ui-helper-clearfix { height:1%; }
20
- .ui-helper-clearfix { display:block; }
21
- /* end clearfix */
22
- .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23
-
24
-
25
- /* Interaction Cues
26
- ----------------------------------*/
27
- .ui-state-disabled { cursor: default !important; }
28
-
29
-
30
- /* Icons
31
- ----------------------------------*/
32
-
33
- /* states and images */
34
- .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
35
-
36
-
37
- /* Misc visuals
38
- ----------------------------------*/
39
-
40
- /* Overlays */
41
- .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42
-
43
-
44
- /*
45
- * jQuery UI CSS Framework 1.8.13
46
- *
47
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
48
- * Dual licensed under the MIT or GPL Version 2 licenses.
49
- * http://jquery.org/license
50
- *
51
- * http://docs.jquery.com/UI/Theming/API
52
- *
53
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
54
- */
55
-
56
-
57
- /* Component containers
58
- ----------------------------------*/
59
- .ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
60
- .ui-widget .ui-widget { font-size: 1em; }
61
- .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
62
- .ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(../images/jquery_ui/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; }
63
- .ui-widget-content a { color: #333333; }
64
- .ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(../images/jquery_ui/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
65
- .ui-widget-header a { color: #ffffff; }
66
-
67
- /* Interaction states
68
- ----------------------------------*/
69
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(../images/jquery_ui/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
70
- .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
71
- .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(../images/jquery_ui/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; }
72
- .ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; }
73
- .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(../images/jquery_ui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
74
- .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; }
75
- .ui-widget :active { outline: none; }
76
-
77
- /* Interaction Cues
78
- ----------------------------------*/
79
- .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(../images/jquery_ui/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; }
80
- .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
81
- .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(../images/jquery_ui/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; }
82
- .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
83
- .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
84
- .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
85
- .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
86
- .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
87
-
88
- /* Icons
89
- ----------------------------------*/
90
-
91
- /* states and images */
92
- .ui-icon { width: 16px; height: 16px; background-image: url(../images/jquery_ui/ui-icons_222222_256x240.png); }
93
- .ui-widget-content .ui-icon {background-image: url(../images/jquery_ui/ui-icons_222222_256x240.png); }
94
- .ui-widget-header .ui-icon {background-image: url(../images/jquery_ui/ui-icons_ffffff_256x240.png); }
95
- .ui-state-default .ui-icon { background-image: url(../images/jquery_ui/ui-icons_ef8c08_256x240.png); }
96
- .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../images/jquery_ui/ui-icons_ef8c08_256x240.png); }
97
- .ui-state-active .ui-icon {background-image: url(../images/jquery_ui/ui-icons_ef8c08_256x240.png); }
98
- .ui-state-highlight .ui-icon {background-image: url(../images/jquery_ui/ui-icons_228ef1_256x240.png); }
99
- .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(../images/jquery_ui/ui-icons_ffd27a_256x240.png); }
100
-
101
- /* positioning */
102
- .ui-icon-carat-1-n { background-position: 0 0; }
103
- .ui-icon-carat-1-ne { background-position: -16px 0; }
104
- .ui-icon-carat-1-e { background-position: -32px 0; }
105
- .ui-icon-carat-1-se { background-position: -48px 0; }
106
- .ui-icon-carat-1-s { background-position: -64px 0; }
107
- .ui-icon-carat-1-sw { background-position: -80px 0; }
108
- .ui-icon-carat-1-w { background-position: -96px 0; }
109
- .ui-icon-carat-1-nw { background-position: -112px 0; }
110
- .ui-icon-carat-2-n-s { background-position: -128px 0; }
111
- .ui-icon-carat-2-e-w { background-position: -144px 0; }
112
- .ui-icon-triangle-1-n { background-position: 0 -16px; }
113
- .ui-icon-triangle-1-ne { background-position: -16px -16px; }
114
- .ui-icon-triangle-1-e { background-position: -32px -16px; }
115
- .ui-icon-triangle-1-se { background-position: -48px -16px; }
116
- .ui-icon-triangle-1-s { background-position: -64px -16px; }
117
- .ui-icon-triangle-1-sw { background-position: -80px -16px; }
118
- .ui-icon-triangle-1-w { background-position: -96px -16px; }
119
- .ui-icon-triangle-1-nw { background-position: -112px -16px; }
120
- .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
121
- .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
122
- .ui-icon-arrow-1-n { background-position: 0 -32px; }
123
- .ui-icon-arrow-1-ne { background-position: -16px -32px; }
124
- .ui-icon-arrow-1-e { background-position: -32px -32px; }
125
- .ui-icon-arrow-1-se { background-position: -48px -32px; }
126
- .ui-icon-arrow-1-s { background-position: -64px -32px; }
127
- .ui-icon-arrow-1-sw { background-position: -80px -32px; }
128
- .ui-icon-arrow-1-w { background-position: -96px -32px; }
129
- .ui-icon-arrow-1-nw { background-position: -112px -32px; }
130
- .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
131
- .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
132
- .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
133
- .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
134
- .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
135
- .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
136
- .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
137
- .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
138
- .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
139
- .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
140
- .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
141
- .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
142
- .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
143
- .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
144
- .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
145
- .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
146
- .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
147
- .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
148
- .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
149
- .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
150
- .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
151
- .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
152
- .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
153
- .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
154
- .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
155
- .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
156
- .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
157
- .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
158
- .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
159
- .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
160
- .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
161
- .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
162
- .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
163
- .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
164
- .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
165
- .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
166
- .ui-icon-arrow-4 { background-position: 0 -80px; }
167
- .ui-icon-arrow-4-diag { background-position: -16px -80px; }
168
- .ui-icon-extlink { background-position: -32px -80px; }
169
- .ui-icon-newwin { background-position: -48px -80px; }
170
- .ui-icon-refresh { background-position: -64px -80px; }
171
- .ui-icon-shuffle { background-position: -80px -80px; }
172
- .ui-icon-transfer-e-w { background-position: -96px -80px; }
173
- .ui-icon-transferthick-e-w { background-position: -112px -80px; }
174
- .ui-icon-folder-collapsed { background-position: 0 -96px; }
175
- .ui-icon-folder-open { background-position: -16px -96px; }
176
- .ui-icon-document { background-position: -32px -96px; }
177
- .ui-icon-document-b { background-position: -48px -96px; }
178
- .ui-icon-note { background-position: -64px -96px; }
179
- .ui-icon-mail-closed { background-position: -80px -96px; }
180
- .ui-icon-mail-open { background-position: -96px -96px; }
181
- .ui-icon-suitcase { background-position: -112px -96px; }
182
- .ui-icon-comment { background-position: -128px -96px; }
183
- .ui-icon-person { background-position: -144px -96px; }
184
- .ui-icon-print { background-position: -160px -96px; }
185
- .ui-icon-trash { background-position: -176px -96px; }
186
- .ui-icon-locked { background-position: -192px -96px; }
187
- .ui-icon-unlocked { background-position: -208px -96px; }
188
- .ui-icon-bookmark { background-position: -224px -96px; }
189
- .ui-icon-tag { background-position: -240px -96px; }
190
- .ui-icon-home { background-position: 0 -112px; }
191
- .ui-icon-flag { background-position: -16px -112px; }
192
- .ui-icon-calendar { background-position: -32px -112px; }
193
- .ui-icon-cart { background-position: -48px -112px; }
194
- .ui-icon-pencil { background-position: -64px -112px; }
195
- .ui-icon-clock { background-position: -80px -112px; }
196
- .ui-icon-disk { background-position: -96px -112px; }
197
- .ui-icon-calculator { background-position: -112px -112px; }
198
- .ui-icon-zoomin { background-position: -128px -112px; }
199
- .ui-icon-zoomout { background-position: -144px -112px; }
200
- .ui-icon-search { background-position: -160px -112px; }
201
- .ui-icon-wrench { background-position: -176px -112px; }
202
- .ui-icon-gear { background-position: -192px -112px; }
203
- .ui-icon-heart { background-position: -208px -112px; }
204
- .ui-icon-star { background-position: -224px -112px; }
205
- .ui-icon-link { background-position: -240px -112px; }
206
- .ui-icon-cancel { background-position: 0 -128px; }
207
- .ui-icon-plus { background-position: -16px -128px; }
208
- .ui-icon-plusthick { background-position: -32px -128px; }
209
- .ui-icon-minus { background-position: -48px -128px; }
210
- .ui-icon-minusthick { background-position: -64px -128px; }
211
- .ui-icon-close { background-position: -80px -128px; }
212
- .ui-icon-closethick { background-position: -96px -128px; }
213
- .ui-icon-key { background-position: -112px -128px; }
214
- .ui-icon-lightbulb { background-position: -128px -128px; }
215
- .ui-icon-scissors { background-position: -144px -128px; }
216
- .ui-icon-clipboard { background-position: -160px -128px; }
217
- .ui-icon-copy { background-position: -176px -128px; }
218
- .ui-icon-contact { background-position: -192px -128px; }
219
- .ui-icon-image { background-position: -208px -128px; }
220
- .ui-icon-video { background-position: -224px -128px; }
221
- .ui-icon-script { background-position: -240px -128px; }
222
- .ui-icon-alert { background-position: 0 -144px; }
223
- .ui-icon-info { background-position: -16px -144px; }
224
- .ui-icon-notice { background-position: -32px -144px; }
225
- .ui-icon-help { background-position: -48px -144px; }
226
- .ui-icon-check { background-position: -64px -144px; }
227
- .ui-icon-bullet { background-position: -80px -144px; }
228
- .ui-icon-radio-off { background-position: -96px -144px; }
229
- .ui-icon-radio-on { background-position: -112px -144px; }
230
- .ui-icon-pin-w { background-position: -128px -144px; }
231
- .ui-icon-pin-s { background-position: -144px -144px; }
232
- .ui-icon-play { background-position: 0 -160px; }
233
- .ui-icon-pause { background-position: -16px -160px; }
234
- .ui-icon-seek-next { background-position: -32px -160px; }
235
- .ui-icon-seek-prev { background-position: -48px -160px; }
236
- .ui-icon-seek-end { background-position: -64px -160px; }
237
- .ui-icon-seek-start { background-position: -80px -160px; }
238
- /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
239
- .ui-icon-seek-first { background-position: -80px -160px; }
240
- .ui-icon-stop { background-position: -96px -160px; }
241
- .ui-icon-eject { background-position: -112px -160px; }
242
- .ui-icon-volume-off { background-position: -128px -160px; }
243
- .ui-icon-volume-on { background-position: -144px -160px; }
244
- .ui-icon-power { background-position: 0 -176px; }
245
- .ui-icon-signal-diag { background-position: -16px -176px; }
246
- .ui-icon-signal { background-position: -32px -176px; }
247
- .ui-icon-battery-0 { background-position: -48px -176px; }
248
- .ui-icon-battery-1 { background-position: -64px -176px; }
249
- .ui-icon-battery-2 { background-position: -80px -176px; }
250
- .ui-icon-battery-3 { background-position: -96px -176px; }
251
- .ui-icon-circle-plus { background-position: 0 -192px; }
252
- .ui-icon-circle-minus { background-position: -16px -192px; }
253
- .ui-icon-circle-close { background-position: -32px -192px; }
254
- .ui-icon-circle-triangle-e { background-position: -48px -192px; }
255
- .ui-icon-circle-triangle-s { background-position: -64px -192px; }
256
- .ui-icon-circle-triangle-w { background-position: -80px -192px; }
257
- .ui-icon-circle-triangle-n { background-position: -96px -192px; }
258
- .ui-icon-circle-arrow-e { background-position: -112px -192px; }
259
- .ui-icon-circle-arrow-s { background-position: -128px -192px; }
260
- .ui-icon-circle-arrow-w { background-position: -144px -192px; }
261
- .ui-icon-circle-arrow-n { background-position: -160px -192px; }
262
- .ui-icon-circle-zoomin { background-position: -176px -192px; }
263
- .ui-icon-circle-zoomout { background-position: -192px -192px; }
264
- .ui-icon-circle-check { background-position: -208px -192px; }
265
- .ui-icon-circlesmall-plus { background-position: 0 -208px; }
266
- .ui-icon-circlesmall-minus { background-position: -16px -208px; }
267
- .ui-icon-circlesmall-close { background-position: -32px -208px; }
268
- .ui-icon-squaresmall-plus { background-position: -48px -208px; }
269
- .ui-icon-squaresmall-minus { background-position: -64px -208px; }
270
- .ui-icon-squaresmall-close { background-position: -80px -208px; }
271
- .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
272
- .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
273
- .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
274
- .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
275
- .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
276
- .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
277
-
278
-
279
- /* Misc visuals
280
- ----------------------------------*/
281
-
282
- /* Corner radius */
283
- .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; }
284
- .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
285
- .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
286
- .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
287
- .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
288
- .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
289
- .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
290
- .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
291
- .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
292
-
293
- /* Overlays */
294
- .ui-widget-overlay { background: #666666 url(../images/jquery_ui/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); }
295
- .ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(../images/jquery_ui/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/*
296
- * jQuery UI Resizable 1.8.13
297
- *
298
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
299
- * Dual licensed under the MIT or GPL Version 2 licenses.
300
- * http://jquery.org/license
301
- *
302
- * http://docs.jquery.com/UI/Resizable#theming
303
- */
304
- .ui-resizable { position: relative;}
305
- .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;
306
- /* http://bugs.jqueryui.com/ticket/7233
307
- - Resizable: resizable handles fail to work in IE if transparent and content overlaps
308
- */
309
- background-image:url(data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=);
310
- }
311
- .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
312
- .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
313
- .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
314
- .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
315
- .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
316
- .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
317
- .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
318
- .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
319
- .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
320
- * jQuery UI Selectable 1.8.13
321
- *
322
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
323
- * Dual licensed under the MIT or GPL Version 2 licenses.
324
- * http://jquery.org/license
325
- *
326
- * http://docs.jquery.com/UI/Selectable#theming
327
- */
328
- .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
329
- /*
330
- * jQuery UI Accordion 1.8.13
331
- *
332
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
333
- * Dual licensed under the MIT or GPL Version 2 licenses.
334
- * http://jquery.org/license
335
- *
336
- * http://docs.jquery.com/UI/Accordion#theming
337
- */
338
- /* IE/Win - Fix animation bug - #4615 */
339
- .ui-accordion { width: 100%; }
340
- .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
341
- .ui-accordion .ui-accordion-li-fix { display: inline; }
342
- .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
343
- .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
344
- .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
345
- .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
346
- .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
347
- .ui-accordion .ui-accordion-content-active { display: block; }
348
- /*
349
- * jQuery UI Autocomplete 1.8.13
350
- *
351
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
352
- * Dual licensed under the MIT or GPL Version 2 licenses.
353
- * http://jquery.org/license
354
- *
355
- * http://docs.jquery.com/UI/Autocomplete#theming
356
- */
357
- .ui-autocomplete { position: absolute; cursor: default; }
358
-
359
- /* workarounds */
360
- * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
361
-
362
- /*
363
- * jQuery UI Menu 1.8.13
364
- *
365
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
366
- * Dual licensed under the MIT or GPL Version 2 licenses.
367
- * http://jquery.org/license
368
- *
369
- * http://docs.jquery.com/UI/Menu#theming
370
- */
371
- .ui-menu {
372
- list-style:none;
373
- padding: 2px;
374
- margin: 0;
375
- display:block;
376
- float: left;
377
- }
378
- .ui-menu .ui-menu {
379
- margin-top: -3px;
380
- }
381
- .ui-menu .ui-menu-item {
382
- margin:0;
383
- padding: 0;
384
- zoom: 1;
385
- float: left;
386
- clear: left;
387
- width: 100%;
388
- }
389
- .ui-menu .ui-menu-item a {
390
- text-decoration:none;
391
- display:block;
392
- padding:.2em .4em;
393
- line-height:1.5;
394
- zoom:1;
395
- }
396
- .ui-menu .ui-menu-item a.ui-state-hover,
397
- .ui-menu .ui-menu-item a.ui-state-active {
398
- font-weight: normal;
399
- margin: -1px;
400
- }
401
- /*
402
- * jQuery UI Button 1.8.13
403
- *
404
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
405
- * Dual licensed under the MIT or GPL Version 2 licenses.
406
- * http://jquery.org/license
407
- *
408
- * http://docs.jquery.com/UI/Button#theming
409
- */
410
- .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
411
- .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
412
- button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
413
- .ui-button-icons-only { width: 3.4em; }
414
- button.ui-button-icons-only { width: 3.7em; }
415
-
416
- /*button text element */
417
- .ui-button .ui-button-text { display: block; line-height: 1.4; }
418
- .ui-button-text-only .ui-button-text { padding: .4em 1em; }
419
- .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
420
- .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
421
- .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
422
- .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
423
- /* no icon support for input elements, provide padding by default */
424
- input.ui-button { padding: .4em 1em; }
425
-
426
- /*button icon element(s) */
427
- .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
428
- .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
429
- .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
430
- .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
431
- .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
432
-
433
- /*button sets*/
434
- .ui-buttonset { margin-right: 7px; }
435
- .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
436
-
437
- /* workarounds */
438
- button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
439
- /*
440
- * jQuery UI Dialog 1.8.13
441
- *
442
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
443
- * Dual licensed under the MIT or GPL Version 2 licenses.
444
- * http://jquery.org/license
445
- *
446
- * http://docs.jquery.com/UI/Dialog#theming
447
- */
448
- .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
449
- .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
450
- .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
451
- .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
452
- .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
453
- .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
454
- .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
455
- .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
456
- .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
457
- .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
458
- .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
459
- .ui-draggable .ui-dialog-titlebar { cursor: move; }
460
- /*
461
- * jQuery UI Slider 1.8.13
462
- *
463
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
464
- * Dual licensed under the MIT or GPL Version 2 licenses.
465
- * http://jquery.org/license
466
- *
467
- * http://docs.jquery.com/UI/Slider#theming
468
- */
469
- .ui-slider { position: relative; text-align: left; }
470
- .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
471
- .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
472
-
473
- .ui-slider-horizontal { height: .8em; }
474
- .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
475
- .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
476
- .ui-slider-horizontal .ui-slider-range-min { left: 0; }
477
- .ui-slider-horizontal .ui-slider-range-max { right: 0; }
478
-
479
- .ui-slider-vertical { width: .8em; height: 100px; }
480
- .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
481
- .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
482
- .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
483
- .ui-slider-vertical .ui-slider-range-max { top: 0; }/*
484
- * jQuery UI Tabs 1.8.13
485
- *
486
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
487
- * Dual licensed under the MIT or GPL Version 2 licenses.
488
- * http://jquery.org/license
489
- *
490
- * http://docs.jquery.com/UI/Tabs#theming
491
- */
492
- .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
493
- .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
494
- .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
495
- .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
496
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
497
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
498
- .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
499
- .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
500
- .ui-tabs .ui-tabs-hide { display: none !important; }
501
- /*
502
- * jQuery UI Datepicker 1.8.13
503
- *
504
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
505
- * Dual licensed under the MIT or GPL Version 2 licenses.
506
- * http://jquery.org/license
507
- *
508
- * http://docs.jquery.com/UI/Datepicker#theming
509
- */
510
- .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
511
- .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
512
- .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
513
- .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
514
- .ui-datepicker .ui-datepicker-prev { left:2px; }
515
- .ui-datepicker .ui-datepicker-next { right:2px; }
516
- .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
517
- .ui-datepicker .ui-datepicker-next-hover { right:1px; }
518
- .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
519
- .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
520
- .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
521
- .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
522
- .ui-datepicker select.ui-datepicker-month,
523
- .ui-datepicker select.ui-datepicker-year { width: 49%;}
524
- .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
525
- .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
526
- .ui-datepicker td { border: 0; padding: 1px; }
527
- .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
528
- .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
529
- .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
530
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
531
-
532
- /* with multiple calendars */
533
- .ui-datepicker.ui-datepicker-multi { width:auto; }
534
- .ui-datepicker-multi .ui-datepicker-group { float:left; }
535
- .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
536
- .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
537
- .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
538
- .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
539
- .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
540
- .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
541
- .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
542
- .ui-datepicker-row-break { clear:both; width:100%; }
543
-
544
- /* RTL support */
545
- .ui-datepicker-rtl { direction: rtl; }
546
- .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
547
- .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
548
- .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
549
- .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
550
- .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
551
- .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
552
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
553
- .ui-datepicker-rtl .ui-datepicker-group { float:right; }
554
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
555
- .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
556
-
557
- /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
558
- .ui-datepicker-cover {
559
- display: none; /*sorry for IE5*/
560
- display/**/: block; /*sorry for IE5*/
561
- position: absolute; /*must have*/
562
- z-index: -1; /*must have*/
563
- filter: mask(); /*must have*/
564
- top: -4px; /*must have*/
565
- left: -4px; /*must have*/
566
- width: 200px; /*must have*/
567
- height: 200px; /*must have*/
568
- }/*
569
- * jQuery UI Progressbar 1.8.13
570
- *
571
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
572
- * Dual licensed under the MIT or GPL Version 2 licenses.
573
- * http://jquery.org/license
574
- *
575
- * http://docs.jquery.com/UI/Progressbar#theming
576
- */
577
- .ui-progressbar { height:2em; text-align: left; }
578
- .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/assets/css/yit-plugin-panel-sidebar.css DELETED
@@ -1,388 +0,0 @@
1
- /*
2
- * This file belongs to the YIT Plugin Framework.
3
- *
4
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
- * that is bundled with this package in the file LICENSE.txt.
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.gnu.org/licenses/gpl-3.0.txt
8
- */
9
-
10
- /* === Panel Sidebar === */
11
- #yit-panel-sidebar {
12
- width : 275px;
13
- float : right;
14
- margin : 10px 0 0 10px;
15
- }
16
-
17
- #yit-panel-sidebar.yith-panel-sidebar-hidden {
18
- position : absolute;
19
- top : 0;
20
- right : 0;
21
- }
22
-
23
- #yit-panel-sidebar.yith-panel-sidebar-hidden #yit-panel-sidebar-widgets-container {
24
- display : none;
25
- }
26
-
27
- .yit-panel-sidebar-widget-wrapper {
28
- position : relative;
29
- margin : 10px 0 30px 0;
30
- }
31
-
32
- .yit-panel-sidebar-widget-container {
33
- border-radius : 5px;
34
- border : 1px solid #ddd;
35
- background : #fff;
36
- box-shadow : 0 2px 1px -1px #ccc;
37
- overflow : hidden;
38
- }
39
-
40
- .yit-panel-sidebar-widget-container a {
41
- text-decoration : none;
42
- }
43
-
44
- .yit-panel-sidebar-widget-container img.yit-panel-sidebar-widget-image {
45
- width : 100%;
46
- position : relative;
47
- bottom : -5px;
48
- }
49
-
50
- .yit-panel-sidebar-widget-title {
51
- padding : 12px 10px;
52
- background : #f4f4f4;
53
- font-size : 10px;
54
- text-transform : uppercase;
55
- font-weight : 700;
56
- }
57
-
58
- .yit-panel-sidebar-widget-title.dashicons {
59
- width : auto !important;
60
- height : auto !important;
61
- display : block;
62
- font-family : "Open Sans", sans-serif;
63
- text-align : left;
64
- }
65
-
66
- .yit-panel-sidebar-widget-title.dashicons::before {
67
- font-family : "Dashicons";
68
- font-size : 18px;
69
- display : inline-block;
70
- vertical-align : middle;
71
- margin-right : 10px;
72
- font-weight : normal;
73
- }
74
-
75
- .yit-panel-sidebar-widget-title.orange {
76
- background : #ff643e;
77
- color : #fff;
78
- }
79
-
80
- .yit-panel-sidebar-widget-title.green {
81
- background : #a3c401;
82
- color : #fff;
83
- }
84
-
85
- .yit-panel-sidebar-widget-title.red {
86
- background : #e4313c;
87
- color : #fff;
88
- }
89
-
90
- .yit-panel-sidebar-widget-title.yellow {
91
- background : #ffc400;
92
- color : #333;
93
- }
94
-
95
- .yit-panel-sidebar-widget-title.center {
96
- text-align : center;
97
- }
98
-
99
- .yit-panel-sidebar-widget-title.right {
100
- text-align : right;
101
- }
102
-
103
- .yit-panel-sidebar-widget-content {
104
- padding : 15px;
105
- }
106
-
107
- .yit-panel-sidebar-widget-content p {
108
- font-size : 11px;
109
- line-height : 18px;
110
- margin : 0;
111
- text-align : justify;
112
- }
113
-
114
- .yit-panel-sidebar-widget-badge.gift-tape {
115
- color : #000;
116
- font-family : "Open Sans", sans-serif;
117
- box-sizing : border-box;
118
- position : absolute;
119
- background-color : transparent;
120
- width : 70px;
121
- height : 70px;
122
- overflow : hidden;
123
- top : 0;
124
- right : 0;
125
- }
126
-
127
- .yit-panel-sidebar-widget-badge.gift-tape div.yit-panel-sidebar-widget-badge-text {
128
- background : #ffd600;
129
- background : -webkit-linear-gradient(left, #fe8502, #ffe400); /* For Safari 5.1 to 6.0 */
130
- background : -o-linear-gradient(right, #fe8502, #ffe400); /* For Opera 11.1 to 12.0 */
131
- background : -moz-linear-gradient(right, #fe8502, #ffe400); /* For Firefox 3.6 to 15 */
132
- background : linear-gradient(to right, #fe8502, #ffe400); /* Standard syntax */
133
- font-size : 10px;
134
- font-weight : bold;
135
- line-height : 24px;
136
- position : absolute;
137
- text-align : center;
138
- z-index : 100;
139
- -webkit-transform : rotate(45deg);
140
- -ms-transform : rotate(45deg);
141
- transform : rotate(45deg);
142
- top : 15px;
143
- left : -6px;
144
- width : 100px;
145
- text-shadow : 1px 1px 1px #fff;
146
- }
147
-
148
- img.yit-panel-sidebar-widget-despacho-image {
149
- background : #ffffff;
150
- background : -webkit-linear-gradient(#ffffff, #a5b7c5); /* For Safari 5.1 to 6.0 */
151
- background : -o-linear-gradient(#ffffff, #a5b7c5); /* For Opera 11.1 to 12.0 */
152
- background : -moz-linear-gradient(#ffffff, #a5b7c5); /* For Firefox 3.6 to 15 */
153
- background : linear-gradient(#ffffff, #a5b7c5); /* Standard syntax */
154
- }
155
-
156
- /* ==== Buttons ==== */
157
- #yit-panel-sidebar .button {
158
- color : #ffffff;
159
- border : none;
160
- background : #666666;
161
- -webkit-box-shadow : none;
162
- box-shadow : none;
163
- vertical-align : middle;
164
- text-transform : uppercase;
165
- font-size : 11px;
166
- font-weight : 700;
167
- height : 32px;
168
- line-height : 32px;
169
- padding : 0 18px 1px;
170
- }
171
-
172
- #yit-panel-sidebar .button.orange {
173
- background : #ff6340;
174
- }
175
-
176
- #yit-panel-sidebar .button.green {
177
- background : #a3c401;
178
- }
179
-
180
- #yit-panel-sidebar .button.red {
181
- background : #e4313c;
182
- }
183
-
184
- #yit-panel-sidebar .button.yellow {
185
- background : #ffc400;
186
- }
187
-
188
- /* === Title Icons === */
189
- #yit-panel-sidebar .yit-panel-sidebar-widget-icon:before {
190
- content : " ";
191
- width : 16px;
192
- height : 16px;
193
- display : inline-block;
194
- vertical-align : middle;
195
- margin-right : 10px;
196
- }
197
-
198
- #yit-panel-sidebar .yit-panel-sidebar-widget-icon.link-icon:before {
199
- background : transparent url('../images/widgets/link-icon.png') no-repeat;
200
- background-size : contain;
201
- }
202
-
203
- #yit-panel-sidebar .yit-panel-sidebar-widget-icon.info-icon:before {
204
- background : transparent url('../images/widgets/info-icon.png') no-repeat;
205
- background-size : contain;
206
- }
207
-
208
- #yit-panel-sidebar .yit-panel-sidebar-widget-icon.box-icon:before {
209
- background : transparent url('../images/widgets/box-icon.png') no-repeat;
210
- background-size : contain;
211
- }
212
-
213
- #yit-panel-sidebar .yit-panel-sidebar-widget-icon.box-white-icon:before {
214
- background : transparent url('../images/widgets/box-white-icon.png') no-repeat;
215
- background-size : contain;
216
- }
217
-
218
- /* ==== Membership Widget ==== */
219
- #yit-panel-sidebar-membership-widget {
220
-
221
- }
222
-
223
- #yit-panel-sidebar-membership-widget .yit-panel-sidebar-widget-title {
224
- text-align : center;
225
- }
226
-
227
- #yit-panel-sidebar-membership-widget .yit-panel-sidebar-widget-content {
228
- background : transparent url('../images/widgets/membership-bg.png') no-repeat;
229
- background-position : 105% 160%;
230
- background-size : 50%;
231
- }
232
-
233
- #yit-panel-sidebar-membership-widget .membership-row {
234
- margin-bottom: 20px;
235
- clear : both;
236
- overflow: hidden;
237
- }
238
-
239
- #yit-panel-sidebar-membership-widget .membership-total-price {
240
- font-size : 25px;
241
- font-weight : 700;
242
- display : block;
243
- width : 50%;
244
- box-sizing : border-box;
245
- float : left;
246
- line-height : 37px;
247
-
248
- }
249
-
250
- #yit-panel-sidebar-membership-widget .membership-offer-text {
251
- display : block;
252
- font-size : 10px;
253
- text-transform : uppercase;
254
- width : 50%;
255
- line-height : 14px;
256
- box-sizing : border-box;
257
- float : left;
258
- }
259
-
260
- #yit-panel-sidebar-membership-widget .membership-offer-text2 {
261
- display : block;
262
- font-size : 10px;
263
- text-transform : uppercase;
264
- text-align : right;
265
- vertical-align : middle;
266
- float : left;
267
- }
268
-
269
- #yit-panel-sidebar-membership-widget .membership-offer-sale-text {
270
- display : block;
271
- font-size : 22px;
272
- color : #ff6340;
273
- text-transform : uppercase;
274
- text-align : left;
275
- vertical-align : middle;
276
- margin-left : 6px;
277
- font-weight : 600;
278
- float : left;
279
- }
280
-
281
- #yit-panel-sidebar-membership-widget .membership-buttons {
282
- text-align : center;
283
- margin-bottom : 10px;
284
- }
285
-
286
- /* ==== Important Links Widget ==== */
287
- #yit-panel-sidebar-links-widget .yit-panel-sidebar-widget-content {
288
- background : transparent url('../images/widgets/link-bg.png') no-repeat;
289
- background-position : 110% 120%;
290
- background-size : 50%;
291
- }
292
-
293
- ul.yit-panel-sidebar-links-list {
294
- margin : 0;
295
- }
296
-
297
- ul.yit-panel-sidebar-links-list li {
298
- margin : 0 0 10px 0;
299
- }
300
-
301
- ul.yit-panel-sidebar-links-list li:before {
302
- content : " ";
303
- width : 15px;
304
- height : 13px;
305
- display : inline-block;
306
- background : transparent url('../images/ui-icons_454545_256x240.png') no-repeat -64px -144px;
307
- margin-right : 7px;
308
- }
309
-
310
- /* === Sidebar Actions ===*/
311
- #yit-panel-sidebar-actions {
312
- text-align : right;
313
- }
314
-
315
- .yit-panel-sidebar-action-title {
316
- margin-right : 5px;
317
- text-transform : uppercase;
318
- font-size : 11px;
319
- }
320
-
321
- #yit-panel-sidebar-action-hide {
322
- text-align : right;
323
- cursor : pointer;
324
- }
325
-
326
- .yit-panel-sidebar-action-hide-icon {
327
- color : #f4f4f4;
328
- background : #565656;
329
- border-radius : 50%;
330
- }
331
-
332
- #yit-panel-sidebar-action-hide:hover .yit-panel-sidebar-action-title {
333
- color : #000;
334
- }
335
-
336
- #yit-panel-sidebar-action-hide:hover .yit-panel-sidebar-action-hide-icon {
337
- background : #000;
338
- }
339
-
340
- .hide-on-click .yit-panel-sidebar-action-hide-icon:before {
341
- content : "\f139" !important;
342
- }
343
-
344
- /* === Responsive === */
345
-
346
- @media (min-width : 767px) {
347
- #wpbody-content #yit-panel-sidebar {
348
- margin-right : 15px;
349
- }
350
- }
351
-
352
- @media (max-width : 767px) {
353
- #yit-panel-sidebar {
354
- width : 275px;
355
- margin : 20px auto 0 auto;
356
- float : none;
357
- display : block;
358
- }
359
-
360
- #yit-panel-sidebar.yith-panel-sidebar-hidden {
361
- position : static;
362
- }
363
-
364
- #yit-panel-sidebar-actions {
365
- text-align : center;
366
- }
367
-
368
- #yit-panel-sidebar-action-hide {
369
- text-align : center;
370
- }
371
- }
372
-
373
- @media (max-width : 480px) {
374
-
375
- }
376
-
377
- @media (min-width : 768px) and (max-width : 992px) {
378
- }
379
-
380
- @media (min-width : 980px) and (max-width : 1199px) {
381
- }
382
-
383
- @media (min-width : 1200px) {
384
-
385
- }
386
-
387
- @media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (-o-min-device-pixel-ratio : 3/2), only screen and (min--moz-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) {
388
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/assets/css/yit-plugin-panel.css CHANGED
@@ -6,85 +6,6 @@
6
  * It is also available through the world-wide-web at this URL:
7
  * http://www.gnu.org/licenses/gpl-3.0.txt
8
  */
9
-
10
- /* onoff */
11
- .rm_onoff input {
12
- display : none;
13
- }
14
-
15
- .rm_onoff input + span {
16
- cursor : pointer;
17
- text-indent : -9999px;
18
- display : block;
19
- width : 85px;
20
- height : 37px;
21
- background : transparent url(../images/off.png);
22
- }
23
-
24
- .rm_onoff input:checked + span {
25
- background : transparent url(../images/on.png);
26
- }
27
-
28
- .rm_onoff input.onoffchecked + span {
29
- background : transparent url(../images/on.png);
30
- }
31
-
32
- /* slider */
33
- /*numbers*/
34
- .ui-slider .maxCaption, .ui-slider .minCaption {
35
- margin-bottom : 5px;
36
- }
37
-
38
- .ui-slider .feedback {
39
- background : url(../images/slider/tooltip.png) no-repeat center top;
40
- position : absolute;
41
- top : -25px;
42
- width : 35px;
43
- height : 43px;
44
- text-align : center;
45
- width : 100%;
46
- display : block;
47
- }
48
-
49
- .ui-slider .feedback strong {
50
- display : inline-block;
51
- padding-top : 4px;
52
- top : -30px;
53
- }
54
-
55
- /*handle*/
56
- .yit-options .ui-slider-horizontal .ui-slider-handle,
57
- .yit_options .ui-slider-horizontal .ui-slider-handle {
58
- background : transparent url(../images/slider/handle.png) no-repeat left top !important;
59
- border : 0px !important;
60
- top : -.35em !important;
61
- width : 18px !important;
62
- height : 19px !important;
63
- }
64
-
65
- /*bg on the left:grey*/
66
- .yit-options .ui-slider.ui-widget-content,
67
- .yit_options .ui-slider.ui-widget-content {
68
- background : url(../images/slider/grey.gif) repeat-x left center !important;
69
- border-color : #c1c1c0 !important;
70
- height : 10px !important;
71
- }
72
-
73
- .iris-slider-offset.ui-slider.ui-widget-content {
74
- background : transparent !important;
75
- height : auto !important;
76
- }
77
-
78
- /*bg on the right:orange*/
79
- .ui-slider.ui-widget-content .ui-widget-header {
80
- background : url(../images/slider/orange.gif) repeat-x left center !important;
81
- left : 2px !important;
82
- -webkit-border-radius : 15px;
83
- -moz-border-radius : 15px;
84
- -khtml-border-radius : 15px;
85
- border-radius : 15px;
86
- }
87
-
88
  .plugin-option tr {
89
  border-bottom : 1px solid #ccc;
90
  }
@@ -100,209 +21,35 @@
100
  float : left;
101
  }
102
 
103
- .plugin-option .form-table td {
104
  padding : 25px 10px;
105
  }
106
 
107
- .yit_options .select_wrapper,
108
- .yit-options .select_wrapper {
109
- background : url("../images/select.png") no-repeat scroll right center #FAFAFA;
110
- border-color : #CCCCCC #EEEEEE #EEEEEE #CCCCCC;
111
- border-radius : 4px 4px 4px 4px;
112
- border-style : solid;
113
- border-width : 1px;
114
- color : #555555;
115
- display : block;
116
- float : left;
117
- font-family : sans-serif;
118
- font-size : 12px;
119
- height : 26px;
120
- margin-bottom : 9px !important;
121
- margin-left : 0;
122
- margin-right : 5px;
123
- margin-top : 0;
124
- width : 400px;
125
- }
126
-
127
- .chosen .select_wrapper {
128
- background : none;
129
- border : none;
130
- }
131
-
132
- .chosen .select_wrapper .chosen-container {
133
- width : 338px !important;
134
- }
135
-
136
- .chosen .select_wrapper .chosen-container .search-field input {
137
- height : 27px !important;
138
- color : #333;
139
- }
140
-
141
- .chosen .select_wrapper .chosen-container .chosen-choices {
142
- border : 1px solid #ddd;
143
- box-shadow : none;
144
- }
145
-
146
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice {
147
- height : 15px !important;
148
- min-width : 105px;
149
- }
150
-
151
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice span {
152
- line-height : 15px;
153
- height : 15px;
154
- padding-top : 2px;
155
- }
156
-
157
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice a.search-choice-close {
158
- top : 5px;
159
- }
160
-
161
- .chosen .select_wrapper .chosen-container .chosen-drop .chosen-search input {
162
- width : 100% !important;
163
- }
164
-
165
- /* === Multiple Chosen Customizzation === */
166
-
167
- .yith-choosen .chosen-choices {
168
- line-height : 27px;
169
- min-height : 27px;
170
- border : 1px solid #ddd;
171
- }
172
-
173
- .yith-choosen .chosen-container-active .chosen-choices {
174
- border : 1px solid #5b9dd9;
175
- -webkit-box-shadow : 0 0 2px rgba(30, 140, 190, .8);
176
- box-shadow : 0 0 2px rgba(30, 140, 190, .8);
177
- }
178
-
179
- .select_wrapper span {
180
- height : 26px;
181
- line-height : 26px;
182
- padding-left : 6px;
183
- position : absolute;
184
- z-index : 2;
185
- overflow : hidden;
186
- }
187
-
188
  .ie8 .yit_options select,
189
  .ie8 .yit-options select {
190
  height : 26px;
191
  }
192
 
193
- .yit_options select, .yit-options select, .the-metabox .select_wrapper select {
194
- cursor : pointer;
195
- height : 28px;
196
- margin : 0;
197
- opacity : 0;
198
- padding : 0;
199
- position : relative;
200
- width : inherit;
201
- z-index : 4;
202
- background-color : #FAFAFA;
203
- }
204
-
205
- /* === Single Chosen Customizzation === */
206
-
207
- .yith-choosen .chosen-container-single .chosen-default {
208
- background : transparent;
209
- border-color : #ddd;
210
- }
211
-
212
- .yith-choosen .chosen-search > input[type=text] {
213
- width : 100% !important;
214
- }
215
-
216
- .yith-choosen .chosen-container-single .chosen-single {
217
- background : transparent;
218
- border-color : #ddd;
219
- }
220
-
221
  /* Style to woocommerce panel*/
222
 
223
- #plugin-fw-wc {
224
  padding-top : 20px;
225
  }
226
 
227
- #plugin-fw-wc table.form-table {
228
  background-color : #fff;
229
  margin-bottom : 20px;
230
  }
231
 
232
- #plugin-fw-wc table.form-table th {
233
  padding : 20px;
234
  }
235
 
236
- #plugin-fw-wc h3 {
237
- padding : 0px 10px 10px;
238
- border-bottom : 1px solid #eee;
239
- }
240
-
241
- /* === VIDEO BOX === */
242
-
243
- .yith-videobox-wrapper {
244
- padding-top : 20px;
245
- }
246
-
247
- .yith-videobox-wrapper h3 {
248
  padding : 0px 10px 10px;
249
  border-bottom : 1px solid #eee;
250
  }
251
 
252
- .yith-videobox-wrapper .postbox {
253
- display : inline-block;
254
- }
255
-
256
- .yith-videobox-wrapper .yith_videobox .column {
257
- width : 45%;
258
- float : left;
259
- padding-right : 2.5%;
260
- border-right : 1px solid #ebebeb;
261
- padding-bottom : 2em;
262
- }
263
-
264
- .yith-videobox-wrapper .yith_videobox .column.two {
265
- margin-right : 0;
266
- padding-right : 0;
267
- padding-left : 2.5%;
268
- border : 0;
269
- max-width : 49%;
270
- }
271
-
272
- .yith-videobox-wrapper .yith_videobox h2 {
273
- font-size : 16px;
274
- margin-bottom : 20px;
275
- }
276
-
277
- .yith-videobox-wrapper .yith-video-link {
278
- width : 100%;
279
- max-width : 200px;
280
- float : left;
281
- margin : 0 1.5em 1.5em 0;
282
- }
283
-
284
- .yith-videobox-wrapper .yith-video-link {
285
- width : 100%;
286
- max-width : 200px;
287
- float : left;
288
- margin : 0 1.5em 1.5em 0;
289
- }
290
-
291
- .yith-videobox-wrapper .yith-image-frame img {
292
- max-width : 100%;
293
- height : auto;
294
- }
295
-
296
- .yith-videobox-wrapper .yith-video-link img {
297
- max-width : 100%;
298
- height : auto;
299
- }
300
-
301
- .yith-videobox-wrapper .yith-video-iframe {
302
- display : none;
303
-
304
- }
305
-
306
  /* === Plugins Upgrader === */
307
 
308
  .yit-plugin-changelog-wrapper {
@@ -314,10 +61,12 @@
314
  }
315
 
316
  .yit-plugin-changelog {
317
- background : #fcfcfc;
318
- height : 97%;
 
 
319
  z-index : 999;
320
- overflow : auto;
321
  }
322
 
323
  /* === Plugins Licence Activation === */
@@ -354,7 +103,7 @@
354
  .yit-container.plugin-licence-activation .message {
355
  display : none;
356
  line-height : normal;
357
- background : #ffffff url(../images/licence-error.png) 15px center no-repeat;
358
  padding-left : 65px;
359
  padding-right : 15px;
360
  width : 150px;
@@ -520,7 +269,7 @@
520
  }
521
 
522
  .yit-container.plugin-licence-activation table tbody tr {
523
- background-color : #ffffff;
524
  }
525
 
526
  .yit-container.plugin-licence-activation table thead tr th {
@@ -659,8 +408,8 @@
659
  width : 6em;
660
  }
661
 
662
- #wpwrap h2.nav-tab-wrapper , #wpbody-content h2.nav-tab-wrapper {
663
- border-bottom: 1px solid #ccc;
664
  }
665
 
666
  /* === YIT FRAMEWORK === */
@@ -671,14 +420,41 @@
671
  }
672
 
673
  /* === Panel Content and Container === */
674
- .yit-admin-panel-container{
675
- position:relative;
676
  }
 
677
  .yit-admin-panel-content-wrap {
678
  width : 100%;
679
  display : block;
680
  }
681
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
682
  /* === Responsive === */
683
 
684
  @media (max-width : 767px) {
6
  * It is also available through the world-wide-web at this URL:
7
  * http://www.gnu.org/licenses/gpl-3.0.txt
8
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  .plugin-option tr {
10
  border-bottom : 1px solid #ccc;
11
  }
21
  float : left;
22
  }
23
 
24
+ .plugin-option .form-table > tbody > tr > td {
25
  padding : 25px 10px;
26
  }
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  .ie8 .yit_options select,
29
  .ie8 .yit-options select {
30
  height : 26px;
31
  }
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  /* Style to woocommerce panel*/
34
 
35
+ #plugin-fw-wc, #yith-plugin-fw-panel {
36
  padding-top : 20px;
37
  }
38
 
39
+ #plugin-fw-wc table.form-table, #yith-plugin-fw-panel table.form-table {
40
  background-color : #fff;
41
  margin-bottom : 20px;
42
  }
43
 
44
+ #plugin-fw-wc table.form-table th, #yith-plugin-fw-panel table.form-table th {
45
  padding : 20px;
46
  }
47
 
48
+ #plugin-fw-wc h3, #yith-plugin-fw-panel h3 {
 
 
 
 
 
 
 
 
 
 
 
49
  padding : 0px 10px 10px;
50
  border-bottom : 1px solid #eee;
51
  }
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  /* === Plugins Upgrader === */
54
 
55
  .yit-plugin-changelog-wrapper {
61
  }
62
 
63
  .yit-plugin-changelog {
64
+ height : calc(100% - 15px);
65
+ width : calc(100% - 15px);
66
+ overflow-x : hidden;
67
+ overflow-y : auto;
68
  z-index : 999;
69
+ background : #fcfcfc;
70
  }
71
 
72
  /* === Plugins Licence Activation === */
103
  .yit-container.plugin-licence-activation .message {
104
  display : none;
105
  line-height : normal;
106
+ background : #fff url(../images/licence-error.png) 15px center no-repeat;
107
  padding-left : 65px;
108
  padding-right : 15px;
109
  width : 150px;
269
  }
270
 
271
  .yit-container.plugin-licence-activation table tbody tr {
272
+ background-color : #fff;
273
  }
274
 
275
  .yit-container.plugin-licence-activation table thead tr th {
408
  width : 6em;
409
  }
410
 
411
+ #wpwrap h2.nav-tab-wrapper, #wpbody-content h2.nav-tab-wrapper {
412
+ border-bottom : 1px solid #ccc;
413
  }
414
 
415
  /* === YIT FRAMEWORK === */
420
  }
421
 
422
  /* === Panel Content and Container === */
423
+ .yit-admin-panel-container {
424
+ position : relative;
425
  }
426
+
427
  .yit-admin-panel-content-wrap {
428
  width : 100%;
429
  display : block;
430
  }
431
 
432
+ .yith-disabled {
433
+ opacity : 0.3;
434
+ pointer-events : none;
435
+ }
436
+
437
+ .yith-plugin-fw-select,
438
+ .yith-plugin-fw-slider-container,
439
+ .yith-plugin-fw-text-input,
440
+ .yith-plugin-fw-text-array-table,
441
+ .yith-plugin-fw-textarea {
442
+ width : 400px;
443
+ max-width : 100%;
444
+ }
445
+
446
+ .yith-plugin-fw-text-array-table input {
447
+ width : 100%;
448
+ }
449
+
450
+ .yith-plugin-fw-panel-wc-row.preview {
451
+ float : none;
452
+ }
453
+
454
+ .yith-plugin-fw-panel .subsubsub {
455
+ margin : 0;
456
+ }
457
+
458
  /* === Responsive === */
459
 
460
  @media (max-width : 767px) {
plugin-fw/assets/css/yit-upgrader.css CHANGED
@@ -9,6 +9,10 @@
9
  }
10
 
11
  .yit-plugin-changelog {
 
 
 
 
 
12
  background: #fcfcfc;
13
- height: 97%;
14
  }
9
  }
10
 
11
  .yit-plugin-changelog {
12
+ height : calc(100% - 15px);
13
+ width : calc(100% - 15px);
14
+ overflow-x : hidden;
15
+ overflow-y : auto;
16
+ z-index : 999;
17
  background: #fcfcfc;
 
18
  }
plugin-fw/assets/css/yith-fields.css ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .yith-plugin-fw span.description {
2
+ display : block;
3
+ margin-top : 5px;
4
+ font-size : 12px;
5
+ color : #777;
6
+ font-style : italic;
7
+ clear : both;
8
+ }
9
+
10
+ .yith-disabled {
11
+ opacity : 0.3;
12
+ pointer-events : none;
13
+ }
14
+
15
+ .yith-plugin-fw-field-wrapper:not(.yith-plugin-fw-title-field-wrapper) {
16
+ display : block;
17
+ width : 100%;
18
+ }
19
+
20
+ .yith-plugin-fw-field-wrapper span.desc {
21
+ display : block;
22
+ width : 100%;
23
+ }
24
+
25
+ .yith-plugin-fw-title-field-wrapper h3.title {
26
+ width : 100%;
27
+ }
28
+
29
+ .the-metabox .yith-plugin-fw-title-field-wrapper h3.title {
30
+ float : left;
31
+ }
32
+
33
+ .yith-plugin-fw input[type=email],
34
+ .yith-plugin-fw input[type=number],
35
+ .yith-plugin-fw input[type=text]:not(.select2-search__field),
36
+ .yith-plugin-fw select,
37
+ .woocommerce .yith-plugin-fw table.form-table input[type=email],
38
+ .woocommerce .yith-plugin-fw table.form-table input[type=number],
39
+ .woocommerce .yith-plugin-fw table.form-table input[type=text]:not(.select2-search__field),
40
+ .woocommerce .yith-plugin-fw table.form-table select {
41
+ width : 400px;
42
+ max-width : 100%;
43
+ height : 30px;
44
+ padding : 5px;
45
+ }
46
+
47
+ .woocommerce .yith-plugin-fw table.form-table input[type=text].wp-color-picker,
48
+ .woocommerce .yith-plugin-fw table.form-table input[type=text].yith-plugin-fw-colorpicker,
49
+ .yith-plugin-fw input[type=text].wp-color-picker,
50
+ .yith-plugin-fw input[type=text].yith-plugin-fw-colorpicker {
51
+ width : 6em;
52
+ max-width : none;
53
+ height : auto;
54
+ padding : 3px 5px;
55
+ }
56
+
57
+ .woocommerce .yith-plugin-fw table.form-table input[type=text].colorpick,
58
+ .yith-plugin-fw input[type=text].colorpick{
59
+ width : 6em;
60
+ max-width : none;
61
+ height : auto;
62
+ padding : 6px;
63
+ }
64
+
65
+ .yith-plugin-fw input.select2-search__field,
66
+ .yith-plugin-fw .select2-container .select2-search--inline .select2-search__field,
67
+ .woocommerce .yith-plugin-fw input.select2-search__field,
68
+ .woocommerce .yith-plugin-fw table.form-table input.select2-search__field {
69
+ padding : 3px;
70
+ }
71
+
72
+ .yith-plugin-fw textarea {
73
+ width : 400px;
74
+ max-width : 100%;
75
+ padding : 5px;
76
+ }
77
+
78
+ /* ------------- ICONS ------------- */
79
+ .yit-icons-manager-wrapper {
80
+ width : 100%;
81
+ max-width : 400px;
82
+ }
83
+
84
+ .yit-icons-manager-text {
85
+ width : 100%;
86
+ }
87
+
88
+ .yit-icons-manager-icon-text {
89
+ width : calc(100% - 35px) !important;
90
+ height : 30px;
91
+ float : left;
92
+ margin : 0;
93
+ }
94
+
95
+ .yit-icons-manager-icon-preview {
96
+ width : 30px;
97
+ height : 30px;
98
+ margin-right : 5px;
99
+ float : left;
100
+ padding-top : 6px;
101
+ box-sizing : border-box;
102
+ text-align : center;
103
+ background : #f1f1f1;
104
+ }
105
+
106
+ .yit-icons-manager-list-wrapper {
107
+ margin : 10px 0;
108
+ box-shadow : 0 0 0 1px #ddd;
109
+ }
110
+
111
+ ul.yit-icons-manager-list {
112
+ width : 100%;
113
+ height : 300px;
114
+ overflow-y : scroll;
115
+ margin : 0;
116
+ }
117
+
118
+ ul.yit-icons-manager-list li {
119
+ float : left;
120
+ width : 30px;
121
+ height : 30px;
122
+ padding-top : 6px;
123
+ box-sizing : border-box;
124
+ text-align : center;
125
+ background : #f1f1f1;
126
+ margin : 1px;
127
+ cursor : pointer;
128
+ }
129
+
130
+ ul.yit-icons-manager-list li:hover {
131
+ background : #c5dcf6;
132
+ }
133
+
134
+ ul.yit-icons-manager-list li.active {
135
+ background : #d4f0ff;
136
+ }
137
+
138
+ .yit-icons-manager-action-set-default {
139
+ margin-bottom : 0;
140
+ }
141
+
142
+ .yit-icons-manager-default-icon-preview {
143
+ height : 100%;
144
+ display : inline-block;
145
+ padding-left : 10px;
146
+ border-left : 1px solid #ccc;
147
+ margin-left : 10px;
148
+ }
149
+
150
+ /* ------- Text Array ------- */
151
+ .yith-plugin-fw-text-array-table td {
152
+ padding : 1px;
153
+ }
154
+
155
+ .yith-plugin-fw-text-array-table input[type=text],
156
+ .woocommerce table.form-table table.yith-plugin-fw-text-array-table input[type=text] {
157
+ width : 100%;
158
+ }
159
+
160
+ /* ------- Image Gallery ------- */
161
+ .yith-plugin-fw .image-gallery ul li {
162
+ display : inline-block;
163
+ width : 80px;
164
+ margin-left : 10px;
165
+ position : relative;
166
+ }
167
+
168
+ .yith-plugin-fw .image-gallery ul li img {
169
+ width : 80px;
170
+ border : 1px solid #ccc;
171
+ }
172
+
173
+ .yith-plugin-fw .image-gallery ul li ul {
174
+ position : absolute;
175
+ top : -6px;
176
+ right : -1px;
177
+ width : 20px;
178
+ height : 20px;
179
+ }
180
+
181
+ .yith-plugin-fw .image-gallery ul a.delete {
182
+ background : url(../images/x.png) no-repeat;
183
+ width : 20px;
184
+ height : 20px;
185
+ display : block;
186
+ text-indent : -99999px;
187
+ }
188
+
189
+ /* ------- OnOff ------- */
190
+ .yith-plugin-fw-onoff-container input {
191
+ display : none;
192
+ }
193
+
194
+ .yith-plugin-fw-onoff-container input + span {
195
+ cursor : pointer;
196
+ text-indent : -9999px;
197
+ display : block;
198
+ width : 36px;
199
+ height : 20px;
200
+ background : #a4a4a4;
201
+ border-radius : 24px;
202
+ position : relative;
203
+ transition : all 0.3s;
204
+ }
205
+
206
+ .yith-plugin-fw-onoff-container input + span:before {
207
+ content : '';
208
+ background : #fff;
209
+ width : 16px;
210
+ height : 16px;
211
+ border-radius : 50%;
212
+ position : absolute;
213
+ top : 2px;
214
+ left : 2px;
215
+ transition : all 0.3s;
216
+ }
217
+
218
+ .yith-plugin-fw-onoff-container input:checked + span,
219
+ .yith-plugin-fw-onoff-container input.onoffchecked + span {
220
+ background : #0073aa;
221
+ }
222
+
223
+ .yith-plugin-fw-onoff-container input:checked + span:before,
224
+ .yith-plugin-fw-onoff-container input.onoffchecked + span:before {
225
+ left : 18px;
226
+ }
227
+
228
+ /* ------- Preview ------- */
229
+ .yith-plugin-fw-preview-field {
230
+ max-height : 200px;
231
+ }
232
+
233
+ /* ------- Sidebar Layout ------- */
234
+ .yith-plugin-fw-sidebar-layout input[type="radio"] {
235
+ display : none;
236
+ width : 0px;
237
+ }
238
+
239
+ .yith-plugin-fw-sidebar-layout input[type="radio"]:first-child {
240
+ margin-right : -2px;
241
+ }
242
+
243
+ .yith-plugin-fw-sidebar-layout input[type="radio"] + img {
244
+ border : 2px solid #fff;
245
+ padding : 1px;
246
+ }
247
+
248
+ .yith-plugin-fw-sidebar-layout input[type="radio"] + img:hover {
249
+ cursor : pointer;
250
+ }
251
+
252
+ .yith-plugin-fw-sidebar-layout input[checked] + img {
253
+ border : 2px solid #f2ad35;
254
+ padding : 1px;
255
+ }
256
+
257
+ .yith-plugin-fw-sidebar-layout select {
258
+ vertical-align : 12px;
259
+ }
260
+
261
+ .yit-admin-panel-content-wrap .yith-plugin-fw-sidebar-layout label {
262
+ font-weight : bold;
263
+ width : 200px;
264
+ float : left;
265
+ line-height : 23px;
266
+ margin-left : -230px;
267
+ }
268
+
269
+ /* ------- Slider ------- */
270
+ .yith-plugin-fw .slider {
271
+ padding-top : 20px;
272
+ }
273
+
274
+ .ui-slider .minCaption {
275
+ position : absolute;
276
+ right : 95%;
277
+ top : -6px;
278
+ margin-right : 11px;
279
+ }
280
+
281
+ .ui-slider .maxCaption {
282
+ position : absolute;
283
+ left : 95%;
284
+ top : -6px;
285
+ margin-left : 20px;
286
+ }
287
+
288
+ .ui-slider-horizontal .ui-slider-handle {
289
+ background : #fff;
290
+ border : 0px !important;
291
+ top : -12px !important;
292
+ border-radius : 50%;
293
+ width : 27px !important;
294
+ height : 27px !important;
295
+ box-sizing : border-box;
296
+ box-shadow : 0 1px 7px -1px rgba(0, 0, 0, 0.5);
297
+ font-size : 13px;
298
+ padding : 6px 0;
299
+ font-weight : 600;
300
+ color : #555;
301
+ text-align : center;
302
+ }
303
+
304
+ .ui-slider.ui-widget-content {
305
+ background : #ccc;
306
+ border : none !important;
307
+ height : 3px !important;
308
+ border-radius : 3px !important;
309
+ width : 90%;
310
+ margin : 15px 5% 20px 5%;
311
+ }
312
+
313
+ .iris-slider-offset.ui-slider.ui-widget-content {
314
+ background : transparent !important;
315
+ height : auto !important;
316
+ }
317
+
318
+ .ui-slider.ui-widget-content .ui-widget-header {
319
+ background : #4b93ff;
320
+ left : 0px !important;
321
+ -webkit-border-radius : 3px;
322
+ -moz-border-radius : 3px;
323
+ -khtml-border-radius : 3px;
324
+ border-radius : 3px;
325
+ }
326
+
327
+ /* ------- Select2 ------- */
328
+ .yith-plugin-fw-select2-wrapper {
329
+ width : 400px;
330
+ }
331
+
332
+ /* ------- Textarea ------- */
333
+ .yith-plugin-fw-textarea-editor-field-wrapper {
334
+ max-width : 1000px;
335
+ clear : both;
336
+ }
337
+
338
+ .yith-plugin-fw-textarea-editor-field-wrapper textarea.wp-editor-area,
339
+ .woocommerce table.form-table .yith-plugin-fw-textarea-editor-field-wrapper textarea.wp-editor-area {
340
+ width : 100%;
341
+ }
342
+
343
+ /* ------- Buttons ------- */
344
+ .yith-plugin-fw-buttons-field-wrapper {
345
+ margin-top : 7px;
346
+ }
plugin-fw/assets/images/chosen/chosen-sprite.png DELETED
Binary file
plugin-fw/assets/images/chosen/chosen-sprite@2x.png DELETED
Binary file
plugin-fw/assets/images/off.png DELETED
Binary file
plugin-fw/assets/images/on.png DELETED
Binary file
plugin-fw/assets/images/select.png DELETED
Binary file
plugin-fw/assets/images/slider/grey.gif DELETED
Binary file
plugin-fw/assets/images/slider/handle.png DELETED
Binary file
plugin-fw/assets/images/slider/orange.gif DELETED
Binary file
plugin-fw/assets/images/slider/tooltip.png DELETED
Binary file
plugin-fw/assets/images/widgets/box-icon.png DELETED
Binary file
plugin-fw/assets/images/widgets/box-white-icon.png DELETED
Binary file
plugin-fw/assets/images/widgets/despacho.png DELETED
Binary file
plugin-fw/assets/images/widgets/info-icon.png DELETED
Binary file
plugin-fw/assets/images/widgets/link-bg.png DELETED
Binary file
plugin-fw/assets/images/widgets/link-bg2.png DELETED
Binary file
plugin-fw/assets/images/widgets/link-icon.png DELETED
Binary file
plugin-fw/assets/images/widgets/membership-bg.png DELETED
Binary file
plugin-fw/assets/js/chosen/ajax-chosen.jquery.js DELETED
@@ -1,81 +0,0 @@
1
- // Generated by CoffeeScript 1.3.1
2
-
3
- (function($) {
4
- return $.fn.ajaxChosen = function(settings, callback) {
5
- var chosenXhr, defaultOptions, options, select;
6
- if (settings == null) {
7
- settings = {};
8
- }
9
- if (callback == null) {
10
- callback = function() {};
11
- }
12
- defaultOptions = {
13
- minTermLength: 3,
14
- afterTypeDelay: 500,
15
- jsonTermKey: "term"
16
- };
17
- select = this;
18
- chosenXhr = null;
19
- options = $.extend({}, defaultOptions, settings);
20
- this.chosen();
21
- return this.each(function() {
22
- return $(this).next('.chosen-container').find(".search-field > input, .chosen-search > input").bind('keyup', function() {
23
- var field, msg, success, val;
24
- val = $.trim($(this).attr('value'));
25
- msg = val.length < options.minTermLength ? "Keep typing..." : "Looking for '" + val + "'";
26
- select.next('.chosen-container').find('.no-results').text(msg);
27
- if (val === $(this).data('prevVal')) {
28
- return false;
29
- }
30
- $(this).data('prevVal', val);
31
- if (this.timer) {
32
- clearTimeout(this.timer);
33
- }
34
- if (val.length < options.minTermLength) {
35
- return false;
36
- }
37
- field = $(this);
38
- if (!(options.data != null)) {
39
- options.data = {};
40
- }
41
- options.data[options.jsonTermKey] = val;
42
- if (options.dataCallback != null) {
43
- options.data = options.dataCallback(options.data);
44
- }
45
- success = options.success;
46
- options.success = function(data) {
47
- var items, selected_values;
48
- if (!(data != null)) {
49
- return;
50
- }
51
- selected_values = [];
52
- select.find('option').each(function() {
53
- if (!$(this).is(":selected")) {
54
- return $(this).remove();
55
- } else {
56
- return selected_values.push($(this).val() + "-" + $(this).text());
57
- }
58
- });
59
- items = callback(data);
60
- $.each(items, function(value, text) {
61
- if ($.inArray(value + "-" + text, selected_values) === -1) {
62
- return $("<option />").attr('value', value).html(text).appendTo(select);
63
- }
64
- });
65
- select.trigger("chosen:updated");
66
- if (success != null) {
67
- success(data);
68
- }
69
- field.attr('value', val);
70
- return field.css('width', 'auto');
71
- };
72
- return this.timer = setTimeout(function() {
73
- if (chosenXhr) {
74
- chosenXhr.abort();
75
- }
76
- return chosenXhr = $.ajax(options);
77
- }, options.afterTypeDelay);
78
- });
79
- });
80
- };
81
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/assets/js/chosen/ajax-chosen.jquery.min.js DELETED
@@ -1,2 +0,0 @@
1
- // Generated by CoffeeScript 1.3.1
2
- (function(e){return e.fn.ajaxChosen=function(t,n){var r,i,s,o;t==null&&(t={});n==null&&(n=function(){});i={minTermLength:3,afterTypeDelay:500,jsonTermKey:"term"};o=this;r=null;s=e.extend({},i,t);this.chosen();return this.each(function(){return e(this).next(".chosen-container").find(".search-field > input, .chosen-search > input").bind("keyup",function(){var t,i,u,a;a=e.trim(e(this).attr("value"));i=a.length<s.minTermLength?"Keep typing...":"Looking for '"+a+"'";o.next(".chosen-container").find(".no-results").text(i);if(a===e(this).data("prevVal"))return!1;e(this).data("prevVal",a);this.timer&&clearTimeout(this.timer);if(a.length<s.minTermLength)return!1;t=e(this);s.data==null&&(s.data={});s.data[s.jsonTermKey]=a;s.dataCallback!=null&&(s.data=s.dataCallback(s.data));u=s.success;s.success=function(r){var i,s;if(r==null)return;s=[];o.find("option").each(function(){return e(this).is(":selected")?s.push(e(this).val()+"-"+e(this).text()):e(this).remove()});i=n(r);e.each(i,function(t,n){if(e.inArray(t+"-"+n,s)===-1)return e("<option />").attr("value",t).html(n).appendTo(o)});o.trigger("chosen:updated");u!=null&&u(r);t.attr("value",a);return t.css("width","auto")};return this.timer=setTimeout(function(){r&&r.abort();return r=e.ajax(s)},s.afterTypeDelay)})})}})(jQuery);
 
 
plugin-fw/assets/js/chosen/chosen.jquery.js DELETED
@@ -1,1211 +0,0 @@
1
- /*!
2
- Chosen, a Select Box Enhancer for jQuery and Prototype
3
- by Patrick Filler for Harvest, http://getharvest.com
4
-
5
- Version 1.1.0
6
- Full source at https://github.com/harvesthq/chosen
7
- Copyright (c) 2011 Harvest http://getharvest.com
8
-
9
- MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
- This file is generated by `grunt build`, do not edit it by hand.
11
- */
12
-
13
- (function() {
14
- var $, AbstractChosen, Chosen, SelectParser, _ref,
15
- __hasProp = {}.hasOwnProperty,
16
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
17
-
18
- SelectParser = (function() {
19
- function SelectParser() {
20
- this.options_index = 0;
21
- this.parsed = [];
22
- }
23
-
24
- SelectParser.prototype.add_node = function(child) {
25
- if (child.nodeName.toUpperCase() === "OPTGROUP") {
26
- return this.add_group(child);
27
- } else {
28
- return this.add_option(child);
29
- }
30
- };
31
-
32
- SelectParser.prototype.add_group = function(group) {
33
- var group_position, option, _i, _len, _ref, _results;
34
- group_position = this.parsed.length;
35
- this.parsed.push({
36
- array_index: group_position,
37
- group: true,
38
- label: this.escapeExpression(group.label),
39
- children: 0,
40
- disabled: group.disabled
41
- });
42
- _ref = group.childNodes;
43
- _results = [];
44
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
45
- option = _ref[_i];
46
- _results.push(this.add_option(option, group_position, group.disabled));
47
- }
48
- return _results;
49
- };
50
-
51
- SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
52
- if (option.nodeName.toUpperCase() === "OPTION") {
53
- if (option.text !== "") {
54
- if (group_position != null) {
55
- this.parsed[group_position].children += 1;
56
- }
57
- this.parsed.push({
58
- array_index: this.parsed.length,
59
- options_index: this.options_index,
60
- value: option.value,
61
- text: option.text,
62
- html: option.innerHTML,
63
- selected: option.selected,
64
- disabled: group_disabled === true ? group_disabled : option.disabled,
65
- group_array_index: group_position,
66
- classes: option.className,
67
- style: option.style.cssText
68
- });
69
- } else {
70
- this.parsed.push({
71
- array_index: this.parsed.length,
72
- options_index: this.options_index,
73
- empty: true
74
- });
75
- }
76
- return this.options_index += 1;
77
- }
78
- };
79
-
80
- SelectParser.prototype.escapeExpression = function(text) {
81
- var map, unsafe_chars;
82
- if ((text == null) || text === false) {
83
- return "";
84
- }
85
- if (!/[\&\<\>\"\'\`]/.test(text)) {
86
- return text;
87
- }
88
- map = {
89
- "<": "&lt;",
90
- ">": "&gt;",
91
- '"': "&quot;",
92
- "'": "&#x27;",
93
- "`": "&#x60;"
94
- };
95
- unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
96
- return text.replace(unsafe_chars, function(chr) {
97
- return map[chr] || "&amp;";
98
- });
99
- };
100
-
101
- return SelectParser;
102
-
103
- })();
104
-
105
- SelectParser.select_to_array = function(select) {
106
- var child, parser, _i, _len, _ref;
107
- parser = new SelectParser();
108
- _ref = select.childNodes;
109
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
110
- child = _ref[_i];
111
- parser.add_node(child);
112
- }
113
- return parser.parsed;
114
- };
115
-
116
- AbstractChosen = (function() {
117
- function AbstractChosen(form_field, options) {
118
- this.form_field = form_field;
119
- this.options = options != null ? options : {};
120
- if (!AbstractChosen.browser_is_supported()) {
121
- return;
122
- }
123
- this.is_multiple = this.form_field.multiple;
124
- this.set_default_text();
125
- this.set_default_values();
126
- this.setup();
127
- this.set_up_html();
128
- this.register_observers();
129
- }
130
-
131
- AbstractChosen.prototype.set_default_values = function() {
132
- var _this = this;
133
- this.click_test_action = function(evt) {
134
- return _this.test_active_click(evt);
135
- };
136
- this.activate_action = function(evt) {
137
- return _this.activate_field(evt);
138
- };
139
- this.active_field = false;
140
- this.mouse_on_container = false;
141
- this.results_showing = false;
142
- this.result_highlighted = null;
143
- this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
144
- this.disable_search_threshold = this.options.disable_search_threshold || 0;
145
- this.disable_search = this.options.disable_search || false;
146
- this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
147
- this.group_search = this.options.group_search != null ? this.options.group_search : true;
148
- this.search_contains = this.options.search_contains || false;
149
- this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
150
- this.max_selected_options = this.options.max_selected_options || Infinity;
151
- this.inherit_select_classes = this.options.inherit_select_classes || false;
152
- this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
153
- return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
154
- };
155
-
156
- AbstractChosen.prototype.set_default_text = function() {
157
- if (this.form_field.getAttribute("data-placeholder")) {
158
- this.default_text = this.form_field.getAttribute("data-placeholder");
159
- } else if (this.is_multiple) {
160
- this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
161
- } else {
162
- this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
163
- }
164
- return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
165
- };
166
-
167
- AbstractChosen.prototype.mouse_enter = function() {
168
- return this.mouse_on_container = true;
169
- };
170
-
171
- AbstractChosen.prototype.mouse_leave = function() {
172
- return this.mouse_on_container = false;
173
- };
174
-
175
- AbstractChosen.prototype.input_focus = function(evt) {
176
- var _this = this;
177
- if (this.is_multiple) {
178
- if (!this.active_field) {
179
- return setTimeout((function() {
180
- return _this.container_mousedown();
181
- }), 50);
182
- }
183
- } else {
184
- if (!this.active_field) {
185
- return this.activate_field();
186
- }
187
- }
188
- };
189
-
190
- AbstractChosen.prototype.input_blur = function(evt) {
191
- var _this = this;
192
- if (!this.mouse_on_container) {
193
- this.active_field = false;
194
- return setTimeout((function() {
195
- return _this.blur_test();
196
- }), 100);
197
- }
198
- };
199
-
200
- AbstractChosen.prototype.results_option_build = function(options) {
201
- var content, data, _i, _len, _ref;
202
- content = '';
203
- _ref = this.results_data;
204
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
205
- data = _ref[_i];
206
- if (data.group) {
207
- content += this.result_add_group(data);
208
- } else {
209
- content += this.result_add_option(data);
210
- }
211
- if (options != null ? options.first : void 0) {
212
- if (data.selected && this.is_multiple) {
213
- this.choice_build(data);
214
- } else if (data.selected && !this.is_multiple) {
215
- this.single_set_selected_text(data.text);
216
- }
217
- }
218
- }
219
- return content;
220
- };
221
-
222
- AbstractChosen.prototype.result_add_option = function(option) {
223
- var classes, option_el;
224
- if (!option.search_match) {
225
- return '';
226
- }
227
- if (!this.include_option_in_results(option)) {
228
- return '';
229
- }
230
- classes = [];
231
- if (!option.disabled && !(option.selected && this.is_multiple)) {
232
- classes.push("active-result");
233
- }
234
- if (option.disabled && !(option.selected && this.is_multiple)) {
235
- classes.push("disabled-result");
236
- }
237
- if (option.selected) {
238
- classes.push("result-selected");
239
- }
240
- if (option.group_array_index != null) {
241
- classes.push("group-option");
242
- }
243
- if (option.classes !== "") {
244
- classes.push(option.classes);
245
- }
246
- option_el = document.createElement("li");
247
- option_el.className = classes.join(" ");
248
- option_el.style.cssText = option.style;
249
- option_el.setAttribute("data-option-array-index", option.array_index);
250
- option_el.innerHTML = option.search_text;
251
- return this.outerHTML(option_el);
252
- };
253
-
254
- AbstractChosen.prototype.result_add_group = function(group) {
255
- var group_el;
256
- if (!(group.search_match || group.group_match)) {
257
- return '';
258
- }
259
- if (!(group.active_options > 0)) {
260
- return '';
261
- }
262
- group_el = document.createElement("li");
263
- group_el.className = "group-result";
264
- group_el.innerHTML = group.search_text;
265
- return this.outerHTML(group_el);
266
- };
267
-
268
- AbstractChosen.prototype.results_update_field = function() {
269
- this.set_default_text();
270
- if (!this.is_multiple) {
271
- this.results_reset_cleanup();
272
- }
273
- this.result_clear_highlight();
274
- this.results_build();
275
- if (this.results_showing) {
276
- return this.winnow_results();
277
- }
278
- };
279
-
280
- AbstractChosen.prototype.reset_single_select_options = function() {
281
- var result, _i, _len, _ref, _results;
282
- _ref = this.results_data;
283
- _results = [];
284
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
285
- result = _ref[_i];
286
- if (result.selected) {
287
- _results.push(result.selected = false);
288
- } else {
289
- _results.push(void 0);
290
- }
291
- }
292
- return _results;
293
- };
294
-
295
- AbstractChosen.prototype.results_toggle = function() {
296
- if (this.results_showing) {
297
- return this.results_hide();
298
- } else {
299
- return this.results_show();
300
- }
301
- };
302
-
303
- AbstractChosen.prototype.results_search = function(evt) {
304
- if (this.results_showing) {
305
- return this.winnow_results();
306
- } else {
307
- return this.results_show();
308
- }
309
- };
310
-
311
- AbstractChosen.prototype.winnow_results = function() {
312
- var escapedSearchText, option, regex, regexAnchor, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
313
- this.no_results_clear();
314
- results = 0;
315
- searchText = this.get_search_text();
316
- escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
317
- regexAnchor = this.search_contains ? "" : "^";
318
- regex = new RegExp(regexAnchor + escapedSearchText, 'i');
319
- zregex = new RegExp(escapedSearchText, 'i');
320
- _ref = this.results_data;
321
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
322
- option = _ref[_i];
323
- option.search_match = false;
324
- results_group = null;
325
- if (this.include_option_in_results(option)) {
326
- if (option.group) {
327
- option.group_match = false;
328
- option.active_options = 0;
329
- }
330
- if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
331
- results_group = this.results_data[option.group_array_index];
332
- if (results_group.active_options === 0 && results_group.search_match) {
333
- results += 1;
334
- }
335
- results_group.active_options += 1;
336
- }
337
- if (!(option.group && !this.group_search)) {
338
- option.search_text = option.group ? option.label : option.html;
339
- option.search_match = this.search_string_match(option.search_text, regex);
340
- if (option.search_match && !option.group) {
341
- results += 1;
342
- }
343
- if (option.search_match) {
344
- if (searchText.length) {
345
- startpos = option.search_text.search(zregex);
346
- text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
347
- option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
348
- }
349
- if (results_group != null) {
350
- results_group.group_match = true;
351
- }
352
- } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
353
- option.search_match = true;
354
- }
355
- }
356
- }
357
- }
358
- this.result_clear_highlight();
359
- if (results < 1 && searchText.length) {
360
- this.update_results_content("");
361
- return this.no_results(searchText);
362
- } else {
363
- this.update_results_content(this.results_option_build());
364
- return this.winnow_results_set_highlight();
365
- }
366
- };
367
-
368
- AbstractChosen.prototype.search_string_match = function(search_string, regex) {
369
- var part, parts, _i, _len;
370
- if (regex.test(search_string)) {
371
- return true;
372
- } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
373
- parts = search_string.replace(/\[|\]/g, "").split(" ");
374
- if (parts.length) {
375
- for (_i = 0, _len = parts.length; _i < _len; _i++) {
376
- part = parts[_i];
377
- if (regex.test(part)) {
378
- return true;
379
- }
380
- }
381
- }
382
- }
383
- };
384
-
385
- AbstractChosen.prototype.choices_count = function() {
386
- var option, _i, _len, _ref;
387
- if (this.selected_option_count != null) {
388
- return this.selected_option_count;
389
- }
390
- this.selected_option_count = 0;
391
- _ref = this.form_field.options;
392
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
393
- option = _ref[_i];
394
- if (option.selected) {
395
- this.selected_option_count += 1;
396
- }
397
- }
398
- return this.selected_option_count;
399
- };
400
-
401
- AbstractChosen.prototype.choices_click = function(evt) {
402
- evt.preventDefault();
403
- if (!(this.results_showing || this.is_disabled)) {
404
- return this.results_show();
405
- }
406
- };
407
-
408
- AbstractChosen.prototype.keyup_checker = function(evt) {
409
- var stroke, _ref;
410
- stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
411
- this.search_field_scale();
412
- switch (stroke) {
413
- case 8:
414
- if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
415
- return this.keydown_backstroke();
416
- } else if (!this.pending_backstroke) {
417
- this.result_clear_highlight();
418
- return this.results_search();
419
- }
420
- break;
421
- case 13:
422
- evt.preventDefault();
423
- if (this.results_showing) {
424
- return this.result_select(evt);
425
- }
426
- break;
427
- case 27:
428
- if (this.results_showing) {
429
- this.results_hide();
430
- }
431
- return true;
432
- case 9:
433
- case 38:
434
- case 40:
435
- case 16:
436
- case 91:
437
- case 17:
438
- break;
439
- default:
440
- return this.results_search();
441
- }
442
- };
443
-
444
- AbstractChosen.prototype.clipboard_event_checker = function(evt) {
445
- var _this = this;
446
- return setTimeout((function() {
447
- return _this.results_search();
448
- }), 50);
449
- };
450
-
451
- AbstractChosen.prototype.container_width = function() {
452
- if (this.options.width != null) {
453
- return this.options.width;
454
- } else {
455
- return "" + this.form_field.offsetWidth + "px";
456
- }
457
- };
458
-
459
- AbstractChosen.prototype.include_option_in_results = function(option) {
460
- if (this.is_multiple && (!this.display_selected_options && option.selected)) {
461
- return false;
462
- }
463
- if (!this.display_disabled_options && option.disabled) {
464
- return false;
465
- }
466
- if (option.empty) {
467
- return false;
468
- }
469
- return true;
470
- };
471
-
472
- AbstractChosen.prototype.search_results_touchstart = function(evt) {
473
- this.touch_started = true;
474
- return this.search_results_mouseover(evt);
475
- };
476
-
477
- AbstractChosen.prototype.search_results_touchmove = function(evt) {
478
- this.touch_started = false;
479
- return this.search_results_mouseout(evt);
480
- };
481
-
482
- AbstractChosen.prototype.search_results_touchend = function(evt) {
483
- if (this.touch_started) {
484
- return this.search_results_mouseup(evt);
485
- }
486
- };
487
-
488
- AbstractChosen.prototype.outerHTML = function(element) {
489
- var tmp;
490
- if (element.outerHTML) {
491
- return element.outerHTML;
492
- }
493
- tmp = document.createElement("div");
494
- tmp.appendChild(element);
495
- return tmp.innerHTML;
496
- };
497
-
498
- AbstractChosen.browser_is_supported = function() {
499
- if (window.navigator.appName === "Microsoft Internet Explorer") {
500
- return document.documentMode >= 8;
501
- }
502
- if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
503
- return false;
504
- }
505
- if (/Android/i.test(window.navigator.userAgent)) {
506
- if (/Mobile/i.test(window.navigator.userAgent)) {
507
- return false;
508
- }
509
- }
510
- return true;
511
- };
512
-
513
- AbstractChosen.default_multiple_text = "Select Some Options";
514
-
515
- AbstractChosen.default_single_text = "Select an Option";
516
-
517
- AbstractChosen.default_no_result_text = "No results match";
518
-
519
- return AbstractChosen;
520
-
521
- })();
522
-
523
- $ = jQuery;
524
-
525
- $.fn.extend({
526
- chosen: function(options) {
527
- if (!AbstractChosen.browser_is_supported()) {
528
- return this;
529
- }
530
- return this.each(function(input_field) {
531
- var $this, chosen;
532
- $this = $(this);
533
- chosen = $this.data('chosen');
534
- if (options === 'destroy' && chosen) {
535
- chosen.destroy();
536
- } else if (!chosen) {
537
- $this.data('chosen', new Chosen(this, options));
538
- }
539
- });
540
- }
541
- });
542
-
543
- Chosen = (function(_super) {
544
- __extends(Chosen, _super);
545
-
546
- function Chosen() {
547
- _ref = Chosen.__super__.constructor.apply(this, arguments);
548
- return _ref;
549
- }
550
-
551
- Chosen.prototype.setup = function() {
552
- this.form_field_jq = $(this.form_field);
553
- this.current_selectedIndex = this.form_field.selectedIndex;
554
- return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
555
- };
556
-
557
- Chosen.prototype.set_up_html = function() {
558
- var container_classes, container_props;
559
- container_classes = ["chosen-container"];
560
- container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
561
- if (this.inherit_select_classes && this.form_field.className) {
562
- container_classes.push(this.form_field.className);
563
- }
564
- if (this.is_rtl) {
565
- container_classes.push("chosen-rtl");
566
- }
567
- container_props = {
568
- 'class': container_classes.join(' '),
569
- 'style': "width: " + (this.container_width()) + ";",
570
- 'title': this.form_field.title
571
- };
572
- if (this.form_field.id.length) {
573
- container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
574
- }
575
- this.container = $("<div />", container_props);
576
- if (this.is_multiple) {
577
- this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
578
- } else {
579
- this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
580
- }
581
- this.form_field_jq.hide().after(this.container);
582
- this.dropdown = this.container.find('div.chosen-drop').first();
583
- this.search_field = this.container.find('input').first();
584
- this.search_results = this.container.find('ul.chosen-results').first();
585
- this.search_field_scale();
586
- this.search_no_results = this.container.find('li.no-results').first();
587
- if (this.is_multiple) {
588
- this.search_choices = this.container.find('ul.chosen-choices').first();
589
- this.search_container = this.container.find('li.search-field').first();
590
- } else {
591
- this.search_container = this.container.find('div.chosen-search').first();
592
- this.selected_item = this.container.find('.chosen-single').first();
593
- }
594
- this.results_build();
595
- this.set_tab_index();
596
- this.set_label_behavior();
597
- return this.form_field_jq.trigger("chosen:ready", {
598
- chosen: this
599
- });
600
- };
601
-
602
- Chosen.prototype.register_observers = function() {
603
- var _this = this;
604
- this.container.bind('mousedown.chosen', function(evt) {
605
- _this.container_mousedown(evt);
606
- });
607
- this.container.bind('mouseup.chosen', function(evt) {
608
- _this.container_mouseup(evt);
609
- });
610
- this.container.bind('mouseenter.chosen', function(evt) {
611
- _this.mouse_enter(evt);
612
- });
613
- this.container.bind('mouseleave.chosen', function(evt) {
614
- _this.mouse_leave(evt);
615
- });
616
- this.search_results.bind('mouseup.chosen', function(evt) {
617
- _this.search_results_mouseup(evt);
618
- });
619
- this.search_results.bind('mouseover.chosen', function(evt) {
620
- _this.search_results_mouseover(evt);
621
- });
622
- this.search_results.bind('mouseout.chosen', function(evt) {
623
- _this.search_results_mouseout(evt);
624
- });
625
- this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
626
- _this.search_results_mousewheel(evt);
627
- });
628
- this.search_results.bind('touchstart.chosen', function(evt) {
629
- _this.search_results_touchstart(evt);
630
- });
631
- this.search_results.bind('touchmove.chosen', function(evt) {
632
- _this.search_results_touchmove(evt);
633
- });
634
- this.search_results.bind('touchend.chosen', function(evt) {
635
- _this.search_results_touchend(evt);
636
- });
637
- this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
638
- _this.results_update_field(evt);
639
- });
640
- this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
641
- _this.activate_field(evt);
642
- });
643
- this.form_field_jq.bind("chosen:open.chosen", function(evt) {
644
- _this.container_mousedown(evt);
645
- });
646
- this.form_field_jq.bind("chosen:close.chosen", function(evt) {
647
- _this.input_blur(evt);
648
- });
649
- this.search_field.bind('blur.chosen', function(evt) {
650
- _this.input_blur(evt);
651
- });
652
- this.search_field.bind('keyup.chosen', function(evt) {
653
- _this.keyup_checker(evt);
654
- });
655
- this.search_field.bind('keydown.chosen', function(evt) {
656
- _this.keydown_checker(evt);
657
- });
658
- this.search_field.bind('focus.chosen', function(evt) {
659
- _this.input_focus(evt);
660
- });
661
- this.search_field.bind('cut.chosen', function(evt) {
662
- _this.clipboard_event_checker(evt);
663
- });
664
- this.search_field.bind('paste.chosen', function(evt) {
665
- _this.clipboard_event_checker(evt);
666
- });
667
- if (this.is_multiple) {
668
- return this.search_choices.bind('click.chosen', function(evt) {
669
- _this.choices_click(evt);
670
- });
671
- } else {
672
- return this.container.bind('click.chosen', function(evt) {
673
- evt.preventDefault();
674
- });
675
- }
676
- };
677
-
678
- Chosen.prototype.destroy = function() {
679
- $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
680
- if (this.search_field[0].tabIndex) {
681
- this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
682
- }
683
- this.container.remove();
684
- this.form_field_jq.removeData('chosen');
685
- return this.form_field_jq.show();
686
- };
687
-
688
- Chosen.prototype.search_field_disabled = function() {
689
- this.is_disabled = this.form_field_jq[0].disabled;
690
- if (this.is_disabled) {
691
- this.container.addClass('chosen-disabled');
692
- this.search_field[0].disabled = true;
693
- if (!this.is_multiple) {
694
- this.selected_item.unbind("focus.chosen", this.activate_action);
695
- }
696
- return this.close_field();
697
- } else {
698
- this.container.removeClass('chosen-disabled');
699
- this.search_field[0].disabled = false;
700
- if (!this.is_multiple) {
701
- return this.selected_item.bind("focus.chosen", this.activate_action);
702
- }
703
- }
704
- };
705
-
706
- Chosen.prototype.container_mousedown = function(evt) {
707
- if (!this.is_disabled) {
708
- if (evt && evt.type === "mousedown" && !this.results_showing) {
709
- evt.preventDefault();
710
- }
711
- if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
712
- if (!this.active_field) {
713
- if (this.is_multiple) {
714
- this.search_field.val("");
715
- }
716
- $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
717
- this.results_show();
718
- } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
719
- evt.preventDefault();
720
- this.results_toggle();
721
- }
722
- return this.activate_field();
723
- }
724
- }
725
- };
726
-
727
- Chosen.prototype.container_mouseup = function(evt) {
728
- if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
729
- return this.results_reset(evt);
730
- }
731
- };
732
-
733
- Chosen.prototype.search_results_mousewheel = function(evt) {
734
- var delta;
735
- if (evt.originalEvent) {
736
- delta = -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
737
- }
738
- if (delta != null) {
739
- evt.preventDefault();
740
- if (evt.type === 'DOMMouseScroll') {
741
- delta = delta * 40;
742
- }
743
- return this.search_results.scrollTop(delta + this.search_results.scrollTop());
744
- }
745
- };
746
-
747
- Chosen.prototype.blur_test = function(evt) {
748
- if (!this.active_field && this.container.hasClass("chosen-container-active")) {
749
- return this.close_field();
750
- }
751
- };
752
-
753
- Chosen.prototype.close_field = function() {
754
- $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
755
- this.active_field = false;
756
- this.results_hide();
757
- this.container.removeClass("chosen-container-active");
758
- this.clear_backstroke();
759
- this.show_search_field_default();
760
- return this.search_field_scale();
761
- };
762
-
763
- Chosen.prototype.activate_field = function() {
764
- this.container.addClass("chosen-container-active");
765
- this.active_field = true;
766
- this.search_field.val(this.search_field.val());
767
- return this.search_field.focus();
768
- };
769
-
770
- Chosen.prototype.test_active_click = function(evt) {
771
- var active_container;
772
- active_container = $(evt.target).closest('.chosen-container');
773
- if (active_container.length && this.container[0] === active_container[0]) {
774
- return this.active_field = true;
775
- } else {
776
- return this.close_field();
777
- }
778
- };
779
-
780
- Chosen.prototype.results_build = function() {
781
- this.parsing = true;
782
- this.selected_option_count = null;
783
- this.results_data = SelectParser.select_to_array(this.form_field);
784
- if (this.is_multiple) {
785
- this.search_choices.find("li.search-choice").remove();
786
- } else if (!this.is_multiple) {
787
- this.single_set_selected_text();
788
- if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
789
- this.search_field[0].readOnly = true;
790
- this.container.addClass("chosen-container-single-nosearch");
791
- } else {
792
- this.search_field[0].readOnly = false;
793
- this.container.removeClass("chosen-container-single-nosearch");
794
- }
795
- }
796
- this.update_results_content(this.results_option_build({
797
- first: true
798
- }));
799
- this.search_field_disabled();
800
- this.show_search_field_default();
801
- this.search_field_scale();
802
- return this.parsing = false;
803
- };
804
-
805
- Chosen.prototype.result_do_highlight = function(el) {
806
- var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
807
- if (el.length) {
808
- this.result_clear_highlight();
809
- this.result_highlight = el;
810
- this.result_highlight.addClass("highlighted");
811
- maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
812
- visible_top = this.search_results.scrollTop();
813
- visible_bottom = maxHeight + visible_top;
814
- high_top = this.result_highlight.position().top + this.search_results.scrollTop();
815
- high_bottom = high_top + this.result_highlight.outerHeight();
816
- if (high_bottom >= visible_bottom) {
817
- return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
818
- } else if (high_top < visible_top) {
819
- return this.search_results.scrollTop(high_top);
820
- }
821
- }
822
- };
823
-
824
- Chosen.prototype.result_clear_highlight = function() {
825
- if (this.result_highlight) {
826
- this.result_highlight.removeClass("highlighted");
827
- }
828
- return this.result_highlight = null;
829
- };
830
-
831
- Chosen.prototype.results_show = function() {
832
- if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
833
- this.form_field_jq.trigger("chosen:maxselected", {
834
- chosen: this
835
- });
836
- return false;
837
- }
838
- this.container.addClass("chosen-with-drop");
839
- this.results_showing = true;
840
- this.search_field.focus();
841
- this.search_field.val(this.search_field.val());
842
- this.winnow_results();
843
- return this.form_field_jq.trigger("chosen:showing_dropdown", {
844
- chosen: this
845
- });
846
- };
847
-
848
- Chosen.prototype.update_results_content = function(content) {
849
- return this.search_results.html(content);
850
- };
851
-
852
- Chosen.prototype.results_hide = function() {
853
- if (this.results_showing) {
854
- this.result_clear_highlight();
855
- this.container.removeClass("chosen-with-drop");
856
- this.form_field_jq.trigger("chosen:hiding_dropdown", {
857
- chosen: this
858
- });
859
- }
860
- return this.results_showing = false;
861
- };
862
-
863
- Chosen.prototype.set_tab_index = function(el) {
864
- var ti;
865
- if (this.form_field.tabIndex) {
866
- ti = this.form_field.tabIndex;
867
- this.form_field.tabIndex = -1;
868
- return this.search_field[0].tabIndex = ti;
869
- }
870
- };
871
-
872
- Chosen.prototype.set_label_behavior = function() {
873
- var _this = this;
874
- this.form_field_label = this.form_field_jq.parents("label");
875
- if (!this.form_field_label.length && this.form_field.id.length) {
876
- this.form_field_label = $("label[for='" + this.form_field.id + "']");
877
- }
878
- if (this.form_field_label.length > 0) {
879
- return this.form_field_label.bind('click.chosen', function(evt) {
880
- if (_this.is_multiple) {
881
- return _this.container_mousedown(evt);
882
- } else {
883
- return _this.activate_field();
884
- }
885
- });
886
- }
887
- };
888
-
889
- Chosen.prototype.show_search_field_default = function() {
890
- if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
891
- this.search_field.val(this.default_text);
892
- return this.search_field.addClass("default");
893
- } else {
894
- this.search_field.val("");
895
- return this.search_field.removeClass("default");
896
- }
897
- };
898
-
899
- Chosen.prototype.search_results_mouseup = function(evt) {
900
- var target;
901
- target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
902
- if (target.length) {
903
- this.result_highlight = target;
904
- this.result_select(evt);
905
- return this.search_field.focus();
906
- }
907
- };
908
-
909
- Chosen.prototype.search_results_mouseover = function(evt) {
910
- var target;
911
- target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
912
- if (target) {
913
- return this.result_do_highlight(target);
914
- }
915
- };
916
-
917
- Chosen.prototype.search_results_mouseout = function(evt) {
918
- if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
919
- return this.result_clear_highlight();
920
- }
921
- };
922
-
923
- Chosen.prototype.choice_build = function(item) {
924
- var choice, close_link,
925
- _this = this;
926
- choice = $('<li />', {
927
- "class": "search-choice"
928
- }).html("<span>" + item.html + "</span>");
929
- if (item.disabled) {
930
- choice.addClass('search-choice-disabled');
931
- } else {
932
- close_link = $('<a />', {
933
- "class": 'search-choice-close',
934
- 'data-option-array-index': item.array_index
935
- });
936
- close_link.bind('click.chosen', function(evt) {
937
- return _this.choice_destroy_link_click(evt);
938
- });
939
- choice.append(close_link);
940
- }
941
- return this.search_container.before(choice);
942
- };
943
-
944
- Chosen.prototype.choice_destroy_link_click = function(evt) {
945
- evt.preventDefault();
946
- evt.stopPropagation();
947
- if (!this.is_disabled) {
948
- return this.choice_destroy($(evt.target));
949
- }
950
- };
951
-
952
- Chosen.prototype.choice_destroy = function(link) {
953
- if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
954
- this.show_search_field_default();
955
- if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
956
- this.results_hide();
957
- }
958
- link.parents('li').first().remove();
959
- return this.search_field_scale();
960
- }
961
- };
962
-
963
- Chosen.prototype.results_reset = function() {
964
- this.reset_single_select_options();
965
- this.form_field.options[0].selected = true;
966
- this.single_set_selected_text();
967
- this.show_search_field_default();
968
- this.results_reset_cleanup();
969
- this.form_field_jq.trigger("change");
970
- if (this.active_field) {
971
- return this.results_hide();
972
- }
973
- };
974
-
975
- Chosen.prototype.results_reset_cleanup = function() {
976
- this.current_selectedIndex = this.form_field.selectedIndex;
977
- return this.selected_item.find("abbr").remove();
978
- };
979
-
980
- Chosen.prototype.result_select = function(evt) {
981
- var high, item;
982
- if (this.result_highlight) {
983
- high = this.result_highlight;
984
- this.result_clear_highlight();
985
- if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
986
- this.form_field_jq.trigger("chosen:maxselected", {
987
- chosen: this
988
- });
989
- return false;
990
- }
991
- if (this.is_multiple) {
992
- high.removeClass("active-result");
993
- } else {
994
- this.reset_single_select_options();
995
- }
996
- item = this.results_data[high[0].getAttribute("data-option-array-index")];
997
- item.selected = true;
998
- this.form_field.options[item.options_index].selected = true;
999
- this.selected_option_count = null;
1000
- if (this.is_multiple) {
1001
- this.choice_build(item);
1002
- } else {
1003
- this.single_set_selected_text(item.text);
1004
- }
1005
- if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
1006
- this.results_hide();
1007
- }
1008
- this.search_field.val("");
1009
- if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1010
- this.form_field_jq.trigger("change", {
1011
- 'selected': this.form_field.options[item.options_index].value
1012
- });
1013
- }
1014
- this.current_selectedIndex = this.form_field.selectedIndex;
1015
- return this.search_field_scale();
1016
- }
1017
- };
1018
-
1019
- Chosen.prototype.single_set_selected_text = function(text) {
1020
- if (text == null) {
1021
- text = this.default_text;
1022
- }
1023
- if (text === this.default_text) {
1024
- this.selected_item.addClass("chosen-default");
1025
- } else {
1026
- this.single_deselect_control_build();
1027
- this.selected_item.removeClass("chosen-default");
1028
- }
1029
- return this.selected_item.find("span").text(text);
1030
- };
1031
-
1032
- Chosen.prototype.result_deselect = function(pos) {
1033
- var result_data;
1034
- result_data = this.results_data[pos];
1035
- if (!this.form_field.options[result_data.options_index].disabled) {
1036
- result_data.selected = false;
1037
- this.form_field.options[result_data.options_index].selected = false;
1038
- this.selected_option_count = null;
1039
- this.result_clear_highlight();
1040
- if (this.results_showing) {
1041
- this.winnow_results();
1042
- }
1043
- this.form_field_jq.trigger("change", {
1044
- deselected: this.form_field.options[result_data.options_index].value
1045
- });
1046
- this.search_field_scale();
1047
- return true;
1048
- } else {
1049
- return false;
1050
- }
1051
- };
1052
-
1053
- Chosen.prototype.single_deselect_control_build = function() {
1054
- if (!this.allow_single_deselect) {
1055
- return;
1056
- }
1057
- if (!this.selected_item.find("abbr").length) {
1058
- this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
1059
- }
1060
- return this.selected_item.addClass("chosen-single-with-deselect");
1061
- };
1062
-
1063
- Chosen.prototype.get_search_text = function() {
1064
- if (this.search_field.val() === this.default_text) {
1065
- return "";
1066
- } else {
1067
- return $('<div/>').text($.trim(this.search_field.val())).html();
1068
- }
1069
- };
1070
-
1071
- Chosen.prototype.winnow_results_set_highlight = function() {
1072
- var do_high, selected_results;
1073
- selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
1074
- do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
1075
- if (do_high != null) {
1076
- return this.result_do_highlight(do_high);
1077
- }
1078
- };
1079
-
1080
- Chosen.prototype.no_results = function(terms) {
1081
- var no_results_html;
1082
- no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
1083
- no_results_html.find("span").first().html(terms);
1084
- this.search_results.append(no_results_html);
1085
- return this.form_field_jq.trigger("chosen:no_results", {
1086
- chosen: this
1087
- });
1088
- };
1089
-
1090
- Chosen.prototype.no_results_clear = function() {
1091
- return this.search_results.find(".no-results").remove();
1092
- };
1093
-
1094
- Chosen.prototype.keydown_arrow = function() {
1095
- var next_sib;
1096
- if (this.results_showing && this.result_highlight) {
1097
- next_sib = this.result_highlight.nextAll("li.active-result").first();
1098
- if (next_sib) {
1099
- return this.result_do_highlight(next_sib);
1100
- }
1101
- } else {
1102
- return this.results_show();
1103
- }
1104
- };
1105
-
1106
- Chosen.prototype.keyup_arrow = function() {
1107
- var prev_sibs;
1108
- if (!this.results_showing && !this.is_multiple) {
1109
- return this.results_show();
1110
- } else if (this.result_highlight) {
1111
- prev_sibs = this.result_highlight.prevAll("li.active-result");
1112
- if (prev_sibs.length) {
1113
- return this.result_do_highlight(prev_sibs.first());
1114
- } else {
1115
- if (this.choices_count() > 0) {
1116
- this.results_hide();
1117
- }
1118
- return this.result_clear_highlight();
1119
- }
1120
- }
1121
- };
1122
-
1123
- Chosen.prototype.keydown_backstroke = function() {
1124
- var next_available_destroy;
1125
- if (this.pending_backstroke) {
1126
- this.choice_destroy(this.pending_backstroke.find("a").first());
1127
- return this.clear_backstroke();
1128
- } else {
1129
- next_available_destroy = this.search_container.siblings("li.search-choice").last();
1130
- if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
1131
- this.pending_backstroke = next_available_destroy;
1132
- if (this.single_backstroke_delete) {
1133
- return this.keydown_backstroke();
1134
- } else {
1135
- return this.pending_backstroke.addClass("search-choice-focus");
1136
- }
1137
- }
1138
- }
1139
- };
1140
-
1141
- Chosen.prototype.clear_backstroke = function() {
1142
- if (this.pending_backstroke) {
1143
- this.pending_backstroke.removeClass("search-choice-focus");
1144
- }
1145
- return this.pending_backstroke = null;
1146
- };
1147
-
1148
- Chosen.prototype.keydown_checker = function(evt) {
1149
- var stroke, _ref1;
1150
- stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
1151
- this.search_field_scale();
1152
- if (stroke !== 8 && this.pending_backstroke) {
1153
- this.clear_backstroke();
1154
- }
1155
- switch (stroke) {
1156
- case 8:
1157
- this.backstroke_length = this.search_field.val().length;
1158
- break;
1159
- case 9:
1160
- if (this.results_showing && !this.is_multiple) {
1161
- this.result_select(evt);
1162
- }
1163
- this.mouse_on_container = false;
1164
- break;
1165
- case 13:
1166
- evt.preventDefault();
1167
- break;
1168
- case 38:
1169
- evt.preventDefault();
1170
- this.keyup_arrow();
1171
- break;
1172
- case 40:
1173
- evt.preventDefault();
1174
- this.keydown_arrow();
1175
- break;
1176
- }
1177
- };
1178
-
1179
- Chosen.prototype.search_field_scale = function() {
1180
- var div, f_width, h, style, style_block, styles, w, _i, _len;
1181
- if (this.is_multiple) {
1182
- h = 0;
1183
- w = 0;
1184
- style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1185
- styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1186
- for (_i = 0, _len = styles.length; _i < _len; _i++) {
1187
- style = styles[_i];
1188
- style_block += style + ":" + this.search_field.css(style) + ";";
1189
- }
1190
- div = $('<div />', {
1191
- 'style': style_block
1192
- });
1193
- div.text(this.search_field.val());
1194
- $('body').append(div);
1195
- w = div.width() + 25;
1196
- div.remove();
1197
- f_width = this.container.outerWidth();
1198
- if (w > f_width - 10) {
1199
- w = f_width - 10;
1200
- }
1201
- return this.search_field.css({
1202
- 'width': w + 'px'
1203
- });
1204
- }
1205
- };
1206
-
1207
- return Chosen;
1208
-
1209
- })(AbstractChosen);
1210
-
1211
- }).call(this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/assets/js/how-to.js CHANGED
@@ -1,6 +1,6 @@
1
- (function($){
2
- var how_to_link = $('#yith-how-to-premium').parent();
3
- if( typeof how_to_link != 'undefined' ){
4
  how_to_link.prop( 'target', '_blank' );
5
  }
6
- })(jQuery);
1
+ (function ( $ ) {
2
+ var how_to_link = $( '#yith-how-to-premium' ).parent();
3
+ if ( typeof how_to_link != 'undefined' ) {
4
  how_to_link.prop( 'target', '_blank' );
5
  }
6
+ })( jQuery );
plugin-fw/assets/js/how-to.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(a){a=a("#yith-how-to-premium").parent();"undefined"!=typeof a&&a.prop("target","_blank")})(jQuery);
plugin-fw/assets/js/jquery.colorbox.js CHANGED
@@ -1102,4 +1102,4 @@
1102
 
1103
  publicMethod.settings = defaults;
1104
 
1105
- }(jQuery, document, window));
1102
 
1103
  publicMethod.settings = defaults;
1104
 
1105
+ }(jQuery, document, window));
plugin-fw/assets/js/jquery.colorbox.min.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function(c,p,A){function g(a,d,F){a=p.createElement(a);d&&(a.id="cbox"+d);F&&(a.style.cssText=F);return c(a)}function R(){return A.innerHeight?A.innerHeight:c(A).height()}function M(a,d){d!==Object(d)&&(d={});this.cache={};this.el=a;this.value=function(a){var b;void 0===this.cache[a]&&(b=c(this.el).attr("data-cbox-"+a),void 0!==b?this.cache[a]=b:void 0!==d[a]?this.cache[a]=d[a]:void 0!==S[a]&&(this.cache[a]=S[a]));return this.cache[a]};this.get=function(a){a=this.value(a);return c.isFunction(a)?
2
+ a.call(this.el,this):a}}function N(a){var d=k.length;a=(m+a)%d;return 0>a?d+a:a}function n(a,d){return Math.round((/%/.test(a)?("x"===d?w.width():R())/100:1)*parseInt(a,10))}function da(a,d){return a.get("photo")||a.get("photoRegex").test(d)}function ea(a,d){return a.get("retinaUrl")&&1<A.devicePixelRatio?d.replace(a.get("photoRegex"),a.get("retinaSuffix")):d}function fa(a){"contains"in f[0]&&!f[0].contains(a.target)&&a.target!==q[0]&&(a.stopPropagation(),f.focus())}function G(a){G.str!==a&&(f.add(q).removeClass(G.str).addClass(a),
3
+ G.str=a)}function ja(b){m=0;b&&!1!==b&&"nofollow"!==b?(k=c(".cboxElement").filter(function(){var a=c.data(this,"colorbox");return(new M(this,a)).get("rel")===b}),m=k.index(a.el),-1===m&&(k=k.add(a.el),m=k.length-1)):k=c(a.el)}function C(a){c(p).trigger(a);r.triggerHandler(a)}function O(b){var d;if(!H){d=c(b).data("colorbox");a=new M(b,d);ja(a.get("rel"));if(!x){x=I=!0;G(a.get("className"));f.css({visibility:"hidden",display:"block",opacity:""});h=g("div","LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden");
4
+ u.css({width:"",height:""}).append(h);t=T.height()+U.height()+u.outerHeight(!0)-u.height();v=V.width()+W.width()+u.outerWidth(!0)-u.width();y=h.outerHeight(!0);z=h.outerWidth(!0);b=n(a.get("initialWidth"),"x");d=n(a.get("initialHeight"),"y");var F=a.get("maxWidth"),B=a.get("maxHeight");a.w=Math.max((!1!==F?Math.min(b,n(F,"x")):b)-z-v,0);a.h=Math.max((!1!==B?Math.min(d,n(B,"y")):d)-y-t,0);h.css({width:"",height:a.h});l.position();C("cbox_open");a.get("onOpen");X.add(Y).hide();f.focus();a.get("trapFocus")&&
5
+ p.addEventListener&&(p.addEventListener("focus",fa,!0),r.one("cbox_closed",function(){p.removeEventListener("focus",fa,!0)}));if(a.get("returnFocus"))r.one("cbox_closed",function(){c(a.el).focus()})}b=parseFloat(a.get("opacity"));q.css({opacity:b===b?b:"",cursor:a.get("overlayClose")?"pointer":"",visibility:"visible"}).show();a.get("closeButton")?P.html(a.get("close")).appendTo(u):P.appendTo("<div/>");ka()}}function ga(){f||(Z=!1,w=c(A),f=g("div").attr({id:"colorbox","class":!1===c.support.opacity?
6
+ "cboxIE":"",role:"dialog",tabindex:"-1"}).hide(),q=g("div","Overlay").hide(),Q=c([g("div","LoadingOverlay")[0],g("div","LoadingGraphic")[0]]),D=g("div","Wrapper"),u=g("div","Content").append(Y=g("div","Title"),aa=g("div","Current"),J=c('<button type="button"/>').attr({id:"cboxPrevious"}),K=c('<button type="button"/>').attr({id:"cboxNext"}),E=g("button","Slideshow"),Q),P=c('<button type="button"/>').attr({id:"cboxClose"}),D.append(g("div").append(g("div","TopLeft"),T=g("div","TopCenter"),g("div","TopRight")),
7
+ g("div",!1,"clear:left").append(V=g("div","MiddleLeft"),u,W=g("div","MiddleRight")),g("div",!1,"clear:left").append(g("div","BottomLeft"),U=g("div","BottomCenter"),g("div","BottomRight"))).find("div div").css({"float":"left"}),L=g("div",!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),X=K.add(J).add(aa).add(E));p.body&&!f.parent().length&&c(p.body).append(q,f.append(D,L))}function la(){function b(a){1<a.which||a.shiftKey||a.altKey||a.metaKey||a.ctrlKey||(a.preventDefault(),
8
+ O(this))}if(f){if(!Z)if(Z=!0,K.click(function(){l.next()}),J.click(function(){l.prev()}),P.click(function(){l.close()}),q.click(function(){a.get("overlayClose")&&l.close()}),c(p).bind("keydown.cbox",function(b){var c=b.keyCode;x&&a.get("escKey")&&27===c&&(b.preventDefault(),l.close());x&&a.get("arrowKey")&&k[1]&&!b.altKey&&(37===c?(b.preventDefault(),J.click()):39===c&&(b.preventDefault(),K.click()))}),c.isFunction(c.fn.on))c(p).on("click.cbox",".cboxElement",b);else c(".cboxElement").live("click.cbox",
9
+ b);return!0}return!1}function ka(){var b,d,f=l.prep,B,h=++ba;I=!0;e=!1;C("cbox_purge");C("cbox_load");a.get("onLoad");a.h=a.get("height")?n(a.get("height"),"y")-y-t:a.get("innerHeight")&&n(a.get("innerHeight"),"y");a.w=a.get("width")?n(a.get("width"),"x")-z-v:a.get("innerWidth")&&n(a.get("innerWidth"),"x");a.mw=a.w;a.mh=a.h;a.get("maxWidth")&&(a.mw=n(a.get("maxWidth"),"x")-z-v,a.mw=a.w&&a.w<a.mw?a.w:a.mw);a.get("maxHeight")&&(a.mh=n(a.get("maxHeight"),"y")-y-t,a.mh=a.h&&a.h<a.mh?a.h:a.mh);b=a.get("href");
10
+ ha=setTimeout(function(){Q.show()},100);if(a.get("inline")){var ca=c(b);B=c("<div>").hide().insertBefore(ca);r.one("cbox_purge",function(){B.replaceWith(ca)});f(ca)}else a.get("iframe")?f(" "):a.get("html")?f(a.get("html")):da(a,b)?(b=ea(a,b),e=a.get("createImg"),c(e).addClass("cboxPhoto").bind("error.cbox",function(){f(g("div","Error").html(a.get("imgError")))}).one("load",function(){h===ba&&setTimeout(function(){var b;a.get("retinaImage")&&1<A.devicePixelRatio&&(e.height/=A.devicePixelRatio,e.width/=
11
+ A.devicePixelRatio);a.get("scalePhotos")&&(d=function(){e.height-=e.height*b;e.width-=e.width*b},a.mw&&e.width>a.mw&&(b=(e.width-a.mw)/e.width,d()),a.mh&&e.height>a.mh&&(b=(e.height-a.mh)/e.height,d()));a.h&&(e.style.marginTop=Math.max(a.mh-e.height,0)/2+"px");k[1]&&(a.get("loop")||k[m+1])&&(e.style.cursor="pointer",c(e).bind("click.cbox",function(){l.next()}));e.style.width=e.width+"px";e.style.height=e.height+"px";f(e)},1)}),e.src=b):b&&L.load(b,a.get("data"),function(b,d){h===ba&&f("error"===d?
12
+ g("div","Error").html(a.get("xhrError")):c(this).contents())})}var S={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,
13
+ slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return c(this).attr("href")},
14
+ title:function(){return this.title},createImg:function(){var a=new Image,d=c(this).data("cbox-img-attrs");"object"===typeof d&&c.each(d,function(c,d){a[c]=d});return a},createIframe:function(){var a=p.createElement("iframe"),d=c(this).data("cbox-iframe-attrs");"object"===typeof d&&c.each(d,function(c,d){a[c]=d});"frameBorder"in a&&(a.frameBorder=0);"allowTransparency"in a&&(a.allowTransparency="true");a.name=(new Date).getTime();a.allowFullscreen=!0;return a}},q,f,D,u,T,V,W,U,k,w,h,L,Q,Y,aa,E,K,J,
15
+ P,X,r=c("<a/>"),a,t,v,y,z,m,e,x,I,H,ha,l,ba=0,ia={},Z,ma=function(){function b(){clearTimeout(n)}function c(){if(a.get("loop")||k[m+1])b(),n=setTimeout(l.next,a.get("slideshowSpeed"))}function e(){E.html(a.get("slideshowStop")).unbind("click.cbox").one("click.cbox",B);r.bind("cbox_complete",c).bind("cbox_load",b);f.removeClass("cboxSlideshow_off").addClass("cboxSlideshow_on")}function B(){b();r.unbind("cbox_complete",c).unbind("cbox_load",b);E.html(a.get("slideshowStart")).unbind("click.cbox").one("click.cbox",
16
+ function(){l.next();e()});f.removeClass("cboxSlideshow_on").addClass("cboxSlideshow_off")}function g(){h=!1;E.hide();b();r.unbind("cbox_complete",c).unbind("cbox_load",b);f.removeClass("cboxSlideshow_off cboxSlideshow_on")}var h,n;return function(){h?a.get("slideshow")||(r.unbind("cbox_cleanup",g),g()):a.get("slideshow")&&k[1]&&(h=!0,r.one("cbox_cleanup",g),a.get("slideshowAuto")?e():B(),E.show())}}();c.colorbox||(c(ga),l=c.fn.colorbox=c.colorbox=function(a,d){var f,e=this;a=a||{};c.isFunction(e)&&
17
+ (e=c("<a/>"),a.open=!0);if(!e[0])return e;ga();la()&&(d&&(a.onComplete=d),e.each(function(){var d=c.data(this,"colorbox")||{};c.data(this,"colorbox",c.extend(d,a))}).addClass("cboxElement"),f=new M(e[0],a),f.get("open")&&O(e[0]));return e},l.position=function(b,d){function e(){T[0].style.width=U[0].style.width=u[0].style.width=parseInt(f[0].style.width,10)-v+"px";u[0].style.height=V[0].style.height=W[0].style.height=parseInt(f[0].style.height,10)-t+"px"}var g,h=0,k=0,m=f.offset(),p,r;w.unbind("resize.cbox");
18
+ f.css({top:-9E4,left:-9E4});p=w.scrollTop();r=w.scrollLeft();a.get("fixed")?(m.top-=p,m.left-=r,f.css({position:"fixed"})):(h=p,k=r,f.css({position:"absolute"}));k=!1!==a.get("right")?k+Math.max(w.width()-a.w-z-v-n(a.get("right"),"x"),0):!1!==a.get("left")?k+n(a.get("left"),"x"):k+Math.round(Math.max(w.width()-a.w-z-v,0)/2);h=!1!==a.get("bottom")?h+Math.max(R()-a.h-y-t-n(a.get("bottom"),"y"),0):!1!==a.get("top")?h+n(a.get("top"),"y"):h+Math.round(Math.max(R()-a.h-y-t,0)/2);f.css({top:m.top,left:m.left,
19
+ visibility:"visible"});D[0].style.width=D[0].style.height="9999px";g={width:a.w+z+v,height:a.h+y+t,top:h,left:k};if(b){var q=0;c.each(g,function(a){g[a]!==ia[a]&&(q=b)});b=q}ia=g;b||f.css(g);f.dequeue().animate(g,{duration:b||0,complete:function(){e();I=!1;D[0].style.width=a.w+z+v+"px";D[0].style.height=a.h+y+t+"px";a.get("reposition")&&setTimeout(function(){w.bind("resize.cbox",l.position)},1);c.isFunction(d)&&d()},step:e})},l.resize=function(b){var c;x&&(b=b||{},b.width&&(a.w=n(b.width,"x")-z-v),
20
+ b.innerWidth&&(a.w=n(b.innerWidth,"x")),h.css({width:a.w}),b.height&&(a.h=n(b.height,"y")-y-t),b.innerHeight&&(a.h=n(b.innerHeight,"y")),b.innerHeight||b.height||(c=h.scrollTop(),h.css({height:"auto"}),a.h=h.height()),h.css({height:a.h}),c&&h.scrollTop(c),l.position("none"===a.get("transition")?0:a.get("speed")))},l.prep=function(b){function d(){a.w=a.w||h.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}function n(){a.h=a.h||h.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}if(x){var q,t="none"===
21
+ a.get("transition")?0:a.get("speed");h.remove();h=g("div","LoadedContent").append(b);h.hide().appendTo(L.show()).css({width:d(),overflow:a.get("scrolling")?"auto":"hidden"}).css({height:n()}).prependTo(u);L.hide();c(e).css({"float":"none"});G(a.get("className"));q=function(){function b(){!1===c.support.opacity&&f[0].style.removeAttribute("filter")}var d=k.length,e,g;x&&(g=function(){clearTimeout(ha);Q.hide();C("cbox_complete");a.get("onComplete")},Y.html(a.get("title")).show(),h.show(),1<d?("string"===
22
+ typeof a.get("current")&&aa.html(a.get("current").replace("{current}",m+1).replace("{total}",d)).show(),K[a.get("loop")||m<d-1?"show":"hide"]().html(a.get("next")),J[a.get("loop")||m?"show":"hide"]().html(a.get("previous")),ma(),a.get("preloading")&&c.each([N(-1),N(1)],function(){var a,b=k[this];a=new M(b,c.data(b,"colorbox"));(b=a.get("href"))&&da(a,b)&&(b=ea(a,b),a=p.createElement("img"),a.src=b)})):X.hide(),a.get("iframe")?(e=a.get("createIframe"),a.get("scrolling")||(e.scrolling="no"),c(e).attr({src:a.get("href"),
23
+ "class":"cboxIframe"}).one("load",g).appendTo(h),r.one("cbox_purge",function(){e.src="//about:blank"}),a.get("fastIframe")&&c(e).trigger("load")):g(),"fade"===a.get("transition")?f.fadeTo(t,1,b):b())};"fade"===a.get("transition")?f.fadeTo(t,0,function(){l.position(0,q)}):l.position(t,q)}},l.next=function(){!I&&k[1]&&(a.get("loop")||k[m+1])&&(m=N(1),O(k[m]))},l.prev=function(){!I&&k[1]&&(a.get("loop")||m)&&(m=N(-1),O(k[m]))},l.close=function(){x&&!H&&(H=!0,x=!1,C("cbox_cleanup"),a.get("onCleanup"),
24
+ w.unbind(".cbox"),q.fadeTo(a.get("fadeOut")||0,0),f.stop().fadeTo(a.get("fadeOut")||0,0,function(){f.hide();q.hide();C("cbox_purge");h.remove();setTimeout(function(){H=!1;C("cbox_closed");a.get("onClosed")},1)}))},l.remove=function(){f&&(f.stop(),c.colorbox.close(),f.stop(!1,!0).remove(),q.remove(),H=!1,f=null,c(".cboxElement").removeData("colorbox").removeClass("cboxElement"),c(p).unbind("click.cbox").unbind("keydown.cbox"))},l.element=function(){return c(a.el)},l.settings=S)})(jQuery,document,window);
plugin-fw/assets/js/metabox.js CHANGED
@@ -28,147 +28,13 @@
28
 
29
  var t = $(this).attr('href');
30
  $(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
31
- $(this).closest('.metaboxes-tab').find('.tabs-panel').slideUp('fast');
32
- $(t).delay(350).slideDown('fast');
33
 
34
  return false;
35
  });
36
  });
37
 
38
- //upload
39
- var _custom_media = true,
40
- _orig_send_attachment = wp.media.editor.send.attachment;
41
-
42
- $(document).on('click', '.metaboxes-tab .upload_button', function(e) {
43
- var send_attachment_bkp = wp.media.editor.send.attachment;
44
- var button = $(this);
45
- if( typeof button.attr('id') != 'undefined' ) {
46
-
47
- var id = button.attr('id').replace('-button', '');
48
- _custom_media = true;
49
- wp.media.editor.send.attachment = function(props, attachment){
50
- if ( _custom_media ) {
51
- if( $("#"+id).is('input[type=text]') ) {
52
- $("#"+id).val(attachment.url);
53
- } else {
54
- $("#"+id + '_custom').val(attachment.url);
55
- }
56
- } else {
57
- return _orig_send_attachment.apply( this, [props, attachment] );
58
- };
59
- }
60
-
61
- wp.media.editor.open(button);
62
- return false;
63
- }
64
-
65
- });
66
-
67
- $('.metaboxes-tab .add_media').on('click', function(){
68
- _custom_media = false;
69
- });
70
-
71
- //colorpicker
72
- $('.metaboxes-tab .panel-colorpicker').wpColorPicker({
73
- onInit: function(){ console.log('test');},
74
- change: function(event, ui){
75
- },
76
- clear: function(){
77
- var input = $(this);
78
- input.val(input.data('default-color'));
79
- input.change();
80
- }
81
- });
82
-
83
-
84
- $('.metaboxes-tab .panel-colorpicker').each( function() {
85
- var select_label = $(this).data('variations-label');
86
- $(this).parent().parent().find('a.wp-color-result').attr('title', select_label);
87
- });
88
-
89
- //datepicker
90
- $('.metaboxes-tab .panel-datepicker').each( function() {
91
- $(this).datepicker();
92
- });
93
-
94
-
95
- // select
96
- var select_value = function() {
97
- var value = '';
98
-
99
- if( $(this).attr('multiple')){
100
- $(this).children("option:selected").each(function(i,v){
101
- if( i != 0)
102
- value += ', ';
103
-
104
- value += $(v).text();
105
- });
106
-
107
- if( value == '' ){
108
- $(this).children().children("option:selected").each(function(i,v){
109
- if( i != 0)
110
- value += ', ';
111
-
112
- value += $(v).text();
113
- });
114
- }
115
- }
116
- else{
117
- value = $(this).children("option:selected").text();
118
-
119
- if( value == '' )
120
- value = $(this).children().children("option:selected").text();
121
- }
122
-
123
-
124
- if ( $(this).parent().find('span').length <= 0 ) {
125
- $(this).before('<span></span>');
126
- }
127
-
128
- $(this).parent().children('span').replaceWith('<span>'+value +'</span>');
129
- };
130
- $('.metaboxes-tab .select_wrapper select').not('.chosen').each(select_value).change(select_value);
131
-
132
- //Open select multiple
133
- $('.metaboxes-tab .select_wrapper').click( function(e){
134
- e.stopPropagation();
135
- $(this).find('select[multiple]').not('.chosen').toggle();
136
- });
137
- //Stops click propagation on select, to prevent select hide
138
- $('.metaboxes-tab .select_wrapper select[multiple]').not('.chosen').click( function(e){
139
- e.stopPropagation();
140
- });
141
- //Hides select on window click
142
- $(window).click(function(){
143
- $('.metaboxes-tab .select_wrapper select[multiple]').not('.chosen').hide();
144
- })
145
-
146
- //chosen
147
- $('.metaboxes-tab .chosen .select_wrapper select').chosen();
148
-
149
-
150
- $('.metaboxes-tab .slider_container .ui-slider-horizontal').each(function(){
151
- var val = $(this).data('val');
152
- var minValue = $(this).data('min');
153
- var maxValue = $(this).data('max');
154
- var step = $(this).data('step');
155
- var labels = $(this).data('labels');
156
-
157
- $(this).slider({
158
- value: val,
159
- min: minValue,
160
- max: maxValue,
161
- range: 'min',
162
- step: step,
163
-
164
- slide: function( event, ui ) {
165
- $(this).find('input').val( ui.value );
166
- $(this).siblings('.feedback').find('strong' ).text( ui.value + labels );
167
- }
168
- });
169
- });
170
-
171
-
172
  var act_page_option = $('#_active_page_options-container').parent().html();
173
  $('#_active_page_options-container').parent().remove();
174
  $(act_page_option).insertAfter('#yit-post-setting .handlediv');
@@ -185,23 +51,24 @@
185
 
186
 
187
  //dependencies handler
188
- $('.metaboxes-tab [data-field]').each(function(){
189
  var t = $(this);
190
 
191
- var field = '#' + t.data('field'),
192
- dep = '#' + t.data('dep'),
193
- value = t.data('value');
 
194
 
195
 
196
- dependencies_handler( field, dep, value.toString() );
197
 
198
  $(dep).on('change', function(){
199
- dependencies_handler( field, dep, value.toString() );
200
  }).change();
201
  });
202
 
203
  //Handle dependencies.
204
- function dependencies_handler ( id, deps, values ) {
205
  var result = true;
206
 
207
 
@@ -222,7 +89,7 @@
222
  }
223
  }
224
 
225
- var values = values.split( ',' );
226
 
227
  for( var i = 0; i < values.length; i++ ) {
228
  if( val != values[i] )
@@ -232,124 +99,40 @@
232
  }
233
  }
234
 
235
- if( !result ) {
236
- $( id + '-container' ).parent().hide();
237
- } else {
238
- $( id + '-container' ).parent().show();
239
- }
240
- };
241
-
242
- // Image gallery
243
- $(document).on('click', '.image-gallery-button', function (e) {
244
- var $t = $(this),
245
- $container = $t.closest('.image-gallery'),
246
- $image_gallery_ids = $container.find('.image_gallery_ids'),
247
- attachment_ids = $image_gallery_ids.val(),
248
- $gallery_images_wrapper = $container.find('ul.slides-wrapper');
249
-
250
-
251
- // Create the media frame.
252
- var image_gallery_frame = wp.media.frames.image_gallery = wp.media({
253
- // Set the title of the modal.
254
- title : $t.data('choose'),
255
- button: {
256
- text: $t.data('update')
257
- },
258
- states: [
259
- new wp.media.controller.Library({
260
- title : $t.data('choose'),
261
- filterable: 'all',
262
- multiple : true
263
- })
264
- ]
265
- });
266
-
267
- // When an image is selected, run a callback.
268
- image_gallery_frame.on('select', function () {
269
- var selection = image_gallery_frame.state().get('selection');
270
- selection.map(function (attachment) {
271
- attachment = attachment.toJSON();
272
-
273
- if (attachment.id) {
274
- attachment_ids = attachment_ids ? attachment_ids + "," + attachment.id : attachment.id;
275
- $gallery_images_wrapper.append('<li class="image" data-attachment_id="' + attachment.id + '"><img src="' + attachment.sizes.thumbnail.url + '"/><ul class="actions"><li><a href="#" class="delete" title="' + $t.data('delete') + '">x</a></li></ul></li>');
276
  }
277
- });
278
-
279
- $image_gallery_ids.val(attachment_ids);
280
- });
281
-
282
- image_gallery_frame.open();
283
-
284
- });
285
-
286
- // Image ordering
287
- $('.image-gallery ul.slides-wrapper').each(function(){
288
- var $t = $(this);
289
- $t.sortable({
290
- items : 'li.image',
291
- cursor : 'move',
292
- scrollSensitivity : 40,
293
- forcePlaceholderSize: true,
294
- forceHelperSize : false,
295
- helper : 'clone',
296
- opacity : 0.65,
297
- start : function (event, ui) {
298
- ui.item.css('background-color', '#f6f6f6');
299
- },
300
- stop : function (event, ui) {
301
- ui.item.removeAttr('style');
302
- },
303
- update : function (event, ui) {
304
- var attachment_ids = '';
305
-
306
- $t.find('li.image').css('cursor', 'default').each(function () {
307
- var attachment_id = $(this).attr('data-attachment_id');
308
- attachment_ids = attachment_ids + attachment_id + ',';
309
- });
310
 
311
- $t.closest('.image-gallery').find('.image_gallery_ids').val(attachment_ids);
 
 
 
 
 
 
 
 
 
 
 
312
  }
313
- });
314
- });
315
-
316
- // Remove images
317
- $('.image-gallery ul.slides-wrapper').on( 'click', 'a.delete', function() {
318
-
319
- var $wrapper = $(this).closest('.image-gallery'),
320
- $gallery = $(this).closest('.image-gallery ul.slides-wrapper'),
321
- $image_gallery_ids = $wrapper.find('.image_gallery_ids'),
322
- attachment_ids = '';
323
-
324
- $(this).closest('li.image').remove();
325
-
326
- $gallery.find('li.image').css('cursor','default').each(function() {
327
- var attachment_id = $(this).attr( 'data-attachment_id' );
328
- attachment_ids = attachment_ids + attachment_id + ',';
329
- });
330
-
331
- $image_gallery_ids.val( attachment_ids );
332
-
333
- return false;
334
- });
335
-
336
-
337
- //on-off
338
- $('.the-metabox .rm_onoff.onoff_container span').on('click', function(ev){
339
-
340
- var input = $( this ).prev( 'input' );
341
- var checked = input.prop( 'checked' );
342
-
343
- if( checked ) {
344
- input.prop( 'checked', false ).attr( 'value', 'no' ).removeClass('onoffchecked');
345
- } else {
346
- input.prop( 'checked', true ).attr( 'value', 'yes' ).addClass('onoffchecked');
347
  }
348
-
349
- input.change();
350
- });
351
-
352
-
353
-
354
-
355
  })(jQuery);
28
 
29
  var t = $(this).attr('href');
30
  $(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
31
+ $(this).closest('.metaboxes-tab').find('.tabs-panel').hide();
32
+ $(t).show();
33
 
34
  return false;
35
  });
36
  });
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  var act_page_option = $('#_active_page_options-container').parent().html();
39
  $('#_active_page_options-container').parent().remove();
40
  $(act_page_option).insertAfter('#yit-post-setting .handlediv');
51
 
52
 
53
  //dependencies handler
54
+ $('.metaboxes-tab [data-dep-target]').each(function(){
55
  var t = $(this);
56
 
57
+ var field = '#' + t.data('dep-target'),
58
+ dep = '#' + t.data('dep-id'),
59
+ value = t.data('dep-value'),
60
+ type = t.data('dep-type');
61
 
62
 
63
+ dependencies_handler( field, dep, value.toString(), type );
64
 
65
  $(dep).on('change', function(){
66
+ dependencies_handler( field, dep, value.toString(), type );
67
  }).change();
68
  });
69
 
70
  //Handle dependencies.
71
+ function dependencies_handler ( id, deps, values, type ) {
72
  var result = true;
73
 
74
 
89
  }
90
  }
91
 
92
+ values = values.split( ',' );
93
 
94
  for( var i = 0; i < values.length; i++ ) {
95
  if( val != values[i] )
99
  }
100
  }
101
 
102
+ var $current_field = $( id ),
103
+ $current_container = $( id + '-container' ).parent();
104
+
105
+ var types = type.split( '-' ), j;
106
+ for ( j in types ) {
107
+ var current_type = types[ j ];
108
+
109
+ if ( !result ) {
110
+ switch ( current_type ) {
111
+ case 'disable':
112
+ $current_container.addClass( 'yith-disabled' );
113
+ $current_field.attr( 'disabled', true );
114
+ break;
115
+ case 'hideme':
116
+ $current_field.hide();
117
+ break;
118
+ default:
119
+ $current_container.hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
 
122
+ } else {
123
+ switch ( current_type ) {
124
+ case 'disable':
125
+ $current_container.removeClass( 'yith-disabled' );
126
+ $current_field.attr( 'disabled', false );
127
+ break;
128
+ case 'hideme':
129
+ $current_field.show();
130
+ break;
131
+ default:
132
+ $current_container.show();
133
+ }
134
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  }
136
+ }
137
+
 
 
 
 
 
138
  })(jQuery);
plugin-fw/assets/js/metabox.min.js CHANGED
@@ -1,11 +1,4 @@
1
- (function(a){function k(b,c,d){var e=!0;if("string"==typeof c){":radio"==c.substr(0,6)&&(c+=":checked");var g=a(c).val();"checkbox"==a(c).attr("type")&&(g=a(c).is(":checked")?"yes":"no");d=d.split(",");for(c=0;c<d.length;c++)if(g!=d[c])e=!1;else{e=!0;break}}e?a(b+"-container").parent().show():a(b+"-container").parent().hide()}a(".metaboxes-tab").each(function(){a(".tabs-panel",this).hide();var b=wpCookies.get("active_metabox_tab"),b=null==b?a("ul.metaboxes-tabs li:first-child a",this).attr("href"):
2
- "#"+b;a(b).show();a(".metaboxes-tabs a",this).click(function(b){if(a(this).parent().hasClass("tabs"))b.preventDefault();else return b=a(this).attr("href"),a(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),a(this).closest(".metaboxes-tab").find(".tabs-panel").slideUp("fast"),a(b).delay(350).slideDown("fast"),!1})});var h=!0,l=wp.media.editor.send.attachment;a(document).on("click",".metaboxes-tab .upload_button",function(b){b=a(this);if("undefined"!=typeof b.attr("id")){var c=b.attr("id").replace("-button",
3
- "");h=!0;wp.media.editor.send.attachment=function(b,e){if(h)a("#"+c).is("input[type=text]")?a("#"+c).val(e.url):a("#"+c+"_custom").val(e.url);else return l.apply(this,[b,e])};wp.media.editor.open(b);return!1}});a(".metaboxes-tab .add_media").on("click",function(){h=!1});a(".metaboxes-tab .panel-colorpicker").wpColorPicker({onInit:function(){console.log("test")},change:function(a,c){},clear:function(){var b=a(this);b.val(b.data("default-color"));b.change()}});a(".metaboxes-tab .panel-colorpicker").each(function(){var b=
4
- a(this).data("variations-label");a(this).parent().parent().find("a.wp-color-result").attr("title",b)});a(".metaboxes-tab .panel-datepicker").each(function(){a(this).datepicker()});var f=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));
5
- 0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+"</span>")};a(".metaboxes-tab .select_wrapper select").not(".chosen").each(f).change(f);a(".metaboxes-tab .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".metaboxes-tab .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".metaboxes-tab .select_wrapper select[multiple]").not(".chosen").hide()});
6
- a(".metaboxes-tab .chosen .select_wrapper select").chosen();a(".metaboxes-tab .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),g=a(this).data("labels");a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);a(this).siblings(".feedback").find("strong").text(c.value+g)}})});f=a("#_active_page_options-container").parent().html();a("#_active_page_options-container").parent().remove();
7
- a(f).insertAfter("#yit-post-setting .handlediv");a(f).insertAfter("#yit-page-setting .handlediv");a("#_active_page_options-container").on("click",function(){a("#_active_page_options").is(":checked")?a("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:1,"pointer-events":"auto"}):a("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:.5,"pointer-events":"none"})}).click();a(".metaboxes-tab [data-field]").each(function(){var b=
8
- a(this),c="#"+b.data("field"),d="#"+b.data("dep"),e=b.data("value");k(c,d,e.toString());a(d).on("change",function(){k(c,d,e.toString())}).change()});a(document).on("click",".image-gallery-button",function(b){var c=a(this);b=c.closest(".image-gallery");var d=b.find(".image_gallery_ids"),e=d.val(),g=b.find("ul.slides-wrapper"),f=wp.media.frames.image_gallery=wp.media({title:c.data("choose"),button:{text:c.data("update")},states:[new wp.media.controller.Library({title:c.data("choose"),filterable:"all",
9
- multiple:!0})]});f.on("select",function(){f.state().get("selection").map(function(a){a=a.toJSON();a.id&&(e=e?e+","+a.id:a.id,g.append('<li class="image" data-attachment_id="'+a.id+'"><img src="'+a.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+c.data("delete")+'">x</a></li></ul></li>'))});d.val(e)});f.open()});a(".image-gallery ul.slides-wrapper").each(function(){var b=a(this);b.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,
10
- forceHelperSize:!1,helper:"clone",opacity:.65,start:function(a,b){b.item.css("background-color","#f6f6f6")},stop:function(a,b){b.item.removeAttr("style")},update:function(c,d){var e="";b.find("li.image").css("cursor","default").each(function(){var b=a(this).attr("data-attachment_id");e=e+b+","});b.closest(".image-gallery").find(".image_gallery_ids").val(e)}})});a(".image-gallery ul.slides-wrapper").on("click","a.delete",function(){var b=a(this).closest(".image-gallery"),c=a(this).closest(".image-gallery ul.slides-wrapper"),
11
- b=b.find(".image_gallery_ids"),d="";a(this).closest("li.image").remove();c.find("li.image").css("cursor","default").each(function(){var b=a(this).attr("data-attachment_id");d=d+b+","});b.val(d);return!1});a(".the-metabox .rm_onoff.onoff_container span").on("click",function(b){b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()})})(jQuery);
1
+ (function(a){function h(b,c,d,e){var f=!0;if("string"==typeof c){":radio"==c.substr(0,6)&&(c+=":checked");var g=a(c).val();"checkbox"==a(c).attr("type")&&(g=a(c).is(":checked")?"yes":"no");d=d.split(",");for(c=0;c<d.length;c++)if(g!=d[c])f=!1;else{f=!0;break}}d=a(b);b=a(b+"-container").parent();e=e.split("-");for(var h in e)if(g=e[h],f)switch(g){case "disable":b.removeClass("yith-disabled");d.attr("disabled",!1);break;case "hideme":d.show();break;default:b.show()}else switch(g){case "disable":b.addClass("yith-disabled");
2
+ d.attr("disabled",!0);break;case "hideme":d.hide();break;default:b.hide()}}a(".metaboxes-tab").each(function(){a(".tabs-panel",this).hide();var b=wpCookies.get("active_metabox_tab"),b=null==b?a("ul.metaboxes-tabs li:first-child a",this).attr("href"):"#"+b;a(b).show();a(".metaboxes-tabs a",this).click(function(b){if(a(this).parent().hasClass("tabs"))b.preventDefault();else return b=a(this).attr("href"),a(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),a(this).closest(".metaboxes-tab").find(".tabs-panel").hide(),
3
+ a(b).show(),!1})});var k=a("#_active_page_options-container").parent().html();a("#_active_page_options-container").parent().remove();a(k).insertAfter("#yit-post-setting .handlediv");a(k).insertAfter("#yit-page-setting .handlediv");a("#_active_page_options-container").on("click",function(){a("#_active_page_options").is(":checked")?a("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:1,"pointer-events":"auto"}):a("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:.5,
4
+ "pointer-events":"none"})}).click();a(".metaboxes-tab [data-dep-target]").each(function(){var b=a(this),c="#"+b.data("dep-target"),d="#"+b.data("dep-id"),e=b.data("dep-value"),f=b.data("dep-type");h(c,d,e.toString(),f);a(d).on("change",function(){h(c,d,e.toString(),f)}).change()})})(jQuery);
 
 
 
 
 
 
 
plugin-fw/assets/js/multisite-updater.js CHANGED
@@ -213,4 +213,10 @@
213
  }
214
  }
215
 
 
 
 
 
 
 
216
  })(jQuery);
213
  }
214
  }
215
 
216
+ // fix ThickBox issue (width-height) when opening a changelog
217
+ $( 'body' ).on( 'click', '.yit-changelog-button', function () {
218
+ $( '#TB_window' ).remove();
219
+ } );
220
+
221
+
222
  })(jQuery);
plugin-fw/assets/js/multisite-updater.min.js CHANGED
@@ -1 +1,4 @@
1
- !function(e){function a(a,s,t,r){for(var i in a){var p=a[i];for(var l in p)if("slug"!=l&&!n(p[l].Version,p[l].Latest,">=")){t=parseInt(t)+1,e(".plugin-count").empty().html(t);var u=new RegExp(" ","g"),c=p[l],g=""+c.Name,d=g.replace(u,"-").trim(),o='*[data-slug="'+d.toLowerCase()+'"]';e(o).addClass("update");var f='<tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message">'+r.strings.new_version.replace("%plugin_name%",g)+'<a class="thickbox" href="'+r.details_url[i]+'">'+r.strings.latest.replace("%latest%",p[l].Latest)+"</a>";f="undefined"==typeof s[i]?f+" <em>"+r.strings.unavailable+"</em>"+r.strings.activate.replace("%activate_link%",r.licence_activation_url).replace("%plugin_name%",g):f+'. <a href="'+r.update_url[i]+'">'+r.strings.update_now+"</a>","undefined"!=typeof r.changelogs[i]&&(f+=r.changelogs[i]),f+="</div></td></tr>",e(f).insertAfter(o)}}}function n(e,a,n){this.php_js=this.php_js||{},this.php_js.ENV=this.php_js.ENV||{};var s=0,t=0,r=0,i={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},p=function(e){return e=(""+e).replace(/[_\-+]/g,"."),e=e.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),e.length?e.split("."):[-8]};for(numVersion=function(e){return e?isNaN(e)?i[e]||-7:parseInt(e,10):0},e=p(e),a=p(a),t=Math.max(e.length,a.length),s=0;t>s;s++)if(e[s]!=a[s]){if(e[s]=numVersion(e[s]),a[s]=numVersion(a[s]),e[s]<a[s]){r=-1;break}if(e[s]>a[s]){r=1;break}}if(!n)return r;switch(n){case">":case"gt":return r>0;case">=":case"ge":return r>=0;case"<=":case"le":return 0>=r;case"==":case"=":case"eq":return 0===r;case"<>":case"!=":case"ne":return 0!==r;case"":case"<":case"lt":return 0>r;default:return null}}var s=e("#menu-plugins"),t=s.find(".update-plugins"),r=t.find(".update-count").text(),i=plugins.registered,p=plugins.activated;if(0==r||""==r){var l='<span class="update-plugins"><span class="plugin-count"></span></span>';r=0,s.find(".wp-menu-name").append(l)}a(i,p,r,plugins)}(jQuery);
 
 
 
1
+ (function(e){function n(c,d,e){this.php_js=this.php_js||{};this.php_js.ENV=this.php_js.ENV||{};var a=0,f=0,b=0,g={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},a=function(a){a=(""+a).replace(/[_\-+]/g,".");a=a.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".");return a.length?a.split("."):[-8]};numVersion=function(a){return a?isNaN(a)?g[a]||-7:parseInt(a,10):0};c=a(c);d=a(d);f=Math.max(c.length,d.length);for(a=0;a<f;a++)if(c[a]!=d[a])if(c[a]=numVersion(c[a]),d[a]=numVersion(d[a]),
2
+ c[a]<d[a]){b=-1;break}else if(c[a]>d[a]){b=1;break}if(!e)return b;switch(e){case ">":case "gt":return 0<b;case ">=":case "ge":return 0<=b;case "<=":case "le":return 0>=b;case "==":case "=":case "eq":return 0===b;case "<>":case "!=":case "ne":return 0!==b;case "":case "<":case "lt":return 0>b;default:return null}}var l=e("#menu-plugins"),h=l.find(".update-plugins").find(".update-count").text(),p=plugins.registered,q=plugins.activated;if(0==h||""==h)h=0,l.find(".wp-menu-name").append('<span class="update-plugins"><span class="plugin-count"></span></span>');
3
+ (function(c,d,h,a){for(var f in c){var b=c[f],g;for(g in b)if("slug"!=g&&!n(b[g].Version,b[g].Latest,">=")){h=parseInt(h)+1;e(".plugin-count").empty().html(h);var m=""+b[g].Name,l='*[data-slug="'+m.replace(RegExp(" ","g"),"-").trim().toLowerCase()+'"]';e(l).addClass("update");var k='<tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message">'+a.strings.new_version.replace("%plugin_name%",m)+'<a class="thickbox" href="'+a.details_url[f]+'">'+a.strings.latest.replace("%latest%",
4
+ b[g].Latest)+"</a>",k="undefined"==typeof d[f]?k+" <em>"+a.strings.unavailable+"</em>"+a.strings.activate.replace("%activate_link%",a.licence_activation_url).replace("%plugin_name%",m):k+'. <a href="'+a.update_url[f]+'">'+a.strings.update_now+"</a>";"undefined"!=typeof a.changelogs[f]&&(k+=a.changelogs[f]);k+="</div></td></tr>";e(k).insertAfter(l)}}})(p,q,h,plugins);e("body").on("click",".yit-changelog-button",function(){e("#TB_window").remove()})})(jQuery);
plugin-fw/assets/js/panel.spinner.js DELETED
@@ -1,139 +0,0 @@
1
- /*
2
- Spinner for jQuery (version 0.1)
3
- Copyright (c) 2012 Simone D'Amico
4
- http://simonedamico.com/
5
-
6
- Licensed under the MIT license:
7
- http://www.opensource.org/licenses/mit-license.php
8
-
9
- Any and all use of this script must be accompanied by this copyright/license notice in its present form.
10
-
11
- */
12
- (function($){
13
- $.fn.spinner = function(params) {
14
-
15
- //private methods
16
- var _createButton = function( buttonClass, buttonLabel ) {
17
- return $('<button/>', {
18
- 'class' : buttonClass + ' spinner-button',
19
- text : buttonLabel
20
- });
21
- };
22
-
23
- var _createBody = function(input) {
24
- //create wrapper
25
- var wrapper = input.wrap('<div class="spinner-wrapper"></div>').parent();
26
-
27
- //create spinner buttons
28
- var plus = _createButton('button-plus', '+').appendTo(wrapper).show(),
29
- minus = _createButton('button-minus', '-').appendTo(wrapper).show();
30
-
31
- return wrapper;
32
- };
33
-
34
- var _buttonClick = function( e ) {
35
- var input = e.data.input,
36
- params = e.data.params,
37
- button = $(this),
38
- value = parseFloat(input.val());
39
-
40
- if( button.hasClass('button-plus') ) {
41
- if( params.max != null ) {
42
- if( ( value + params.interval ) <= params.max ) {
43
- input.val( value + params.interval );
44
- } else {
45
- input.val( params.max );
46
- }
47
- } else {
48
- input.val( value + params.interval );
49
- }
50
- } else if( button.hasClass('button-minus') ) {
51
- if( params.min != null ) {
52
- if( ( value - params.interval ) >= params.min ) {
53
- input.val( value - params.interval );
54
- } else {
55
- input.val( params.min );
56
- }
57
- } else {
58
- input.val( value - params.interval );
59
- }
60
- }
61
-
62
- input.change(); e.preventDefault();
63
- };
64
-
65
- var _validateContent = function( e ) {
66
- var value = parseFloat( $(this).val() );
67
-
68
- if( params.max != null && value >= params.max ) {
69
- $(this).val(params.max);
70
- } else if( value <= params.min || isNaN( value ) ) {
71
- $(this).val(params.min ? params.min : 0);
72
- } else {
73
- $(this).val(value);
74
- }
75
- };
76
-
77
-
78
- //public methods
79
- var methods = {
80
- init : function( params ) {
81
-
82
- var params = $.extend({
83
- min: null,
84
- max: null,
85
- interval: 1,
86
- defaultValue: 0,
87
- mouseWheel: true,
88
- largeInterval: 10
89
- }, params);
90
-
91
- var self = this,
92
- t = $(this),
93
- data = t.data('spinner');
94
-
95
- return this.each(function(){
96
- //check if the plugin hasn't already been initialized
97
- //and it's an input[type=text] element
98
- if( !data && t.is(':text') ) {
99
- //initialize the value
100
- if( params.defaultValue ) {
101
- t.val( params.defaultValue );
102
- }
103
-
104
- //create the spinner body
105
- var wrapper = _createBody(t);
106
-
107
- //event handlers
108
- //var mouseWheelEventName = $.browser.mozilla ? 'DOMMouseScroll' : 'mousewheel';
109
-
110
- wrapper.find('.spinner-button')
111
- .bind('click.spinner', { params: params, input: t }, _buttonClick);
112
-
113
- t.bind('blur.spinner', _validateContent)
114
- //.bind('keyup.spinner', _validateKey)
115
- //.bind(mouseWheelEventName, _inputMousewheel);
116
-
117
- //register field data
118
- t.data('spinner', {
119
- target: self
120
- });
121
- }
122
- });
123
- },
124
-
125
- destroy : function( params) {
126
- console.log('destroy', params);
127
- }
128
- };
129
-
130
- //execute the plugin
131
- if ( methods[params] ) {
132
- return methods[params].apply( this, Array.prototype.slice.call( arguments, 1 ));
133
- } else if ( typeof params === 'object' || ! params ) {
134
- return methods.init.apply( this, arguments );
135
- } else {
136
- $.error( 'Method ' + params + ' does not exist' );
137
- }
138
- };
139
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/assets/js/panel.spinner.min.js DELETED
@@ -1,3 +0,0 @@
1
- (function(d){d.fn.spinner=function(c){var h=function(b,e){return d("<button/>",{"class":b+" spinner-button",text:e})},k=function(b){var e=b.data.input,a=b.data.params,c=d(this),f=parseFloat(e.val());c.hasClass("button-plus")?null!=a.max?f+a.interval<=a.max?e.val(f+a.interval):e.val(a.max):e.val(f+a.interval):c.hasClass("button-minus")&&(null!=a.min?f-a.interval>=a.min?e.val(f-a.interval):e.val(a.min):e.val(f-a.interval));e.change();b.preventDefault()},l=function(b){b=parseFloat(d(this).val());null!=
2
- c.max&&b>=c.max?d(this).val(c.max):b<=c.min||isNaN(b)?d(this).val(c.min?c.min:0):d(this).val(b)},g={init:function(b){b=d.extend({min:null,max:null,interval:1,defaultValue:0,mouseWheel:!0,largeInterval:10},b);var c=this,a=d(this),g=a.data("spinner");return this.each(function(){if(!g&&a.is(":text")){b.defaultValue&&a.val(b.defaultValue);var d=a.wrap('<div class="spinner-wrapper"></div>').parent();h("button-plus","+").appendTo(d).show();h("button-minus","-").appendTo(d).show();d.find(".spinner-button").bind("click.spinner",
3
- {params:b,input:a},k);a.bind("blur.spinner",l);a.data("spinner",{target:c})}})},destroy:function(b){console.log("destroy",b)}};if(g[c])return g[c].apply(this,Array.prototype.slice.call(arguments,1));if("object"!==typeof c&&c)d.error("Method "+c+" does not exist");else return g.init.apply(this,arguments)}})(jQuery);
 
 
 
plugin-fw/assets/js/yit-cptu-sortable-posts.js DELETED
@@ -1,32 +0,0 @@
1
- /**
2
- * This file belongs to the YIT Framework.
3
- *
4
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
- * that is bundled with this package in the file LICENSE.txt.
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.gnu.org/licenses/gpl-3.0.txt
8
- */
9
-
10
- (function($) {
11
- "use strict";
12
- // Author code here
13
-
14
- $("#the-list").sortable({
15
- items : 'tr',
16
- axis : 'y',
17
- helper : function(e, ui) {
18
- ui.children().children().each(function() {
19
- $(this).width( $(this).width() );
20
- });
21
- return ui;
22
- },
23
- update : function(e, ui) {
24
- $.post( ajaxurl, {
25
- action: 'cpt_sort_posts',
26
- order: $("#the-list").sortable("serialize"),
27
- post_type: typenow
28
- });
29
- }
30
- });
31
-
32
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/assets/js/yit-plugin-panel-sidebar.js DELETED
@@ -1,56 +0,0 @@
1
- /**
2
- * This file belongs to the YIT Plugin Framework.
3
- *
4
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
- * that is bundled with this package in the file LICENSE.txt.
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.gnu.org/licenses/gpl-3.0.txt
8
- */
9
-
10
-
11
- (function ( $ ) {
12
- var hide_sidebar_btn = $( '#yit-panel-sidebar-action-hide' ),
13
- hide_sidebar_text = hide_sidebar_btn.find( '.yit-panel-sidebar-action-title' ),
14
- sidebar = $( '#yit-panel-sidebar' ),
15
- panel_wrapper = $( '.' + sidebar_labels.wrapper_class ),
16
- ajax_hide_option_save_call,
17
- ajax_hide_option_save = function ( option ) {
18
- if ( ajax_hide_option_save_call ) {
19
- ajax_hide_option_save_call.abort();
20
- }
21
-
22
- var post_data = {
23
- option: option,
24
- action: 'yith_plugin_panel_sidebar_set_collapse_option'
25
- };
26
-
27
- ajax_hide_option_save_call = $.ajax( {
28
- type: "POST",
29
- data: post_data,
30
- url: ajaxurl
31
- } );
32
- },
33
- hide_sidebar = function () {
34
- hide_sidebar_btn.removeClass( 'hide-on-click' );
35
- hide_sidebar_text.html( sidebar_labels.show_sidebar );
36
- sidebar.addClass( 'yith-panel-sidebar-hidden' );
37
- panel_wrapper.addClass( 'yit-admin-panel-content-wrap-full' );
38
- ajax_hide_option_save( 'yes' );
39
- },
40
- show_sidebar = function () {
41
- hide_sidebar_btn.addClass( 'hide-on-click' );
42
- hide_sidebar_text.html( sidebar_labels.hide_sidebar );
43
- sidebar.removeClass( 'yith-panel-sidebar-hidden' );
44
- panel_wrapper.removeClass( 'yit-admin-panel-content-wrap-full' );
45
- ajax_hide_option_save( 'no' );
46
- };
47
-
48
- hide_sidebar_btn.on( 'click', function () {
49
- if ( $( this ).is( '.hide-on-click' ) ) {
50
- hide_sidebar();
51
- } else {
52
- show_sidebar();
53
- }
54
- } );
55
-
56
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/assets/js/yit-plugin-panel-sidebar.min.js DELETED
@@ -1 +0,0 @@
1
- !function(a){var i,e=a("#yit-panel-sidebar-action-hide"),n=e.find(".yit-panel-sidebar-action-title"),l=a("#yit-panel-sidebar"),s=a("."+sidebar_labels.wrapper_class),t=function(e){i&&i.abort();var n={option:e,action:"yith_plugin_panel_sidebar_set_collapse_option"};i=a.ajax({type:"POST",data:n,url:ajaxurl})},d=function(){e.removeClass("hide-on-click"),n.html(sidebar_labels.show_sidebar),l.addClass("yith-panel-sidebar-hidden"),s.addClass("yit-admin-panel-content-wrap-full"),t("yes")},o=function(){e.addClass("hide-on-click"),n.html(sidebar_labels.hide_sidebar),l.removeClass("yith-panel-sidebar-hidden"),s.removeClass("yit-admin-panel-content-wrap-full"),t("no")};e.on("click",function(){a(this).is(".hide-on-click")?d():o()})}(jQuery);
 
plugin-fw/assets/js/yit-plugin-panel.js CHANGED
@@ -8,230 +8,49 @@
8
  */
9
 
10
 
11
- (function ($) {
12
-
13
- // select
14
- var select_value = function () {
15
-
16
- var value = '';
17
-
18
- if ($(this).attr('multiple')) {
19
- $(this).children("option:selected").each(function (i, v) {
20
- if (i != 0)
21
- value += ', ';
22
-
23
- value += $(v).text();
24
- });
25
-
26
- if (value == '') {
27
- $(this).children().children("option:selected").each(function (i, v) {
28
- if (i != 0)
29
- value += ', ';
30
-
31
- value += $(v).text();
32
- });
33
- }
34
- }
35
- else {
36
- value = $(this).children("option:selected").text();
37
-
38
- if (value == '')
39
- value = $(this).children().children("option:selected").text();
40
- }
41
-
42
-
43
- if ($(this).parent().find('span').length <= 0) {
44
- $(this).before('<span></span>');
45
- }
46
-
47
- $(this).parent().children('span').replaceWith('<span>' + value + '</span>');
48
- };
49
- $('.plugin-option .select_wrapper select').not('.chosen').each(select_value).change(select_value);
50
-
51
- //Open select multiple
52
- $('.plugin-option .select_wrapper').click(function (e) {
53
- e.stopPropagation();
54
- $(this).find('select[multiple]').not('.chosen').toggle();
55
- });
56
- //Stops click propagation on select, to prevent select hide
57
- $('.plugin-option .select_wrapper select[multiple]').not('.chosen').click(function (e) {
58
- e.stopPropagation();
59
- });
60
- //Hides select on window click
61
- $(window).click(function () {
62
- $('.plugin-option .select_wrapper select[multiple]').not('.chosen').hide();
63
- })
64
- //chosen
65
- $('.plugin-option .chosen .select_wrapper select').chosen();
66
-
67
- // on-off
68
- $('.plugin-option .onoff_container span').on('click', function () {
69
- var input = $(this).prev('input');
70
- var checked = input.prop('checked');
71
-
72
- if (checked) {
73
- input.prop('checked', false).attr('value', 'no').removeClass('onoffchecked');
74
- } else {
75
- input.prop('checked', true).attr('value', 'yes').addClass('onoffchecked');
76
- }
77
-
78
- input.change();
79
- });
80
-
81
- //colorpicker
82
- $('.plugin-option .panel-colorpicker').wpColorPicker({
83
- onInit: function(){ },
84
- change: function(event, ui){
85
- },
86
- clear: function(){
87
- var input = $(this);
88
- input.val(input.data('default-color'));
89
- input.change();
90
- }
91
- });
92
-
93
- //slider
94
- $('.plugin-option .slider_container .ui-slider-horizontal').each(function () {
95
- var val = $(this).data('val');
96
- var minValue = $(this).data('min');
97
- var maxValue = $(this).data('max');
98
- var step = $(this).data('step');
99
- var labels = $(this).data('labels');
100
-
101
- $(this).slider({
102
- value: val,
103
- min : minValue,
104
- max : maxValue,
105
- range: 'min',
106
- step : step,
107
-
108
- slide: function (event, ui) {
109
- $(this).find('input').val(ui.value);
110
- $(this).siblings('.feedback').find('strong').text(ui.value + labels);
111
- }
112
- });
113
- });
114
-
115
-
116
- if (typeof wp !== 'undefined' && typeof wp.media !== 'undefined') {
117
-
118
- //upload
119
- var _custom_media = true,
120
- _orig_send_attachment = wp.media.editor.send.attachment;
121
-
122
- // preview
123
- $('.plugin-option .upload_img_url').change(function () {
124
- var url = $(this).val();
125
- var re = new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)");
126
-
127
- var preview = $(this).parents().siblings('.upload_img_preview');
128
- if (re.test(url)) {
129
- preview.html('<img src="' + url + '" style="max-width:600px; max-height:300px;" />');
130
- } else {
131
- preview.html('');
132
- }
133
- }).trigger( 'change' );
134
-
135
- $( document ).on( 'click', '.plugin-option .upload_button', function(e) {
136
- e.preventDefault();
137
-
138
- var t = $(this),
139
- custom_uploader,
140
- id = t.attr('id').replace(/-button$/, '');
141
-
142
- //If the uploader object has already been created, reopen the dialog
143
- if (custom_uploader) {
144
- custom_uploader.open();
145
- return;
146
- }
147
-
148
- var custom_uploader_states = [
149
- // Main states.
150
- new wp.media.controller.Library({
151
- library: wp.media.query(),
152
- multiple: false,
153
- title: 'Choose Image',
154
- priority: 20,
155
- filterable: 'uploaded'
156
- })
157
- ];
158
-
159
- // Create the media frame.
160
- custom_uploader = wp.media.frames.downloadable_file = wp.media({
161
- // Set the title of the modal.
162
- title: 'Choose Image',
163
- library: {
164
- type: ''
165
- },
166
- button: {
167
- text: 'Choose Image'
168
- },
169
- multiple: false,
170
- states: custom_uploader_states
171
- });
172
-
173
-
174
- //When a file is selected, grab the URL and set it as the text field's value
175
- custom_uploader.on( 'select' , function() {
176
- var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
177
-
178
- $("#" + id).val( attachment.url );
179
- // Save the id of the selected element to an element which name is the same with
180
- // a suffix "-yith-attachment-id"
181
- if ($("#" + id + "-yith-attachment-id")) {
182
- $("#" + id + "-yith-attachment-id").val(attachment.id);
183
- }
184
-
185
- $('.plugin-option .upload_img_url').trigger('change');
186
- });
187
-
188
- //Open the uploader dialog
189
- custom_uploader.open();
190
- });
191
-
192
- $( document).on( 'click', '.plugin-option .upload_button_reset', function(e){
193
- var t = $(this),
194
- id = t.attr('id'),
195
- input_id = t.attr('id').replace(/-button_reset$/, ''),
196
- default_value = $('#' + id).data('default');
197
-
198
- $("#" + input_id).val( default_value );
199
- $('.plugin-option .upload_img_url').trigger('change');
200
- } );
201
- }
202
-
203
- $('.plugin-option .add_media').on('click', function () {
204
- _custom_media = false;
205
- });
206
-
207
  //dependencies handler
208
- $('[data-field]').each(function () {
209
- var t = $(this);
 
 
 
 
 
210
 
211
- var field = '#' + t.data('field'),
212
- dep = '#' + t.data('dep'),
213
- value = t.data('value');
214
 
215
- $(dep).on('change',function () {
216
- dependencies_handler(field, dep, value.toString());
217
- }).change();
218
- });
219
 
220
  //Handle dependencies.
221
- function dependencies_handler(id, deps, values) {
222
  var result = true;
223
 
224
  //Single dependency
225
- if (typeof( deps ) == 'string') {
226
- if (deps.substr(0, 6) == ':radio') {
227
  deps = deps + ':checked';
228
  }
229
 
230
- var values = values.split(',');
231
 
232
- for (var i = 0; i < values.length; i++) {
 
 
 
 
 
 
 
 
 
 
233
 
234
- if ($(deps).val() != values[i]) {
 
235
  result = false;
236
  }
237
  else {
@@ -241,87 +60,77 @@
241
  }
242
  }
243
 
244
- if (!result) {
245
- $(id + '-container').closest('tr').hide();
246
- } else {
247
- $(id + '-container').closest('tr').show();
248
- }
249
- };
250
 
251
- //connected list
252
- $('.rm_connectedlist').each(function () {
253
- var ul = $(this).find('ul');
254
- var input = $(this).find(':hidden');
255
- var sortable = ul.sortable({
256
- connectWith: ul,
257
- update : function (event, ui) {
258
- var value = {};
259
-
260
- ul.each(function () {
261
- var options = {};
262
-
263
- $(this).children().each(function () {
264
- options[ $(this).data('option') ] = $(this).text();
265
- });
266
-
267
- value[ $(this).data('list') ] = options;
268
- });
269
-
270
- input.val((JSON.stringify(value)).replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0'));
271
- }
272
- }).disableSelection();
273
- });
274
-
275
- $(document).ready(function () {
276
-
277
- $('.yith-video-link').click(function (event) {
278
- event.preventDefault();
279
- var target = $(this).data('video-id');
280
-
281
- $('.' + target).dialog({
282
- dialogClass : 'wp-dialog yit-dialog yit-video-dialog',
283
- modal : true,
284
- closeOnEscape: true,
285
- width : 'auto',
286
- resizable : false,
287
- draggable : false,
288
- create : function (event, ui) {
289
- $(this).css("maxWidth", "853px");
290
- },
291
- open : function (event, ui) {
292
 
293
- $('.ui-widget-overlay').bind('click', function () {
294
- $(this).siblings('.ui-dialog').find('.ui-dialog-content').dialog('close');
295
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
296
 
 
 
 
 
 
 
 
 
 
 
 
297
  }
 
 
 
298
 
299
- });
 
 
 
 
 
 
 
300
 
301
- $('.ui-dialog :button').blur();
 
302
 
303
- });
304
- });
 
305
 
306
- //codemirror
307
- $(document).ready(function () {
308
- $('.codemirror').each(function (i, v) {
309
- var editor = CodeMirror.fromTextArea(v, {
310
- lineNumbers : 1,
311
- mode : 'javascript',
312
- showCursorWhenSelecting: true
313
- })
314
 
315
- $(v).data('codemirrorInstance', editor);
316
- })
317
- })
 
318
 
319
  //google analytics generation
320
- $(document).ready(function () {
321
- $('.google-analytic-generate').click(function () {
322
- var editor = $('#' + $(this).data('textarea')).data('codemirrorInstance');
323
- var gatc = $('#' + $(this).data('input')).val();
324
- var basename = $(this).data('basename');
325
 
326
  var text = "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n";
327
  text += "(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\n";
@@ -331,10 +140,14 @@
331
  text += "ga('send', 'pageview');\n";
332
  editor.replaceRange(
333
  text,
334
- editor.getCursor('start'),
335
- editor.getCursor('end')
336
  )
337
- })
338
- })
339
-
340
- })(jQuery);
 
 
 
 
8
  */
9
 
10
 
11
+ (function ( $ ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  //dependencies handler
13
+ $( '[data-dep-target]' ).each( function () {
14
+ var t = $( this );
15
+
16
+ var field = '#' + t.data( 'dep-target' ),
17
+ dep = '#' + t.data( 'dep-id' ),
18
+ value = t.data( 'dep-value' ),
19
+ type = t.data( 'dep-type' );
20
 
21
+ dependencies_handler( field, dep, value.toString(), type );
 
 
22
 
23
+ $( dep ).on( 'change', function () {
24
+ dependencies_handler( field, dep, value.toString(), type );
25
+ } ).change();
26
+ } );
27
 
28
  //Handle dependencies.
29
+ function dependencies_handler( id, deps, values, type ) {
30
  var result = true;
31
 
32
  //Single dependency
33
+ if ( typeof( deps ) == 'string' ) {
34
+ if ( deps.substr( 0, 6 ) == ':radio' ) {
35
  deps = deps + ':checked';
36
  }
37
 
38
+ var val = $( deps ).val();
39
 
40
+ if ( $( deps ).attr( 'type' ) == 'checkbox' ) {
41
+ var thisCheck = $( deps );
42
+ if ( thisCheck.is( ':checked' ) ) {
43
+ val = 'yes';
44
+ }
45
+ else {
46
+ val = 'no';
47
+ }
48
+ }
49
+
50
+ values = values.split( ',' );
51
 
52
+ for ( var i = 0; i < values.length; i++ ) {
53
+ if ( val != values[ i ] ) {
54
  result = false;
55
  }
56
  else {
60
  }
61
  }
62
 
63
+ var $current_field = $( id ),
64
+ $current_container = $( id + '-container' ).closest( 'tr' ); // container for YIT Plugin Panel
 
 
 
 
65
 
66
+ if ( $current_container.length < 1 ) {
67
+ // container for YIT Plugin Panel WooCommerce
68
+ $current_container = $current_field.closest( '.yith-plugin-fw-panel-wc-row' );
69
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
+ var types = type.split( '-' ), j;
72
+ for ( j in types ) {
73
+ var current_type = types[ j ];
74
+
75
+ if ( !result ) {
76
+ switch ( current_type ) {
77
+ case 'disable':
78
+ $current_container.addClass( 'yith-disabled' );
79
+ $current_field.attr( 'disabled', true );
80
+ break;
81
+ case 'hideme':
82
+ $current_field.hide();
83
+ break;
84
+ default:
85
+ $current_container.hide();
86
+ }
87
 
88
+ } else {
89
+ switch ( current_type ) {
90
+ case 'disable':
91
+ $current_container.removeClass( 'yith-disabled' );
92
+ $current_field.attr( 'disabled', false );
93
+ break;
94
+ case 'hideme':
95
+ $current_field.show();
96
+ break;
97
+ default:
98
+ $current_container.show();
99
  }
100
+ }
101
+ }
102
+ }
103
 
104
+ //connected list
105
+ $( '.rm_connectedlist' ).each( function () {
106
+ var ul = $( this ).find( 'ul' );
107
+ var input = $( this ).find( ':hidden' );
108
+ var sortable = ul.sortable( {
109
+ connectWith: ul,
110
+ update : function ( event, ui ) {
111
+ var value = {};
112
 
113
+ ul.each( function () {
114
+ var options = {};
115
 
116
+ $( this ).children().each( function () {
117
+ options[ $( this ).data( 'option' ) ] = $( this ).text();
118
+ } );
119
 
120
+ value[ $( this ).data( 'list' ) ] = options;
121
+ } );
 
 
 
 
 
 
122
 
123
+ input.val( (JSON.stringify( value )).replace( /[\\"']/g, '\\$&' ).replace( /\u0000/g, '\\0' ) );
124
+ }
125
+ } ).disableSelection();
126
+ } );
127
 
128
  //google analytics generation
129
+ $( document ).ready( function () {
130
+ $( '.google-analytic-generate' ).click( function () {
131
+ var editor = $( '#' + $( this ).data( 'textarea' ) ).data( 'codemirrorInstance' );
132
+ var gatc = $( '#' + $( this ).data( 'input' ) ).val();
133
+ var basename = $( this ).data( 'basename' );
134
 
135
  var text = "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n";
136
  text += "(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\n";
140
  text += "ga('send', 'pageview');\n";
141
  editor.replaceRange(
142
  text,
143
+ editor.getCursor( 'start' ),
144
+ editor.getCursor( 'end' )
145
  )
146
+ } )
147
+ } );
148
+
149
+
150
+ // prevents the WC message for changes when leaving the panel page
151
+ $( '.yith-plugin-fw-panel .woo-nav-tab-wrapper' ).removeClass( 'woo-nav-tab-wrapper' ).addClass( 'yith-nav-tab-wrapper' );
152
+
153
+ })( jQuery );
plugin-fw/assets/js/yit-plugin-panel.min.js CHANGED
@@ -1 +1,7 @@
1
- !function(t){function e(e,i,n){var a=!0;if("string"==typeof i){":radio"==i.substr(0,6)&&(i+=":checked");for(var n=n.split(","),o=0;o<n.length;o++){if(t(i).val()==n[o]){a=!0;break}a=!1}}a?t(e+"-container").closest("tr").show():t(e+"-container").closest("tr").hide()}var i=function(){var e="";t(this).attr("multiple")?(t(this).children("option:selected").each(function(i,n){0!=i&&(e+=", "),e+=t(n).text()}),""==e&&t(this).children().children("option:selected").each(function(i,n){0!=i&&(e+=", "),e+=t(n).text()})):(e=t(this).children("option:selected").text(),""==e&&(e=t(this).children().children("option:selected").text())),t(this).parent().find("span").length<=0&&t(this).before("<span></span>"),t(this).parent().children("span").replaceWith("<span>"+e+"</span>")};if(t(".plugin-option .select_wrapper select").not(".chosen").each(i).change(i),t(".plugin-option .select_wrapper").click(function(e){e.stopPropagation(),t(this).find("select[multiple]").not(".chosen").toggle()}),t(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(t){t.stopPropagation()}),t(window).click(function(){t(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()}),t(".plugin-option .chosen .select_wrapper select").chosen(),t(".plugin-option .onoff_container span").on("click",function(){var e=t(this).prev("input"),i=e.prop("checked");i?e.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):e.prop("checked",!0).attr("value","yes").addClass("onoffchecked"),e.change()}),t(".plugin-option .panel-colorpicker").wpColorPicker({onInit:function(){},change:function(t,e){},clear:function(){var e=t(this);e.val(e.data("default-color")),e.change()}}),t(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var e=t(this).data("val"),i=t(this).data("min"),n=t(this).data("max"),a=t(this).data("step"),o=t(this).data("labels");t(this).slider({value:e,min:i,max:n,range:"min",step:a,slide:function(e,i){t(this).find("input").val(i.value),t(this).siblings(".feedback").find("strong").text(i.value+o)}})}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media){var n=!0;wp.media.editor.send.attachment;t(".plugin-option .upload_img_url").change(function(){var e=t(this).val(),i=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)"),n=t(this).parents().siblings(".upload_img_preview");i.test(e)?n.html('<img src="'+e+'" style="max-width:600px; max-height:300px;" />'):n.html("")}).trigger("change"),t(document).on("click",".plugin-option .upload_button",function(e){e.preventDefault();var i,n=t(this),a=n.attr("id").replace(/-button$/,"");if(i)return void i.open();var o=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];i=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:o}),i.on("select",function(){var e=i.state().get("selection").first().toJSON();t("#"+a).val(e.url),t("#"+a+"-yith-attachment-id")&&t("#"+a+"-yith-attachment-id").val(e.id),t(".plugin-option .upload_img_url").trigger("change")}),i.open()}),t(document).on("click",".plugin-option .upload_button_reset",function(e){var i=t(this),n=i.attr("id"),a=i.attr("id").replace(/-button_reset$/,""),o=t("#"+n).data("default");t("#"+a).val(o),t(".plugin-option .upload_img_url").trigger("change")})}t(".plugin-option .add_media").on("click",function(){n=!1}),t("[data-field]").each(function(){var i=t(this),n="#"+i.data("field"),a="#"+i.data("dep"),o=i.data("value");t(a).on("change",function(){e(n,a,o.toString())}).change()}),t(".rm_connectedlist").each(function(){var e=t(this).find("ul"),i=t(this).find(":hidden");e.sortable({connectWith:e,update:function(n,a){var o={};e.each(function(){var e={};t(this).children().each(function(){e[t(this).data("option")]=t(this).text()}),o[t(this).data("list")]=e}),i.val(JSON.stringify(o).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()}),t(document).ready(function(){t(".yith-video-link").click(function(e){e.preventDefault();var i=t(this).data("video-id");t("."+i).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",resizable:!1,draggable:!1,create:function(e,i){t(this).css("maxWidth","853px")},open:function(e,i){t(".ui-widget-overlay").bind("click",function(){t(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}}),t(".ui-dialog :button").blur()})}),t(document).ready(function(){t(".codemirror").each(function(e,i){var n=CodeMirror.fromTextArea(i,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});t(i).data("codemirrorInstance",n)})}),t(document).ready(function(){t(".google-analytic-generate").click(function(){var e=t("#"+t(this).data("textarea")).data("codemirrorInstance"),i=t("#"+t(this).data("input")).val(),n=t(this).data("basename"),a="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n";a+="(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\n",a+="m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n",a+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n",a+="ga('create', '"+i+"', '"+n+"');\n",a+="ga('send', 'pageview');\n",e.replaceRange(a,e.getCursor("start"),e.getCursor("end"))})})}(jQuery);
 
 
 
 
 
 
1
+ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,e,b){a instanceof String&&(a=String(a));for(var c=a.length,d=0;d<c;d++){var g=a[d];if(e.call(b,g,d,a))return{i:d,v:g}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,e,b){a!=Array.prototype&&a!=Object.prototype&&(a[e]=b.value)};
2
+ $jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,e,b,c){if(e){b=$jscomp.global;a=a.split(".");for(c=0;c<a.length-1;c++){var d=a[c];d in b||(b[d]={});b=b[d]}a=a[a.length-1];c=b[a];e=e(c);e!=c&&null!=e&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:e})}};
3
+ $jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");
4
+ (function(a){function e(b,c,d,e){var f=!0;if("string"==typeof c){":radio"==c.substr(0,6)&&(c+=":checked");var h=a(c).val();"checkbox"==a(c).attr("type")&&(h=a(c).is(":checked")?"yes":"no");d=d.split(",");for(c=0;c<d.length;c++)if(h!=d[c])f=!1;else{f=!0;break}}d=a(b);b=a(b+"-container").closest("tr");1>b.length&&(b=d.closest(".yith-plugin-fw-panel-wc-row"));e=e.split("-");for(var g in e)if(h=e[g],f)switch(h){case "disable":b.removeClass("yith-disabled");d.attr("disabled",!1);break;case "hideme":d.show();
5
+ break;default:b.show()}else switch(h){case "disable":b.addClass("yith-disabled");d.attr("disabled",!0);break;case "hideme":d.hide();break;default:b.hide()}}a("[data-dep-target]").each(function(){var b=a(this),c="#"+b.data("dep-target"),d="#"+b.data("dep-id"),g=b.data("dep-value"),f=b.data("dep-type");e(c,d,g.toString(),f);a(d).on("change",function(){e(c,d,g.toString(),f)}).change()});a(".rm_connectedlist").each(function(){var b=a(this).find("ul"),c=a(this).find(":hidden");b.sortable({connectWith:b,
6
+ update:function(d,e){var f={};b.each(function(){var b={};a(this).children().each(function(){b[a(this).data("option")]=a(this).text()});f[a(this).data("list")]=b});c.val(JSON.stringify(f).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()});a(document).ready(function(){a(".google-analytic-generate").click(function(){var b=a("#"+a(this).data("textarea")).data("codemirrorInstance"),c=a("#"+a(this).data("input")).val(),d=a(this).data("basename");b.replaceRange("(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n"+
7
+ ("ga('create', '"+c+"', '"+d+"');\n")+"ga('send', 'pageview');\n",b.getCursor("start"),b.getCursor("end"))})});a(".yith-plugin-fw-panel .woo-nav-tab-wrapper").removeClass("woo-nav-tab-wrapper").addClass("yith-nav-tab-wrapper")})(jQuery);
plugin-fw/assets/js/yit-wp-pointer.js CHANGED
@@ -1,5 +1,4 @@
1
  jQuery(document).ready( function($) {
2
-
3
  var pointers = custom_pointer.pointers[0],
4
  options = pointers.options,
5
  target = $(pointers.target),
1
  jQuery(document).ready( function($) {
 
2
  var pointers = custom_pointer.pointers[0],
3
  options = pointers.options,
4
  target = $(pointers.target),
plugin-fw/assets/js/yit-wp-pointer.min.js CHANGED
@@ -1,3 +1,3 @@
1
- jQuery(document).ready(function(b){var c=custom_pointer.pointers[0],d=c.options,a=b(c.target),e=c.pointer_id;b(a).find(".wp-submenu li a").each(function(){var f=b(this),h=f.attr("href"),h=h.replace("admin.php?page=","");if(h==e){var k=f.add(a),g=a.find(c.target.replace("#","."));a.toggleClass("wp-no-current-submenu wp-menu-open wp-has-current-submenu");f.pointer({pointerClass:"yit-wp-pointer",content:d.content,position:d.position,open:function(){console.log("here");k.toggleClass("yit-pointer-selected-row");
2
- g.addClass("yit-pointer")},close:function(){a.toggleClass("wp-no-current-submenu wp-menu-open wp-has-current-submenu");k.toggleClass("yit-pointer-selected-row");g.removeClass("yit-pointer");b.ajax({type:"POST",url:ajaxurl,data:{action:"dismiss-wp-pointer",pointer:e},success:function(a){}})}}).pointer("open")}else if("yith_default_pointer"==e){var k=f.add(a),g=a.find(c.target.replace("#",".")),l=b(c.target);l.addClass("wp-has-current-submenu");g.pointer({pointerClass:"yit-wp-pointer",content:d.content,
3
- position:d.position,open:function(){l.addClass("yit-pointer-selected-row")},close:function(){l.removeClass("yit-pointer-selected-row wp-has-current-submenu");b.ajax({type:"POST",url:ajaxurl,data:{action:"dismiss-wp-pointer",pointer:e},success:function(a){}})}}).pointer("open")}})});
1
+ jQuery(document).ready(function(b){var c=custom_pointer.pointers[0],d=c.options,a=b(c.target),e=c.pointer_id;b(a).find(".wp-submenu li a").each(function(){var f=b(this),h=f.attr("href"),h=h.replace("admin.php?page=","");if(h==e){var k=f.add(a),g=a.find(c.target.replace("#","."));a.toggleClass("wp-no-current-submenu wp-menu-open wp-has-current-submenu");f.pointer({pointerClass:"yit-wp-pointer",content:d.content,position:d.position,open:function(){k.toggleClass("yit-pointer-selected-row");g.addClass("yit-pointer")},
2
+ close:function(){a.toggleClass("wp-no-current-submenu wp-menu-open wp-has-current-submenu");k.toggleClass("yit-pointer-selected-row");g.removeClass("yit-pointer");b.ajax({type:"POST",url:ajaxurl,data:{action:"dismiss-wp-pointer",pointer:e},success:function(a){}})}}).pointer("open")}else if("yith_default_pointer"==e){var k=f.add(a),g=a.find(c.target.replace("#",".")),l=b(c.target);l.addClass("wp-has-current-submenu");g.pointer({pointerClass:"yit-wp-pointer",content:d.content,position:d.position,open:function(){l.addClass("yit-pointer-selected-row")},
3
+ close:function(){l.removeClass("yit-pointer-selected-row wp-has-current-submenu");b.ajax({type:"POST",url:ajaxurl,data:{action:"dismiss-wp-pointer",pointer:e},success:function(a){}})}}).pointer("open")}})});
plugin-fw/assets/js/yith-enhanced-select-wc-2.6.js ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ global yith_framework_enhanced_select_params
3
+ */
4
+ jQuery( document ).ready( function ( $ ) {
5
+ "use strict";
6
+
7
+ $( document.body )
8
+ .on( 'yith-framework-enhanced-select-init', function () {
9
+ // Post Search
10
+ $( ':input.yith-post-search' ).filter( ':not(.enhanced)' ).each( function () {
11
+ var default_data = {
12
+ action : 'yith_plugin_fw_json_search_posts',
13
+ security : yith_framework_enhanced_select_params.search_posts_nonce,
14
+ post_type: 'post'
15
+ },
16
+ current_data = $.extend( default_data, $( this ).data() ),
17
+ select2_args = {
18
+ allowClear : $( this ).data( 'allow_clear' ) ? true : false,
19
+ placeholder : $( this ).data( 'placeholder' ),
20
+ minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '3',
21
+ escapeMarkup : function ( m ) {
22
+ return m;
23
+ },
24
+ ajax : {
25
+ url : yith_framework_enhanced_select_params.ajax_url,
26
+ dataType : 'json',
27
+ quietMillis: 250,
28
+ data : function ( term ) {
29
+ current_data.term = term;
30
+ return current_data;
31
+ },
32
+ results : function ( data ) {
33
+ var terms = [];
34
+ if ( data ) {
35
+ $.each( data, function ( id, text ) {
36
+ terms.push( { id: id, text: text } );
37
+ } );
38
+ }
39
+ return {
40
+ results: terms
41
+ };
42
+ },
43
+ cache : true
44
+ }
45
+ };
46
+
47
+ if ( $( this ).data( 'multiple' ) === true ) {
48
+ select2_args.multiple = true;
49
+ select2_args.initSelection = function ( element, callback ) {
50
+ var data = $.parseJSON( element.attr( 'data-selected' ) );
51
+ var selected = [];
52
+
53
+ $( element.val().split( ',' ) ).each( function ( i, val ) {
54
+ selected.push( {
55
+ id : val,
56
+ text: data[ val ]
57
+ } );
58
+ } );
59
+ return callback( selected );
60
+ };
61
+ select2_args.formatSelection = function ( data ) {
62
+ return '<div class="selected-option" data-id="' + data.id + '">' + data.text + '</div>';
63
+ };
64
+ } else {
65
+ select2_args.multiple = false;
66
+ select2_args.initSelection = function ( element, callback ) {
67
+ var data = {
68
+ id : element.val(),
69
+ text: element.attr( 'data-selected' )
70
+ };
71
+ return callback( data );
72
+ };
73
+ }
74
+
75
+ $( this ).select2( select2_args ).addClass( 'enhanced' );
76
+ } );
77
+
78
+ // Term Search
79
+ $( ':input.yith-term-search' ).filter( ':not(.enhanced)' ).each( function () {
80
+ var default_data = {
81
+ action : 'yith_plugin_fw_json_search_terms',
82
+ security : yith_framework_enhanced_select_params.search_terms_nonce,
83
+ taxonomy: 'category'
84
+ },
85
+ current_data = $.extend( default_data, $( this ).data() ),
86
+ select2_args = {
87
+ allowClear : $( this ).data( 'allow_clear' ) ? true : false,
88
+ placeholder : $( this ).data( 'placeholder' ),
89
+ minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '3',
90
+ escapeMarkup : function ( m ) {
91
+ return m;
92
+ },
93
+ ajax : {
94
+ url : yith_framework_enhanced_select_params.ajax_url,
95
+ dataType : 'json',
96
+ quietMillis: 250,
97
+ data : function ( term ) {
98
+ current_data.term = term;
99
+ return current_data;
100
+ },
101
+ results : function ( data ) {
102
+ var terms = [];
103
+ if ( data ) {
104
+ $.each( data, function ( id, text ) {
105
+ terms.push( { id: id, text: text } );
106
+ } );
107
+ }
108
+ return {
109
+ results: terms
110
+ };
111
+ },
112
+ cache : true
113
+ }
114
+ };
115
+
116
+ if ( $( this ).data( 'multiple' ) === true ) {
117
+ select2_args.multiple = true;
118
+ select2_args.initSelection = function ( element, callback ) {
119
+ var data = $.parseJSON( element.attr( 'data-selected' ) );
120
+ var selected = [];
121
+
122
+ $( element.val().split( ',' ) ).each( function ( i, val ) {
123
+ selected.push( {
124
+ id : val,
125
+ text: data[ val ]
126
+ } );
127
+ } );
128
+ return callback( selected );
129
+ };
130
+ select2_args.formatSelection = function ( data ) {
131
+ return '<div class="selected-option" data-id="' + data.id + '">' + data.text + '</div>';
132
+ };
133
+ } else {
134
+ select2_args.multiple = false;
135
+ select2_args.initSelection = function ( element, callback ) {
136
+ var data = {
137
+ id : element.val(),
138
+ text: element.attr( 'data-selected' )
139
+ };
140
+ return callback( data );
141
+ };
142
+ }
143
+
144
+ $( this ).select2( select2_args ).addClass( 'enhanced' );
145
+ } );
146
+ } ).trigger( 'yith-framework-enhanced-select-init' );
147
+
148
+ } );
plugin-fw/assets/js/yith-enhanced-select-wc-2.6.min.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ jQuery(document).ready(function(a){a(document.body).on("yith-framework-enhanced-select-init",function(){a(":input.yith-post-search").filter(":not(.enhanced)").each(function(){var d=a.extend({action:"yith_plugin_fw_json_search_posts",security:yith_framework_enhanced_select_params.search_posts_nonce,post_type:"post"},a(this).data()),c={allowClear:a(this).data("allow_clear")?!0:!1,placeholder:a(this).data("placeholder"),minimumInputLength:a(this).data("minimum_input_length")?a(this).data("minimum_input_length"):
2
+ "3",escapeMarkup:function(b){return b},ajax:{url:yith_framework_enhanced_select_params.ajax_url,dataType:"json",quietMillis:250,data:function(b){d.term=b;return d},results:function(b){var c=[];b&&a.each(b,function(b,a){c.push({id:b,text:a})});return{results:c}},cache:!0}};!0===a(this).data("multiple")?(c.multiple=!0,c.initSelection=function(b,c){var f=a.parseJSON(b.attr("data-selected")),e=[];a(b.val().split(",")).each(function(b,a){e.push({id:a,text:f[a]})});return c(e)},c.formatSelection=function(b){return'<div class="selected-option" data-id="'+
3
+ b.id+'">'+b.text+"</div>"}):(c.multiple=!1,c.initSelection=function(b,a){var c={id:b.val(),text:b.attr("data-selected")};return a(c)});a(this).select2(c).addClass("enhanced")});a(":input.yith-term-search").filter(":not(.enhanced)").each(function(){var d=a.extend({action:"yith_plugin_fw_json_search_terms",security:yith_framework_enhanced_select_params.search_terms_nonce,taxonomy:"category"},a(this).data()),c={allowClear:a(this).data("allow_clear")?!0:!1,placeholder:a(this).data("placeholder"),minimumInputLength:a(this).data("minimum_input_length")?
4
+ a(this).data("minimum_input_length"):"3",escapeMarkup:function(b){return b},ajax:{url:yith_framework_enhanced_select_params.ajax_url,dataType:"json",quietMillis:250,data:function(b){d.term=b;return d},results:function(b){var c=[];b&&a.each(b,function(b,a){c.push({id:b,text:a})});return{results:c}},cache:!0}};!0===a(this).data("multiple")?(c.multiple=!0,c.initSelection=function(b,c){var d=a.parseJSON(b.attr("data-selected")),e=[];a(b.val().split(",")).each(function(b,a){e.push({id:a,text:d[a]})});
5
+ return c(e)},c.formatSelection=function(a){return'<div class="selected-option" data-id="'+a.id+'">'+a.text+"</div>"}):(c.multiple=!1,c.initSelection=function(a,c){var d={id:a.val(),text:a.attr("data-selected")};return c(d)});a(this).select2(c).addClass("enhanced")})}).trigger("yith-framework-enhanced-select-init")});
plugin-fw/assets/js/yith-enhanced-select.js ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global yith_framework_enhanced_select_params */
2
+
3
+ jQuery( document ).ready( function ( $ ) {
4
+ "use strict";
5
+
6
+ $( document.body )
7
+ .on( 'yith-framework-enhanced-select-init', function () {
8
+ // Post Search
9
+ $( '.yith-post-search' ).filter( ':not(.enhanced)' ).each( function () {
10
+ var default_data = {
11
+ action : 'yith_plugin_fw_json_search_posts',
12
+ security : yith_framework_enhanced_select_params.search_posts_nonce,
13
+ post_type: 'post'
14
+ },
15
+ current_data = $.extend( default_data, $( this ).data() ),
16
+ select2_args = {
17
+ allowClear : $( this ).data( 'allow_clear' ) ? true : false,
18
+ placeholder : $( this ).data( 'placeholder' ),
19
+ minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '3',
20
+ escapeMarkup : function ( m ) {
21
+ return m;
22
+ },
23
+ ajax : {
24
+ url : ajaxurl,
25
+ dataType : 'json',
26
+ quietMillis : 250,
27
+ data : function ( params ) {
28
+ var default_data_to_return = {
29
+ term: params.term
30
+ };
31
+
32
+ return $.extend( default_data_to_return, current_data );
33
+ },
34
+ processResults: function ( data ) {
35
+ var terms = [];
36
+ if ( data ) {
37
+ $.each( data, function ( id, text ) {
38
+ terms.push( { id: id, text: text } );
39
+ } );
40
+ }
41
+ return {
42
+ results: terms
43
+ };
44
+ },
45
+ cache : true
46
+ }
47
+ };
48
+
49
+ $( this ).select2( select2_args ).addClass( 'enhanced' );
50
+
51
+ if ( $( this ).data( 'sortable' ) ) {
52
+ var $select = $( this );
53
+ var $list = $( this ).next( '.select2-container' ).find( 'ul.select2-selection__rendered' );
54
+
55
+ $list.sortable( {
56
+ placeholder : 'ui-state-highlight select2-selection__choice',
57
+ forcePlaceholderSize: true,
58
+ items : 'li:not(.select2-search__field)',
59
+ tolerance : 'pointer',
60
+ stop : function () {
61
+ $( $list.find( '.select2-selection__choice' ).get().reverse() ).each( function () {
62
+ var id = $( this ).data( 'data' ).id;
63
+ var option = $select.find( 'option[value="' + id + '"]' )[ 0 ];
64
+ $select.prepend( option );
65
+ } );
66
+ }
67
+ } );
68
+ }
69
+ } );
70
+
71
+ // TERM SEARCH
72
+ $( '.yith-term-search' ).filter( ':not(.enhanced)' ).each( function () {
73
+ var default_data = {
74
+ action : 'yith_plugin_fw_json_search_terms',
75
+ security: yith_framework_enhanced_select_params.search_terms_nonce,
76
+ taxonomy: 'category'
77
+ },
78
+ current_data = $.extend( default_data, $( this ).data() ),
79
+ select2_args = {
80
+ allowClear : $( this ).data( 'allow_clear' ) ? true : false,
81
+ placeholder : $( this ).data( 'placeholder' ),
82
+ minimumInputLength: $( this ).data( 'minimum_input_length' ) ? $( this ).data( 'minimum_input_length' ) : '3',
83
+ escapeMarkup : function ( m ) {
84
+ return m;
85
+ },
86
+ ajax : {
87
+ url : ajaxurl,
88
+ dataType : 'json',
89
+ quietMillis : 250,
90
+ data : function ( params ) {
91
+ var default_data_to_return = {
92
+ term: params.term
93
+ };
94
+
95
+ return $.extend( default_data_to_return, current_data );
96
+ },
97
+ processResults: function ( data ) {
98
+ var terms = [];
99
+ if ( data ) {
100
+ $.each( data, function ( id, text ) {
101
+ terms.push( { id: id, text: text } );
102
+ } );
103
+ }
104
+ return {
105
+ results: terms
106
+ };
107
+ },
108
+ cache : true
109
+ }
110
+ };
111
+
112
+ $( this ).select2( select2_args ).addClass( 'enhanced' );
113
+
114
+ if ( $( this ).data( 'sortable' ) ) {
115
+ var $select = $( this );
116
+ var $list = $( this ).next( '.select2-container' ).find( 'ul.select2-selection__rendered' );
117
+
118
+ $list.sortable( {
119
+ placeholder : 'ui-state-highlight select2-selection__choice',
120
+ forcePlaceholderSize: true,
121
+ items : 'li:not(.select2-search__field)',
122
+ tolerance : 'pointer',
123
+ stop : function () {
124
+ $( $list.find( '.select2-selection__choice' ).get().reverse() ).each( function () {
125
+ var id = $( this ).data( 'data' ).id;
126
+ var option = $select.find( 'option[value="' + id + '"]' )[ 0 ];
127
+ $select.prepend( option );
128
+ } );
129
+ }
130
+ } );
131
+ }
132
+ } );
133
+
134
+ } ).trigger( 'yith-framework-enhanced-select-init' );
135
+
136
+ } );
plugin-fw/assets/js/yith-enhanced-select.min.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ jQuery(document).ready(function(a){a(document.body).on("yith-framework-enhanced-select-init",function(){a(".yith-post-search").filter(":not(.enhanced)").each(function(){var e=a.extend({action:"yith_plugin_fw_json_search_posts",security:yith_framework_enhanced_select_params.search_posts_nonce,post_type:"post"},a(this).data()),f={allowClear:a(this).data("allow_clear")?!0:!1,placeholder:a(this).data("placeholder"),minimumInputLength:a(this).data("minimum_input_length")?a(this).data("minimum_input_length"):
2
+ "3",escapeMarkup:function(a){return a},ajax:{url:ajaxurl,dataType:"json",quietMillis:250,data:function(b){return a.extend({term:b.term},e)},processResults:function(b){var c=[];b&&a.each(b,function(a,b){c.push({id:a,text:b})});return{results:c}},cache:!0}};a(this).select2(f).addClass("enhanced");if(a(this).data("sortable")){var c=a(this),d=a(this).next(".select2-container").find("ul.select2-selection__rendered");d.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,
3
+ items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){a(d.find(".select2-selection__choice").get().reverse()).each(function(){var b=a(this).data("data").id,b=c.find('option[value="'+b+'"]')[0];c.prepend(b)})}})}});a(".yith-term-search").filter(":not(.enhanced)").each(function(){var e=a.extend({action:"yith_plugin_fw_json_search_terms",security:yith_framework_enhanced_select_params.search_terms_nonce,taxonomy:"category"},a(this).data()),f={allowClear:a(this).data("allow_clear")?
4
+ !0:!1,placeholder:a(this).data("placeholder"),minimumInputLength:a(this).data("minimum_input_length")?a(this).data("minimum_input_length"):"3",escapeMarkup:function(a){return a},ajax:{url:ajaxurl,dataType:"json",quietMillis:250,data:function(b){return a.extend({term:b.term},e)},processResults:function(b){var c=[];b&&a.each(b,function(a,b){c.push({id:a,text:b})});return{results:c}},cache:!0}};a(this).select2(f).addClass("enhanced");if(a(this).data("sortable")){var c=a(this),d=a(this).next(".select2-container").find("ul.select2-selection__rendered");
5
+ d.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){a(d.find(".select2-selection__choice").get().reverse()).each(function(){var b=a(this).data("data").id,b=c.find('option[value="'+b+'"]')[0];c.prepend(b)})}})}})}).trigger("yith-framework-enhanced-select-init")});
plugin-fw/assets/js/yith-fields.js ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( function ( $ ) {
2
+
3
+ var $datepicker = $( '.yith-plugin-fw-datepicker' ),
4
+ $colorpicker = $( '.yith-plugin-fw-colorpicker' ),
5
+ $upload = {
6
+ imgPreviewHandler : '.yith-plugin-fw-upload-img-preview',
7
+ uploadButtonHandler: '.yith-plugin-fw-upload-button',
8
+ imgUrlHandler : '.yith-plugin-fw-upload-img-url',
9
+ resetButtonHandler : '.yith-plugin-fw-upload-button-reset',
10
+ imgUrl : $( '.yith-plugin-fw-upload-img-url' )
11
+ },
12
+ $wpAddMedia = $( '.add_media' ),
13
+ $imageGallery = {
14
+ sliderWrapper: $( '.yith-plugin-fw .image-gallery ul.slides-wrapper' ),
15
+ buttonHandler: '.yith-plugin-fw .image-gallery-button'
16
+ },
17
+ $onoff = $( '.yith-plugin-fw-onoff-container span' ),
18
+ $sidebars = $( '.yith-plugin-fw-sidebar-layout' ),
19
+ $slider = $( '.yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal' ),
20
+ $codemirror = $( '.codemirror' ),
21
+ $icons = $( '.yit-icons-manager-wrapper' );
22
+
23
+ /* Datepicker */
24
+ $datepicker.each( function () {
25
+ var args = $( this ).data();
26
+ $( this ).datepicker( args );
27
+ } );
28
+
29
+ /* Colorpicker */
30
+ $colorpicker.wpColorPicker( {
31
+ clear: function () {
32
+ var input = $( this );
33
+ input.val( input.data( 'default-color' ) );
34
+ input.change();
35
+ }
36
+ } );
37
+ $colorpicker.each( function () {
38
+ var select_label = $( this ).data( 'variations-label' );
39
+ $( this ).parent().parent().find( 'a.wp-color-result' ).attr( 'title', select_label );
40
+ } );
41
+
42
+ /* Upload */
43
+ if ( typeof wp !== 'undefined' && typeof wp.media !== 'undefined' ) {
44
+ var _custom_media = true;
45
+ // preview
46
+ $upload.imgUrl.change( function () {
47
+ var url = $( this ).val(),
48
+ re = new RegExp( "(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)" ),
49
+ preview = $( this ).parent().find( $upload.imgPreviewHandler ).first();
50
+
51
+ if ( preview.length < 1 )
52
+ preview = $( this ).parent().parent().find( $upload.imgPreviewHandler ).first();
53
+
54
+ if ( re.test( url ) ) {
55
+ preview.html( '<img src="' + url + '" style="max-width:100px; max-height:100px;" />' );
56
+ } else {
57
+ preview.html( '' );
58
+ }
59
+ } ).trigger( 'change' );
60
+
61
+ $( document ).on( 'click', $upload.uploadButtonHandler, function ( e ) {
62
+ e.preventDefault();
63
+
64
+ var t = $( this ),
65
+ custom_uploader,
66
+ id = t.attr( 'id' ).replace( /-button$/, '' );
67
+
68
+ //If the uploader object has already been created, reopen the dialog
69
+ if ( custom_uploader ) {
70
+ custom_uploader.open();
71
+ return;
72
+ }
73
+
74
+ var custom_uploader_states = [
75
+ // Main states.
76
+ new wp.media.controller.Library( {
77
+ library : wp.media.query(),
78
+ multiple : false,
79
+ title : 'Choose Image',
80
+ priority : 20,
81
+ filterable: 'uploaded'
82
+ } )
83
+ ];
84
+
85
+ // Create the media frame.
86
+ custom_uploader = wp.media.frames.downloadable_file = wp.media( {
87
+ // Set the title of the modal.
88
+ title : 'Choose Image',
89
+ library : {
90
+ type: ''
91
+ },
92
+ button : {
93
+ text: 'Choose Image'
94
+ },
95
+ multiple: false,
96
+ states : custom_uploader_states
97
+ } );
98
+
99
+ //When a file is selected, grab the URL and set it as the text field's value
100
+ custom_uploader.on( 'select', function () {
101
+ var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
102
+
103
+ $( "#" + id ).val( attachment.url );
104
+ // Save the id of the selected element to an element which name is the same with a suffix "-yith-attachment-id"
105
+ if ( $( "#" + id + "-yith-attachment-id" ) ) {
106
+ $( "#" + id + "-yith-attachment-id" ).val( attachment.id );
107
+ }
108
+ $upload.imgUrl.trigger( 'change' );
109
+ } );
110
+
111
+ //Open the uploader dialog
112
+ custom_uploader.open();
113
+ } );
114
+
115
+ $( document ).on( 'click', $upload.resetButtonHandler, function ( e ) {
116
+ var t = $( this ),
117
+ id = t.attr( 'id' ),
118
+ input_id = t.attr( 'id' ).replace( /-button-reset$/, '' ),
119
+ default_value = $( '#' + id ).data( 'default' );
120
+
121
+ $( "#" + input_id ).val( default_value );
122
+ $upload.imgUrl.trigger( 'change' );
123
+ } );
124
+ }
125
+
126
+ $wpAddMedia.on( 'click', function () {
127
+ _custom_media = false;
128
+ } );
129
+
130
+ /* Image Gallery */
131
+ if ( typeof wp !== 'undefined' && typeof wp.media !== 'undefined' ) {
132
+ $( document ).on( 'click', $imageGallery.buttonHandler, function ( e ) {
133
+ var $t = $( this ),
134
+ $container = $t.closest( '.image-gallery' ),
135
+ $image_gallery_ids = $container.find( '.image_gallery_ids' ),
136
+ attachment_ids = $image_gallery_ids.val(),
137
+ $gallery_images_wrapper = $container.find( 'ul.slides-wrapper' );
138
+
139
+ // Create the media frame.
140
+ var image_gallery_frame = wp.media.frames.image_gallery = wp.media( {
141
+ // Set the title of the modal.
142
+ title : $t.data( 'choose' ),
143
+ button: {
144
+ text: $t.data( 'update' )
145
+ },
146
+ states: [
147
+ new wp.media.controller.Library( {
148
+ title : $t.data( 'choose' ),
149
+ filterable: 'all',
150
+ multiple : true
151
+ } )
152
+ ]
153
+ } );
154
+
155
+ // When an image is selected, run a callback.
156
+ image_gallery_frame.on( 'select', function () {
157
+ var selection = image_gallery_frame.state().get( 'selection' );
158
+ selection.map( function ( attachment ) {
159
+ attachment = attachment.toJSON();
160
+
161
+ if ( attachment.id ) {
162
+ attachment_ids = attachment_ids ? attachment_ids + "," + attachment.id : attachment.id;
163
+ $gallery_images_wrapper.append( '<li class="image" data-attachment_id="' + attachment.id + '"><img src="' + attachment.sizes.thumbnail.url + '"/><ul class="actions"><li><a href="#" class="delete" title="' + $t.data( 'delete' ) + '">x</a></li></ul></li>' );
164
+ }
165
+ } );
166
+
167
+ $image_gallery_ids.val( attachment_ids );
168
+ } );
169
+
170
+ image_gallery_frame.open();
171
+
172
+ } );
173
+
174
+ // Image ordering
175
+ $imageGallery.sliderWrapper.each( function () {
176
+ var $t = $( this );
177
+ $t.sortable( {
178
+ items : 'li.image',
179
+ cursor : 'move',
180
+ scrollSensitivity : 40,
181
+ forcePlaceholderSize: true,
182
+ forceHelperSize : false,
183
+ helper : 'clone',
184
+ opacity : 0.65,
185
+ start : function ( event, ui ) {
186
+ ui.item.css( 'background-color', '#f6f6f6' );
187
+ },
188
+ stop : function ( event, ui ) {
189
+ ui.item.removeAttr( 'style' );
190
+ },
191
+ update : function ( event, ui ) {
192
+ var attachment_ids = '';
193
+
194
+ $t.find( 'li.image' ).css( 'cursor', 'default' ).each( function () {
195
+ var attachment_id = $( this ).attr( 'data-attachment_id' );
196
+ attachment_ids = attachment_ids + attachment_id + ',';
197
+ } );
198
+
199
+ $t.closest( '.image-gallery' ).find( '.image_gallery_ids' ).val( attachment_ids );
200
+ }
201
+ } );
202
+ } );
203
+
204
+ // Remove images
205
+ $imageGallery.sliderWrapper.on( 'click', 'a.delete', function () {
206
+ var $wrapper = $( this ).closest( '.image-gallery' ),
207
+ $gallery = $( this ).closest( '.image-gallery ul.slides-wrapper' ),
208
+ $image_gallery_ids = $wrapper.find( '.image_gallery_ids' ),
209
+ attachment_ids = '';
210
+
211
+ $( this ).closest( 'li.image' ).remove();
212
+
213
+ $gallery.find( 'li.image' ).css( 'cursor', 'default' ).each( function () {
214
+ var attachment_id = $( this ).attr( 'data-attachment_id' );
215
+ attachment_ids = attachment_ids + attachment_id + ',';
216
+ } );
217
+
218
+ $image_gallery_ids.val( attachment_ids );
219
+ } );
220
+ }
221
+
222
+ /* on-off */
223
+ $onoff.on( 'click', function () {
224
+ var input = $( this ).prev( 'input' ),
225
+ checked = input.prop( 'checked' );
226
+
227
+ if ( checked ) {
228
+ input.prop( 'checked', false ).attr( 'value', 'no' ).removeClass( 'onoffchecked' );
229
+ } else {
230
+ input.prop( 'checked', true ).attr( 'value', 'yes' ).addClass( 'onoffchecked' );
231
+ }
232
+
233
+ input.change();
234
+ } );
235
+
236
+ /* Sidebars */
237
+ $sidebars.each( function () {
238
+ var $images = $( this ).find( 'img' );
239
+ $images.on( 'click', function () {
240
+ var $container = $( this ).closest( '.yith-plugin-fw-sidebar-layout' ),
241
+ $left = $container.find( '.yith-plugin-fw-sidebar-layout-sidebar-left-container' ),
242
+ $right = $container.find( '.yith-plugin-fw-sidebar-layout-sidebar-right-container' ),
243
+ type = $( this ).data( 'type' );
244
+
245
+ $( this ).parent().children( ':radio' ).attr( 'checked', false );
246
+ $( this ).prev( ':radio' ).attr( 'checked', true );
247
+
248
+ if ( typeof type != 'undefined' ) {
249
+ switch ( type ) {
250
+ case 'left':
251
+ $left.show();
252
+ $right.hide();
253
+ break;
254
+ case 'right':
255
+ $right.show();
256
+ $left.hide();
257
+ break;
258
+ case 'double':
259
+ $left.show();
260
+ $right.show();
261
+ break;
262
+ default:
263
+ $left.hide();
264
+ $right.hide();
265
+ break;
266
+ }
267
+ }
268
+ } );
269
+ } );
270
+
271
+ /* Slider */
272
+ $slider.each( function () {
273
+ var val = $( this ).data( 'val' ),
274
+ minValue = $( this ).data( 'min' ),
275
+ maxValue = $( this ).data( 'max' ),
276
+ step = $( this ).data( 'step' ),
277
+ labels = $( this ).data( 'labels' );
278
+
279
+ $( this ).slider( {
280
+ value: val,
281
+ min : minValue,
282
+ max : maxValue,
283
+ range: 'min',
284
+ step : step,
285
+
286
+ create: function() {
287
+ $( this ).find( '.ui-slider-handle' ).text( $( this ).slider( "value" ) );
288
+ },
289
+
290
+
291
+ slide: function ( event, ui ) {
292
+ $( this ).find( 'input' ).val( ui.value );
293
+ $( this ).find( '.ui-slider-handle' ).text( ui.value );
294
+ $( this ).siblings( '.feedback' ).find( 'strong' ).text( ui.value + labels );
295
+ }
296
+ } );
297
+ } );
298
+
299
+ /* codemirror */
300
+ $codemirror.each( function ( i, v ) {
301
+ var editor = CodeMirror.fromTextArea( v, {
302
+ lineNumbers : 1,
303
+ mode : 'javascript',
304
+ showCursorWhenSelecting: true
305
+ } );
306
+
307
+ $( v ).data( 'codemirrorInstance', editor );
308
+ } );
309
+
310
+ /* Select All - Deselect All */
311
+ $( document ).on( 'click', '.yith-plugin-fw-select-all', function () {
312
+ var $targetSelect = $( '#' + $( this ).data( 'select-id' ) );
313
+ $targetSelect.find( 'option' ).prop( 'selected', true ).trigger( 'change' );
314
+ } );
315
+
316
+ $( document ).on( 'click', '.yith-plugin-fw-deselect-all', function () {
317
+ var $targetSelect = $( '#' + $( this ).data( 'select-id' ) );
318
+ $targetSelect.find( 'option' ).prop( 'selected', false ).trigger( 'change' );
319
+ } );
320
+
321
+
322
+ $icons.each( function () {
323
+ var $container = $( this ),
324
+ $preview = $container.find( '.yit-icons-manager-icon-preview' ).first(),
325
+ $text = $container.find( '.yit-icons-manager-icon-text' );
326
+
327
+ $container.on( 'click', '.yit-icons-manager-list li', function ( event ) {
328
+ var $target = $( event.target ).closest( 'li' ),
329
+ font = $target.data( 'font' ),
330
+ icon = $target.data( 'icon' ),
331
+ key = $target.data( 'key' ),
332
+ name = $target.data( 'name' );
333
+
334
+ $preview.attr( 'data-font', font );
335
+ $preview.attr( 'data-icon', icon );
336
+ $preview.attr( 'data-key', key );
337
+ $preview.attr( 'data-name', name );
338
+
339
+ $text.val( font + ':' + name );
340
+
341
+ $container.find( '.yit-icons-manager-list li' ).removeClass( 'active' );
342
+ $target.addClass( 'active' );
343
+ } );
344
+
345
+ $container.on( 'click', '.yit-icons-manager-action-set-default', function () {
346
+ $container.find( '.yit-icons-manager-list li.default' ).trigger( 'click' );
347
+ } );
348
+ } );
349
+
350
+ } );
plugin-fw/assets/js/yith-fields.min.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,g,e){a instanceof String&&(a=String(a));for(var d=a.length,h=0;h<d;h++){var l=a[h];if(g.call(e,l,h,a))return{i:h,v:l}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,g,e){a!=Array.prototype&&a!=Object.prototype&&(a[g]=e.value)};
2
+ $jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,g,e,d){if(g){e=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var h=a[d];h in e||(e[h]={});e=e[h]}a=a[a.length-1];d=e[a];g=g(d);g!=d&&null!=g&&$jscomp.defineProperty(e,a,{configurable:!0,writable:!0,value:g})}};
3
+ $jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,e){return $jscomp.findInternal(this,a,e).v}},"es6","es3");
4
+ jQuery(function(a){var g=a(".yith-plugin-fw-datepicker"),e=a(".yith-plugin-fw-colorpicker"),d=a(".yith-plugin-fw-upload-img-url"),h=a(".add_media"),l=a(".yith-plugin-fw .image-gallery ul.slides-wrapper"),m=a(".yith-plugin-fw-onoff-container span"),n=a(".yith-plugin-fw-sidebar-layout"),p=a(".yith-plugin-fw .yith-plugin-fw-slider-container .ui-slider-horizontal"),q=a(".codemirror"),r=a(".yit-icons-manager-wrapper");g.each(function(){var b=a(this).data();a(this).datepicker(b)});e.wpColorPicker({clear:function(){var b=
5
+ a(this);b.val(b.data("default-color"));b.change()}});e.each(function(){var b=a(this).data("variations-label");a(this).parent().parent().find("a.wp-color-result").attr("title",b)});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&(d.change(function(){var b=a(this).val(),c=a(this).parent().find(".yith-plugin-fw-upload-img-preview").first();1>c.length&&(c=a(this).parent().parent().find(".yith-plugin-fw-upload-img-preview").first());/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?
6
+ c.html('<img src="'+b+'" style="max-width:100px; max-height:100px;" />'):c.html("")}).trigger("change"),a(document).on("click",".yith-plugin-fw-upload-button",function(b){b.preventDefault();var c=a(this).attr("id").replace(/-button$/,"");if(!f){b=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];var f=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,
7
+ states:b});f.on("select",function(){var b=f.state().get("selection").first().toJSON();a("#"+c).val(b.url);a("#"+c+"-yith-attachment-id")&&a("#"+c+"-yith-attachment-id").val(b.id);d.trigger("change")})}f.open()}),a(document).on("click",".yith-plugin-fw-upload-button-reset",function(b){var c=a(this);b=c.attr("id");c=c.attr("id").replace(/-button-reset$/,"");b=a("#"+b).data("default");a("#"+c).val(b);d.trigger("change")}));h.on("click",function(){});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&
8
+ (a(document).on("click",".yith-plugin-fw .image-gallery-button",function(b){var c=a(this);b=c.closest(".image-gallery");var f=b.find(".image_gallery_ids"),k=f.val(),e=b.find("ul.slides-wrapper"),d=wp.media.frames.image_gallery=wp.media({title:c.data("choose"),button:{text:c.data("update")},states:[new wp.media.controller.Library({title:c.data("choose"),filterable:"all",multiple:!0})]});d.on("select",function(){d.state().get("selection").map(function(a){a=a.toJSON();a.id&&(k=k?k+","+a.id:a.id,e.append('<li class="image" data-attachment_id="'+
9
+ a.id+'"><img src="'+a.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+c.data("delete")+'">x</a></li></ul></li>'))});f.val(k)});d.open()}),l.each(function(){var b=a(this);b.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,start:function(a,b){b.item.css("background-color","#f6f6f6")},stop:function(a,b){b.item.removeAttr("style")},update:function(c,f){var k="";b.find("li.image").css("cursor",
10
+ "default").each(function(){var b=a(this).attr("data-attachment_id");k=k+b+","});b.closest(".image-gallery").find(".image_gallery_ids").val(k)}})}),l.on("click","a.delete",function(){var b=a(this).closest(".image-gallery"),c=a(this).closest(".image-gallery ul.slides-wrapper");b=b.find(".image_gallery_ids");var f="";a(this).closest("li.image").remove();c.find("li.image").css("cursor","default").each(function(){var b=a(this).attr("data-attachment_id");f=f+b+","});b.val(f)}));m.on("click",function(){var b=
11
+ a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});n.each(function(){a(this).find("img").on("click",function(){var b=a(this).closest(".yith-plugin-fw-sidebar-layout"),c=b.find(".yith-plugin-fw-sidebar-layout-sidebar-left-container");b=b.find(".yith-plugin-fw-sidebar-layout-sidebar-right-container");var f=a(this).data("type");a(this).parent().children(":radio").attr("checked",
12
+ !1);a(this).prev(":radio").attr("checked",!0);if("undefined"!=typeof f)switch(f){case "left":c.show();b.hide();break;case "right":b.show();c.hide();break;case "double":c.show();b.show();break;default:c.hide(),b.hide()}})});p.each(function(){var b=a(this).data("val"),c=a(this).data("min"),f=a(this).data("max"),e=a(this).data("step"),d=a(this).data("labels");a(this).slider({value:b,min:c,max:f,range:"min",step:e,create:function(){a(this).find(".ui-slider-handle").text(a(this).slider("value"))},slide:function(b,
13
+ c){a(this).find("input").val(c.value);a(this).find(".ui-slider-handle").text(c.value);a(this).siblings(".feedback").find("strong").text(c.value+d)}})});q.each(function(b,c){b=CodeMirror.fromTextArea(c,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});a(c).data("codemirrorInstance",b)});a(document).on("click",".yith-plugin-fw-select-all",function(){a("#"+a(this).data("select-id")).find("option").prop("selected",!0).trigger("change")});a(document).on("click",".yith-plugin-fw-deselect-all",
14
+ function(){a("#"+a(this).data("select-id")).find("option").prop("selected",!1).trigger("change")});r.each(function(){var b=a(this),c=b.find(".yit-icons-manager-icon-preview").first(),e=b.find(".yit-icons-manager-icon-text");b.on("click",".yit-icons-manager-list li",function(d){d=a(d.target).closest("li");var f=d.data("font"),g=d.data("icon"),h=d.data("key"),k=d.data("name");c.attr("data-font",f);c.attr("data-icon",g);c.attr("data-key",h);c.attr("data-name",k);e.val(f+":"+k);b.find(".yit-icons-manager-list li").removeClass("active");
15
+ d.addClass("active")});b.on("click",".yit-icons-manager-action-set-default",function(){b.find(".yit-icons-manager-list li.default").trigger("click")})})});
plugin-fw/init.php CHANGED
@@ -1,14 +1,13 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 2.9.69
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
- * @package YITH WooCommerce Ajax Navigation
11
- * @version 2.0
12
  */
13
  /**
14
  * This file belongs to the YIT Plugin Framework.
@@ -25,7 +24,7 @@ if ( ! defined ( 'ABSPATH' ) ) {
25
 
26
  if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) ) {
27
  /**
28
- * YITH WooCommerce Ajax Navigation
29
  *
30
  * @since 1.0.0
31
  */
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 3.0.12
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
+ * @version 3.0.12
 
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
24
 
25
  if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) ) {
26
  /**
27
+ * yit_maybe_plugin_fw_loader
28
  *
29
  * @since 1.0.0
30
  */
plugin-fw/lib/yit-ajax.php CHANGED
@@ -32,6 +32,23 @@ if ( !class_exists( 'YIT_Ajax' ) ) {
32
  * @since 1.0
33
  */
34
  protected static $_instance = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  /**
37
  * Constructor
@@ -40,24 +57,208 @@ if ( !class_exists( 'YIT_Ajax' ) ) {
40
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
41
  */
42
  private function __construct() {
 
 
 
 
 
 
43
 
 
 
 
 
44
  }
45
 
46
  /**
47
- * get single instance
48
  *
49
- * @static
50
- * @return YIT_Ajax
51
- *
52
- * @since 1.0
53
- * @author Leanza Francesco <leanzafrancesco@gmail.com>
54
  */
55
- public static function instance() {
56
- if ( is_null( self::$_instance ) ) {
57
- self::$_instance = new self();
 
 
 
 
 
 
 
 
58
  }
59
 
60
- return self::$_instance;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
  }
63
  }
32
  * @since 1.0
33
  */
34
  protected static $_instance = null;
35
+
36
+ /**
37
+ * get single instance
38
+ *
39
+ * @static
40
+ * @return YIT_Ajax
41
+ *
42
+ * @since 1.0
43
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
44
+ */
45
+ public static function instance() {
46
+ if ( is_null( self::$_instance ) ) {
47
+ self::$_instance = new self();
48
+ }
49
+
50
+ return self::$_instance;
51
+ }
52
 
53
  /**
54
  * Constructor
57
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
58
  */
59
  private function __construct() {
60
+ $ajax_actions = array(
61
+ 'json_search_posts',
62
+ 'json_search_products',
63
+ 'json_search_orders',
64
+ 'json_search_terms'
65
+ );
66
 
67
+ foreach ( $ajax_actions as $ajax_action ) {
68
+ add_action( 'wp_ajax_yith_plugin_fw_' . $ajax_action, array( $this, $ajax_action ) );
69
+ add_action( 'wp_ajax_nopriv_yith_plugin_fw_' . $ajax_action, array( $this, $ajax_action ) );
70
+ }
71
  }
72
 
73
  /**
74
+ * Post Search
75
  *
76
+ * @param bool|array $request
 
 
 
 
77
  */
78
+ public function json_search_posts( $request = false ) {
79
+ ob_start();
80
+
81
+ if ( !$request )
82
+ check_ajax_referer( 'search-posts', 'security' );
83
+
84
+ $request = $request ? $request : $_REQUEST;
85
+
86
+ $term = (string) wc_clean( stripslashes( $request[ 'term' ] ) );
87
+ if ( empty( $term ) ) {
88
+ die();
89
  }
90
 
91
+ $found_posts = array();
92
+
93
+ $args = array(
94
+ 'post_type' => 'post',
95
+ 'post_status' => 'publish',
96
+ 'numberposts' => -1,
97
+ 'orderby' => 'title',
98
+ 'order' => 'asc',
99
+ 'post_parent' => 0,
100
+ 'suppress_filters' => 0,
101
+ 'include' => '',
102
+ 'exclude' => '',
103
+ );
104
+
105
+ foreach ( $args as $key => $default_value ) {
106
+ if ( !empty( $request[ $key ] ) ) {
107
+ $args[ $key ] = $request[ $key ];
108
+ }
109
+ }
110
+
111
+ $show_id = isset( $request[ 'show_id' ] ) && $request[ 'show_id' ];
112
+
113
+ $args[ 's' ] = $term;
114
+ $args[ 'fields' ] = 'ids';
115
+
116
+ $posts = get_posts( $args );
117
+
118
+ if ( !empty( $posts ) ) {
119
+ foreach ( $posts as $post_id ) {
120
+ if ( !current_user_can( 'read_product', $post_id ) ) {
121
+ continue;
122
+ }
123
+ $title = get_the_title( $post_id ) . ( $show_id ? " (#{$post_id})" : '' );
124
+ $found_posts[ $post_id ] = apply_filters( 'yith_plugin_fw_json_search_found_post_title', rawurldecode( $title ), $post_id, $request );
125
+ }
126
+ }
127
+ $found_posts = apply_filters( 'yith_plugin_fw_json_search_found_posts', $found_posts, $request );
128
+
129
+ wp_send_json( $found_posts );
130
+ }
131
+
132
+ /**
133
+ * Product Search
134
+ */
135
+ public function json_search_products() {
136
+ check_ajax_referer( 'search-posts', 'security' );
137
+
138
+ $term = (string) wc_clean( stripslashes( $_REQUEST[ 'term' ] ) );
139
+ if ( empty( $term ) ) {
140
+ die();
141
+ }
142
+
143
+ $request = $_REQUEST;
144
+ $request[ 'post_type' ] = 'product';
145
+
146
+ $request_include = isset( $request[ 'include' ] ) && !is_array( $request[ 'include' ] ) ? explode( ',', $request[ 'include' ] ) : array();
147
+
148
+ if ( !empty( $request[ 'product_type' ] ) ) {
149
+ if ( $product_type_term = get_term_by( 'slug', $request[ 'product_type' ], 'product_type' ) ) {
150
+ $posts_in = array_unique( (array) get_objects_in_term( $product_type_term->term_id, 'product_type' ) );
151
+ if ( !!$request_include )
152
+ $posts_in = array_intersect( $posts_in, $request_include );
153
+
154
+ if ( !!$posts_in ) {
155
+ $request[ 'include' ] = implode( ',', $posts_in );
156
+ } else {
157
+ $request[ 'include' ] = '-1';
158
+ }
159
+ }
160
+ }
161
+
162
+ $request = apply_filters( 'yith_plugin_fw_json_search_products_request', $request );
163
+
164
+ $this->json_search_posts( $request );
165
+ }
166
+
167
+ /**
168
+ * Order Search
169
+ */
170
+ public function json_search_orders() {
171
+ global $wpdb;
172
+ ob_start();
173
+
174
+ check_ajax_referer( 'search-posts', 'security' );
175
+
176
+ $term = wc_clean( stripslashes( $_REQUEST[ 'term' ] ) );
177
+
178
+ if ( empty( $term ) ) {
179
+ die();
180
+ }
181
+
182
+ $found_orders = array();
183
+
184
+ $term = apply_filters( 'yith_plugin_fw_json_search_order_number', $term );
185
+
186
+ $query_orders = $wpdb->get_results( $wpdb->prepare( "
187
+ SELECT ID, post_title FROM {$wpdb->posts} AS posts
188
+ WHERE posts.post_type = 'shop_order'
189
+ AND posts.ID LIKE %s
190
+ ", '%' . $term . '%' ) );
191
+
192
+ if ( $query_orders ) {
193
+ foreach ( $query_orders as $item ) {
194
+ $order_number = apply_filters( 'yith_plugin_fw_order_number', '#' . $item->ID, $item->ID );
195
+ $found_orders[ $item->ID ] = $order_number . ' &ndash; ' . esc_html( $item->post_title );
196
+ }
197
+ }
198
+
199
+ wp_send_json( $found_orders );
200
+ }
201
+
202
+ /**
203
+ * Order Search
204
+ */
205
+ public function json_search_terms() {
206
+ global $wpdb;
207
+ ob_start();
208
+
209
+ check_ajax_referer( 'search-terms', 'security' );
210
+
211
+ $term = (string) wc_clean( stripslashes( $_REQUEST[ 'term' ] ) );
212
+
213
+ if ( empty( $term ) ) {
214
+ die();
215
+ }
216
+
217
+ $request = $_REQUEST;
218
+
219
+ $args = array(
220
+ 'taxonomy' => 'category',
221
+ 'hide_empty' => false,
222
+ 'order' => 'ASC',
223
+ 'orderby' => 'name',
224
+ 'include' => '',
225
+ 'exclude' => '',
226
+ 'exclude_tree' => '',
227
+ 'number' => '',
228
+ 'hierarchical' => true,
229
+ 'child_of' => 0,
230
+ 'parent' => '',
231
+ 'term_field' => 'id'
232
+ );
233
+
234
+ $args = apply_filters( 'yith_plugin_fw_json_search_terms_default_args', $args, $request );
235
+
236
+ foreach ( $args as $key => $default_value ) {
237
+ if ( !empty( $request[ $key ] ) ) {
238
+ $args[ $key ] = $request[ $key ];
239
+ }
240
+ }
241
+
242
+ $args = apply_filters( 'yith_plugin_fw_json_search_terms_args', $args, $request );
243
+
244
+ $args[ 'name__like' ] = $term;
245
+ $args[ 'fields' ] = 'id=>name';
246
+
247
+ if ( !taxonomy_exists( $args[ 'taxonomy' ] ) )
248
+ die();
249
+
250
+ $terms = yith_get_terms( $args );
251
+
252
+ if ( $args[ 'term_field' ] !== 'id' ) {
253
+ $temp_terms = $terms;
254
+ $terms = array();
255
+ foreach ( $temp_terms as $term_id => $term_name ) {
256
+ $current_term_field = get_term_field( $args[ 'term_field' ], $term_id, $args[ 'taxonomy' ] );
257
+ $terms[ $current_term_field ] = $term_name;
258
+ }
259
+ }
260
+
261
+ wp_send_json( $terms );
262
  }
263
  }
264
  }
plugin-fw/lib/yit-assets.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
12
+
13
+ if ( !class_exists( 'YIT_Assets' ) ) {
14
+ /**
15
+ * YIT Assets
16
+ *
17
+ * @class YIT_Assets
18
+ * @package Yithemes
19
+ * @since 3.0.0
20
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
21
+ */
22
+ class YIT_Assets {
23
+ /** @var string */
24
+ public $version = '1.0.0';
25
+
26
+ /** @var YIT_Assets */
27
+ private static $_instance;
28
+
29
+ /** @return YIT_Assets */
30
+ public static function instance() {
31
+ return !is_null( self::$_instance ) ? self::$_instance : self::$_instance = new self();
32
+ }
33
+
34
+ /**
35
+ * Constructor
36
+ *
37
+ * @since 1.0
38
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
39
+ */
40
+ private function __construct() {
41
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_styles_and_scripts' ) );
42
+ }
43
+
44
+ /**
45
+ * Register styles and scripts
46
+ */
47
+ public function register_styles_and_scripts() {
48
+ global $wp_scripts, $woocommerce;
49
+
50
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
51
+
52
+ //scripts
53
+ wp_register_script( 'yith-plugin-fw-fields', YIT_CORE_PLUGIN_URL . '/assets/js/yith-fields' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'wp-color-picker', 'codemirror', 'codemirror-javascript', 'jquery-ui-slider' ), $this->version, true );
54
+ wp_register_script( 'yit-metabox', YIT_CORE_PLUGIN_URL . '/assets/js/metabox' . $suffix . '.js', array( 'jquery', 'wp-color-picker' ), '1.0.0', true );
55
+ wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel' . $suffix . '.js', array( 'jquery', 'wp-color-picker', 'jquery-ui-sortable' ), $this->version, true );
56
+ wp_register_script( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/codemirror.js', array( 'jquery' ), $this->version, true );
57
+ wp_register_script( 'codemirror-javascript', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/javascript.js', array( 'jquery', 'codemirror' ), $this->version, true );
58
+ wp_register_script( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/js/jquery.colorbox' . $suffix . '.js', array( 'jquery' ), '1.6.3', true );
59
+ wp_register_script( 'yith_how_to', YIT_CORE_PLUGIN_URL . '/assets/js/how-to' . $suffix . '.js', array( 'jquery' ), $this->version, true );
60
+
61
+ //styles
62
+ $jquery_version = isset( $wp_scripts->registered[ 'jquery-ui-core' ]->ver ) ? $wp_scripts->registered[ 'jquery-ui-core' ]->ver : '1.9.2';
63
+ wp_register_style( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/css/codemirror/codemirror.css' );
64
+ wp_register_style( 'yit-plugin-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel.css', array(), $this->version );
65
+ wp_register_style( 'raleway-font', '//fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,100,200,300,900' );
66
+ wp_register_style( 'yit-jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
67
+ wp_register_style( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/css/colorbox.css', array(), $this->version );
68
+ wp_register_style( 'yit-upgrade-to-pro', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrade-to-pro.css', array( 'colorbox' ), $this->version );
69
+ wp_register_style( 'yit-plugin-metaboxes', YIT_CORE_PLUGIN_URL . '/assets/css/metaboxes.css' );
70
+ wp_register_style( 'yith-plugin-fw-fields', YIT_CORE_PLUGIN_URL . '/assets/css/yith-fields.css', false, $this->version );
71
+
72
+ if ( function_exists( 'WC' ) || !empty( $woocommerce ) ) {
73
+ $woocommerce_version = function_exists( 'WC' ) ? WC()->version : $woocommerce->version;
74
+ $wc_version_suffix = version_compare( $woocommerce_version, '3.0.0', '>=' ) ? '' : '-wc-2.6';
75
+
76
+ wp_register_style( 'woocommerce_admin_styles', $woocommerce->plugin_url() . '/assets/css/admin.css', array(), $woocommerce_version );
77
+
78
+ wp_register_script( 'yith-enhanced-select', YIT_CORE_PLUGIN_URL . '/assets/js/yith-enhanced-select' . $wc_version_suffix . $suffix . '.js', array( 'jquery', 'select2', 'woocommerce_admin' ), '1.0.0', true );
79
+ wp_localize_script( 'yith-enhanced-select', 'yith_framework_enhanced_select_params', array(
80
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
81
+ 'search_posts_nonce' => wp_create_nonce( 'search-posts' ),
82
+ 'search_terms_nonce' => wp_create_nonce( 'search-terms' ),
83
+ ) );
84
+ }
85
+
86
+ wp_enqueue_style( 'yith-plugin-fw-admin', YIT_CORE_PLUGIN_URL . '/assets/css/admin.css', array(), $this->version );
87
+
88
+ }
89
+ }
90
+ }
91
+
92
+ YIT_Assets::instance();
plugin-fw/lib/yit-debug.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
12
+
13
+ if ( !class_exists( 'YITH_Debug' ) ) {
14
+ /**
15
+ * YITH_Debug
16
+ *
17
+ * manages debug
18
+ *
19
+ * @class YITH_Debug
20
+ * @package Yithemes
21
+ * @since 1.0.0
22
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
23
+ *
24
+ */
25
+ class YITH_Debug {
26
+
27
+ /** @var YITH_Debug */
28
+ private static $_instance;
29
+
30
+ public static function get_instance() {
31
+ return isset( self::$_instance ) ? self::$_instance : self::$_instance = new self();
32
+ }
33
+
34
+ /**
35
+ * @access private
36
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
37
+ */
38
+ private function __construct() {
39
+ add_action( 'init', array( $this, 'init' ) );
40
+ }
41
+
42
+ /**
43
+ * fired on init
44
+ */
45
+ public function init() {
46
+ if ( !is_admin() || defined( 'DOING_AJAX' ) )
47
+ return;
48
+
49
+ $is_debug = apply_filters( 'yith_plugin_fw_is_debug', isset( $_GET[ 'yith-debug' ] ) );
50
+
51
+ if ( $is_debug ) {
52
+ add_action( 'admin_bar_menu', array( $this, 'add_debug_in_admin_bar' ), 99 );
53
+ }
54
+ }
55
+
56
+ /**
57
+ * add debug node in admin bar
58
+ *
59
+ * @param $wp_admin_bar
60
+ */
61
+ public function add_debug_in_admin_bar( $wp_admin_bar ) {
62
+ $args = array(
63
+ 'id' => 'yith-debug-admin-bar',
64
+ 'title' => 'YITH Debug',
65
+ 'href' => '',
66
+ 'meta' => array(
67
+ 'class' => 'yith-debug-admin-bar'
68
+ )
69
+ );
70
+ $wp_admin_bar->add_node( $args );
71
+
72
+ $subnodes = array();
73
+
74
+ foreach ( $this->get_debug_information() as $key => $information ) {
75
+ $label = $information[ 'label' ];
76
+ $value = $information[ 'value' ];
77
+ $url = !empty( $information[ 'url' ] ) ? $information[ 'url' ] : '';
78
+
79
+ if ( !!$value ) {
80
+ $title = "<strong>$label:</strong> $value";
81
+ } else {
82
+ $title = "<strong>$label</strong>";
83
+ }
84
+
85
+ $subnodes[] = array(
86
+ 'id' => 'yith-debug-admin-bar-' . $key,
87
+ 'parent' => 'yith-debug-admin-bar',
88
+ 'title' => $title,
89
+ 'href' => $url,
90
+ 'meta' => array(
91
+ 'class' => 'yith-debug-admin-bar-' . $key
92
+ )
93
+ );
94
+
95
+ if ( isset( $information[ 'subsub' ] ) ) {
96
+ foreach ( $information[ 'subsub' ] as $sub_key => $sub_value ) {
97
+ $title = isset( $sub_value[ 'title' ] ) ? $sub_value[ 'title' ] : '';
98
+ $html = isset( $sub_value[ 'html' ] ) ? $sub_value[ 'html' ] : '';
99
+ $subnodes[] = array(
100
+ 'id' => 'yith-debug-admin-bar-' . $key . '-' . $sub_key,
101
+ 'parent' => 'yith-debug-admin-bar-' . $key,
102
+ 'title' => $title,
103
+ 'href' => '',
104
+ 'meta' => array(
105
+ 'class' => 'yith-debug-admin-bar-' . $key . '-' . $sub_key,
106
+ 'html' => $html,
107
+ )
108
+ );
109
+ }
110
+ }
111
+ }
112
+
113
+ foreach ( $subnodes as $subnode ) {
114
+ $wp_admin_bar->add_node( $subnode );
115
+ }
116
+ }
117
+
118
+
119
+ /**
120
+ * return an array of debug information
121
+ *
122
+ * @return array
123
+ */
124
+ public function get_debug_information() {
125
+ $debug = array(
126
+ 'plugin-fw-info' => array(
127
+ 'label' => 'Framework',
128
+ 'value' => $this->get_plugin_framework_info()
129
+ ),
130
+ 'yith-premium-plugins' => array(
131
+ 'label' => 'YITH Premium Plugins',
132
+ 'value' => '',
133
+ 'subsub' => $this->get_premium_plugins_info()
134
+ ),
135
+ 'wc-version' => array(
136
+ 'label' => 'WooCommerce',
137
+ 'value' => $this->get_woocommerce_version_info()
138
+ ),
139
+ 'theme' => array(
140
+ 'label' => 'Theme',
141
+ 'value' => $this->get_theme_info()
142
+ ),
143
+ 'screen-id' => array(
144
+ 'label' => 'Screen ID',
145
+ 'value' => $this->get_current_screen_info()
146
+ ),
147
+ 'post-meta' => array(
148
+ 'label' => 'Post Meta',
149
+ 'value' => '',
150
+ 'url' => add_query_arg( array( 'yith-debug-post-meta' => 'all' ) )
151
+ ),
152
+ 'option' => array(
153
+ 'label' => 'Option',
154
+ 'value' => '',
155
+ 'url' => add_query_arg( array( 'yith-debug-option' => '' ) )
156
+ ),
157
+ );
158
+
159
+ // Post Meta debug -------------
160
+ global $post;
161
+ if ( !empty( $_GET[ 'yith-debug-post-meta' ] ) && $post ) {
162
+ $meta_key = $_GET[ 'yith-debug-post-meta' ];
163
+ $meta_value = 'all' !== $meta_key ? get_post_meta( $post->ID, $meta_key, true ) : get_post_meta( $post->ID );
164
+
165
+ ob_start();
166
+ echo '<pre>';
167
+ var_dump( $meta_value );
168
+ echo '</pre>';
169
+ $meta_value_html = ob_get_clean();
170
+
171
+ $debug[ 'post-meta' ][ 'value' ] = $meta_key;
172
+ $debug[ 'post-meta' ][ 'subsub' ] = array( array( 'html' => $meta_value_html ) );
173
+ }
174
+
175
+ // Option debug -------------
176
+
177
+ if ( !empty( $_GET[ 'yith-debug-option' ] ) ) {
178
+ $option_key = $_GET[ 'yith-debug-option' ];
179
+ $option_value = get_option( $option_key );
180
+
181
+ ob_start();
182
+ echo '<pre>';
183
+ var_dump( $option_value );
184
+ echo '</pre>';
185
+ $option_value_html = ob_get_clean();
186
+
187
+ $debug[ 'option' ][ 'value' ] = $option_key;
188
+ $debug[ 'option' ][ 'subsub' ] = array( array( 'html' => $option_value_html ) );
189
+ }
190
+
191
+ return $debug;
192
+ }
193
+
194
+ /** -----------------------------------------------------------
195
+ * GETTER INFO
196
+ * -----------------------------------------------------------
197
+ */
198
+
199
+
200
+ /**
201
+ * return the current screen id
202
+ *
203
+ * @return string
204
+ */
205
+ public function get_current_screen_info() {
206
+ $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
207
+
208
+ return !!$screen ? $screen->id : 'null';
209
+ }
210
+
211
+ /**
212
+ * return the current theme name and version
213
+ *
214
+ * @return string
215
+ */
216
+ public function get_theme_info() {
217
+ $theme = function_exists( 'wp_get_theme' ) ? wp_get_theme() : false;
218
+
219
+ return !!$theme ? $theme->get( 'Name' ) . ' (' . $theme->get( 'Version' ) . ')' : 'null';
220
+ }
221
+
222
+ /**
223
+ * return the WooCommerce version if active
224
+ *
225
+ * @return string
226
+ */
227
+ public function get_woocommerce_version_info() {
228
+ return function_exists( 'WC' ) ? WC()->version : 'not active';
229
+ }
230
+
231
+ /**
232
+ * return plugin framework information (version and loaded_by)
233
+ *
234
+ * @return string
235
+ */
236
+ public function get_plugin_framework_info() {
237
+ $plugin_fw_data = get_file_data( trailingslashit( YIT_CORE_PLUGIN_PATH ) . 'init.php', array( 'Version' => 'Version' ) );
238
+ $plugin_fw_version = $plugin_fw_data[ 'Version' ];
239
+ $plugin_fw_loaded_by = basename( dirname( YIT_CORE_PLUGIN_PATH ) );
240
+
241
+ return "$plugin_fw_version (by $plugin_fw_loaded_by)";
242
+ }
243
+
244
+ /**
245
+ * return premium plugins list with versions
246
+ *
247
+ * @return array
248
+ */
249
+ public function get_premium_plugins_info() {
250
+ $plugins = YIT_Plugin_Licence()->get_products();
251
+ $plugins_info = array();
252
+
253
+ if ( !!$plugins ) {
254
+ foreach ( $plugins as $plugin ) {
255
+ $plugins_info[ $plugin[ 'product_id' ] ] = array( 'title' => $plugin[ 'Name' ] . ' (' . $plugin[ 'Version' ] . ')' );
256
+ }
257
+
258
+ sort( $plugins_info );
259
+ }
260
+
261
+ return $plugins_info;
262
+ }
263
+ }
264
+ }
265
+ if ( !function_exists( 'YITH_Debug' ) ) {
266
+ function YITH_Debug() {
267
+ return YITH_Debug::get_instance();
268
+ }
269
+
270
+ YITH_Debug();
271
+ }
plugin-fw/lib/yit-icons.php ADDED
@@ -0,0 +1,1143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+
12
+ if ( !defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ } // Exit if accessed directly
15
+
16
+ if ( !class_exists( 'YIT_Icons' ) ) {
17
+ /**
18
+ * YIT Icons
19
+ *
20
+ * Class to manage icons
21
+ *
22
+ * @class YIT_Icons
23
+ * @package Yithemes
24
+ * @since 1.0.0
25
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
26
+ *
27
+ */
28
+ class YIT_Icons {
29
+
30
+ /**
31
+ * Single instance of the class
32
+ *
33
+ * @var YIT_Icons
34
+ */
35
+ private static $_instance;
36
+
37
+ /**
38
+ * @var array
39
+ */
40
+ private $_data
41
+ = array(
42
+ 'font_awesome_version' => '4.6.3',
43
+ 'icons' => array(
44
+ 'FontAwesome' => array(
45
+ '\f000' => 'glass',
46
+ '\f001' => 'music',
47
+ '\f002' => 'search',
48
+ '\f003' => 'envelope-o',
49
+ '\f004' => 'heart',
50
+ '\f005' => 'star',
51
+ '\f006' => 'star-o',
52
+ '\f007' => 'user',
53
+ '\f008' => 'film',
54
+ '\f009' => 'th-large',
55
+ '\f00a' => 'th',
56
+ '\f00b' => 'th-list',
57
+ '\f00c' => 'check',
58
+ '\f00d' => 'times',
59
+ '\f00e' => 'search-plus',
60
+ '\f010' => 'search-minus',
61
+ '\f011' => 'power-off',
62
+ '\f012' => 'signal',
63
+ '\f013' => 'cog',
64
+ '\f014' => 'trash-o',
65
+ '\f015' => 'home',
66
+ '\f016' => 'file-o',
67
+ '\f017' => 'clock-o',
68
+ '\f018' => 'road',
69
+ '\f019' => 'download',
70
+ '\f01a' => 'arrow-circle-o-down',
71
+ '\f01b' => 'arrow-circle-o-up',
72
+ '\f01c' => 'inbox',
73
+ '\f01d' => 'play-circle-o',
74
+ '\f01e' => 'repeat',
75
+ '\f021' => 'refresh',
76
+ '\f022' => 'list-alt',
77
+ '\f023' => 'lock',
78
+ '\f024' => 'flag',
79
+ '\f025' => 'headphones',
80
+ '\f026' => 'volume-off',
81
+ '\f027' => 'volume-down',
82
+ '\f028' => 'volume-up',
83
+ '\f029' => 'qrcode',
84
+ '\f02a' => 'barcode',
85
+ '\f02b' => 'tag',
86
+ '\f02c' => 'tags',
87
+ '\f02d' => 'book',
88
+ '\f02e' => 'bookmark',
89
+ '\f02f' => 'print',
90
+ '\f030' => 'camera',
91
+ '\f031' => 'font',
92
+ '\f032' => 'bold',
93
+ '\f033' => 'italic',
94
+ '\f034' => 'text-height',
95
+ '\f035' => 'text-width',
96
+ '\f036' => 'align-left',
97
+ '\f037' => 'align-center',
98
+ '\f038' => 'align-right',
99
+ '\f039' => 'align-justify',
100
+ '\f03a' => 'list',
101
+ '\f03b' => 'outdent',
102
+ '\f03c' => 'indent',
103
+ '\f03d' => 'video-camera',
104
+ '\f03e' => 'picture-o',
105
+ '\f040' => 'pencil',
106
+ '\f041' => 'map-marker',
107
+ '\f042' => 'adjust',
108
+ '\f043' => 'tint',
109
+ '\f044' => 'pencil-square-o',
110
+ '\f045' => 'share-square-o',
111
+ '\f046' => 'check-square-o',
112
+ '\f047' => 'arrows',
113
+ '\f048' => 'step-backward',
114
+ '\f049' => 'fast-backward',
115
+ '\f04a' => 'backward',
116
+ '\f04b' => 'play',
117
+ '\f04c' => 'pause',
118
+ '\f04d' => 'stop',
119
+ '\f04e' => 'forward',
120
+ '\f050' => 'fast-forward',
121
+ '\f051' => 'step-forward',
122
+ '\f052' => 'eject',
123
+ '\f053' => 'chevron-left',
124
+ '\f054' => 'chevron-right',
125
+ '\f055' => 'plus-circle',
126
+ '\f056' => 'minus-circle',
127
+ '\f057' => 'times-circle',
128
+ '\f058' => 'check-circle',
129
+ '\f059' => 'question-circle',
130
+ '\f05a' => 'info-circle',
131
+ '\f05b' => 'crosshairs',
132
+ '\f05c' => 'times-circle-o',
133
+ '\f05d' => 'check-circle-o',
134
+ '\f05e' => 'ban',
135
+ '\f060' => 'arrow-left',
136
+ '\f061' => 'arrow-right',
137
+ '\f062' => 'arrow-up',
138
+ '\f063' => 'arrow-down',
139
+ '\f064' => 'share',
140
+ '\f065' => 'expand',
141
+ '\f066' => 'compress',
142
+ '\f067' => 'plus',
143
+ '\f068' => 'minus',
144
+ '\f069' => 'asterisk',
145
+ '\f06a' => 'exclamation-circle',
146
+ '\f06b' => 'gift',
147
+ '\f06c' => 'leaf',
148
+ '\f06d' => 'fire',
149
+ '\f06e' => 'eye',
150
+ '\f070' => 'eye-slash',
151
+ '\f071' => 'exclamation-triangle',
152
+ '\f072' => 'plane',
153
+ '\f073' => 'calendar',
154
+ '\f074' => 'random',
155
+ '\f075' => 'comment',
156
+ '\f076' => 'magnet',
157
+ '\f077' => 'chevron-up',
158
+ '\f078' => 'chevron-down',
159
+ '\f079' => 'retweet',
160
+ '\f07a' => 'shopping-cart',
161
+ '\f07b' => 'folder',
162
+ '\f07c' => 'folder-open',
163
+ '\f07d' => 'arrows-v',
164
+ '\f07e' => 'arrows-h',
165
+ '\f080' => 'bar-chart',
166
+ '\f081' => 'twitter-square',
167
+ '\f082' => 'facebook-square',
168
+ '\f083' => 'camera-retro',
169
+ '\f084' => 'key',
170
+ '\f085' => 'cogs',
171
+ '\f086' => 'comments',
172
+ '\f087' => 'thumbs-o-up',
173
+ '\f088' => 'thumbs-o-down',
174
+ '\f089' => 'star-half',
175
+ '\f08a' => 'heart-o',
176
+ '\f08b' => 'sign-out',
177
+ '\f08c' => 'linkedin-square',
178
+ '\f08d' => 'thumb-tack',
179
+ '\f08e' => 'external-link',
180
+ '\f090' => 'sign-in',
181
+ '\f091' => 'trophy',
182
+ '\f092' => 'github-square',
183
+ '\f093' => 'upload',
184
+ '\f094' => 'lemon-o',
185
+ '\f095' => 'phone',
186
+ '\f096' => 'square-o',
187
+ '\f097' => 'bookmark-o',
188
+ '\f098' => 'phone-square',
189
+ '\f099' => 'twitter',
190
+ '\f09a' => 'facebook',
191
+ '\f09b' => 'github',
192
+ '\f09c' => 'unlock',
193
+ '\f09d' => 'credit-card',
194
+ '\f09e' => 'rss',
195
+ '\f0a0' => 'hdd-o',
196
+ '\f0a1' => 'bullhorn',
197
+ '\f0a2' => 'bell-o',
198
+ '\f0a3' => 'certificate',
199
+ '\f0a4' => 'hand-o-right',
200
+ '\f0a5' => 'hand-o-left',
201
+ '\f0a6' => 'hand-o-up',
202
+ '\f0a7' => 'hand-o-down',
203
+ '\f0a8' => 'arrow-circle-left',
204
+ '\f0a9' => 'arrow-circle-right',
205
+ '\f0aa' => 'arrow-circle-up',
206
+ '\f0ab' => 'arrow-circle-down',
207
+ '\f0ac' => 'globe',
208
+ '\f0ad' => 'wrench',
209
+ '\f0ae' => 'tasks',
210
+ '\f0b0' => 'filter',
211
+ '\f0b1' => 'briefcase',
212
+ '\f0b2' => 'arrows-alt',
213
+ '\f0c0' => 'users',
214
+ '\f0c1' => 'link',
215
+ '\f0c2' => 'cloud',
216
+ '\f0c3' => 'flask',
217
+ '\f0c4' => 'scissors',
218
+ '\f0c5' => 'files-o',
219
+ '\f0c6' => 'paperclip',
220
+ '\f0c7' => 'floppy-o',
221
+ '\f0c8' => 'square',
222
+ '\f0c9' => 'bars',
223
+ '\f0ca' => 'list-ul',
224
+ '\f0cb' => 'list-ol',
225
+ '\f0cc' => 'strikethrough',
226
+ '\f0cd' => 'underline',
227
+ '\f0ce' => 'table',
228
+ '\f0d0' => 'magic',
229
+ '\f0d1' => 'truck',
230
+ '\f0d2' => 'pinterest',
231
+ '\f0d3' => 'pinterest-square',
232
+ '\f0d4' => 'google-plus-square',
233
+ '\f0d5' => 'google-plus',
234
+ '\f0d6' => 'money',
235
+ '\f0d7' => 'caret-down',
236
+ '\f0d8' => 'caret-up',
237
+ '\f0d9' => 'caret-left',
238
+ '\f0da' => 'caret-right',
239
+ '\f0db' => 'columns',
240
+ '\f0dc' => 'sort',
241
+ '\f0dd' => 'sort-desc',
242
+ '\f0de' => 'sort-asc',
243
+ '\f0e0' => 'envelope',
244
+ '\f0e1' => 'linkedin',
245
+ '\f0e2' => 'undo',
246
+ '\f0e3' => 'gavel',
247
+ '\f0e4' => 'tachometer',
248
+ '\f0e5' => 'comment-o',
249
+ '\f0e6' => 'comments-o',
250
+ '\f0e7' => 'bolt',
251
+ '\f0e8' => 'sitemap',
252
+ '\f0e9' => 'umbrella',
253
+ '\f0ea' => 'clipboard',
254
+ '\f0eb' => 'lightbulb-o',
255
+ '\f0ec' => 'exchange',
256
+ '\f0ed' => 'cloud-download',
257
+ '\f0ee' => 'cloud-upload',
258
+ '\f0f0' => 'user-md',
259
+ '\f0f1' => 'stethoscope',
260
+ '\f0f2' => 'suitcase',
261
+ '\f0f3' => 'bell',
262
+ '\f0f4' => 'coffee',
263
+ '\f0f5' => 'cutlery',
264
+ '\f0f6' => 'file-text-o',
265
+ '\f0f7' => 'building-o',
266
+ '\f0f8' => 'hospital-o',
267
+ '\f0f9' => 'ambulance',
268
+ '\f0fa' => 'medkit',
269
+ '\f0fb' => 'fighter-jet',
270
+ '\f0fc' => 'beer',
271
+ '\f0fd' => 'h-square',
272
+ '\f0fe' => 'plus-square',
273
+ '\f100' => 'angle-double-left',
274
+ '\f101' => 'angle-double-right',
275
+ '\f102' => 'angle-double-up',
276
+ '\f103' => 'angle-double-down',
277
+ '\f104' => 'angle-left',
278
+ '\f105' => 'angle-right',
279
+ '\f106' => 'angle-up',
280
+ '\f107' => 'angle-down',
281
+ '\f108' => 'desktop',
282
+ '\f109' => 'laptop',
283
+ '\f10a' => 'tablet',
284
+ '\f10b' => 'mobile',
285
+ '\f10c' => 'circle-o',
286
+ '\f10d' => 'quote-left',
287
+ '\f10e' => 'quote-right',
288
+ '\f110' => 'spinner',
289
+ '\f111' => 'circle',
290
+ '\f112' => 'reply',
291
+ '\f113' => 'github-alt',
292
+ '\f114' => 'folder-o',
293
+ '\f115' => 'folder-open-o',
294
+ '\f118' => 'smile-o',
295
+ '\f119' => 'frown-o',
296
+ '\f11a' => 'meh-o',
297
+ '\f11b' => 'gamepad',
298
+ '\f11c' => 'keyboard-o',
299
+ '\f11d' => 'flag-o',
300
+ '\f11e' => 'flag-checkered',
301
+ '\f120' => 'terminal',
302
+ '\f121' => 'code',
303
+ '\f122' => 'reply-all',
304
+ '\f123' => 'star-half-o',
305
+ '\f124' => 'location-arrow',
306
+ '\f125' => 'crop',
307
+ '\f126' => 'code-fork',
308
+ '\f127' => 'chain-broken',
309
+ '\f128' => 'question',
310
+ '\f129' => 'info',
311
+ '\f12a' => 'exclamation',
312
+ '\f12b' => 'superscript',
313
+ '\f12c' => 'subscript',
314
+ '\f12d' => 'eraser',
315
+ '\f12e' => 'puzzle-piece',
316
+ '\f130' => 'microphone',
317
+ '\f131' => 'microphone-slash',
318
+ '\f132' => 'shield',
319
+ '\f133' => 'calendar-o',
320
+ '\f134' => 'fire-extinguisher',
321
+ '\f135' => 'rocket',
322
+ '\f136' => 'maxcdn',
323
+ '\f137' => 'chevron-circle-left',
324
+ '\f138' => 'chevron-circle-right',
325
+ '\f139' => 'chevron-circle-up',
326
+ '\f13a' => 'chevron-circle-down',
327
+ '\f13b' => 'html5',
328
+ '\f13c' => 'css3',
329
+ '\f13d' => 'anchor',
330
+ '\f13e' => 'unlock-alt',
331
+ '\f140' => 'bullseye',
332
+ '\f141' => 'ellipsis-h',
333
+ '\f142' => 'ellipsis-v',
334
+ '\f143' => 'rss-square',
335
+ '\f144' => 'play-circle',
336
+ '\f145' => 'ticket',
337
+ '\f146' => 'minus-square',
338
+ '\f147' => 'minus-square-o',
339
+ '\f148' => 'level-up',
340
+ '\f149' => 'level-down',
341
+ '\f14a' => 'check-square',
342
+ '\f14b' => 'pencil-square',
343
+ '\f14c' => 'external-link-square',
344
+ '\f14d' => 'share-square',
345
+ '\f14e' => 'compass',
346
+ '\f150' => 'caret-square-o-down',
347
+ '\f151' => 'caret-square-o-up',
348
+ '\f152' => 'caret-square-o-right',
349
+ '\f153' => 'eur',
350
+ '\f154' => 'gbp',
351
+ '\f155' => 'usd',
352
+ '\f156' => 'inr',
353
+ '\f157' => 'jpy',
354
+ '\f158' => 'rub',
355
+ '\f159' => 'krw',
356
+ '\f15a' => 'btc',
357
+ '\f15b' => 'file',
358
+ '\f15c' => 'file-text',
359
+ '\f15d' => 'sort-alpha-asc',
360
+ '\f15e' => 'sort-alpha-desc',
361
+ '\f160' => 'sort-amount-asc',
362
+ '\f161' => 'sort-amount-desc',
363
+ '\f162' => 'sort-numeric-asc',
364
+ '\f163' => 'sort-numeric-desc',
365
+ '\f164' => 'thumbs-up',
366
+ '\f165' => 'thumbs-down',
367
+ '\f166' => 'youtube-square',
368
+ '\f167' => 'youtube',
369
+ '\f168' => 'xing',
370
+ '\f169' => 'xing-square',
371
+ '\f16a' => 'youtube-play',
372
+ '\f16b' => 'dropbox',
373
+ '\f16c' => 'stack-overflow',
374
+ '\f16d' => 'instagram',
375
+ '\f16e' => 'flickr',
376
+ '\f170' => 'adn',
377
+ '\f171' => 'bitbucket',
378
+ '\f172' => 'bitbucket-square',
379
+ '\f173' => 'tumblr',
380
+ '\f174' => 'tumblr-square',
381
+ '\f175' => 'long-arrow-down',
382
+ '\f176' => 'long-arrow-up',
383
+ '\f177' => 'long-arrow-left',
384
+ '\f178' => 'long-arrow-right',
385
+ '\f179' => 'apple',
386
+ '\f17a' => 'windows',
387
+ '\f17b' => 'android',
388
+ '\f17c' => 'linux',
389
+ '\f17d' => 'dribbble',
390
+ '\f17e' => 'skype',
391
+ '\f180' => 'foursquare',
392
+ '\f181' => 'trello',
393
+ '\f182' => 'female',
394
+ '\f183' => 'male',
395
+ '\f184' => 'gratipay',
396
+ '\f185' => 'sun-o',
397
+ '\f186' => 'moon-o',
398
+ '\f187' => 'archive',
399
+ '\f188' => 'bug',
400
+ '\f189' => 'vk',
401
+ '\f18a' => 'weibo',
402
+ '\f18b' => 'renren',
403
+ '\f18c' => 'pagelines',
404
+ '\f18d' => 'stack-exchange',
405
+ '\f18e' => 'arrow-circle-o-right',
406
+ '\f190' => 'arrow-circle-o-left',
407
+ '\f191' => 'caret-square-o-left',
408
+ '\f192' => 'dot-circle-o',
409
+ '\f193' => 'wheelchair',
410
+ '\f194' => 'vimeo-square',
411
+ '\f195' => 'try',
412
+ '\f196' => 'plus-square-o',
413
+ '\f197' => 'space-shuttle',
414
+ '\f198' => 'slack',
415
+ '\f199' => 'envelope-square',
416
+ '\f19a' => 'wordpress',
417
+ '\f19b' => 'openid',
418
+ '\f19c' => 'university',
419
+ '\f19d' => 'graduation-cap',
420
+ '\f19e' => 'yahoo',
421
+ '\f1a0' => 'google',
422
+ '\f1a1' => 'reddit',
423
+ '\f1a2' => 'reddit-square',
424
+ '\f1a3' => 'stumbleupon-circle',
425
+ '\f1a4' => 'stumbleupon',
426
+ '\f1a5' => 'delicious',
427
+ '\f1a6' => 'digg',
428
+ '\f1a7' => 'pied-piper-pp',
429
+ '\f1a8' => 'pied-piper-alt',
430
+ '\f1a9' => 'drupal',
431
+ '\f1aa' => 'joomla',
432
+ '\f1ab' => 'language',
433
+ '\f1ac' => 'fax',
434
+ '\f1ad' => 'building',
435
+ '\f1ae' => 'child',
436
+ '\f1b0' => 'paw',
437
+ '\f1b1' => 'spoon',
438
+ '\f1b2' => 'cube',
439
+ '\f1b3' => 'cubes',
440
+ '\f1b4' => 'behance',
441
+ '\f1b5' => 'behance-square',
442
+ '\f1b6' => 'steam',
443
+ '\f1b7' => 'steam-square',
444
+ '\f1b8' => 'recycle',
445
+ '\f1b9' => 'car',
446
+ '\f1ba' => 'taxi',
447
+ '\f1bb' => 'tree',
448
+ '\f1bc' => 'spotify',
449
+ '\f1bd' => 'deviantart',
450
+ '\f1be' => 'soundcloud',
451
+ '\f1c0' => 'database',
452
+ '\f1c1' => 'file-pdf-o',
453
+ '\f1c2' => 'file-word-o',
454
+ '\f1c3' => 'file-excel-o',
455
+ '\f1c4' => 'file-powerpoint-o',
456
+ '\f1c5' => 'file-image-o',
457
+ '\f1c6' => 'file-archive-o',
458
+ '\f1c7' => 'file-audio-o',
459
+ '\f1c8' => 'file-video-o',
460
+ '\f1c9' => 'file-code-o',
461
+ '\f1ca' => 'vine',
462
+ '\f1cb' => 'codepen',
463
+ '\f1cc' => 'jsfiddle',
464
+ '\f1cd' => 'life-ring',
465
+ '\f1ce' => 'circle-o-notch',
466
+ '\f1d0' => 'rebel',
467
+ '\f1d1' => 'empire',
468
+ '\f1d2' => 'git-square',
469
+ '\f1d3' => 'git',
470
+ '\f1d4' => 'hacker-news',
471
+ '\f1d5' => 'tencent-weibo',
472
+ '\f1d6' => 'qq',
473
+ '\f1d7' => 'weixin',
474
+ '\f1d8' => 'paper-plane',
475
+ '\f1d9' => 'paper-plane-o',
476
+ '\f1da' => 'history',
477
+ '\f1db' => 'circle-thin',
478
+ '\f1dc' => 'header',
479
+ '\f1dd' => 'paragraph',
480
+ '\f1de' => 'sliders',
481
+ '\f1e0' => 'share-alt',
482
+ '\f1e1' => 'share-alt-square',
483
+ '\f1e2' => 'bomb',
484
+ '\f1e3' => 'futbol-o',
485
+ '\f1e4' => 'tty',
486
+ '\f1e5' => 'binoculars',
487
+ '\f1e6' => 'plug',
488
+ '\f1e7' => 'slideshare',
489
+ '\f1e8' => 'twitch',
490
+ '\f1e9' => 'yelp',
491
+ '\f1ea' => 'newspaper-o',
492
+ '\f1eb' => 'wifi',
493
+ '\f1ec' => 'calculator',
494
+ '\f1ed' => 'paypal',
495
+ '\f1ee' => 'google-wallet',
496
+ '\f1f0' => 'cc-visa',
497
+ '\f1f1' => 'cc-mastercard',
498
+ '\f1f2' => 'cc-discover',
499
+ '\f1f3' => 'cc-amex',
500
+ '\f1f4' => 'cc-paypal',
501
+ '\f1f5' => 'cc-stripe',
502
+ '\f1f6' => 'bell-slash',
503
+ '\f1f7' => 'bell-slash-o',
504
+ '\f1f8' => 'trash',
505
+ '\f1f9' => 'copyright',
506
+ '\f1fa' => 'at',
507
+ '\f1fb' => 'eyedropper',
508
+ '\f1fc' => 'paint-brush',
509
+ '\f1fd' => 'birthday-cake',
510
+ '\f1fe' => 'area-chart',
511
+ '\f200' => 'pie-chart',
512
+ '\f201' => 'line-chart',
513
+ '\f202' => 'lastfm',
514
+ '\f203' => 'lastfm-square',
515
+ '\f204' => 'toggle-off',
516
+ '\f205' => 'toggle-on',
517
+ '\f206' => 'bicycle',
518
+ '\f207' => 'bus',
519
+ '\f208' => 'ioxhost',
520
+ '\f209' => 'angellist',
521
+ '\f20a' => 'cc',
522
+ '\f20b' => 'ils',
523
+ '\f20c' => 'meanpath',
524
+ '\f20d' => 'buysellads',
525
+ '\f20e' => 'connectdevelop',
526
+ '\f210' => 'dashcube',
527
+ '\f211' => 'forumbee',
528
+ '\f212' => 'leanpub',
529
+ '\f213' => 'sellsy',
530
+ '\f214' => 'shirtsinbulk',
531
+ '\f215' => 'simplybuilt',
532
+ '\f216' => 'skyatlas',
533
+ '\f217' => 'cart-plus',
534
+ '\f218' => 'cart-arrow-down',
535
+ '\f219' => 'diamond',
536
+ '\f21a' => 'ship',
537
+ '\f21b' => 'user-secret',
538
+ '\f21c' => 'motorcycle',
539
+ '\f21d' => 'street-view',
540
+ '\f21e' => 'heartbeat',
541
+ '\f221' => 'venus',
542
+ '\f222' => 'mars',
543
+ '\f223' => 'mercury',
544
+ '\f224' => 'transgender',
545
+ '\f225' => 'transgender-alt',
546
+ '\f226' => 'venus-double',
547
+ '\f227' => 'mars-double',
548
+ '\f228' => 'venus-mars',
549
+ '\f229' => 'mars-stroke',
550
+ '\f22a' => 'mars-stroke-v',
551
+ '\f22b' => 'mars-stroke-h',
552
+ '\f22c' => 'neuter',
553
+ '\f22d' => 'genderless',
554
+ '\f230' => 'facebook-official',
555
+ '\f231' => 'pinterest-p',
556
+ '\f232' => 'whatsapp',
557
+ '\f233' => 'server',
558
+ '\f234' => 'user-plus',
559
+ '\f235' => 'user-times',
560
+ '\f236' => 'bed',
561
+ '\f237' => 'viacoin',
562
+ '\f238' => 'train',
563
+ '\f239' => 'subway',
564
+ '\f23a' => 'medium',
565
+ '\f23b' => 'y-combinator',
566
+ '\f23c' => 'optin-monster',
567
+ '\f23d' => 'opencart',
568
+ '\f23e' => 'expeditedssl',
569
+ '\f240' => 'battery-full',
570
+ '\f241' => 'battery-three-quarters',
571
+ '\f242' => 'battery-half',
572
+ '\f243' => 'battery-quarter',
573
+ '\f244' => 'battery-empty',
574
+ '\f245' => 'mouse-pointer',
575
+ '\f246' => 'i-cursor',
576
+ '\f247' => 'object-group',
577
+ '\f248' => 'object-ungroup',
578
+ '\f249' => 'sticky-note',
579
+ '\f24a' => 'sticky-note-o',
580
+ '\f24b' => 'cc-jcb',
581
+ '\f24c' => 'cc-diners-club',
582
+ '\f24d' => 'clone',
583
+ '\f24e' => 'balance-scale',
584
+ '\f250' => 'hourglass-o',
585
+ '\f251' => 'hourglass-start',
586
+ '\f252' => 'hourglass-half',
587
+ '\f253' => 'hourglass-end',
588
+ '\f254' => 'hourglass',
589
+ '\f255' => 'hand-rock-o',
590
+ '\f256' => 'hand-paper-o',
591
+ '\f257' => 'hand-scissors-o',
592
+ '\f258' => 'hand-lizard-o',
593
+ '\f259' => 'hand-spock-o',
594
+ '\f25a' => 'hand-pointer-o',
595
+ '\f25b' => 'hand-peace-o',
596
+ '\f25c' => 'trademark',
597
+ '\f25d' => 'registered',
598
+ '\f25e' => 'creative-commons',
599
+ '\f260' => 'gg',
600
+ '\f261' => 'gg-circle',
601
+ '\f262' => 'tripadvisor',
602
+ '\f263' => 'odnoklassniki',
603
+ '\f264' => 'odnoklassniki-square',
604
+ '\f265' => 'get-pocket',
605
+ '\f266' => 'wikipedia-w',
606
+ '\f267' => 'safari',
607
+ '\f268' => 'chrome',
608
+ '\f269' => 'firefox',
609
+ '\f26a' => 'opera',
610
+ '\f26b' => 'internet-explorer',
611
+ '\f26c' => 'television',
612
+ '\f26d' => 'contao',
613
+ '\f26e' => '500px',
614
+ '\f270' => 'amazon',
615
+ '\f271' => 'calendar-plus-o',
616
+ '\f272' => 'calendar-minus-o',
617
+ '\f273' => 'calendar-times-o',
618
+ '\f274' => 'calendar-check-o',
619
+ '\f275' => 'industry',
620
+ '\f276' => 'map-pin',
621
+ '\f277' => 'map-signs',
622
+ '\f278' => 'map-o',
623
+ '\f279' => 'map',
624
+ '\f27a' => 'commenting',
625
+ '\f27b' => 'commenting-o',
626
+ '\f27c' => 'houzz',
627
+ '\f27d' => 'vimeo',
628
+ '\f27e' => 'black-tie',
629
+ '\f280' => 'fonticons',
630
+ '\f281' => 'reddit-alien',
631
+ '\f282' => 'edge',
632
+ '\f283' => 'credit-card-alt',
633
+ '\f284' => 'codiepie',
634
+ '\f285' => 'modx',
635
+ '\f286' => 'fort-awesome',
636
+ '\f287' => 'usb',
637
+ '\f288' => 'product-hunt',
638
+ '\f289' => 'mixcloud',
639
+ '\f28a' => 'scribd',
640
+ '\f28b' => 'pause-circle',
641
+ '\f28c' => 'pause-circle-o',
642
+ '\f28d' => 'stop-circle',
643
+ '\f28e' => 'stop-circle-o',
644
+ '\f290' => 'shopping-bag',
645
+ '\f291' => 'shopping-basket',
646
+ '\f292' => 'hashtag',
647
+ '\f293' => 'bluetooth',
648
+ '\f294' => 'bluetooth-b',
649
+ '\f295' => 'percent',
650
+ '\f296' => 'gitlab',
651
+ '\f297' => 'wpbeginner',
652
+ '\f298' => 'wpforms',
653
+ '\f299' => 'envira',
654
+ '\f29a' => 'universal-access',
655
+ '\f29b' => 'wheelchair-alt',
656
+ '\f29c' => 'question-circle-o',
657
+ '\f29d' => 'blind',
658
+ '\f29e' => 'audio-description',
659
+ '\f2a0' => 'volume-control-phone',
660
+ '\f2a1' => 'braille',
661
+ '\f2a2' => 'assistive-listening-systems',
662
+ '\f2a3' => 'american-sign-language-interpreting',
663
+ '\f2a4' => 'deaf',
664
+ '\f2a5' => 'glide',
665
+ '\f2a6' => 'glide-g',
666
+ '\f2a7' => 'sign-language',
667
+ '\f2a8' => 'low-vision',
668
+ '\f2a9' => 'viadeo',
669
+ '\f2aa' => 'viadeo-square',
670
+ '\f2ab' => 'snapchat',
671
+ '\f2ac' => 'snapchat-ghost',
672
+ '\f2ad' => 'snapchat-square',
673
+ '\f2ae' => 'pied-piper',
674
+ '\f2b0' => 'first-order',
675
+ '\f2b1' => 'yoast',
676
+ '\f2b2' => 'themeisle',
677
+ '\f2b3' => 'google-plus-official',
678
+ '\f2b4' => 'font-awesome',
679
+ ),
680
+ 'Dashicons' => array(
681
+ '\f100' => 'admin-appearance',
682
+ '\f101' => 'admin-comments',
683
+ '\f102' => 'admin-home',
684
+ '\f104' => 'admin-media',
685
+ '\f105' => 'admin-page',
686
+ '\f106' => 'admin-plugins',
687
+ '\f107' => 'admin-tools',
688
+ '\f108' => 'admin-settings',
689
+ '\f110' => 'admin-users',
690
+ '\f111' => 'admin-generic',
691
+ '\f112' => 'admin-network',
692
+ '\f115' => 'welcome-view-site',
693
+ '\f116' => 'welcome-widgets-menus',
694
+ '\f117' => 'welcome-comments',
695
+ '\f118' => 'welcome-learn-more',
696
+ '\f120' => 'wordpress',
697
+ '\f122' => 'format-quote',
698
+ '\f123' => 'format-aside',
699
+ '\f125' => 'format-chat',
700
+ '\f126' => 'format-video',
701
+ '\f127' => 'format-audio',
702
+ '\f128' => 'format-image',
703
+ '\f130' => 'format-status',
704
+ '\f132' => 'plus',
705
+ '\f133' => 'welcome-add-page',
706
+ '\f134' => 'align-center',
707
+ '\f135' => 'align-left',
708
+ '\f136' => 'align-right',
709
+ '\f138' => 'align-none',
710
+ '\f139' => 'arrow-right',
711
+ '\f140' => 'arrow-down',
712
+ '\f141' => 'arrow-left',
713
+ '\f142' => 'arrow-up',
714
+ '\f145' => 'calendar',
715
+ '\f147' => 'yes',
716
+ '\f148' => 'admin-collapse',
717
+ '\f153' => 'dismiss',
718
+ '\f154' => 'star-empty',
719
+ '\f155' => 'star-filled',
720
+ '\f156' => 'sort',
721
+ '\f157' => 'pressthis',
722
+ '\f158' => 'no',
723
+ '\f159' => 'marker',
724
+ '\f160' => 'lock',
725
+ '\f161' => 'format-gallery',
726
+ '\f163' => 'list-view',
727
+ '\f165' => 'image-crop',
728
+ '\f166' => 'image-rotate-left',
729
+ '\f167' => 'image-rotate-right',
730
+ '\f168' => 'image-flip-vertical',
731
+ '\f169' => 'image-flip-horizontal',
732
+ '\f171' => 'undo',
733
+ '\f172' => 'redo',
734
+ '\f173' => 'post-status',
735
+ '\f174' => 'cart',
736
+ '\f175' => 'feedback',
737
+ '\f176' => 'cloud',
738
+ '\f177' => 'visibility',
739
+ '\f178' => 'vault',
740
+ '\f179' => 'search',
741
+ '\f180' => 'screenoptions',
742
+ '\f181' => 'slides',
743
+ '\f183' => 'analytics',
744
+ '\f184' => 'chart-pie',
745
+ '\f185' => 'chart-bar',
746
+ '\f200' => 'editor-bold',
747
+ '\f201' => 'editor-italic',
748
+ '\f203' => 'editor-ul',
749
+ '\f204' => 'editor-ol',
750
+ '\f205' => 'editor-quote',
751
+ '\f206' => 'editor-alignleft',
752
+ '\f207' => 'editor-aligncenter',
753
+ '\f208' => 'editor-alignright',
754
+ '\f209' => 'editor-insertmore',
755
+ '\f210' => 'editor-spellcheck',
756
+ '\f212' => 'editor-kitchensink',
757
+ '\f213' => 'editor-underline',
758
+ '\f214' => 'editor-justify',
759
+ '\f215' => 'editor-textcolor',
760
+ '\f216' => 'editor-paste-word',
761
+ '\f217' => 'editor-paste-text',
762
+ '\f218' => 'editor-removeformatting',
763
+ '\f219' => 'editor-video',
764
+ '\f220' => 'editor-customchar',
765
+ '\f221' => 'editor-outdent',
766
+ '\f222' => 'editor-indent',
767
+ '\f223' => 'editor-help',
768
+ '\f224' => 'editor-strikethrough',
769
+ '\f225' => 'editor-unlink',
770
+ '\f226' => 'dashboard',
771
+ '\f227' => 'flag',
772
+ '\f229' => 'leftright',
773
+ '\f230' => 'location',
774
+ '\f231' => 'location-alt',
775
+ '\f232' => 'images-alt',
776
+ '\f233' => 'images-alt2',
777
+ '\f234' => 'video-alt',
778
+ '\f235' => 'video-alt2',
779
+ '\f236' => 'video-alt3',
780
+ '\f237' => 'share1',
781
+ '\f238' => 'chart-line',
782
+ '\f239' => 'chart-area',
783
+ '\f240' => 'share-alt',
784
+ '\f242' => 'share-alt2',
785
+ '\f301' => 'twitter',
786
+ '\f303' => 'rss',
787
+ '\f304' => 'facebook',
788
+ '\f305' => 'facebook-alt',
789
+ '\f306' => 'camera',
790
+ '\f307' => 'groups',
791
+ '\f308' => 'hammer',
792
+ '\f309' => 'art',
793
+ '\f310' => 'migrate',
794
+ '\f311' => 'performance',
795
+ '\f312' => 'products',
796
+ '\f313' => 'awards',
797
+ '\f314' => 'forms',
798
+ '\f316' => 'download',
799
+ '\f317' => 'upload',
800
+ '\f318' => 'category',
801
+ '\f319' => 'admin-site',
802
+ '\f320' => 'editor-rtl',
803
+ '\f321' => 'backup',
804
+ '\f322' => 'portfolio',
805
+ '\f323' => 'tag',
806
+ '\f324' => 'wordpress-alt',
807
+ '\f325' => 'networking',
808
+ '\f326' => 'translation',
809
+ '\f328' => 'smiley',
810
+ '\f330' => 'book',
811
+ '\f331' => 'book-alt',
812
+ '\f332' => 'shield',
813
+ '\f333' => 'menu',
814
+ '\f334' => 'shield-alt',
815
+ '\f335' => 'no-alt',
816
+ '\f336' => 'id',
817
+ '\f337' => 'id-alt',
818
+ '\f338' => 'businessman',
819
+ '\f339' => 'lightbulb',
820
+ '\f340' => 'arrow-left-alt',
821
+ '\f341' => 'arrow-left-alt2',
822
+ '\f342' => 'arrow-up-alt',
823
+ '\f343' => 'arrow-up-alt2',
824
+ '\f344' => 'arrow-right-alt',
825
+ '\f345' => 'arrow-right-alt2',
826
+ '\f346' => 'arrow-down-alt',
827
+ '\f347' => 'arrow-down-alt2',
828
+ '\f348' => 'info',
829
+ '\f459' => 'star-half',
830
+ '\f460' => 'minus',
831
+ '\f462' => 'googleplus',
832
+ '\f463' => 'update',
833
+ '\f464' => 'edit',
834
+ '\f465' => 'email',
835
+ '\f466' => 'email-alt',
836
+ '\f468' => 'sos',
837
+ '\f469' => 'clock',
838
+ '\f470' => 'smartphone',
839
+ '\f471' => 'tablet',
840
+ '\f472' => 'desktop',
841
+ '\f473' => 'testimonial',
842
+ '\f474' => 'editor-break',
843
+ '\f475' => 'editor-code',
844
+ '\f476' => 'editor-paragraph',
845
+ '\f478' => 'text',
846
+ '\f479' => 'tagcloud',
847
+ '\f480' => 'archive',
848
+ '\f481' => 'clipboard',
849
+ '\f482' => 'microphone',
850
+ '\f483' => 'universal-access',
851
+ '\f484' => 'nametag',
852
+ '\f486' => 'tickets',
853
+ '\f487' => 'heart',
854
+ '\f488' => 'megaphone',
855
+ '\f489' => 'schedule',
856
+ '\f490' => 'media-video',
857
+ '\f491' => 'media-text',
858
+ '\f492' => 'playlist-audio',
859
+ '\f493' => 'playlist-video',
860
+ '\f495' => 'media-spreadsheet',
861
+ '\f496' => 'media-interactive',
862
+ '\f497' => 'media-document',
863
+ '\f498' => 'media-default',
864
+ '\f499' => 'media-code',
865
+ '\f500' => 'media-audio',
866
+ '\f501' => 'media-archive',
867
+ '\f502' => 'plus-alt',
868
+ '\f503' => 'randomize',
869
+ '\f504' => 'external',
870
+ '\f506' => 'editor-contract',
871
+ '\f507' => 'universal-access-alt',
872
+ '\f508' => 'calendar-alt',
873
+ '\f509' => 'grid-view',
874
+ '\f510' => 'index-card',
875
+ '\f511' => 'carrot',
876
+ '\f512' => 'building',
877
+ '\f513' => 'store',
878
+ '\f514' => 'album',
879
+ '\f515' => 'controls-repeat',
880
+ '\f516' => 'controls-skipback',
881
+ '\f517' => 'controls-skipforward',
882
+ '\f518' => 'controls-back',
883
+ '\f519' => 'controls-forward',
884
+ '\f520' => 'controls-volumeoff',
885
+ '\f521' => 'controls-volumeon',
886
+ '\f522' => 'controls-play',
887
+ '\f523' => 'controls-pause',
888
+ '\f524' => 'tickets-alt',
889
+ '\f525' => 'phone',
890
+ '\f526' => 'money',
891
+ '\f527' => 'palmtree',
892
+ '\f528' => 'unlock',
893
+ '\f529' => 'thumbs-up',
894
+ '\f530' => 'hidden',
895
+ '\f531' => 'image-rotate',
896
+ '\f533' => 'image-filter',
897
+ '\f534' => 'warning',
898
+ '\f535' => 'editor-table',
899
+ '\f536' => 'filter',
900
+ '\f537' => 'sticky',
901
+ '\f538' => 'layout',
902
+ '\f540' => 'admin-customizer',
903
+ '\f541' => 'admin-multisite',
904
+ '\f542' => 'thumbs-down',
905
+ '\f543' => 'plus-alt2',
906
+ '\f545' => 'move',
907
+ '\f546' => 'paperclip',
908
+ '\f547' => 'laptop',
909
+ ),
910
+ )
911
+ );
912
+
913
+
914
+ /**
915
+ * Returns single instance of the class
916
+ *
917
+ * @return YIT_Icons
918
+ * @since 1.0.0
919
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
920
+ */
921
+ public static function get_instance() {
922
+ return isset( self::$_instance ) ? self::$_instance : self::$_instance = new self();
923
+ }
924
+
925
+ /**
926
+ * @since 1.0.0
927
+ * @access protected
928
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
929
+ */
930
+ private function __construct() {
931
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 99 );
932
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 99 );
933
+ }
934
+
935
+ /**
936
+ * __get function.
937
+ *
938
+ * @param string $key
939
+ *
940
+ * @return mixed
941
+ */
942
+ public function __get( $key ) {
943
+ $value = isset( $this->_data[ $key ] ) ? $this->_data[ $key ] : false;
944
+
945
+ return $value;
946
+ }
947
+
948
+ /**
949
+ * __isset function.
950
+ *
951
+ * @param string $key
952
+ *
953
+ * @return bool
954
+ */
955
+ public function __isset( $key ) {
956
+ return isset( $this->_data[ $key ] );
957
+ }
958
+
959
+ public function get_icons( $filter_icons = '' ) {
960
+ $icons = $this->icons;
961
+ if ( !empty( $filter_icons ) ) {
962
+ $icons = apply_filters( 'yith_plugin_fw_icons_field_icons_' . sanitize_key( $filter_icons ), $icons );
963
+ }
964
+
965
+ return $icons;
966
+ }
967
+
968
+ /**
969
+ * @param $icon_string
970
+ *
971
+ * @param string $filter_icons
972
+ *
973
+ * @return string
974
+ */
975
+ public function get_icon_data( $icon_string, $filter_icons = '' ) {
976
+ $icon_data = '';
977
+ if ( $icon_string ) {
978
+ $icon_array = explode( ':', $icon_string );
979
+
980
+ if ( count( $icon_array ) < 2 ) {
981
+ return $icon_data;
982
+ }
983
+
984
+ $font_name = $icon_array[ 0 ];
985
+ $icon_name = $icon_array[ 1 ];
986
+
987
+ $icons = $this->get_icons( $filter_icons );
988
+ if ( array_key_exists( $font_name, $icons ) ) {
989
+ $icon_key = array_search( $icon_name, $icons[ $font_name ] );
990
+ $icon_code = '&#x' . str_replace( '\\', '', $icon_key );
991
+
992
+ $icon_data = 'data-font="' . esc_attr( $font_name ) . '" data-name="' . esc_attr( $icon_name ) . '" data-key="' . esc_attr( $icon_key ) . '" data-icon="' . $icon_code . '"';
993
+ }
994
+ }
995
+
996
+ return $icon_data;
997
+ }
998
+
999
+ /**
1000
+ * Retrieves the font awesome array
1001
+ * the first time retrieves the array by the Font Awesome CSS
1002
+ * [utility method]
1003
+ *
1004
+ * @return array
1005
+ */
1006
+ private function _get_font_awesome_array() {
1007
+ $font_awesome_list = get_option( 'yit_font_awesome_list', array() );
1008
+ $font_awesome_version = $this->font_awesome_version;
1009
+
1010
+ $font_awesome_array = array();
1011
+
1012
+ if ( !empty( $font_awesome_list[ $font_awesome_version ] ) ) {
1013
+ $font_awesome_array = $font_awesome_list[ $font_awesome_version ];
1014
+ } else {
1015
+ // Create the array by css
1016
+ $font_awesome_file = "https://maxcdn.bootstrapcdn.com/font-awesome/{$font_awesome_version}/css/font-awesome.min.css";
1017
+
1018
+ $pattern = '/\.(fa-(?:\w+(?:-)?)+):before{content:"\\\\(....)"}/';
1019
+ $subject = file_get_contents( $font_awesome_file );
1020
+ preg_match_all( $pattern, $subject, $matches, PREG_SET_ORDER );
1021
+ foreach ( $matches as $match ) {
1022
+ $font_awesome_array[ $match[ 2 ] ] = $match[ 1 ];
1023
+ }
1024
+ ksort( $font_awesome_array );
1025
+
1026
+ $font_awesome_list[ $font_awesome_version ] = $font_awesome_array;
1027
+ update_option( 'yit_font_awesome_list', $font_awesome_list );
1028
+ }
1029
+
1030
+ return $font_awesome_array;
1031
+ }
1032
+
1033
+ /**
1034
+ * Retrieves the dashicons array
1035
+ * the first time retrieves the array by the Dashicons CSS
1036
+ * [utility method]
1037
+ *
1038
+ * @return array
1039
+ */
1040
+ private function _get_dashicons_array() {
1041
+ $dashicons_list = get_option( 'yit_dashicons_list', array() );
1042
+
1043
+ $dashicons_array = array();
1044
+ if ( false && !empty( $dashicons_list ) ) {
1045
+ $dashicons_array = $dashicons_list;
1046
+ } else {
1047
+ // Create the array by css
1048
+ $file = "https://s.w.org/wp-includes/css/dashicons.min.css";
1049
+
1050
+ $pattern = '/\.dashicons-((?:\w+(?:-)?)+):before{content:"\\\\(....)"/';
1051
+ $pattern = '/\.dashicons-((?:\w+(?:-)?)+):before.............../';
1052
+ $subject = file_get_contents( $file );
1053
+ preg_match_all( $pattern, $subject, $matches, PREG_SET_ORDER );
1054
+
1055
+ foreach ( $matches as $match ) {
1056
+ $code = str_replace( '.dashicons-' . $match[ 1 ] . ':before{content:"\\', '', $match[ 0 ] );
1057
+ if ( strlen( $code ) == 4 )
1058
+ $dashicons_array[ $code ] = $match[ 1 ];
1059
+ }
1060
+ ksort( $dashicons_array );
1061
+ }
1062
+
1063
+ return $dashicons_array;
1064
+ }
1065
+
1066
+ /**
1067
+ * Enqueue Scripts
1068
+ *
1069
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
1070
+ */
1071
+ public function enqueue_scripts() {
1072
+ wp_register_style( 'font-awesome', "https://maxcdn.bootstrapcdn.com/font-awesome/{$this->font_awesome_version}/css/font-awesome.min.css", array(), $this->font_awesome_version );
1073
+
1074
+ $font_awesome_inline = $this->get_inline_scripts( 'font-awesome' );
1075
+ wp_add_inline_style( 'font-awesome', $font_awesome_inline );
1076
+
1077
+ $dashicons_inline = $this->get_inline_scripts( 'dashicons' );
1078
+ wp_add_inline_style( 'dashicons', $dashicons_inline );
1079
+ }
1080
+
1081
+ /**
1082
+ * Return the icon HTML from icon_string passed
1083
+ *
1084
+ * @param string|array $icon
1085
+ * @param array $args
1086
+ *
1087
+ * @return string
1088
+ */
1089
+ public function get_icon( $icon = '', $args = array() ) {
1090
+ $icon = is_array( $icon ) && isset( $icon[ 'icon' ] ) ? $icon[ 'icon' ] : $icon;
1091
+ $icon_html = "";
1092
+ if ( $icon ) {
1093
+ $default_args = array(
1094
+ 'html_tag' => 'span',
1095
+ 'class' => '',
1096
+ 'style' => '',
1097
+ 'filter_icons' => ''
1098
+ );
1099
+ $args = wp_parse_args( $args, $default_args );
1100
+ /**
1101
+ * @var string $html_tag
1102
+ * @var string $class
1103
+ * @var string $style
1104
+ * @var string $filter_icons
1105
+ */
1106
+ extract( $args );
1107
+
1108
+ if ( $icon_data = $this->get_icon_data( $icon, $filter_icons ) ) {
1109
+ $icon_html = "<$html_tag class=\"$class\" style=\"$style\" $icon_data></$html_tag>";
1110
+ }
1111
+
1112
+ }
1113
+
1114
+ return $icon_html;
1115
+ }
1116
+
1117
+ /**
1118
+ * Get inline scripts
1119
+ *
1120
+ * @param $slug
1121
+ *
1122
+ * @return string
1123
+ */
1124
+ public function get_inline_scripts( $slug ) {
1125
+ $css = '';
1126
+ switch ( $slug ) {
1127
+ case 'font-awesome':
1128
+ $css = '[data-font="FontAwesome"]:before {font-family: \'FontAwesome\' !important;content: attr(data-icon) !important;speak: none !important;font-weight: normal !important;font-variant: normal !important;text-transform: none !important;line-height: 1 !important;font-style: normal !important;-webkit-font-smoothing: antialiased !important;-moz-osx-font-smoothing: grayscale !important;}';
1129
+ break;
1130
+ case 'dashicons':
1131
+ $css = '[data-font="Dashicons"]:before {font-family: \'Dashicons\' !important;content: attr(data-icon) !important;speak: none !important;font-weight: normal !important;font-variant: normal !important;text-transform: none !important;line-height: 1 !important;font-style: normal !important;-webkit-font-smoothing: antialiased !important;-moz-osx-font-smoothing: grayscale !important;}';
1132
+ }
1133
+
1134
+ return $css;
1135
+ }
1136
+
1137
+ }
1138
+ }
1139
+ function YIT_Icons() {
1140
+ return YIT_Icons::get_instance();
1141
+ }
1142
+
1143
+ YIT_Icons();
plugin-fw/lib/yit-metabox.php CHANGED
@@ -9,11 +9,11 @@
9
  */
10
 
11
 
12
- if (!defined('ABSPATH')) {
13
  exit;
14
  } // Exit if accessed directly
15
 
16
- if (!class_exists('YIT_Metabox')) {
17
  /**
18
  * YIT Metabox
19
  *
@@ -48,8 +48,7 @@ if (!class_exists('YIT_Metabox')) {
48
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
49
  *
50
  */
51
- class YIT_Metabox
52
- {
53
 
54
  /**
55
  * @var string the id of metabox
@@ -91,12 +90,12 @@ if (!class_exists('YIT_Metabox')) {
91
  * @since 1.0
92
  * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
93
  */
94
- public static function instance($id)
95
- {
96
- if (!isset(self::$_instance[$id])) {
97
- self::$_instance[$id] = new self($id);
98
  }
99
- return self::$_instance[$id];
 
100
  }
101
 
102
  /**
@@ -108,8 +107,7 @@ if (!class_exists('YIT_Metabox')) {
108
  * @since 1.0
109
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
110
  */
111
- function __construct($id = '')
112
- {
113
  $this->id = $id;
114
 
115
  }
@@ -126,17 +124,27 @@ if (!class_exists('YIT_Metabox')) {
126
  * @since 1.0
127
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
128
  */
129
- public function init($options = array())
130
- {
131
 
132
- $this->set_options($options);
133
  $this->set_tabs();
134
 
 
 
 
135
 
136
- add_action('add_meta_boxes', array($this, 'register_metabox'),99);
137
- add_action('save_post', array($this, 'save_postdata'));
138
- add_action('admin_enqueue_scripts', array($this, 'enqueue'), 15);
139
 
 
 
 
 
 
 
 
 
 
140
  }
141
 
142
  /**
@@ -147,20 +155,27 @@ if (!class_exists('YIT_Metabox')) {
147
  * @return void
148
  * @since 1.0
149
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
 
150
  */
151
- public function enqueue()
152
- {
153
-
154
- wp_enqueue_media();
155
- wp_enqueue_style('wp-color-picker');
156
- wp_enqueue_style('yit-plugin-metaboxes', YIT_CORE_PLUGIN_URL . '/assets/css/metaboxes.css');
157
- wp_enqueue_style('jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css');
158
- wp_enqueue_script('jquery-ui-datepicker');
159
- wp_enqueue_script('yit-spinner', YIT_CORE_PLUGIN_URL . '/assets/js/panel.spinner.js', array('jquery'), '0.0.1', true);
160
- wp_enqueue_script('jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array('jquery'), '1.1.0', true);
161
- wp_enqueue_script('ajax-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/'.yit_load_js_file('ajax-chosen.jquery.js'), array('jquery'), '1.1.0', true);
162
- wp_enqueue_script('yit-metabox', YIT_CORE_PLUGIN_URL . '/assets/js/metabox.js', array('jquery', 'wp-color-picker'), '1.0.0', true);
163
- wp_enqueue_style('jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-custom/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all');
 
 
 
 
 
 
164
  }
165
 
166
  /**
@@ -174,8 +189,7 @@ if (!class_exists('YIT_Metabox')) {
174
  * @since 1.0
175
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
176
  */
177
- public function set_options($options = array())
178
- {
179
  $this->options = $options;
180
 
181
  }
@@ -191,14 +205,13 @@ if (!class_exists('YIT_Metabox')) {
191
  * @since 1.0
192
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
193
  */
194
- public function set_tabs()
195
- {
196
- if (!isset($this->options['tabs'])) {
197
  return;
198
  }
199
- $this->tabs = $this->options['tabs'];
200
- if (isset($this->tabs['settings']['fields'])) {
201
- $this->tabs['settings']['fields'] = array_filter($this->tabs['settings']['fields']);
202
  }
203
  }
204
 
@@ -210,31 +223,30 @@ if (!class_exists('YIT_Metabox')) {
210
  *
211
  * @internal param array $tabs
212
  *
213
- * @param array $tab the new tab to add to the metabox
214
  * @param string $where tell where insert the tab if after or before a $refer
215
- * @param null $refer an existent tab inside metabox
216
  *
217
  * @return void
218
  * @since 1.0
219
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
220
  */
221
- public function add_tab($tab, $where = 'after', $refer = null)
222
- {
223
- if (!is_null($refer)) {
224
- $ref_pos = array_search($refer, array_keys($this->tabs));
225
- if ($ref_pos !== false) {
226
- if ($where == 'after') {
227
- $this->tabs = array_slice($this->tabs, 0, $ref_pos + 1, true) +
228
- $tab +
229
- array_slice($this->tabs, $ref_pos + 1, count($this->tabs) - 1, true);
230
  } else {
231
- $this->tabs = array_slice($this->tabs, 0, $ref_pos, true) +
232
- $tab +
233
- array_slice($this->tabs, $ref_pos, count($this->tabs), true);
234
  }
235
  }
236
  } else {
237
- $this->tabs = array_merge($tab, $this->tabs);
238
  }
239
 
240
  }
@@ -252,10 +264,9 @@ if (!class_exists('YIT_Metabox')) {
252
  * @since 1.0
253
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
254
  */
255
- public function remove_tab($id_tab)
256
- {
257
- if (isset($this->tabs[$id_tab])) {
258
- unset ($this->tabs[$id_tab]);
259
  }
260
  }
261
 
@@ -268,40 +279,39 @@ if (!class_exists('YIT_Metabox')) {
268
  * @internal param array $tabs
269
  *
270
  * @param string $tab_id the id of the tabs where add the field
271
- * @param array $args the field to add
272
  * @param string $where tell where insert the field if after or before a $refer
273
- * @param null $refer an existent field inside tab
274
  *
275
  * @return void
276
  * @since 1.0
277
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
278
  */
279
- public function add_field($tab_id, $args, $where = 'after', $refer = null)
280
- {
281
- if (isset($this->tabs[$tab_id])) {
282
-
283
- $cf = $this->tabs[$tab_id]['fields'];
284
- if (!is_null($refer)) {
285
- $ref_pos = array_search($refer, array_keys($cf));
286
- if ($ref_pos !== false) {
287
- if ($where == 'after') {
288
- $this->tabs[$tab_id]['fields'] = array_slice($cf, 0, $ref_pos + 1, true) +
289
- $args +
290
- array_slice($cf, $ref_pos, count($cf) - 1, true);
291
-
292
- } elseif ($where == 'before') {
293
- $this->tabs[$tab_id]['fields'] = array_slice($cf, 0, $ref_pos, true) +
294
- $args +
295
- array_slice($cf, $ref_pos, count($cf), true);
296
 
297
  }
298
  }
299
  } else {
300
- if ($where == 'first') {
301
- $this->tabs[$tab_id]['fields'] = $args + $cf;
302
 
303
  } else {
304
- $this->tabs[$tab_id]['fields'] = array_merge($this->tabs[$tab_id]['fields'], $args);
305
  }
306
  }
307
 
@@ -321,11 +331,10 @@ if (!class_exists('YIT_Metabox')) {
321
  * @since 1.0
322
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
323
  */
324
- public function remove_field($id_field)
325
- {
326
- foreach ($this->tabs as $tab_name => $tab) {
327
- if (isset($tab['fields'][$id_field])) {
328
- unset ($this->tabs[$tab_name]['fields'][$id_field]);
329
  }
330
  }
331
  }
@@ -341,13 +350,14 @@ if (!class_exists('YIT_Metabox')) {
341
  * @since 1.0
342
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
343
  */
344
- public function reorder_tabs()
345
- {
346
- foreach ($this->tabs as $tab_name => $tab) {
347
- foreach ($tab['fields'] as $id_field => $field) {
348
- $this->tabs[$tab_name]['fields'][$id_field]['private'] = (isset($field['private'])) ? $field['private'] : true;
349
- $this->tabs[$tab_name]['fields'][$id_field]['id'] = $this->get_option_metabox_id($id_field, $this->tabs[$tab_name]['fields'][$id_field]['private']);
350
- $this->tabs[$tab_name]['fields'][$id_field]['name'] = $this->get_option_metabox_name($this->tabs[$tab_name]['fields'][$id_field]['id']);
 
351
  }
352
  }
353
 
@@ -360,15 +370,14 @@ if (!class_exists('YIT_Metabox')) {
360
  * return the id of the field
361
  *
362
  * @param string $id_field
363
- * @param bool $private if private add an _befor the id
364
  *
365
  * @return string
366
  * @since 1.0
367
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
368
  */
369
- public function get_option_metabox_id($id_field, $private = true)
370
- {
371
- if ($private) {
372
  return '_' . $id_field;
373
  } else {
374
  return $id_field;
@@ -381,23 +390,22 @@ if (!class_exists('YIT_Metabox')) {
381
  * return the name of the field, this name will be used as attribute name of the input field
382
  *
383
  * @param string $id_field
384
- * @param bool $private if private add an _befor the id
385
  *
386
  * @return string
387
  * @since 1.0
388
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
389
  */
390
- public function get_option_metabox_name($id_field, $private = true)
391
- {
392
- $db_name = apply_filters('yit_metaboxes_option_main_name', 'yit_metaboxes');
393
- $return = $db_name . '[';
394
 
395
- if (!strpos($id_field, '[')) {
396
  return $return . $id_field . ']';
397
  }
398
- $return .= substr($id_field, 0, strpos($id_field, '['));
399
  $return .= ']';
400
- $return .= substr($id_field, strpos($id_field, '['));
401
 
402
  return $return;
403
  }
@@ -412,11 +420,10 @@ if (!class_exists('YIT_Metabox')) {
412
  * @since 1.0
413
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
414
  */
415
- public function register_metabox($post_type)
416
- {
417
 
418
- if (in_array($post_type, (array)$this->options['pages'])) {
419
- add_meta_box($this->id, $this->options['label'], array($this, 'show'), $post_type, $this->options['context'], $this->options['priority']);
420
  }
421
  }
422
 
@@ -430,11 +437,10 @@ if (!class_exists('YIT_Metabox')) {
430
  * @since 1.0
431
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
432
  */
433
- public function show()
434
- {
435
  $this->reorder_tabs();
436
 
437
- yit_plugin_get_template(YIT_CORE_PLUGIN_PATH, 'metaboxes/tab.php', array('tabs' => $this->tabs));
438
  }
439
 
440
  /**
@@ -448,31 +454,30 @@ if (!class_exists('YIT_Metabox')) {
448
  * @since 1.0
449
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
450
  */
451
- public function save_postdata($post_id)
452
- {
453
 
454
 
455
- if (!isset($_POST['yit_metaboxes_nonce']) || !wp_verify_nonce($_POST['yit_metaboxes_nonce'], 'metaboxes-fields-nonce')) {
456
  return $post_id;
457
  }
458
 
459
 
460
- if ((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || (defined('DOING_AJAX') && DOING_AJAX)) {
461
  return $post_id;
462
  }
463
 
464
- if (isset($_POST['post_type'])) {
465
- $post_type = $_POST['post_type'];
466
  } else {
467
  return $post_id;
468
  }
469
 
470
- if ('page' == $post_type) {
471
- if (!current_user_can('edit_page', $post_id)) {
472
  return $post_id;
473
  }
474
  } else {
475
- if (!current_user_can('edit_post', $post_id)) {
476
  return $post_id;
477
  }
478
  }
@@ -483,16 +488,15 @@ if (!class_exists('YIT_Metabox')) {
483
 
484
  $this->reorder_tabs();
485
 
486
- if(isset($_POST['yit_metaboxes'])) {
487
- $yit_metabox_data = $_POST['yit_metaboxes'];
488
 
489
- if(is_array($yit_metabox_data)) {
490
 
491
- foreach ($yit_metabox_data as $field_name => $field_value) {
492
 
493
- if(! add_post_meta($post_id, $field_name, $field_value, true) )
494
- {
495
- update_post_meta($post_id, $field_name, $field_value);
496
  }
497
 
498
 
@@ -503,25 +507,29 @@ if (!class_exists('YIT_Metabox')) {
503
 
504
  }
505
 
506
- foreach ($this->tabs as $tab) {
507
 
508
- foreach ($tab['fields'] as $field) {
509
 
510
- if (in_array($field['type'], array('title'))) {
511
  continue;
512
  }
513
 
514
- if (isset($_POST['yit_metaboxes'][$field['id']])) {
515
 
516
- add_post_meta($post_id, $field['id'], $_POST['yit_metaboxes'][$field['id']], true) || update_post_meta($post_id, $field['id'], $_POST['yit_metaboxes'][$field['id']]);
517
- } elseif (in_array($field['type'], array('onoff', 'checkbox'))) {
518
- update_post_meta($post_id, $field['id'], '0');
 
 
 
 
519
  } else {
520
- delete_post_meta($post_id, $field['id']);
521
  }
522
  }
523
  }
524
-
525
  }
526
 
527
  /**
@@ -535,16 +543,15 @@ if (!class_exists('YIT_Metabox')) {
535
  * @since 2.0.0
536
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
537
  */
538
- public function remove_fields($id_fields)
539
- {
540
- foreach ($id_fields as $k => $field) {
541
- $this->remove_field($field);
542
  }
543
  }
544
  }
545
  }
546
 
547
- if (!function_exists('YIT_Metabox')) {
548
 
549
  /**
550
  * Main instance of plugin
@@ -557,9 +564,8 @@ if (!function_exists('YIT_Metabox')) {
557
  */
558
 
559
 
560
- function YIT_Metabox($id)
561
- {
562
- return YIT_Metabox::instance($id);
563
  }
564
  }
565
 
9
  */
10
 
11
 
12
+ if ( !defined( 'ABSPATH' ) ) {
13
  exit;
14
  } // Exit if accessed directly
15
 
16
+ if ( !class_exists( 'YIT_Metabox' ) ) {
17
  /**
18
  * YIT Metabox
19
  *
48
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
49
  *
50
  */
51
+ class YIT_Metabox {
 
52
 
53
  /**
54
  * @var string the id of metabox
90
  * @since 1.0
91
  * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
92
  */
93
+ public static function instance( $id ) {
94
+ if ( !isset( self::$_instance[ $id ] ) ) {
95
+ self::$_instance[ $id ] = new self( $id );
 
96
  }
97
+
98
+ return self::$_instance[ $id ];
99
  }
100
 
101
  /**
107
  * @since 1.0
108
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
109
  */
110
+ function __construct( $id = '' ) {
 
111
  $this->id = $id;
112
 
113
  }
124
  * @since 1.0
125
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
126
  */
127
+ public function init( $options = array() ) {
 
128
 
129
+ $this->set_options( $options );
130
  $this->set_tabs();
131
 
132
+ add_action( 'add_meta_boxes', array( $this, 'register_metabox' ), 99 );
133
+ add_action( 'save_post', array( $this, 'save_postdata' ) );
134
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ), 15 );
135
 
136
+ add_filter( 'yit_icons_screen_ids', array( $this, 'add_screen_ids_for_icons' ) );
137
+ }
 
138
 
139
+ /**
140
+ * Add Screen ids to include icons
141
+ *
142
+ * @param $screen_ids
143
+ *
144
+ * @return array
145
+ */
146
+ public function add_screen_ids_for_icons( $screen_ids ) {
147
+ return array_unique( array_merge( $screen_ids, (array) $this->options[ 'pages' ] ) );
148
  }
149
 
150
  /**
155
  * @return void
156
  * @since 1.0
157
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
158
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
159
  */
160
+ public function enqueue() {
161
+ $enqueue = function_exists( 'get_current_screen' ) && get_current_screen() && in_array( get_current_screen()->id, (array) $this->options[ 'pages' ] );
162
+ $enqueue = apply_filters( 'yith_plugin_fw_metabox_enqueue_styles_and_scripts', $enqueue, $this );
163
+
164
+ // load scripts and styles only where the metabox is displayed
165
+ if ( $enqueue ) {
166
+ wp_enqueue_media();
167
+
168
+ wp_enqueue_style( 'woocommerce_admin_styles' );
169
+
170
+ wp_enqueue_style( 'yith-plugin-fw-fields' );
171
+ wp_enqueue_style( 'wp-color-picker' );
172
+ wp_enqueue_style( 'yit-plugin-metaboxes' );
173
+ wp_enqueue_style( 'yit-jquery-ui-style' );
174
+
175
+ wp_enqueue_script( 'yit-metabox' );
176
+
177
+ wp_enqueue_script( 'yith-plugin-fw-fields' );
178
+ }
179
  }
180
 
181
  /**
189
  * @since 1.0
190
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
191
  */
192
+ public function set_options( $options = array() ) {
 
193
  $this->options = $options;
194
 
195
  }
205
  * @since 1.0
206
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
207
  */
208
+ public function set_tabs() {
209
+ if ( !isset( $this->options[ 'tabs' ] ) ) {
 
210
  return;
211
  }
212
+ $this->tabs = $this->options[ 'tabs' ];
213
+ if ( isset( $this->tabs[ 'settings' ][ 'fields' ] ) ) {
214
+ $this->tabs[ 'settings' ][ 'fields' ] = array_filter( $this->tabs[ 'settings' ][ 'fields' ] );
215
  }
216
  }
217
 
223
  *
224
  * @internal param array $tabs
225
  *
226
+ * @param array $tab the new tab to add to the metabox
227
  * @param string $where tell where insert the tab if after or before a $refer
228
+ * @param null $refer an existent tab inside metabox
229
  *
230
  * @return void
231
  * @since 1.0
232
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
233
  */
234
+ public function add_tab( $tab, $where = 'after', $refer = null ) {
235
+ if ( !is_null( $refer ) ) {
236
+ $ref_pos = array_search( $refer, array_keys( $this->tabs ) );
237
+ if ( $ref_pos !== false ) {
238
+ if ( $where == 'after' ) {
239
+ $this->tabs = array_slice( $this->tabs, 0, $ref_pos + 1, true ) +
240
+ $tab +
241
+ array_slice( $this->tabs, $ref_pos + 1, count( $this->tabs ) - 1, true );
 
242
  } else {
243
+ $this->tabs = array_slice( $this->tabs, 0, $ref_pos, true ) +
244
+ $tab +
245
+ array_slice( $this->tabs, $ref_pos, count( $this->tabs ), true );
246
  }
247
  }
248
  } else {
249
+ $this->tabs = array_merge( $tab, $this->tabs );
250
  }
251
 
252
  }
264
  * @since 1.0
265
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
266
  */
267
+ public function remove_tab( $id_tab ) {
268
+ if ( isset( $this->tabs[ $id_tab ] ) ) {
269
+ unset ( $this->tabs[ $id_tab ] );
 
270
  }
271
  }
272
 
279
  * @internal param array $tabs
280
  *
281
  * @param string $tab_id the id of the tabs where add the field
282
+ * @param array $args the field to add
283
  * @param string $where tell where insert the field if after or before a $refer
284
+ * @param null $refer an existent field inside tab
285
  *
286
  * @return void
287
  * @since 1.0
288
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
289
  */
290
+ public function add_field( $tab_id, $args, $where = 'after', $refer = null ) {
291
+ if ( isset( $this->tabs[ $tab_id ] ) ) {
292
+
293
+ $cf = $this->tabs[ $tab_id ][ 'fields' ];
294
+ if ( !is_null( $refer ) ) {
295
+ $ref_pos = array_search( $refer, array_keys( $cf ) );
296
+ if ( $ref_pos !== false ) {
297
+ if ( $where == 'after' ) {
298
+ $this->tabs[ $tab_id ][ 'fields' ] = array_slice( $cf, 0, $ref_pos + 1, true ) +
299
+ $args +
300
+ array_slice( $cf, $ref_pos, count( $cf ) - 1, true );
301
+
302
+ } elseif ( $where == 'before' ) {
303
+ $this->tabs[ $tab_id ][ 'fields' ] = array_slice( $cf, 0, $ref_pos, true ) +
304
+ $args +
305
+ array_slice( $cf, $ref_pos, count( $cf ), true );
 
306
 
307
  }
308
  }
309
  } else {
310
+ if ( $where == 'first' ) {
311
+ $this->tabs[ $tab_id ][ 'fields' ] = $args + $cf;
312
 
313
  } else {
314
+ $this->tabs[ $tab_id ][ 'fields' ] = array_merge( $this->tabs[ $tab_id ][ 'fields' ], $args );
315
  }
316
  }
317
 
331
  * @since 1.0
332
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
333
  */
334
+ public function remove_field( $id_field ) {
335
+ foreach ( $this->tabs as $tab_name => $tab ) {
336
+ if ( isset( $tab[ 'fields' ][ $id_field ] ) ) {
337
+ unset ( $this->tabs[ $tab_name ][ 'fields' ][ $id_field ] );
 
338
  }
339
  }
340
  }
350
  * @since 1.0
351
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
352
  */
353
+ public function reorder_tabs() {
354
+ foreach ( $this->tabs as $tab_name => $tab ) {
355
+ foreach ( $tab[ 'fields' ] as $id_field => $field ) {
356
+ $this->tabs[ $tab_name ][ 'fields' ][ $id_field ][ 'private' ] = ( isset( $field[ 'private' ] ) ) ? $field[ 'private' ] : true;
357
+ if ( empty( $this->tabs[ $tab_name ][ 'fields' ][ $id_field ][ 'id' ] ) )
358
+ $this->tabs[ $tab_name ][ 'fields' ][ $id_field ][ 'id' ] = $this->get_option_metabox_id( $id_field, $this->tabs[ $tab_name ][ 'fields' ][ $id_field ][ 'private' ] );
359
+ if ( empty( $this->tabs[ $tab_name ][ 'fields' ][ $id_field ][ 'name' ] ) )
360
+ $this->tabs[ $tab_name ][ 'fields' ][ $id_field ][ 'name' ] = $this->get_option_metabox_name( $this->tabs[ $tab_name ][ 'fields' ][ $id_field ][ 'id' ] );
361
  }
362
  }
363
 
370
  * return the id of the field
371
  *
372
  * @param string $id_field
373
+ * @param bool $private if private add an _befor the id
374
  *
375
  * @return string
376
  * @since 1.0
377
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
378
  */
379
+ public function get_option_metabox_id( $id_field, $private = true ) {
380
+ if ( $private ) {
 
381
  return '_' . $id_field;
382
  } else {
383
  return $id_field;
390
  * return the name of the field, this name will be used as attribute name of the input field
391
  *
392
  * @param string $id_field
393
+ * @param bool $private if private add an _befor the id
394
  *
395
  * @return string
396
  * @since 1.0
397
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
398
  */
399
+ public function get_option_metabox_name( $id_field, $private = true ) {
400
+ $db_name = apply_filters( 'yit_metaboxes_option_main_name', 'yit_metaboxes' );
401
+ $return = $db_name . '[';
 
402
 
403
+ if ( !strpos( $id_field, '[' ) ) {
404
  return $return . $id_field . ']';
405
  }
406
+ $return .= substr( $id_field, 0, strpos( $id_field, '[' ) );
407
  $return .= ']';
408
+ $return .= substr( $id_field, strpos( $id_field, '[' ) );
409
 
410
  return $return;
411
  }
420
  * @since 1.0
421
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
422
  */
423
+ public function register_metabox( $post_type ) {
 
424
 
425
+ if ( in_array( $post_type, (array) $this->options[ 'pages' ] ) ) {
426
+ add_meta_box( $this->id, $this->options[ 'label' ], array( $this, 'show' ), $post_type, $this->options[ 'context' ], $this->options[ 'priority' ] );
427
  }
428
  }
429
 
437
  * @since 1.0
438
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
439
  */
440
+ public function show() {
 
441
  $this->reorder_tabs();
442
 
443
+ yit_plugin_get_template( YIT_CORE_PLUGIN_PATH, 'metaboxes/tab.php', array( 'tabs' => $this->tabs ) );
444
  }
445
 
446
  /**
454
  * @since 1.0
455
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
456
  */
457
+ public function save_postdata( $post_id ) {
 
458
 
459
 
460
+ if ( !isset( $_POST[ 'yit_metaboxes_nonce' ] ) || !wp_verify_nonce( $_POST[ 'yit_metaboxes_nonce' ], 'metaboxes-fields-nonce' ) ) {
461
  return $post_id;
462
  }
463
 
464
 
465
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
466
  return $post_id;
467
  }
468
 
469
+ if ( isset( $_POST[ 'post_type' ] ) ) {
470
+ $post_type = $_POST[ 'post_type' ];
471
  } else {
472
  return $post_id;
473
  }
474
 
475
+ if ( 'page' == $post_type ) {
476
+ if ( !current_user_can( 'edit_page', $post_id ) ) {
477
  return $post_id;
478
  }
479
  } else {
480
+ if ( !current_user_can( 'edit_post', $post_id ) ) {
481
  return $post_id;
482
  }
483
  }
488
 
489
  $this->reorder_tabs();
490
 
491
+ if ( isset( $_POST[ 'yit_metaboxes' ] ) ) {
492
+ $yit_metabox_data = $_POST[ 'yit_metaboxes' ];
493
 
494
+ if ( is_array( $yit_metabox_data ) ) {
495
 
496
+ foreach ( $yit_metabox_data as $field_name => $field_value ) {
497
 
498
+ if ( !add_post_meta( $post_id, $field_name, $field_value, true ) ) {
499
+ update_post_meta( $post_id, $field_name, $field_value );
 
500
  }
501
 
502
 
507
 
508
  }
509
 
510
+ foreach ( $this->tabs as $tab ) {
511
 
512
+ foreach ( $tab[ 'fields' ] as $field ) {
513
 
514
+ if ( in_array( $field[ 'type' ], array( 'title' ) ) ) {
515
  continue;
516
  }
517
 
518
+ if ( isset( $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ] ) ) {
519
 
520
+ if ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
521
+ update_post_meta( $post_id, $field[ 'id' ], '1' );
522
+ } else {
523
+ add_post_meta( $post_id, $field[ 'id' ], $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ], true ) || update_post_meta( $post_id, $field[ 'id' ], $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ] );
524
+ }
525
+ } elseif ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
526
+ update_post_meta( $post_id, $field[ 'id' ], '0' );
527
  } else {
528
+ delete_post_meta( $post_id, $field[ 'id' ] );
529
  }
530
  }
531
  }
532
+
533
  }
534
 
535
  /**
543
  * @since 2.0.0
544
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
545
  */
546
+ public function remove_fields( $id_fields ) {
547
+ foreach ( $id_fields as $k => $field ) {
548
+ $this->remove_field( $field );
 
549
  }
550
  }
551
  }
552
  }
553
 
554
+ if ( !function_exists( 'YIT_Metabox' ) ) {
555
 
556
  /**
557
  * Main instance of plugin
564
  */
565
 
566
 
567
+ function YIT_Metabox( $id ) {
568
+ return YIT_Metabox::instance( $id );
 
569
  }
570
  }
571
 
plugin-fw/lib/yit-plugin-common.php CHANGED
@@ -1129,7 +1129,7 @@ class YIT_Plugin_Common {
1129
  'easeInBounce' => 'easeInBounce',
1130
  'easeOutBounce' => 'easeOutBounce',
1131
  'easeInOutBounce' => 'easeInOutBounce'
1132
- )
1133
  );
1134
 
1135
  /**
1129
  'easeInBounce' => 'easeInBounce',
1130
  'easeOutBounce' => 'easeOutBounce',
1131
  'easeInOutBounce' => 'easeInOutBounce'
1132
+ ),
1133
  );
1134
 
1135
  /**
plugin-fw/lib/yit-plugin-panel-sidebar.php DELETED
@@ -1,430 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( !class_exists( 'YIT_Plugin_Panel_Sidebar' ) ) {
16
- /**
17
- * YIT Plugin Panel Sidebar
18
- *
19
- * @class YIT_Plugin_Panel_Sidebar
20
- * @package Yithemes
21
- * @since 1.0
22
- * @author Leanza Francesco <leanzafrancesco@gmail.com>
23
- */
24
- class YIT_Plugin_Panel_Sidebar {
25
- /**
26
- * @var string version of class
27
- */
28
- public $version = '1.0.1';
29
-
30
-
31
- /**
32
- * @var array array of widgets
33
- */
34
- public $widgets = array();
35
-
36
- /**
37
- * @type string
38
- */
39
- protected $_remote_widget_xml = 'http://bit.ly/1UJ83xN';
40
-
41
- /**
42
- * default priority for Remote Widgets
43
- *
44
- * @type int
45
- */
46
- public $default_remote_widget_priority = 40;
47
-
48
- /**
49
- * parent panel
50
- *
51
- * @var YIT_Plugin_Panel
52
- */
53
- public $panel;
54
-
55
- private $_is_collapsed;
56
-
57
- /**
58
- * @type string
59
- */
60
- public static $transient_remote_widgets = 'yit_panel_sidebar_remote_widgets';
61
-
62
- /**
63
- * @type string
64
- */
65
- public static $transient_updated_remote_widgets = 'yit_panel_sidebar_remote_widgets_update';
66
-
67
- /**
68
- * @type string
69
- */
70
- public static $collapse_option = 'yith_plugin_panel_sidebar_collapse';
71
-
72
- /**
73
- * Constructor
74
- *
75
- * @param YIT_Plugin_Panel $panel the parent panel
76
- *
77
- * @since 1.0
78
- * @author Leanza Francesco <leanzafrancesco@gmail.com>
79
- */
80
- private function __construct( $panel ) {
81
- $this->panel = $panel;
82
-
83
- /* load and sort default widgets and remote widgets */
84
- $this->load_widgets();
85
-
86
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
87
- add_filter( 'yit_admin_panel_content_class', array( $this, 'filter_admin_panel_content_class' ) );
88
- }
89
-
90
- /**
91
- * get instance
92
- *
93
- * @static
94
- * @return YIT_Plugin_Panel_Sidebar
95
- *
96
- * @since 1.0
97
- * @author Leanza Francesco <leanzafrancesco@gmail.com>
98
- */
99
- public static function instance( $panel ) {
100
- return new self( $panel );
101
- }
102
-
103
- /**
104
- * return true if is collapsed by option
105
- *
106
- * @return bool
107
- */
108
- public function is_collapsed() {
109
- if ( !isset( $this->_is_collapsed ) ) {
110
- $this->_is_collapsed = get_option( self::$collapse_option, 'no' ) === 'yes';
111
- }
112
-
113
- return $this->_is_collapsed;
114
- }
115
-
116
- /**
117
- * if is collapsed add a class to panel wrapper
118
- *
119
- * @param $class
120
- *
121
- * @return string
122
- */
123
- public function filter_admin_panel_content_class( $class ) {
124
- if ( $this->is_collapsed() ) {
125
- $class .= ' yit-admin-panel-content-wrap-full';
126
- }
127
-
128
- return $class;
129
- }
130
-
131
- /**
132
- * Add one or more widgets to $this->widgets
133
- *
134
- * @param array $widgets
135
- */
136
- public function add_widgets( $widgets ) {
137
- $this->widgets = array_merge( $this->widgets, $widgets );
138
- }
139
-
140
- /**
141
- * delete transients
142
- */
143
- public static function delete_transients() {
144
- delete_transient( self::$transient_remote_widgets );
145
- delete_transient( self::$transient_updated_remote_widgets );
146
- }
147
-
148
- /**
149
- * filter and sort widgets
150
- */
151
- private function _filter_and_sort_widgets() {
152
- /* filter widgets */
153
- $page_name = isset( $this->panel->settings[ 'page' ] ) ? $this->panel->settings[ 'page' ] : '';
154
- $this->widgets = apply_filters( 'yit_plugin_panel_sidebar_widgets', $this->widgets, $page_name );
155
-
156
- /*sort widgets*/
157
- uasort( $this->widgets, array( $this, 'sort_widgets' ) );
158
- }
159
-
160
- /**
161
- * get Remote Widget by XML from YIThemes
162
- *
163
- * @return array
164
- *
165
- * @since 1.0
166
- * @author Leanza Francesco <leanzafrancesco@gmail.com>
167
- */
168
- public function get_remote_widgets() {
169
- $load_remote_widgets = apply_filters( 'yit_panel_sidebar_load_remote_widgets', true );
170
- if ( !$load_remote_widgets )
171
- return array();
172
-
173
- $remote_widgets = get_transient( self::$transient_remote_widgets );
174
- $updated = get_transient( self::$transient_updated_remote_widgets );
175
- $is_debug = defined( 'YIT_FW_REMOTE_WIDGETS_DEBUG' ) && YIT_FW_REMOTE_WIDGETS_DEBUG;
176
-
177
- if ( $is_debug || $updated === false || $remote_widgets === false ) {
178
- $remote_widgets = array();
179
- } else {
180
- return $remote_widgets;
181
- }
182
-
183
- $expiration = 1 * DAY_IN_SECONDS;
184
- $updated_expiration = DAY_IN_SECONDS; // update frequency
185
-
186
- $remote_xml = wp_remote_get( $this->_remote_widget_xml );
187
- if ( !is_wp_error( $remote_xml ) && isset( $remote_xml[ 'response' ][ 'code' ] ) && '200' == $remote_xml[ 'response' ][ 'code' ] && class_exists( 'SimpleXmlElement' ) ) {
188
- try {
189
- // suppress all XML errors when loading the document
190
- libxml_use_internal_errors( true );
191
-
192
- $xml_data = new SimpleXmlElement( $remote_xml[ 'body' ] );
193
- $xml_remote_widgets = isset( $xml_data->widget ) ? $xml_data->widget : array();
194
-
195
- $enabled_args = array(
196
- 'title',
197
- 'icon',
198
- 'content',
199
- 'class',
200
- 'title_class',
201
- 'badge',
202
- 'badge_text',
203
- 'image',
204
- 'image_class',
205
- 'priority',
206
- 'starting',
207
- 'expiration',
208
- );
209
-
210
- $last_remote_priority = $this->default_remote_widget_priority;
211
-
212
- foreach ( $xml_remote_widgets as $xml_widget ) {
213
- if ( !isset( $xml_widget->id ) )
214
- continue;
215
-
216
- $widget_id = (string) $xml_widget->id;
217
- $widget_array = array();
218
- foreach ( $enabled_args as $key ) {
219
- if ( isset( $xml_widget->$key ) ) {
220
- $widget_array[ $key ] = (string) $xml_widget->$key;
221
- } else {
222
- if ( $key == 'priority' ) {
223
- $widget_array[ $key ] = $last_remote_priority;
224
- $last_remote_priority += 10;
225
- }
226
- }
227
- }
228
- $remote_widgets[ $widget_id ] = $widget_array;
229
- }
230
-
231
- $xml_expiration = isset( $xml_data->expiration ) ? (string) $xml_data->expiration : '';
232
- if ( !empty( $xml_expiration ) ) {
233
- $expiration = strtotime( $xml_expiration ) - strtotime( 'now' );
234
- // if the XML is expired removes widgets
235
- if ( $expiration < 1 )
236
- $remote_widgets = array();
237
-
238
- $is_urgent = isset( $xml_data->urgent ) ? !!$xml_data->urgent : false;
239
- $is_urgent = true;
240
- if ( !$is_urgent ) {
241
- $four_days_random = mt_rand( 0, 4 * DAY_IN_SECONDS );
242
- $expiration += $four_days_random;
243
- } else {
244
- /**
245
- * - - - - - U R G E N T - - - - -
246
- * it will be updated the exact day, BUT in different time! :)
247
- * [to prevent too many request at the same time]
248
- */
249
- $one_day_random = mt_rand( 0, DAY_IN_SECONDS );
250
- $expiration += $one_day_random;
251
- }
252
- }
253
-
254
- $four_days_random = mt_rand( 0, 4 * DAY_IN_SECONDS );
255
-
256
- /* to prevent multiple request if it's expired */
257
- if ( $expiration < 1 ) {
258
- $expiration = 1 * DAY_IN_SECONDS + $four_days_random;
259
- }
260
- } catch ( Exception $e ) {
261
-
262
- }
263
-
264
- //$updated_expiration = 30 * DAY_IN_SECONDS + $four_days_random;
265
- }
266
-
267
- set_transient( self::$transient_remote_widgets, $remote_widgets, $expiration );
268
- set_transient( self::$transient_updated_remote_widgets, true, $updated_expiration );
269
-
270
- return $remote_widgets;
271
- }
272
-
273
- /**
274
- * load and sort default widgets and remote widgets
275
- *
276
- * @since 1.0
277
- * @author Leanza Francesco <leanzafrancesco@gmail.com>
278
- */
279
- public function load_widgets() {
280
- /* get static widgets */
281
- $this->widgets = include( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/sidebar/widgets/widgets.php' );
282
-
283
- /* get remote widgets */
284
- $remote_widgets = $this->get_remote_widgets();
285
- $this->add_widgets( $remote_widgets );
286
- }
287
-
288
- /**
289
- * Print the panel sidebar
290
- *
291
- * @return void
292
- *
293
- * @since 1.0
294
- * @author Leanza Francesco <leanzafrancesco@gmail.com>
295
- */
296
- public function print_panel_sidebar() {
297
- do_action( 'yit_panel_before_sidebar' );
298
-
299
- include( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/sidebar/sidebar.php' );
300
-
301
- do_action( 'yit_panel_after_sidebar' );
302
- }
303
-
304
- /**
305
- * Print the panel sidebar widgets
306
- *
307
- * @return void
308
- *
309
- * @since 1.0
310
- * @author Leanza Francesco <leanzafrancesco@gmail.com>
311
- */
312
- public function print_panel_sidebar_widgets() {
313
- $basename = YIT_CORE_PLUGIN_PATH;
314
- $path = '/panel/sidebar/widget.php';
315
-
316
- $default_args = array(
317
- 'id' => '',
318
- 'title' => '',
319
- 'icon' => '',
320
- 'content' => '',
321
- 'class' => '',
322
- 'title_class' => '',
323
- 'template' => '',
324
- 'badge' => '',
325
- 'badge_text' => '',
326
- 'image' => '',
327
- 'image_class' => '',
328
- 'args' => array(),
329
- 'hide_if_empty_args' => '',
330
- 'priority' => 10,
331
- 'starting' => '',
332
- 'expiration' => '',
333
- );
334
-
335
- $this->_filter_and_sort_widgets();
336
-
337
- foreach ( $this->widgets as $widget_id => $widget ) {
338
- $args = array_merge( $widget, array( 'id' => $widget_id ) );
339
- $args = wp_parse_args( $args, $default_args );
340
-
341
- $is_started = empty( $args[ 'starting' ] ) || strtotime( $args[ 'starting' ] . ' midnight' ) <= strtotime( 'midnight' );
342
- $is_expired = !empty( $args[ 'expiration' ] ) && strtotime( $args[ 'expiration' ] . ' midnight' ) < strtotime( 'midnight' );
343
-
344
- if ( $is_expired || !$is_started )
345
- continue;
346
-
347
- if ( !empty( $args[ 'hide_if_empty_args' ] ) ) {
348
- $hide_if_empty_args = $args[ 'hide_if_empty_args' ];
349
- $continue = false;
350
- foreach ( $hide_if_empty_args as $hide_if_empty_arg ) {
351
- if ( empty( $args[ 'args' ][ $hide_if_empty_arg ] ) ) {
352
- $continue = true;
353
- break;
354
- }
355
- }
356
- if ( $continue )
357
- continue;
358
- }
359
-
360
- do_action( 'yit_panel_sidebar_before_widget', $widget_id, $widget );
361
-
362
- yit_plugin_get_template( $basename, $path, $args );
363
-
364
- do_action( 'yit_panel_sidebar_after_widget', $widget_id, $widget );
365
- }
366
- }
367
-
368
- /**
369
- * set transient for first activation
370
- * to prevent too many calls to YIThemes
371
- */
372
- public static function set_transient_for_first_activation() {
373
- $remote_widgets = get_transient( self::$transient_remote_widgets );
374
- $updated = get_transient( self::$transient_updated_remote_widgets );
375
-
376
- $first_activation = $updated === false && $remote_widgets === false;
377
- if ( $first_activation ) {
378
- $seven_days_random = mt_rand( 0, 7 * DAY_IN_SECONDS );
379
- $expiration = 1 * DAY_IN_SECONDS + $seven_days_random;
380
-
381
- set_transient( self::$transient_remote_widgets, array(), $expiration );
382
- set_transient( self::$transient_updated_remote_widgets, true, $expiration );
383
- }
384
- }
385
-
386
- /**
387
- * Sort widgets by priority
388
- *
389
- * @param $a
390
- * @param $b
391
- *
392
- * @return bool
393
- *
394
- * @since 1.0
395
- * @author Leanza Francesco <leanzafrancesco@gmail.com>
396
- */
397
- public function sort_widgets( $a, $b ) {
398
- $priority_a = isset( $a[ 'priority' ] ) ? intval( $a[ 'priority' ] ) : $this->default_remote_widget_priority;
399
- $priority_b = isset( $b[ 'priority' ] ) ? intval( $b[ 'priority' ] ) : $this->default_remote_widget_priority;
400
- if ( $priority_a == $priority_b ) {
401
- return 0;
402
- } elseif ( $priority_a > $priority_b ) {
403
- return 1;
404
- } else {
405
- return -1;
406
- }
407
- }
408
-
409
- /**
410
- * Add Admin WC Style and Scripts
411
- *
412
- * @return void
413
- *
414
- * @since 1.0
415
- * @author Leanza Francesco <leanzafrancesco@gmail.com
416
- */
417
- public function admin_enqueue_scripts() {
418
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
419
-
420
- wp_enqueue_style( 'opensans-font', '//fonts.googleapis.com/css?family=Open+Sans:400,500,600,700,800,100,200,300,900' );
421
- wp_enqueue_style( 'yit-plugin-sidebar-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel-sidebar.css', $this->version );
422
- wp_enqueue_script( 'yit-plugin-sidebar-js', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel-sidebar' . $min . '.js', array( 'jquery' ), $this->version, true );
423
- wp_localize_script( 'yit-plugin-sidebar-js', 'sidebar_labels', array(
424
- 'hide_sidebar' => __( 'Hide sidebar', 'yith-plugin-fw' ),
425
- 'show_sidebar' => __( 'Show sidebar', 'yith-plugin-fw' ),
426
- 'wrapper_class' => 'yit-admin-panel-content-wrap',
427
- ) );
428
- }
429
- }
430
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/lib/yit-plugin-panel-wc.php CHANGED
@@ -8,11 +8,11 @@
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
- if ( ! defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
- if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
16
  /**
17
  * YIT Plugin Panel for WooCommerce
18
  *
@@ -24,7 +24,6 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
24
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
26
  */
27
-
28
  class YIT_Plugin_Panel_WooCommerce extends YIT_Plugin_Panel {
29
 
30
  /**
@@ -40,13 +39,18 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
40
  /**
41
  * @var array a setting list of parameters
42
  */
43
- public $wc_type = array();
44
 
45
  /**
46
  * @var array
47
  */
48
  protected $_tabs_path_files;
49
 
 
 
 
 
 
50
  /**
51
  * Constructor
52
  *
@@ -56,21 +60,12 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
56
  */
57
  public function __construct( $args = array() ) {
58
 
59
- $this->wc_type = array(
60
- 'checkbox',
61
- 'textarea',
62
- 'multiselect',
63
- 'multi_select_countries',
64
- 'image_width'
65
- );
66
-
67
  $args = apply_filters( 'yit_plugin_fw_wc_panel_option_args', $args );
68
-
69
- if ( ! empty( $args ) ) {
70
  $this->settings = $args;
71
  $this->_tabs_path_files = $this->get_tabs_path_files();
72
 
73
- if( isset( $this->settings['create_menu_page'] ) && $this->settings[ 'create_menu_page'] ){
74
  $this->add_menu_page();
75
  }
76
 
@@ -78,21 +73,42 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
78
  $this->links = $this->settings[ 'links' ];
79
  }
80
 
81
- add_action( 'admin_init', array( $this, 'set_default_options') );
82
  add_action( 'admin_menu', array( $this, 'add_setting_page' ) );
83
  add_action( 'admin_menu', array( $this, 'add_premium_version_upgrade_to_menu' ), 100 );
84
  add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 100 );
85
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
86
  add_action( 'admin_init', array( $this, 'woocommerce_update_options' ) );
87
- add_filter( 'woocommerce_screen_ids', array( $this, 'add_allowed_screen_id' ) );
 
88
  add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'maybe_unserialize_panel_data' ), 10, 3 );
89
 
 
 
 
 
 
 
 
 
90
  /* Add VideoBox and InfoBox */
91
- add_action( 'woocommerce_admin_field_boxinfo', array( $this, 'add_infobox' ), 10, 1 );
92
- add_action( 'woocommerce_admin_field_videobox', array( $this, 'add_videobox' ), 10, 1 );
 
 
93
 
94
  /* WooCommerce 2.4 Support */
95
- add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
 
 
 
 
 
 
 
 
 
 
96
  }
97
  }
98
 
@@ -110,13 +126,13 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
110
  public function yit_panel() {
111
  $additional_info = array(
112
  'current_tab' => $this->get_current_tab(),
113
- 'available_tabs' => $this->settings['admin-tabs'],
114
  'default_tab' => $this->get_available_tabs( true ), //get default tabs
115
- 'page' => $this->settings['page']
116
  );
117
 
118
- $additional_info = apply_filters( 'yith_admin_tab_params', $additional_info );
119
- $additional_info['additional_info'] = $additional_info;
120
 
121
  extract( $additional_info );
122
  require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-panel.php' );
@@ -126,7 +142,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
126
  * Show a input fields to upload images
127
  *
128
  *
129
- * @return void
130
  * @since 1.0
131
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
132
  */
@@ -139,40 +155,41 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
139
  * Show a input fields to upload images
140
  *
141
  *
142
- * @return void
 
143
  * @since 1.0
144
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
145
  */
146
 
147
  public function yit_upload( $args = array() ) {
148
- if ( ! empty( $args ) ) {
149
- $args['value'] = ( get_option($args['id'])) ? get_option($args['id']) : $args['default'];
150
  extract( $args );
151
 
152
  include( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-upload.php' );
153
  }
154
  }
155
 
156
- /**
157
- * Add the plugin woocommerce page settings in the screen ids of woocommerce
158
- *
159
- * @param $screen_ids
160
- *
161
- * @return mixed
162
- * @since 1.0.0
163
- * @author Antonino Scarfì <antonino.scarfi@yithemes.com>
164
- */
165
- public function add_allowed_screen_id( $screen_ids ) {
166
- global $admin_page_hooks;
167
 
168
- if ( ! isset( $admin_page_hooks[ $this->settings['parent_page'] ] ) ) {
169
- return $screen_ids;
170
- }
171
 
172
- $screen_ids[] = $admin_page_hooks[ $this->settings['parent_page'] ] . '_page_' . $this->settings['page'];
173
 
174
- return $screen_ids;
175
- }
176
 
177
  /**
178
  * Returns current active tab slug
@@ -186,11 +203,10 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
186
  global $pagenow;
187
  $tabs = $this->get_available_tabs();
188
 
189
- if ( $pagenow == 'admin.php' && isset( $_REQUEST['tab'] ) && in_array( $_REQUEST['tab'], $tabs ) ) {
190
- return $_REQUEST['tab'];
191
- }
192
- else {
193
- return $tabs[0];
194
  }
195
  }
196
 
@@ -207,8 +223,9 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
207
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
208
  */
209
  public function get_available_tabs( $default = false ) {
210
- $tabs = array_keys( $this->settings['admin-tabs'] );
211
- return $default ? $tabs[0] : $tabs;
 
212
  }
213
 
214
 
@@ -226,11 +243,11 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
226
  $yit_options = $this->get_main_array_options();
227
  $current_tab = $this->get_current_tab();
228
 
229
- if ( ! $current_tab ) {
230
  return;
231
  }
232
 
233
- woocommerce_admin_fields( $yit_options[$current_tab] );
234
  }
235
 
236
  /**
@@ -250,10 +267,10 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
250
  $custom_tab_action = $this->is_custom_tab( $yit_options, $current_tab );
251
 
252
  if ( $custom_tab_action ) {
253
- $this->print_custom_tab( $custom_tab_action);
 
254
  return;
255
- }
256
- else {
257
  require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-form.php' );
258
  }
259
  }
@@ -270,33 +287,33 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
270
  */
271
  public function woocommerce_update_options() {
272
 
273
- if ( isset( $_POST['yit_panel_wc_options_nonce'] ) && wp_verify_nonce( $_POST['yit_panel_wc_options_nonce'], 'yit_panel_wc_options_'.$this->settings['page'] ) ) {
274
 
275
  do_action( 'yit_panel_wc_before_update' );
276
 
277
  $yit_options = $this->get_main_array_options();
278
  $current_tab = $this->get_current_tab();
279
 
280
- if( version_compare( WC()->version, '2.4.0', '>=' ) ) {
281
- if ( ! empty( $yit_options[ $current_tab ] ) ) {
282
  foreach ( $yit_options[ $current_tab ] as $option ) {
283
- if ( isset( $option['id'] ) && isset( $_POST[ $option['id'] ] ) && isset( $option['type' ] ) && ! in_array( $option['type'], $this->wc_type ) ) {
284
- $_POST[ $option['id'] ] = maybe_serialize( $_POST[ $option['id'] ] );
285
  }
286
  }
287
  }
288
  }
289
 
290
- foreach($_POST as $name => $value) {
291
 
292
  // Check if current POST var name ends with a specific needle and make some stuff here
293
  $attachment_id_needle = "-yith-attachment-id";
294
- $is_hidden_input = (($temp = strlen($name) - strlen($attachment_id_needle)) >= 0 && strpos($name, $attachment_id_needle, $temp) !== FALSE);
295
- if ($is_hidden_input){
296
  // Is an input element of type "hidden" coupled with an input element for selecting an element from the media gallery
297
- $yit_options[ $current_tab ][$name] = array(
298
  "type" => "text",
299
- "id" => $name
300
  );
301
  }
302
  }
@@ -305,17 +322,18 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
305
 
306
  do_action( 'yit_panel_wc_after_update' );
307
 
308
- } elseif( isset( $_REQUEST['yit-action'] ) && $_REQUEST['yit-action'] == 'wc-options-reset'
309
- && isset( $_POST['yith_wc_reset_options_nonce'] ) && wp_verify_nonce( $_POST['yith_wc_reset_options_nonce'], 'yith_wc_reset_options_'.$this->settings['page'] )){
 
310
 
311
  do_action( 'yit_panel_wc_before_reset' );
312
-
313
  $yit_options = $this->get_main_array_options();
314
  $current_tab = $this->get_current_tab();
315
 
316
- foreach( $yit_options[ $current_tab ] as $id => $option ){
317
- if( isset( $option['default'] ) ){
318
- update_option( $option['id'], $option['default'] );
319
  }
320
  }
321
 
@@ -330,54 +348,50 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
330
  * @since 1.0
331
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
332
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
 
333
  */
334
  public function admin_enqueue_scripts() {
335
  global $woocommerce, $pagenow;
336
-
337
- $woocommerce_version = function_exists( 'WC' ) ? WC()->version : $woocommerce->version;
338
 
339
- wp_enqueue_style( 'raleway-font', '//fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,100,200,300,900' );
 
 
340
 
341
- wp_enqueue_media();
342
- wp_enqueue_style( 'woocommerce_admin_styles', $woocommerce->plugin_url() . '/assets/css/admin.css', array(), $woocommerce_version );
343
- wp_register_style( 'yit-plugin-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel.css', $woocommerce_version );
344
- wp_register_style( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/css/colorbox.css', array(), $woocommerce_version );
345
- wp_register_style( 'yit-upgrade-to-pro', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrade-to-pro.css', array( 'colorbox' ), $woocommerce_version );
 
 
 
 
 
 
 
 
346
 
347
- if ( 'customize.php' != $pagenow ){
348
- wp_enqueue_style ( 'wp-jquery-ui-dialog' );
349
- }
350
 
351
- wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
352
- wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
 
353
 
354
- $woocommerce_settings_deps = array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris' );
355
-
356
- if( version_compare( '2.5', $woocommerce_version, '<=' ) ){
357
- // WooCommerce > 2.6
358
- $woocommerce_settings_deps[] = 'select2';
359
- }
360
-
361
- else {
362
- // WooCommerce < 2.6
363
- $woocommerce_settings_deps[] = 'jquery-ui-dialog';
364
- $woocommerce_settings_deps[] = 'chosen';
365
  }
366
-
367
- wp_enqueue_script( 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/js/admin/settings.min.js', $woocommerce_settings_deps, $woocommerce_version, true );
368
-
369
- wp_register_script( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/js/jquery.colorbox.js', array( 'jquery' ), '1.6.3', true );
370
- wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.min.js', array( 'jquery', 'jquery-chosen','wp-color-picker', 'jquery-ui-dialog' ), $this->version, true );
371
- wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array(
372
- 'i18n_nav_warning' => __( 'The changes you have made will be lost if you leave this page.', 'yith-plugin-fw' )
373
- ) );
374
-
375
- if( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ){
376
  wp_enqueue_style( 'yit-plugin-style' );
377
  wp_enqueue_script( 'yit-plugin-panel' );
378
  }
379
 
380
- if( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith_upgrade_premium_version' ) !== false ){
381
  wp_enqueue_style( 'yit-upgrade-to-pro' );
382
  wp_enqueue_script( 'colorbox' );
383
  }
@@ -393,25 +407,43 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
393
  * @since 1.0.0
394
  */
395
  public function set_default_options() {
 
 
 
 
 
396
 
397
  $default_options = $this->get_main_array_options();
398
 
399
- foreach ($default_options as $section) {
400
  foreach ( $section as $value ) {
401
- if ( ( isset( $value['std'] ) || isset( $value['default'] ) ) && isset( $value['id'] ) ) {
402
- $default_value = ( isset( $value['default'] ) ) ? $value['default'] : $value['std'];
403
 
404
- if ( $value['type'] == 'image_width' ) {
405
- add_option($value['id'].'_width', $default_value);
406
- add_option($value['id'].'_height', $default_value);
407
  } else {
408
- add_option($value['id'], $default_value);
409
  }
410
  }
411
 
412
  }
413
  }
414
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  }
416
 
417
  /**
@@ -419,12 +451,17 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
419
  *
420
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
421
  * @since 2.0
 
422
  * @param $classes The body classes
423
  *
424
  * @return array Filtered body classes
425
  */
426
- public function admin_body_class( $admin_body_classes ){
427
  global $pagenow;
 
 
 
 
428
  return 'admin.php' == $pagenow && substr_count( $admin_body_classes, 'woocommerce' ) == 0 ? $admin_body_classes .= ' woocommerce ' : $admin_body_classes;
429
  }
430
 
@@ -442,16 +479,16 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
442
  public function maybe_unserialize_panel_data( $value, $option, $raw_value ) {
443
 
444
 
445
- if( ! version_compare( WC()->version, '2.4.0', '>=' ) || ! isset( $option['type' ] ) || in_array( $option['type'], $this->wc_type ) ) {
446
  return $value;
447
  }
448
 
449
  $yit_options = $this->get_main_array_options();
450
  $current_tab = $this->get_current_tab();
451
 
452
- if( ! empty( $yit_options[ $current_tab ] ) ){
453
- foreach( $yit_options[ $current_tab ] as $option_array ){
454
- if( isset( $option_array['id'] ) && isset( $option['id'] ) && $option_array['id'] == $option['id'] ){
455
  return maybe_unserialize( $value );
456
  }
457
  }
@@ -460,5 +497,58 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
460
  return $value;
461
  }
462
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
463
  }
464
- }
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
+ if ( !defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
+ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
16
  /**
17
  * YIT Plugin Panel for WooCommerce
18
  *
24
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
26
  */
 
27
  class YIT_Plugin_Panel_WooCommerce extends YIT_Plugin_Panel {
28
 
29
  /**
39
  /**
40
  * @var array a setting list of parameters
41
  */
42
+ public static $wc_type = array( 'checkbox', 'textarea', 'multiselect', 'multi_select_countries', 'image_width' );
43
 
44
  /**
45
  * @var array
46
  */
47
  protected $_tabs_path_files;
48
 
49
+ /**
50
+ * @var bool
51
+ */
52
+ protected static $_actions_initialized = false;
53
+
54
  /**
55
  * Constructor
56
  *
60
  */
61
  public function __construct( $args = array() ) {
62
 
 
 
 
 
 
 
 
 
63
  $args = apply_filters( 'yit_plugin_fw_wc_panel_option_args', $args );
64
+ if ( !empty( $args ) ) {
 
65
  $this->settings = $args;
66
  $this->_tabs_path_files = $this->get_tabs_path_files();
67
 
68
+ if ( isset( $this->settings[ 'create_menu_page' ] ) && $this->settings[ 'create_menu_page' ] ) {
69
  $this->add_menu_page();
70
  }
71
 
73
  $this->links = $this->settings[ 'links' ];
74
  }
75
 
76
+ add_action( 'admin_init', array( $this, 'set_default_options' ) );
77
  add_action( 'admin_menu', array( $this, 'add_setting_page' ) );
78
  add_action( 'admin_menu', array( $this, 'add_premium_version_upgrade_to_menu' ), 100 );
79
  add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 100 );
80
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
81
  add_action( 'admin_init', array( $this, 'woocommerce_update_options' ) );
82
+ add_filter( 'woocommerce_screen_ids', array( $this, 'add_allowed_screen_id' ) );
83
+
84
  add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'maybe_unserialize_panel_data' ), 10, 3 );
85
 
86
+
87
+ // init actions once to prevent multiple actions
88
+ static::_init_actions();
89
+ }
90
+ }
91
+
92
+ protected static function _init_actions() {
93
+ if ( !static::$_actions_initialized ) {
94
  /* Add VideoBox and InfoBox */
95
+ add_action( 'woocommerce_admin_field_boxinfo', array( __CLASS__, 'add_infobox' ), 10, 1 );
96
+
97
+ /* Add YITH Fields */
98
+ add_action( 'woocommerce_admin_field_yith-field', array( __CLASS__, 'add_yith_field' ), 10, 1 );
99
 
100
  /* WooCommerce 2.4 Support */
101
+ add_filter( 'admin_body_class', array( __CLASS__, 'admin_body_class' ) );
102
+
103
+ add_filter( 'woocommerce_admin_settings_sanitize_option', array( __CLASS__, 'sanitize_option' ), 10, 3 );
104
+
105
+ // sort plugins by name in YITH Plugins menu
106
+ add_action( 'admin_menu', array( __CLASS__, 'sort_plugins' ), 90 );
107
+
108
+ add_filter( 'add_menu_classes', array( __CLASS__, 'add_menu_class_in_yith_plugin' ) );
109
+
110
+
111
+ static::$_actions_initialized = true;
112
  }
113
  }
114
 
126
  public function yit_panel() {
127
  $additional_info = array(
128
  'current_tab' => $this->get_current_tab(),
129
+ 'available_tabs' => $this->settings[ 'admin-tabs' ],
130
  'default_tab' => $this->get_available_tabs( true ), //get default tabs
131
+ 'page' => $this->settings[ 'page' ]
132
  );
133
 
134
+ $additional_info = apply_filters( 'yith_admin_tab_params', $additional_info );
135
+ $additional_info[ 'additional_info' ] = $additional_info;
136
 
137
  extract( $additional_info );
138
  require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-panel.php' );
142
  * Show a input fields to upload images
143
  *
144
  *
145
+ * @return string
146
  * @since 1.0
147
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
148
  */
155
  * Show a input fields to upload images
156
  *
157
  *
158
+ * @param array $args
159
+ *
160
  * @since 1.0
161
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
162
  */
163
 
164
  public function yit_upload( $args = array() ) {
165
+ if ( !empty( $args ) ) {
166
+ $args[ 'value' ] = ( get_option( $args[ 'id' ] ) ) ? get_option( $args[ 'id' ] ) : $args[ 'default' ];
167
  extract( $args );
168
 
169
  include( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-upload.php' );
170
  }
171
  }
172
 
173
+ /**
174
+ * Add the plugin woocommerce page settings in the screen ids of woocommerce
175
+ *
176
+ * @param $screen_ids
177
+ *
178
+ * @return mixed
179
+ * @since 1.0.0
180
+ * @author Antonino Scarfì <antonino.scarfi@yithemes.com>
181
+ */
182
+ public function add_allowed_screen_id( $screen_ids ) {
183
+ global $admin_page_hooks;
184
 
185
+ if ( !isset( $admin_page_hooks[ $this->settings[ 'parent_page' ] ] ) ) {
186
+ return $screen_ids;
187
+ }
188
 
189
+ $screen_ids[] = $admin_page_hooks[ $this->settings[ 'parent_page' ] ] . '_page_' . $this->settings[ 'page' ];
190
 
191
+ return $screen_ids;
192
+ }
193
 
194
  /**
195
  * Returns current active tab slug
203
  global $pagenow;
204
  $tabs = $this->get_available_tabs();
205
 
206
+ if ( $pagenow == 'admin.php' && isset( $_REQUEST[ 'tab' ] ) && in_array( $_REQUEST[ 'tab' ], $tabs ) ) {
207
+ return $_REQUEST[ 'tab' ];
208
+ } else {
209
+ return $tabs[ 0 ];
 
210
  }
211
  }
212
 
223
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
224
  */
225
  public function get_available_tabs( $default = false ) {
226
+ $tabs = array_keys( $this->settings[ 'admin-tabs' ] );
227
+
228
+ return $default ? $tabs[ 0 ] : $tabs;
229
  }
230
 
231
 
243
  $yit_options = $this->get_main_array_options();
244
  $current_tab = $this->get_current_tab();
245
 
246
+ if ( !$current_tab ) {
247
  return;
248
  }
249
 
250
+ woocommerce_admin_fields( $yit_options[ $current_tab ] );
251
  }
252
 
253
  /**
267
  $custom_tab_action = $this->is_custom_tab( $yit_options, $current_tab );
268
 
269
  if ( $custom_tab_action ) {
270
+ $this->print_custom_tab( $custom_tab_action );
271
+
272
  return;
273
+ } else {
 
274
  require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-form.php' );
275
  }
276
  }
287
  */
288
  public function woocommerce_update_options() {
289
 
290
+ if ( isset( $_POST[ 'yit_panel_wc_options_nonce' ] ) && wp_verify_nonce( $_POST[ 'yit_panel_wc_options_nonce' ], 'yit_panel_wc_options_' . $this->settings[ 'page' ] ) ) {
291
 
292
  do_action( 'yit_panel_wc_before_update' );
293
 
294
  $yit_options = $this->get_main_array_options();
295
  $current_tab = $this->get_current_tab();
296
 
297
+ if ( version_compare( WC()->version, '2.4.0', '>=' ) ) {
298
+ if ( !empty( $yit_options[ $current_tab ] ) ) {
299
  foreach ( $yit_options[ $current_tab ] as $option ) {
300
+ if ( isset( $option[ 'id' ] ) && isset( $_POST[ $option[ 'id' ] ] ) && isset( $option[ 'type' ] ) && !in_array( $option[ 'type' ], self::$wc_type ) ) {
301
+ $_POST[ $option[ 'id' ] ] = maybe_serialize( $_POST[ $option[ 'id' ] ] );
302
  }
303
  }
304
  }
305
  }
306
 
307
+ foreach ( $_POST as $name => $value ) {
308
 
309
  // Check if current POST var name ends with a specific needle and make some stuff here
310
  $attachment_id_needle = "-yith-attachment-id";
311
+ $is_hidden_input = ( ( $temp = strlen( $name ) - strlen( $attachment_id_needle ) ) >= 0 && strpos( $name, $attachment_id_needle, $temp ) !== false );
312
+ if ( $is_hidden_input ) {
313
  // Is an input element of type "hidden" coupled with an input element for selecting an element from the media gallery
314
+ $yit_options[ $current_tab ][ $name ] = array(
315
  "type" => "text",
316
+ "id" => $name
317
  );
318
  }
319
  }
322
 
323
  do_action( 'yit_panel_wc_after_update' );
324
 
325
+ } elseif ( isset( $_REQUEST[ 'yit-action' ] ) && $_REQUEST[ 'yit-action' ] == 'wc-options-reset'
326
+ && isset( $_POST[ 'yith_wc_reset_options_nonce' ] ) && wp_verify_nonce( $_POST[ 'yith_wc_reset_options_nonce' ], 'yith_wc_reset_options_' . $this->settings[ 'page' ] )
327
+ ) {
328
 
329
  do_action( 'yit_panel_wc_before_reset' );
330
+
331
  $yit_options = $this->get_main_array_options();
332
  $current_tab = $this->get_current_tab();
333
 
334
+ foreach ( $yit_options[ $current_tab ] as $id => $option ) {
335
+ if ( isset( $option[ 'default' ] ) ) {
336
+ update_option( $option[ 'id' ], $option[ 'default' ] );
337
  }
338
  }
339
 
348
  * @since 1.0
349
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
350
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
351
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
352
  */
353
  public function admin_enqueue_scripts() {
354
  global $woocommerce, $pagenow;
 
 
355
 
356
+ if ( 'customize.php' != $pagenow ) {
357
+ wp_enqueue_style( 'wp-jquery-ui-dialog' );
358
+ }
359
 
360
+ // enqueue styles only in the current panel page
361
+ if ( 'admin.php' === $pagenow && strpos( get_current_screen()->id, $this->settings[ 'page' ] ) !== false ) {
362
+ $woocommerce_version = function_exists( 'WC' ) ? WC()->version : $woocommerce->version;
363
+ $woocommerce_settings_deps = array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris' );
364
+
365
+ if ( version_compare( '2.5', $woocommerce_version, '<=' ) ) {
366
+ // WooCommerce > 2.6
367
+ $woocommerce_settings_deps[] = 'select2';
368
+ } else {
369
+ // WooCommerce < 2.6
370
+ $woocommerce_settings_deps[] = 'jquery-ui-dialog';
371
+ $woocommerce_settings_deps[] = 'chosen';
372
+ }
373
 
374
+ wp_enqueue_media();
 
 
375
 
376
+ wp_enqueue_style( 'yith-plugin-fw-fields' );
377
+ wp_enqueue_style( 'woocommerce_admin_styles' );
378
+ wp_enqueue_style( 'raleway-font' );
379
 
380
+ wp_enqueue_script( 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/js/admin/settings.min.js', $woocommerce_settings_deps, $woocommerce_version, true );
381
+ wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array(
382
+ 'i18n_nav_warning' => __( 'The changes you have made will be lost if you leave this page.', 'yith-plugin-fw' )
383
+ ) );
384
+
385
+ wp_enqueue_script( 'yith-plugin-fw-fields' );
 
 
 
 
 
386
  }
387
+
388
+ if ( 'admin.php' === $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) {
389
+ wp_enqueue_media();
 
 
 
 
 
 
 
390
  wp_enqueue_style( 'yit-plugin-style' );
391
  wp_enqueue_script( 'yit-plugin-panel' );
392
  }
393
 
394
+ if ( 'admin.php' === $pagenow && strpos( get_current_screen()->id, 'yith_upgrade_premium_version' ) !== false ) {
395
  wp_enqueue_style( 'yit-upgrade-to-pro' );
396
  wp_enqueue_script( 'colorbox' );
397
  }
407
  * @since 1.0.0
408
  */
409
  public function set_default_options() {
410
+ // check if the default options for this panel are already set
411
+ $page = $this->settings[ 'page' ];
412
+ $default_options_set = get_option( 'yit_plugin_fw_panel_wc_default_options_set', array() );
413
+ if ( isset( $default_options_set[ $page ] ) && $default_options_set[ $page ] )
414
+ return;
415
 
416
  $default_options = $this->get_main_array_options();
417
 
418
+ foreach ( $default_options as $section ) {
419
  foreach ( $section as $value ) {
420
+ if ( ( isset( $value[ 'std' ] ) || isset( $value[ 'default' ] ) ) && isset( $value[ 'id' ] ) ) {
421
+ $default_value = ( isset( $value[ 'default' ] ) ) ? $value[ 'default' ] : $value[ 'std' ];
422
 
423
+ if ( $value[ 'type' ] == 'image_width' ) {
424
+ add_option( $value[ 'id' ] . '_width', $default_value );
425
+ add_option( $value[ 'id' ] . '_height', $default_value );
426
  } else {
427
+ add_option( $value[ 'id' ], $default_value );
428
  }
429
  }
430
 
431
  }
432
  }
433
 
434
+ // set the flag for the default options of this panel
435
+ $default_options_set[ $page ] = true;
436
+ update_option( 'yit_plugin_fw_panel_wc_default_options_set', $default_options_set );
437
+ }
438
+
439
+ /**
440
+ * Delete the "default options added" option
441
+ *
442
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
443
+ *
444
+ */
445
+ public static function delete_default_options_set_option() {
446
+ delete_option( 'yit_plugin_fw_panel_wc_default_options_set' );
447
  }
448
 
449
  /**
451
  *
452
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
453
  * @since 2.0
454
+ *
455
  * @param $classes The body classes
456
  *
457
  * @return array Filtered body classes
458
  */
459
+ public static function admin_body_class( $admin_body_classes ) {
460
  global $pagenow;
461
+
462
+ if ( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) )
463
+ $admin_body_classes = substr_count( $admin_body_classes, ' yith-plugin-fw-panel ' ) == 0 ? $admin_body_classes . ' yith-plugin-fw-panel ' : $admin_body_classes;
464
+
465
  return 'admin.php' == $pagenow && substr_count( $admin_body_classes, 'woocommerce' ) == 0 ? $admin_body_classes .= ' woocommerce ' : $admin_body_classes;
466
  }
467
 
479
  public function maybe_unserialize_panel_data( $value, $option, $raw_value ) {
480
 
481
 
482
+ if ( !version_compare( WC()->version, '2.4.0', '>=' ) || !isset( $option[ 'type' ] ) || in_array( $option[ 'type' ], self::$wc_type ) ) {
483
  return $value;
484
  }
485
 
486
  $yit_options = $this->get_main_array_options();
487
  $current_tab = $this->get_current_tab();
488
 
489
+ if ( !empty( $yit_options[ $current_tab ] ) ) {
490
+ foreach ( $yit_options[ $current_tab ] as $option_array ) {
491
+ if ( isset( $option_array[ 'id' ] ) && isset( $option[ 'id' ] ) && $option_array[ 'id' ] == $option[ 'id' ] ) {
492
  return maybe_unserialize( $value );
493
  }
494
  }
497
  return $value;
498
  }
499
 
500
+ /**
501
+ * Sanitize Option
502
+ *
503
+ * @param $value mixed Option value
504
+ * @param $option mixed Option settings array
505
+ * @param $raw_value string Raw option value
506
+ *
507
+ * @return mixed Filtered return value
508
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
509
+ * @since 3.0.0
510
+ */
511
+ public static function sanitize_option( $value, $option, $raw_value ) {
512
+ if ( isset( $option[ 'type' ] ) && 'yith-field' === $option[ 'type' ] ) {
513
+ // set empty array if is multiple
514
+ if ( !empty( $option[ 'multiple' ] ) && is_null( $value ) ) {
515
+ $value = array();
516
+ }
517
+
518
+ // sanitize the option for the checkbox field: 'yes' or 'no'
519
+ if ( isset( $option[ 'yith-type' ] ) && in_array( $option[ 'yith-type' ], array( 'checkbox', 'onoff' ) ) ) {
520
+ $value = yith_plugin_fw_is_true( $raw_value ) ? 'yes' : 'no';
521
+ }
522
+
523
+ if ( isset( $option[ 'yith-type' ] ) && in_array( $option[ 'yith-type' ], array( 'textarea-editor', 'textarea-codemirror' ) ) ) {
524
+ $value = $raw_value;
525
+ }
526
+ }
527
+
528
+ return $value;
529
+ }
530
+
531
+ /**
532
+ * Add YITH Fields
533
+ *
534
+ * @param array $field
535
+ *
536
+ * @return void
537
+ * @since 3.0.0
538
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
539
+ */
540
+ public static function add_yith_field( $field = array() ) {
541
+ if ( !empty( $field ) && isset( $field[ 'yith-type' ] ) ) {
542
+ $field[ 'type' ] = $field[ 'yith-type' ];
543
+ unset( $field[ 'yith-type' ] );
544
+
545
+ $field[ 'id' ] = isset( $field[ 'id' ] ) ? $field[ 'id' ] : '';
546
+ $field[ 'name' ] = $field[ 'id' ];
547
+ $field[ 'default' ] = isset( $field[ 'default' ] ) ? $field[ 'default' ] : '';
548
+ $field[ 'value' ] = WC_Admin_Settings::get_option( $field[ 'id' ], $field[ 'default' ] );
549
+
550
+ require( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-option-row.php' );
551
+ }
552
+ }
553
  }
554
+ }
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -8,11 +8,11 @@
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
- if ( ! defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
- if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
16
  /**
17
  * YIT Plugin Panel
18
  *
@@ -23,7 +23,6 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
23
  * @since 1.0
24
  * @author Your Inspiration Themes
25
  */
26
-
27
  class YIT_Plugin_Panel {
28
 
29
  /**
@@ -51,25 +50,30 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
51
  */
52
  public $links;
53
 
54
- /**
55
- * Constructor
56
- *
57
- * @since 1.0
58
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
59
- *
60
- * @param array $args
61
- */
 
 
 
 
 
62
  public function __construct( $args = array() ) {
63
 
64
- if ( ! empty( $args ) ) {
65
 
66
  $default_args = array(
67
  'parent_slug' => 'edit.php?',
68
  'page_title' => __( 'Plugin Settings', 'yith-plugin-fw' ),
69
  'menu_title' => __( 'Settings', 'yith-plugin-fw' ),
70
  'capability' => 'manage_options',
71
- 'icon_url' => '',
72
- 'position' => null
73
  );
74
 
75
  $args = apply_filters( 'yit_plugin_fw_panel_option_args', wp_parse_args( $args, $default_args ) );
@@ -77,7 +81,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
77
  $this->settings = $args;
78
  $this->_tabs_path_files = $this->get_tabs_path_files();
79
 
80
- if ( isset( $this->settings['create_menu_page'] ) && $this->settings['create_menu_page'] ) {
81
  $this->add_menu_page();
82
  }
83
 
@@ -90,11 +94,51 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
90
  add_action( 'admin_menu', array( $this, 'add_premium_version_upgrade_to_menu' ), 100 );
91
  add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 100 );
92
  add_action( 'admin_init', array( $this, 'add_fields' ) );
 
 
 
93
  }
94
 
95
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
96
  }
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /**
99
  * Add Menu page link
100
  *
@@ -103,12 +147,15 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
103
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
104
  */
105
  public function add_menu_page() {
106
- global $admin_page_hooks;
 
 
 
 
 
107
 
108
- if( ! isset( $admin_page_hooks['yit_plugin_panel'] ) ){
109
- $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
110
  // YITH Plugins text must not be translated
111
- apply_filters('yit_plugin_panel_menu_page_capability', current_user_can( 'manage_options' )) && add_menu_page( 'yit_plugin_panel', 'YITH Plugins', 'manage_options', 'yit_plugin_panel', NULL, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
112
  }
113
  }
114
 
@@ -134,41 +181,33 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
134
  * @return void
135
  * @since 1.0
136
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
 
137
  */
138
  public function admin_enqueue_scripts() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
 
140
- global $wp_scripts, $pagenow;
141
-
142
- //scripts
143
- wp_enqueue_media();
144
- wp_enqueue_script( 'jquery-ui' );
145
- wp_enqueue_script( 'jquery-ui-core' );
146
- wp_enqueue_script( 'jquery-ui-slider' );
147
- wp_enqueue_script( 'jquery-ui-dialog' );
148
- wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
149
- wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.js', array( 'jquery', 'jquery-chosen','wp-color-picker'), $this->version, true );
150
- wp_register_script( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/codemirror.js', array( 'jquery' ), $this->version, true );
151
- wp_register_script( 'codemirror-javascript', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/javascript.js', array( 'jquery', 'codemirror' ), $this->version, true );
152
- wp_register_script( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/js/jquery.colorbox.js', array( 'jquery' ), '1.6.3', true );
153
- wp_enqueue_script( 'yith_how_to', YIT_CORE_PLUGIN_URL . '/assets/js/how-to.js', array('jquery'), $this->version, true );
154
-
155
- //styles
156
- $jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
157
- wp_register_style( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/css/codemirror/codemirror.css' );
158
- wp_enqueue_style( 'jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-custom/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all' );
159
- wp_register_style( 'yit-plugin-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel.css', array(), $this->version );
160
- wp_enqueue_style( 'raleway-font', '//fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,100,200,300,900' );
161
- wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
162
- wp_enqueue_style( 'yit-jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
163
- wp_register_style( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/css/colorbox.css', array(), $this->version );
164
- wp_register_style( 'yit-upgrade-to-pro', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrade-to-pro.css', array( 'colorbox' ), $this->version );
165
-
166
- if( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) || apply_filters( 'yit_plugin_panel_asset_loading', false ) ){
167
- wp_enqueue_style( 'yit-plugin-style' );
168
- wp_enqueue_script( 'yit-plugin-panel' );
169
- }
170
-
171
- if( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith_upgrade_premium_version' ) !== false ){
172
  wp_enqueue_style( 'yit-upgrade-to-pro' );
173
  wp_enqueue_script( 'colorbox' );
174
  }
@@ -185,7 +224,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
185
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
186
  */
187
  public function register_settings() {
188
- register_setting( 'yit_' . $this->settings['parent'] . '_options', 'yit_' . $this->settings['parent'] . '_options', array( $this, 'options_validate' ) );
189
  }
190
 
191
  /**
@@ -201,46 +240,41 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
201
  */
202
  public function options_validate( $input ) {
203
 
204
- $current_tab = ! empty( $input['current_tab'] ) ? $input['current_tab'] : 'general';
205
 
206
  $yit_options = $this->get_main_array_options();
207
 
208
  // default
209
  $valid_input = $this->get_options();
210
 
211
- $submit = ( ! empty( $input['submit-general'] ) ? true : false );
212
- $reset = ( ! empty( $input['reset-general'] ) ? true : false );
213
 
214
- foreach ( $yit_options[$current_tab] as $section => $data ) {
215
  foreach ( $data as $option ) {
216
- if ( isset( $option['sanitize_call'] ) && isset( $option['id'] ) ) { //yiw_debug($option, false);
217
- if ( is_array( $option['sanitize_call'] ) ) :
218
- foreach ( $option['sanitize_call'] as $callback ) {
219
- if ( is_array( $input[$option['id']] ) ) {
220
- $valid_input[$option['id']] = array_map( $callback, $input[$option['id']] );
221
- }
222
- else {
223
- $valid_input[$option['id']] = call_user_func( $callback, $input[$option['id']] );
224
  }
225
  }
226
  else :
227
- if ( is_array( $input[$option['id']] ) ) {
228
- $valid_input[$option['id']] = array_map( $option['sanitize_call'], $input[$option['id']] );
229
- }
230
- else {
231
- $valid_input[$option['id']] = call_user_func( $option['sanitize_call'], $input[$option['id']] );
232
  }
233
  endif;
234
- }
235
- else {
236
- if ( isset( $option['id'] ) ) {
237
- if ( isset( $input[$option['id']] ) ) {
238
- $valid_input[$option['id']] = $input[$option['id']];
239
- }
240
- else {
241
- $valid_input[$option['id']] = 'no';
242
  }
243
-
244
  }
245
  }
246
 
@@ -260,15 +294,15 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
260
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
261
  */
262
  public function add_setting_page() {
263
- $this->settings['icon_url'] = isset( $this->settings['icon_url'] ) ? $this->settings['icon_url'] : '';
264
- $this->settings['position'] = isset( $this->settings['position'] ) ? $this->settings['position'] : null;
265
- $parent = $this->settings['parent_slug'] . $this->settings['parent_page'];
266
-
267
- if ( ! empty( $parent ) ) {
268
- add_submenu_page( $parent, $this->settings['page_title'], $this->settings['menu_title'], $this->settings['capability'], $this->settings['page'], array( $this, 'yit_panel' ) );
269
- } else {
270
- add_menu_page( $this->settings['page_title'], $this->settings['menu_title'], $this->settings['capability'], $this->settings['page'], array( $this, 'yit_panel' ), $this->settings['icon_url'], $this->settings['position'] );
271
- }
272
  /* === Duplicate Items Hack === */
273
  $this->remove_duplicate_submenu_page();
274
  do_action( 'yit_after_add_settings_page' );
@@ -283,11 +317,11 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
283
  * @since 2.9.13
284
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
285
  */
286
- public function add_premium_version_upgrade_to_menu(){
287
  global $submenu;
288
 
289
- if( apply_filters( 'yit_show_upgrade_to_premium_version', ! isset( $submenu['yit_plugin_panel']['how_to'] ) ) ){
290
- $submenu['yit_plugin_panel']['how_to'] = array(
291
  sprintf( '%s%s%s', '<span id="yith-how-to-premium">', __( 'How to install premium version', 'yith-plugin-fw' ), '</span>' ),
292
  'install_plugins',
293
  '//support.yithemes.com/hc/en-us/articles/217840988',
@@ -312,59 +346,60 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
312
  $yit_options = $this->get_main_array_options();
313
 
314
  // tabs
315
- foreach ( $this->settings['admin-tabs'] as $tab => $tab_value ) {
316
  $active_class = ( $current_tab == $tab ) ? ' nav-tab-active' : '';
317
- $tabs .= '<a class="nav-tab' . $active_class . '" href="?' . $this->settings['parent_page'] . '&page=' . $this->settings['page'] . '&tab=' . $tab . '">' . $tab_value . '</a>';
318
  }
319
  ?>
320
- <div id="icon-themes" class="icon32"><br /></div>
321
- <h2 class="yith nav-tab-wrapper">
322
  <?php echo $tabs ?>
323
  </h2>
324
  <?php
325
  $custom_tab_action = $this->is_custom_tab( $yit_options, $current_tab );
326
  if ( $custom_tab_action ) {
327
  $this->print_custom_tab( $custom_tab_action );
 
328
  return;
329
  }
330
  ?>
331
- <?php $this->print_video_box(); ?>
332
  <?php
333
  $panel_content_class = apply_filters( 'yit_admin_panel_content_class', 'yit-admin-panel-content-wrap' );
334
  ?>
335
- <div id="wrap" class="plugin-option yit-admin-panel-container">
336
  <?php $this->message(); ?>
337
  <div class="<?php echo $panel_content_class; ?>">
338
- <h2><?php echo $this->get_tab_title() ?></h2>
339
- <?php if ( $this->is_show_form() ) : ?>
340
- <form method="post" action="options.php">
341
- <?php do_settings_sections( 'yit' ); ?>
 
 
 
 
 
 
 
 
 
 
 
342
  <p>&nbsp;</p>
343
- <?php settings_fields( 'yit_' . $this->settings['parent'] . '_options' ); ?>
344
- <input type="hidden" name="<?php echo $this->get_name_field( 'current_tab' ) ?>" value="<?php echo esc_attr( $current_tab ) ?>" />
345
- <input type="submit" class="button-primary" value="<?php _e( 'Save Changes', 'yith-plugin-fw' ) ?>" style="float:left;margin-right:10px;" />
346
- </form>
347
- <form method="post">
348
- <?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
349
- <input type="hidden" name="yit-action" value="reset" />
350
- <input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset to default', 'yith-plugin-fw' ) ?>" onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');" />
351
- </form>
352
- <p>&nbsp;</p>
353
- <?php endif ?>
354
  </div>
355
  </div>
356
- <?php
357
  }
358
 
359
  public function is_custom_tab( $options, $current_tab ) {
360
- foreach ( $options[$current_tab] as $section => $option ) {
361
- if ( isset( $option['type'] ) && isset( $option['action'] ) && 'custom_tab' == $option['type'] && ! empty( $option['action'] ) ) {
362
- return $option['action'];
363
- }
364
- else {
365
  return false;
366
  }
367
  }
 
368
  return false;
369
  }
370
 
@@ -379,7 +414,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
379
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
380
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
381
  */
382
- public function print_custom_tab( $action) {
383
  do_action( $action );
384
  }
385
 
@@ -396,14 +431,14 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
396
  $yit_options = $this->get_main_array_options();
397
  $current_tab = $this->get_current_tab();
398
 
399
- if ( ! $current_tab ) {
400
  return;
401
  }
402
- foreach ( $yit_options[$current_tab] as $section => $data ) {
403
  add_settings_section( "yit_settings_{$current_tab}_{$section}", $this->get_section_title( $section ), $this->get_section_description( $section ), 'yit' );
404
  foreach ( $data as $option ) {
405
- if ( isset( $option['id'] ) && isset( $option['type'] ) && isset( $option['name'] ) ) {
406
- add_settings_field( "yit_setting_" . $option['id'], $option['name'], array( $this, 'render_field' ), 'yit', "yit_settings_{$current_tab}_{$section}", array( 'option' => $option, 'label_for' => $this->get_id_field( $option['id'] ) ) );
407
  }
408
  }
409
  }
@@ -423,19 +458,19 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
423
 
424
  global $wp_admin_bar;
425
 
426
- if ( ! current_user_can( 'manage_options' ) ) {
427
  return;
428
  }
429
 
430
- if ( ! empty( $this->settings['admin_tabs'] ) ) {
431
- foreach ( $this->settings['admin-tabs'] as $item => $title ) {
432
 
433
  $wp_admin_bar->add_menu( array(
434
- 'parent' => $this->settings['parent'],
435
- 'title' => $title,
436
- 'id' => $this->settings['parent'] . '-' . $item,
437
- 'href' => admin_url( 'themes.php' ) . '?page=' . $this->settings['parent_page'] . '&tab=' . $item
438
- ) );
439
  }
440
  }
441
  }
@@ -451,21 +486,18 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
451
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
452
  */
453
  function get_current_tab() {
454
- $admin_tabs = array_keys( $this->settings['admin-tabs'] );
455
 
456
- if ( ! isset( $_GET['page'] ) || $_GET['page'] != $this->settings['page'] ) {
457
  return false;
458
  }
459
- if ( isset( $_REQUEST['yit_tab_options'] ) ) {
460
- return $_REQUEST['yit_tab_options'];
461
- }
462
- elseif ( isset( $_GET['tab'] ) && isset( $this->_tabs_path_files[$_GET['tab']] ) ) {
463
- return $_GET['tab'];
464
- }
465
- elseif ( isset( $admin_tabs[0] ) ) {
466
- return $admin_tabs[0];
467
- }
468
- else {
469
  return 'general';
470
  }
471
  }
@@ -498,8 +530,8 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
498
  );
499
 
500
  foreach ( $message as $key => $value ) {
501
- if ( isset( $_GET[$key] ) ) {
502
- echo $message[$key];
503
  }
504
  }
505
 
@@ -523,6 +555,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
523
  if ( $echo ) {
524
  echo $message;
525
  }
 
526
  return $message;
527
  }
528
 
@@ -538,20 +571,20 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
538
  */
539
  function get_tabs_path_files() {
540
 
541
- $option_files_path = $this->settings['options-path'] . '/';
542
 
543
  $tabs = array();
544
 
545
  foreach ( ( array ) glob( $option_files_path . '*.php' ) as $filename ) {
546
  preg_match( '/(.*)-options\.(.*)/', basename( $filename ), $filename_parts );
547
 
548
- if ( ! isset( $filename_parts[1] ) ) {
549
- continue;
550
- }
551
 
552
- $tab = $filename_parts[1];
553
 
554
- $tabs[$tab] = $filename;
555
  }
556
 
557
  return $tabs;
@@ -567,12 +600,12 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
567
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
568
  */
569
  function get_main_array_options() {
570
- if ( ! empty( $this->_main_array_options ) ) {
571
  return $this->_main_array_options;
572
  }
573
 
574
- foreach ( $this->settings['admin-tabs'] as $item => $v ) {
575
- $path = $this->settings['options-path'] . '/' . $item . '-options.php';
576
  if ( file_exists( $path ) ) {
577
  $this->_main_array_options = array_merge( $this->_main_array_options, include $path );
578
  }
@@ -598,14 +631,15 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
598
  foreach ( $yit_options as $tab => $sections ) {
599
  foreach ( $sections as $section ) {
600
  foreach ( $section as $id => $value ) {
601
- if ( isset( $value['std'] ) && isset( $value['id'] ) ) {
602
- $default_options[$value['id']] = $value['std'];
603
  }
604
  }
605
  }
606
  }
607
 
608
  unset( $yit_options );
 
609
  return $default_options;
610
  }
611
 
@@ -623,10 +657,10 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
623
  $yit_options = $this->get_main_array_options();
624
  $current_tab = $this->get_current_tab();
625
 
626
- foreach ( $yit_options[$current_tab] as $sections => $data ) {
627
  foreach ( $data as $option ) {
628
- if ( isset( $option['type'] ) && $option['type'] == 'title' ) {
629
- return $option['name'];
630
  }
631
  }
632
  }
@@ -647,9 +681,9 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
647
  $yit_options = $this->get_main_array_options();
648
  $current_tab = $this->get_current_tab();
649
 
650
- foreach ( $yit_options[$current_tab][$section] as $option ) {
651
- if ( isset( $option['type'] ) && $option['type'] == 'section' ) {
652
- return $option['name'];
653
  }
654
  }
655
  }
@@ -669,9 +703,9 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
669
  $yit_options = $this->get_main_array_options();
670
  $current_tab = $this->get_current_tab();
671
 
672
- foreach ( $yit_options[$current_tab][$section] as $option ) {
673
- if ( isset( $option['type'] ) && $option['type'] == 'section' && isset( $option['desc'] ) ) {
674
- return '<p>' . $option['desc'] . '</p>';
675
  }
676
  }
677
  }
@@ -690,15 +724,14 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
690
  $yit_options = $this->get_main_array_options();
691
  $current_tab = $this->get_current_tab();
692
 
693
- foreach ( $yit_options[$current_tab] as $sections => $data ) {
694
  foreach ( $data as $option ) {
695
- if ( ! isset( $option['type'] ) || $option['type'] != 'title' ) {
696
  continue;
697
  }
698
- if ( isset( $option['showform'] ) ) {
699
- return $option['showform'];
700
- }
701
- else {
702
  return true;
703
  }
704
  }
@@ -717,7 +750,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
717
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
718
  */
719
  function get_name_field( $name = '' ) {
720
- return 'yit_' . $this->settings['parent'] . '_options[' . $name . ']';
721
  }
722
 
723
  /**
@@ -732,7 +765,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
732
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
733
  */
734
  function get_id_field( $id ) {
735
- return 'yit_' . $this->settings['parent'] . '_options_' . $id;
736
  }
737
 
738
 
@@ -750,30 +783,32 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
750
  */
751
  function render_field( $param ) {
752
 
753
- if ( ! empty( $param ) && isset( $param ['option'] ) ) {
754
- $option = $param ['option'];
755
  $db_options = $this->get_options();
756
 
757
  $custom_attributes = array();
758
 
759
- if ( ! empty( $option['custom_attributes'] ) && is_array( $option['custom_attributes'] ) ) {
760
- foreach ( $option['custom_attributes'] as $attribute => $attribute_value ) {
761
  $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
762
  }
763
  }
764
 
765
  $custom_attributes = implode( ' ', $custom_attributes );
766
- $std = isset( $option['std'] ) ? $option['std'] : '';
767
- $db_value = ( isset( $db_options[$option['id']] ) ) ? $db_options[$option['id']] : $std;
768
 
769
- if ( isset( $option['deps'] ) ) {
770
- $deps = $option['deps'];
771
- }
772
- $type = YIT_CORE_PLUGIN_PATH . '/templates/panel/types/' . $option['type'] . '.php';
773
- if ( file_exists( $type ) ) {
774
- include $type;
775
- }
776
- else {
 
 
777
  do_action( "yit_panel_{$option['type']}", $option, $db_value, $custom_attributes );
778
  }
779
  }
@@ -790,10 +825,11 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
790
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
791
  */
792
  public function get_options() {
793
- $options = get_option( 'yit_' . $this->settings['parent'] . '_options' );
794
- if ( $options === false || ( isset( $_REQUEST['yit-action'] ) && $_REQUEST['yit-action'] == 'reset' ) ) {
795
  $options = $this->get_default_options();
796
  }
 
797
  return $options;
798
  }
799
 
@@ -807,8 +843,8 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
807
  * @since 1.0
808
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
809
  */
810
- public function add_infobox( $args = array() ) {
811
- if ( ! empty( $args ) ) {
812
  extract( $args );
813
  require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/boxinfo.php' );
814
  }
@@ -817,36 +853,73 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
817
  /**
818
  * Show a box panel with specific content in two columns as a new woocommerce type
819
  *
 
 
820
  * @param array $args
821
  *
822
  * @return void
823
- * @since 1.0
824
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
825
  */
826
- public function add_videobox( $args = array() ) {
827
- if ( ! empty( $args ) ) {
828
- extract( $args );
829
- require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/videobox.php' );
830
- }
831
  }
832
 
833
- /**
834
- * Fire the action to print the custom tab
835
- *
836
- * @return void
837
- * @since 1.0
838
- * @author Antonino Scarfì <antonino.scarfi@yithemes.com>
839
- */
840
- public function print_video_box() {
841
- $file = $this->settings['options-path'] . '/video-box.php';
 
 
 
 
 
 
 
 
 
 
 
842
 
843
- if ( ! file_exists( $file ) ) {
844
- return;
845
- }
846
 
847
- $args = include_once( $file );
 
 
848
 
849
- $this->add_videobox( $args );
850
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
851
  }
852
- }
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
+ if ( !defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
+ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
16
  /**
17
  * YIT Plugin Panel
18
  *
23
  * @since 1.0
24
  * @author Your Inspiration Themes
25
  */
 
26
  class YIT_Plugin_Panel {
27
 
28
  /**
50
  */
51
  public $links;
52
 
53
+ /**
54
+ * @var bool
55
+ */
56
+ protected static $_actions_initialized = false;
57
+
58
+ /**
59
+ * Constructor
60
+ *
61
+ * @since 1.0
62
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
63
+ *
64
+ * @param array $args
65
+ */
66
  public function __construct( $args = array() ) {
67
 
68
+ if ( !empty( $args ) ) {
69
 
70
  $default_args = array(
71
  'parent_slug' => 'edit.php?',
72
  'page_title' => __( 'Plugin Settings', 'yith-plugin-fw' ),
73
  'menu_title' => __( 'Settings', 'yith-plugin-fw' ),
74
  'capability' => 'manage_options',
75
+ 'icon_url' => '',
76
+ 'position' => null
77
  );
78
 
79
  $args = apply_filters( 'yit_plugin_fw_panel_option_args', wp_parse_args( $args, $default_args ) );
81
  $this->settings = $args;
82
  $this->_tabs_path_files = $this->get_tabs_path_files();
83
 
84
+ if ( isset( $this->settings[ 'create_menu_page' ] ) && $this->settings[ 'create_menu_page' ] ) {
85
  $this->add_menu_page();
86
  }
87
 
94
  add_action( 'admin_menu', array( $this, 'add_premium_version_upgrade_to_menu' ), 100 );
95
  add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 100 );
96
  add_action( 'admin_init', array( $this, 'add_fields' ) );
97
+
98
+ // init actions once to prevent multiple actions
99
+ static::_init_actions();
100
  }
101
 
102
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
103
  }
104
 
105
+ /**
106
+ * Init actions once to prevent multiple actions
107
+ *
108
+ * @since 3.0.0
109
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
110
+ */
111
+ protected static function _init_actions() {
112
+ if ( !static::$_actions_initialized ) {
113
+ add_filter( 'admin_body_class', array( __CLASS__, 'add_body_class' ) );
114
+
115
+ // sort plugins by name in YITH Plugins menu
116
+ add_action( 'admin_menu', array( __CLASS__, 'sort_plugins' ), 90 );
117
+ add_filter( 'add_menu_classes', array( __CLASS__, 'add_menu_class_in_yith_plugin' ) );
118
+
119
+
120
+ static::$_actions_initialized = true;
121
+ }
122
+ }
123
+
124
+ /**
125
+ * Add yith-plugin-fw-panel in body classes in Panel pages
126
+ *
127
+ * @param $admin_body_classes
128
+ *
129
+ * @since 3.0.0
130
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
131
+ *
132
+ * @return string
133
+ */
134
+ public static function add_body_class( $admin_body_classes ) {
135
+ global $pagenow;
136
+ if ( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) )
137
+ $admin_body_classes = substr_count( $admin_body_classes, ' yith-plugin-fw-panel ' ) == 0 ? $admin_body_classes . ' yith-plugin-fw-panel ' : $admin_body_classes;
138
+
139
+ return $admin_body_classes;
140
+ }
141
+
142
  /**
143
  * Add Menu page link
144
  *
147
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
148
  */
149
  public function add_menu_page() {
150
+ global $admin_page_hooks;
151
+
152
+ if ( !isset( $admin_page_hooks[ 'yit_plugin_panel' ] ) ) {
153
+ $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
154
+ $capability = apply_filters( 'yit_plugin_panel_menu_page_capability', 'manage_options' );
155
+ $show = apply_filters( 'yit_plugin_panel_menu_page_show', true );
156
 
 
 
157
  // YITH Plugins text must not be translated
158
+ !!$show && add_menu_page( 'yit_plugin_panel', 'YITH Plugins', $capability, 'yit_plugin_panel', null, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
159
  }
160
  }
161
 
181
  * @return void
182
  * @since 1.0
183
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
184
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
185
  */
186
  public function admin_enqueue_scripts() {
187
+ global $pagenow;
188
+
189
+ // enqueue styles only in the current panel page
190
+ if ( 'admin.php' === $pagenow && strpos( get_current_screen()->id, $this->settings[ 'page' ] ) !== false || apply_filters( 'yit_plugin_panel_asset_loading', false ) ) {
191
+ wp_enqueue_media();
192
+
193
+ wp_enqueue_style( 'yith-plugin-fw-fields' );
194
+ wp_enqueue_style( 'yit-jquery-ui-style' );
195
+ wp_enqueue_style( 'raleway-font' );
196
+
197
+ wp_enqueue_script( 'jquery-ui' );
198
+ wp_enqueue_script( 'jquery-ui-core' );
199
+ wp_enqueue_script( 'jquery-ui-dialog' );
200
+ wp_enqueue_script( 'yith_how_to' );
201
+ wp_enqueue_script( 'yith-plugin-fw-fields' );
202
+ }
203
 
204
+ if ( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) || apply_filters( 'yit_plugin_panel_asset_loading', false ) ) {
205
+ wp_enqueue_media();
206
+ wp_enqueue_style( 'yit-plugin-style' );
207
+ wp_enqueue_script( 'yit-plugin-panel' );
208
+ }
209
+
210
+ if ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith_upgrade_premium_version' ) !== false ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
  wp_enqueue_style( 'yit-upgrade-to-pro' );
212
  wp_enqueue_script( 'colorbox' );
213
  }
224
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
225
  */
226
  public function register_settings() {
227
+ register_setting( 'yit_' . $this->settings[ 'parent' ] . '_options', 'yit_' . $this->settings[ 'parent' ] . '_options', array( $this, 'options_validate' ) );
228
  }
229
 
230
  /**
240
  */
241
  public function options_validate( $input ) {
242
 
243
+ $current_tab = !empty( $input[ 'current_tab' ] ) ? $input[ 'current_tab' ] : 'general';
244
 
245
  $yit_options = $this->get_main_array_options();
246
 
247
  // default
248
  $valid_input = $this->get_options();
249
 
250
+ $submit = ( !empty( $input[ 'submit-general' ] ) ? true : false );
251
+ $reset = ( !empty( $input[ 'reset-general' ] ) ? true : false );
252
 
253
+ foreach ( $yit_options[ $current_tab ] as $section => $data ) {
254
  foreach ( $data as $option ) {
255
+ if ( isset( $option[ 'sanitize_call' ] ) && isset( $option[ 'id' ] ) ) { //yiw_debug($option, false);
256
+ if ( is_array( $option[ 'sanitize_call' ] ) ) :
257
+ foreach ( $option[ 'sanitize_call' ] as $callback ) {
258
+ if ( is_array( $input[ $option[ 'id' ] ] ) ) {
259
+ $valid_input[ $option[ 'id' ] ] = array_map( $callback, $input[ $option[ 'id' ] ] );
260
+ } else {
261
+ $valid_input[ $option[ 'id' ] ] = call_user_func( $callback, $input[ $option[ 'id' ] ] );
 
262
  }
263
  }
264
  else :
265
+ if ( is_array( $input[ $option[ 'id' ] ] ) ) {
266
+ $valid_input[ $option[ 'id' ] ] = array_map( $option[ 'sanitize_call' ], $input[ $option[ 'id' ] ] );
267
+ } else {
268
+ $valid_input[ $option[ 'id' ] ] = call_user_func( $option[ 'sanitize_call' ], $input[ $option[ 'id' ] ] );
 
269
  }
270
  endif;
271
+ } else {
272
+ if ( isset( $option[ 'id' ] ) ) {
273
+ $value = isset( $input[ $option[ 'id' ] ] ) ? $input[ $option[ 'id' ] ] : false;
274
+ if ( isset( $option[ 'type' ] ) && in_array( $option[ 'type' ], array( 'checkbox', 'onoff' ) ) ) {
275
+ $value = yith_plugin_fw_is_true( $value ) ? 'yes' : 'no';
 
 
 
276
  }
277
+ $valid_input[ $option[ 'id' ] ] = $value;
278
  }
279
  }
280
 
294
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
295
  */
296
  public function add_setting_page() {
297
+ $this->settings[ 'icon_url' ] = isset( $this->settings[ 'icon_url' ] ) ? $this->settings[ 'icon_url' ] : '';
298
+ $this->settings[ 'position' ] = isset( $this->settings[ 'position' ] ) ? $this->settings[ 'position' ] : null;
299
+ $parent = $this->settings[ 'parent_slug' ] . $this->settings[ 'parent_page' ];
300
+
301
+ if ( !empty( $parent ) ) {
302
+ add_submenu_page( $parent, $this->settings[ 'page_title' ], $this->settings[ 'menu_title' ], $this->settings[ 'capability' ], $this->settings[ 'page' ], array( $this, 'yit_panel' ) );
303
+ } else {
304
+ add_menu_page( $this->settings[ 'page_title' ], $this->settings[ 'menu_title' ], $this->settings[ 'capability' ], $this->settings[ 'page' ], array( $this, 'yit_panel' ), $this->settings[ 'icon_url' ], $this->settings[ 'position' ] );
305
+ }
306
  /* === Duplicate Items Hack === */
307
  $this->remove_duplicate_submenu_page();
308
  do_action( 'yit_after_add_settings_page' );
317
  * @since 2.9.13
318
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
319
  */
320
+ public function add_premium_version_upgrade_to_menu() {
321
  global $submenu;
322
 
323
+ if ( apply_filters( 'yit_show_upgrade_to_premium_version', isset( $submenu[ 'yit_plugin_panel' ] ) && !isset( $submenu[ 'yit_plugin_panel' ][ 'how_to' ] ) ) ) {
324
+ $submenu[ 'yit_plugin_panel' ][ 'how_to' ] = array(
325
  sprintf( '%s%s%s', '<span id="yith-how-to-premium">', __( 'How to install premium version', 'yith-plugin-fw' ), '</span>' ),
326
  'install_plugins',
327
  '//support.yithemes.com/hc/en-us/articles/217840988',
346
  $yit_options = $this->get_main_array_options();
347
 
348
  // tabs
349
+ foreach ( $this->settings[ 'admin-tabs' ] as $tab => $tab_value ) {
350
  $active_class = ( $current_tab == $tab ) ? ' nav-tab-active' : '';
351
+ $tabs .= '<a class="nav-tab' . $active_class . '" href="?' . $this->settings[ 'parent_page' ] . '&page=' . $this->settings[ 'page' ] . '&tab=' . $tab . '">' . $tab_value . '</a>';
352
  }
353
  ?>
354
+ <div id="icon-themes" class="icon32"><br/></div>
355
+ <h2 class="nav-tab-wrapper">
356
  <?php echo $tabs ?>
357
  </h2>
358
  <?php
359
  $custom_tab_action = $this->is_custom_tab( $yit_options, $current_tab );
360
  if ( $custom_tab_action ) {
361
  $this->print_custom_tab( $custom_tab_action );
362
+
363
  return;
364
  }
365
  ?>
 
366
  <?php
367
  $panel_content_class = apply_filters( 'yit_admin_panel_content_class', 'yit-admin-panel-content-wrap' );
368
  ?>
369
+ <div id="wrap" class="yith-plugin-fw plugin-option yit-admin-panel-container">
370
  <?php $this->message(); ?>
371
  <div class="<?php echo $panel_content_class; ?>">
372
+ <h2><?php echo $this->get_tab_title() ?></h2>
373
+ <?php if ( $this->is_show_form() ) : ?>
374
+ <form id="yith-plugin-fw-panel" method="post" action="options.php">
375
+ <?php do_settings_sections( 'yit' ); ?>
376
+ <p>&nbsp;</p>
377
+ <?php settings_fields( 'yit_' . $this->settings[ 'parent' ] . '_options' ); ?>
378
+ <input type="hidden" name="<?php echo $this->get_name_field( 'current_tab' ) ?>" value="<?php echo esc_attr( $current_tab ) ?>"/>
379
+ <input type="submit" class="button-primary" value="<?php _e( 'Save Changes', 'yith-plugin-fw' ) ?>" style="float:left;margin-right:10px;"/>
380
+ </form>
381
+ <form method="post">
382
+ <?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
383
+ <input type="hidden" name="yit-action" value="reset"/>
384
+ <input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset to default', 'yith-plugin-fw' ) ?>"
385
+ onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');"/>
386
+ </form>
387
  <p>&nbsp;</p>
388
+ <?php endif ?>
 
 
 
 
 
 
 
 
 
 
389
  </div>
390
  </div>
391
+ <?php
392
  }
393
 
394
  public function is_custom_tab( $options, $current_tab ) {
395
+ foreach ( $options[ $current_tab ] as $section => $option ) {
396
+ if ( isset( $option[ 'type' ] ) && isset( $option[ 'action' ] ) && 'custom_tab' == $option[ 'type' ] && !empty( $option[ 'action' ] ) ) {
397
+ return $option[ 'action' ];
398
+ } else {
 
399
  return false;
400
  }
401
  }
402
+
403
  return false;
404
  }
405
 
414
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
415
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
416
  */
417
+ public function print_custom_tab( $action ) {
418
  do_action( $action );
419
  }
420
 
431
  $yit_options = $this->get_main_array_options();
432
  $current_tab = $this->get_current_tab();
433
 
434
+ if ( !$current_tab ) {
435
  return;
436
  }
437
+ foreach ( $yit_options[ $current_tab ] as $section => $data ) {
438
  add_settings_section( "yit_settings_{$current_tab}_{$section}", $this->get_section_title( $section ), $this->get_section_description( $section ), 'yit' );
439
  foreach ( $data as $option ) {
440
+ if ( isset( $option[ 'id' ] ) && isset( $option[ 'type' ] ) && isset( $option[ 'name' ] ) ) {
441
+ add_settings_field( "yit_setting_" . $option[ 'id' ], $option[ 'name' ], array( $this, 'render_field' ), 'yit', "yit_settings_{$current_tab}_{$section}", array( 'option' => $option, 'label_for' => $this->get_id_field( $option[ 'id' ] ) ) );
442
  }
443
  }
444
  }
458
 
459
  global $wp_admin_bar;
460
 
461
+ if ( !current_user_can( 'manage_options' ) ) {
462
  return;
463
  }
464
 
465
+ if ( !empty( $this->settings[ 'admin_tabs' ] ) ) {
466
+ foreach ( $this->settings[ 'admin-tabs' ] as $item => $title ) {
467
 
468
  $wp_admin_bar->add_menu( array(
469
+ 'parent' => $this->settings[ 'parent' ],
470
+ 'title' => $title,
471
+ 'id' => $this->settings[ 'parent' ] . '-' . $item,
472
+ 'href' => admin_url( 'themes.php' ) . '?page=' . $this->settings[ 'parent_page' ] . '&tab=' . $item
473
+ ) );
474
  }
475
  }
476
  }
486
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
487
  */
488
  function get_current_tab() {
489
+ $admin_tabs = array_keys( $this->settings[ 'admin-tabs' ] );
490
 
491
+ if ( !isset( $_GET[ 'page' ] ) || $_GET[ 'page' ] != $this->settings[ 'page' ] ) {
492
  return false;
493
  }
494
+ if ( isset( $_REQUEST[ 'yit_tab_options' ] ) ) {
495
+ return $_REQUEST[ 'yit_tab_options' ];
496
+ } elseif ( isset( $_GET[ 'tab' ] ) && isset( $this->_tabs_path_files[ $_GET[ 'tab' ] ] ) ) {
497
+ return $_GET[ 'tab' ];
498
+ } elseif ( isset( $admin_tabs[ 0 ] ) ) {
499
+ return $admin_tabs[ 0 ];
500
+ } else {
 
 
 
501
  return 'general';
502
  }
503
  }
530
  );
531
 
532
  foreach ( $message as $key => $value ) {
533
+ if ( isset( $_GET[ $key ] ) ) {
534
+ echo $message[ $key ];
535
  }
536
  }
537
 
555
  if ( $echo ) {
556
  echo $message;
557
  }
558
+
559
  return $message;
560
  }
561
 
571
  */
572
  function get_tabs_path_files() {
573
 
574
+ $option_files_path = $this->settings[ 'options-path' ] . '/';
575
 
576
  $tabs = array();
577
 
578
  foreach ( ( array ) glob( $option_files_path . '*.php' ) as $filename ) {
579
  preg_match( '/(.*)-options\.(.*)/', basename( $filename ), $filename_parts );
580
 
581
+ if ( !isset( $filename_parts[ 1 ] ) ) {
582
+ continue;
583
+ }
584
 
585
+ $tab = $filename_parts[ 1 ];
586
 
587
+ $tabs[ $tab ] = $filename;
588
  }
589
 
590
  return $tabs;
600
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
601
  */
602
  function get_main_array_options() {
603
+ if ( !empty( $this->_main_array_options ) ) {
604
  return $this->_main_array_options;
605
  }
606
 
607
+ foreach ( $this->settings[ 'admin-tabs' ] as $item => $v ) {
608
+ $path = $this->settings[ 'options-path' ] . '/' . $item . '-options.php';
609
  if ( file_exists( $path ) ) {
610
  $this->_main_array_options = array_merge( $this->_main_array_options, include $path );
611
  }
631
  foreach ( $yit_options as $tab => $sections ) {
632
  foreach ( $sections as $section ) {
633
  foreach ( $section as $id => $value ) {
634
+ if ( isset( $value[ 'std' ] ) && isset( $value[ 'id' ] ) ) {
635
+ $default_options[ $value[ 'id' ] ] = $value[ 'std' ];
636
  }
637
  }
638
  }
639
  }
640
 
641
  unset( $yit_options );
642
+
643
  return $default_options;
644
  }
645
 
657
  $yit_options = $this->get_main_array_options();
658
  $current_tab = $this->get_current_tab();
659
 
660
+ foreach ( $yit_options[ $current_tab ] as $sections => $data ) {
661
  foreach ( $data as $option ) {
662
+ if ( isset( $option[ 'type' ] ) && $option[ 'type' ] == 'title' ) {
663
+ return $option[ 'name' ];
664
  }
665
  }
666
  }
681
  $yit_options = $this->get_main_array_options();
682
  $current_tab = $this->get_current_tab();
683
 
684
+ foreach ( $yit_options[ $current_tab ][ $section ] as $option ) {
685
+ if ( isset( $option[ 'type' ] ) && $option[ 'type' ] == 'section' ) {
686
+ return $option[ 'name' ];
687
  }
688
  }
689
  }
703
  $yit_options = $this->get_main_array_options();
704
  $current_tab = $this->get_current_tab();
705
 
706
+ foreach ( $yit_options[ $current_tab ][ $section ] as $option ) {
707
+ if ( isset( $option[ 'type' ] ) && $option[ 'type' ] == 'section' && isset( $option[ 'desc' ] ) ) {
708
+ return '<p>' . $option[ 'desc' ] . '</p>';
709
  }
710
  }
711
  }
724
  $yit_options = $this->get_main_array_options();
725
  $current_tab = $this->get_current_tab();
726
 
727
+ foreach ( $yit_options[ $current_tab ] as $sections => $data ) {
728
  foreach ( $data as $option ) {
729
+ if ( !isset( $option[ 'type' ] ) || $option[ 'type' ] != 'title' ) {
730
  continue;
731
  }
732
+ if ( isset( $option[ 'showform' ] ) ) {
733
+ return $option[ 'showform' ];
734
+ } else {
 
735
  return true;
736
  }
737
  }
750
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
751
  */
752
  function get_name_field( $name = '' ) {
753
+ return 'yit_' . $this->settings[ 'parent' ] . '_options[' . $name . ']';
754
  }
755
 
756
  /**
765
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
766
  */
767
  function get_id_field( $id ) {
768
+ return 'yit_' . $this->settings[ 'parent' ] . '_options_' . $id;
769
  }
770
 
771
 
783
  */
784
  function render_field( $param ) {
785
 
786
+ if ( !empty( $param ) && isset( $param [ 'option' ] ) ) {
787
+ $option = $param [ 'option' ];
788
  $db_options = $this->get_options();
789
 
790
  $custom_attributes = array();
791
 
792
+ if ( !empty( $option[ 'custom_attributes' ] ) && is_array( $option[ 'custom_attributes' ] ) ) {
793
+ foreach ( $option[ 'custom_attributes' ] as $attribute => $attribute_value ) {
794
  $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
795
  }
796
  }
797
 
798
  $custom_attributes = implode( ' ', $custom_attributes );
799
+ $std = isset( $option[ 'std' ] ) ? $option[ 'std' ] : '';
800
+ $db_value = ( isset( $db_options[ $option[ 'id' ] ] ) ) ? $db_options[ $option[ 'id' ] ] : $std;
801
 
802
+ if ( isset( $option[ 'deps' ] ) )
803
+ $deps = $option[ 'deps' ];
804
+
805
+ if ( 'on-off' === $option[ 'type' ] )
806
+ $option[ 'type' ] = 'onoff';
807
+
808
+ if ( $field_template_path = yith_plugin_fw_get_field_template_path( $option ) ) {
809
+ $field_container_path = apply_filters( 'yith_plugin_fw_panel_field_container_template_path', YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/panel-field-container.php', $option );
810
+ file_exists( $field_container_path ) && include( $field_container_path );
811
+ } else {
812
  do_action( "yit_panel_{$option['type']}", $option, $db_value, $custom_attributes );
813
  }
814
  }
825
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
826
  */
827
  public function get_options() {
828
+ $options = get_option( 'yit_' . $this->settings[ 'parent' ] . '_options' );
829
+ if ( $options === false || ( isset( $_REQUEST[ 'yit-action' ] ) && $_REQUEST[ 'yit-action' ] == 'reset' ) ) {
830
  $options = $this->get_default_options();
831
  }
832
+
833
  return $options;
834
  }
835
 
843
  * @since 1.0
844
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
845
  */
846
+ public static function add_infobox( $args = array() ) {
847
+ if ( !empty( $args ) ) {
848
  extract( $args );
849
  require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/boxinfo.php' );
850
  }
853
  /**
854
  * Show a box panel with specific content in two columns as a new woocommerce type
855
  *
856
+ * @deprecated 3.0.12 Do nothing! Method left to prevent Fatal Error if called directly
857
+ *
858
  * @param array $args
859
  *
860
  * @return void
 
 
861
  */
862
+ public static function add_videobox( $args = array() ) {
863
+
 
 
 
864
  }
865
 
866
+ /**
867
+ * Fire the action to print the custom tab
868
+ *
869
+ * @deprecated 3.0.12 Do nothing! Method left to prevent Fatal Error if called directly
870
+ * @return void
871
+ */
872
+ public function print_video_box() {
873
+
874
+ }
875
+
876
+ /**
877
+ * sort plugins by name in YITH Plugins menu
878
+ *
879
+ * @since 3.0.0
880
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
881
+ */
882
+ public static function sort_plugins() {
883
+ global $submenu;
884
+ if ( !empty( $submenu[ 'yit_plugin_panel' ] ) ) {
885
+ $sorted_plugins = $submenu[ 'yit_plugin_panel' ];
886
 
887
+ usort( $sorted_plugins, function ( $a, $b ) {
888
+ return strcmp( current( $a ), current( $b ) );
889
+ } );
890
 
891
+ $submenu[ 'yit_plugin_panel' ] = $sorted_plugins;
892
+ }
893
+ }
894
 
895
+ /**
896
+ * add menu class in YITH Plugins menu
897
+ *
898
+ * @since 3.0.0
899
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
900
+ */
901
+ public static function add_menu_class_in_yith_plugin( $menu ) {
902
+ global $submenu;
903
+
904
+ if ( !empty( $submenu[ 'yit_plugin_panel' ] ) ) {
905
+ $item_count = count( $submenu[ 'yit_plugin_panel' ] );
906
+ $columns = absint( $item_count / 20 ) + 1;
907
+ $columns = max( 1, min( $columns, 3 ) );
908
+ $columns = apply_filters( 'yith_plugin_fw_yith_plugins_menu_columns', $columns, $item_count );
909
+
910
+ if ( $columns > 1 ) {
911
+ $class = "yith-plugin-fw-menu-$columns-columns";
912
+ foreach ( $menu as $order => $top ) {
913
+ if ( 'yit_plugin_panel' === $top[ 2 ] ) {
914
+ $c = $menu[ $order ][ 4 ];
915
+ $menu[ $order ][ 4 ] = add_cssclass( $class, $c );
916
+ break;
917
+ }
918
+ }
919
+ }
920
+ }
921
+
922
+ return $menu;
923
+ }
924
  }
925
+ }
plugin-fw/lib/yit-plugin-subpanel.php CHANGED
@@ -8,11 +8,11 @@
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
- if ( ! defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
- if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
16
  /**
17
  * YIT Plugin Panel
18
  *
@@ -23,7 +23,6 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
23
  * @since 1.0
24
  * @author Your Inspiration Themes
25
  */
26
-
27
  class YIT_Plugin_SubPanel extends YIT_Plugin_Panel {
28
 
29
  /**
@@ -50,10 +49,10 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
50
  */
51
 
52
  public function __construct( $args = array() ) {
53
- if ( ! empty( $args ) ) {
54
- $this->settings = $args;
55
- $this->settings['parent'] = $this->settings['page'];
56
- $this->_tabs_path_files = $this->get_tabs_path_files();
57
 
58
  add_action( 'admin_init', array( $this, 'register_settings' ) );
59
  add_action( 'admin_menu', array( &$this, 'add_setting_page' ) );
@@ -74,11 +73,10 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
74
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
75
  */
76
  public function register_settings() {
77
- register_setting( 'yit_' . $this->settings['page'] . '_options', 'yit_' . $this->settings['page'] . '_options', array( &$this, 'options_validate' ) );
78
  }
79
 
80
 
81
-
82
  /**
83
  * Add Setting SubPage
84
  *
@@ -98,12 +96,12 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
98
  $logo = $admin_logo;
99
  }
100
 
101
- if( ! isset( $admin_page_hooks['yit_plugin_panel'] ) ) {
102
  $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
103
- add_menu_page( 'yit_plugin_panel', 'YITH Plugins', 'nosuchcapability', 'yit_plugin_panel', NULL, $logo, $position );
104
  }
105
 
106
- add_submenu_page( 'yit_plugin_panel', $this->settings['label'], $this->settings['label'], 'manage_options', $this->settings['page'], array( $this, 'yit_panel' ) );
107
  remove_submenu_page( 'yit_plugin_panel', 'yit_plugin_panel' );
108
 
109
  }
@@ -118,46 +116,58 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
118
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
119
  */
120
  public function yit_panel() {
121
-
122
  $tabs = '';
123
  $current_tab = $this->get_current_tab();
 
 
124
 
125
  // tabs
126
- foreach ( $this->settings['admin-tabs'] as $tab => $tab_value ) {
127
  $active_class = ( $current_tab == $tab ) ? ' nav-tab-active' : '';
128
- $tabs .= '<a class="nav-tab' . $active_class . '" href="?page=' . $this->settings['page'] . '&tab=' . $tab . '">' . $tab_value . '</a>';
129
  }
130
  ?>
131
- <div id="icon-themes" class="icon32"><br /></div>
132
  <h2 class="nav-tab-wrapper">
133
  <?php echo $tabs ?>
134
  </h2>
 
 
 
 
135
 
136
- <div id="wrap" class="plugin-option">
 
 
 
 
 
 
137
  <?php $this->message(); ?>
138
- <h2><?php echo $this->get_tab_title() ?></h2>
139
-
140
- <?php if ( $this->is_show_form() ) : ?>
141
- <form method="post" action="options.php">
142
- <?php do_settings_sections( 'yit' ); ?>
 
 
 
 
 
 
 
 
 
 
 
143
  <p>&nbsp;</p>
144
- <?php settings_fields( 'yit_' . $this->settings['page'] . '_options' ); ?>
145
- <input type="hidden" name="<?php echo $this->get_name_field( 'current_tab' ) ?>" value="<?php echo esc_attr( $current_tab ) ?>" />
146
- <input type="submit" class="button-primary" value="<?php _e( 'Save Changes', 'yith-plugin-fw' ) ?>" style="float:left;margin-right:10px;" />
147
- </form>
148
- <form method="post">
149
- <?php $warning = __( 'If you continue with this action, you will reset all the options in this page.', 'yith-plugin-fw' ) ?>
150
- <input type="hidden" name="yit-action" value="reset" />
151
- <input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset to default', 'yith-plugin-fw' ) ?>" onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');" />
152
- </form>
153
- <p>&nbsp;</p>
154
- <?php endif ?>
155
  </div>
156
- <?php
157
  }
158
 
159
 
160
-
161
  }
162
 
163
  }
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
+ if ( !defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
+ if ( !class_exists( 'YIT_Plugin_SubPanel' ) ) {
16
  /**
17
  * YIT Plugin Panel
18
  *
23
  * @since 1.0
24
  * @author Your Inspiration Themes
25
  */
 
26
  class YIT_Plugin_SubPanel extends YIT_Plugin_Panel {
27
 
28
  /**
49
  */
50
 
51
  public function __construct( $args = array() ) {
52
+ if ( !empty( $args ) ) {
53
+ $this->settings = $args;
54
+ $this->settings[ 'parent' ] = $this->settings[ 'page' ];
55
+ $this->_tabs_path_files = $this->get_tabs_path_files();
56
 
57
  add_action( 'admin_init', array( $this, 'register_settings' ) );
58
  add_action( 'admin_menu', array( &$this, 'add_setting_page' ) );
73
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
74
  */
75
  public function register_settings() {
76
+ register_setting( 'yit_' . $this->settings[ 'page' ] . '_options', 'yit_' . $this->settings[ 'page' ] . '_options', array( &$this, 'options_validate' ) );
77
  }
78
 
79
 
 
80
  /**
81
  * Add Setting SubPage
82
  *
96
  $logo = $admin_logo;
97
  }
98
 
99
+ if ( !isset( $admin_page_hooks[ 'yit_plugin_panel' ] ) ) {
100
  $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
101
+ add_menu_page( 'yit_plugin_panel', 'YITH Plugins', 'nosuchcapability', 'yit_plugin_panel', null, $logo, $position );
102
  }
103
 
104
+ add_submenu_page( 'yit_plugin_panel', $this->settings[ 'label' ], $this->settings[ 'label' ], 'manage_options', $this->settings[ 'page' ], array( $this, 'yit_panel' ) );
105
  remove_submenu_page( 'yit_plugin_panel', 'yit_plugin_panel' );
106
 
107
  }
116
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
117
  */
118
  public function yit_panel() {
 
119
  $tabs = '';
120
  $current_tab = $this->get_current_tab();
121
+ $yit_options = $this->get_main_array_options();
122
+
123
 
124
  // tabs
125
+ foreach ( $this->settings[ 'admin-tabs' ] as $tab => $tab_value ) {
126
  $active_class = ( $current_tab == $tab ) ? ' nav-tab-active' : '';
127
+ $tabs .= '<a class="nav-tab' . $active_class . '" href="?page=' . $this->settings[ 'page' ] . '&tab=' . $tab . '">' . $tab_value . '</a>';
128
  }
129
  ?>
130
+ <div id="icon-themes" class="icon32"><br/></div>
131
  <h2 class="nav-tab-wrapper">
132
  <?php echo $tabs ?>
133
  </h2>
134
+ <?php
135
+ $custom_tab_action = $this->is_custom_tab( $yit_options, $current_tab );
136
+ if ( $custom_tab_action ) {
137
+ $this->print_custom_tab( $custom_tab_action );
138
 
139
+ return;
140
+ }
141
+ ?>
142
+ <?php
143
+ $panel_content_class = apply_filters( 'yit_admin_panel_content_class', 'yit-admin-panel-content-wrap' );
144
+ ?>
145
+ <div id="wrap" class="yith-plugin-fw plugin-option yit-admin-panel-container">
146
  <?php $this->message(); ?>
147
+ <div class="<?php echo $panel_content_class; ?>">
148
+ <h2><?php echo $this->get_tab_title() ?></h2>
149
+ <?php if ( $this->is_show_form() ) : ?>
150
+ <form id="yith-plugin-fw-panel" method="post" action="options.php">
151
+ <?php do_settings_sections( 'yit' ); ?>
152
+ <p>&nbsp;</p>
153
+ <?php settings_fields( 'yit_' . $this->settings[ 'parent' ] . '_options' ); ?>
154
+ <input type="hidden" name="<?php echo $this->get_name_field( 'current_tab' ) ?>" value="<?php echo esc_attr( $current_tab ) ?>"/>
155
+ <input type="submit" class="button-primary" value="<?php _e( 'Save Changes', 'yith-plugin-fw' ) ?>" style="float:left;margin-right:10px;"/>
156
+ </form>
157
+ <form method="post">
158
+ <?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
159
+ <input type="hidden" name="yit-action" value="reset"/>
160
+ <input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset to default', 'yith-plugin-fw' ) ?>"
161
+ onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');"/>
162
+ </form>
163
  <p>&nbsp;</p>
164
+ <?php endif ?>
165
+ </div>
 
 
 
 
 
 
 
 
 
166
  </div>
167
+ <?php
168
  }
169
 
170
 
 
171
  }
172
 
173
  }
plugin-fw/lib/yit-upgrade.php CHANGED
@@ -7,562 +7,570 @@
7
  * It is also available through the world-wide-web at this URL:
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  } // Exit if accessed directly
13
 
14
- if ( ! class_exists( 'YIT_Upgrade' ) ) {
15
- /**
16
- * YIT Upgrade
17
- *
18
- * Notify and Update plugin
19
- *
20
- * @class YIT_Upgrade
21
- * @package Yithemes
22
- * @since 1.0
23
- * @author Your Inspiration Themes
24
- * @see WP_Updater Class
25
- */
26
- class YIT_Upgrade {
27
-
28
- /**
29
- * @var string XML notifier update
30
- */
31
- protected $_xml = 'http://update.yithemes.com/plugins/%plugin_slug%.xml';
32
-
33
- /**
34
- * @var string api server url
35
- */
36
- protected $_package_url = 'https://yithemes.com';
37
-
38
- /**
39
- * @var array The registered plugins
40
- */
41
- protected $_plugins = array();
42
-
43
- /**
44
- * @var YIT_Upgrade The main instance
45
- */
46
- protected static $_instance;
47
-
48
- /**
49
- * Construct
50
- *
51
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
52
- * @since 1.0
53
- */
54
- public function __construct() {
55
- add_filter( 'upgrader_pre_download', array( $this, 'upgrader_pre_download' ), 10, 3 );
56
- add_action( 'update-custom_upgrade-plugin-multisite', array( $this, 'upgrade_plugin_multisite' ) );
57
-
58
- if ( is_network_admin() ) {
59
- add_action( 'admin_enqueue_scripts', array( $this, 'network_admin_enqueue_scripts' ) );
60
- }
61
-
62
- $is_debug_enabled = defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG;
63
- if ( $is_debug_enabled ) {
64
- $this->_package_url = defined( 'YIT_LICENCE_DEBUG_LOCALHOST' ) ? YIT_LICENCE_DEBUG_LOCALHOST : 'http://dev.yithemes.com';
65
- add_filter( 'block_local_requests', '__return_false' );
66
- }
67
- }
68
-
69
- /**
70
- * Main plugin Instance
71
- *
72
- * @param $plugin_slug | string The plugin slug
73
- * @param $plugin_init | string The plugin init file
74
- *
75
- * @return void
76
- *
77
- * @since 1.0
78
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
79
- */
80
- public function register( $plugin_slug, $plugin_init ) {
81
-
82
- if ( ! function_exists( 'get_plugins' ) ) {
83
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
84
- }
85
-
86
- $plugins = get_plugins();
87
- $plugin_info = $plugins[ $plugin_init ];
88
-
89
- $this->_plugins[ $plugin_init ] = array(
90
- 'info' => $plugin_info,
91
- 'slug' => $plugin_slug,
92
- );
93
-
94
- /* === HOOKS === */
95
- if ( ! is_multisite() || is_plugin_active_for_network( $plugin_init ) ) {
96
- add_action( 'load-plugins.php', array( $this, 'remove_wp_plugin_update_row' ), 25 );
97
- add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
98
- } else if ( is_multisite() && current_user_can( 'update_plugins' ) ) {
99
- $transient = 'yith_register_' . md5( $plugin_slug );
100
- if ( apply_filters( 'yith_register_delete_transient', false ) ) {
101
- delete_transient( $transient );
102
- }
103
- $info = get_transient( $transient );
104
- if ( false === $info || apply_filters( 'yith_register_delete_transient', false ) ) {
105
- $xml = str_replace( '%plugin_slug%', $plugin_slug, $this->_xml );
106
- $remote_xml = wp_remote_get( $xml );
107
-
108
- if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
109
- $plugin_remote_info = new SimpleXmlElement( $remote_xml['body'] );
110
- $info['Latest'] = (string) $plugin_remote_info->latest;
111
- $info['changelog'] = (string) $plugin_remote_info->changelog;
112
- YIT_Plugin_Licence()->check( $plugin_slug, false );
113
- set_transient( $transient, $info, DAY_IN_SECONDS );
114
- }
115
- }
116
-
117
- $this->_plugins[ $plugin_init ]['info']['Latest'] = $info['Latest'];
118
- $this->_plugins[ $plugin_init ]['info']['changelog'] = $info['changelog'];
119
- add_action( 'admin_enqueue_scripts', array( $this, 'multisite_updater_script' ) );
120
- }
121
- }
122
-
123
- /**
124
- * Add the multisite updater scripts
125
- *
126
- * @return void
127
- *
128
- * @since 1.0
129
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
130
- */
131
- public function multisite_updater_script() {
132
-
133
- $update_url = $changelogs = $details_url = array();
134
- $strings = array(
135
- 'new_version' => __( 'There is a new version of %plugin_name% available.', 'yith-plugin-fw' ),
136
- 'latest' => __( 'View version %latest% details.', 'yith-plugin-fw' ),
137
- 'unavailable' => __( 'Automatic update is unavailable for this plugin,', 'yith-plugin-fw' ),
138
- 'activate' => __( 'please <a href="%activate_link%">activate</a> your copy of %plugin_name%.', 'yith-plugin-fw' ),
139
- 'update_now' => __( 'Update now.', 'yith-plugin-fw' )
140
-
141
- );
142
-
143
- foreach ( $this->_plugins as $init => $info ) {
144
- $update_url[ $init ] = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin-multisite&plugin=' ) . $init, 'upgrade-plugin-multisite_' . $init );
145
- $changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
146
- $details_url[ $init ] = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ), '' ) );
147
- $plugin_changelog = isset( $this->_plugins[ $init ]['info']['changelog'] ) ? $this->_plugins[ $init ]['info']['changelog'] : '';
148
- $changelogs[ $init ] = $this->in_theme_update_message( $this->_plugins[ $init ], $plugin_changelog, $changelog_id, false );
149
- }
150
-
151
- $localize_script_args = array(
152
- 'registered' => $this->_plugins,
153
- 'activated' => YIT_Plugin_Licence()->get_activated_products(),
154
- 'licence_activation_url' => YIT_Plugin_Licence()->get_licence_activation_page_url(),
155
- 'update_url' => $update_url,
156
- 'details_url' => $details_url,
157
- 'strings' => $strings,
158
- 'changelogs' => $changelogs
159
- );
160
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
161
- yit_enqueue_script( 'yit-multisite-updater', YIT_CORE_PLUGIN_URL . '/assets/js/multisite-updater' . $suffix . '.js', array( 'jquery' ), false, true );
162
-
163
- wp_localize_script( 'yit-multisite-updater', 'plugins', $localize_script_args );
164
- }
165
-
166
- public function network_admin_enqueue_scripts() {
167
- yit_enqueue_style( 'yit-upgrader', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrader.css' );
168
- }
169
-
170
- /**
171
- * Retrive the zip package file
172
- *
173
- * @param bool $reply Whether to bail without returning the package. Default false.
174
- * @param string $package The package file name.
175
- * @param \WP_Upgrader $upgrader WP_Upgrader instance.
176
- *
177
- * @return string | The download file
178
- *
179
- * @since 1.0
180
- * @see wp-admin/includes/class-wp-upgrader.php
181
- * @access public
182
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
183
- */
184
- public function upgrader_pre_download( $reply, $package, $upgrader ) {
185
- $plugin = false;
186
- $is_bulk = $upgrader->skin instanceof Bulk_Plugin_Upgrader_Skin;
187
-
188
- if ( ! $is_bulk ) {
189
- $plugin = isset( $upgrader->skin->plugin ) ? $upgrader->skin->plugin : false;
190
- } else {
191
- //Bulk action upgrade
192
- $action_url = parse_url( $upgrader->skin->options['url'] );
193
- parse_str( rawurldecode( htmlspecialchars_decode( $action_url['query'] ) ) );
194
- $plugins = explode( ',', $plugins );
195
- foreach ( $plugins as $plugin_init ) {
196
- $to_upgrade = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_init );
197
- if ( $to_upgrade['Name'] == $upgrader->skin->plugin_info['Name'] ) {
198
- $plugin = $plugin_init;
199
- }
200
- }
201
- }
202
-
203
- /**
204
- * It isn't YITH Premium plugins, please wordpress update it for me!
205
- */
206
- if ( ! $plugin ) {
207
- return $reply;
208
- }
209
-
210
- $plugin_info = YIT_Plugin_Licence()->get_product( $plugin );
211
-
212
- /**
213
- * False ? It isn't YITH Premium plugins, please wordpress update it for me!
214
- */
215
- if ( false === $plugin_info ) {
216
- return $reply;
217
- }
218
-
219
- $licence = YIT_Plugin_Licence()->get_licence();
220
- $product_id = $plugin_info['product_id'];
221
- $args = array(
222
- 'email' => $licence[ $product_id ]['email'],
223
- 'licence_key' => $licence[ $product_id ]['licence_key'],
224
- 'product_id' => $plugin_info['product_id'],
225
- 'secret_key' => $plugin_info['secret_key'],
226
- 'instance' => YIT_Plugin_Licence()->get_home_url(),
227
- 'wc-api' => 'download-api',
228
- 'request' => 'download'
229
- );
230
-
231
- if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) {
232
- //Local file or remote?
233
- return $package;
234
- }
235
-
236
- if ( empty( $package ) ) {
237
- return new WP_Error( 'no_package', $upgrader->strings['no_package'] );
238
- }
239
-
240
- $upgrader->skin->feedback( 'downloading_package', __( 'YIThemes Repository', 'yith-plugin-fw' ) );
241
-
242
- $download_file = $this->_download_url( $package, $args );
243
-
244
- /**
245
- * Regenerate update_plugins transient
246
- */
247
- $this->force_regenerate_update_transient();
248
-
249
- if ( is_wp_error( $download_file ) ) {
250
- return new WP_Error( 'download_failed', $upgrader->strings['download_failed'], $download_file->get_error_message() );
251
- }
252
-
253
- return $download_file;
254
- }
255
-
256
- /**
257
- * Retrive the temp filename
258
- *
259
- * @param string $url The package url
260
- * @param string $body The post data fields
261
- * @param int $timeout Execution timeout (default: 300)
262
- *
263
- * @return string | The temp filename
264
- *
265
- * @since 1.0
266
- * @see wp-admin/includes/class-wp-upgrader.php
267
- * @access protected
268
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
269
- */
270
- protected function _download_url( $url, $body, $timeout = 300 ) {
271
-
272
- //WARNING: The file is not automatically deleted, The script must unlink() the file.
273
- if ( ! $url ) {
274
- return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.', 'yit' ) );
275
- }
276
-
277
- $tmpfname = wp_tempnam( $url );
278
-
279
- $args = array(
280
- 'timeout' => $timeout,
281
- 'stream' => true,
282
- 'filename' => $tmpfname,
283
- 'body' => $body
284
- );
285
-
286
- if ( ! $tmpfname ) {
287
- return new WP_Error( 'http_no_file', __( 'Could not create Temporary file.', 'yit' ) );
288
- }
289
-
290
- $response = wp_safe_remote_post( $url, $args );
291
-
292
- if ( is_wp_error( $response ) ) {
293
- unlink( $tmpfname );
294
-
295
- return $response;
296
- }
297
-
298
- if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
299
- unlink( $tmpfname );
300
-
301
- return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ) );
302
- }
303
-
304
- $content_md5 = wp_remote_retrieve_header( $response, 'content-md5' );
305
-
306
- if ( $content_md5 ) {
307
- $md5_check = verify_file_md5( $tmpfname, $content_md5 );
308
- if ( is_wp_error( $md5_check ) ) {
309
- unlink( $tmpfname );
310
-
311
- return $md5_check;
312
- }
313
- }
314
-
315
- return $tmpfname;
316
- }
317
-
318
- /**
319
- * Main plugin Instance
320
- *
321
- * @static
322
- * @return object Main instance
323
- *
324
- * @since 1.0
325
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
326
- */
327
- public static function instance() {
328
- if ( is_null( self::$_instance ) ) {
329
- self::$_instance = new self();
330
- }
331
-
332
- return self::$_instance;
333
- }
334
-
335
- /**
336
- * Delete the update plugins transient
337
- *
338
- * @return void
339
- *
340
- * @since 1.0
341
- * @see update_plugins transient and pre_set_site_transient_update_plugins hooks
342
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
343
- */
344
- public function force_regenerate_update_transient() {
345
- delete_site_transient( 'update_plugins' );
346
- }
347
-
348
- /**
349
- * Check for plugins update
350
- *
351
- * If a new plugin version is available set it in the pre_set_site_transient_update_plugins hooks
352
- *
353
- * @param mixed $transient | update_plugins transient value
354
- * @param bool $save | Default: false. Set true to regenerate the update_transient plugins
355
- *
356
- * @return mixed $transient | The new update_plugins transient value
357
- *
358
- * @since 1.0
359
- * @see update_plugins transient and pre_set_site_transient_update_plugins hooks
360
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
361
- */
362
- public function check_update( $transient, $save = false ) {
363
-
364
- foreach ( $this->_plugins as $init => $plugin ) {
365
- $xml = str_replace( '%plugin_slug%', $this->_plugins[ $init ]['slug'], $this->_xml );
366
- $remote_xml = wp_remote_get( $xml );
367
-
368
- if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
369
-
370
- try {
371
-
372
- $plugin_remote_info = new SimpleXmlElement( $remote_xml['body'] );
373
-
374
- if ( version_compare( $plugin_remote_info->latest, $plugin['info']['Version'], '>' ) && ! isset( $transient->response[ $init ] ) ) {
375
-
376
- $package = YIT_Plugin_Licence()->check( $init ) ? $this->_package_url : null;
377
-
378
- $obj = new stdClass();
379
- $obj->slug = (string) $init;
380
- $obj->new_version = (string) $plugin_remote_info->latest;
381
- $obj->changelog = (string) $plugin_remote_info->changelog;
382
- $obj->package = $package;
383
- $obj->plugin = $init;
384
- $transient->response[ $init ] = $obj;
385
- }
386
-
387
- } catch ( Exception $e ) {
388
-
389
- return $transient;
390
-
391
- }
392
-
393
- }
394
- }
395
-
396
- if ( $save ) {
397
- set_site_transient( 'update_plugins', $transient );
398
- }
399
-
400
- return $transient;
401
- }
402
-
403
- /**
404
- * Add the plugin update row in plugin page
405
- *
406
- * @return void
407
- * @fire "in_theme_update_message-{$init}" action
408
- *
409
- * @since 1.0
410
- * @see after_plugin_row_{$init} action
411
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
412
- */
413
- public function plugin_update_row() {
414
-
415
- $current = get_site_transient( 'update_plugins' );
416
- $init = str_replace( 'after_plugin_row_', '', current_filter() );
417
-
418
- if ( ! isset( $current->response[ $init ] ) ) {
419
- return false;
420
- }
421
-
422
- /**
423
- * stdClass Object
424
- */
425
- $r = $current->response[ $init ];
426
-
427
- $changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
428
- $details_url = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ), '' ) );
429
-
430
- /**
431
- * @see wp_plugin_update_rows() in wp-single\wp-admin\includes\update.php
432
- */
433
- $wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );
434
-
435
- if ( is_network_admin() || ! is_multisite() || true ) {
436
- global $wp_version;
437
- $is_wp_4_6 = version_compare( $wp_version, '4.6', '>=' );
438
-
439
- echo '<tr class="plugin-update-tr' . ( is_plugin_active( $init ) ? ' active' : '' ) . '"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">';
440
-
441
- echo '<div class="update-message' . ( $is_wp_4_6 ? ' notice inline notice-warning notice-alt' : '' ) . '">';
442
-
443
- echo( $is_wp_4_6 ? '<p>' : '' );
444
-
445
- if ( ! current_user_can( 'update_plugins' ) ) {
446
- printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button open-plugin-details-modal" title="%3$s">View version %4$s details</a>.', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version );
447
- } elseif ( is_plugin_active_for_network( $init ) ) {
448
- printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button open-plugin-details-modal" title="%3$s">View version %4$s details</a>. <em>You have to activate the plugin on a single site of the network to benefit from automatic updates.</em>', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version );
449
- } elseif ( empty( $r->package ) ) {
450
- printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button open-plugin-details-modal" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin, please <a href="%5$s" title="License activation">activate</a> your copy of %6s.</em>', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version, YIT_Plugin_Licence()->get_licence_activation_page_url(), $this->_plugins[ $init ]['info']['Name'] );
451
- } else {
452
- printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button open-plugin-details-modal" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version, wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $init, 'upgrade-plugin_' . $init ) );
453
- }
454
-
455
- echo( $is_wp_4_6 ? '</p>' : '' );
456
-
457
- /**
458
- * Fires at the end of the update message container in each
459
- * row of the themes list table.
460
- *
461
- * The dynamic portion of the hook name, `$theme_key`, refers to
462
- * the theme slug as found in the WordPress.org themes repository.
463
- *
464
- * @since Wordpress 3.1.0
465
- * }
466
- */
467
- do_action( "in_theme_update_message-{$init}", $this->_plugins[ $init ], $r->changelog, $changelog_id );
468
-
469
- echo '</div></td></tr>';
470
- }
471
- }
472
-
473
- /**
474
- * Remove the standard plugin_update_row
475
- *
476
- * Remove the standard plugin_update_row and Add a custom plugin update row in plugin page.
477
- *
478
- * @return void
479
- * @fire "in_theme_update_message-{$init}" action
480
- *
481
- * @since 1.0
482
- * @see after_plugin_row_{$init} action
483
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
484
- */
485
- public function remove_wp_plugin_update_row() {
486
- foreach ( $this->_plugins as $init => $plugin ) {
487
- remove_action( "after_plugin_row_{$init}", 'wp_plugin_update_row', 10 );
488
- add_action( "after_plugin_row_{$init}", array( $this, 'plugin_update_row' ) );
489
- add_action( "in_theme_update_message-{$init}", array( $this, 'in_theme_update_message' ), 10, 3 );
490
- }
491
- }
492
-
493
- public function in_theme_update_message( $plugin, $changelog, $changelog_id, $echo = true ) {
494
-
495
- $res = "<div id='{$changelog_id}' class='yit-plugin-changelog-wrapper'>
 
 
 
 
 
 
 
 
496
  <div class='yit-plugin-changelog'>
497
  <h2 class='yit-plugin-changelog-title'>{$plugin['info']['Name']} - Changelog</h2>
498
  <p>{$changelog}</p>
499
  </div>
500
  </div>";
501
 
502
- if ( $echo ) {
503
- echo $res;
504
- } else {
505
- return $res;
506
- }
507
- }
508
-
509
- /**
510
- * Auto-Update Plugin in multisite
511
- *
512
- * Manage the non standard upgrade-plugin-multisite action
513
- *
514
- * @return void
515
- *
516
- * @since 1.0
517
- * @see upgrade-plugin action
518
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
519
- */
520
- public function upgrade_plugin_multisite() {
521
-
522
- $plugin = isset( $_REQUEST['plugin'] ) ? trim( $_REQUEST['plugin'] ) : '';
523
- $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
524
-
525
- if ( 'upgrade-plugin-multisite' != $action ) {
526
- wp_die( __( 'You can\'t update the plugins for this site.', 'yith-plugin-fw' ) );
527
- }
528
-
529
- if ( ! current_user_can( 'update_plugins' ) ) {
530
- wp_die( __( 'You do not have sufficient permissions to update the plugins for this site.', 'yith-plugin-fw' ) );
531
- }
532
-
533
- $this->check_update( get_site_transient( 'update_plugins' ), true );
534
-
535
- check_admin_referer( 'upgrade-plugin-multisite_' . $plugin );
536
-
537
- $title = __( 'Update Plugin', 'yith-plugin-fw' );
538
- $parent_file = 'plugins.php';
539
- $submenu_file = 'plugins.php';
540
-
541
- wp_enqueue_script( 'updates' );
542
- require_once( ABSPATH . 'wp-admin/admin-header.php' );
543
-
544
- $nonce = 'upgrade-plugin-multisite_' . $plugin;
545
- $url = 'update.php?action=upgrade-plugin-multisite&plugin=' . urlencode( $plugin );
546
-
547
- $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'plugin' ) ) );
548
- $upgrader->upgrade( $plugin );
549
-
550
- include( ABSPATH . 'wp-admin/admin-footer.php' );
551
- }
552
- }
553
  }
554
 
555
- if ( ! function_exists( 'YIT_Upgrade' ) ) {
556
- /**
557
- * Main instance of plugin
558
- *
559
- * @return YIT_Upgrade
560
- * @since 1.0
561
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
562
- */
563
- function YIT_Upgrade() {
564
- return YIT_Upgrade::instance();
565
- }
566
  }
567
 
568
  /**
7
  * It is also available through the world-wide-web at this URL:
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
+ if ( !defined( 'ABSPATH' ) ) {
11
+ exit;
12
  } // Exit if accessed directly
13
 
14
+ if ( !class_exists( 'YIT_Upgrade' ) ) {
15
+ /**
16
+ * YIT Upgrade
17
+ *
18
+ * Notify and Update plugin
19
+ *
20
+ * @class YIT_Upgrade
21
+ * @package Yithemes
22
+ * @since 1.0
23
+ * @author Your Inspiration Themes
24
+ * @see WP_Updater Class
25
+ */
26
+ class YIT_Upgrade {
27
+
28
+ /**
29
+ * @var string XML notifier update
30
+ */
31
+ protected $_xml = 'http://update.yithemes.com/plugins/%plugin_slug%.xml';
32
+
33
+ /**
34
+ * @var string api server url
35
+ */
36
+ protected $_package_url = 'https://yithemes.com';
37
+
38
+ /**
39
+ * @var array The registered plugins
40
+ */
41
+ protected $_plugins = array();
42
+
43
+ /**
44
+ * @var YIT_Upgrade The main instance
45
+ */
46
+ protected static $_instance;
47
+
48
+ /**
49
+ * Construct
50
+ *
51
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
52
+ * @since 1.0
53
+ */
54
+ public function __construct() {
55
+ add_filter( 'upgrader_pre_download', array( $this, 'upgrader_pre_download' ), 10, 3 );
56
+ add_action( 'update-custom_upgrade-plugin-multisite', array( $this, 'upgrade_plugin_multisite' ) );
57
+
58
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
59
+
60
+ $is_debug_enabled = defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG;
61
+ if ( $is_debug_enabled ) {
62
+ $this->_package_url = defined( 'YIT_LICENCE_DEBUG_LOCALHOST' ) ? YIT_LICENCE_DEBUG_LOCALHOST : 'http://dev.yithemes.com';
63
+ add_filter( 'block_local_requests', '__return_false' );
64
+ }
65
+ }
66
+
67
+ /**
68
+ * Main plugin Instance
69
+ *
70
+ * @param $plugin_slug | string The plugin slug
71
+ * @param $plugin_init | string The plugin init file
72
+ *
73
+ * @return void
74
+ *
75
+ * @since 1.0
76
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
77
+ */
78
+ public function register( $plugin_slug, $plugin_init ) {
79
+
80
+ if ( !function_exists( 'get_plugins' ) ) {
81
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
82
+ }
83
+
84
+ $plugins = get_plugins();
85
+ $plugin_info = $plugins[ $plugin_init ];
86
+
87
+ $this->_plugins[ $plugin_init ] = array(
88
+ 'info' => $plugin_info,
89
+ 'slug' => $plugin_slug,
90
+ );
91
+
92
+ /* === HOOKS === */
93
+ if ( !is_multisite() || is_plugin_active_for_network( $plugin_init ) ) {
94
+ add_action( 'load-plugins.php', array( $this, 'remove_wp_plugin_update_row' ), 25 );
95
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
96
+ } else if ( is_multisite() && current_user_can( 'update_plugins' ) ) {
97
+ $transient = 'yith_register_' . md5( $plugin_slug );
98
+ if ( apply_filters( 'yith_register_delete_transient', false ) ) {
99
+ delete_transient( $transient );
100
+ }
101
+ $info = get_transient( $transient );
102
+ if ( false === $info || apply_filters( 'yith_register_delete_transient', false ) ) {
103
+ $xml = str_replace( '%plugin_slug%', $plugin_slug, $this->_xml );
104
+ $remote_xml = wp_remote_get( $xml );
105
+
106
+ if ( !is_wp_error( $remote_xml ) && isset( $remote_xml[ 'response' ][ 'code' ] ) && '200' == $remote_xml[ 'response' ][ 'code' ] ) {
107
+ $plugin_remote_info = @simplexml_load_string( $remote_xml[ 'body' ] );
108
+ if ( $plugin_remote_info ) {
109
+ $info[ 'Latest' ] = (string) $plugin_remote_info->latest;
110
+ $info[ 'changelog' ] = (string) $plugin_remote_info->changelog;
111
+ YIT_Plugin_Licence()->check( $plugin_slug, false );
112
+ set_transient( $transient, $info, DAY_IN_SECONDS );
113
+ } else {
114
+ error_log( sprintf( 'SimpleXML error in %s:%s [plugin slug: %s]',
115
+ __FILE__, __FUNCTION__, $plugin_slug ) );
116
+ }
117
+ }
118
+ }
119
+
120
+ $this->_plugins[ $plugin_init ][ 'info' ][ 'Latest' ] = $info[ 'Latest' ];
121
+ $this->_plugins[ $plugin_init ][ 'info' ][ 'changelog' ] = $info[ 'changelog' ];
122
+ add_action( 'admin_enqueue_scripts', array( $this, 'multisite_updater_script' ) );
123
+ }
124
+ }
125
+
126
+ /**
127
+ * Add the multisite updater scripts
128
+ *
129
+ * @return void
130
+ *
131
+ * @since 1.0
132
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
133
+ */
134
+ public function multisite_updater_script() {
135
+
136
+ $update_url = $changelogs = $details_url = array();
137
+ $strings = array(
138
+ 'new_version' => __( 'There is a new version of %plugin_name% available.', 'yith-plugin-fw' ),
139
+ 'latest' => __( 'View version %latest% details.', 'yith-plugin-fw' ),
140
+ 'unavailable' => __( 'Automatic update is unavailable for this plugin,', 'yith-plugin-fw' ),
141
+ 'activate' => __( 'please <a href="%activate_link%">activate</a> your copy of %plugin_name%.', 'yith-plugin-fw' ),
142
+ 'update_now' => __( 'Update now.', 'yith-plugin-fw' )
143
+
144
+ );
145
+
146
+ foreach ( $this->_plugins as $init => $info ) {
147
+ $update_url[ $init ] = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin-multisite&plugin=' ) . $init, 'upgrade-plugin-multisite_' . $init );
148
+ $changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
149
+ $details_url[ $init ] = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ), '' ) );
150
+ $plugin_changelog = isset( $this->_plugins[ $init ][ 'info' ][ 'changelog' ] ) ? $this->_plugins[ $init ][ 'info' ][ 'changelog' ] : '';
151
+ $changelogs[ $init ] = $this->in_theme_update_message( $this->_plugins[ $init ], $plugin_changelog, $changelog_id, false );
152
+ }
153
+
154
+ $localize_script_args = array(
155
+ 'registered' => $this->_plugins,
156
+ 'activated' => YIT_Plugin_Licence()->get_activated_products(),
157
+ 'licence_activation_url' => YIT_Plugin_Licence()->get_licence_activation_page_url(),
158
+ 'update_url' => $update_url,
159
+ 'details_url' => $details_url,
160
+ 'strings' => $strings,
161
+ 'changelogs' => $changelogs
162
+ );
163
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
164
+ yit_enqueue_script( 'yit-multisite-updater', YIT_CORE_PLUGIN_URL . '/assets/js/multisite-updater' . $suffix . '.js', array( 'jquery' ), false, true );
165
+
166
+ wp_localize_script( 'yit-multisite-updater', 'plugins', $localize_script_args );
167
+ }
168
+
169
+ public function admin_enqueue_scripts() {
170
+ global $pagenow;
171
+ if ( 'plugins.php' === $pagenow )
172
+ wp_enqueue_style( 'yit-upgrader', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrader.css' );
173
+ }
174
+
175
+ /**
176
+ * Retrive the zip package file
177
+ *
178
+ * @param bool $reply Whether to bail without returning the package. Default false.
179
+ * @param string $package The package file name.
180
+ * @param \WP_Upgrader $upgrader WP_Upgrader instance.
181
+ *
182
+ * @return string | The download file
183
+ *
184
+ * @since 1.0
185
+ * @see wp-admin/includes/class-wp-upgrader.php
186
+ * @access public
187
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
188
+ */
189
+ public function upgrader_pre_download( $reply, $package, $upgrader ) {
190
+ $plugin = false;
191
+ $is_bulk = $upgrader->skin instanceof Bulk_Plugin_Upgrader_Skin;
192
+
193
+ if ( !$is_bulk ) {
194
+ $plugin = isset( $upgrader->skin->plugin ) ? $upgrader->skin->plugin : false;
195
+ } else {
196
+ //Bulk action upgrade
197
+ $action_url = parse_url( $upgrader->skin->options[ 'url' ] );
198
+ parse_str( rawurldecode( htmlspecialchars_decode( $action_url[ 'query' ] ) ), $output );
199
+ $plugins = isset( $output[ 'plugins' ] ) ? $output[ 'plugins' ] : '';
200
+ $plugins = explode( ',', $plugins );
201
+ foreach ( $plugins as $plugin_init ) {
202
+ $to_upgrade = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_init );
203
+ if ( $to_upgrade[ 'Name' ] == $upgrader->skin->plugin_info[ 'Name' ] ) {
204
+ $plugin = $plugin_init;
205
+ }
206
+ }
207
+ }
208
+
209
+ /**
210
+ * It isn't YITH Premium plugins, please wordpress update it for me!
211
+ */
212
+ if ( !$plugin ) {
213
+ return $reply;
214
+ }
215
+
216
+ $plugin_info = YIT_Plugin_Licence()->get_product( $plugin );
217
+
218
+ /**
219
+ * False ? It isn't YITH Premium plugins, please wordpress update it for me!
220
+ */
221
+ if ( false === $plugin_info ) {
222
+ return $reply;
223
+ }
224
+
225
+ $licence = YIT_Plugin_Licence()->get_licence();
226
+ $product_id = $plugin_info[ 'product_id' ];
227
+ $args = array(
228
+ 'email' => $licence[ $product_id ][ 'email' ],
229
+ 'licence_key' => $licence[ $product_id ][ 'licence_key' ],
230
+ 'product_id' => $plugin_info[ 'product_id' ],
231
+ 'secret_key' => $plugin_info[ 'secret_key' ],
232
+ 'instance' => YIT_Plugin_Licence()->get_home_url(),
233
+ 'wc-api' => 'download-api',
234
+ 'request' => 'download'
235
+ );
236
+
237
+ if ( !preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) {
238
+ //Local file or remote?
239
+ return $package;
240
+ }
241
+
242
+ if ( empty( $package ) ) {
243
+ return new WP_Error( 'no_package', $upgrader->strings[ 'no_package' ] );
244
+ }
245
+
246
+ $upgrader->skin->feedback( 'downloading_package', __( 'YIThemes Repository', 'yith-plugin-fw' ) );
247
+
248
+ $download_file = $this->_download_url( $package, $args );
249
+
250
+ /**
251
+ * Regenerate update_plugins transient
252
+ */
253
+ $this->force_regenerate_update_transient();
254
+
255
+ if ( is_wp_error( $download_file ) ) {
256
+ return new WP_Error( 'download_failed', $upgrader->strings[ 'download_failed' ], $download_file->get_error_message() );
257
+ }
258
+
259
+ return $download_file;
260
+ }
261
+
262
+ /**
263
+ * Retrive the temp filename
264
+ *
265
+ * @param string $url The package url
266
+ * @param string $body The post data fields
267
+ * @param int $timeout Execution timeout (default: 300)
268
+ *
269
+ * @return string | The temp filename
270
+ *
271
+ * @since 1.0
272
+ * @see wp-admin/includes/class-wp-upgrader.php
273
+ * @access protected
274
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
275
+ */
276
+ protected function _download_url( $url, $body, $timeout = 300 ) {
277
+
278
+ //WARNING: The file is not automatically deleted, The script must unlink() the file.
279
+ if ( !$url ) {
280
+ return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.', 'yit' ) );
281
+ }
282
+
283
+ $tmpfname = wp_tempnam( $url );
284
+
285
+ $args = array(
286
+ 'timeout' => $timeout,
287
+ 'stream' => true,
288
+ 'filename' => $tmpfname,
289
+ 'body' => $body
290
+ );
291
+
292
+ if ( !$tmpfname ) {
293
+ return new WP_Error( 'http_no_file', __( 'Could not create Temporary file.', 'yit' ) );
294
+ }
295
+
296
+ $response = wp_safe_remote_post( $url, $args );
297
+
298
+ if ( is_wp_error( $response ) ) {
299
+ unlink( $tmpfname );
300
+
301
+ return $response;
302
+ }
303
+
304
+ if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
305
+ unlink( $tmpfname );
306
+
307
+ return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ) );
308
+ }
309
+
310
+ $content_md5 = wp_remote_retrieve_header( $response, 'content-md5' );
311
+
312
+ if ( $content_md5 ) {
313
+ $md5_check = verify_file_md5( $tmpfname, $content_md5 );
314
+ if ( is_wp_error( $md5_check ) ) {
315
+ unlink( $tmpfname );
316
+
317
+ return $md5_check;
318
+ }
319
+ }
320
+
321
+ return $tmpfname;
322
+ }
323
+
324
+ /**
325
+ * Main plugin Instance
326
+ *
327
+ * @static
328
+ * @return object Main instance
329
+ *
330
+ * @since 1.0
331
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
332
+ */
333
+ public static function instance() {
334
+ if ( is_null( self::$_instance ) ) {
335
+ self::$_instance = new self();
336
+ }
337
+
338
+ return self::$_instance;
339
+ }
340
+
341
+ /**
342
+ * Delete the update plugins transient
343
+ *
344
+ * @return void
345
+ *
346
+ * @since 1.0
347
+ * @see update_plugins transient and pre_set_site_transient_update_plugins hooks
348
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
349
+ */
350
+ public function force_regenerate_update_transient() {
351
+ delete_site_transient( 'update_plugins' );
352
+ }
353
+
354
+ /**
355
+ * Check for plugins update
356
+ *
357
+ * If a new plugin version is available set it in the pre_set_site_transient_update_plugins hooks
358
+ *
359
+ * @param mixed $transient | update_plugins transient value
360
+ * @param bool $save | Default: false. Set true to regenerate the update_transient plugins
361
+ *
362
+ * @return mixed $transient | The new update_plugins transient value
363
+ *
364
+ * @since 1.0
365
+ * @see update_plugins transient and pre_set_site_transient_update_plugins hooks
366
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
367
+ */
368
+ public function check_update( $transient, $save = false ) {
369
+
370
+ foreach ( $this->_plugins as $init => $plugin ) {
371
+ $plugin_slug = $this->_plugins[ $init ][ 'slug' ];
372
+ $xml = str_replace( '%plugin_slug%', $plugin_slug, $this->_xml );
373
+ $remote_xml = wp_remote_get( $xml );
374
+
375
+ if ( !is_wp_error( $remote_xml ) && isset( $remote_xml[ 'response' ][ 'code' ] ) && '200' == $remote_xml[ 'response' ][ 'code' ] ) {
376
+
377
+ $plugin_remote_info = @simplexml_load_string( $remote_xml[ 'body' ] );
378
+
379
+ if ( $plugin_remote_info ) {
380
+
381
+ if ( version_compare( $plugin_remote_info->latest, $plugin[ 'info' ][ 'Version' ], '>' ) && !isset( $transient->response[ $init ] ) ) {
382
+
383
+ $package = YIT_Plugin_Licence()->check( $init ) ? $this->_package_url : null;
384
+
385
+ $obj = new stdClass();
386
+ $obj->slug = (string) $init;
387
+ $obj->new_version = (string) $plugin_remote_info->latest;
388
+ $obj->changelog = (string) $plugin_remote_info->changelog;
389
+ $obj->package = $package;
390
+ $obj->plugin = $init;
391
+ $transient->response[ $init ] = $obj;
392
+ }
393
+
394
+ } else {
395
+ error_log( sprintf( 'SimpleXML error in %s:%s [plugin slug: %s]',
396
+ __FILE__, __FUNCTION__, $plugin_slug ) );
397
+
398
+ return $transient;
399
+ }
400
+ }
401
+ }
402
+
403
+ if ( $save ) {
404
+ set_site_transient( 'update_plugins', $transient );
405
+ }
406
+
407
+ return $transient;
408
+ }
409
+
410
+ /**
411
+ * Add the plugin update row in plugin page
412
+ *
413
+ * @return void
414
+ * @fire "in_theme_update_message-{$init}" action
415
+ *
416
+ * @since 1.0
417
+ * @see after_plugin_row_{$init} action
418
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
419
+ */
420
+ public function plugin_update_row() {
421
+
422
+ $current = get_site_transient( 'update_plugins' );
423
+ $init = str_replace( 'after_plugin_row_', '', current_filter() );
424
+
425
+ if ( !isset( $current->response[ $init ] ) ) {
426
+ return false;
427
+ }
428
+
429
+ /**
430
+ * stdClass Object
431
+ */
432
+ $r = $current->response[ $init ];
433
+
434
+ $changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
435
+ $details_url = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ), '' ) );
436
+
437
+ /**
438
+ * @see wp_plugin_update_rows() in wp-single\wp-admin\includes\update.php
439
+ */
440
+ $wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );
441
+
442
+ if ( is_network_admin() || !is_multisite() || true ) {
443
+ global $wp_version;
444
+ $is_wp_4_6 = version_compare( $wp_version, '4.6', '>=' );
445
+
446
+ echo '<tr class="plugin-update-tr' . ( is_plugin_active( $init ) ? ' active' : '' ) . '"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">';
447
+
448
+ echo '<div class="update-message' . ( $is_wp_4_6 ? ' notice inline notice-warning notice-alt' : '' ) . '">';
449
+
450
+ echo( $is_wp_4_6 ? '<p>' : '' );
451
+
452
+ if ( !current_user_can( 'update_plugins' ) ) {
453
+ printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button open-plugin-details-modal" title="%3$s">View version %4$s details</a>.', 'yith-plugin-fw' ), $this->_plugins[ $init ][ 'info' ][ 'Name' ], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ][ 'info' ][ 'Name' ] ), $r->new_version );
454
+ } elseif ( is_plugin_active_for_network( $init ) ) {
455
+ printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button open-plugin-details-modal" title="%3$s">View version %4$s details</a>. <em>You have to activate the plugin on a single site of the network to benefit from automatic updates.</em>', 'yith-plugin-fw' ), $this->_plugins[ $init ][ 'info' ][ 'Name' ], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ][ 'info' ][ 'Name' ] ), $r->new_version );
456
+ } elseif ( empty( $r->package ) ) {
457
+ printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button open-plugin-details-modal" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin, please <a href="%5$s" title="License activation">activate</a> your copy of %6s.</em>', 'yith-plugin-fw' ), $this->_plugins[ $init ][ 'info' ][ 'Name' ], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ][ 'info' ][ 'Name' ] ), $r->new_version, YIT_Plugin_Licence()->get_licence_activation_page_url(), $this->_plugins[ $init ][ 'info' ][ 'Name' ] );
458
+ } else {
459
+ printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button open-plugin-details-modal" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.', 'yith-plugin-fw' ), $this->_plugins[ $init ][ 'info' ][ 'Name' ], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ][ 'info' ][ 'Name' ] ), $r->new_version, wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $init, 'upgrade-plugin_' . $init ) );
460
+ }
461
+
462
+ echo( $is_wp_4_6 ? '</p>' : '' );
463
+
464
+ /**
465
+ * Fires at the end of the update message container in each
466
+ * row of the themes list table.
467
+ *
468
+ * The dynamic portion of the hook name, `$theme_key`, refers to
469
+ * the theme slug as found in the WordPress.org themes repository.
470
+ *
471
+ * @since Wordpress 3.1.0
472
+ * }
473
+ */
474
+ do_action( "in_theme_update_message-{$init}", $this->_plugins[ $init ], $r->changelog, $changelog_id );
475
+
476
+ echo '</div></td></tr>';
477
+ }
478
+ }
479
+
480
+ /**
481
+ * Remove the standard plugin_update_row
482
+ *
483
+ * Remove the standard plugin_update_row and Add a custom plugin update row in plugin page.
484
+ *
485
+ * @return void
486
+ * @fire "in_theme_update_message-{$init}" action
487
+ *
488
+ * @since 1.0
489
+ * @see after_plugin_row_{$init} action
490
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
491
+ */
492
+ public function remove_wp_plugin_update_row() {
493
+ foreach ( $this->_plugins as $init => $plugin ) {
494
+ remove_action( "after_plugin_row_{$init}", 'wp_plugin_update_row', 10 );
495
+ add_action( "after_plugin_row_{$init}", array( $this, 'plugin_update_row' ) );
496
+ add_action( "in_theme_update_message-{$init}", array( $this, 'in_theme_update_message' ), 10, 3 );
497
+ }
498
+ }
499
+
500
+ public function in_theme_update_message( $plugin, $changelog, $changelog_id, $echo = true ) {
501
+
502
+ $res
503
+ = "<div id='{$changelog_id}' class='yit-plugin-changelog-wrapper'>
504
  <div class='yit-plugin-changelog'>
505
  <h2 class='yit-plugin-changelog-title'>{$plugin['info']['Name']} - Changelog</h2>
506
  <p>{$changelog}</p>
507
  </div>
508
  </div>";
509
 
510
+ if ( $echo ) {
511
+ echo $res;
512
+ } else {
513
+ return $res;
514
+ }
515
+ }
516
+
517
+ /**
518
+ * Auto-Update Plugin in multisite
519
+ *
520
+ * Manage the non standard upgrade-plugin-multisite action
521
+ *
522
+ * @return void
523
+ *
524
+ * @since 1.0
525
+ * @see upgrade-plugin action
526
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
527
+ */
528
+ public function upgrade_plugin_multisite() {
529
+
530
+ $plugin = isset( $_REQUEST[ 'plugin' ] ) ? trim( $_REQUEST[ 'plugin' ] ) : '';
531
+ $action = isset( $_REQUEST[ 'action' ] ) ? $_REQUEST[ 'action' ] : '';
532
+
533
+ if ( 'upgrade-plugin-multisite' != $action ) {
534
+ wp_die( __( 'You can\'t update the plugins for this site.', 'yith-plugin-fw' ) );
535
+ }
536
+
537
+ if ( !current_user_can( 'update_plugins' ) ) {
538
+ wp_die( __( 'You do not have sufficient permissions to update the plugins for this site.', 'yith-plugin-fw' ) );
539
+ }
540
+
541
+ $this->check_update( get_site_transient( 'update_plugins' ), true );
542
+
543
+ check_admin_referer( 'upgrade-plugin-multisite_' . $plugin );
544
+
545
+ $title = __( 'Update Plugin', 'yith-plugin-fw' );
546
+ $parent_file = 'plugins.php';
547
+ $submenu_file = 'plugins.php';
548
+
549
+ wp_enqueue_script( 'updates' );
550
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
551
+
552
+ $nonce = 'upgrade-plugin-multisite_' . $plugin;
553
+ $url = 'update.php?action=upgrade-plugin-multisite&plugin=' . urlencode( $plugin );
554
+
555
+ $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'plugin' ) ) );
556
+ $upgrader->upgrade( $plugin );
557
+
558
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
559
+ }
560
+ }
561
  }
562
 
563
+ if ( !function_exists( 'YIT_Upgrade' ) ) {
564
+ /**
565
+ * Main instance of plugin
566
+ *
567
+ * @return YIT_Upgrade
568
+ * @since 1.0
569
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
570
+ */
571
+ function YIT_Upgrade() {
572
+ return YIT_Upgrade::instance();
573
+ }
574
  }
575
 
576
  /**
plugin-fw/licence/assets/css/yit-licence.css CHANGED
@@ -9,10 +9,12 @@
9
  }
10
 
11
  .yit-plugin-changelog {
 
 
 
 
 
12
  background: #fcfcfc;
13
- height: 97%;
14
- z-index: 999;
15
- overflow: auto;
16
  }
17
 
18
  /* === Plugins Licence Activation === */
9
  }
10
 
11
  .yit-plugin-changelog {
12
+ height : calc(100% - 15px);
13
+ width : calc(100% - 15px);
14
+ overflow-x : hidden;
15
+ overflow-y : auto;
16
+ z-index : 999;
17
  background: #fcfcfc;
 
 
 
18
  }
19
 
20
  /* === Plugins Licence Activation === */
plugin-fw/licence/lib/yit-licence.php CHANGED
@@ -8,11 +8,11 @@
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
- if ( ! defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
- if ( ! class_exists( 'YIT_Licence' ) ) {
16
  /**
17
  * YIT Licence Panel
18
  *
@@ -23,7 +23,6 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
23
  * @since 1.0
24
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
  */
26
-
27
  abstract class YIT_Licence {
28
 
29
  /**
@@ -44,7 +43,7 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
44
  */
45
  protected $_licence_option = 'yit_products_licence_activation';
46
 
47
- /**
48
  * @var string The yithemes api uri
49
  * @since 1.0
50
  */
@@ -63,7 +62,7 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
63
  */
64
  public $show_extra_info = false;
65
 
66
- /**
67
  * @var string check for show extra info
68
  * @since 1.0
69
  */
@@ -84,14 +83,12 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
84
 
85
  /* Style adn Script */
86
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
87
- if( $is_debug_enabled ) {
88
  //show extra info and renew button in debug mode
89
  $this->show_extra_info = $this->show_renew_button = true;
90
- }
91
-
92
- else {
93
- $this->show_extra_info = defined( 'YIT_SHOW_EXTRA_LICENCE_INFO' ) && YIT_SHOW_EXTRA_LICENCE_INFO;
94
- $this->show_renew_button = ! ( defined( 'YIT_HIDE_LICENCE_RENEW_BUTTON' ) && YIT_HIDE_LICENCE_RENEW_BUTTON );
95
  }
96
 
97
  /* Update Licence Information */
@@ -130,20 +127,27 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
130
  /**
131
  * Get The home url without protocol
132
  *
133
- * @return string | The home url
134
  *
135
  * @since 1.0
136
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
137
  */
138
  public function get_home_url() {
139
- $home_url = home_url();
140
- $schemes = apply_filters( 'yit_licence_url_schemes', array( 'https://', 'http://' ) );
141
 
142
- foreach( $schemes as $scheme ){
143
  $home_url = str_replace( $scheme, '', $home_url );
144
  }
145
 
146
- return apply_filters('yit_licence_get_home_url', $home_url );
 
 
 
 
 
 
 
147
  }
148
 
149
  /**
@@ -158,7 +162,7 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
158
  return defined( 'DOING_AJAX' ) && DOING_AJAX ? true : false;
159
  }
160
 
161
- /**
162
  * Admin Enqueue Scripts
163
  *
164
  * @return void
@@ -166,33 +170,39 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
166
  * @since 1.0
167
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
168
  */
169
- public function admin_enqueue_scripts(){
170
 
171
  /**
172
  * Support to YIT Framework < 2.0
173
  */
174
- $filename = function_exists( 'yit_load_js_file' ) ? yit_load_js_file( 'yit-licence.js' ) : 'yit-licence.js';
175
- $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
176
- $style_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
177
 
178
- wp_enqueue_script( 'yit-licence', $script_path . '/licence/assets/js/' . $filename, array( 'jquery' ), '1.0.0', true );
179
- wp_enqueue_style( 'yit-theme-licence', $style_path . '/licence/assets/css/yit-licence.css' );
180
 
181
  /* Localize Scripts */
182
  wp_localize_script( 'yit-licence', 'licence_message', array(
183
- 'error' => sprintf( _x( '%s field cannot be empty', '%s = field name', 'yith-plugin-fw' ), '%field%' ), // sprintf must be used to avoid errors with '%field%' string in translation in .po file
184
- 'errors' => sprintf( __( '%s and %s fields cannot be empty', 'yith-plugin-fw' ), '%field_1%', '%field_2%' ),
185
- 'server' => __( 'Unable to contact the remote server, please try again later. Thanks!', 'yith-plugin-fw' ),
186
- 'email' => __( 'Email', 'yith-plugin-fw' ),
187
- 'license_key' => __( 'License Key', 'yith-plugin-fw' ),
188
- 'are_you_sure' => __( 'Are you sure you want to deactivate the license for current site?', 'yith-plugin-fw' )
189
- )
190
  );
191
 
192
  wp_localize_script( 'yit-licence', 'script_info', array(
193
- 'is_debug' => defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG
194
- )
195
  );
 
 
 
 
 
 
196
  }
197
 
198
  /**
@@ -207,44 +217,44 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
207
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
208
  */
209
  public function activate() {
210
- $product_init = $_REQUEST['product_init'];
211
  $product = $this->get_product( $product_init );
212
 
213
  $args = array(
214
- 'email' => urlencode( sanitize_email( $_REQUEST['email'] ) ),
215
- 'licence_key' => sanitize_text_field( $_REQUEST['licence_key'] ),
216
- 'product_id' => sanitize_text_field( $product['product_id'] ),
217
- 'secret_key' => sanitize_text_field( $product['secret_key'] ),
218
  'instance' => $this->get_home_url()
219
  );
220
 
221
  $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'activation' ) ) );
222
- $response = wp_remote_get( $api_uri, array( 'timeout' => 30 ) );
 
223
 
224
  if ( is_wp_error( $response ) ) {
225
  $body = false;
226
- }
227
- else {
228
- $body = json_decode( $response['body'] );
229
  $body = is_object( $body ) ? get_object_vars( $body ) : false;
230
  }
231
 
232
- if ( $body && is_array( $body ) && isset( $body['activated'] ) && $body['activated'] ) {
233
-
234
- $option[$product['product_id']] = array(
235
- 'email' => urldecode( $args['email'] ),
236
- 'licence_key' => $args['licence_key'],
237
- 'licence_expires' => $body['licence_expires'],
238
- 'message' => $body['message'],
239
- 'activated' => true,
240
- 'activation_limit' => $body['activation_limit'],
241
- 'activation_remaining' => $body['activation_remaining'],
242
- 'is_membership' => isset( $body['is_membership'] ) ? $body['is_membership'] : false,
243
  );
244
 
245
  /* === Check for other plugins activation === */
246
- $options = $this->get_licence();
247
- $options[$product['product_id']] = $option[$product['product_id']];
248
 
249
  update_option( $this->_licence_option, $options );
250
 
@@ -252,7 +262,7 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
252
  YIT_Upgrade()->force_regenerate_update_transient();
253
 
254
  /* === Licence Activation Template === */
255
- $body['template'] = $this->show_activation_panel( $this->get_response_code_message( 200 ) );
256
  }
257
 
258
  wp_send_json( $body );
@@ -270,44 +280,44 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
270
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
271
  */
272
  public function deactivate() {
273
- $product_init = $_REQUEST['product_init'];
274
  $product = $this->get_product( $product_init );
275
 
276
  $args = array(
277
- 'email' => urlencode( sanitize_email( $_REQUEST['email'] ) ),
278
- 'licence_key' => sanitize_text_field( $_REQUEST['licence_key'] ),
279
- 'product_id' => sanitize_text_field( $product['product_id'] ),
280
- 'secret_key' => sanitize_text_field( $product['secret_key'] ),
281
  'instance' => $this->get_home_url()
282
  );
283
 
284
  $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'deactivation' ) ) );
285
- $response = wp_remote_get( $api_uri, array( 'timeout' => 30 ) );
 
286
 
287
  if ( is_wp_error( $response ) ) {
288
  $body = false;
289
- }
290
- else {
291
- $body = json_decode( $response['body'] );
292
  $body = is_object( $body ) ? get_object_vars( $body ) : false;
293
  }
294
 
295
- if ( $body && is_array( $body ) && isset( $body['activated'] ) && ! $body['activated'] && ! isset( $body['error'] ) ) {
296
-
297
- $option[$product['product_id']] = array(
298
- 'activated' => false,
299
- 'email' => urldecode( $args['email'] ),
300
- 'licence_key' => $args['licence_key'],
301
- 'licence_expires' => $body['licence_expires'],
302
- 'message' => $body['message'],
303
- 'activation_limit' => $body['activation_limit'],
304
- 'activation_remaining' => $body['activation_remaining'],
305
- 'is_membership' => isset( $body['is_membership'] ) ? $body['is_membership'] : false,
306
  );
307
 
308
  /* === Check for other plugins activation === */
309
- $options = $this->get_licence();
310
- $options[$product['product_id']] = $option[$product['product_id']];
311
 
312
  update_option( $this->_licence_option, $options );
313
 
@@ -315,11 +325,9 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
315
  YIT_Upgrade()->force_regenerate_update_transient();
316
 
317
  /* === Licence Activation Template === */
318
- $body['template'] = $this->show_activation_panel( $this->get_response_code_message( 'deactivated', array( 'instance' => $body['instance'] ) ) );
319
- }
320
-
321
- else {
322
- $body['error'] = $this->get_response_code_message( $body['code'] );
323
  }
324
 
325
  wp_send_json( $body );
@@ -343,45 +351,45 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
343
  $body = false;
344
  $product = $this->get_product( $product_init );
345
  $licence = $this->get_licence();
346
- $product_id = $product['product_id'];
347
 
348
- if( ! isset( $licence[ $product_id ] ) ) {
349
  return false;
350
  }
351
 
352
  $args = array(
353
- 'email' => urlencode( $licence[$product_id]['email'] ),
354
- 'licence_key' => $licence[$product_id]['licence_key'],
355
  'product_id' => $product_id,
356
- 'secret_key' => $product['secret_key'],
357
  'instance' => $this->get_home_url()
358
  );
359
 
360
  $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'check' ) ) );
361
- $response = wp_remote_get( $api_uri, array( 'timeout' => 30 ) );
 
362
 
363
- if ( ! is_wp_error( $response ) ) {
364
- $body = json_decode( $response['body'] );
365
  $body = is_object( $body ) ? get_object_vars( $body ) : false;
366
  }
367
 
368
- if ( $body && is_array( $body ) && isset( $body['success'] ) ) {
369
- if ( $body['success'] ) {
370
 
371
  /**
372
  * Code 200 -> Licence key is valid
373
  */
374
- $licence[ $product_id ]['status_code'] = '200';
375
- $licence[ $product_id ]['activated'] = $body['activated'];
376
- $licence[ $product_id ]['licence_expires'] = $body['licence_expires'];
377
- $licence[ $product_id ]['activation_remaining'] = $body['activation_remaining'];
378
- $licence[ $product_id ]['activation_limit'] = $body['activation_limit'];
379
- $licence[ $product_id ]['is_membership'] = isset( $body['is_membership'] ) ? $body['is_membership'] : false;
380
- $status = (bool) $body['activated'];
381
- }
382
- elseif ( isset( $body['code'] ) ) {
383
 
384
- switch ( $body['code'] ) {
385
 
386
  /**
387
  * Error Code List:
@@ -406,17 +414,17 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
406
  break;
407
 
408
  case '106':
409
- $licence[ $product_id ]['activated'] = false;
410
- $licence[ $product_id ]['message'] = $body['error'];
411
- $licence[ $product_id ]['status_code'] = $body['code'];
412
- $licence[ $product_id ]['licence_expires'] = $body['licence_expires'];
413
  //$licence[ $product_id ]['is_membership'] = isset( $body['is_membership'] ) ? $body['is_membership'] : false;
414
  break;
415
 
416
  case '107':
417
- $licence[ $product_id ]['activated'] = false;
418
- $licence[ $product_id ]['message'] = $body['error'];
419
- $licence[ $product_id ]['status_code'] = $body['code'];
420
  //$licence[ $product_id ]['is_membership'] = isset( $body['is_membership'] ) ? $body['is_membership'] : false;
421
  break;
422
  }
@@ -426,10 +434,11 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
426
  update_option( $this->_licence_option, $licence );
427
 
428
  /* === Update Plugin Licence Information === */
429
- if( $regenerate_transient ) {
430
  YIT_Upgrade()->force_regenerate_update_transient();
431
  }
432
  }
 
433
  return $status;
434
  }
435
 
@@ -442,13 +451,13 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
442
  * @use YIT_Theme_Licence->check()
443
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
444
  */
445
- public function check_all(){
446
  foreach ( $this->_products as $init => $info ) {
447
  $this->check( $init );
448
  }
449
  }
450
 
451
- /**
452
  * Update Plugins Information
453
  *
454
  * Send a request to API server to check activate plugins and update the informations
@@ -468,8 +477,8 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
468
 
469
  do_action( 'yit_licence_after_check' );
470
 
471
- if( $this->is_ajax() ) {
472
- $response['template'] = $this->show_activation_panel();
473
  wp_send_json( $response );
474
  }
475
  }
@@ -489,9 +498,9 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
489
  if ( $this->is_ajax() ) {
490
  ob_start();
491
  require_once( $path . '/licence/templates/panel/activation/activation-panel.php' );
 
492
  return ob_get_clean();
493
- }
494
- else {
495
  require_once( $path . '/licence/templates/panel/activation/activation-panel.php' );
496
  }
497
  }
@@ -506,14 +515,14 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
506
  */
507
  public function get_activated_products() {
508
  $activated_products = array();
509
- $licence = $this->get_licence();
510
 
511
  if ( is_array( $licence ) ) {
512
  foreach ( $this->_products as $init => $info ) {
513
- if ( in_array( $info['product_id'], array_keys( $licence ) ) && isset( $licence[$info['product_id']]['activated'] ) && $licence[$info['product_id']]['activated'] ) {
514
- $product[$init] = $this->_products[$init];
515
- $product[$init]['licence'] = $licence[$info['product_id']];
516
- $activated_products[$init] = $product[$init];
517
  }
518
  }
519
  }
@@ -543,30 +552,31 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
543
  */
544
  public function get_no_active_licence_key() {
545
  $unactive_products = $this->get_to_active_products();
546
- $licence = $this->get_licence();
547
- $licence_key = array();
548
 
549
  /**
550
  * Remove banned licence key
551
  */
552
  foreach ( $unactive_products as $init => $info ) {
553
- $product_id = $unactive_products[$init]['product_id'];
554
- if ( isset( $licence[$product_id]['activated'] ) && ! $licence[$product_id]['activated'] && isset( $licence[$product_id]['status_code'] ) ) {
555
- $status_code = $licence[$product_id]['status_code'];
556
 
557
  switch ( $status_code ) {
558
  case '106':
559
- $licence_key[$status_code][$init] = $unactive_products[$init];
560
- $licence_key[$status_code][$init]['licence'] = $licence[$product_id];
561
  break;
562
 
563
  case '107':
564
- $licence_key[$status_code][$init] = $unactive_products[$init];
565
- $licence_key[$status_code][$init]['licence'] = $licence[$product_id];
566
  break;
567
  }
568
  }
569
  }
 
570
  return $licence_key;
571
  }
572
 
@@ -581,10 +591,10 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
581
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
582
  */
583
  public function get_product( $init ) {
584
- return isset( $this->_products[$init] ) ? $this->_products[$init] : false;
585
  }
586
 
587
- /**
588
  * Get product product id information
589
  *
590
  * @param $product_init | product init file
@@ -595,7 +605,7 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
595
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
596
  */
597
  public function get_product_id( $init ) {
598
- return isset( $this->_products[$init]['product_id'] ) ? $this->_products[$init]['product_id'] : false;
599
  }
600
 
601
  /**
@@ -609,7 +619,7 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
609
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
610
  */
611
  public function get_renewing_uri( $licence_key ) {
612
- return ! empty( $licence_key ) ? str_replace( 'www.', '', $this->_api_uri ) . '?renewing_key=' . $licence_key : false;
613
  }
614
 
615
  /**
@@ -635,7 +645,7 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
635
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
636
  */
637
  public function get_licence_activation_page_url() {
638
- return esc_url( add_query_arg( array( 'page' => $this->_settings['page'] ), admin_url( 'admin.php' ) ) );
639
  }
640
 
641
 
@@ -665,20 +675,20 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
665
  extract( $args );
666
 
667
  $messages = array(
668
- '100' => __( 'Invalid Request', 'yith-plugin-fw' ),
669
- '101' => __( 'Invalid license key', 'yith-plugin-fw' ),
670
- '102' => __( 'Software has been deactivated', 'yith-plugin-fw' ),
671
- '103' => __( 'Maximum number of activations exceeded', 'yith-plugin-fw' ),
672
- '104' => __( 'Invalid instance ID', 'yith-plugin-fw' ),
673
- '105' => __( 'Invalid security key', 'yith-plugin-fw' ),
674
- '106' => __( 'License key has expired', 'yith-plugin-fw' ),
675
- '107' => __( 'License key has been banned', 'yith-plugin-fw' ),
676
- '108' => __( 'Current product is not included in your YITH Club Subscription key', 'yith-plugin-fw' ),
677
- '200' => sprintf( '<strong>%s</strong>! %s',__( 'Great', 'yith-plugin-fw' ), __( 'License successfully activated', 'yith-plugin-fw' ) ),
678
- 'deactivated' => sprintf( '%s <strong>%s</strong>', __( 'License key deactivated for website', 'woocommerce-software-add-on' ), isset( $instance ) ? $instance : '' )
679
  );
680
 
681
- return isset( $messages[$code] ) ? $messages[$code] : false;
682
  }
683
 
684
  /**
@@ -691,20 +701,21 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
691
  * @since 2.2
692
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
693
  */
694
- public function display_product_name( $product_name ){
695
  return str_replace( array( 'for WooCommerce', 'YITH', 'WooCommerce', 'Premium', 'Theme', 'WordPress' ), '', $product_name );
696
  }
697
 
698
- public function get_number_of_membership_products(){
699
- $activated_products = $this->get_activated_products();
700
  $num_members_products_activate = 0;
701
- foreach( $activated_products as $activated_product ){
702
- if( isset( $activated_product['licence']['is_membership'] ) && $activated_product['licence']['is_membership'] ){
703
  $num_members_products_activate++;
704
  }
705
  }
 
706
  return $num_members_products_activate;
707
  }
708
 
709
  }
710
- }
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
+ if ( !defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
+ if ( !class_exists( 'YIT_Licence' ) ) {
16
  /**
17
  * YIT Licence Panel
18
  *
23
  * @since 1.0
24
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
  */
 
26
  abstract class YIT_Licence {
27
 
28
  /**
43
  */
44
  protected $_licence_option = 'yit_products_licence_activation';
45
 
46
+ /**
47
  * @var string The yithemes api uri
48
  * @since 1.0
49
  */
62
  */
63
  public $show_extra_info = false;
64
 
65
+ /**
66
  * @var string check for show extra info
67
  * @since 1.0
68
  */
83
 
84
  /* Style adn Script */
85
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
86
+ if ( $is_debug_enabled ) {
87
  //show extra info and renew button in debug mode
88
  $this->show_extra_info = $this->show_renew_button = true;
89
+ } else {
90
+ $this->show_extra_info = defined( 'YIT_SHOW_EXTRA_LICENCE_INFO' ) && YIT_SHOW_EXTRA_LICENCE_INFO;
91
+ $this->show_renew_button = !( defined( 'YIT_HIDE_LICENCE_RENEW_BUTTON' ) && YIT_HIDE_LICENCE_RENEW_BUTTON );
 
 
92
  }
93
 
94
  /* Update Licence Information */
127
  /**
128
  * Get The home url without protocol
129
  *
130
+ * @return string the home url
131
  *
132
  * @since 1.0
133
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
134
  */
135
  public function get_home_url() {
136
+ $home_url = home_url();
137
+ $schemes = array( 'https://', 'http://', 'www.' );
138
 
139
+ foreach ( $schemes as $scheme ) {
140
  $home_url = str_replace( $scheme, '', $home_url );
141
  }
142
 
143
+ if ( strpos( $home_url, '?' ) !== false ) {
144
+ list( $base, $query ) = explode( '?', $home_url, 2 );
145
+ $home_url = $base;
146
+ }
147
+
148
+ $home_url = untrailingslashit( $home_url );
149
+
150
+ return $home_url;
151
  }
152
 
153
  /**
162
  return defined( 'DOING_AJAX' ) && DOING_AJAX ? true : false;
163
  }
164
 
165
+ /**
166
  * Admin Enqueue Scripts
167
  *
168
  * @return void
170
  * @since 1.0
171
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
172
  */
173
+ public function admin_enqueue_scripts() {
174
 
175
  /**
176
  * Support to YIT Framework < 2.0
177
  */
178
+ $filename = function_exists( 'yit_load_js_file' ) ? yit_load_js_file( 'yit-licence.js' ) : 'yit-licence.js';
179
+ $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
180
+ $style_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
181
 
182
+ wp_register_script( 'yit-licence', $script_path . '/licence/assets/js/' . $filename, array( 'jquery' ), '1.0.0', true );
183
+ wp_register_style( 'yit-theme-licence', $style_path . '/licence/assets/css/yit-licence.css' );
184
 
185
  /* Localize Scripts */
186
  wp_localize_script( 'yit-licence', 'licence_message', array(
187
+ 'error' => sprintf( _x( '%s field cannot be empty', '%s = field name', 'yith-plugin-fw' ), '%field%' ), // sprintf must be used to avoid errors with '%field%' string in translation in .po file
188
+ 'errors' => sprintf( __( '%s and %s fields cannot be empty', 'yith-plugin-fw' ), '%field_1%', '%field_2%' ),
189
+ 'server' => __( 'Unable to contact the remote server, please try again later. Thanks!', 'yith-plugin-fw' ),
190
+ 'email' => __( 'Email', 'yith-plugin-fw' ),
191
+ 'license_key' => __( 'License Key', 'yith-plugin-fw' ),
192
+ 'are_you_sure' => __( 'Are you sure you want to deactivate the license for current site?', 'yith-plugin-fw' )
193
+ )
194
  );
195
 
196
  wp_localize_script( 'yit-licence', 'script_info', array(
197
+ 'is_debug' => defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG
198
+ )
199
  );
200
+
201
+ /* Enqueue Scripts only in Licence Activation page */
202
+ if ( strpos( get_current_screen()->id, 'yith_plugins_activation' ) !== false ) {
203
+ wp_enqueue_script( 'yit-licence' );
204
+ wp_enqueue_style( 'yit-theme-licence' );
205
+ }
206
  }
207
 
208
  /**
217
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
218
  */
219
  public function activate() {
220
+ $product_init = $_REQUEST[ 'product_init' ];
221
  $product = $this->get_product( $product_init );
222
 
223
  $args = array(
224
+ 'email' => urlencode( sanitize_email( $_REQUEST[ 'email' ] ) ),
225
+ 'licence_key' => sanitize_text_field( $_REQUEST[ 'licence_key' ] ),
226
+ 'product_id' => sanitize_text_field( $product[ 'product_id' ] ),
227
+ 'secret_key' => sanitize_text_field( $product[ 'secret_key' ] ),
228
  'instance' => $this->get_home_url()
229
  );
230
 
231
  $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'activation' ) ) );
232
+ $timeout = apply_filters( 'yith_plugin_fw_licence_timeout', 30, __FUNCTION__ );
233
+ $response = wp_remote_get( $api_uri, array( 'timeout' => $timeout ) );
234
 
235
  if ( is_wp_error( $response ) ) {
236
  $body = false;
237
+ } else {
238
+ $body = json_decode( $response[ 'body' ] );
 
239
  $body = is_object( $body ) ? get_object_vars( $body ) : false;
240
  }
241
 
242
+ if ( $body && is_array( $body ) && isset( $body[ 'activated' ] ) && $body[ 'activated' ] ) {
243
+
244
+ $option[ $product[ 'product_id' ] ] = array(
245
+ 'email' => urldecode( $args[ 'email' ] ),
246
+ 'licence_key' => $args[ 'licence_key' ],
247
+ 'licence_expires' => $body[ 'licence_expires' ],
248
+ 'message' => $body[ 'message' ],
249
+ 'activated' => true,
250
+ 'activation_limit' => $body[ 'activation_limit' ],
251
+ 'activation_remaining' => $body[ 'activation_remaining' ],
252
+ 'is_membership' => isset( $body[ 'is_membership' ] ) ? $body[ 'is_membership' ] : false,
253
  );
254
 
255
  /* === Check for other plugins activation === */
256
+ $options = $this->get_licence();
257
+ $options[ $product[ 'product_id' ] ] = $option[ $product[ 'product_id' ] ];
258
 
259
  update_option( $this->_licence_option, $options );
260
 
262
  YIT_Upgrade()->force_regenerate_update_transient();
263
 
264
  /* === Licence Activation Template === */
265
+ $body[ 'template' ] = $this->show_activation_panel( $this->get_response_code_message( 200 ) );
266
  }
267
 
268
  wp_send_json( $body );
280
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
281
  */
282
  public function deactivate() {
283
+ $product_init = $_REQUEST[ 'product_init' ];
284
  $product = $this->get_product( $product_init );
285
 
286
  $args = array(
287
+ 'email' => urlencode( sanitize_email( $_REQUEST[ 'email' ] ) ),
288
+ 'licence_key' => sanitize_text_field( $_REQUEST[ 'licence_key' ] ),
289
+ 'product_id' => sanitize_text_field( $product[ 'product_id' ] ),
290
+ 'secret_key' => sanitize_text_field( $product[ 'secret_key' ] ),
291
  'instance' => $this->get_home_url()
292
  );
293
 
294
  $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'deactivation' ) ) );
295
+ $timeout = apply_filters( 'yith_plugin_fw_licence_timeout', 30, __FUNCTION__ );
296
+ $response = wp_remote_get( $api_uri, array( 'timeout' => $timeout ) );
297
 
298
  if ( is_wp_error( $response ) ) {
299
  $body = false;
300
+ } else {
301
+ $body = json_decode( $response[ 'body' ] );
 
302
  $body = is_object( $body ) ? get_object_vars( $body ) : false;
303
  }
304
 
305
+ if ( $body && is_array( $body ) && isset( $body[ 'activated' ] ) && !$body[ 'activated' ] && !isset( $body[ 'error' ] ) ) {
306
+
307
+ $option[ $product[ 'product_id' ] ] = array(
308
+ 'activated' => false,
309
+ 'email' => urldecode( $args[ 'email' ] ),
310
+ 'licence_key' => $args[ 'licence_key' ],
311
+ 'licence_expires' => $body[ 'licence_expires' ],
312
+ 'message' => $body[ 'message' ],
313
+ 'activation_limit' => $body[ 'activation_limit' ],
314
+ 'activation_remaining' => $body[ 'activation_remaining' ],
315
+ 'is_membership' => isset( $body[ 'is_membership' ] ) ? $body[ 'is_membership' ] : false,
316
  );
317
 
318
  /* === Check for other plugins activation === */
319
+ $options = $this->get_licence();
320
+ $options[ $product[ 'product_id' ] ] = $option[ $product[ 'product_id' ] ];
321
 
322
  update_option( $this->_licence_option, $options );
323
 
325
  YIT_Upgrade()->force_regenerate_update_transient();
326
 
327
  /* === Licence Activation Template === */
328
+ $body[ 'template' ] = $this->show_activation_panel( $this->get_response_code_message( 'deactivated', array( 'instance' => $body[ 'instance' ] ) ) );
329
+ } else {
330
+ $body[ 'error' ] = $this->get_response_code_message( $body[ 'code' ] );
 
 
331
  }
332
 
333
  wp_send_json( $body );
351
  $body = false;
352
  $product = $this->get_product( $product_init );
353
  $licence = $this->get_licence();
354
+ $product_id = $product[ 'product_id' ];
355
 
356
+ if ( !isset( $licence[ $product_id ] ) ) {
357
  return false;
358
  }
359
 
360
  $args = array(
361
+ 'email' => urlencode( $licence[ $product_id ][ 'email' ] ),
362
+ 'licence_key' => $licence[ $product_id ][ 'licence_key' ],
363
  'product_id' => $product_id,
364
+ 'secret_key' => $product[ 'secret_key' ],
365
  'instance' => $this->get_home_url()
366
  );
367
 
368
  $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'check' ) ) );
369
+ $timeout = apply_filters( 'yith_plugin_fw_licence_timeout', 30, __FUNCTION__ );
370
+ $response = wp_remote_get( $api_uri, array( 'timeout' => $timeout ) );
371
 
372
+ if ( !is_wp_error( $response ) ) {
373
+ $body = json_decode( $response[ 'body' ] );
374
  $body = is_object( $body ) ? get_object_vars( $body ) : false;
375
  }
376
 
377
+ if ( $body && is_array( $body ) && isset( $body[ 'success' ] ) ) {
378
+ if ( $body[ 'success' ] ) {
379
 
380
  /**
381
  * Code 200 -> Licence key is valid
382
  */
383
+ $licence[ $product_id ][ 'status_code' ] = '200';
384
+ $licence[ $product_id ][ 'activated' ] = $body[ 'activated' ];
385
+ $licence[ $product_id ][ 'licence_expires' ] = $body[ 'licence_expires' ];
386
+ $licence[ $product_id ][ 'activation_remaining' ] = $body[ 'activation_remaining' ];
387
+ $licence[ $product_id ][ 'activation_limit' ] = $body[ 'activation_limit' ];
388
+ $licence[ $product_id ][ 'is_membership' ] = isset( $body[ 'is_membership' ] ) ? $body[ 'is_membership' ] : false;
389
+ $status = (bool) $body[ 'activated' ];
390
+ } elseif ( isset( $body[ 'code' ] ) ) {
 
391
 
392
+ switch ( $body[ 'code' ] ) {
393
 
394
  /**
395
  * Error Code List:
414
  break;
415
 
416
  case '106':
417
+ $licence[ $product_id ][ 'activated' ] = false;
418
+ $licence[ $product_id ][ 'message' ] = $body[ 'error' ];
419
+ $licence[ $product_id ][ 'status_code' ] = $body[ 'code' ];
420
+ $licence[ $product_id ][ 'licence_expires' ] = $body[ 'licence_expires' ];
421
  //$licence[ $product_id ]['is_membership'] = isset( $body['is_membership'] ) ? $body['is_membership'] : false;
422
  break;
423
 
424
  case '107':
425
+ $licence[ $product_id ][ 'activated' ] = false;
426
+ $licence[ $product_id ][ 'message' ] = $body[ 'error' ];
427
+ $licence[ $product_id ][ 'status_code' ] = $body[ 'code' ];
428
  //$licence[ $product_id ]['is_membership'] = isset( $body['is_membership'] ) ? $body['is_membership'] : false;
429
  break;
430
  }
434
  update_option( $this->_licence_option, $licence );
435
 
436
  /* === Update Plugin Licence Information === */
437
+ if ( $regenerate_transient ) {
438
  YIT_Upgrade()->force_regenerate_update_transient();
439
  }
440
  }
441
+
442
  return $status;
443
  }
444
 
451
  * @use YIT_Theme_Licence->check()
452
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
453
  */
454
+ public function check_all() {
455
  foreach ( $this->_products as $init => $info ) {
456
  $this->check( $init );
457
  }
458
  }
459
 
460
+ /**
461
  * Update Plugins Information
462
  *
463
  * Send a request to API server to check activate plugins and update the informations
477
 
478
  do_action( 'yit_licence_after_check' );
479
 
480
+ if ( $this->is_ajax() ) {
481
+ $response[ 'template' ] = $this->show_activation_panel();
482
  wp_send_json( $response );
483
  }
484
  }
498
  if ( $this->is_ajax() ) {
499
  ob_start();
500
  require_once( $path . '/licence/templates/panel/activation/activation-panel.php' );
501
+
502
  return ob_get_clean();
503
+ } else {
 
504
  require_once( $path . '/licence/templates/panel/activation/activation-panel.php' );
505
  }
506
  }
515
  */
516
  public function get_activated_products() {
517
  $activated_products = array();
518
+ $licence = $this->get_licence();
519
 
520
  if ( is_array( $licence ) ) {
521
  foreach ( $this->_products as $init => $info ) {
522
+ if ( in_array( $info[ 'product_id' ], array_keys( $licence ) ) && isset( $licence[ $info[ 'product_id' ] ][ 'activated' ] ) && $licence[ $info[ 'product_id' ] ][ 'activated' ] ) {
523
+ $product[ $init ] = $this->_products[ $init ];
524
+ $product[ $init ][ 'licence' ] = $licence[ $info[ 'product_id' ] ];
525
+ $activated_products[ $init ] = $product[ $init ];
526
  }
527
  }
528
  }
552
  */
553
  public function get_no_active_licence_key() {
554
  $unactive_products = $this->get_to_active_products();
555
+ $licence = $this->get_licence();
556
+ $licence_key = array();
557
 
558
  /**
559
  * Remove banned licence key
560
  */
561
  foreach ( $unactive_products as $init => $info ) {
562
+ $product_id = $unactive_products[ $init ][ 'product_id' ];
563
+ if ( isset( $licence[ $product_id ][ 'activated' ] ) && !$licence[ $product_id ][ 'activated' ] && isset( $licence[ $product_id ][ 'status_code' ] ) ) {
564
+ $status_code = $licence[ $product_id ][ 'status_code' ];
565
 
566
  switch ( $status_code ) {
567
  case '106':
568
+ $licence_key[ $status_code ][ $init ] = $unactive_products[ $init ];
569
+ $licence_key[ $status_code ][ $init ][ 'licence' ] = $licence[ $product_id ];
570
  break;
571
 
572
  case '107':
573
+ $licence_key[ $status_code ][ $init ] = $unactive_products[ $init ];
574
+ $licence_key[ $status_code ][ $init ][ 'licence' ] = $licence[ $product_id ];
575
  break;
576
  }
577
  }
578
  }
579
+
580
  return $licence_key;
581
  }
582
 
591
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
592
  */
593
  public function get_product( $init ) {
594
+ return isset( $this->_products[ $init ] ) ? $this->_products[ $init ] : false;
595
  }
596
 
597
+ /**
598
  * Get product product id information
599
  *
600
  * @param $product_init | product init file
605
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
606
  */
607
  public function get_product_id( $init ) {
608
+ return isset( $this->_products[ $init ][ 'product_id' ] ) ? $this->_products[ $init ][ 'product_id' ] : false;
609
  }
610
 
611
  /**
619
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
620
  */
621
  public function get_renewing_uri( $licence_key ) {
622
+ return !empty( $licence_key ) ? str_replace( 'www.', '', $this->_api_uri ) . '?renewing_key=' . $licence_key : false;
623
  }
624
 
625
  /**
645
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
646
  */
647
  public function get_licence_activation_page_url() {
648
+ return esc_url( add_query_arg( array( 'page' => $this->_settings[ 'page' ] ), admin_url( 'admin.php' ) ) );
649
  }
650
 
651
 
675
  extract( $args );
676
 
677
  $messages = array(
678
+ '100' => __( 'Invalid Request', 'yith-plugin-fw' ),
679
+ '101' => __( 'Invalid license key', 'yith-plugin-fw' ),
680
+ '102' => __( 'Software has been deactivated', 'yith-plugin-fw' ),
681
+ '103' => __( 'Maximum number of activations exceeded', 'yith-plugin-fw' ),
682
+ '104' => __( 'Invalid instance ID', 'yith-plugin-fw' ),
683
+ '105' => __( 'Invalid security key', 'yith-plugin-fw' ),
684
+ '106' => __( 'License key has expired', 'yith-plugin-fw' ),
685
+ '107' => __( 'License key has been banned', 'yith-plugin-fw' ),
686
+ '108' => __( 'Current product is not included in your YITH Club Subscription key', 'yith-plugin-fw' ),
687
+ '200' => sprintf( '<strong>%s</strong>! %s', __( 'Great', 'yith-plugin-fw' ), __( 'License successfully activated', 'yith-plugin-fw' ) ),
688
+ 'deactivated' => sprintf( '%s <strong>%s</strong>', __( 'License key deactivated for website', 'woocommerce-software-add-on' ), isset( $instance ) ? $instance : '' )
689
  );
690
 
691
+ return isset( $messages[ $code ] ) ? $messages[ $code ] : false;
692
  }
693
 
694
  /**
701
  * @since 2.2
702
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
703
  */
704
+ public function display_product_name( $product_name ) {
705
  return str_replace( array( 'for WooCommerce', 'YITH', 'WooCommerce', 'Premium', 'Theme', 'WordPress' ), '', $product_name );
706
  }
707
 
708
+ public function get_number_of_membership_products() {
709
+ $activated_products = $this->get_activated_products();
710
  $num_members_products_activate = 0;
711
+ foreach ( $activated_products as $activated_product ) {
712
+ if ( isset( $activated_product[ 'licence' ][ 'is_membership' ] ) && $activated_product[ 'licence' ][ 'is_membership' ] ) {
713
  $num_members_products_activate++;
714
  }
715
  }
716
+
717
  return $num_members_products_activate;
718
  }
719
 
720
  }
721
+ }
plugin-fw/licence/lib/yit-plugin-licence.php CHANGED
@@ -75,6 +75,42 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
75
  add_action( "wp_ajax_yith_deactivate-{$this->_product_type}", array( $this, 'deactivate' ) );
76
  add_action( "wp_ajax_yith_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
77
  add_action( 'yit_licence_after_check', array( $this, 'licence_after_check' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  }
79
 
80
 
@@ -109,11 +145,11 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
109
  */
110
  public function add_submenu_page() {
111
  add_submenu_page(
112
- $this->_settings['parent_page'],
113
- $this->_settings['page_title'],
114
- $this->_settings['menu_title'],
115
- $this->_settings['capability'],
116
- $this->_settings['page'],
117
  array( $this, 'show_activation_panel' )
118
  );
119
  }
@@ -122,8 +158,8 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
122
  * Premium plugin registration
123
  *
124
  * @param $plugin_init | string | The plugin init file
125
- * @param $secret_key | string | The product secret key
126
- * @param $product_id | string | The plugin slug (product_id)
127
  *
128
  * @return void
129
  *
@@ -135,10 +171,10 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
135
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
  }
137
 
138
- $plugins = get_plugins();
139
- $plugins[$plugin_init]['secret_key'] = $secret_key;
140
- $plugins[$plugin_init]['product_id'] = $product_id;
141
- $this->_products[$plugin_init] = $plugins[$plugin_init];
142
  }
143
 
144
  public function get_product_type() {
75
  add_action( "wp_ajax_yith_deactivate-{$this->_product_type}", array( $this, 'deactivate' ) );
76
  add_action( "wp_ajax_yith_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
77
  add_action( 'yit_licence_after_check', array( $this, 'licence_after_check' ) );
78
+
79
+ /** @since 3.0.0 */
80
+ add_action( 'admin_notices', array( $this, 'activate_license_notice' ), 15 );
81
+ }
82
+
83
+ /**
84
+ * print notice with products to activate
85
+ *
86
+ * @since 3.0.0
87
+ */
88
+ public function activate_license_notice() {
89
+ $show_license_notice = current_user_can( 'update_plugins' ) && ( !isset( $_GET[ 'page' ] ) || 'yith_plugins_activation' !== $_GET[ 'page' ] );
90
+ if ( apply_filters( 'yith_plugin_fw_show_activate_license_notice', $show_license_notice ) ) {
91
+ $products_to_activate = $this->get_to_active_products();
92
+ if ( !!$products_to_activate ) {
93
+ $product_names = array();
94
+ foreach ( $products_to_activate as $init => $product ) {
95
+ if ( !empty( $product[ 'Name' ] ) )
96
+ $product_names[] = $product[ 'Name' ];
97
+ }
98
+
99
+ if ( !!$product_names ) {
100
+ $start = '<span style="display:inline-block; padding:3px 10px; margin: 0 10px 10px 0; background: #f1f1f1; border-radius: 4px;">';
101
+ $end = '</span>';
102
+ $product_list = '<div>' . $start . implode( $end . $start, $product_names ) . $end . '</div>';
103
+ $activation_url = add_query_arg( array( 'page' => 'yith_plugins_activation' ), admin_url( 'admin.php' ) );
104
+ ?>
105
+ <div class="notice notice-error">
106
+ <p><strong>Warning!</strong> You didn't set license key for the following products:
107
+ <?php echo $product_list ?>
108
+ which means you're missing out on updates and support. <a href='<?php echo $activation_url ?>'>Enter your license key</a>, please.</p>
109
+ </div>
110
+ <?php
111
+ }
112
+ }
113
+ }
114
  }
115
 
116
 
145
  */
146
  public function add_submenu_page() {
147
  add_submenu_page(
148
+ $this->_settings[ 'parent_page' ],
149
+ $this->_settings[ 'page_title' ],
150
+ $this->_settings[ 'menu_title' ],
151
+ $this->_settings[ 'capability' ],
152
+ $this->_settings[ 'page' ],
153
  array( $this, 'show_activation_panel' )
154
  );
155
  }
158
  * Premium plugin registration
159
  *
160
  * @param $plugin_init | string | The plugin init file
161
+ * @param $secret_key | string | The product secret key
162
+ * @param $product_id | string | The plugin slug (product_id)
163
  *
164
  * @return void
165
  *
171
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
172
  }
173
 
174
+ $plugins = get_plugins();
175
+ $plugins[ $plugin_init ][ 'secret_key' ] = $secret_key;
176
+ $plugins[ $plugin_init ][ 'product_id' ] = $product_id;
177
+ $this->_products[ $plugin_init ] = $plugins[ $plugin_init ];
178
  }
179
 
180
  public function get_product_type() {
plugin-fw/templates/fields/ajax-posts.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ *
12
+ * [Important Note] the stored value is:
13
+ * - array if WooCommerce version >= 3.0.0
14
+ * - string (comma-separated) otherwise
15
+ */
16
+
17
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
18
+
19
+ wp_enqueue_script( 'yith-enhanced-select' );
20
+ wp_enqueue_style( 'woocommerce_admin_styles' );
21
+
22
+ $default_field = array(
23
+ 'id' => '',
24
+ 'name' => '',
25
+ 'class' => 'yith-post-search',
26
+ 'no_value' => false,
27
+ 'multiple' => false,
28
+ 'data' => array(),
29
+ 'style' => 'width:400px',
30
+ 'value' => ''
31
+ );
32
+
33
+ foreach ( $default_field as $field_key => $field_value ) {
34
+ if ( empty( $field[ $field_key ] ) ) {
35
+ $field[ $field_key ] = $field_value;
36
+ }
37
+ }
38
+ unset( $field_key );
39
+ unset( $field_value );
40
+ extract( $field );
41
+ /**
42
+ * @var string $id
43
+ * @var string $class
44
+ * @var bool $no_value
45
+ * @var bool $multiple
46
+ * @var array $data
47
+ * @var string $name
48
+ * @var string $style
49
+ * @var string|array $value
50
+ */
51
+
52
+
53
+ if ( $no_value )
54
+ $value = array();
55
+
56
+ $default_data = array(
57
+ 'action' => 'yith_plugin_fw_json_search_posts',
58
+ 'placeholder' => __( 'Search Posts', 'yith-plugin-fw' ),
59
+ 'allow_clear' => false,
60
+ );
61
+ $data = wp_parse_args( $data, $default_data );
62
+ $show_id = isset( $data[ 'show_id' ] ) && $data[ 'show_id' ];
63
+
64
+ // separate select2 needed data and other data
65
+ $select2_custom_attributes = array();
66
+ $select2_data = array();
67
+ $select2_data_keys = array( 'placeholder', 'allow_clear', 'action' );
68
+ foreach ( $data as $d_key => $d_value ) {
69
+ if ( in_array( $d_key, $select2_data_keys ) ) {
70
+ $select2_data[ $d_key ] = $d_value;
71
+ } else {
72
+ $select2_custom_attributes[ 'data-' . $d_key ] = $d_value;
73
+ }
74
+ }
75
+
76
+ // populate data-selected by value
77
+ $data_selected = array();
78
+ if ( !empty( $value ) ) {
79
+ if ( $multiple ) {
80
+ $value = is_array( $value ) ? $value : explode( ',', $value );
81
+ foreach ( $value as $post_id ) {
82
+ $data_selected[ $post_id ] = get_the_title( $post_id ) . ( $show_id ? " (#{$post_id})" : '' );
83
+ }
84
+ } else {
85
+ $post_id = absint( $value );
86
+ $data_selected[ $post_id ] = get_the_title( $post_id ) . ( $show_id ? " (#{$post_id})" : '' );
87
+ }
88
+ }
89
+
90
+ // parse $value to string to prevent issue with wc2.6
91
+ $value = is_array( $value ) ? implode( ',', $value ) : $value;
92
+ ?>
93
+ <div class="yith-plugin-fw-select2-wrapper">
94
+ <?php
95
+ if ( function_exists( 'yit_add_select2_fields' ) ) {
96
+ yit_add_select2_fields( array(
97
+ 'id' => $id,
98
+ 'name' => $name,
99
+ 'class' => $class,
100
+ 'data-multiple' => $multiple,
101
+ 'data-placeholder' => $select2_data[ 'placeholder' ],
102
+ 'data-allow_clear' => $select2_data[ 'allow_clear' ],
103
+ 'data-action' => $select2_data[ 'action' ],
104
+ 'custom-attributes' => $select2_custom_attributes,
105
+ 'style' => $style,
106
+ 'value' => $value,
107
+ 'data-selected' => $data_selected,
108
+ ) );
109
+ }
110
+ ?>
111
+ </div>
plugin-fw/templates/fields/ajax-products.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
12
+
13
+ $field[ 'type' ] = 'ajax-posts';
14
+ $field_data = array(
15
+ 'post_type' => 'product',
16
+ 'placeholder' => __( 'Search Product', 'yith-plugin-fw' ),
17
+ 'action' => 'yith_plugin_fw_json_search_products',
18
+ );
19
+ if ( isset( $field[ 'data' ] ) )
20
+ $field_data = wp_parse_args( $field[ 'data' ], $field_data );
21
+
22
+ $field[ 'data' ] = $field_data;
23
+
24
+ yith_plugin_fw_get_field( $field, true );
plugin-fw/templates/fields/ajax-terms.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ *
12
+ * [Important Note] the stored value is:
13
+ * - array if WooCommerce version >= 3.0.0
14
+ * - string (comma-separated) otherwise
15
+ */
16
+
17
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
18
+
19
+ wp_enqueue_script( 'yith-enhanced-select' );
20
+ wp_enqueue_style( 'woocommerce_admin_styles' );
21
+
22
+ $default_field = array(
23
+ 'id' => '',
24
+ 'name' => '',
25
+ 'class' => 'yith-term-search',
26
+ 'no_value' => false,
27
+ 'multiple' => false,
28
+ 'data' => array(),
29
+ 'style' => 'width:400px',
30
+ 'value' => ''
31
+ );
32
+
33
+ foreach ( $default_field as $field_key => $field_value ) {
34
+ if ( empty( $field[ $field_key ] ) ) {
35
+ $field[ $field_key ] = $field_value;
36
+ }
37
+ }
38
+ unset( $field_key );
39
+ unset( $field_value );
40
+ extract( $field );
41
+ /**
42
+ * @var string $id
43
+ * @var string $class
44
+ * @var bool $no_value
45
+ * @var bool $multiple
46
+ * @var array $data
47
+ * @var string $name
48
+ * @var string $style
49
+ * @var string|array $value
50
+ */
51
+
52
+ if ( $no_value )
53
+ $value = array();
54
+
55
+ $default_data = array(
56
+ 'action' => 'yith_plugin_fw_json_search_terms',
57
+ 'placeholder' => __( 'Search Categories', 'yith-plugin-fw' ),
58
+ 'allow_clear' => false,
59
+ 'taxonomy' => 'category',
60
+ 'term_field' => 'id'
61
+ );
62
+ $data = wp_parse_args( $data, $default_data );
63
+ $show_id = isset( $data[ 'show_id' ] ) && $data[ 'show_id' ];
64
+
65
+ // separate select2 needed data and other data
66
+ $select2_custom_attributes = array();
67
+ $select2_data = array();
68
+ $select2_data_keys = array( 'placeholder', 'allow_clear', 'action' );
69
+ foreach ( $data as $d_key => $d_value ) {
70
+ if ( in_array( $d_key, $select2_data_keys ) ) {
71
+ $select2_data[ $d_key ] = $d_value;
72
+ } else {
73
+ $select2_custom_attributes[ 'data-' . $d_key ] = $d_value;
74
+ }
75
+ }
76
+
77
+ $term_field = $data[ 'term_field' ];
78
+
79
+ // populate data-selected by value
80
+ $data_selected = array();
81
+ if ( !empty( $value ) ) {
82
+ if ( $multiple ) {
83
+ if ( 'id' === $term_field ) {
84
+ $value = is_array( $value ) ? array_map( 'absint', $value ) : explode( ',', $value );
85
+ } else {
86
+ $value = is_array( $value ) ? $value : explode( ',', $value );
87
+ }
88
+ foreach ( $value as $term_value ) {
89
+ $term = get_term_by( $term_field, $term_value, $data[ 'taxonomy' ] );
90
+ if ( is_object( $term ) ) {
91
+ $title = wp_kses_post( html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ) );
92
+ $title .= ( $show_id ? " (#{$term->term_id})" : '' );
93
+ $data_selected[ $term_value ] = $title;
94
+ } else {
95
+ $data_selected[ $term_value ] = '#' . $term_value;
96
+ }
97
+ }
98
+ } else {
99
+ $term_value = 'id' === $term_field ? absint( $value ) : $value;
100
+ $term = get_term_by( $term_field, $term_value, $data[ 'taxonomy' ] );
101
+ if ( is_object( $term ) ) {
102
+ $title = wp_kses_post( html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ) );
103
+ $title .= ( $show_id ? " (#{$term->term_id})" : '' );
104
+ $data_selected[ $term_value ] = $title;
105
+ } else {
106
+ $data_selected[ $term_value ] = '#' . $term_value;
107
+ }
108
+ }
109
+ }
110
+
111
+ // parse $value to string to prevent issue with wc2.6
112
+ $value = is_array( $value ) ? implode( ',', $value ) : $value;
113
+ ?>
114
+ <div class="yith-plugin-fw-select2-wrapper">
115
+ <?php
116
+ if ( function_exists( 'yit_add_select2_fields' ) ) {
117
+ yit_add_select2_fields( array(
118
+ 'id' => $id,
119
+ 'name' => $name,
120
+ 'class' => $class,
121
+ 'data-multiple' => $multiple,
122
+ 'data-placeholder' => $select2_data[ 'placeholder' ],
123
+ 'data-allow_clear' => $select2_data[ 'allow_clear' ],
124
+ 'data-action' => $select2_data[ 'action' ],
125
+ 'custom-attributes' => $select2_custom_attributes,
126
+ 'style' => $style,
127
+ 'value' => $value,
128
+ 'data-selected' => $data_selected,
129
+ 'data-term-field' => $term_field
130
+ ) );
131
+ }
132
+ ?>
133
+ </div>
plugin-fw/templates/fields/buttons.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
12
+
13
+ extract( $field );
14
+
15
+ if ( !empty( $buttons ) && is_array( $buttons ) ):
16
+ foreach ( $buttons as $button ) :
17
+ $button_default_args = array(
18
+ 'name' => '',
19
+ 'class' => '',
20
+ 'data' => array(),
21
+ );
22
+ $button = wp_parse_args( $button, $button_default_args );
23
+ ?>
24
+ <input type="button" class="<?php echo $button[ 'class' ]; ?> button button-secondary"
25
+ value="<?php echo esc_attr( $button[ 'name' ] ) ?>" <?php echo yith_plugin_fw_html_data_to_string( $button[ 'data' ] ) ?>/>
26
+ <?php endforeach;
27
+ endif; ?>
plugin-fw/templates/fields/checkbox.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ *
12
+ */
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+ ?>
17
+ <input type="checkbox" id="<?php echo $id ?>"
18
+ name="<?php echo $name ?>" value="1"
19
+ <?php echo !empty( $class ) ? "class='$class'" : ''; ?>
20
+ <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>" <?php endif; ?>
21
+ <?php checked( true, yith_plugin_fw_is_true( $value ) ) ?>
22
+ <?php echo $custom_attributes ?>
23
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>/>
24
+ <?php
25
+ if ( isset( $field[ 'desc-inline' ] ) )
26
+ echo "<span class='description inline'>" . $field[ 'desc-inline' ] . "</span>";
27
+
28
+ ?>
plugin-fw/templates/fields/colorpicker.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ wp_enqueue_style( 'wp-color-picker' );
16
+
17
+ extract( $field );
18
+
19
+ $class = !empty( $class ) ? $class : 'yith-plugin-fw-colorpicker';
20
+ ?>
21
+
22
+ <input type="text" name="<?php echo $name ?>"
23
+ id="<?php echo $id ?>" value="<?php echo esc_attr( $value ) ?>"
24
+ <?php if ( isset( $std ) ) : ?>data-default-color="<?php echo $std ?>"<?php endif ?>
25
+ class="<?php echo $class ?>"
26
+ <?php echo $custom_attributes ?>
27
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>/>
plugin-fw/templates/fields/customtabs.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ *
12
+ */
13
+
14
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
15
+
16
+ extract( $field );
17
+
18
+ $field[ 'labels' ] = array(
19
+ 'plural_name' => 'Tabs',
20
+ 'singular_name' => 'Tab',
21
+ 'item_name_sing' => 'Tab',
22
+ 'item_name_plur' => 'Tabs',
23
+ );
24
+ $value = is_array( $value ) ? $value : array();
25
+ ?>
26
+ <div id="yit_custom_tabs" class="panel wc-metaboxes-wrapper" style="display: block;">
27
+ <p class="toolbar">
28
+ <a href="#" class="close_all"><?php _e( 'Close all', 'yith-plugin-fw' ) ?></a><a href="#" class="expand_all"><?php _e( 'Expand all', 'yith-plugin-fw' ) ?></a>
29
+ </p>
30
+
31
+ <div class="yit_custom_tabs wc-metaboxes ui-sortable" style="">
32
+
33
+ <?php if ( !empty( $value ) ): ?>
34
+ <?php foreach ( $value as $i => $tab ): ?>
35
+ <div class="yit_custom_tab wc-metabox closed" rel="0">
36
+ <h3>
37
+ <button type="button" class="remove_row button"><?php _e( 'Remove', 'yith-plugin-fw' ) ?></button>
38
+ <div class="handlediv" title="Click to toggle"></div>
39
+ <strong class="attribute_name"><?php echo $tab[ 'name' ] ?></strong>
40
+ </h3>
41
+
42
+ <table cellpadding="0" cellspacing="0" class="woocommerce_attribute_data wc-metabox-content" style="display: table;">
43
+ <tbody>
44
+ <tr>
45
+ <td class="attribute_name">
46
+ <label><?php _e( 'Name', 'yith-plugin-fw' ) ?>:</label>
47
+ <input type="text" class="attribute_name" name="<?php echo $name ?>[<?php echo $i ?>][name]" value="<?php echo esc_attr( $tab[ 'name' ] ) ?>">
48
+ <input type="hidden" name="<?php echo $name ?>[<?php echo $i ?>][position]" class="attribute_position" value="<?php echo $i ?>">
49
+ </td>
50
+
51
+ <td rowspan="3">
52
+ <label><?php _e( 'Value', 'yith-plugin-fw' ) ?>:</label>
53
+ <textarea name="<?php echo $name ?>[<?php echo $i ?>][value]" cols="5" rows="5" placeholder="<?php _e( 'Content of the tab. (HTML is supported)', 'yith-plugin-fw' ) ?>"><?php echo $tab[ 'value' ] ?></textarea>
54
+ </td>
55
+ </tr>
56
+ </tbody>
57
+ </table>
58
+
59
+ </div>
60
+ <?php endforeach ?>
61
+ <?php endif ?>
62
+ </div>
63
+
64
+ <p class="toolbar">
65
+ <button type="button" class="button button-primary add_custom_tab"><?php _e( 'Add custom product tab', 'yith-plugin-fw' ) ?></button>
66
+ </p>
67
+
68
+ <div class="clear"></div>
69
+ </div>
70
+
71
+ <script>
72
+ jQuery( document ).ready( function ( $ ) {
73
+ // Add rows
74
+ $( 'button.add_custom_tab' ).on( 'click', function () {
75
+
76
+ var size = $( '.yit_custom_tabs .yit_custom_tab' ).size() + 1;
77
+
78
+ // Add custom attribute row
79
+ $( '.yit_custom_tabs' ).append( '<div class="yit_custom_tab wc-metabox">\
80
+ <h3>\
81
+ <button type="button" class="remove_row button"><?php _e( 'Remove', 'yith-plugin-fw' ) ?></button>\
82
+ <div class="handlediv" title="Click to toggle"></div>\
83
+ <strong class="attribute_name"></strong>\
84
+ </h3>\
85
+ <table cellpadding="0" cellspacing="0" class="woocommerce_attribute_data">\
86
+ <tbody>\
87
+ <tr>\
88
+ <td class="attribute_name">\
89
+ <label><?php _e( 'Name', 'yith-plugin-fw' ) ?>:</label>\
90
+ <input type="text" class="attribute_name" name="<?php echo $name ?>[' + size + '][name]" />\
91
+ <input type="hidden" name="<?php echo $name ?>[' + size + '][position]" class="attribute_position" value="' + size + '" />\
92
+ </td>\
93
+ <td rowspan="3">\
94
+ <label><?php _e( 'Value', 'yith-plugin-fw' ) ?>:</label>\
95
+ <textarea name="<?php echo $name ?>[' + size + '][value]" cols="5" rows="5" placeholder="<?php echo addslashes( __( 'Content of the tab. (HTML is supported)', 'yith-plugin-fw' ) ) ?>"></textarea>\
96
+ </td>\
97
+ </tr>\
98
+ </tbody>\
99
+ </table>\
100
+ </div>' );
101
+
102
+ } );
103
+
104
+
105
+ $( '.yit_custom_tabs' ).on( 'click', 'button.remove_row', function () {
106
+ var answer = confirm( "<?php _e( 'Do you want to remove the custom tab?', 'yith-plugin-fw' ) ?>" );
107
+ if ( answer ) {
108
+ var $parent = $( this ).parent().parent();
109
+
110
+ $parent.remove();
111
+ attribute_row_indexes();
112
+ }
113
+ return false;
114
+ } );
115
+
116
+ // Attribute ordering
117
+ $( '.yit_custom_tabs' ).sortable( {
118
+ items : '.yit_custom_tab',
119
+ cursor : 'move',
120
+ axis : 'y',
121
+ handle : 'h3',
122
+ scrollSensitivity : 40,
123
+ forcePlaceholderSize: true,
124
+ helper : 'clone',
125
+ opacity : 0.65,
126
+ placeholder : 'wc-metabox-sortable-placeholder',
127
+ start : function ( event, ui ) {
128
+ ui.item.css( 'background-color', '#f6f6f6' );
129
+ },
130
+ stop : function ( event, ui ) {
131
+ ui.item.removeAttr( 'style' );
132
+ attribute_row_indexes();
133
+ }
134
+ } );
135
+
136
+ function attribute_row_indexes() {
137
+ $( '.yit_custom_tabs .yit_custom_tab' ).each( function ( index, el ) {
138
+ var newVal = '[' + $( el ).index( '.yit_custom_tabs .yit_custom_tab' ) + ']';
139
+ var oldVal = '[' + $( '.attribute_position', el ).val() + ']';
140
+
141
+ $( ':input:not(button)', el ).each( function () {
142
+ var name = $( this ).attr( 'name' );
143
+ $( this ).attr( 'name', name.replace( oldVal, newVal ) );
144
+ } );
145
+
146
+ $( '.attribute_position', el ).val( $( el ).index( '.yit_custom_tabs .yit_custom_tab' ) );
147
+ } );
148
+ }
149
+
150
+ } );
151
+ </script>
plugin-fw/templates/fields/datepicker.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+ $class = !empty( $class ) ? $class : 'yith-plugin-fw-datepicker';
17
+ ?>
18
+ <input type="text"
19
+ name="<?php echo $name ?>"
20
+ id="<?php echo $id ?>"
21
+ value="<?php echo esc_attr( $value ) ?>"
22
+ class="<?php echo $class ?>"
23
+ <?php echo $custom_attributes ?>
24
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>/>
plugin-fw/templates/fields/hidden.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+
17
+ // backward compatibility
18
+ if ( !isset( $value ) ) {
19
+ if ( isset( $val ) )
20
+ $value = $val;
21
+ else
22
+ $value = '';
23
+ }
24
+ ?>
25
+ <input type="hidden" id="<?php echo $id ?>"
26
+ name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>"
27
+ <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>
28
+ <?php echo $custom_attributes ?>
29
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>/>
plugin-fw/templates/{metaboxes/types/simple-text.php → fields/html.php} RENAMED
@@ -6,15 +6,12 @@
6
  * that is bundled with this package in the file LICENSE.txt.
7
  * It is also available through the world-wide-web at this URL:
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
 
 
9
  */
10
 
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
 
16
- extract( $args );
17
 
18
- $id = empty( $id ) ? '' : " id=\"$id\"";
19
- ?>
20
- <p<?php echo $id ?>><?php echo $desc ?></p>
6
  * that is bundled with this package in the file LICENSE.txt.
7
  * It is also available through the world-wide-web at this URL:
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
  */
12
 
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
 
 
 
14
 
15
+ extract( $field );
16
 
17
+ echo !empty( $html ) ? $html : '';
 
 
plugin-fw/templates/fields/icons.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * This file belongs to the YIT Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ extract( $field );
14
+
15
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
16
+
17
+ wp_enqueue_style( 'font-awesome' );
18
+ extract( $field );
19
+
20
+ $filter_icons = !empty( $field[ 'filter_icons' ] ) ? $field[ 'filter_icons' ] : '';
21
+ $default_icon_text = isset( $std ) ? $std : false;
22
+ $default_icon_data = YIT_Icons()->get_icon_data( $default_icon_text, $filter_icons );
23
+
24
+ $current_icon_data = YIT_Icons()->get_icon_data( $value, $filter_icons );
25
+ $current_icon_text = $value;
26
+
27
+ $yit_icons = YIT_Icons()->get_icons( $filter_icons );
28
+ ?>
29
+
30
+ <div id="yit-icons-manager-wrapper-<?php echo $id ?>" class="yit-icons-manager-wrapper">
31
+
32
+ <div class="yit-icons-manager-text">
33
+ <div class="yit-icons-manager-icon-preview" <?php echo $current_icon_data ?>></div>
34
+ <input class="yit-icons-manager-icon-text" type="text" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo $current_icon_text; ?>"/>
35
+ <div class="clear"></div>
36
+ </div>
37
+
38
+
39
+ <div class="yit-icons-manager-list-wrapper">
40
+ <ul class="yit-icons-manager-list">
41
+ <?php foreach ( $yit_icons as $font => $icons ):
42
+ foreach ( $icons as $key => $icon_name ):
43
+ $icon_text = $font . ':' . $icon_name;
44
+ $icon_class = $icon_text == $current_icon_text ? 'active' : '';
45
+ $icon_class .= $icon_text == $default_icon_text ? ' default' : '';
46
+ $data_icon = str_replace( '\\', '&#x', $key );
47
+ ?>
48
+ <li class="<?php echo $icon_class ?>" data-font="<?php echo $font ?>" data-icon="<?php echo $data_icon; ?>" data-key="<?php echo $key ?>"
49
+ data-name="<?php echo $icon_name ?>"></li>
50
+ <?php
51
+ endforeach;
52
+ endforeach; ?>
53
+ </ul>
54
+ </div>
55
+
56
+ <div class="yit-icons-manager-actions">
57
+ <?php if ( $default_icon_text ): ?>
58
+ <div class="yit-icons-manager-action-set-default button"><?php _e( 'Set Default', 'yith-plugin-fw' ) ?><i
59
+ class="yit-icons-manager-default-icon-preview" <?php echo $default_icon_data ?>></i></div>
60
+ <?php endif ?>
61
+ </div>
62
+
63
+ </div>
plugin-fw/templates/fields/image-gallery.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+ $array_id = array();
17
+ if ( !empty( $value ) ) {
18
+ $array_id = array_filter( explode( ',', $value ) );
19
+ }
20
+ ?>
21
+ <ul id="<?php echo $id ?>-extra-images" class="slides-wrapper extra-images ui-sortable clearfix">
22
+ <?php if ( !empty( $array_id ) ) : ?>
23
+ <?php foreach ( $array_id as $image_id ) : ?>
24
+ <li class="image" data-attachment_id= <?php echo esc_attr( $image_id ) ?>>
25
+ <a href="#">
26
+ <?php
27
+ if ( function_exists( 'yit_image' ) ) :
28
+ yit_image( "id=$image_id&size=admin-post-type-thumbnails" );
29
+ else:
30
+ echo wp_get_attachment_image( $image_id, array( 80, 80 ) );
31
+ endif; ?>
32
+ </a>
33
+ <ul class="actions">
34
+ <li><a href="#" class="delete" title="<?php _e( 'Delete image', 'yith-plugin-fw' ); ?>">x</a></li>
35
+ </ul>
36
+ </li>
37
+ <?php endforeach; endif; ?>
38
+ </ul>
39
+ <input type="button" data-choose="<?php _e( 'Add Images to Gallery', 'yith-plugin-fw' ); ?>" data-update="<?php _e( 'Add to gallery', 'yith-plugin-fw' ); ?>" value="<?php _e( 'Add images', 'yith-plugin-fw' ) ?>" data-delete="<?php _e( 'Delete image', 'yith-plugin-fw' ); ?>" data-text="<?php _e( 'Delete', 'yith-plugin-fw' ); ?>" id="<?php echo $id ?>-button" class="image-gallery-button button"/>
40
+ <input type="hidden" class="image_gallery_ids" id="image_gallery_ids" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ); ?>"/>
plugin-fw/templates/fields/number.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+
17
+ $min_max_attr = $step_attr = '';
18
+
19
+ if ( isset( $min ) ) {
20
+ $min_max_attr .= " min='{$min}'";
21
+ }
22
+
23
+ if ( isset( $max ) ) {
24
+ $min_max_attr .= " max='{$max}'";
25
+ }
26
+
27
+ if ( isset( $step ) ) {
28
+ $step_attr .= "step='{$step}'";
29
+ }
30
+ ?>
31
+ <input type="number" id="<?php echo $id ?>"
32
+ <?php echo !empty( $class ) ? "class='$class'" : ''; ?>
33
+ name="<?php echo $name ?>" <?php echo $step_attr ?> <?php echo $min_max_attr ?>
34
+ value="<?php echo esc_attr( $value ) ?>" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>
35
+ <?php echo $custom_attributes ?>
36
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>/>
plugin-fw/templates/fields/onoff.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+ ?>
17
+
18
+ <div class="yith-plugin-fw-onoff-container">
19
+ <input type="checkbox" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>" <?php checked( yith_plugin_fw_is_true( $value ) ) ?> class="on_off" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?> />
20
+ <span class="yith-plugin-fw-onoff">&nbsp;</span>
21
+ </div>
plugin-fw/templates/fields/preview.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
11
+
12
+ extract( $field );
13
+ $class = !empty( $class ) ? $class : 'yith-plugin-fw-preview-field';
14
+
15
+ ?>
16
+ <img src="<?php echo $value ?>" class="<?php echo $class ?>"
17
+ <?php echo $custom_attributes ?>
18
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>>
plugin-fw/templates/fields/select-buttons.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ wp_enqueue_script( 'wc-enhanced-select' );
16
+
17
+ $field[ 'type' ] = 'select';
18
+
19
+ if ( empty( $field[ 'class' ] ) ) unset( $field[ 'class' ] );
20
+
21
+ $default_args = array(
22
+ 'multiple' => true,
23
+ 'class' => 'wc-enhanced-select',
24
+ 'buttons' => array(
25
+ array(
26
+ 'name' => __( 'Select All', 'yith-plugin-fw' ),
27
+ 'class' => 'yith-plugin-fw-select-all',
28
+ 'data' => array(
29
+ 'select-id' => $field[ 'id' ]
30
+ ),
31
+ ),
32
+ array(
33
+ 'name' => __( 'Deselect All', 'yith-plugin-fw' ),
34
+ 'class' => 'yith-plugin-fw-deselect-all',
35
+ 'data' => array(
36
+ 'select-id' => $field[ 'id' ]
37
+ ),
38
+ )
39
+ )
40
+ );
41
+
42
+ $field = wp_parse_args( $field, $default_args );
43
+
44
+ yith_plugin_fw_get_field( $field, true );
plugin-fw/templates/fields/select-mailchimp.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+ $multiple_html = ( isset( $multiple ) && $multiple ) ? ' multiple' : '';
17
+ ?>
18
+
19
+ <select<?php echo $multiple_html ?>
20
+ id="<?php echo $id ?>"
21
+ name="<?php echo $name ?>" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>
22
+ class="yith-plugin-fw-select"
23
+ <?php echo $custom_attributes ?>
24
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>>
25
+ <?php foreach ( $options as $key => $item ) : ?>
26
+ <option value="<?php echo $key ?>"<?php selected( $key, $value ) ?>><?php echo $item ?></option>
27
+ <?php endforeach; ?>
28
+ </select>
29
+ <input type="button" class="button-secondary <?php echo isset( $class ) ? $class : ''; ?>" value="<?php echo $button_name ?>"/>
30
+ <span class="spinner"></span>
plugin-fw/templates/fields/select.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+ $multiple = isset( $multiple ) && $multiple;
17
+ $multiple_html = ( $multiple ) ? ' multiple' : '';
18
+
19
+ if ( $multiple && !is_array( $value ) )
20
+ $value = array();
21
+
22
+ $class = isset( $class ) ? $class : 'yith-plugin-fw-select';
23
+ ?>
24
+ <select<?php echo $multiple_html ?>
25
+ id="<?php echo $id ?>"
26
+ name="<?php echo $name ?><?php if ( $multiple ) echo "[]" ?>" <?php if ( isset( $std ) ) : ?>
27
+ data-std="<?php echo ( $multiple ) ? implode( ' ,', $std ) : $std ?>"<?php endif ?>
28
+ class="<?php echo $class ?>"
29
+ <?php echo $custom_attributes ?>
30
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>>
31
+ <?php foreach ( $options as $key => $item ) : ?>
32
+ <option value="<?php echo esc_attr( $key ) ?>" <?php if ( $multiple ): selected( true, in_array( $key, $value ) );
33
+ else: selected( $key, $value ); endif; ?> ><?php echo $item ?></option>
34
+ <?php endforeach; ?>
35
+ </select>
36
+
37
+ <?php
38
+ /* --------- BUTTONS ----------- */
39
+ if ( isset( $buttons ) ) {
40
+ $button_field = array(
41
+ 'type' => 'buttons',
42
+ 'buttons' => $buttons
43
+ );
44
+ yith_plugin_fw_get_field( $button_field, true );
45
+ }
46
+ ?>
plugin-fw/templates/{metaboxes/types → fields}/sep.php RENAMED
@@ -8,11 +8,7 @@
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
 
16
  // doesn't do nothing, allow to stamp the container of this option with sep class:
17
- // <div class="the-metabox sep"></div>
18
- ?>
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
 
 
 
12
 
13
  // doesn't do nothing, allow to stamp the container of this option with sep class:
14
+ //<div class="the-metabox sep clearfix"></div>
 
plugin-fw/templates/fields/sidebarlist.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+
17
+ $class = isset( $class ) ? $class : 'yith-plugin-fw-select';
18
+ $options = yit_registered_sidebars();
19
+ ?>
20
+ <select id="<?php echo $id ?>"
21
+ name="<?php echo $name ?>"
22
+ class="<?php echo $class ?>"
23
+ <?php echo $custom_attributes ?>
24
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>>
25
+ <?php foreach ( $options as $key => $item ) : ?>
26
+ <option value="<?php echo esc_attr( $key ) ?>"<?php selected( $key, $value ) ?>><?php echo $item ?></option>
27
+ <?php endforeach; ?>
28
+ </select>
plugin-fw/templates/fields/sidebars.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ extract( $field );
14
+
15
+ $layout = !isset( $value[ 'layout' ] ) ? 'sidebar-no' : $value[ 'layout' ];
16
+ $sidebar_left = !isset( $value[ 'sidebar-left' ] ) ? '-1' : $value[ 'sidebar-left' ];
17
+ $sidebar_right = !isset( $value[ 'sidebar-right' ] ) ? '-1' : $value[ 'sidebar-right' ];
18
+ ?>
19
+ <div class="yith-plugin-fw-sidebar-layout">
20
+ <div class="option">
21
+ <input type="radio" name="<?php echo $name ?>[layout]" id="<?php echo $id . '-left' ?>" value="sidebar-left" <?php checked( $layout, 'sidebar-left' ) ?> />
22
+ <img src="<?php echo YIT_CORE_PLUGIN_URL ?>/assets/images/sidebar-left.png" title="<?php _e( 'Left sidebar', 'yith-plugin-fw' ) ?>" alt="<?php _e( 'Left sidebar', 'yith-plugin-fw' ) ?>" class="<?php echo $id . '-left' ?>" data-type="left"/>
23
+
24
+ <input type="radio" name="<?php echo $name ?>[layout]" id="<?php echo $id . '-right' ?>" value="sidebar-right" <?php checked( $layout, 'sidebar-right' ) ?> />
25
+ <img src="<?php echo YIT_CORE_PLUGIN_URL ?>/assets/images/sidebar-right.png" title="<?php _e( 'Right sidebar', 'yith-plugin-fw' ) ?>" alt="<?php _e( 'Right sidebar', 'yith-plugin-fw' ) ?>" class="<?php echo $id . '-right' ?>" data-type="right"/>
26
+
27
+ <input type="radio" name="<?php echo $name ?>[layout]" id="<?php echo $id . '-double' ?>" value="sidebar-double" <?php checked( $layout, 'sidebar-double' ) ?> />
28
+ <img src="<?php echo YIT_CORE_PLUGIN_URL ?>/assets/images/double-sidebar.png" title="<?php _e( 'No sidebar', 'yith-plugin-fw' ) ?>" alt="<?php _e( 'No sidebar', 'yith-plugin-fw' ) ?>" class="<?php echo $id . '-double' ?>" data-type="double"/>
29
+
30
+ <input type="radio" name="<?php echo $name ?>[layout]" id="<?php echo $id . '-no' ?>" value="sidebar-no" <?php checked( $layout, 'sidebar-no' ) ?> />
31
+ <img src="<?php echo YIT_CORE_PLUGIN_URL ?>/assets/images/no-sidebar.png" title="<?php _e( 'No sidebar', 'yith-plugin-fw' ) ?>" alt="<?php _e( 'No sidebar', 'yith-plugin-fw' ) ?>" class="<?php echo $id . '-no' ?>" data-type="none"/>
32
+ </div>
33
+ <div class="clearfix"></div>
34
+ <div class="option" id="choose-sidebars">
35
+ <div class="side">
36
+ <div <?php if ( $layout != 'sidebar-double' && $layout != 'sidebar-left' ) {
37
+ echo 'style="display:none"';
38
+ } ?> class="yith-plugin-fw-sidebar-layout-sidebar-left-container select-mask">
39
+ <label for="<?php echo $id ?>-sidebar-left"><?php _e( 'Left Sidebar', 'yith-plugin-fw' ) ?></label>
40
+ <select class="yith-plugin-fw-select" name="<?php echo $name ?>[sidebar-left]" id="<?php echo $id ?>-sidebar-left">
41
+ <option value="-1"><?php _e( 'Choose a sidebar', 'yith-plugin-fw' ) ?></option>
42
+ <?php foreach ( yit_registered_sidebars() as $val => $option ) { ?>
43
+ <option value="<?php echo esc_attr( $val ) ?>" <?php selected( $sidebar_left, $val ) ?>><?php echo $option; ?></option>
44
+ <?php } ?>
45
+ </select>
46
+ </div>
47
+ </div>
48
+ <div class="side" style="clear: both">
49
+ <div <?php if ( $layout != 'sidebar-double' && $layout != 'sidebar-right' ) {
50
+ echo 'style="display:none"';
51
+ } ?> class="yith-plugin-fw-sidebar-layout-sidebar-right-container select-mask">
52
+ <label for="<?php echo $id ?>-sidebar-right"><?php _e( 'Right Sidebar', 'yith-plugin-fw' ) ?></label>
53
+ <select class="yith-plugin-fw-select" name="<?php echo $name ?>[sidebar-right]" id="<?php echo $id ?>-sidebar-right">
54
+ <option value="-1"><?php _e( 'Choose a sidebar', 'yith-plugin-fw' ) ?></option>
55
+ <?php foreach ( yit_registered_sidebars() as $val => $option ) { ?>
56
+ <option value="<?php echo esc_attr( $val ) ?>" <?php selected( $sidebar_right, $val ) ?>><?php echo $option; ?></option>
57
+ <?php } ?>
58
+ </select>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </div>
plugin-fw/templates/fields/simple-text.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+ ?>
17
+ <p <?php if ( !empty( $id ) ) echo "id='$id'" ?>
18
+ <?php echo $custom_attributes ?>
19
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>><?php echo $desc ?></p>
plugin-fw/templates/fields/slider.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+
17
+ $min = isset( $option[ 'min' ] ) ? $option[ 'min' ] : 0;
18
+ $max = isset( $option[ 'max' ] ) ? $option[ 'max' ] : 100;
19
+ ?>
20
+ <div class="yith-plugin-fw-slider-container">
21
+ <div class="ui-slider">
22
+ <span class="minCaption"><?php echo $min ?></span>
23
+ <div id="<?php echo $id ?>-div" data-step="<?php echo isset( $step ) ? $step : 1 ?>" data-min="<?php echo $min ?>" data-max="<?php echo $max ?>" data-val="<?php echo $value; ?>" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">
24
+ <input id="<?php echo $id ?>" type="hidden" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ); ?>"/>
25
+ </div>
26
+ <span class="maxCaption"><?php echo $max ?></span>
27
+ </div>
28
+ </div>
plugin-fw/templates/fields/text-array.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+
17
+ $size = isset( $size ) ? " style=\"width:{$size}px;\"" : '';
18
+ ?>
19
+ <table class="yith-plugin-fw-text-array-table">
20
+ <?php foreach ( $fields as $field_name => $field_label ) : ?>
21
+ <tr>
22
+ <td><?php echo $field_label ?></td>
23
+ <td>
24
+ <input type="text" name="<?php echo $name ?>[<?php echo $field_name ?>]" id="<?php echo $id ?>_<?php echo $field_name ?>" value="<?php echo isset( $value[ $field_name ] ) ? esc_attr( $value[ $field_name ] ) : '' ?>"<?php echo $size ?> />
25
+ </td>
26
+ </tr>
27
+ <?php endforeach ?>
28
+ </table>
plugin-fw/templates/fields/text-button.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
12
+
13
+ extract( $field );
14
+
15
+ $backward_compatibility = false;
16
+ if ( !isset( $field[ 'buttons' ] ) ) {
17
+ // backward compatibility
18
+ $backward_compatibility = true;
19
+ $button_data = array();
20
+
21
+ if ( isset( $field[ 'button-class' ] ) )
22
+ $button_data[ 'class' ] = $field[ 'button-class' ];
23
+ if ( isset( $field[ 'button-name' ] ) )
24
+ $button_data[ 'name' ] = $field[ 'button-name' ];
25
+ if ( isset( $field[ 'data' ] ) )
26
+ $button_data[ 'data' ] = $field[ 'data' ];
27
+
28
+ $buttons = array( $button_data );
29
+ }
30
+ $class = isset( $class ) ? $class : 'yith-plugin-fw-text-input';
31
+ ?>
32
+ <input type="text" name="<?php echo $name ?>"
33
+ id="<?php echo $id ?>"
34
+ value="<?php echo esc_attr( $value ) ?>"
35
+ class="<?php echo $class ?>"
36
+ <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>
37
+ <?php echo $custom_attributes ?>
38
+ <?php if ( !$backward_compatibility && isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>/>
39
+
40
+ <?php
41
+ /* --------- BUTTONS ----------- */
42
+ if ( isset( $buttons ) ) {
43
+ $button_field = array(
44
+ 'type' => 'buttons',
45
+ 'buttons' => $buttons
46
+ );
47
+ yith_plugin_fw_get_field( $button_field, true );
48
+ }
49
+ ?>
plugin-fw/templates/fields/text.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+
17
+ $class = isset( $class ) ? $class : 'yith-plugin-fw-text-input';
18
+ ?>
19
+ <input type="text" name="<?php echo $name ?>"
20
+ id="<?php echo $id ?>"
21
+ value="<?php echo esc_attr( $value ) ?>"
22
+ class="<?php echo $class ?>"
23
+ <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>
24
+ <?php echo $custom_attributes ?>
25
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>/>
26
+
plugin-fw/templates/fields/textarea-codemirror.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+
12
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
13
+
14
+ wp_enqueue_script( 'codemirror' );
15
+ wp_enqueue_script( 'codemirror-javascript' );
16
+ wp_enqueue_style( 'codemirror' );
17
+
18
+ extract( $field );
19
+
20
+ $class = isset( $class ) ? $class : 'codemirror';
21
+ ?>
22
+ <textarea id="<?php echo $id ?>"
23
+ name="<?php echo $name ?>"
24
+ class="<?php echo $class ?>"
25
+ rows="8" cols="50" <?php echo $custom_attributes ?>
26
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>><?php echo $value ?></textarea>
plugin-fw/templates/fields/textarea-editor.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ // wp_editor is includes since 3.3 of wordpress
16
+ if ( !function_exists( 'wp_editor' ) ) :
17
+ include 'textarea.php';
18
+ else:
19
+ extract( $field );
20
+
21
+ $editor_args = array(
22
+ 'wpautop' => true, // use wpautop?
23
+ 'media_buttons' => true, // show insert/upload button(s)
24
+ 'textarea_name' => $name, // set the textarea name to something different, square brackets [] can be used here
25
+ 'textarea_rows' => 20, // rows="..."
26
+ 'tabindex' => '',
27
+ 'editor_css' => '', // intended for extra styles for both visual and HTML editors buttons, needs to include the <style> tags, can use "scoped".
28
+ 'editor_class' => '', // add extra class(es) to the editor textarea
29
+ 'teeny' => false, // output the minimal editor config used in Press This
30
+ 'dfw' => false, // replace the default fullscreen with DFW (needs specific DOM elements and css)
31
+ 'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array()
32
+ 'quicktags' => true // load Quicktags, can be used to pass settings directly to Quicktags using an array()
33
+ );
34
+ ?>
35
+ <div class="editor" <?php echo $custom_attributes ?>
36
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>><?php wp_editor( $value, $id, $editor_args ); ?></div>
37
+
38
+ <?php endif; ?>
plugin-fw/templates/fields/textarea.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+
17
+ $class = isset( $class ) ? $class : 'yith-plugin-fw-textarea';
18
+ ?>
19
+ <textarea id="<?php echo $id ?>"
20
+ name="<?php echo $name ?>"
21
+ class="<?php echo $class ?>"
22
+ rows="5" cols="50" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>
23
+ <?php echo $custom_attributes ?>
24
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>><?php echo $value ?></textarea>
plugin-fw/templates/{metaboxes/types/hidden.php → fields/title.php} RENAMED
@@ -6,13 +6,12 @@
6
  * that is bundled with this package in the file LICENSE.txt.
7
  * It is also available through the world-wide-web at this URL:
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
 
 
9
  */
 
10
 
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
-
16
- extract( $args );
17
  ?>
18
- <input type="hidden" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $val ) ?>" <?php if( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?> />
 
6
  * that is bundled with this package in the file LICENSE.txt.
7
  * It is also available through the world-wide-web at this URL:
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
  */
12
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
13
 
14
+ extract( $field );
 
 
 
 
 
15
  ?>
16
+ <h3 class="title" <?php echo $custom_attributes ?>
17
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?>><?php echo $desc ?></h3>
plugin-fw/templates/fields/upload.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ */
12
+
13
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
14
+
15
+ extract( $field );
16
+ ?>
17
+ <input type="text" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>" <?php if ( isset( $default ) ) : ?>data-std="<?php echo $default ?>"<?php endif ?> class="yith-plugin-fw-upload-img-url"/>
18
+ <input type="button" class="button-secondary yith-plugin-fw-upload-button" id="<?php echo $id ?>-button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>"/>
19
+ <input type="button" value="<?php _e( 'Reset', 'yith-plugin-fw' ) ?>" id="<?php echo $id ?>-button-reset" class="yith-plugin-fw-upload-button-reset button"
20
+ data-default="<?php echo isset( $default ) ? $default : '' ?>"/>
21
+ <div class="yith-plugin-fw-upload-img-preview" style="margin-top:10px;">
22
+ <?php
23
+ $file = $value;
24
+ if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
25
+ echo "<img src='$file' style='max-width:600px; max-height:300px;' />";
26
+ }
27
+ ?>
28
+ </div>
plugin-fw/templates/metaboxes/field-row.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var array $field
11
+ *
12
+ * [Important Note] the stored value is:
13
+ * - array if WooCommerce version >= 3.0.0
14
+ * - string (comma-separated) otherwise
15
+ */
16
+
17
+
18
+ if ( !defined( 'ABSPATH' ) ) {
19
+ exit;
20
+ } // Exit if accessed directly
21
+
22
+ // metabox backward compatibility
23
+ if ( isset( $field[ 'label' ] ) )
24
+ $field[ 'title' ] = $field[ 'label' ];
25
+
26
+ $default_field = array(
27
+ 'id' => '',
28
+ 'title' => isset( $field[ 'name' ] ) ? $field[ 'name' ] : '',
29
+ 'desc' => '',
30
+ );
31
+ $field = wp_parse_args( $field, $default_field );
32
+
33
+ $display_field_only = isset( $field[ 'display-field-only' ] ) ? $field[ 'display-field-only' ] : false;
34
+ ?>
35
+ <div id="<?php echo $field[ 'id' ] ?>-container" <?php echo yith_field_deps_data( $field ); ?> class="yith-plugin-fw-metabox-field-row">
36
+ <?php if ( $display_field_only ) :
37
+ yith_plugin_fw_get_field( $field, true );
38
+ else: ?>
39
+ <label for="<?php echo $field[ 'id' ] ?>"><?php echo $field[ 'title' ] ?></label>
40
+ <?php yith_plugin_fw_get_field( $field, true ); ?>
41
+ <div class="clear"></div>
42
+ <span class="description"><?php echo $field[ 'desc' ] ?></span>
43
+ <?php endif; ?>
44
+ </div>
plugin-fw/templates/metaboxes/tab.php CHANGED
@@ -8,32 +8,44 @@
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
- if ( ! defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
  global $post;
16
 
17
  do_action( 'yit_before_metaboxes_tab' ) ?>
18
- <div class="metaboxes-tab">
19
  <?php do_action( 'yit_before_metaboxes_labels' ) ?>
20
  <ul class="metaboxes-tabs clearfix"<?php if ( count( $tabs ) <= 1 ) : ?> style="display:none;"<?php endif; ?>>
21
  <?php
22
  $i = 0;
23
  foreach ( $tabs as $tab ) :
24
- if ( ! isset( $tab['fields'] ) || empty( $tab['fields'] ) ) {
25
  continue;
26
  }
 
 
 
 
 
 
 
 
 
 
 
 
27
  ?>
28
- <li<?php if ( ! $i ) : ?> class="tabs"<?php endif ?>>
29
- <a href="#<?php echo urldecode( sanitize_title( $tab['label'] ) ) ?>"><?php echo $tab['label'] ?></a></li><?php
30
- $i ++;
31
  endforeach;
32
  ?>
33
  </ul>
34
  <?php do_action( 'yit_after_metaboxes_labels' ) ?>
35
- <?php if( isset( $tab['label'] ) ) : ?>
36
- <?php do_action( 'yit_before_metabox_option_' . urldecode( sanitize_title( $tab['label'] ) ) ); ?>
37
  <?php endif ?>
38
 
39
  <?php
@@ -43,29 +55,53 @@ do_action( 'yit_before_metaboxes_tab' ) ?>
43
  <?php foreach ( $tabs as $tab ) :
44
 
45
  ?>
46
- <div class="tabs-panel" id="<?php echo urldecode( sanitize_title( $tab['label'] ) ) ?>">
47
  <?php
48
- if ( ! isset( $tab['fields'] ) ) {
49
  continue;
50
  }
51
 
52
- $tab['fields'] = apply_filters( 'yit_metabox_' . sanitize_title( $tab['label'] ) . '_tab_fields', $tab['fields'] );
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
- foreach ( $tab['fields'] as $id_tab=>$field ) :
55
- $value = yit_get_post_meta( $post->ID, $field['id'] );
56
- $field['value'] = $value != '' ? $value : ( isset( $field['std'] ) ? $field['std'] : '' );
57
  ?>
58
- <div class="the-metabox <?php echo $field['type'] ?> clearfix<?php if ( empty( $field['label'] ) ) : ?> no-label<?php endif; ?>">
59
- <?php $args = apply_filters('yit_fw_metaboxes_type_args', array(
60
- 'basename' => YIT_CORE_PLUGIN_PATH,
61
- 'path' => '/metaboxes/types/',
62
- 'type' => $field['type'],
63
- 'args' => array('args' => $field)
64
- )
65
- );
66
- extract( $args );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  ?>
68
- <?php yit_plugin_get_template( $basename, $path . $type . '.php' , $args ) ?>
69
  </div>
70
  <?php endforeach ?>
71
  </div>
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
+ if ( !defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
  global $post;
16
 
17
  do_action( 'yit_before_metaboxes_tab' ) ?>
18
+ <div class="yith-plugin-fw metaboxes-tab">
19
  <?php do_action( 'yit_before_metaboxes_labels' ) ?>
20
  <ul class="metaboxes-tabs clearfix"<?php if ( count( $tabs ) <= 1 ) : ?> style="display:none;"<?php endif; ?>>
21
  <?php
22
  $i = 0;
23
  foreach ( $tabs as $tab ) :
24
+ if ( !isset( $tab[ 'fields' ] ) || empty( $tab[ 'fields' ] ) ) {
25
  continue;
26
  }
27
+ $anchor_id = 'yith-plugin-fw-metabox-tab-' . urldecode( sanitize_title( $tab[ 'label' ] ) ) . '-anchor';
28
+
29
+ // parse deps for the tab visibility
30
+ if ( isset( $tab[ 'deps' ] ) ) {
31
+ $tab[ 'deps' ][ 'target-id' ] = isset( $tab[ 'deps' ][ 'target-id' ] ) ? $tab[ 'deps' ][ 'target-id' ] : $anchor_id;
32
+ if ( isset( $tab[ 'deps' ][ 'id' ] ) && strpos( $tab[ 'deps' ][ 'id' ], '_' ) !== 0 )
33
+ $tab[ 'deps' ][ 'id' ] = '_' . $tab[ 'deps' ][ 'id' ];
34
+ if ( isset( $tab[ 'deps' ][ 'ids' ] ) && strpos( $tab[ 'deps' ][ 'ids' ], '_' ) !== 0 )
35
+ $tab[ 'deps' ][ 'ids' ] = '_' . $tab[ 'deps' ][ 'ids' ];
36
+
37
+ $tab[ 'deps' ][ 'type' ] = 'hideme';
38
+ }
39
  ?>
40
+ <li id="<?php echo $anchor_id ?>" <?php if ( !$i ) : ?>class="tabs"<?php endif ?> <?php echo yith_field_deps_data( $tab ); ?>>
41
+ <a href="#<?php echo urldecode( sanitize_title( $tab[ 'label' ] ) ) ?>"><?php echo $tab[ 'label' ] ?></a></li><?php
42
+ $i++;
43
  endforeach;
44
  ?>
45
  </ul>
46
  <?php do_action( 'yit_after_metaboxes_labels' ) ?>
47
+ <?php if ( isset( $tab[ 'label' ] ) ) : ?>
48
+ <?php do_action( 'yit_before_metabox_option_' . urldecode( sanitize_title( $tab[ 'label' ] ) ) ); ?>
49
  <?php endif ?>
50
 
51
  <?php
55
  <?php foreach ( $tabs as $tab ) :
56
 
57
  ?>
58
+ <div class="tabs-panel" id="<?php echo urldecode( sanitize_title( $tab[ 'label' ] ) ) ?>">
59
  <?php
60
+ if ( !isset( $tab[ 'fields' ] ) ) {
61
  continue;
62
  }
63
 
64
+ $tab[ 'fields' ] = apply_filters( 'yit_metabox_' . sanitize_title( $tab[ 'label' ] ) . '_tab_fields', $tab[ 'fields' ] );
65
+
66
+ foreach ( $tab[ 'fields' ] as $id_tab => $field ) :
67
+ $field_name = $field[ 'name' ];
68
+ $field_name = str_replace( 'yit_metaboxes[', '', $field_name );
69
+ if ( $pos = strpos( $field_name, ']' ) ) {
70
+ $field_name = substr_replace( $field_name, '', $pos, 1 );
71
+ }
72
+ $value = yit_get_post_meta( $post->ID, $field_name );
73
+ $field[ 'value' ] = $value != '' ? $value : ( isset( $field[ 'std' ] ) ? $field[ 'std' ] : '' );
74
+
75
+ $container_classes = "the-metabox " . $field[ 'type' ] . " clearfix ";
76
+ $container_classes .= empty( $field[ 'label' ] ) ? 'no-label' : '';
77
 
 
 
 
78
  ?>
79
+ <div class="<?php echo $container_classes ?>">
80
+ <?php
81
+ if ( $field_template_path = yith_plugin_fw_get_field_template_path( $field ) ) {
82
+ $display_row = 'hidden' !== $field[ 'type' ];
83
+ $display_row = isset( $field[ 'yith-display-row' ] ) ? !!$field[ 'yith-display-row' ] : $display_row;
84
+ $field[ 'display-field-only' ] = in_array( $field[ 'type' ], array( 'hidden', 'html', 'sep', 'simple-text', 'title' ) );
85
+
86
+ if ( $display_row ) {
87
+ $field_row_path = apply_filters( 'yith_plugin_fw_metabox_field_row_template_path', YIT_CORE_PLUGIN_TEMPLATE_PATH . '/metaboxes/field-row.php', $field );
88
+ file_exists( $field_row_path ) && include( $field_row_path );
89
+ } else {
90
+ yith_plugin_fw_get_field( $field, true );
91
+ }
92
+ } else {
93
+ // backward compatibility
94
+ $args = apply_filters( 'yit_fw_metaboxes_type_args', array(
95
+ 'basename' => YIT_CORE_PLUGIN_PATH,
96
+ 'path' => '/metaboxes/types/',
97
+ 'type' => $field[ 'type' ],
98
+ 'args' => array( 'args' => $field )
99
+ )
100
+ );
101
+ extract( $args );
102
+ yit_plugin_get_template( $basename, $path . $type . '.php', $args );
103
+ }
104
  ?>
 
105
  </div>
106
  <?php endforeach ?>
107
  </div>
plugin-fw/templates/metaboxes/types/ajax-products.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
- wp_enqueue_script( 'woocommerce_admin' );
15
- extract( $args );
16
- $is_multiple = isset( $multiple ) && $multiple;
17
- $multiple = ( $is_multiple ) ? ' multiple' : '';
18
- ?>
19
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
20
-
21
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
22
-
23
- <select id="<?php echo $id ?>" name="<?php echo $name ?><?php if( $is_multiple ) echo "[]" ?>" class="ajax_chosen_select_products" multiple="multiple" data-placeholder="<?php _e('Search for a product','yith-plugin-fw') ?>">
24
- <?php
25
- if ( $value ) {
26
- foreach ( $value as $product_id ) {
27
- $product = wc_get_product( $product_id );
28
- if ( $product ) {
29
- echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product->get_formatted_name() ) . '</option>';
30
- }
31
- }
32
- }
33
- ?>
34
- </select>
35
-
36
- <span class="desc inline"><?php echo $desc ?></span>
37
- </div>
38
- <script>
39
-
40
- (function ($) {
41
- $(document).ready(function(){
42
- $("select.ajax_chosen_select_products").ajaxChosen({
43
- method: 'GET',
44
- url: '<?php echo admin_url('admin-ajax.php') ?>',
45
- dataType: 'json',
46
- afterTypeDelay: 100,
47
- data: {
48
- action: 'woocommerce_json_search_products',
49
- security: '<?php echo wp_create_nonce("search-products") ?>'
50
- }
51
- }, function (data) {
52
- var terms = {};
53
-
54
- $.each(data, function (i, val) {
55
- terms[i] = val;
56
- });
57
-
58
- return terms;
59
- });
60
- })
61
-
62
- })(jQuery);
63
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/categories.php DELETED
@@ -1,88 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- global $post;
16
-
17
- extract( $args );
18
-
19
- if ( empty( $value ) || ! is_array( $value ) )
20
- $value = array();
21
-
22
- $categories = yit_get_model('cpt_unlimited')->get_setting( 'categories', $post->ID );
23
- ?>
24
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
25
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
26
- <div class="categories-panel">
27
- <div class="box">
28
- <ul id="<?php echo $id ?>-category-list" class="category-list">
29
- <?php if ( ! empty( $categories ) ) : ?>
30
- <?php foreach ( $categories as $cat_slug => $cat_name ) : ?>
31
- <li>
32
- <label class="selectit"><input type="checkbox" name="<?php echo $name ?>[]" value="<?php echo esc_attr( $cat_slug ) ?>"<?php checked( in_array( $cat_slug, $value ) ) ?> /> <?php echo $cat_name ?> <a class="remove_cat" href="#">X</a></label>
33
- </li>
34
- <?php endforeach; ?>
35
- <?php else : ?>
36
- <li class="remove-after-add"><i><?php _e( 'No categories.', 'yith-plugin-fw' ); ?></i></li>
37
- <?php endif; ?>
38
- </ul>
39
- </div>
40
- <div class="wp-hidden-children">
41
- <h4>
42
- <a tabindex="3" class="hide-if-no-js" href="#category-add" id="<?php echo $id ?>-category-add"><?php _e( '+ Add New Category', 'yith-plugin-fw' ); ?></a>
43
- </h4>
44
- <p class="category-add-field" id="<?php echo $id ?>-category-field">
45
- <input type="text" class="newcategory" name="newcategory" style="width:100%;" id="<?php echo $id ?>-new-category" />
46
- <input type="button" value="<?php esc_attr_e( 'Add', 'yit' ); ?>" class="add:categorychecklist:category-add button category-add-submit" id="<?php echo $id ?>-category-add-submit" />
47
- </p>
48
- </div>
49
- </div>
50
- <span class="desc inline"><?php echo $desc ?></span>
51
- </div>
52
- <script type="text/javascript">
53
- jQuery(document).ready(function($){
54
- $('#<?php echo $id ?>-category-field').hide();
55
- $(document).on('click', '#<?php echo $id ?>-category-add', function(){
56
- $('#<?php echo $id ?>-category-field').toggle();
57
- return false;
58
- });
59
-
60
- $(document).on('click', '#<?php echo $id ?>-category-add-submit', function(){
61
- var t = $(this);
62
- var new_category = $('#<?php echo $id ?>-new-category').val();
63
-
64
- var data = {
65
- action: 'add_category_post_type',
66
- post_id: <?php echo $post->ID; ?>,
67
- new_category: new_category
68
- };
69
-
70
- $.post(ajaxurl, data, function(response) {
71
- t.prev().val('');
72
- var new_cat = response;
73
-
74
- $('.remove-after-add').hide();
75
- $('.category-list').each(function(){
76
- var this_post_id = $(this).attr('id');
77
- var name = '<?php echo $name ?>';
78
- this_post_id = this_post_id.match( /([0-9]+)/gi );
79
- name = name.replace( /[0-9]+/g, this_post_id[0] );
80
- $(this).prepend('<li><label class="selectit"><input type="checkbox" name="'+name+'[]" value="'+new_cat.slug+'" /> '+new_cat.name+' <a class="remove_cat" href="#">X</a></label></li>');
81
- $('#<?php echo $id ?>-category-list li:first-child .selectit input').attr('checked', true);
82
- });
83
- }, 'json');
84
-
85
- });
86
-
87
- });
88
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/checkbox.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
-
15
- extract( $args );
16
- ?>
17
- <div id="<?php echo $id ?>-container" <?php if ( isset($deps) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
18
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
19
- <p>
20
- <input type="checkbox" id="<?php echo $id ?>" name="<?php echo $name ?>" value="1" <?php if( isset( $std ) ) : ?>data-std="<?php echo $std ?>" <?php endif; checked( $value, 1 ) ?> />
21
- <span class="desc inline"><?php echo $desc ?></span>
22
- </p>
23
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/chosen.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
- $is_multiple = isset( $multiple ) && $multiple;
17
- $multiple = ( $is_multiple ) ? ' multiple' : '';
18
- ?>
19
- <div id="<?php echo $id ?>-container" class="chosen" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
20
-
21
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
22
-
23
- <div class="select_wrapper">
24
- <select<?php echo $multiple ?> id="<?php echo $id ?>" class="chosen" name="<?php echo $name ?><?php if( $is_multiple ) echo "[]" ?>" <?php if ( isset( $std ) ) : ?>data-std="<?php echo ( $is_multiple )? implode(' ,', $std) : $std ?>"<?php endif ?>>
25
- <?php foreach ( $options as $key => $item ) : ?>
26
- <option value="<?php echo esc_attr( $key ) ?>" <?php if( $is_multiple ): selected( true, in_array( $key, $value ) ); else: selected( $key, $value ); endif; ?> ><?php echo $item ?></option>
27
- <?php endforeach; ?>
28
- </select>
29
- </div>
30
-
31
- <span class="desc inline"><?php echo $desc ?></span>
32
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/colorpicker.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
- ?>
17
- <div id="<?php echo $id ?>-container" <?php if ( isset($deps) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
18
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
19
-
20
- <input type="text" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $value ) ?>" <?php if( isset( $std ) ) : ?>data-default-color="<?php echo $std ?>"<?php endif ?> class="panel-colorpicker"/>
21
- <span class="desc inline"><?php echo $desc ?></span>
22
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/contactform.php DELETED
@@ -1,557 +0,0 @@
1
- <?php
2
-
3
-
4
- extract( $args );
5
-
6
- $types = array(
7
- 'text' => __( 'Text Input', 'yith-plugin-fw' ),
8
- 'checkbox' => __( 'Checkbox', 'yith-plugin-fw' ),
9
- 'select' => __( 'Select', 'yith-plugin-fw' ),
10
- 'textarea' => __( 'Textarea', 'yith-plugin-fw' ),
11
- 'radio' => __( 'Radio Input', 'yith-plugin-fw' ),
12
- 'password' => __( 'Password Field', 'yith-plugin-fw' ),
13
- 'file' => __( 'File Upload', 'yith-plugin-fw' ),
14
- );
15
-
16
- $defaults = array(
17
- 'order' => 0,
18
- 'title' => '',
19
- 'data_name' => '',
20
- 'type' => 'text',
21
- 'already_checked' => '',
22
- 'options' => array(),
23
- 'option_selected' => '',
24
- 'error' => '',
25
- 'required' => '',
26
- 'is_email' => '',
27
- 'reply_to' => '',
28
- 'class' => '',
29
- 'select-icon' => 'none',
30
- 'icon' => '',
31
- 'custom-icon' => ''
32
- );
33
-
34
- if ( ! is_array( $value ) ) {
35
- $value = array();
36
- }
37
- foreach ( $value as $i => $v ) {
38
- $value[$i] = wp_parse_args( $value[$i], $defaults );
39
- }
40
-
41
- $index = 1;
42
-
43
-
44
- /* Select Font Awesome */
45
-
46
- $options["select"]=array(
47
- 'icon' => __( 'Theme Icon', 'yith-plugin-fw' ),
48
- 'custom' => __( 'Custom Icon', 'yith-plugin-fw' ),
49
- 'none' => __( 'None', 'yith-plugin-fw' )
50
- );
51
-
52
- $options["icon"] = YIT_Plugin_Common::get_awesome_icons();
53
-
54
- /* End select Font Awesome */
55
- ?>
56
- <div id="<?php echo $id ?>-container" <?php if ( isset($deps) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
57
- <?php if( isset( $label ) ):?><label for="<?php echo $id ?>"><?php echo $label ?></label><?php endif;?>
58
-
59
- <p class="field-row">
60
- <a href="" class="button-secondary add-items"><?php _e( 'Add field', 'yith-plugin-fw' ) ?></a>
61
- <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="add-items-ajax-loading" alt="" />
62
- </p>
63
-
64
-
65
- <div class="contactform_items panel" id="panel_form">
66
- <?php while ( $index <= count( $value ) ): ?>
67
- <div class="contactform_item closed">
68
- <h3>
69
- <button type="button" class="remove_item button" rel=""><?php _e( 'Remove', 'yith-plugin-fw' ) ?></button>
70
- <div class="handlediv" title="<?php _e( 'Click to toggle', 'yith-plugin-fw' ) ?>"></div>
71
- <strong><?php echo $value[$index]['title'] ?> <?php yit_string( '(', $types[$value[$index]['type']], ')' ) ?></strong>
72
- <input type="hidden" class="contactform_menu_order" name="<?php echo $name ?>[<?php echo $index ?>][order]" value="<?php echo esc_attr( $index ) ?>" />
73
- </h3>
74
- <div class="inside">
75
-
76
- <div class="the-metabox text clearfix">
77
- <label for="<?php echo $id ?>_title_<?php echo $index ?>"><?php _e( 'Field Title', 'yith-plugin-fw' ) ?></label>
78
-
79
- <p>
80
- <input type="text" value="<?php echo esc_attr( $value[$index]['title'] ) ?>" id="<?php echo $id ?>_title_<?php echo $index ?>" name="<?php echo $name ?>[<?php echo $index ?>][title]" />
81
- <span class="desc inline"><?php _e( 'Insert the title for the field.', 'yith-plugin-fw' ) ?></span>
82
- </p>
83
- </div>
84
-
85
- <div class="the-metabox text clearfix">
86
- <label for="<?php echo $id ?>_data_name_<?php echo $index ?>"><?php _e( 'Data Name', 'yith-plugin-fw' ) ?></label>
87
-
88
- <p>
89
- <input type="text" value="<?php echo esc_attr( $value[$index]['data_name'] ) ?>" id="<?php echo $id ?>_data_name_<?php echo $index ?>" name="<?php echo $name ?>[<?php echo $index ?>][data_name]" />
90
- <span class="desc inline"><?php _e( 'REQUIRED: Field identification name to be entered into email body. <strong>Note:</strong>Use only lowercase characters and underscores.', 'yith-plugin-fw' ) ?></span>
91
- </p>
92
- </div>
93
-
94
- <div class="the-metabox select clearfix text-field-type">
95
- <label for="<?php echo $id ?>_type_<?php echo $index ?>"><?php _e( 'Field Type', 'yith-plugin-fw' ) ?></label>
96
-
97
- <p>
98
- <select id="<?php echo $id ?>_type_<?php echo $index ?>" name="<?php echo $name . '[' . $index . ']' ?>[type]">
99
- <?php foreach ( $types as $type => $name_type ) : ?>
100
- <option value="<?php echo esc_attr( $type ) ?>"<?php selected( $type, $value[$index]['type'] ) ?>><?php echo $name_type ?></option>
101
- <?php endforeach; ?>
102
- </select>
103
- <span class="desc inline"><?php _e( 'Select the type for this field.', 'yith-plugin-fw' ) ?></span>
104
- </p>
105
- </div>
106
-
107
- <div class="the-metabox checkbox clearfix deps_checkbox deps">
108
- <label for="<?php echo $id ?>_already_checked_<?php echo $index ?>"><?php _e( 'Checked', 'yith-plugin-fw' ) ?></label>
109
-
110
- <p>
111
- <input type="checkbox" id="<?php echo $id ?>_already_checked_<?php echo $index ?>" name="<?php echo $name ?>[<?php echo $index ?>][already_checked]" value="1"<?php checked( $value[$index]['already_checked'] ) ?> />
112
- <span class="desc inline"><?php _e( 'Select this option if you want this field appears as already checked.', 'yith-plugin-fw' ) ?></span>
113
- </p>
114
- </div>
115
-
116
- <div id="<?php echo $id ?>_addoptions" class="the-metabox addoptions clearfix deps_radio deps_select deps">
117
- <label for=""><?php _e( 'Add options ', 'yith-plugin-fw' ) ?></label>
118
- <a href="#" class="add-field-option button-secondary" data-index="<?php echo $index ?>"><?php _e( 'Add option', 'yith-plugin-fw' ) ?></a><br /><br />
119
- <?php foreach ( $value[$index]['options'] as $key => $option ) : ?>
120
- <p class="option">
121
- <label><input type="radio" name="<?php echo $name ?>[<?php echo $index ?>][option_selected]" value="<?php echo esc_attr( $key ) ?>"<?php checked( $value[$index]['option_selected'], $key ) ?> /> <?php _e( 'Selected', 'yith-plugin-fw' ) ?>
122
- </label>
123
- <input type="text" name="<?php echo $name ?>[<?php echo $index ?>][options][]" value="<?php echo $option ?>" style="width:200px" />
124
- <a href="#" class="del-field-option button-secondary"><?php _e( 'Delete option', 'yith-plugin-fw' ) ?></a>
125
- </p>
126
- <?php endforeach; ?>
127
- </div>
128
-
129
- <div class="the-metabox text clearfix">
130
- <label for="<?php echo $id ?>_error_<?php echo $index ?>"><?php _e( 'Error Message', 'yith-plugin-fw' ) ?></label>
131
-
132
- <p>
133
- <input type="text" value="<?php echo esc_attr( $value[$index]['error'] ) ?>" id="<?php echo $id ?>_error_<?php echo $index ?>" name="<?php echo $name ?>[<?php echo $index ?>][error]" />
134
- <span class="desc inline"><?php _e( 'Insert the error message for validation.', 'yith-plugin-fw' ) ?></span>
135
- </p>
136
- </div>
137
-
138
- <div class="the-metabox checkbox clearfix">
139
- <label for="<?php echo $id ?>_required_<?php echo $index ?>"><?php _e( 'Required', 'yith-plugin-fw' ) ?></label>
140
-
141
- <p>
142
- <input type="checkbox" id="<?php echo $id ?>_required_<?php echo $index ?>" name="<?php echo $name ?>[<?php echo $index ?>][required]" value="1"<?php checked( $value[$index]['required'] ) ?> />
143
- <span class="desc inline"><?php _e( 'Select this option if it must be required.', 'yith-plugin-fw' ) ?></span>
144
- </p>
145
- </div>
146
-
147
- <div class="the-metabox checkbox clearfix">
148
- <label for="<?php echo $id ?>_is_email_<?php echo $index ?>"><?php _e( 'Email', 'yith-plugin-fw' ) ?></label>
149
-
150
- <p>
151
- <input type="checkbox" id="<?php echo $id ?>_is_email_<?php echo $index ?>" name="<?php echo $name ?>[<?php echo $index ?>][is_email]" value="1"<?php checked( $value[$index]['is_email'] ) ?> />
152
- <span class="desc inline"><?php _e( 'Select this option if the email must be valid.', 'yith-plugin-fw' ) ?></span>
153
- </p>
154
- </div>
155
-
156
- <div class="the-metabox checkbox clearfix">
157
- <label for="<?php echo $id ?>_reply_to_<?php echo $index ?>"><?php _e( 'Reply To', 'yith-plugin-fw' ) ?></label>
158
-
159
- <p>
160
- <input type="checkbox" id="<?php echo $id ?>_reply_to_<?php echo $index ?>" name="<?php echo $name ?>[<?php echo $index ?>][reply_to]" value="1"<?php checked( $value[$index]['reply_to'] ) ?> />
161
- <span class="desc inline"><?php _e( 'Select this if it is the email you can reply to.', 'yith-plugin-fw' ) ?></span>
162
- </p>
163
- </div>
164
-
165
- <div class="the-metabox text clearfix">
166
- <label for="<?php echo $id ?>_class_<?php echo $index ?>"><?php _e( 'Class', 'yith-plugin-fw' ) ?></label>
167
-
168
- <p>
169
- <input type="text" value="<?php echo esc_attr( $value[$index]['class'] ) ?>" id="<?php echo $id ?>_class_<?php echo $index ?>" name="<?php echo $name ?>[<?php echo $index ?>][class]" />
170
- <span class="desc inline"><?php _e( 'Insert additional class(es) (separated by commas) for more personalization.', 'yith-plugin-fw' ) ?></span>
171
- </p>
172
- </div>
173
-
174
- <div class="the-metabox text clearfix">
175
- <label for="<?php echo $id ?>_icon_<?php echo $index ?>"><?php _e( 'Icon', 'yith-plugin-fw' ) ?></label>
176
-
177
- <p>
178
-
179
- <div class="option">
180
-
181
- <div class="icon_type">
182
- <select name="<?php echo $name ?>[<?php echo $index ?>][select-icon]" id="<?php echo $id ?>_icon_<?php echo $index ?>">
183
- <?php foreach ( $options['select'] as $val => $option ) { ?>
184
- <option value="<?php echo esc_attr( $val ) ?>"<?php selected( $value[$index]['select-icon'], $val ) ?>><?php echo $option; ?></option>
185
- <?php } ?>
186
- </select>
187
- </div>
188
-
189
-
190
-
191
- <div class="awesome_icon" style="font-family: 'FontAwesome'">
192
- <select style="font-family: 'FontAwesome'" name="<?php echo $name ?>[<?php echo $index ?>][icon]" id="<?php echo $id ?>_icon_<?php echo $index ?>[icon]">
193
- <?php foreach ( $options['icon'] as $option => $val ) { ?>
194
- <option value="<?php echo esc_attr( $val ) ?>"<?php selected( $value[$index]['icon'], $val ); ?>>
195
- <?php echo '&#x' . $option . '; ' . $val; ?>
196
- </option>
197
- <?php } ?>
198
- </select>
199
- </div>
200
-
201
- <div class="input_wrapper custom_icon">
202
- <input type="text" name="<?php echo $name ?>[<?php echo $index ?>][custom]" id="<?php echo $id ?>_icon_<?php echo $index ?>[custom-icon]" value="<?php echo esc_attr( $value[$index]['custom'] ); ?>" class="upload_img_url upload_custom_icon" />
203
- <input type="button" name="<?php echo $name ?>[<?php echo $index ?>][custom]-button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>" id="<?php echo $id ?>_icon_<?php echo $index ?>[custom-icon]-button" class="upload_button button" />
204
-
205
- <div class="upload_img_preview" style="margin-top:10px;">
206
- <?php
207
- $file = $current_options['custom'];
208
- if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
209
- echo __('Image preview', 'yith-plugin-fw') . ': ' . "<img src=\"" . YIT_CORE_ASSETS_URL . "/images/sleep.png\" data-src=\"$file\" />";
210
- }
211
- ?>
212
- </div>
213
-
214
- </div>
215
- </div>
216
-
217
- <span class="desc inline"><?php _e( 'Insert an icon for more personalization.', 'yith-plugin-fw' ) ?></span>
218
- </p>
219
- </div>
220
-
221
- <div class="the-metabox text clearfix">
222
- <label for="<?php echo $id ?>_width_<?php echo $index ?>"><?php _e( 'Width', 'yith-plugin-fw' ) ?></label>
223
-
224
- <p>
225
- <select id="<?php echo $id ?>_width_<?php echo $index ?>" name="<?php echo $name . '[' . $index . ']' ?>[width]">
226
- <?php
227
- for ( $i = 1; $i < 13; $i ++ ) {
228
- ?>
229
- <option value="col-sm-<?php echo $i ?>"
230
- <?php
231
- if ( isset( $value[$index]['width'] ) ) {
232
- selected( 'col-sm-' . $i, $value[$index]['width'] );
233
- }
234
- else {
235
- if ( $value['type'] == 'textarea' ) {
236
- selected( 'col-sm-' . $i, 'col-sm-9' );
237
- }
238
- else {
239
- selected( 'col-sm-' . $i, 'col-sm-3' );
240
- }
241
- }
242
- ?>><?php echo $i ?></option>
243
- <?php
244
- }
245
- ?>
246
- </select>
247
- <span class="desc inline"><?php _e( 'Set field length.', 'yith-plugin-fw' ) ?></span>
248
- </p>
249
- </div>
250
- </div>
251
- </div>
252
- <?php
253
- $index ++;
254
- endwhile;
255
- ?>
256
-
257
- </div>
258
-
259
- <div class="contactform_item closed" id="stamp_form" style="display:none;">
260
- <h3>
261
- <button type="button" class="remove_item button" rel=""><?php _e( 'Remove', 'yith-plugin-fw' ) ?></button>
262
- <div class="handlediv" title="<?php _e( 'Click to toggle', 'yith-plugin-fw' ) ?>"></div>
263
- <strong></strong>
264
- <input disabled type="hidden" class="contactform_menu_order" name="<?php echo $name ?>[][order]" value=""/>
265
- </h3>
266
- <div class="inside">
267
-
268
- <div class="the-metabox text clearfix">
269
- <label for="<?php echo $id ?>_title"><?php _e( 'Field Title', 'yith-plugin-fw' ) ?></label>
270
-
271
- <p>
272
- <input disabled type="text" value="" id="<?php echo $id ?>_title" name="<?php echo $name ?>[][title]" />
273
- <span class="desc inline"><?php _e( 'Insert the title for the field.', 'yith-plugin-fw' ) ?></span>
274
- </p>
275
- </div>
276
-
277
- <div class="the-metabox text clearfix">
278
- <label for="<?php echo $id ?>_data_name"><?php _e( 'Data Name', 'yith-plugin-fw' ) ?></label>
279
-
280
- <p>
281
- <input disabled type="text" value="" id="<?php echo $id ?>_data_name" name="<?php echo $name ?>[][data_name]" />
282
- <span class="desc inline"><?php _e( 'REQUIRED: Field identification name to be entered into email body. <strong>Note:</strong>Use only lowercase characters and underscores.', 'yith-plugin-fw' ) ?></span>
283
- </p>
284
- </div>
285
-
286
- <div class="the-metabox select clearfix text-field-type">
287
- <label for="<?php echo $id ?>_type"><?php _e( 'Field Type', 'yith-plugin-fw' ) ?></label>
288
-
289
- <p>
290
- <select disabled id="<?php echo $id ?>_type" name="<?php echo $name ?>[][type]">
291
- <?php foreach ( $types as $type => $name_type ) : ?>
292
- <option value="<?php echo esc_attr( $type ) ?>"><?php echo $name_type ?></option>
293
- <?php endforeach; ?>
294
- </select>
295
- <span class="desc inline"><?php _e( 'Select the type for this field.', 'yith-plugin-fw' ) ?></span>
296
- </p>
297
- </div>
298
-
299
- <div class="the-metabox checkbox clearfix deps_checkbox deps">
300
- <label for="<?php echo $id ?>_already_checked"><?php _e( 'Checked', 'yith-plugin-fw' ) ?></label>
301
-
302
- <p>
303
- <input disabled type="checkbox" id="<?php echo $id ?>_already_checked" name="<?php echo $name ?>[][already_checked]" value="1" />
304
- <span class="desc inline"><?php _e( 'Select this option if you want this field appears as already checked.', 'yith-plugin-fw' ) ?></span>
305
- </p>
306
- </div>
307
-
308
- <div id="<?php echo $id ?>_addoptions" class="the-metabox addoptions clearfix deps_radio deps_select deps">
309
- <label for=""><?php _e( 'Add options ', 'yith-plugin-fw' ) ?></label>
310
- <a href="#" class="add-field-option button-secondary"><?php _e( 'Add option', 'yith-plugin-fw' ) ?></a><br /><br />
311
-
312
- <p class="option">
313
- <label><input disabled type="radio" name="<?php echo $name ?>[][option_selected]" value="" /> <?php _e( 'Selected', 'yith-plugin-fw' ) ?>
314
- </label>
315
- <input disabled type="text" name="<?php echo $name ?>[][options][]" value="" style="width:200px" />
316
- <a href="#" class="del-field-option button-secondary"><?php _e( 'Delete option', 'yith-plugin-fw' ) ?></a>
317
- </p>
318
-
319
- </div>
320
-
321
- <div class="the-metabox text clearfix">
322
- <label for="<?php echo $id ?>_error"><?php _e( 'Error Message', 'yith-plugin-fw' ) ?></label>
323
-
324
- <p>
325
- <input disabled type="text" value="" id="<?php echo $id ?>_error" name="<?php echo $name ?>[][error]" />
326
- <span class="desc inline"><?php _e( 'Insert the error message for validation.', 'yith-plugin-fw' ) ?></span>
327
- </p>
328
- </div>
329
-
330
- <div class="the-metabox checkbox clearfix">
331
- <label for="<?php echo $id ?>_required"><?php _e( 'Required', 'yith-plugin-fw' ) ?></label>
332
-
333
- <p>
334
- <input disabled type="checkbox" id="<?php echo $id ?>_required" name="<?php echo $name ?>[][required]" value="1" />
335
- <span class="desc inline"><?php _e( 'Select this option if it must be required.', 'yith-plugin-fw' ) ?></span>
336
- </p>
337
- </div>
338
-
339
- <div class="the-metabox checkbox clearfix">
340
- <label for="<?php echo $id ?>_is_email"><?php _e( 'Email', 'yith-plugin-fw' ) ?></label>
341
-
342
- <p>
343
- <input disabled type="checkbox" id="<?php echo $id ?>_is_email" name="<?php echo $name ?>[][is_email]" value="1" />
344
- <span class="desc inline"><?php _e( 'Select this option if the email must be valid.', 'yith-plugin-fw' ) ?></span>
345
- </p>
346
- </div>
347
-
348
- <div class="the-metabox checkbox clearfix">
349
- <label for="<?php echo $id ?>_reply_to"><?php _e( 'Reply To', 'yith-plugin-fw' ) ?></label>
350
-
351
- <p>
352
- <input disabled type="checkbox" id="<?php echo $id ?>_reply_to" name="<?php echo $name ?>[][reply_to]" value="1" />
353
- <span class="desc inline"><?php _e( 'Select this if it is the email you can reply to.', 'yith-plugin-fw' ) ?></span>
354
- </p>
355
- </div>
356
-
357
- <div class="the-metabox text clearfix">
358
- <label for="<?php echo $id ?>_class"><?php _e( 'Class', 'yith-plugin-fw' ) ?></label>
359
-
360
- <p>
361
- <input disabled type="text" value="" id="<?php echo $id ?>_class" name="<?php echo $name ?>[][class]" />
362
- <span class="desc inline"><?php _e( 'Insert additional class(es) (separated by commas) for more personalization.', 'yith-plugin-fw' ) ?></span>
363
- </p>
364
- </div>
365
-
366
- <div class="the-metabox text clearfix">
367
- <label for="<?php echo $id ?>_icon"><?php _e( 'Icon', 'yith-plugin-fw' ) ?></label>
368
-
369
- <div class="option">
370
-
371
- <div class="icon_type">
372
- <select disabled name="<?php echo $name ?>[][select-icon]" id="<?php echo $id ?>_icon">
373
- <?php foreach ( $options['select'] as $val => $option ) { ?>
374
- <option value="<?php echo esc_attr( $val ) ?>"><?php echo $option; ?></option>
375
- <?php } ?>
376
- </select>
377
- </div>
378
-
379
- <div class="awesome_icon" style="font-family: 'FontAwesome'">
380
- <select disabled style="font-family: 'FontAwesome'" name="<?php echo $name ?>[][icon]" id="<?php echo $id ?>_icon[icon]">
381
- <?php foreach ( $options['icon'] as $option => $val ) { ?>
382
- <option value="<?php echo esc_attr( $val ) ?>">
383
- <?php echo '&#x' . $option . '; ' . $val; ?>
384
- </option>
385
- <?php } ?>
386
- </select>
387
- </div>
388
-
389
- <div class="input_wrapper custom_icon">
390
- <input disabled type="text" name="<?php echo $name ?>[][custom]" id="<?php echo $id ?>_icon[custom-icon]" value="" class="upload_img_url upload_custom_icon" />
391
- <input disabled type="button" name="<?php echo $name ?>[][custom]-button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>" id="<?php echo $id ?>_icon[custom-icon]-button" class="upload_button button" />
392
-
393
- <div class="upload_img_preview" style="margin-top:10px;">
394
- <?php
395
- $file = '';
396
- if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
397
- echo __('Image preview', 'yith-plugin-fw') . ': ' . "<img src=\"" . YIT_CORE_ASSETS_URL . "/images/sleep.png\" data-src=\"$file\" />";
398
- }
399
- ?>
400
- </div>
401
-
402
- </div>
403
- </div>
404
-
405
- <span class="desc inline"><?php _e( 'Insert an icon for more personalization.', 'yith-plugin-fw' ) ?></span>
406
- </div>
407
-
408
- <div class="the-metabox text clearfix">
409
- <label for="<?php echo $id ?>_width"><?php _e( 'Width', 'yith-plugin-fw' ) ?></label>
410
-
411
- <p>
412
- <select disabled id="<?php echo $id ?>_width" name="<?php echo $name?>[][width]">
413
- <?php
414
- for ( $i = 1; $i < 13; $i ++ ) {
415
- ?>
416
- <option value="col-sm-<?php echo $i ?>"> <?php echo $i ?> </option>
417
- <?php
418
- }
419
- ?>
420
- </select>
421
- <span class="desc inline"><?php _e( 'Set field length.', 'yith-plugin-fw' ) ?></span>
422
- </p>
423
- </div>
424
- </div>
425
- </div>
426
- </div>
427
-
428
- <script>
429
-
430
- var index = <?php echo $index ?>;
431
-
432
- jQuery(document).ready(function ($) {
433
-
434
- $(document).on('click', '#<?php echo $id ?>_addoptions .add-field-option', function(){
435
- var select_index = $(this).data('index');
436
- var option = "<p class='option'><label><input type='radio' name='<?php echo $name ?>[option_selected]' value='' /> <?php _e( 'Selected', 'yith-plugin-fw' ) ?></label><input type='text' name='<?php echo $name ?>[" + select_index + "][options][]' style='width:200px' /> <a href='#' class='del-field-option button-secondary'><?php _e( 'Delete option', 'yith-plugin-fw' ) ?></a></p>";
437
-
438
- $(option).appendTo( $(this).parents('#<?php echo $id ?>_addoptions') );
439
- return false;
440
- });
441
-
442
- //toggle items
443
- $(document).on('click', '.contactform_item h3, .contactform_item .handlediv', function () {
444
- var p = $(this).parent('.contactform_item'), id = p.attr('id');
445
- p.toggleClass('closed');
446
-
447
- if (!p.hasClass('closed')) {
448
- p.find('.inside').show();
449
- } else {
450
- p.find('.inside').hide();
451
- }
452
-
453
- });
454
-
455
- //add item
456
- $(".add-items").click(function () {
457
-
458
-
459
- var a = $("#stamp_form").clone();
460
- a.appendTo("#panel_form").attr("id", "").show();
461
-
462
- a.find("input, select").each(function(){
463
- $(this).prop('disabled', false);
464
- var str = $(this).attr("name");
465
-
466
- var nam = str.replace("[]","["+ index +"]");
467
- $(this).attr("name", nam );
468
- });
469
-
470
- index++;
471
-
472
- $('body').trigger('yit_contact_form_added_item');
473
-
474
- return false;
475
- });
476
-
477
- //remove item
478
- $(document).on('click', '.remove_item', function () {
479
- if ($('.remove_item').length > 1) {
480
- var str = $(this).parents('.contactform_item').find("input:first-child").attr("name").match( /(.*)\[(.*)\](.*)\[(.*)\]/ );
481
-
482
- var i = parseInt(str[2]);
483
-
484
- $('.contactform_item:gt('+ --i +')').find("input, select").each(function(){
485
- var str = $(this).attr("name").match( /(.*)\[(.*)\](.*)\[(.*)\]/ );
486
- var indice = parseInt(str[2]);
487
- var nam = $(this).attr('name').replace("[" + indice + "]", "[" + --indice + "]");
488
- $(this).attr("name", nam );
489
- });
490
-
491
- $(this).parents('.contactform_item').remove();
492
-
493
- index--;
494
-
495
- $('body').trigger('yit_contact_form_removed_item');
496
- }
497
-
498
- return false;
499
- });
500
-
501
- //sortable
502
- $('.contactform_items').sortable({
503
- items:'.contactform_item',
504
- cursor:'move',
505
- axis:'y',
506
- handle: 'h3',
507
- scrollSensitivity:60,
508
- forcePlaceholderSize: true,
509
- helper: 'clone',
510
- opacity: 0.65,
511
- placeholder: 'metabox-sortable-placeholder',
512
- start:function(event,ui){
513
- ui.item.css('background-color','#f6f6f6');
514
- },
515
- stop:function(event,ui){
516
- ui.item.removeAttr('style');
517
-
518
-
519
- variation_row_indexes();
520
- }
521
- });
522
-
523
-
524
- function variation_row_indexes() {
525
- $('.contactform_items .contactform_item').each(function(index){
526
- index++;
527
- $(this).find("input,select").each(function(){
528
- var str = $(this).attr('name').match( /(.*)\[(.*)\](.*)\[(.*)\]/ );
529
- var nam = $(this).attr('name').replace("[" +parseInt(str[2])+ "]", "[" +index+ "]");
530
- $(this).attr('name', nam);
531
- });
532
- });
533
- }
534
-
535
- //
536
- var field_type_handler = function(){
537
- var this_item = $(this);
538
- $(this_item).on('change', '.text-field-type select', function(){
539
- var val = $(this).val();
540
- $('.deps', this_item).hide().filter(function(i){ return $(this).hasClass( 'deps_' + val ); }).show();
541
- });
542
- $('.text-field-type select').change();
543
- };
544
- $('.contactform_item').each(field_type_handler);
545
-
546
-
547
- //
548
- $(document).on('click', '.del-field-option', function(){
549
- if( $('.option').length > 1 ) {
550
- $(this).parents('.option').remove();
551
- }
552
-
553
- return false;
554
- });
555
-
556
- });
557
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/customtabs.php DELETED
@@ -1,152 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract($args);
16
-
17
- $args['labels'] = array(
18
- 'plural_name' => 'Tabs',
19
- 'singular_name' => 'Tab',
20
- 'item_name_sing' => 'Tab',
21
- 'item_name_plur' => 'Tabs',
22
- );
23
-
24
- ?>
25
- <div id="<?php echo $id ?>-container" <?php if ( isset($deps) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
26
- <div id="yit_custom_tabs" class="panel wc-metaboxes-wrapper" style="display: block;">
27
- <p class="toolbar">
28
- <a href="#" class="close_all"><?php _e('Close all', 'yith-plugin-fw') ?></a><a href="#" class="expand_all"><?php _e('Expand all', 'yith-plugin-fw') ?></a>
29
- </p>
30
-
31
- <div class="yit_custom_tabs wc-metaboxes ui-sortable" style="">
32
-
33
- <?php if( !empty($value) ): ?>
34
- <?php foreach( $value as $i=>$tab ): ?>
35
- <div class="yit_custom_tab wc-metabox closed" rel="0">
36
- <h3>
37
- <button type="button" class="remove_row button"><?php _e('Remove', 'yith-plugin-fw') ?></button>
38
- <div class="handlediv" title="Click to toggle"></div>
39
- <strong class="attribute_name"><?php echo $tab['name'] ?></strong>
40
- </h3>
41
-
42
- <table cellpadding="0" cellspacing="0" class="woocommerce_attribute_data wc-metabox-content" style="display: table;">
43
- <tbody>
44
- <tr>
45
- <td class="attribute_name">
46
- <label><?php _e('Name', 'yith-plugin-fw') ?>:</label>
47
- <input type="text" class="attribute_name" name="<?php echo $name ?>[<?php echo $i ?>][name]" value="<?php echo esc_attr( $tab['name'] ) ?>">
48
- <input type="hidden" name="<?php echo $name ?>[<?php echo $i ?>][position]" class="attribute_position" value="<?php echo $i ?>">
49
- </td>
50
-
51
- <td rowspan="3">
52
- <label><?php _e('Value', 'yith-plugin-fw') ?>:</label>
53
- <textarea name="<?php echo $name ?>[<?php echo $i ?>][value]" cols="5" rows="5" placeholder="<?php _e('Content of the tab. (HTML is supported)','yith-plugin-fw') ?>"><?php echo $tab['value'] ?></textarea>
54
- </td>
55
- </tr>
56
- </tbody>
57
- </table>
58
-
59
- </div>
60
- <?php endforeach ?>
61
- <?php endif ?>
62
- </div>
63
-
64
- <p class="toolbar">
65
- <button type="button" class="button button-primary add_custom_tab"><?php _e( 'Add custom product tab', 'yith-plugin-fw' ) ?></button>
66
- </p>
67
-
68
- <div class="clear"></div>
69
- </div>
70
- </div>
71
-
72
- <script>
73
- jQuery(document).ready(function($){
74
- // Add rows
75
- $('button.add_custom_tab').on('click', function(){
76
-
77
- var size = $('.yit_custom_tabs .yit_custom_tab').size() + 1;
78
-
79
- // Add custom attribute row
80
- $('.yit_custom_tabs').append('<div class="yit_custom_tab wc-metabox">\
81
- <h3>\
82
- <button type="button" class="remove_row button"><?php _e('Remove', 'yith-plugin-fw') ?></button>\
83
- <div class="handlediv" title="Click to toggle"></div>\
84
- <strong class="attribute_name"></strong>\
85
- </h3>\
86
- <table cellpadding="0" cellspacing="0" class="woocommerce_attribute_data">\
87
- <tbody>\
88
- <tr>\
89
- <td class="attribute_name">\
90
- <label><?php _e('Name', 'yith-plugin-fw') ?>:</label>\
91
- <input type="text" class="attribute_name" name="<?php echo $name ?>[' + size + '][name]" />\
92
- <input type="hidden" name="<?php echo $name ?>[' + size + '][position]" class="attribute_position" value="' + size + '" />\
93
- </td>\
94
- <td rowspan="3">\
95
- <label><?php _e('Value', 'yith-plugin-fw') ?>:</label>\
96
- <textarea name="<?php echo $name ?>[' + size + '][value]" cols="5" rows="5" placeholder="<?php echo addslashes( __('Content of the tab. (HTML is supported)','yith-plugin-fw') ) ?>"></textarea>\
97
- </td>\
98
- </tr>\
99
- </tbody>\
100
- </table>\
101
- </div>');
102
-
103
- });
104
-
105
-
106
- $('.yit_custom_tabs').on('click', 'button.remove_row', function() {
107
- var answer = confirm("<?php _e('Do you want to remove the custom tab?', 'yith-plugin-fw') ?>");
108
- if (answer){
109
- var $parent = $(this).parent().parent();
110
-
111
- $parent.remove();
112
- attribute_row_indexes();
113
- }
114
- return false;
115
- });
116
-
117
- // Attribute ordering
118
- $('.yit_custom_tabs').sortable({
119
- items:'.yit_custom_tab',
120
- cursor:'move',
121
- axis:'y',
122
- handle: 'h3',
123
- scrollSensitivity:40,
124
- forcePlaceholderSize: true,
125
- helper: 'clone',
126
- opacity: 0.65,
127
- placeholder: 'wc-metabox-sortable-placeholder',
128
- start:function(event,ui){
129
- ui.item.css('background-color','#f6f6f6');
130
- },
131
- stop:function(event,ui){
132
- ui.item.removeAttr('style');
133
- attribute_row_indexes();
134
- }
135
- });
136
-
137
- function attribute_row_indexes() {
138
- $('.yit_custom_tabs .yit_custom_tab').each(function(index, el){
139
- var newVal = '[' + $(el).index('.yit_custom_tabs .yit_custom_tab') + ']';
140
- var oldVal = '[' + $('.attribute_position', el).val() + ']';
141
-
142
- $(':input:not(button)', el).each(function(){
143
- var name = $(this).attr('name');
144
- $(this).attr('name', name.replace(oldVal, newVal));
145
- });
146
-
147
- $('.attribute_position', el).val( $(el).index('.yit_custom_tabs .yit_custom_tab') );
148
- });
149
- };
150
-
151
- });
152
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/datepicker.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
- ?>
17
- <div id="<?php echo $id ?>-container" <?php if ( isset($deps) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
18
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
19
- <input type="text" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $value ) ?>" class="panel-datepicker"/>
20
- <span class="desc inline"><?php echo $desc ?></span>
21
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/icon-list.php DELETED
@@ -1,135 +0,0 @@
1
- <?php
2
- /*
3
- * This file belongs to the YIT Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Awesome Icon Admin View
13
- *
14
- * @package Yithemes
15
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
16
- * @since 1.0.0
17
- */
18
-
19
- extract( $args );
20
-
21
-
22
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
23
-
24
- $current_options = wp_parse_args( $args['value'], $args['std'] );
25
- $current_icon = YIT_Icon()->get_icon_data( $current_options['icon'] );
26
- $std_icon = YIT_Icon()->get_icon_data( $std['icon'] );
27
-
28
- $options['icon'] = YIT_Plugin_Common::get_icon_list();
29
-
30
- ?>
31
-
32
-
33
-
34
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>class="select_icon rm_option rm_input rm_text">
35
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
36
-
37
- <div class="option">
38
- <div class="select_wrapper icon_list_type clearfix">
39
- <select name="<?php echo $name ?>[select]" id="<?php echo $id ?>[select]" <?php if ( isset( $std['select'] ) ) : ?>data-std="<?php echo $std['select']; ?>"<?php endif; ?>>
40
- <?php foreach ( $options['select'] as $val => $option ) : ?>
41
- <option value="<?php echo $val ?>" <?php selected( $current_options['select'], $val ); ?> ><?php echo $option ?></option>
42
- <?php endforeach; ?>
43
- </select>
44
- </div>
45
-
46
-
47
- <div class="icon-manager-wrapper">
48
- <div class="icon-manager-text">
49
- <div class="icon-preview" <?php echo $current_icon ?>></div>
50
- <input type="text" id="<?php echo $id ?>[icon]" class="icon-text" name="<?php echo $name ?>[icon]" value="<?php echo $current_options['icon']; ?>" />
51
- </div>
52
-
53
-
54
- <div class="icon-manager">
55
- <ul class="icon-list-wrapper">
56
- <?php foreach ( $options['icon'] as $font => $icons ):
57
- foreach ( $icons as $key => $icon ): ?>
58
- <li data-font="<?php echo $font ?>" data-icon="<?php echo ( strpos( $key , '\\') === 0 ) ? '&#x'.substr( $key , 1 ) : $key ?>" data-key="<?php echo $key ?>" data-name="<?php echo $icon ?>"></li>
59
- <?php
60
- endforeach;
61
- endforeach; ?>
62
- </ul>
63
- </div>
64
- </div>
65
-
66
-
67
- <div class="input_wrapper custom_icon_wrapper upload" style="clear:both;">
68
- <input type="text" name="<?php echo $name ?>[custom]" id="<?php echo $id ?>[custom]" value="<?php echo $current_options['custom'] ?>" class="upload_img_url upload_custom_icon" />
69
- <input type="button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>" id="<?php echo $id; ?>-custom-button" class="upload_button button" />
70
-
71
- <div class="upload_img_preview" style="margin-top:10px;">
72
- <?php
73
- $file = $current_options['custom'];
74
- if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
75
- echo __('Image preview', 'yith-plugin-fw') . ': ' . "<img src=\"" . YIT_CORE_ASSETS_URL . "/images/sleep.png\" data-src=\"$file\" />";
76
- }
77
- ?>
78
- </div>
79
- </div>
80
-
81
- </div>
82
-
83
- <div class="clear"></div>
84
-
85
-
86
- <div class="description">
87
- <?php echo $desc ?>
88
- <?php if( $std['select'] == 'custom' ) : ?>
89
- <?php printf( __( '(Default: %s <img src="%s"/>)', 'yith-plugin-fw' ), $options['select']['custom'], $std['custom'] ) ?>
90
- <?php else: ?>
91
- <?php printf( __( '(Default: <i %s></i> )', 'yith-plugin-fw' ), $std_icon ) ?>
92
- <?php endif; ?>
93
- </div>
94
-
95
- <div class="clear"></div>
96
-
97
- </div>
98
-
99
- <script>
100
-
101
- jQuery(document).ready( function($){
102
-
103
- $('.select_wrapper.icon_list_type').on('change', function(){
104
-
105
- var t = $(this);
106
- var parents = $('#' + t.parents('div.select_icon').attr('id'));
107
- var option = $('option:selected', this).val();
108
- var to_show = option == 'none' ? '' : option == 'icon' ? '.icon-manager-wrapper' : '.custom_icon_wrapper';
109
-
110
- parents.find('.option > div:not(.icon_list_type)').removeClass('show').addClass('hidden');
111
- parents.find( to_show ).removeClass( 'hidden' ).addClass( 'show' );
112
- });
113
-
114
- $('.select_wrapper.icon_list_type').trigger('change');
115
-
116
- var $icon_list = $('.select_icon').find('ul.icon-list-wrapper'),
117
- $preview = $('.icon-preview'),
118
- $element_list = $icon_list.find('li'),
119
- $icon_text = $('.icon-text');
120
-
121
- $element_list.on("click", function () {
122
- var $t = $(this);
123
- $element_list.removeClass('active');
124
- $t.addClass('active');
125
- $preview.attr('data-font', $t.data('font'));
126
- $preview.attr('data-icon', $t.data('icon'));
127
- $preview.attr('data-name', $t.data('name'));
128
- $preview.attr('data-key', $t.data('key'));
129
-
130
- $icon_text.val($t.data('font') + ':' + $t.data('name'));
131
-
132
- });
133
- });
134
-
135
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/image-gallery.php DELETED
@@ -1,48 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
- $array_id = array();
17
- if ( !empty( $value ) ) {
18
- $array_id = array_filter( explode( ',', $value ) );
19
- }
20
-
21
- ?>
22
- <div id="<?php echo $id ?>-container" class="image-gallery" <?php if (isset( $deps )): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
23
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
24
-
25
- <p>
26
- <span class="desc inline"><?php echo $desc ?></span>
27
- <ul id="<?php echo $id ?>-extra-images" class="slides-wrapper extra-images ui-sortable clearfix">
28
- <?php if ( !empty( $array_id ) ) : ?>
29
- <?php foreach ( $array_id as $image_id ) : ?>
30
- <li class="image" data-attachment_id = <?php echo esc_attr($image_id) ?>>
31
- <a href="#">
32
- <?php
33
- if( function_exists( 'yit_image' ) ) :
34
- yit_image( "id=$image_id&size=admin-post-type-thumbnails" );
35
- else:
36
- echo wp_get_attachment_image( $image_id, array( 80, 80 ) );
37
- endif; ?>
38
- </a>
39
- <ul class="actions">
40
- <li><a href="#" class="delete" title="<?php _e( 'Delete image', 'yith-plugin-fw' ); ?>">x</a></li>
41
- </ul>
42
- </li>
43
- <?php endforeach; endif; ?>
44
- </ul>
45
- <input type="button" data-choose="<?php _e( 'Add Images to Gallery', 'yith-plugin-fw' ); ?>" data-update="<?php _e( 'Add to gallery', 'yith-plugin-fw' ); ?>" value="<?php _e( 'Add images', 'yith-plugin-fw' ) ?>" data-delete="<?php _e( 'Delete image', 'yith-plugin-fw' ); ?>" data-text="<?php _e( 'Delete', 'yith-plugin-fw' ); ?>" id="<?php echo $id ?>-button" class="image-gallery-button button" />
46
- <input type="hidden" class="image_gallery_ids" id="image_gallery_ids" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ); ?>" />
47
- </p>
48
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/images.php DELETED
@@ -1,90 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- global $post;
15
-
16
- extract( $args );
17
-
18
- if ( empty( $value ) || ! is_array( $value ) )
19
- $value = array();
20
-
21
- //$categories = yit_get_model('cpt_unlimited')->get_setting( 'categories', $post->ID );
22
- ?>
23
- <div id="<?php echo $id ?>-container" <?php if ( isset($deps) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
24
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
25
- <span class="desc inline"><?php echo $desc ?></span>
26
- <ul id="<?php echo $id ?>-extra-images" class="slides-wrapper extra-images ui-sortable clearfix" style="">
27
- <?php if ( ! empty( $value ) ) : foreach ( $value as $image_id ) : ?>
28
- <li>
29
- <a href="#">
30
- <?php
31
- if( function_exists( 'yit_image' ) ) :
32
- yit_image( "id=$image_id&size=admin-post-type-thumbnails" );
33
- else:
34
- echo wp_get_attachment_image( $image_id, array( 80, 80 ) );
35
- endif; ?>
36
- <input type="hidden" name="<?php echo $name ?>[]" value="<?php echo esc_attr( $image_id ) ?>" />
37
- </a>
38
- <a href="#" title="<?php _e( 'Delete image', 'yith-plugin-fw' ) ?>" class="delete">X</a>
39
- </li>
40
- <?php endforeach; endif; ?>
41
- </ul>
42
- <a href="#" class="button-secondary upload-extra-images" id="<?php echo $id ?>-upload-extra-images"><?php _e( 'Upload new images', 'yith-plugin-fw' ) ?></a>
43
- </div>
44
- <script type="text/javascript">
45
- jQuery(document).ready(function($){
46
- $('#<?php echo $id ?>-upload-extra-images').on( 'click', function(){
47
- tb_show('', 'media-upload.php?post_id=0&TB_iframe=1&width=700');
48
-
49
- window.send_to_editor = function(html) {
50
-
51
- var imgurl = $('a', '<div>' + html + '</div>').attr('href');
52
- var image_id = $('img', html).attr('class').replace(/(.*?)wp-image-/, '');
53
-
54
- var data = {
55
- action: 'generate_preview_image_post_type',
56
- item_id: image_id
57
- };
58
-
59
- $.post(ajaxurl, data, function(response) {
60
- var thumburl = imgurl.split('.').reverse();
61
- var baseurl = imgurl.replace( '.' + thumburl[0], '' );
62
- thumburl = baseurl + '-140x100.' + thumburl[0];
63
-
64
- $('#<?php echo $id ?>-extra-images.slides-wrapper').append('<li><a href="#"><img src="'+thumburl+'" width="140" height="100" /> <input type="hidden" name="<?php echo $name ?>[]" value="'+image_id+'" /></a><a href="#" title="<?php echo addslashes( __( 'Delete image', 'yith-plugin-fw' ) ) ?>" class="delete">X</a></li>');
65
- });
66
-
67
- tb_remove();
68
-
69
- }
70
-
71
- return false;
72
- });
73
-
74
- $('#<?php echo $id ?>-extra-images a.delete').on( 'click', function(){
75
- if ( confirm( "<?php _e( 'Are you sure you want to remove this image?', 'yith-plugin-fw' ) ?>" ) ) {
76
- $(this).parent().remove();
77
- }
78
-
79
- return false;
80
- });
81
-
82
- // SORTABLE
83
- $('#<?php echo $id ?>-extra-images').sortable({
84
- axis: 'x',
85
- stop: function(e, ui) {}
86
- });
87
-
88
- $('.extra-images a:not(.delete)').click(function(){ return false; });
89
- });
90
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/number.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
-
17
- $min_max_attr = $step_attr = '';
18
-
19
- if( isset( $min ) ){
20
- $min_max_attr .= " min='{$min}'";
21
- }
22
-
23
- if( isset( $max ) ){
24
- $min_max_attr .= " max='{$max}'";
25
- }
26
-
27
- if( isset( $step ) ){
28
- $step_attr .= "step='{$step}'";
29
- }
30
- ?>
31
- <div id="<?php echo $id ?>-container" <?php if ( isset($deps) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
32
- <div class="rm_number">
33
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
34
- <span class="field">
35
- <input class="number" type="text" id="<?php echo $id ?>" name="<?php echo $name ?>" <?php echo $step_attr ?> <?php echo $min_max_attr ?> value="<?php echo esc_attr( $value ) ?>" <?php if( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>" />
36
- <?php yit_string( '<span class="description">', $desc, '</span>' ); ?>
37
- </span>
38
- </div>
39
- </div>
40
- <script type="text/javascript" charset="utf-8">
41
- jQuery(document).ready( function( $ ) {
42
- $('#<?php echo $id ?>').spinner({
43
- <?php if( isset( $min )): ?>min: <?php echo $min ?>, <?php endif ?>
44
- <?php if( isset( $max )): ?>max: <?php echo $max ?>, <?php endif ?>
45
- showOn: 'always',
46
- upIconClass: "ui-icon-plus",
47
- downIconClass: "ui-icon-minus"
48
- });
49
- });
50
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/onoff.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
-
17
- if ( !isset( $desc ) ) {
18
- $desc='';
19
- }
20
- ?>
21
-
22
- <div id="<?php echo $id ?>-container" <?php if ( isset($deps) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?> class="rm_onoff onoff_container">
23
-
24
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
25
- <p>
26
- <input type="checkbox" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>" <?php checked( $value, 'yes' ) ?> class="on_off" <?php if( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?> />
27
- <span class="onoff">&nbsp;</span>
28
- <span class="desc inline"><?php echo $desc ?></span>
29
- </p>
30
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/preview.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- extract( $args );
15
-
16
- ?>
17
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?> data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
18
- <img src="<?php echo $value ?>" class="yit-preview">
19
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/responsivesliders.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- extract( $args );
15
-
16
- $options = yit_get_responsive_sliders();
17
- ?>
18
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
19
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
20
-
21
- <div class="select_wrapper">
22
- <select id="<?php echo $id ?>" name="<?php echo $name ?>" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>>
23
- <option></option>
24
- <option value="none"><?php _e( 'None', 'yith-plugin-fw' ) ?></option>
25
- <?php foreach ( $options as $key => $item ) : ?>
26
- <option value="<?php echo esc_attr( $key ) ?>"<?php selected( $key, $value ) ?>><?php echo $item ?></option>
27
- <?php endforeach; ?>
28
- </select>
29
- </div>
30
- <span class="desc inline"><?php echo $desc ?></span>
31
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/select-icon.php DELETED
@@ -1,72 +0,0 @@
1
- <?php
2
-
3
-
4
- extract( $args );
5
-
6
- $current_options = wp_parse_args( $args['value'], $args['std'] );
7
-
8
- ?>
9
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?> class="select_icon">
10
-
11
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
12
-
13
- <div class="option">
14
-
15
- <div class="select_wrapper icon_type">
16
- <select id="<?php echo $id ?>[select]" name="<?php echo $name ?>[select]" <?php if ( isset( $std['select'] ) ) : ?>data-std="<?php echo $std['select']; ?>"<?php endif; ?>>
17
- <?php foreach ( $options['select'] as $val => $option ) : ?>
18
- <option value="<?php echo $val ?>" <?php selected( $current_options['select'], $val ); ?> ><?php echo $option ?></option>
19
- <?php endforeach; ?>
20
- </select>
21
- </div>
22
-
23
- <div class="select_wrapper awesome_icon" style="font-family: 'FontAwesome'">
24
- <select style="font-family: 'FontAwesome'" id="<?php echo $id ?>[icon]" name="<?php echo $name ?>[icon]">
25
- <?php foreach ( $options['icon'] as $val => $option ) : $esc_icon = ! empty( $val ) ? '&#x' . $val . '; ' : ''; ?>
26
- <option value="<?php echo $option ?>" <?php selected( $current_options['icon'], $option ); ?> ><?php echo $esc_icon . $option; ?></option>
27
- <?php endforeach; ?>
28
- </select>
29
- </div>
30
-
31
- <div class="input_wrapper custom_icon">
32
- <input type="text" name="<?php echo $name ?>[custom]" id="<?php echo $id ?>[custom]" value="<?php echo $current_options['custom'] ?>" class="upload_img_url upload_custom_icon" />
33
- <input type="button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>" id="<?php echo $id; ?>-custom-button" class="upload_button button" />
34
-
35
- <div class="upload_img_preview" style="margin-top:10px;">
36
- <?php
37
- $file = $current_options['custom'];
38
- if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
39
- echo __( 'Image preview', 'yith-plugin-fw' ) . ': ' . "<img src=\"" . YIT_CORE_ASSETS_URL . "/images/sleep.png\" data-src=\"$file\" />";
40
- }
41
- ?>
42
- </div>
43
-
44
- </div>
45
- </div>
46
-
47
- <div class="clear"></div>
48
-
49
- <div class="description">
50
- <?php echo $desc ?>
51
- </div>
52
-
53
- </div>
54
-
55
- <script>
56
-
57
- jQuery(document).ready( function($){
58
-
59
- $('.select_wrapper.icon_type').on('change', function(){
60
- var t = $(this);
61
- var parents = $('#' + t.parents('div.select_icon').attr('id'));
62
- var option = $('option:selected', this).val();
63
- var to_show = option == 'none' ? '' : option == 'icon' ? '.awesome_icon' : '.custom_icon';
64
-
65
- parents.find('.option > div:not(.icon_type)').addClass('hidden').removeClass( 'show' );
66
- parents.find( to_show ).removeClass( 'hidden' ).addClass( 'show' );
67
- });
68
-
69
- $('.select_wrapper.icon_type').trigger('change');
70
- });
71
-
72
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/select-mailchimp.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
- $multiple = ( isset( $multiple ) && $multiple ) ? ' multiple' : '';
17
- ?>
18
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
19
-
20
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
21
-
22
- <div class="select_wrapper">
23
- <select<?php echo $multiple ?> id="<?php echo $id ?>" name="<?php echo $name ?>" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>>
24
- <?php foreach ( $options as $key => $item ) : ?>
25
- <option value="<?php echo $key ?>"<?php selected( $key, $value ) ?>><?php echo $item ?></option>
26
- <?php endforeach; ?>
27
- </select>
28
- </div>
29
- <input type="button" class="button-secondary <?php echo $class?>" value="<?php echo $button_name?>"/>
30
- <span class="spinner"></span>
31
- <span class="desc inline"><?php echo $desc ?></span>
32
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/select.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
- $is_multiple = isset( $multiple ) && $multiple;
17
- $multiple = ( $is_multiple ) ? ' multiple' : '';
18
- ?>
19
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
20
-
21
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
22
-
23
- <div class="select_wrapper">
24
- <select<?php echo $multiple ?> id="<?php echo $id ?>" name="<?php echo $name ?><?php if( $is_multiple ) echo "[]" ?>" <?php if ( isset( $std ) ) : ?>data-std="<?php echo ( $is_multiple )? implode(' ,', $std) : $std ?>"<?php endif ?>>
25
- <?php foreach ( $options as $key => $item ) : ?>
26
- <option value="<?php echo esc_attr( $key ) ?>" <?php if( $is_multiple ): selected( true, in_array( $key, $value ) ); else: selected( $key, $value ); endif; ?> ><?php echo $item ?></option>
27
- <?php endforeach; ?>
28
- </select>
29
- </div>
30
-
31
- <span class="desc inline"><?php echo $desc ?></span>
32
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/sidebar-layout.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
-
17
- $layout = ! isset( $value['layout'] ) ? 'sidebar-right' : $value['layout'];
18
- $sidebar = ! isset( $value['sidebar'] ) ? '' : $value['sidebar'];
19
- ?>
20
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
21
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
22
-
23
- <p class="yit-sidebar-layout">
24
- <input type="radio" name="<?php echo $name ?>[layout]" id="<?php echo $id . '-left' ?>" value="sidebar-left" <?php checked( $layout, 'sidebar-left' ) ?> />
25
- <img src="<?php echo YIT_CORE_ASSETS_URL ?>/images/sideleft.png" title="<?php _e( 'Left sidebar', 'yith-plugin-fw' ) ?>" alt="<?php _e( 'Left sidebar', 'yith-plugin-fw' ) ?>" />
26
-
27
- <input type="radio" name="<?php echo $name ?>[layout]" id="<?php echo $id . '-no' ?>" value="sidebar-no" <?php checked( $layout, 'sidebar-no' ) ?> />
28
- <img src="<?php echo YIT_CORE_ASSETS_URL ?>/images/noside.png" title="<?php _e( 'No sidebar', 'yith-plugin-fw' ) ?>" alt="<?php _e( 'No sidebar', 'yith-plugin-fw' ) ?>" />
29
-
30
- <input type="radio" name="<?php echo $name ?>[layout]" id="<?php echo $id . '-right' ?>" value="sidebar-right" <?php checked( $layout, 'sidebar-right' ) ?> />
31
- <img src="<?php echo YIT_CORE_ASSETS_URL ?>/images/sideright.png" title="<?php _e( 'Right sidebar', 'yith-plugin-fw' ) ?>" alt="<?php _e( 'Right sidebar', 'yith-plugin-fw' ) ?>" />
32
-
33
- <select name="<?php echo $name ?>[sidebar]" id="<?php echo $id ?>-sidebar">
34
- <option value="-1"><?php _e( 'Choose a sidebar', 'yith-plugin-fw' ) ?></option>
35
- <?php foreach ( yit_registered_sidebars() as $val => $option ) { ?>
36
- <option value="<?php echo esc_attr( $val ) ?>" <?php selected( $sidebar, $val ) ?>><?php echo $option; ?></option>
37
- <?php } ?>
38
- </select>
39
- <script type="text/javascript">
40
- jQuery(document).ready(function ($) {
41
- $('.yit-sidebar-layout img').click(function () {
42
- $(this).parent().children(':radio').attr('checked', false);
43
- $(this).prev(':radio').attr('checked', true);
44
- });
45
-
46
- if ($('#<?php echo $id . '-no' ?>').attr('checked')) {
47
- $('#<?php echo $id ?>-sidebar').hide();
48
- }
49
-
50
- $('.yit-sidebar-layout :radio').next('img').click(function () {
51
-
52
- if ($(this).prev(':radio').val() == 'sidebar-no') {
53
- $('#<?php echo $id ?>-sidebar').fadeOut();
54
- } else {
55
- $('#<?php echo $id ?>-sidebar').fadeIn();
56
- }
57
- });
58
- });
59
- </script>
60
- </p>
61
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/sidebarlist.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
-
17
- $options = yit_registered_sidebars();
18
- ?>
19
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
20
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
21
- <div class="select_wrapper">
22
- <select id="<?php echo $id ?>" name="<?php echo $name ?>">
23
- <?php foreach ( $options as $key => $item ) : ?>
24
- <option value="<?php echo esc_attr( $key ) ?>"<?php selected( $key, $value ) ?>><?php echo $item ?></option>
25
- <?php endforeach; ?>
26
- </select>
27
- </div>
28
- <span class="desc inline"><?php echo $desc ?></span>
29
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/sidebars.php DELETED
@@ -1,124 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Select Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- extract( $args );
20
- //
21
- //$layout = ! isset( $value['layout'] ) ? 'sidebar-right' : $value['layout'];
22
- //$sidebar1 = ! isset( $value['sidebar1'] ) ? '-1' : $value['sidebar1'];
23
- //$sidebar2 = ! isset( $value['sidebar2'] ) ? '-1' : $value['sidebar2'];
24
-
25
-
26
- $layout = ! isset( $value['layout'] ) ? 'sidebar-no' : $value['layout'];
27
- $sidebar_left = ! isset( $value['sidebar-left'] ) ? '-1' : $value['sidebar-left'];
28
- $sidebar_right = ! isset( $value['sidebar-right'] ) ? '-1' : $value['sidebar-right'];
29
-
30
- ?>
31
- <div class="yit-sidebar-layout">
32
- <div class="option">
33
- <label for="_slider_name"><?php echo $label ?></label>
34
-
35
- <input type="radio" name="<?php echo $name ?>[layout]" id="<?php echo $id . '-left' ?>" value="sidebar-left" <?php checked( $layout, 'sidebar-left' ) ?> />
36
- <img src="<?php echo YIT_CORE_PLUGIN_URL ?>/assets/images/sidebar-left.png" title="<?php _e( 'Left sidebar', 'yith-plugin-fw' ) ?>" alt="<?php _e( 'Left sidebar', 'yith-plugin-fw' ) ?>" class="<?php echo $id . '-left' ?>" />
37
-
38
- <input type="radio" name="<?php echo $name ?>[layout]" id="<?php echo $id . '-right' ?>" value="sidebar-right" <?php checked( $layout, 'sidebar-right' ) ?> />
39
- <img src="<?php echo YIT_CORE_PLUGIN_URL ?>/assets/images/sidebar-right.png" title="<?php _e( 'Right sidebar', 'yith-plugin-fw' ) ?>" alt="<?php _e( 'Right sidebar', 'yith-plugin-fw' ) ?>" class="<?php echo $id . '-right' ?>" />
40
-
41
- <input type="radio" name="<?php echo $name ?>[layout]" id="<?php echo $id . '-double' ?>" value="sidebar-double" <?php checked( $layout, 'sidebar-double' ) ?> />
42
- <img src="<?php echo YIT_CORE_PLUGIN_URL ?>/assets/images/double-sidebar.png" title="<?php _e( 'No sidebar', 'yith-plugin-fw' ) ?>" alt="<?php _e( 'No sidebar', 'yith-plugin-fw' ) ?>" class="<?php echo $id . '-double' ?>" />
43
-
44
- <input type="radio" name="<?php echo $name ?>[layout]" id="<?php echo $id . '-no' ?>" value="sidebar-no" <?php checked( $layout, 'sidebar-no' ) ?> />
45
- <img src="<?php echo YIT_CORE_PLUGIN_URL ?>/assets/images/no-sidebar.png" title="<?php _e( 'No sidebar', 'yith-plugin-fw' ) ?>" alt="<?php _e( 'No sidebar', 'yith-plugin-fw' ) ?>" class="<?php echo $id . '-no' ?>" />
46
- </div>
47
- <div class="clearfix"></div>
48
- <div class="option" id="choose-sidebars">
49
- <div class="side">
50
- <div class="select-mask" <?php if ( $layout != 'sidebar-double' && $layout != 'sidebar-left' ) { echo 'style="display:none"'; } ?> id="<?php echo $id ?>-sidebar-left-container">
51
- <label for ="<?php echo $id ?>-sidebar-left"><?php _e('Left Sidebar','yith-plugin-fw') ?></label>
52
- <select name="<?php echo $name ?>[sidebar-left]" id="<?php echo $id ?>-sidebar-left">
53
- <option value="-1"><?php _e( 'Choose a sidebar', 'yith-plugin-fw' ) ?></option>
54
- <?php foreach ( yit_registered_sidebars() as $val => $option ) { ?>
55
- <option value="<?php echo esc_attr( $val ) ?>" <?php selected( $sidebar_left, $val ) ?>><?php echo $option; ?></option>
56
- <?php } ?>
57
- </select>
58
- </div>
59
- </div>
60
- <div class="side" style="clear: both">
61
- <div class="select-mask" <?php if ( $layout != 'sidebar-double' && $layout != 'sidebar-right' ) { echo 'style="display:none"'; } ?> id="<?php echo $id ?>-sidebar-right-container">
62
- <label for ="<?php echo $id ?>-sidebar-right"><?php _e('Right Sidebar','yith-plugin-fw') ?></label>
63
- <select name="<?php echo $name ?>[sidebar-right]" id="<?php echo $id ?>-sidebar-right">
64
- <option value="-1"><?php _e( 'Choose a sidebar', 'yith-plugin-fw' ) ?></option>
65
- <?php foreach ( yit_registered_sidebars() as $val => $option ) { ?>
66
- <option value="<?php echo esc_attr( $val ) ?>" <?php selected( $sidebar_right, $val ) ?>><?php echo $option; ?></option>
67
- <?php } ?>
68
- </select>
69
- </div>
70
- </div>
71
- </div>
72
-
73
- </div>
74
-
75
- <script type="text/javascript">
76
- (function ($){
77
-
78
- $(document).on('click', '.yit-sidebar-layout img' , function(e) {
79
-
80
- $( this ).parent().children( ':radio' ).attr( 'checked', false );
81
- $( this ).prev( ':radio' ).attr( 'checked', true );
82
- });
83
-
84
- $(document).on('click', 'img._sidebars-no' , function(e) {
85
- $( '#_sidebars-sidebar-left-container, #_sidebars-sidebar-right-container' ).hide();
86
- });
87
-
88
- $(document).on('click', 'img._sidebars-left' , function(e) {
89
- $('#_sidebars-sidebar-right-container' ).hide();
90
- $('#_sidebars-sidebar-left-container' ).show();
91
- });
92
-
93
- $(document).on('click', 'img._sidebars-right' , function(e) {
94
- $('#_sidebars-sidebar-right-container' ).show();
95
- $('#_sidebars-sidebar-left-container' ).hide();
96
- });
97
-
98
- $(document).on('click', 'img._sidebars-double' , function(e) {
99
- $( '#_sidebars-sidebar-right-container, #_sidebars-sidebar-left-container' ).show();
100
- });
101
-
102
- //
103
- // $(document).on('click', '.yit-sidebar-layout img' , function() {
104
- //
105
- // $( this ).parent().children( ':radio' ).attr( 'checked', false );
106
- // $( this ).prev( ':radio' ).attr( 'checked', true );
107
- // });
108
- //
109
- // $('img._sidebar-no').click( function() {
110
- // $( '#_sidebar-sidebar1-container, #_sidebar-sidebar2-container' ).hide();
111
- // });
112
- //
113
- // $( 'img._sidebar-left, img._sidebar-right').click( function() {
114
- // $('#_sidebar-sidebar2-container' ).hide();
115
- // $('#_sidebar-sidebar1-container' ).show();
116
- // });
117
- //
118
- // $('img._sidebar-double').click( function() {
119
- // $( '#_sidebar-sidebar1-container, #_sidebar-sidebar2-container' ).show();
120
- // });
121
-
122
-
123
- })(jQuery);
124
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/slider.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
-
16
- extract( $args );
17
-
18
- if ( ! isset( $labels ) ) {
19
- $labels = '';
20
- }
21
-
22
- ?>
23
- <div id="<?php echo $id ?>-container" class="slider_container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
24
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
25
- <div class="ui-slider">
26
- <span class="minCaption"><?php echo $min ?></span>
27
- <span class="maxCaption"><?php echo $max ?></span>
28
- <span id="<?php echo $id ?>-feedback" class="feedback"><strong><?php echo $value ?></strong></span>
29
-
30
- <div id="<?php echo $id ?>-div" data-step="<?php echo isset( $step ) ? $step : 1 ?>" data-labels="<?php echo '' ?>" data-min="<?php echo $min ?>" data-max="<?php echo $max ?>" data-val="<?php echo $value; ?>" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">
31
- <input id="<?php echo $id ?>" type="hidden" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ); ?>" />
32
- </div>
33
- </div>
34
- <span class="description"><?php echo $desc ?></span>
35
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/text-array.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
-
17
- $size = isset( $size ) ? " style=\"width:{$size}px;\"" : '';
18
- ?>
19
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
20
- <label for="<?php echo $id ?>"><?php echo $label ?>
21
- <small><?php echo $desc ?></small>
22
- </label>
23
-
24
- <p>
25
- <?php foreach ( $fields as $field_name => $field_label ) : ?>
26
- <?php echo $field_label ?>:
27
- <input type="text" name="<?php echo $name ?>[<?php echo $field_name ?>]" id="<?php echo $id ?>_<?php echo $field_name ?>" value="<?php echo isset( $value[$field_name] ) ? esc_attr( $value[$field_name] ) : '' ?>"<?php echo $size ?> /> &nbsp; &nbsp;
28
- <?php endforeach ?>
29
- </p>
30
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/text.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- extract( $args );
15
-
16
- ?>
17
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?> data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
18
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
19
-
20
- <p>
21
- <input type="text" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $value ) ?>" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?> />
22
- <span class="desc inline"><?php echo $desc ?></span>
23
- </p>
24
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/textarea-editor.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
-
16
- // wp_editor is includes since 3.3 of wordpress
17
- if ( ! function_exists( 'wp_editor' ) ) {
18
- include 'textarea.php';
19
- return;
20
- }
21
-
22
- extract( $args );
23
-
24
- $editor_args = array(
25
- 'wpautop' => true, // use wpautop?
26
- 'media_buttons' => true, // show insert/upload button(s)
27
- 'textarea_name' => $name, // set the textarea name to something different, square brackets [] can be used here
28
- 'textarea_rows' => 20, // rows="..."
29
- 'tabindex' => '',
30
- 'editor_css' => '', // intended for extra styles for both visual and HTML editors buttons, needs to include the <style> tags, can use "scoped".
31
- 'editor_class' => '', // add extra class(es) to the editor textarea
32
- 'teeny' => false, // output the minimal editor config used in Press This
33
- 'dfw' => false, // replace the default fullscreen with DFW (needs specific DOM elements and css)
34
- 'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array()
35
- 'quicktags' => true // load Quicktags, can be used to pass settings directly to Quicktags using an array()
36
- );
37
- ?>
38
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?> >
39
- <?php if ( ! empty( $title ) ) : ?><label for="<?php echo $id ?>"><?php echo $title ?></label><?php endif; ?>
40
- <div class="editor"><?php wp_editor( $value, $id, $editor_args ); ?></div>
41
- <p><span class="desc"><?php echo $desc ?></span></p>
42
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/textarea.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
-
16
- extract( $args );
17
- ?>
18
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
19
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
20
-
21
- <p>
22
- <textarea id="<?php echo $id ?>" name="<?php echo $name ?>" rows="5" cols="50" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?>><?php echo $value ?></textarea>
23
- <span class="desc inline"><?php echo $desc ?></span>
24
- </p>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/title.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- extract( $args );
15
- ?>
16
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
17
- <h3 style="margin: 0 -10px;"><?php echo $desc ?></h3>
18
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/typography.php DELETED
@@ -1,255 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
-
17
- $defaults = array(
18
- 'size' => 12,
19
- 'unit' => 'px',
20
- 'family' => '',
21
- 'style' => 'regular',
22
- 'color' => '#000000'
23
- );
24
- $value = wp_parse_args( $value, $defaults );
25
- ?>
26
- <div id="<?php echo $id ?>-container" <?php if ( isset( $deps ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?> >
27
- <div id="<?php echo $id ?>" class="rm_typography rm_option">
28
- <div class="option">
29
- <label for="<?php echo $id ?>"><?php echo $label ?>
30
- <small><?php echo $desc ?></small>
31
- </label>
32
-
33
- <?php if ( strpos( $style['properties'], 'font-size' ) !== false ) : ?>
34
- <!-- Size -->
35
- <div class="spinner_container">
36
- <input class="number" type="text" name="<?php echo $name ?>[size]" id="<?php echo $id ?>-size" value="<?php echo esc_attr( $value['size'] ) ?>" />
37
- </div>
38
-
39
- <!-- Unit -->
40
- <div class="select_wrapper font-unit">
41
- <select name="<?php echo $name ?>[unit]" id="<?php echo $id ?>-unit">
42
- <option value="px" <?php selected( $value['unit'], 'px' ) ?>><?php _e( 'px', 'yith-plugin-fw' ) ?></option>
43
- <option value="em" <?php selected( $value['unit'], 'em' ) ?>><?php _e( 'em', 'yith-plugin-fw' ) ?></option>
44
- <option value="pt" <?php selected( $value['unit'], 'pt' ) ?>><?php _e( 'pt', 'yith-plugin-fw' ) ?></option>
45
- <option value="rem" <?php selected( $value['unit'], 'rem' ) ?>><?php _e( 'rem', 'yith-plugin-fw' ) ?></option>
46
- </select>
47
- </div>
48
- <?php endif; ?>
49
-
50
- <?php if ( strpos( $style['properties'], 'font-family' ) !== false ) : ?>
51
- <!-- Family -->
52
- <div class="select_wrapper font-family">
53
- <select name="<?php echo $name ?>[family]" id="<?php echo $id ?>-family">
54
- <?php
55
- $web_fonts = yit_get_web_fonts();
56
- $google_fonts = yit_get_google_fonts();
57
-
58
- if ( ! empty( $web_fonts ) ) {
59
- echo '<optgroup label="' . __( 'Web fonts', 'yith-plugin-fw' ) . '">';
60
-
61
- foreach ( $web_fonts as $font_name => $rule ) {
62
- ?>
63
- <option value='<?php echo esc_attr( $rule ) ?>' <?php selected( stripslashes( $value['family'] ), $rule ) ?>><?php echo $font_name ?></option>
64
- <?php
65
- }
66
-
67
- echo '</optgroup>';
68
- }
69
-
70
- if ( ! empty( $google_fonts ) ) {
71
- echo '<optgroup label="' . __( 'Google fonts', 'yith-plugin-fw' ) . '">';
72
-
73
- foreach ( $google_fonts->items as $font ) {
74
- // $font_human = trim( stripslashes( end( array_slice( explode( ',', $font ), 0, 1 ) ) ), "'" );
75
- // $std_human = trim( stripslashes( end( array_slice( explode( ',', $value['family'] ), 0, 1 ) ) ), "'" );
76
-
77
- //if( isset($font->family) ):
78
- //Only me and god know what happen on this line...
79
- ?>
80
- <option value="<?php echo stripslashes( $font ) ?>" <?php selected( $value['family'], $font ) ?>><?php echo $font ?></option>
81
- <?php
82
- //endif;
83
- }
84
-
85
- echo '</optgroup>';
86
- }
87
- ?>
88
- </select>
89
- </div>
90
- <?php endif; ?>
91
-
92
- <?php if ( strpos( $style['properties'], 'font-style' ) !== false ) : ?>
93
- <!-- Style -->
94
- <div class="select_wrapper font-style">
95
- <select name="<?php echo $name ?>[style]" id="<?php echo $id ?>-style">
96
- <option value="regular" <?php selected( $value['style'], 'regular' ) ?>><?php _e( 'Regular', 'yith-plugin-fw' ) ?></option>
97
- <option value="bold" <?php selected( $value['style'], 'bold' ) ?>><?php _e( 'Bold', 'yith-plugin-fw' ) ?></option>
98
- <option value="extra-bold" <?php selected( $std['style'], 'extra-bold' ) ?>><?php _e( 'Extra bold', 'yith-plugin-fw' ) ?></option>
99
- <option value="italic" <?php selected( $value['style'], 'italic' ) ?>><?php _e( 'Italic', 'yith-plugin-fw' ) ?></option>
100
- <option value="bold-italic" <?php selected( $value['style'], 'bold-italic' ) ?>><?php _e( 'Italic bold', 'yith-plugin-fw' ) ?></option>
101
- </select>
102
- </div>
103
- <?php endif; ?>
104
-
105
- <?php if ( strpos( $style['properties'], 'color' ) !== false ) : ?>
106
- <!-- Color -->
107
- <div id="<?php echo $id ?>_container" class="colorpicker_container">
108
- <div style="background-color: <?php echo $value['color'] ?>"></div>
109
- </div>
110
- <input type="text" name="<?php echo $name ?>[color]" id="<?php echo $id ?>-color" style="width:150px" value="<?php echo esc_attr( $value['color'] ) ?>" />
111
- <?php endif; ?>
112
- </div>
113
- <div class="clear"></div>
114
- <div class="font-preview">
115
- <p>The quick brown fox jumps over the lazy dog</p>
116
- </div>
117
- </div>
118
- </div>
119
- <script type="text/javascript" charset="utf-8">
120
- jQuery(document).ready(function ($) {
121
- var container = $('#<?php echo $id ?>');
122
- var preview = container.children('.font-preview').children('p');
123
-
124
- //Set current value, before trigger change event
125
-
126
- //Color
127
- preview.css('color', '<?php echo $value['color'] ?>');
128
- //Font size
129
- var size = $('#<?php echo $id ?>-size').val();
130
- var unit = $('#<?php echo $id ?>-unit').val();
131
-
132
- preview.css('font-size', size + unit);
133
- preview.css('line-height', ( unit == 'em' || unit == 'rem' ? Number(size) + 0.4 : Number(size) + 4 ) + unit);
134
- //Font style
135
- var style = $('#<?php echo $id ?>-style').val();
136
-
137
- if (style == 'italic') {
138
- preview.css({ 'font-weight': 'normal', 'font-style': 'italic' });
139
- } else if (style == 'bold') {
140
- preview.css({ 'font-weight': 'bold', 'font-style': 'normal' });
141
- } else if (style == 'extra-bold') {
142
- preview.css({ 'font-weight': '800', 'font-style': 'normal' });
143
- } else if (style == 'bold-italic') {
144
- preview.css({ 'font-weight': 'bold', 'font-style': 'italic' });
145
- } else {
146
- preview.css({ 'font-weight': 'normal', 'font-style': 'normal' });
147
- }
148
-
149
- //Font Family
150
- var group = $('#<?php echo $id ?>-family').find('option:selected').parent().attr('label');
151
-
152
- if ($('#<?php echo $id ?>-family').length > 0) {
153
- if (group == '<?php _e( 'Web fonts', 'yith-plugin-fw' ) ?>') {
154
- //Web font
155
- preview.css('font-family', $('#<?php echo $id ?>-family').val());
156
- } else {
157
- //Google font
158
- WebFontConfig = {
159
- google: { families: [ $('#<?php echo $id ?>-family :selected').text() ] }
160
- };
161
- (function () {
162
- var wf = document.createElement('script');
163
- wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
164
- '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
165
- wf.type = 'text/javascript';
166
- wf.async = 'true';
167
-
168
- var s = document.getElementsByTagName('script')[0];
169
- s.parentNode.insertBefore(wf, s);
170
- })();
171
-
172
- var preview_font = $('#<?php echo $id ?>-family').val()
173
- preview.css('font-family', preview_font.replace(/:(.*)?/g, ''));
174
- }
175
- }
176
-
177
- $('#<?php echo $id ?>-size').spinner({
178
- <?php if( isset( $min )): ?>min: <?php echo $min ?>, <?php endif ?>
179
- <?php if( isset( $max )): ?>max: <?php echo $max ?>, <?php endif ?>
180
- showOn : 'always',
181
- upIconClass : "ui-icon-plus",
182
- downIconClass : "ui-icon-minus",
183
- });
184
-
185
- $('#<?php echo $id ?>_container').ColorPicker({
186
- color : '<?php echo $value['color'] ?>',
187
- onShow : function (colpkr) {
188
- $(colpkr).fadeIn(500);
189
- return false;
190
- },
191
- onHide : function (colpkr) {
192
- $(colpkr).fadeOut(500);
193
- return false;
194
- },
195
- onChange: function (hsb, hex, rgb) {
196
- $('#<?php echo $id ?>_container div').css('backgroundColor', '#' + hex);
197
- $('#<?php echo $id ?>_container').next('input').attr('value', '#' + hex);
198
-
199
- //Preview color change
200
- preview.css('color', '#' + hex);
201
- }
202
- });
203
-
204
- //Font Size Change
205
- $('#<?php echo $id ?>-size, #<?php echo $id ?>-unit').change(function () {
206
- var size = $('#<?php echo $id ?>-size').val();
207
- var unit = $('#<?php echo $id ?>-unit').val();
208
-
209
- preview.css('font-size', size + unit);
210
- preview.css('line-height', ( unit == 'em' || unit == 'rem' ? Number(size) + 0.4 : Number(size) + 4 ) + unit);
211
- });
212
-
213
- //Font Family Change
214
- $('#<?php echo $id ?>-family').change(function () {
215
- var group = $(this).find('option:selected').parent().attr('label');
216
-
217
- if (group == '<?php _e( 'Web fonts', 'yith-plugin-fw' ) ?>') {
218
- //Web font
219
- preview.css('font-family', $(this).val());
220
- } else {
221
- //Google font
222
- WebFontConfig = {
223
- google: { families: [ $(':selected', this).text() ] }
224
- };
225
- (function () {
226
- var wf = document.createElement('script');
227
- wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
228
- '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
229
- wf.type = 'text/javascript';
230
- wf.async = 'true';
231
- var s = document.getElementsByTagName('script')[0];
232
- s.parentNode.insertBefore(wf, s);
233
- })();
234
-
235
- var preview_font = $(this).val();
236
- preview.css('font-family', preview_font.replace(/:(.*)?/g, ''));
237
- }
238
- });
239
-
240
- //Font Style Change
241
- $('#<?php echo $id ?>-style').change(function () {
242
- var style = $(this).val();
243
-
244
- if (style == 'italic') {
245
- preview.css({ 'font-weight': 'normal', 'font-style': 'italic' });
246
- } else if (style == 'bold') {
247
- preview.css({ 'font-weight': 'bold', 'font-style': 'normal' });
248
- } else if (style == 'bold-italic') {
249
- preview.css({ 'font-weight': 'bold', 'font-style': 'italic' });
250
- } else {
251
- preview.css({ 'font-weight': 'normal', 'font-style': 'normal' });
252
- }
253
- });
254
- });
255
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/metaboxes/types/upload.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- extract( $args );
16
- ?>
17
- <div id="<?php echo $id ?>-container" <?php if ( isset($deps) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $deps['ids'] ?>" data-value="<?php echo $deps['values'] ?>" <?php endif ?>>
18
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
19
- <p>
20
- <input type="text" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>" <?php if( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?> class="upload_img_url"/>
21
- <input type="button" class="button-secondary upload_button" id="<?php echo $id ?>-button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>" />
22
- <span class="desc inline"><?php echo $desc ?></span>
23
- </p>
24
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/panel-field-container.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ /**
12
+ * Field Container for YIT Panel
13
+ *
14
+ * @package Yithemes
15
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
16
+ * @since 3.0.0
17
+ */
18
+
19
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
20
+
21
+ $id = $this->get_id_field( $option[ 'id' ] );
22
+ $name = $this->get_name_field( $option[ 'id' ] );
23
+ $type = $option[ 'type' ];
24
+
25
+ $field = $option;
26
+ $field[ 'id' ] = $id;
27
+ $field[ 'name' ] = $name;
28
+ $field[ 'value' ] = $db_value;
29
+ if ( !empty( $custom_attributes ) )
30
+ $field[ 'custom_attributes' ] = $custom_attributes;
31
+
32
+ ?>
33
+ <div id="<?php echo $id ?>-container" class="yit_options yith-plugin-fw-field-wrapper yith-plugin-fw-<?php echo $type ?>-field-wrapper" <?php echo yith_panel_field_deps_data( $option, $this ) ?>>
34
+ <div class="option">
35
+ <?php yith_plugin_fw_get_field( $field, true, false ); ?>
36
+ </div>
37
+ <span class="description"><?php echo $option[ 'desc' ] ?></span>
38
+
39
+ <div class="clear"></div>
40
+ </div>
41
+
plugin-fw/templates/panel/sidebar/sidebar.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- $sidebar_action_hide_class = $this->is_collapsed() ? '' : 'hide-on-click';
3
- $sidebar_action_hide_title = $this->is_collapsed() ? __( 'Show sidebar', 'yith-plugin-fw' ) : __( 'Hide sidebar', 'yith-plugin-fw' );
4
- $sidebar_class = $this->is_collapsed() ? 'yith-panel-sidebar-hidden' : '';
5
- ?>
6
-
7
-
8
- <div id="yit-panel-sidebar" class="<?php echo $sidebar_class; ?>">
9
- <div id="yit-panel-sidebar-actions">
10
- <div id="yit-panel-sidebar-action-hide" class="<?php echo $sidebar_action_hide_class; ?>">
11
- <span class="yit-panel-sidebar-action-title"><?php echo $sidebar_action_hide_title; ?></span>
12
- <span class="yit-panel-sidebar-action-hide-icon dashicons dashicons-arrow-left"></span>
13
- </div>
14
- </div>
15
- <div id="yit-panel-sidebar-widgets-container">
16
- <?php
17
- $this->print_panel_sidebar_widgets();
18
- ?>
19
- </div>
20
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/sidebar/widget.php DELETED
@@ -1,53 +0,0 @@
1
- <?php
2
- /**
3
- * @var string $id
4
- * @var string $title
5
- * @var string $content
6
- * @var string $class
7
- * @var string $title_class
8
- * @var string $template
9
- * @var string $badge
10
- * @var string $badge_text
11
- * @var string $image
12
- * @var array $args
13
- * @var string $icon
14
- *
15
- */
16
-
17
- if ( !empty( $template ) ) {
18
- ob_start();
19
- $basename = YIT_CORE_PLUGIN_PATH;
20
- $path = '/panel/sidebar/widgets/widget-' . $template . '.php';
21
- yit_plugin_get_template( $basename, $path, $args );
22
- $content = ob_get_clean();
23
- }
24
-
25
- if ( !empty( $icon ) ) {
26
- $title_class .= ' yit-panel-sidebar-widget-icon ' . $icon . '-icon';
27
- }
28
-
29
- ?>
30
-
31
- <div id="yit-panel-sidebar-<?php echo $id ?>-widget" class="yit-panel-sidebar-widget-wrapper <?php echo $class; ?>">
32
- <div class="yit-panel-sidebar-widget-container">
33
- <?php if ( !empty( $title ) ): ?>
34
- <div class="yit-panel-sidebar-widget-title <?php echo $title_class; ?>">
35
- <?php echo $title; ?>
36
- </div>
37
- <?php endif; ?>
38
- <div class="yit-panel-sidebar-widget-content"><?php echo $content; ?></div>
39
- <?php
40
- if ( !empty( $image ) ) {
41
- $path = YIT_CORE_PLUGIN_URL . '/assets/images/widgets/' . $image;
42
- echo "<img class='yit-panel-sidebar-widget-image $image_class' src='{$path}' alt='' width='100%'/>";
43
- }
44
- ?>
45
- </div>
46
- <?php
47
- if ( !empty( $badge ) ) {
48
- $basename = YIT_CORE_PLUGIN_PATH;
49
- $path = '/panel/sidebar/widgets/badges/badge.php';
50
- yit_plugin_get_template( $basename, $path, array( 'text' => $badge_text, 'type' => $badge ) );
51
- }
52
- ?>
53
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/sidebar/widgets/badges/badge.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- /**
3
- * @var string $type
4
- */
5
- ?>
6
-
7
- <div class="yit-panel-sidebar-widget-badge <?php echo $type; ?>">
8
- <div class="yit-panel-sidebar-widget-badge-s1"></div>
9
- <div class="yit-panel-sidebar-widget-badge-s2"></div>
10
- <div class="yit-panel-sidebar-widget-badge-text"><?php echo $text ?></div>
11
- </div>
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/sidebar/widgets/widget-despacho.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
- ?>
15
- <p>We are happy to present Despacho, our new cutting edge WordPress theme for e-commerce sites.
16
- Conceived to include all the best and hi-quality features for shops,
17
- this powerful theme offers a wide range of options to
18
- <strong>easily customize and shape the appearande of your site. <a href="//despacho.yithemes.com" target="_blank">Discover More ></a></strong>
19
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/sidebar/widgets/widget-links.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- /**
16
- * @var array $links
17
- */
18
- $links = !empty( $links ) ? $links : array();
19
-
20
- $link_default_args = array(
21
- 'url' => '',
22
- 'title' => '',
23
- 'target' => '_blank'
24
- );
25
- ?>
26
-
27
- <ul class="yit-panel-sidebar-links-list">
28
- <?php foreach ( $links as $link ) {
29
- $link = wp_parse_args( $link, $link_default_args );
30
- $link = (object)$link;
31
- echo "<li><a href='$link->url' target='$link->target'>$link->title</a></li>";
32
- }
33
- ?>
34
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/sidebar/widgets/widget-membership.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
- ?>
15
-
16
- <div class="membership-wrapper">
17
- <div class="membership-row">
18
- <div class="membership-total-price">$10.000+</div>
19
- <div class="membership-offer-text">worth of themes<br/>and plugins<br/>for WooCommerce</div>
20
- </div>
21
- <div class="membership-row">
22
- <div class="membership-offer-text2">on a</div>
23
- <div class="membership-offer-sale-text">95% OFF DISCOUNT</div>
24
- </div>
25
- <div class="membership-buttons">
26
- <a class="button green" href="//yithemes.com/themes/membership/annual-yithemes-club-subscription/"
27
- target="_blank">Discover More!</a>
28
- </div>
29
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/sidebar/widgets/widgets.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * @var YIT_Plugin_Panel_Sidebar $this
13
- */
14
-
15
- $widgets = array(
16
- 'membership' => array(
17
- 'title' => __( 'Join the club', 'yit' ),
18
- 'title_class' => 'orange',
19
- 'icon' => 'box-white',
20
- 'template' => 'membership',
21
- 'priority' => 10,
22
- ),
23
- 'despacho' => array(
24
- 'title' => __( 'Despacho Theme - 100% FREE', 'yit' ),
25
- 'icon' => 'info',
26
- 'template' => 'despacho',
27
- 'badge' => 'gift-tape',
28
- 'badge_text' => __( 'FREE!', 'yit' ),
29
- 'image' => 'despacho.png',
30
- 'image_class' => 'yit-panel-sidebar-widget-despacho-image',
31
- 'priority' => 20,
32
- ),
33
- 'links' => array(
34
- 'title' => __( 'Important Links', 'yit' ),
35
- 'icon' => 'link',
36
- 'template' => 'links',
37
- 'args' => array( 'links' => $this->panel->links ),
38
- 'hide_if_empty_args' => array( 'links' ),
39
- 'priority' => 30,
40
- ),
41
- );
42
- return apply_filters( 'yit_panel_widgets_array', $widgets );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/chosen.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- $id = $this->get_id_field( $option['id'] );
16
- $name = $this->get_name_field( $option['id'] );
17
-
18
- $is_multiple = isset( $option['multiple'] ) && $option['multiple'];
19
- $multiple = ( $is_multiple ) ? ' multiple' : '';
20
-
21
- $db_value = ( $is_multiple && ! is_array( $db_value ) ) ? array() : $db_value;
22
- ?>
23
- <div id="<?php echo $id ?>-container" class="chosen yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
24
- <div class="option">
25
- <div class="select_wrapper">
26
- <select name="<?php echo $name ?><?php if( $is_multiple ) echo "[]" ?>" class="chosen" id="<?php echo $id ?>" <?php echo $multiple ?> <?php echo $custom_attributes ?> >
27
- <?php foreach ( $option['options'] as $key => $value ) : ?>
28
- <option value="<?php echo esc_attr( $key ) ?>"<?php ($is_multiple) ? selected( true, in_array( $key, $db_value) ) : selected( $key, $db_value ) ?>><?php echo $value ?></option>
29
- <?php endforeach; ?>
30
- </select>
31
- </div>
32
- </div>
33
- <span class="description"><?php echo $option['desc'] ?></span>
34
-
35
- <div class="clear"></div>
36
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/colorpicker.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Text Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- } // Exit if accessed directly
22
-
23
- wp_enqueue_style('wp-color-picker');
24
-
25
- $id = $this->get_id_field( $option['id'] );
26
- $name = $this->get_name_field( $option['id'] );
27
-
28
- ?>
29
- <div id="<?php echo $id ?>-container" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?> class="yit_options rm_option rm_input rm_colorpicker">
30
- <div class="option">
31
- <input type="text" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $db_value ) ?>" <?php if( isset( $std ) ) : ?>data-default-color="<?php echo $std ?>"<?php endif ?> class="panel-colorpicker"/>
32
-
33
- </div>
34
- <span class="description"><?php echo $option['desc'] ?></span>
35
-
36
- <div class="clear"></div>
37
- </div>
38
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/connected-list.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- $id = $this->get_id_field( $option['id'] );
3
- $name = $this->get_name_field( $option['id'] );
4
- ?>
5
-
6
- <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text rm_connectedlist" <?php if( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
7
- <div class="option">
8
- <?php $yit_option = json_decode( stripslashes( $db_value ), true ); ?>
9
- <?php $lists = is_array($yit_option) ? $yit_option : $option['lists']; ?>
10
-
11
- <?php foreach( $lists as $list => $options ): ?>
12
- <div class="list_container">
13
- <h4><?php echo $option['heads'][ $list ] ?></h4>
14
- <ul id="list_<?php echo $list ?>" class="connectedSortable" data-list="<?php echo $list ?>" <?php echo $custom_attributes ?>>
15
- <?php foreach( $options as $value => $label ): ?>
16
- <li data-option="<?php echo $value ?>" class="ui-state-default"><?php echo $label ?></li>
17
- <?php endforeach ?>
18
- </ul>
19
- </div>
20
- <?php endforeach ?>
21
- <input type="hidden" name="<?php echo $name ?>" id="<?php echo $id ?>" value='<?php echo esc_attr( $db_value ) ?>' />
22
- </div>
23
- <div class="description">
24
- <?php echo $option['desc'] ?>
25
- </div>
26
- <div class="clear"></div>
27
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/layout-panel.php DELETED
File without changes
plugin-fw/templates/panel/types/number.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Number Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- } // Exit if accessed directly
22
-
23
- $id = $this->get_id_field( $option['id'] );
24
- $name = $this->get_name_field( $option['id'] );
25
-
26
- ?>
27
- <div id="<?php echo $id ?>-container" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?> class="yit_options rm_option rm_input rm_text">
28
- <div class="option">
29
- <input type="number" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $db_value ) ?>" <?php echo $custom_attributes ?> />
30
- </div>
31
- <span class="description"><?php echo $option['desc'] ?></span>
32
-
33
- <div class="clear"></div>
34
- </div>
35
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/on-off.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * ON-OFF Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- } // Exit if accessed directly
22
-
23
- $id = $this->get_id_field( $option['id'] );
24
- $name = $this->get_name_field( $option['id'] );
25
-
26
- ?>
27
- <div id="<?php echo $id ?>-container" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?> class="onoff_container yit_options rm_option rm_input rm_onoff">
28
- <div class="option">
29
- <input type="checkbox" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $db_value ) ?>" <?php checked( $db_value, 'yes' ); ?> class="on_off<?php if ( $db_value == 'yes' ): ?> onoffchecked<?php endif ?>" <?php echo $custom_attributes ?>/>
30
- <span>&nbsp;</span>
31
- </div>
32
- <span class="description"><?php echo $option['desc'] ?></span>
33
- </div>
34
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/select-mailchimp.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Select Mailchimp Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Antonio La Rocca <antonio.larocca@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
20
- ?>
21
-
22
- <div id="<?php echo $this->get_id_field( $option['id'] ) ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
23
- <div class="option">
24
- <div class="select_wrapper">
25
- <select name="<?php echo $this->get_name_field( $option['id'] ) ?>" id="<?php echo $this->get_id_field( $option['id'] ) ?>" <?php echo $custom_attributes ?>>
26
- <?php foreach( $option['options'] as $key => $value ) : ?>
27
- <option value="<?php echo esc_attr( $key ) ?>"<?php selected( $key, $db_value ) ?>><?php echo $value ?></option>
28
- <?php endforeach; ?>
29
- </select>
30
- </div>
31
- <input type="button" class="button-secondary <?php echo $option['class']?>" value="<?php echo esc_attr( $option['button_name'] ) ?>"/>
32
- <span class="spinner"></span>
33
- </div>
34
- <span class="description"><?php echo $option['desc'] ?></span>
35
- <div class="clear"></div>
36
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/select.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Select Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- } // Exit if accessed directly
22
- $id = $this->get_id_field( $option['id'] );
23
- $name = $this->get_name_field( $option['id'] );
24
-
25
- $is_multiple = isset( $option['multiple'] ) && $option['multiple'];
26
- $multiple = ( $is_multiple ) ? ' multiple' : '';
27
- ?>
28
- <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
29
- <div class="option">
30
- <div class="select_wrapper">
31
- <select name="<?php echo $name ?><?php if( $is_multiple ) echo "[]" ?>" id="<?php echo $id ?>" <?php echo $multiple ?> <?php echo $custom_attributes ?> >
32
- <?php foreach ( $option['options'] as $key => $value ) : ?>
33
- <option value="<?php echo esc_attr( $key ) ?>"<?php ($is_multiple) ? selected( true, in_array( $key, $db_value) ) : selected( $key, $db_value ) ?>><?php echo $value ?></option>
34
- <?php endforeach; ?>
35
- </select>
36
- </div>
37
- </div>
38
- <span class="description"><?php echo $option['desc'] ?></span>
39
-
40
- <div class="clear"></div>
41
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/slider.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Slider Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- } // Exit if accessed directly
22
-
23
- $id = $this->get_id_field( $option['id'] );
24
- $name = $this->get_name_field( $option['id'] );
25
- ?>
26
- <div id="<?php echo $id ?>-container" class="slider_container yit_options rm_option rm_input slider_control slider" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
27
- <div class="option">
28
- <div class="ui-slider">
29
- <span class="minCaption"><?php echo $option['min'] ?></span>
30
- <span class="maxCaption"><?php echo $option['max'] ?></span>
31
- <span id="<?php echo $id ?>-feedback" class="feedback"><strong><?php echo $db_value ?></strong></span>
32
-
33
- <div id="<?php echo $id ?>-div" data-step="<?php echo isset( $option['step'] ) ? $option['step'] : 1 ?>" data-labels="<?php echo '' ?>" data-min="<?php echo $option['min'] ?>" data-max="<?php echo $option['max'] ?>" data-val="<?php echo $db_value; ?>" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">
34
- <input id="<?php echo $id ?>" type="hidden" name="<?php echo $name ?>" value="<?php echo esc_attr( $db_value ); ?>" />
35
- </div>
36
- </div>
37
- </div>
38
-
39
- <span class="description"><?php echo $option['desc'] ?></span>
40
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/text-button.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Text Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Antonio La Rocca <antonio.larocca@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- } // Exit if accessed directly
22
-
23
- $id = $this->get_id_field( $option['id'] );
24
- $name = $this->get_name_field( $option['id'] );
25
-
26
- ?>
27
- <div id="<?php echo $id ?>-container" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?> class="yit_options rm_option rm_input rm_text">
28
- <div class="option">
29
- <input type="text" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $db_value ) ?>" />
30
- <input type="button" class="<?php echo $option['button-class']?> button button-secondary" value="<?php echo esc_attr( $option['button-name'] ) ?>" <?php if ( isset( $option['data'] ) && ! empty( $option['data'] ) ): foreach( $option['data'] as $id => $data ): ?> data-<?php echo $id?>="<?php echo $data?>" <?php endforeach; endif;?> />
31
- </div>
32
- <span class="description"><?php echo $option['desc'] ?></span>
33
-
34
- <div class="clear"></div>
35
- </div>
36
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/text.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Text Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- } // Exit if accessed directly
22
-
23
- $id = $this->get_id_field( $option['id'] );
24
- $name = $this->get_name_field( $option['id'] );
25
-
26
- ?>
27
- <div id="<?php echo $id ?>-container" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?> class="yit_options rm_option rm_input rm_text">
28
- <div class="option">
29
- <input type="text" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $db_value ) ?>" <?php echo $custom_attributes ?> />
30
- </div>
31
- <span class="description"><?php echo $option['desc'] ?></span>
32
-
33
- <div class="clear"></div>
34
- </div>
35
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/textarea-codemirror.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Textarea Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Antonio La Rocca <antonio.larocca@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- } // Exit if accessed directly
22
-
23
- $id = $this->get_id_field( $option['id'] );
24
- $name = $this->get_name_field( $option['id'] );
25
-
26
- ?>
27
- <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
28
- <div class="option">
29
- <textarea name="<?php echo $name ?>" class="codemirror" id="<?php echo $id ?>" rows="8" cols="50" <?php echo $custom_attributes ?>><?php echo $db_value ?></textarea>
30
- </div>
31
- <span class="description"><?php echo $option['desc'] ?></span>
32
-
33
- <div class="clear"></div>
34
- </div>
35
-
36
- <?php
37
- wp_enqueue_script('codemirror');
38
- wp_enqueue_script('codemirror-javascript');
39
- wp_enqueue_style('codemirror');
40
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/textarea.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Textarea Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- } // Exit if accessed directly
22
-
23
- $id = $this->get_id_field( $option['id'] );
24
- $name = $this->get_name_field( $option['id'] );
25
-
26
- ?>
27
- <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
28
- <div class="option">
29
- <textarea name="<?php echo $name ?>" id="<?php echo $id ?>" rows="8" cols="50" <?php echo $custom_attributes ?>><?php echo $db_value ?></textarea>
30
- </div>
31
- <span class="description"><?php echo $option['desc'] ?></span>
32
-
33
- <div class="clear"></div>
34
- </div>
35
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/types/upload.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- /**
12
- * Upload Plugin Admin View
13
- *
14
- * @package Yithemes
15
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- } // Exit if accessed directly
22
-
23
- $id = $this->get_id_field( $option['id'] );
24
- $name = $this->get_name_field( $option['id'] );
25
-
26
- ?>
27
- <div id="<?php echo $id ?>-container" >
28
- <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text rm_upload" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
29
- <div class="option yit-upload">
30
- <input type="text" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo $db_value == '1' ? '' : esc_attr( $db_value ) ?>" class="upload_img_url" />
31
- <input type="button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>" id="<?php echo $id ?>-button" class="upload_button button" />
32
- <input type="button" value="<?php _e( 'Reset', 'yith-plugin-fw' ) ?>" id="<?php echo $id ?>-button_reset" class="upload_button_reset button" data-default="<?php echo $option['std'] ?>"/>
33
- </div>
34
- <div class="clear"></div>
35
- <span class="description"><?php echo $option['desc'] ?></span>
36
- </div>
37
- <div class="upload_img_preview" style="margin-top:10px;">
38
- <?php
39
- $file = $db_value;
40
- if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
41
- echo isset( $this->settings['plugin-url'] ) ? "<img src=\"" . $this->settings['plugin-url'] . "/plugin-fw/assets/images/sleep.png\" data-src=\"$file\" />" : '';
42
- }
43
- ?>
44
- </div>
45
- </div>
46
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/videobox.php DELETED
@@ -1,83 +0,0 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- /**
16
- * Example to call this template
17
- *
18
- * 'section_general_settings_videobox' => array(
19
- * 'name' => __( 'Title of box', 'yith-plugin-fw' ),
20
- * 'type' => 'videobox',
21
- * 'default' => array(
22
- * 'plugin_name' => __( 'Plugin Name', 'yith-plugin-fw' ),
23
- * 'title_first_column' => __( 'Title first column', 'yith-plugin-fw' ),
24
- * 'description_first_column' => __('Lorem ipsum ... ', 'yith-plugin-fw'),
25
- * 'video' => array(
26
- * 'video_id' => 'vimeo_code',
27
- * 'video_image_url' => '#',
28
- * 'video_description' => __( 'Lorem ipsum dolor sit amet....', 'yith-plugin-fw' ),
29
- * ),
30
- * 'title_second_column' => __( 'Title first column', 'yith-plugin-fw' ),
31
- * 'description_second_column' => __('Lorem ipsum dolor sit amet.... ', 'yith-plugin-fw'),
32
- * 'button' => array(
33
- * 'href' => 'http://www.yithemes.com',
34
- * 'title' => 'Get Support and Pro Features'
35
- * )
36
- * ),
37
- * 'id' => 'yith_wcas_general_videobox'
38
- * ),
39
- */
40
- ?>
41
- <div id="normal-sortables" class="meta-box-sortables yith-videobox-wrapper">
42
- <div id="<?php echo $id ?>" class="postbox">
43
- <h3><span><?php echo $name ?></span></h3>
44
- <div class="inside">
45
- <div class="yith_videobox">
46
- <div class="column"><h2><?php echo $default['title_first_column'] ?></h2>
47
- <?php if ( isset( $default['video'] ) && !empty( $default['video'] ) ): ?>
48
- <a class="yith-video-link" href="#" data-video-id="yith-video-iframe">
49
- <img src="<?php echo $default['video']['video_image_url'] ?>">
50
- </a>
51
-
52
- <p class="yit-video-description">
53
- <?php echo $default['video']['video_description'] ?>
54
- </p>
55
-
56
- <p class="yith-video-iframe">
57
- <iframe src="//player.vimeo.com/video/<?php echo $default['video']['video_id'] ?>?title=0&amp;byline=0&amp;portrait=0" width="853" height="480" frameborder="0"></iframe>
58
- </p>
59
- <?php endif ?>
60
- <?php if ( isset( $default['image'] ) && !empty( $default['image'] ) ): ?>
61
- <a href="<?php echo $default['image']['image_link'] ?>" target="_blank" class="yith-image-frame">
62
- <img src="<?php echo $default['image']['image_url'] ?>">
63
- </a>
64
- <?php endif ?>
65
- <?php if ( isset( $default['description_first_column'] ) && $default['description_first_column'] != '' ): ?>
66
- <p><?php echo $default['description_first_column'] ?></p>
67
- <?php endif ?>
68
- </div>
69
- <div class="column two">
70
- <h2><?php echo $default['title_second_column'] ?>?</h2>
71
-
72
- <p><?php echo $default['description_second_column'] ?></p>
73
-
74
- <?php if ( isset( $default['button'] ) && !empty( $default['button'] ) ): ?>
75
- <p>
76
- <a class="button-primary" href="<?php echo $default['button']['href'] ?>" target="_blank"><?php echo $default['button']['title'] ?></a>
77
- </p>
78
- <?php endif ?>
79
- </div>
80
- </div>
81
- </div>
82
- </div>
83
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/panel/woocommerce/woocommerce-form.php CHANGED
@@ -2,7 +2,7 @@
2
  $panel_content_class = apply_filters( 'yit_admin_panel_content_class', 'yit-admin-panel-content-wrap' );
3
  ?>
4
 
5
- <div id="<?php echo $this->settings[ 'page' ] ?>_<?php echo $this->get_current_tab() ?>" class="yit-admin-panel-container">
6
  <?php do_action( 'yit_framework_before_print_wc_panel_content', $current_tab ); ?>
7
  <div class="<?php echo $panel_content_class; ?>">
8
  <form id="plugin-fw-wc" method="post">
2
  $panel_content_class = apply_filters( 'yit_admin_panel_content_class', 'yit-admin-panel-content-wrap' );
3
  ?>
4
 
5
+ <div id="<?php echo $this->settings[ 'page' ] ?>_<?php echo $this->get_current_tab() ?>" class="yith-plugin-fw yit-admin-panel-container">
6
  <?php do_action( 'yit_framework_before_print_wc_panel_content', $current_tab ); ?>
7
  <div class="<?php echo $panel_content_class; ?>">
8
  <form id="plugin-fw-wc" method="post">
plugin-fw/templates/panel/woocommerce/woocommerce-option-row.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @var array $field
4
+ * @var string $description
5
+ */
6
+ $default_field = array(
7
+ 'id' => '',
8
+ 'title' => isset( $field[ 'name' ] ) ? $field[ 'name' ] : '',
9
+ 'desc' => '',
10
+ );
11
+ $field = wp_parse_args( $field, $default_field );
12
+
13
+ $display_row = !in_array( $field[ 'type' ], array( 'hidden', 'html', 'sep', 'simple-text', 'title' ) );
14
+ $display_row = isset( $field[ 'yith-display-row' ] ) ? !!$field[ 'yith-display-row' ] : $display_row;
15
+
16
+ ?>
17
+ <tr valign="top" class="yith-plugin-fw-panel-wc-row <?php echo $field[ 'type' ] ?>" <?php echo yith_field_deps_data( $field ) ?>>
18
+ <?php if ( $display_row ) : ?>
19
+ <th scope="row" class="titledesc">
20
+ <label for="<?php echo esc_attr( $field[ 'id' ] ); ?>"><?php echo esc_html( $field[ 'title' ] ); ?></label>
21
+ </th>
22
+ <td class="forminp forminp-<?php echo sanitize_title( $field[ 'type' ] ) ?>">
23
+ <?php yith_plugin_fw_get_field( $field, true ); ?>
24
+ <?php echo '<span class="description">' . wp_kses_post( $field[ 'desc' ] ) . '</span>'; ?>
25
+ </td>
26
+ <?php else: ?>
27
+ <td colspan="2">
28
+ <?php yith_plugin_fw_get_field( $field, true ); ?>
29
+ </td>
30
+ <?php endif; ?>
31
+ </tr>
plugin-fw/templates/panel/woocommerce/woocommerce-upload.php CHANGED
@@ -35,15 +35,15 @@ $hidden_val = get_option($id . "-yith-attachment-id", 0);
35
  data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
36
  <div class="option">
37
  <input type="text" name="<?php echo $id ?>" id="<?php echo $id ?>"
38
- value="<?php echo $value == '1' ? '' : esc_attr($value) ?>" class="upload_img_url"/>
39
  <input type="hidden" name="<?php echo $id ?>-yith-attachment-id" id="<?php echo $id ?>-yith-attachment-id" value="<?php echo $hidden_val; ?>" />
40
  <input type="button" value="<?php _e('Upload', 'yith-plugin-fw') ?>" id="<?php echo $id ?>-button"
41
- class="upload_button button"/>
42
  </div>
43
  <div class="clear"></div>
44
  <span class="description"><?php echo $desc ?></span>
45
 
46
- <div class="upload_img_preview" style="margin-top:10px;">
47
  <?php
48
  $file = $value;
49
  if (preg_match('/(jpg|jpeg|png|gif|ico)$/', $file)) {
35
  data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
36
  <div class="option">
37
  <input type="text" name="<?php echo $id ?>" id="<?php echo $id ?>"
38
+ value="<?php echo $value == '1' ? '' : esc_attr($value) ?>" class="yith-plugin-fw-upload-img-url"/>
39
  <input type="hidden" name="<?php echo $id ?>-yith-attachment-id" id="<?php echo $id ?>-yith-attachment-id" value="<?php echo $hidden_val; ?>" />
40
  <input type="button" value="<?php _e('Upload', 'yith-plugin-fw') ?>" id="<?php echo $id ?>-button"
41
+ class="yith-plugin-fw-upload-button button"/>
42
  </div>
43
  <div class="clear"></div>
44
  <span class="description"><?php echo $desc ?></span>
45
 
46
+ <div class="yith-plugin-fw-upload-img-preview" style="margin-top:10px;">
47
  <?php
48
  $file = $value;
49
  if (preg_match('/(jpg|jpeg|png|gif|ico)$/', $file)) {
plugin-fw/yit-functions.php CHANGED
@@ -8,11 +8,11 @@
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
- if ( ! defined ( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
- if ( ! function_exists ( 'yit_plugin_locate_template' ) ) {
16
  /**
17
  * Locate the templates and return the path of the file found
18
  *
@@ -23,15 +23,15 @@ if ( ! function_exists ( 'yit_plugin_locate_template' ) ) {
23
  * @return string
24
  * @since 2.0.0
25
  */
26
- function yit_plugin_locate_template ( $plugin_basename, $path, $var = NULL ) {
27
 
28
  $template_path = '/theme/templates/' . $path;
29
 
30
- $located = locate_template ( array (
31
- $template_path,
32
- ) );
33
 
34
- if ( ! $located ) {
35
  $located = $plugin_basename . '/templates/' . $path;
36
  }
37
 
@@ -40,7 +40,7 @@ if ( ! function_exists ( 'yit_plugin_locate_template' ) ) {
40
 
41
  }
42
 
43
- if ( ! function_exists ( 'yit_plugin_get_template' ) ) {
44
  /**
45
  * Retrieve a template file.
46
  *
@@ -52,30 +52,30 @@ if ( ! function_exists ( 'yit_plugin_get_template' ) ) {
52
  * @return string
53
  * @since 2.0.0
54
  */
55
- function yit_plugin_get_template ( $plugin_basename, $path, $var = null, $return = false ) {
56
 
57
- $located = yit_plugin_locate_template ( $plugin_basename, $path, $var );
58
 
59
- if ( $var && is_array ( $var ) ) {
60
- extract ( $var );
61
  }
62
 
63
  if ( $return ) {
64
- ob_start ();
65
  }
66
 
67
  // include file located
68
- if ( file_exists ( $located ) ) {
69
- include ( $located );
70
  }
71
 
72
  if ( $return ) {
73
- return ob_get_clean ();
74
  }
75
  }
76
  }
77
 
78
- if ( ! function_exists ( 'yit_plugin_content' ) ) {
79
  /**
80
  * Return post content with read more link (if needed)
81
  *
@@ -88,12 +88,12 @@ if ( ! function_exists ( 'yit_plugin_content' ) ) {
88
  * @return string
89
  * @since 2.0.0
90
  */
91
- function yit_plugin_content ( $what = 'content', $limit = 25, $more_text = '', $split = '[...]', $in_paragraph = 'true' ) {
92
  if ( $what == 'content' ) {
93
- $content = get_the_content ( $more_text );
94
  } else {
95
  if ( $what == 'excerpt' ) {
96
- $content = get_the_excerpt ();
97
  } else {
98
  $content = $what;
99
  }
@@ -101,70 +101,70 @@ if ( ! function_exists ( 'yit_plugin_content' ) ) {
101
 
102
  if ( $limit == 0 ) {
103
  if ( $what == 'excerpt' ) {
104
- $content = apply_filters ( 'the_excerpt', $content );
105
  } else {
106
- $content = preg_replace ( '/<img[^>]+./', '', $content ); //remove images
107
- $content = apply_filters ( 'the_content', $content );
108
- $content = str_replace ( ']]>', ']]&gt;', $content );
109
  }
110
 
111
  return $content;
112
  }
113
 
114
  // remove the tag more from the content
115
- if ( preg_match ( "/<(a)[^>]*class\s*=\s*(['\"])more-link\\2[^>]*>(.*?)<\/\\1>/", $content, $matches ) ) {
116
 
117
- if ( strpos ( $matches[ 0 ], '[button' ) ) {
118
- $more_link = str_replace ( 'href="#"', 'href="' . get_permalink () . '"', do_shortcode ( $matches[ 3 ] ) );
119
  } else {
120
  $more_link = $matches[ 0 ];
121
  }
122
 
123
- $content = str_replace ( $more_link, '', $content );
124
  $split = '';
125
  }
126
 
127
  if ( empty( $content ) ) {
128
  return;
129
  }
130
- $content = explode ( ' ', $content );
131
 
132
- if ( ! empty( $more_text ) && ! isset( $more_link ) ) {
133
  //array_pop( $content );
134
- $more_link = strpos ( $more_text, '<a class="btn"' ) ? $more_text : '<a class="read-more' . apply_filters ( 'yit_simple_read_more_classes', ' ' ) . '" href="' . get_permalink () . '">' . $more_text . '</a>';
135
  $split = '';
136
- } elseif ( ! isset( $more_link ) ) {
137
  $more_link = '';
138
  }
139
 
140
  // split
141
- if ( count ( $content ) >= $limit ) {
142
  $split_content = '';
143
- for ( $i = 0; $i < $limit; $i ++ ) {
144
  $split_content .= $content[ $i ] . ' ';
145
  }
146
 
147
  $content = $split_content . $split;
148
  } else {
149
- $content = implode ( " ", $content );
150
  }
151
 
152
  // TAGS UNCLOSED
153
- $tags = array ();
154
  // get all tags opened
155
- preg_match_all ( "/(<([\w]+)[^>]*>)/", $content, $tags_opened, PREG_SET_ORDER );
156
  foreach ( $tags_opened as $tag ) {
157
  $tags[] = $tag[ 2 ];
158
  }
159
 
160
  // get all tags closed and remove it from the tags opened.. the rest will be closed at the end of the content
161
- preg_match_all ( "/(<\/([\w]+)[^>]*>)/", $content, $tags_closed, PREG_SET_ORDER );
162
  foreach ( $tags_closed as $tag ) {
163
- unset( $tags[ array_search ( $tag[ 2 ], $tags ) ] );
164
  }
165
 
166
  // close the tags
167
- if ( ! empty( $tags ) ) {
168
  foreach ( $tags as $tag ) {
169
  $content .= "</$tag>";
170
  }
@@ -172,31 +172,31 @@ if ( ! function_exists ( 'yit_plugin_content' ) ) {
172
 
173
  //$content = preg_replace( '/\[.+\]/', '', $content );
174
  if ( $in_paragraph == true ): $content .= $more_link; endif;
175
- $content = preg_replace ( '/<img[^>]+./', '', $content ); //remove images
176
- $content = apply_filters ( 'the_content', $content );
177
- $content = str_replace ( ']]>', ']]&gt;', $content ); // echo str_replace( array( '<', '>' ), array( '&lt;', '&gt;' ), $content );
178
  if ( $in_paragraph == false ): $content .= $more_link; endif;
179
 
180
  return $content;
181
  }
182
  }
183
 
184
- if ( ! function_exists ( 'yit_plugin_string' ) ) {
185
  /**
186
  * Simple echo a string, with a before and after string, only if the main string is not empty.
187
  *
188
  * @param string $before What there is before the main string
189
  * @param string $string The main string. If it is empty or null, the functions return null.
190
- * @param string $after What there is after the main string
191
- * @param bool $echo If echo or only return it
192
  *
193
  * @return string The complete string, if the main string is not empty or null
194
  * @since 2.0.0
195
  */
196
- function yit_plugin_string ( $before = '', $string = '', $after = '', $echo = true ) {
197
  $html = '';
198
 
199
- if ( $string != '' AND ! is_null ( $string ) ) {
200
  $html = $before . $string . $after;
201
  }
202
 
@@ -208,7 +208,7 @@ if ( ! function_exists ( 'yit_plugin_string' ) ) {
208
  }
209
  }
210
 
211
- if ( ! function_exists ( 'yit_plugin_decode_title' ) ) {
212
  /**
213
  * Change some special characters to put easily html into a string
214
  *
@@ -222,14 +222,14 @@ if ( ! function_exists ( 'yit_plugin_decode_title' ) ) {
222
  *
223
  * @since 1.0
224
  */
225
- function yit_plugin_decode_title ( $title ) {
226
- $replaces = apply_filters ( 'yit_title_special_characters', array () );
227
 
228
- return preg_replace ( array_keys ( $replaces ), array_values ( $replaces ), $title );
229
  }
230
  }
231
 
232
- if ( ! function_exists ( 'yit_plugin_get_attachment_id' ) ) {
233
 
234
  /**
235
  * Return the ID of an attachment.
@@ -241,22 +241,22 @@ if ( ! function_exists ( 'yit_plugin_get_attachment_id' ) ) {
241
  * @since 2.0.0
242
  */
243
 
244
- function yit_plugin_get_attachment_id ( $url ) {
245
 
246
- $upload_dir = wp_upload_dir ();
247
- $dir = trailingslashit ( $upload_dir[ 'baseurl' ] );
248
 
249
- if ( false === strpos ( $url, $dir ) ) {
250
  return false;
251
  }
252
 
253
- $file = basename ( $url );
254
 
255
- $query = array (
256
  'post_type' => 'attachment',
257
  'fields' => 'ids',
258
- 'meta_query' => array (
259
- array (
260
  'value' => $file,
261
  'compare' => 'LIKE',
262
  ),
@@ -264,26 +264,26 @@ if ( ! function_exists ( 'yit_plugin_get_attachment_id' ) ) {
264
  );
265
 
266
  $query[ 'meta_query' ][ 0 ][ 'key' ] = '_wp_attached_file';
267
- $ids = get_posts ( $query );
268
 
269
  foreach ( $ids as $id ) {
270
- $attachment_image = wp_get_attachment_image_src ( $id, 'full' );
271
- if ( $url == array_shift ( $attachment_image ) || $url == str_replace ( 'https://', 'http://', array_shift ( $attachment_image ) ) ) {
272
  return $id;
273
  }
274
  }
275
  $query[ 'meta_query' ][ 0 ][ 'key' ] = '_wp_attachment_metadata';
276
- $ids = get_posts ( $query );
277
 
278
  foreach ( $ids as $id ) {
279
 
280
- $meta = wp_get_attachment_metadata ( $id );
281
- if ( ! isset( $meta[ 'sizes' ] ) ) {
282
  continue;
283
  }
284
 
285
- foreach ( (array)$meta[ 'sizes' ] as $size => $values ) {
286
- if ( $values[ 'file' ] == $file && $url == str_replace ( 'https://', 'http://', array_shift ( wp_get_attachment_image_src ( $id, $size ) ) ) ) {
287
 
288
  return $id;
289
  }
@@ -294,7 +294,7 @@ if ( ! function_exists ( 'yit_plugin_get_attachment_id' ) ) {
294
  }
295
  }
296
 
297
- if ( ! function_exists ( 'yit_enqueue_script' ) ) {
298
  /**
299
  * Enqueues script.
300
  *
@@ -304,18 +304,18 @@ if ( ! function_exists ( 'yit_enqueue_script' ) ) {
304
  * @author Simone D'Amico <simone.damico@yithemes.com>
305
  * @see yit_register_script() For parameter information.
306
  */
307
- function yit_enqueue_script ( $handle, $src, $deps = array (), $ver = false, $in_footer = true ) {
308
 
309
- if ( function_exists ( 'YIT_Asset' ) && ! is_admin () ) {
310
  $enqueue = true;
311
- YIT_Asset ()->set ( 'script', $handle, compact ( 'src', 'deps', 'ver', 'in_footer', 'enqueue' ) );
312
  } else {
313
- wp_enqueue_script ( $handle, $src, $deps, $ver, $in_footer );
314
  }
315
  }
316
  }
317
 
318
- if ( ! function_exists ( 'yit_enqueue_style' ) ) {
319
  /**
320
  * Enqueues style.
321
  *
@@ -325,68 +325,71 @@ if ( ! function_exists ( 'yit_enqueue_style' ) ) {
325
  * @author Simone D'Amico <simone.damico@yithemes.com>
326
  * @see yit_register_style() For parameter information.
327
  */
328
- function yit_enqueue_style ( $handle, $src, $deps = array (), $ver = false, $media = 'all' ) {
329
 
330
- if ( function_exists ( 'YIT_Asset' ) ) {
331
  $enqueue = true;
332
- $who = YIT_Asset ()->get_stylesheet_handle ( get_stylesheet_uri (), 'style' );
333
  $where = 'before';
334
 
335
  if ( false == $who ) {
336
  $who = '';
337
  }
338
 
339
- YIT_Asset ()->set ( 'style', $handle, compact ( 'src', 'deps', 'ver', 'media', 'enqueue' ), $where, $who );
340
  } else {
341
- wp_enqueue_style ( $handle, $src, $deps, $ver, $media );
342
  }
343
  }
344
  }
345
 
346
- if ( ! function_exists ( 'yit_get_post_meta' ) ) {
347
  /**
348
  * Retrieve the value of a metabox.
349
  *
350
  * This function retrieve the value of a metabox attached to a post. It return either a single value or an array.
351
  *
352
- * @param int $id Post ID.
353
  * @param string $meta The meta key to retrieve.
354
  *
355
  * @return mixed Single value or array
356
  * @since 2.0.0
357
  */
358
- function yit_get_post_meta ( $id, $meta ) {
359
- if ( ! strpos ( $meta, '[' ) ) {
360
- return get_post_meta ( $id, $meta, true );
361
  }
362
 
363
- $sub_meta = explode ( '[', $meta );
364
 
365
- $meta = get_post_meta ( $id, $meta, true );
366
- for ( $i = 0; $i < count ( $sub_meta ); $i ++ ) {
367
- $meta = $meta[ rtrim ( $sub_meta[ $i ], ']' ) ];
 
 
 
368
  }
369
 
370
  return $meta;
371
  }
372
  }
373
 
374
- if ( ! function_exists ( 'yit_string' ) ) {
375
  /**
376
  * Simple echo a string, with a before and after string, only if the main string is not empty.
377
  *
378
  * @param string $before What there is before the main string
379
  * @param string $string The main string. If it is empty or null, the functions return null.
380
- * @param string $after What there is after the main string
381
- * @param bool $echo If echo or only return it
382
  *
383
  * @return string The complete string, if the main string is not empty or null
384
  * @since 2.0.0
385
  */
386
- function yit_string ( $before = '', $string = '', $after = '', $echo = true ) {
387
  $html = '';
388
 
389
- if ( $string != '' AND ! is_null ( $string ) ) {
390
  $html = $before . $string . $after;
391
  }
392
 
@@ -399,7 +402,7 @@ if ( ! function_exists ( 'yit_string' ) ) {
399
  }
400
 
401
 
402
- if ( ! function_exists ( 'yit_pagination' ) ) {
403
  /**
404
  * Print pagination
405
  *
@@ -409,12 +412,12 @@ if ( ! function_exists ( 'yit_pagination' ) ) {
409
  * @return string
410
  * @since 2.0.0
411
  */
412
- function yit_pagination ( $pages = '', $range = 10 ) {
413
  $showitems = ( $range * 2 ) + 1;
414
 
415
- $paged = ( get_query_var ( 'paged' ) ) ? get_query_var ( 'paged' ) : false;
416
  if ( $paged === false ) {
417
- $paged = ( get_query_var ( 'page' ) ) ? get_query_var ( 'page' ) : false;
418
  }
419
  if ( $paged === false ) {
420
  $paged = 1;
@@ -430,7 +433,7 @@ if ( ! function_exists ( 'yit_pagination' ) ) {
430
  $pages = $wp_query->max_num_pages;
431
  }
432
 
433
- if ( ! $pages ) {
434
  $pages = 1;
435
  }
436
  }
@@ -438,60 +441,60 @@ if ( ! function_exists ( 'yit_pagination' ) ) {
438
  if ( 1 != $pages ) {
439
  $html .= "<div class='general-pagination clearfix'>";
440
  if ( $paged > 2 ) {
441
- $html .= sprintf ( '<a class="%s" href="%s">&laquo;</a>', 'yit_pagination_first', get_pagenum_link ( 1 ) );
442
  }
443
  if ( $paged > 1 ) {
444
- $html .= sprintf ( '<a class="%s" href="%s">&lsaquo;</a>', 'yit_pagination_previous', get_pagenum_link ( $paged - 1 ) );
445
  }
446
 
447
- for ( $i = 1; $i <= $pages; $i ++ ) {
448
- if ( 1 != $pages && ( ! ( $i >= $paged + $range + 1 || $i <= $paged - $range - 1 ) || $pages <= $showitems ) ) {
449
  $class = ( $paged == $i ) ? " class='selected'" : '';
450
- $html .= "<a href='" . get_pagenum_link ( $i ) . "'$class >$i</a>";
451
  }
452
  }
453
 
454
  if ( $paged < $pages ) {
455
- $html .= sprintf ( '<a class="%s" href="%s">&rsaquo;</a>', 'yit_pagination_next', get_pagenum_link ( $paged + 1 ) );
456
  }
457
  if ( $paged < $pages - 1 ) {
458
- $html .= sprintf ( '<a class="%s" href="%s">&raquo;</a>', 'yit_pagination_last', get_pagenum_link ( $pages ) );
459
  }
460
 
461
  $html .= "</div>\n";
462
  }
463
 
464
- echo apply_filters ( 'yit_pagination_html', $html );
465
  }
466
  }
467
 
468
- if ( ! function_exists ( 'yit_registered_sidebars' ) ) {
469
  /**
470
  * Retrieve all registered sidebars
471
  *
472
  * @return array
473
  * @since 2.0.0
474
  */
475
- function yit_registered_sidebars () {
476
  global $wp_registered_sidebars;
477
 
478
- $return = array ();
479
 
480
  if ( empty( $wp_registered_sidebars ) ) {
481
- $return = array ( '' => '' );
482
  }
483
 
484
- foreach ( ( array )$wp_registered_sidebars as $the_ ) {
485
  $return[ $the_[ 'name' ] ] = $the_[ 'name' ];
486
  }
487
 
488
- ksort ( $return );
489
 
490
  return $return;
491
  }
492
  }
493
 
494
- if ( ! function_exists ( 'yit_layout_option' ) ) {
495
  /**
496
  * Retrieve a layout option
497
  *
@@ -503,18 +506,18 @@ if ( ! function_exists ( 'yit_layout_option' ) ) {
503
  * @return array
504
  * @since 2.0.0
505
  */
506
- function yit_layout_option ( $key, $id = false, $type = "post", $model = "post_type" ) {
507
 
508
  $option = '';
509
 
510
- if ( defined ( 'YIT' ) ) {
511
- $option = YIT_Layout_Panel ()->get_option ( $key, $id, $type, $model );
512
  } else {
513
- if ( ! $id && ( is_single () || is_page () ) ) {
514
  global $post;
515
  $id = $post->ID;
516
  } elseif ( $id != 'all' ) {
517
- $option = get_post_meta ( $id, $key );
518
  }
519
  }
520
 
@@ -522,13 +525,13 @@ if ( ! function_exists ( 'yit_layout_option' ) ) {
522
  }
523
  }
524
 
525
- if ( ! function_exists ( 'yit_curPageURL' ) ) {
526
  /**
527
  * Retrieve the current complete url
528
  *
529
  * @since 1.0
530
  */
531
- function yit_curPageURL () {
532
  $pageURL = 'http';
533
  if ( isset( $_SERVER[ "HTTPS" ] ) AND $_SERVER[ "HTTPS" ] == "on" ) {
534
  $pageURL .= "s";
@@ -546,7 +549,7 @@ if ( ! function_exists ( 'yit_curPageURL' ) ) {
546
  }
547
  }
548
 
549
- if ( ! function_exists ( 'yit_get_excluded_categories' ) ) {
550
  /**
551
  *
552
  * Retrieve the escluded categories, set on Theme Options
@@ -558,46 +561,46 @@ if ( ! function_exists ( 'yit_get_excluded_categories' ) ) {
558
  * @since 2.0.0
559
  */
560
 
561
- function yit_get_excluded_categories ( $k = 1 ) {
562
 
563
  global $post;
564
 
565
- if ( ! isset( $post->ID ) ) {
566
  return;
567
  }
568
 
569
- $cf_cats = get_post_meta ( $post->ID, 'blog-cats', true );
570
 
571
- if ( ! empty( $cf_cats ) ) {
572
  return $cf_cats;
573
  }
574
 
575
- $cats = function_exists ( 'yit_get_option' ) ? yit_get_option ( 'blog-excluded-cats' ) : '';
576
 
577
 
578
- if ( ! is_array ( $cats ) || empty( $cats ) || ! isset( $cats[ $k ] ) ) {
579
  return;
580
  }
581
 
582
- $cats = array_map ( 'trim', $cats[ $k ] );
583
 
584
  $i = 0;
585
  $query = '';
586
  foreach ( $cats as $cat ) {
587
  $query .= ",-$cat";
588
 
589
- $i ++;
590
  }
591
 
592
- ltrim ( ',', $query );
593
 
594
  return $query;
595
  }
596
  }
597
 
598
 
599
- if ( ! function_exists ( 'yit_add_extra_theme_headers' ) ) {
600
- add_filter ( 'extra_theme_headers', 'yit_add_extra_theme_headers' );
601
 
602
  /**
603
  * Check the framework core version
@@ -608,14 +611,14 @@ if ( ! function_exists ( 'yit_add_extra_theme_headers' ) ) {
608
  * @since 2.0.0
609
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
610
  */
611
- function yit_add_extra_theme_headers ( $headers ) {
612
  $headers[] = 'Core Framework Version';
613
 
614
  return $headers;
615
  }
616
  }
617
 
618
- if ( ! function_exists ( 'yit_check_plugin_support' ) ) {
619
  /**
620
  * Check the framework core version
621
  *
@@ -623,16 +626,16 @@ if ( ! function_exists ( 'yit_check_plugin_support' ) ) {
623
  * @since 2.0.0
624
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
625
  */
626
- function yit_check_plugin_support () {
627
 
628
- $headers[ 'core' ] = wp_get_theme ()->get ( 'Core Framework Version' );
629
- $headers[ 'author' ] = wp_get_theme ()->get ( 'Author' );
630
 
631
- if ( ! $headers[ 'core' ] && defined ( 'YIT_CORE_VERSION' ) ) {
632
  $headers[ 'core' ] = YIT_CORE_VERSION;
633
  }
634
 
635
- if ( ( ! empty( $headers[ 'core' ] ) && version_compare ( $headers[ 'core' ], '2.0.0', '<=' ) ) || $headers[ 'author' ] != 'Your Inspiration Themes' ) {
636
  return true;
637
  } else {
638
  return false;
@@ -640,7 +643,7 @@ if ( ! function_exists ( 'yit_check_plugin_support' ) ) {
640
  }
641
  }
642
 
643
- if ( ! function_exists ( 'yit_ie_version' ) ) {
644
  /**
645
  * Retrieve IE version.
646
  *
@@ -650,28 +653,26 @@ if ( ! function_exists ( 'yit_ie_version' ) ) {
650
  */
651
  function yit_ie_version() {
652
 
653
- if ( ! isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
654
- return - 1;
655
  }
656
- preg_match( '/MSIE ([0-9]+\.[0-9])/', $_SERVER['HTTP_USER_AGENT'], $reg );
657
 
658
- if ( ! isset( $reg[1] ) ) // IE 11 FIX
659
  {
660
- preg_match( '/rv:([0-9]+\.[0-9])/', $_SERVER['HTTP_USER_AGENT'], $reg );
661
- if ( ! isset( $reg[1] ) ) {
662
- return - 1;
663
- }
664
- else {
665
- return floatval( $reg[1] );
666
  }
667
- }
668
- else {
669
- return floatval( $reg[1] );
670
  }
671
  }
672
  }
673
 
674
- if ( ! function_exists ( 'yit_avoid_duplicate' ) ) {
675
  /**
676
  * Check if something exists. If yes, add a -N to the value where N is a number.
677
  *
@@ -683,29 +684,29 @@ if ( ! function_exists ( 'yit_avoid_duplicate' ) ) {
683
  * @since 2.0.0
684
  * @author Antonino Scarf� <antonino.scarfi@yithemes.com>
685
  */
686
- function yit_avoid_duplicate ( $value, $array, $check = 'value' ) {
687
- $match = array ();
688
 
689
- if ( ! is_array ( $array ) ) {
690
  return $value;
691
  }
692
 
693
- if ( ( $check == 'value' && ! in_array ( $value, $array ) ) || ( $check == 'key' && ! isset( $array[ $value ] ) ) ) {
694
  return $value;
695
  } else {
696
- if ( ! preg_match ( '/([a-z]+)-([0-9]+)/', $value, $match ) ) {
697
  $i = 2;
698
  } else {
699
- $i = intval ( $match[ 2 ] ) + 1;
700
  $value = $match[ 1 ];
701
  }
702
 
703
- return yit_avoid_duplicate ( $value . '-' . $i, $array, $check );
704
  }
705
  }
706
  }
707
 
708
- if ( ! function_exists ( 'yit_title_special_characters' ) ) {
709
  /**
710
  * The chars used in yit_decode_title() and yit_encode_title()
711
  *
@@ -719,17 +720,17 @@ if ( ! function_exists ( 'yit_title_special_characters' ) ) {
719
  *
720
  * @since 1.0
721
  */
722
- function yit_title_special_characters ( $chars ) {
723
- return array_merge ( $chars, array (
724
  '/[=\[](.*?)[=\]]/' => '<span class="title-highlight">$1</span>',
725
  '/\|/' => '<br />',
726
  ) );
727
  }
728
 
729
- add_filter ( 'yit_title_special_characters', 'yit_title_special_characters' );
730
  }
731
 
732
- if ( ! function_exists ( 'yit_decode_title' ) ) {
733
  /**
734
  * Change some special characters to put easily html into a string
735
  *
@@ -743,14 +744,14 @@ if ( ! function_exists ( 'yit_decode_title' ) ) {
743
  *
744
  * @since 1.0
745
  */
746
- function yit_decode_title ( $title ) {
747
- $replaces = apply_filters ( 'yit_title_special_characters', array () );
748
 
749
- return preg_replace ( array_keys ( $replaces ), array_values ( $replaces ), $title );
750
  }
751
  }
752
 
753
- if ( ! function_exists ( 'yit_encode_title' ) ) {
754
  /**
755
  * Change some special characters to put easily html into a string
756
  *
@@ -764,14 +765,14 @@ if ( ! function_exists ( 'yit_encode_title' ) ) {
764
  *
765
  * @since 1.0
766
  */
767
- function yit_encode_title ( $title ) {
768
- $replaces = apply_filters ( 'yit_title_special_characters', array () );
769
 
770
- return preg_replace ( array_values ( $replaces ), array_keys ( $replaces ), $title );
771
  }
772
  }
773
 
774
- if ( ! function_exists ( 'yit_remove_chars_title' ) ) {
775
  /**
776
  * Change some special characters to put easily html into a string
777
  *
@@ -785,14 +786,14 @@ if ( ! function_exists ( 'yit_remove_chars_title' ) ) {
785
  *
786
  * @since 1.0
787
  */
788
- function yit_remove_chars_title ( $title ) {
789
- $replaces = apply_filters ( 'yit_title_special_characters', array () );
790
 
791
- return preg_replace ( array_keys ( $replaces ), '$1', $title );
792
  }
793
  }
794
 
795
- if ( ! function_exists ( 'is_shop_installed' ) ) {
796
  /**
797
  * Detect if there is a shop plugin installed
798
  *
@@ -800,9 +801,9 @@ if ( ! function_exists ( 'is_shop_installed' ) ) {
800
  * @since 2.0.0
801
  * @author Francesco Grasso <francesco.grasso@yithemes.com
802
  */
803
- function is_shop_installed () {
804
  global $woocommerce;
805
- if ( isset( $woocommerce ) || defined ( 'JIGOSHOP_VERSION' ) ) {
806
  return true;
807
  } else {
808
  return false;
@@ -810,27 +811,27 @@ if ( ! function_exists ( 'is_shop_installed' ) ) {
810
  }
811
  }
812
 
813
- if ( ! function_exists ( 'yit_load_js_file' ) ) {
814
  /**
815
  * Load .min.js file if WP_Debug is not defined
816
  *
817
- * @param $filename The file name
818
  *
819
  * @return string The file path
820
  * @since 2.0.0
821
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
822
  */
823
- function yit_load_js_file ( $filename ) {
824
 
825
- if ( ! ( ( defined ( 'WP_DEBUG' ) && WP_DEBUG ) || ( defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) || isset( $_GET['yith_script_debug'] ) ) ) {
826
- $filename = str_replace ( '.js', '.min.js', $filename );
827
  }
828
 
829
  return $filename;
830
  }
831
  }
832
 
833
- if ( ! function_exists ( 'yit_wpml_register_string' ) ) {
834
  /**
835
  * Register a string in wpml trnslation
836
  *
@@ -841,13 +842,13 @@ if ( ! function_exists ( 'yit_wpml_register_string' ) ) {
841
  * @since 2.0.0
842
  * @author Andrea Frascaspata <andrea.frascaspata@yithemes.com>
843
  */
844
- function yit_wpml_register_string ( $contenxt, $name, $value ) {
845
  // wpml string translation
846
- do_action ( 'wpml_register_single_string', $contenxt, $name, $value );
847
  }
848
  }
849
 
850
- if ( ! function_exists ( 'yit_wpml_string_translate' ) ) {
851
  /**
852
  * Get a string translation
853
  *
@@ -859,13 +860,13 @@ if ( ! function_exists ( 'yit_wpml_string_translate' ) ) {
859
  * @since 2.0.0
860
  * @author Andrea Frascaspata <andrea.frascaspata@yithemes.com>
861
  */
862
- function yit_wpml_string_translate ( $contenxt, $name, $default_value ) {
863
- return apply_filters ( 'wpml_translate_single_string', $default_value, $contenxt, $name );
864
  }
865
 
866
  }
867
 
868
- if ( ! function_exists ( 'yit_wpml_object_id' ) ) {
869
  /**
870
  * Get id of post translation in current language
871
  *
@@ -878,11 +879,11 @@ if ( ! function_exists ( 'yit_wpml_object_id' ) ) {
878
  * @since 2.0.0
879
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
880
  */
881
- function yit_wpml_object_id ( $element_id, $element_type = 'post', $return_original_if_missing = false, $ulanguage_code = null ) {
882
- if ( function_exists ( 'wpml_object_id_filter' ) ) {
883
  return wpml_object_id_filter( $element_id, $element_type, $return_original_if_missing, $ulanguage_code );
884
- } elseif ( function_exists ( 'icl_object_id' ) ) {
885
- return icl_object_id ( $element_id, $element_type, $return_original_if_missing, $ulanguage_code );
886
  } else {
887
  return $element_id;
888
  }
@@ -891,7 +892,7 @@ if ( ! function_exists ( 'yit_wpml_object_id' ) ) {
891
  }
892
 
893
 
894
- if ( ! function_exists ( 'yith_get_formatted_price' ) ) {
895
  /**
896
  * Format the price with a currency symbol.
897
  *
@@ -900,27 +901,175 @@ if ( ! function_exists ( 'yith_get_formatted_price' ) ) {
900
  *
901
  * @return string
902
  */
903
- function yith_get_formatted_price ( $price, $args = array () ) {
904
- extract ( apply_filters ( 'wc_price_args', wp_parse_args ( $args, array (
905
  'ex_tax_label' => false,
906
  'currency' => '',
907
- 'decimal_separator' => wc_get_price_decimal_separator (),
908
- 'thousand_separator' => wc_get_price_thousand_separator (),
909
- 'decimals' => wc_get_price_decimals (),
910
- 'price_format' => get_woocommerce_price_format (),
911
  ) ) ) );
912
 
913
  $negative = $price < 0;
914
- $price = apply_filters ( 'raw_woocommerce_price', floatval ( $negative ? $price * - 1 : $price ) );
915
- $price = apply_filters ( 'formatted_woocommerce_price', number_format ( $price, $decimals, $decimal_separator, $thousand_separator ), $price, $decimals, $decimal_separator, $thousand_separator );
916
 
917
- if ( apply_filters ( 'woocommerce_price_trim_zeros', false ) && $decimals > 0 ) {
918
- $price = wc_trim_zeros ( $price );
919
  }
920
 
921
- $formatted_price = ( $negative ? '-' : '' ) . sprintf ( $price_format, get_woocommerce_currency_symbol ( $currency ), $price );
922
  $return = $formatted_price;
923
 
924
- return apply_filters ( 'wc_price', $return, $price, $args );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
925
  }
926
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
+ if ( !defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
+ if ( !function_exists( 'yit_plugin_locate_template' ) ) {
16
  /**
17
  * Locate the templates and return the path of the file found
18
  *
23
  * @return string
24
  * @since 2.0.0
25
  */
26
+ function yit_plugin_locate_template( $plugin_basename, $path, $var = null ) {
27
 
28
  $template_path = '/theme/templates/' . $path;
29
 
30
+ $located = locate_template( array(
31
+ $template_path,
32
+ ) );
33
 
34
+ if ( !$located ) {
35
  $located = $plugin_basename . '/templates/' . $path;
36
  }
37
 
40
 
41
  }
42
 
43
+ if ( !function_exists( 'yit_plugin_get_template' ) ) {
44
  /**
45
  * Retrieve a template file.
46
  *
52
  * @return string
53
  * @since 2.0.0
54
  */
55
+ function yit_plugin_get_template( $plugin_basename, $path, $var = null, $return = false ) {
56
 
57
+ $located = yit_plugin_locate_template( $plugin_basename, $path, $var );
58
 
59
+ if ( $var && is_array( $var ) ) {
60
+ extract( $var );
61
  }
62
 
63
  if ( $return ) {
64
+ ob_start();
65
  }
66
 
67
  // include file located
68
+ if ( file_exists( $located ) ) {
69
+ include( $located );
70
  }
71
 
72
  if ( $return ) {
73
+ return ob_get_clean();
74
  }
75
  }
76
  }
77
 
78
+ if ( !function_exists( 'yit_plugin_content' ) ) {
79
  /**
80
  * Return post content with read more link (if needed)
81
  *
88
  * @return string
89
  * @since 2.0.0
90
  */
91
+ function yit_plugin_content( $what = 'content', $limit = 25, $more_text = '', $split = '[...]', $in_paragraph = 'true' ) {
92
  if ( $what == 'content' ) {
93
+ $content = get_the_content( $more_text );
94
  } else {
95
  if ( $what == 'excerpt' ) {
96
+ $content = get_the_excerpt();
97
  } else {
98
  $content = $what;
99
  }
101
 
102
  if ( $limit == 0 ) {
103
  if ( $what == 'excerpt' ) {
104
+ $content = apply_filters( 'the_excerpt', $content );
105
  } else {
106
+ $content = preg_replace( '/<img[^>]+./', '', $content ); //remove images
107
+ $content = apply_filters( 'the_content', $content );
108
+ $content = str_replace( ']]>', ']]&gt;', $content );
109
  }
110
 
111
  return $content;
112
  }
113
 
114
  // remove the tag more from the content
115
+ if ( preg_match( "/<(a)[^>]*class\s*=\s*(['\"])more-link\\2[^>]*>(.*?)<\/\\1>/", $content, $matches ) ) {
116
 
117
+ if ( strpos( $matches[ 0 ], '[button' ) ) {
118
+ $more_link = str_replace( 'href="#"', 'href="' . get_permalink() . '"', do_shortcode( $matches[ 3 ] ) );
119
  } else {
120
  $more_link = $matches[ 0 ];
121
  }
122
 
123
+ $content = str_replace( $more_link, '', $content );
124
  $split = '';
125
  }
126
 
127
  if ( empty( $content ) ) {
128
  return;
129
  }
130
+ $content = explode( ' ', $content );
131
 
132
+ if ( !empty( $more_text ) && !isset( $more_link ) ) {
133
  //array_pop( $content );
134
+ $more_link = strpos( $more_text, '<a class="btn"' ) ? $more_text : '<a class="read-more' . apply_filters( 'yit_simple_read_more_classes', ' ' ) . '" href="' . get_permalink() . '">' . $more_text . '</a>';
135
  $split = '';
136
+ } elseif ( !isset( $more_link ) ) {
137
  $more_link = '';
138
  }
139
 
140
  // split
141
+ if ( count( $content ) >= $limit ) {
142
  $split_content = '';
143
+ for ( $i = 0; $i < $limit; $i++ ) {
144
  $split_content .= $content[ $i ] . ' ';
145
  }
146
 
147
  $content = $split_content . $split;
148
  } else {
149
+ $content = implode( " ", $content );
150
  }
151
 
152
  // TAGS UNCLOSED
153
+ $tags = array();
154
  // get all tags opened
155
+ preg_match_all( "/(<([\w]+)[^>]*>)/", $content, $tags_opened, PREG_SET_ORDER );
156
  foreach ( $tags_opened as $tag ) {
157
  $tags[] = $tag[ 2 ];
158
  }
159
 
160
  // get all tags closed and remove it from the tags opened.. the rest will be closed at the end of the content
161
+ preg_match_all( "/(<\/([\w]+)[^>]*>)/", $content, $tags_closed, PREG_SET_ORDER );
162
  foreach ( $tags_closed as $tag ) {
163
+ unset( $tags[ array_search( $tag[ 2 ], $tags ) ] );
164
  }
165
 
166
  // close the tags
167
+ if ( !empty( $tags ) ) {
168
  foreach ( $tags as $tag ) {
169
  $content .= "</$tag>";
170
  }
172
 
173
  //$content = preg_replace( '/\[.+\]/', '', $content );
174
  if ( $in_paragraph == true ): $content .= $more_link; endif;
175
+ $content = preg_replace( '/<img[^>]+./', '', $content ); //remove images
176
+ $content = apply_filters( 'the_content', $content );
177
+ $content = str_replace( ']]>', ']]&gt;', $content ); // echo str_replace( array( '<', '>' ), array( '&lt;', '&gt;' ), $content );
178
  if ( $in_paragraph == false ): $content .= $more_link; endif;
179
 
180
  return $content;
181
  }
182
  }
183
 
184
+ if ( !function_exists( 'yit_plugin_string' ) ) {
185
  /**
186
  * Simple echo a string, with a before and after string, only if the main string is not empty.
187
  *
188
  * @param string $before What there is before the main string
189
  * @param string $string The main string. If it is empty or null, the functions return null.
190
+ * @param string $after What there is after the main string
191
+ * @param bool $echo If echo or only return it
192
  *
193
  * @return string The complete string, if the main string is not empty or null
194
  * @since 2.0.0
195
  */
196
+ function yit_plugin_string( $before = '', $string = '', $after = '', $echo = true ) {
197
  $html = '';
198
 
199
+ if ( $string != '' AND !is_null( $string ) ) {
200
  $html = $before . $string . $after;
201
  }
202
 
208
  }
209
  }
210
 
211
+ if ( !function_exists( 'yit_plugin_decode_title' ) ) {
212
  /**
213
  * Change some special characters to put easily html into a string
214
  *
222
  *
223
  * @since 1.0
224
  */
225
+ function yit_plugin_decode_title( $title ) {
226
+ $replaces = apply_filters( 'yit_title_special_characters', array() );
227
 
228
+ return preg_replace( array_keys( $replaces ), array_values( $replaces ), $title );
229
  }
230
  }
231
 
232
+ if ( !function_exists( 'yit_plugin_get_attachment_id' ) ) {
233
 
234
  /**
235
  * Return the ID of an attachment.
241
  * @since 2.0.0
242
  */
243
 
244
+ function yit_plugin_get_attachment_id( $url ) {
245
 
246
+ $upload_dir = wp_upload_dir();
247
+ $dir = trailingslashit( $upload_dir[ 'baseurl' ] );
248
 
249
+ if ( false === strpos( $url, $dir ) ) {
250
  return false;
251
  }
252
 
253
+ $file = basename( $url );
254
 
255
+ $query = array(
256
  'post_type' => 'attachment',
257
  'fields' => 'ids',
258
+ 'meta_query' => array(
259
+ array(
260
  'value' => $file,
261
  'compare' => 'LIKE',
262
  ),
264
  );
265
 
266
  $query[ 'meta_query' ][ 0 ][ 'key' ] = '_wp_attached_file';
267
+ $ids = get_posts( $query );
268
 
269
  foreach ( $ids as $id ) {
270
+ $attachment_image = wp_get_attachment_image_src( $id, 'full' );
271
+ if ( $url == array_shift( $attachment_image ) || $url == str_replace( 'https://', 'http://', array_shift( $attachment_image ) ) ) {
272
  return $id;
273
  }
274
  }
275
  $query[ 'meta_query' ][ 0 ][ 'key' ] = '_wp_attachment_metadata';
276
+ $ids = get_posts( $query );
277
 
278
  foreach ( $ids as $id ) {
279
 
280
+ $meta = wp_get_attachment_metadata( $id );
281
+ if ( !isset( $meta[ 'sizes' ] ) ) {
282
  continue;
283
  }
284
 
285
+ foreach ( (array) $meta[ 'sizes' ] as $size => $values ) {
286
+ if ( $values[ 'file' ] == $file && $url == str_replace( 'https://', 'http://', array_shift( wp_get_attachment_image_src( $id, $size ) ) ) ) {
287
 
288
  return $id;
289
  }
294
  }
295
  }
296
 
297
+ if ( !function_exists( 'yit_enqueue_script' ) ) {
298
  /**
299
  * Enqueues script.
300
  *
304
  * @author Simone D'Amico <simone.damico@yithemes.com>
305
  * @see yit_register_script() For parameter information.
306
  */
307
+ function yit_enqueue_script( $handle, $src, $deps = array(), $ver = false, $in_footer = true ) {
308
 
309
+ if ( function_exists( 'YIT_Asset' ) && !is_admin() ) {
310
  $enqueue = true;
311
+ YIT_Asset()->set( 'script', $handle, compact( 'src', 'deps', 'ver', 'in_footer', 'enqueue' ) );
312
  } else {
313
+ wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
314
  }
315
  }
316
  }
317
 
318
+ if ( !function_exists( 'yit_enqueue_style' ) ) {
319
  /**
320
  * Enqueues style.
321
  *
325
  * @author Simone D'Amico <simone.damico@yithemes.com>
326
  * @see yit_register_style() For parameter information.
327
  */
328
+ function yit_enqueue_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {
329
 
330
+ if ( function_exists( 'YIT_Asset' ) ) {
331
  $enqueue = true;
332
+ $who = YIT_Asset()->get_stylesheet_handle( get_stylesheet_uri(), 'style' );
333
  $where = 'before';
334
 
335
  if ( false == $who ) {
336
  $who = '';
337
  }
338
 
339
+ YIT_Asset()->set( 'style', $handle, compact( 'src', 'deps', 'ver', 'media', 'enqueue' ), $where, $who );
340
  } else {
341
+ wp_enqueue_style( $handle, $src, $deps, $ver, $media );
342
  }
343
  }
344
  }
345
 
346
+ if ( !function_exists( 'yit_get_post_meta' ) ) {
347
  /**
348
  * Retrieve the value of a metabox.
349
  *
350
  * This function retrieve the value of a metabox attached to a post. It return either a single value or an array.
351
  *
352
+ * @param int $id Post ID.
353
  * @param string $meta The meta key to retrieve.
354
  *
355
  * @return mixed Single value or array
356
  * @since 2.0.0
357
  */
358
+ function yit_get_post_meta( $id, $meta ) {
359
+ if ( !strpos( $meta, '[' ) ) {
360
+ return get_post_meta( $id, $meta, true );
361
  }
362
 
363
+ $sub_meta = explode( '[', $meta );
364
 
365
+ $meta = get_post_meta( $id, current( $sub_meta ), true );
366
+ for ( $i = 1; $i < count( $sub_meta ); $i++ ) {
367
+ $current_submeta = rtrim( $sub_meta[ $i ], ']' );
368
+ if ( !isset( $meta[ $current_submeta ] ) )
369
+ return false;
370
+ $meta = $meta[ $current_submeta ];
371
  }
372
 
373
  return $meta;
374
  }
375
  }
376
 
377
+ if ( !function_exists( 'yit_string' ) ) {
378
  /**
379
  * Simple echo a string, with a before and after string, only if the main string is not empty.
380
  *
381
  * @param string $before What there is before the main string
382
  * @param string $string The main string. If it is empty or null, the functions return null.
383
+ * @param string $after What there is after the main string
384
+ * @param bool $echo If echo or only return it
385
  *
386
  * @return string The complete string, if the main string is not empty or null
387
  * @since 2.0.0
388
  */
389
+ function yit_string( $before = '', $string = '', $after = '', $echo = true ) {
390
  $html = '';
391
 
392
+ if ( $string != '' AND !is_null( $string ) ) {
393
  $html = $before . $string . $after;
394
  }
395
 
402
  }
403
 
404
 
405
+ if ( !function_exists( 'yit_pagination' ) ) {
406
  /**
407
  * Print pagination
408
  *
412
  * @return string
413
  * @since 2.0.0
414
  */
415
+ function yit_pagination( $pages = '', $range = 10 ) {
416
  $showitems = ( $range * 2 ) + 1;
417
 
418
+ $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : false;
419
  if ( $paged === false ) {
420
+ $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : false;
421
  }
422
  if ( $paged === false ) {
423
  $paged = 1;
433
  $pages = $wp_query->max_num_pages;
434
  }
435
 
436
+ if ( !$pages ) {
437
  $pages = 1;
438
  }
439
  }
441
  if ( 1 != $pages ) {
442
  $html .= "<div class='general-pagination clearfix'>";
443
  if ( $paged > 2 ) {
444
+ $html .= sprintf( '<a class="%s" href="%s">&laquo;</a>', 'yit_pagination_first', get_pagenum_link( 1 ) );
445
  }
446
  if ( $paged > 1 ) {
447
+ $html .= sprintf( '<a class="%s" href="%s">&lsaquo;</a>', 'yit_pagination_previous', get_pagenum_link( $paged - 1 ) );
448
  }
449
 
450
+ for ( $i = 1; $i <= $pages; $i++ ) {
451
+ if ( 1 != $pages && ( !( $i >= $paged + $range + 1 || $i <= $paged - $range - 1 ) || $pages <= $showitems ) ) {
452
  $class = ( $paged == $i ) ? " class='selected'" : '';
453
+ $html .= "<a href='" . get_pagenum_link( $i ) . "'$class >$i</a>";
454
  }
455
  }
456
 
457
  if ( $paged < $pages ) {
458
+ $html .= sprintf( '<a class="%s" href="%s">&rsaquo;</a>', 'yit_pagination_next', get_pagenum_link( $paged + 1 ) );
459
  }
460
  if ( $paged < $pages - 1 ) {
461
+ $html .= sprintf( '<a class="%s" href="%s">&raquo;</a>', 'yit_pagination_last', get_pagenum_link( $pages ) );
462
  }
463
 
464
  $html .= "</div>\n";
465
  }
466
 
467
+ echo apply_filters( 'yit_pagination_html', $html );
468
  }
469
  }
470
 
471
+ if ( !function_exists( 'yit_registered_sidebars' ) ) {
472
  /**
473
  * Retrieve all registered sidebars
474
  *
475
  * @return array
476
  * @since 2.0.0
477
  */
478
+ function yit_registered_sidebars() {
479
  global $wp_registered_sidebars;
480
 
481
+ $return = array();
482
 
483
  if ( empty( $wp_registered_sidebars ) ) {
484
+ $return = array( '' => '' );
485
  }
486
 
487
+ foreach ( ( array ) $wp_registered_sidebars as $the_ ) {
488
  $return[ $the_[ 'name' ] ] = $the_[ 'name' ];
489
  }
490
 
491
+ ksort( $return );
492
 
493
  return $return;
494
  }
495
  }
496
 
497
+ if ( !function_exists( 'yit_layout_option' ) ) {
498
  /**
499
  * Retrieve a layout option
500
  *
506
  * @return array
507
  * @since 2.0.0
508
  */
509
+ function yit_layout_option( $key, $id = false, $type = "post", $model = "post_type" ) {
510
 
511
  $option = '';
512
 
513
+ if ( defined( 'YIT' ) ) {
514
+ $option = YIT_Layout_Panel()->get_option( $key, $id, $type, $model );
515
  } else {
516
+ if ( !$id && ( is_single() || is_page() ) ) {
517
  global $post;
518
  $id = $post->ID;
519
  } elseif ( $id != 'all' ) {
520
+ $option = get_post_meta( $id, $key );
521
  }
522
  }
523
 
525
  }
526
  }
527
 
528
+ if ( !function_exists( 'yit_curPageURL' ) ) {
529
  /**
530
  * Retrieve the current complete url
531
  *
532
  * @since 1.0
533
  */
534
+ function yit_curPageURL() {
535
  $pageURL = 'http';
536
  if ( isset( $_SERVER[ "HTTPS" ] ) AND $_SERVER[ "HTTPS" ] == "on" ) {
537
  $pageURL .= "s";
549
  }
550
  }
551
 
552
+ if ( !function_exists( 'yit_get_excluded_categories' ) ) {
553
  /**
554
  *
555
  * Retrieve the escluded categories, set on Theme Options
561
  * @since 2.0.0
562
  */
563
 
564
+ function yit_get_excluded_categories( $k = 1 ) {
565
 
566
  global $post;
567
 
568
+ if ( !isset( $post->ID ) ) {
569
  return;
570
  }
571
 
572
+ $cf_cats = get_post_meta( $post->ID, 'blog-cats', true );
573
 
574
+ if ( !empty( $cf_cats ) ) {
575
  return $cf_cats;
576
  }
577
 
578
+ $cats = function_exists( 'yit_get_option' ) ? yit_get_option( 'blog-excluded-cats' ) : '';
579
 
580
 
581
+ if ( !is_array( $cats ) || empty( $cats ) || !isset( $cats[ $k ] ) ) {
582
  return;
583
  }
584
 
585
+ $cats = array_map( 'trim', $cats[ $k ] );
586
 
587
  $i = 0;
588
  $query = '';
589
  foreach ( $cats as $cat ) {
590
  $query .= ",-$cat";
591
 
592
+ $i++;
593
  }
594
 
595
+ ltrim( ',', $query );
596
 
597
  return $query;
598
  }
599
  }
600
 
601
 
602
+ if ( !function_exists( 'yit_add_extra_theme_headers' ) ) {
603
+ add_filter( 'extra_theme_headers', 'yit_add_extra_theme_headers' );
604
 
605
  /**
606
  * Check the framework core version
611
  * @since 2.0.0
612
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
613
  */
614
+ function yit_add_extra_theme_headers( $headers ) {
615
  $headers[] = 'Core Framework Version';
616
 
617
  return $headers;
618
  }
619
  }
620
 
621
+ if ( !function_exists( 'yit_check_plugin_support' ) ) {
622
  /**
623
  * Check the framework core version
624
  *
626
  * @since 2.0.0
627
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
628
  */
629
+ function yit_check_plugin_support() {
630
 
631
+ $headers[ 'core' ] = wp_get_theme()->get( 'Core Framework Version' );
632
+ $headers[ 'author' ] = wp_get_theme()->get( 'Author' );
633
 
634
+ if ( !$headers[ 'core' ] && defined( 'YIT_CORE_VERSION' ) ) {
635
  $headers[ 'core' ] = YIT_CORE_VERSION;
636
  }
637
 
638
+ if ( ( !empty( $headers[ 'core' ] ) && version_compare( $headers[ 'core' ], '2.0.0', '<=' ) ) || $headers[ 'author' ] != 'Your Inspiration Themes' ) {
639
  return true;
640
  } else {
641
  return false;
643
  }
644
  }
645
 
646
+ if ( !function_exists( 'yit_ie_version' ) ) {
647
  /**
648
  * Retrieve IE version.
649
  *
653
  */
654
  function yit_ie_version() {
655
 
656
+ if ( !isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
657
+ return -1;
658
  }
659
+ preg_match( '/MSIE ([0-9]+\.[0-9])/', $_SERVER[ 'HTTP_USER_AGENT' ], $reg );
660
 
661
+ if ( !isset( $reg[ 1 ] ) ) // IE 11 FIX
662
  {
663
+ preg_match( '/rv:([0-9]+\.[0-9])/', $_SERVER[ 'HTTP_USER_AGENT' ], $reg );
664
+ if ( !isset( $reg[ 1 ] ) ) {
665
+ return -1;
666
+ } else {
667
+ return floatval( $reg[ 1 ] );
 
668
  }
669
+ } else {
670
+ return floatval( $reg[ 1 ] );
 
671
  }
672
  }
673
  }
674
 
675
+ if ( !function_exists( 'yit_avoid_duplicate' ) ) {
676
  /**
677
  * Check if something exists. If yes, add a -N to the value where N is a number.
678
  *
684
  * @since 2.0.0
685
  * @author Antonino Scarf� <antonino.scarfi@yithemes.com>
686
  */
687
+ function yit_avoid_duplicate( $value, $array, $check = 'value' ) {
688
+ $match = array();
689
 
690
+ if ( !is_array( $array ) ) {
691
  return $value;
692
  }
693
 
694
+ if ( ( $check == 'value' && !in_array( $value, $array ) ) || ( $check == 'key' && !isset( $array[ $value ] ) ) ) {
695
  return $value;
696
  } else {
697
+ if ( !preg_match( '/([a-z]+)-([0-9]+)/', $value, $match ) ) {
698
  $i = 2;
699
  } else {
700
+ $i = intval( $match[ 2 ] ) + 1;
701
  $value = $match[ 1 ];
702
  }
703
 
704
+ return yit_avoid_duplicate( $value . '-' . $i, $array, $check );
705
  }
706
  }
707
  }
708
 
709
+ if ( !function_exists( 'yit_title_special_characters' ) ) {
710
  /**
711
  * The chars used in yit_decode_title() and yit_encode_title()
712
  *
720
  *
721
  * @since 1.0
722
  */
723
+ function yit_title_special_characters( $chars ) {
724
+ return array_merge( $chars, array(
725
  '/[=\[](.*?)[=\]]/' => '<span class="title-highlight">$1</span>',
726
  '/\|/' => '<br />',
727
  ) );
728
  }
729
 
730
+ add_filter( 'yit_title_special_characters', 'yit_title_special_characters' );
731
  }
732
 
733
+ if ( !function_exists( 'yit_decode_title' ) ) {
734
  /**
735
  * Change some special characters to put easily html into a string
736
  *
744
  *
745
  * @since 1.0
746
  */
747
+ function yit_decode_title( $title ) {
748
+ $replaces = apply_filters( 'yit_title_special_characters', array() );
749
 
750
+ return preg_replace( array_keys( $replaces ), array_values( $replaces ), $title );
751
  }
752
  }
753
 
754
+ if ( !function_exists( 'yit_encode_title' ) ) {
755
  /**
756
  * Change some special characters to put easily html into a string
757
  *
765
  *
766
  * @since 1.0
767
  */
768
+ function yit_encode_title( $title ) {
769
+ $replaces = apply_filters( 'yit_title_special_characters', array() );
770
 
771
+ return preg_replace( array_values( $replaces ), array_keys( $replaces ), $title );
772
  }
773
  }
774
 
775
+ if ( !function_exists( 'yit_remove_chars_title' ) ) {
776
  /**
777
  * Change some special characters to put easily html into a string
778
  *
786
  *
787
  * @since 1.0
788
  */
789
+ function yit_remove_chars_title( $title ) {
790
+ $replaces = apply_filters( 'yit_title_special_characters', array() );
791
 
792
+ return preg_replace( array_keys( $replaces ), '$1', $title );
793
  }
794
  }
795
 
796
+ if ( !function_exists( 'is_shop_installed' ) ) {
797
  /**
798
  * Detect if there is a shop plugin installed
799
  *
801
  * @since 2.0.0
802
  * @author Francesco Grasso <francesco.grasso@yithemes.com
803
  */
804
+ function is_shop_installed() {
805
  global $woocommerce;
806
+ if ( isset( $woocommerce ) || defined( 'JIGOSHOP_VERSION' ) ) {
807
  return true;
808
  } else {
809
  return false;
811
  }
812
  }
813
 
814
+ if ( !function_exists( 'yit_load_js_file' ) ) {
815
  /**
816
  * Load .min.js file if WP_Debug is not defined
817
  *
818
+ * @param string $filename The file name
819
  *
820
  * @return string The file path
821
  * @since 2.0.0
822
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
823
  */
824
+ function yit_load_js_file( $filename ) {
825
 
826
+ if ( !( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) || isset( $_GET[ 'yith_script_debug' ] ) ) ) {
827
+ $filename = str_replace( '.js', '.min.js', $filename );
828
  }
829
 
830
  return $filename;
831
  }
832
  }
833
 
834
+ if ( !function_exists( 'yit_wpml_register_string' ) ) {
835
  /**
836
  * Register a string in wpml trnslation
837
  *
842
  * @since 2.0.0
843
  * @author Andrea Frascaspata <andrea.frascaspata@yithemes.com>
844
  */
845
+ function yit_wpml_register_string( $contenxt, $name, $value ) {
846
  // wpml string translation
847
+ do_action( 'wpml_register_single_string', $contenxt, $name, $value );
848
  }
849
  }
850
 
851
+ if ( !function_exists( 'yit_wpml_string_translate' ) ) {
852
  /**
853
  * Get a string translation
854
  *
860
  * @since 2.0.0
861
  * @author Andrea Frascaspata <andrea.frascaspata@yithemes.com>
862
  */
863
+ function yit_wpml_string_translate( $contenxt, $name, $default_value ) {
864
+ return apply_filters( 'wpml_translate_single_string', $default_value, $contenxt, $name );
865
  }
866
 
867
  }
868
 
869
+ if ( !function_exists( 'yit_wpml_object_id' ) ) {
870
  /**
871
  * Get id of post translation in current language
872
  *
879
  * @since 2.0.0
880
  * @author Antonio La Rocca <antonio.larocca@yithemes.com>
881
  */
882
+ function yit_wpml_object_id( $element_id, $element_type = 'post', $return_original_if_missing = false, $ulanguage_code = null ) {
883
+ if ( function_exists( 'wpml_object_id_filter' ) ) {
884
  return wpml_object_id_filter( $element_id, $element_type, $return_original_if_missing, $ulanguage_code );
885
+ } elseif ( function_exists( 'icl_object_id' ) ) {
886
+ return icl_object_id( $element_id, $element_type, $return_original_if_missing, $ulanguage_code );
887
  } else {
888
  return $element_id;
889
  }
892
  }
893
 
894
 
895
+ if ( !function_exists( 'yith_get_formatted_price' ) ) {
896
  /**
897
  * Format the price with a currency symbol.
898
  *
901
  *
902
  * @return string
903
  */
904
+ function yith_get_formatted_price( $price, $args = array() ) {
905
+ extract( apply_filters( 'wc_price_args', wp_parse_args( $args, array(
906
  'ex_tax_label' => false,
907
  'currency' => '',
908
+ 'decimal_separator' => wc_get_price_decimal_separator(),
909
+ 'thousand_separator' => wc_get_price_thousand_separator(),
910
+ 'decimals' => wc_get_price_decimals(),
911
+ 'price_format' => get_woocommerce_price_format(),
912
  ) ) ) );
913
 
914
  $negative = $price < 0;
915
+ $price = apply_filters( 'raw_woocommerce_price', floatval( $negative ? $price * -1 : $price ) );
916
+ $price = apply_filters( 'formatted_woocommerce_price', number_format( $price, $decimals, $decimal_separator, $thousand_separator ), $price, $decimals, $decimal_separator, $thousand_separator );
917
 
918
+ if ( apply_filters( 'woocommerce_price_trim_zeros', false ) && $decimals > 0 ) {
919
+ $price = wc_trim_zeros( $price );
920
  }
921
 
922
+ $formatted_price = ( $negative ? '-' : '' ) . sprintf( $price_format, get_woocommerce_currency_symbol( $currency ), $price );
923
  $return = $formatted_price;
924
 
925
+ return apply_filters( 'wc_price', $return, $price, $args );
926
+ }
927
+ }
928
+
929
+ if ( !function_exists( 'yith_get_terms' ) ) {
930
+ /**
931
+ * Get terms
932
+ *
933
+ * @param $args
934
+ *
935
+ * @return array|int|WP_Error
936
+ */
937
+ function yith_get_terms( $args ) {
938
+ global $wp_version;
939
+ if ( version_compare( $wp_version, '4.5', '>=' ) ) {
940
+ $terms = get_terms( $args );
941
+ } else {
942
+ $terms = get_terms( $args[ 'taxonomy' ], $args );
943
+ }
944
+
945
+ return $terms;
946
+ }
947
+ }
948
+
949
+ if ( !function_exists( 'yith_field_deps_data' ) ) {
950
+ function yith_field_deps_data( $args ) {
951
+ $deps_data = '';
952
+ if ( isset( $args[ 'deps' ] ) && ( isset( $args[ 'deps' ][ 'ids' ] ) || isset( $args[ 'deps' ][ 'id' ] ) ) && ( isset( $args[ 'deps' ][ 'values' ] ) || isset( $args[ 'deps' ][ 'value' ] ) ) ) {
953
+ $deps = $args[ 'deps' ];
954
+ $id = isset( $deps[ 'target-id' ] ) ? $deps[ 'target-id' ] : $args[ 'id' ];
955
+ $dep_id = isset( $deps[ 'id' ] ) ? $deps[ 'id' ] : $deps[ 'ids' ];
956
+ $dep_values = isset( $deps[ 'value' ] ) ? $deps[ 'value' ] : $deps[ 'values' ];
957
+ $dep_type = isset( $deps[ 'type' ] ) ? $deps[ 'type' ] : 'hide'; // possible values: hide|disable
958
+
959
+ $deps_data = "data-dep-target='$id' data-dep-id='$dep_id' data-dep-value='$dep_values' data-dep-type='$dep_type'";
960
+ }
961
+
962
+ return $deps_data;
963
  }
964
+ }
965
+
966
+ if ( !function_exists( 'yith_panel_field_deps_data' ) ) {
967
+ /**
968
+ * @param $option
969
+ * @param YIT_Plugin_Panel|YIT_Plugin_Panel_WooCommerce $panel
970
+ *
971
+ * @return string
972
+ */
973
+ function yith_panel_field_deps_data( $option, $panel ) {
974
+ $deps_data = '';
975
+ if ( isset( $option[ 'deps' ] ) && ( isset( $option[ 'deps' ][ 'ids' ] ) || isset( $option[ 'deps' ][ 'id' ] ) ) && isset( $option[ 'deps' ][ 'values' ] ) ) {
976
+ $dep_id = isset( $option[ 'deps' ][ 'id' ] ) ? $option[ 'deps' ][ 'id' ] : $option[ 'deps' ][ 'ids' ];
977
+ $option[ 'deps' ][ 'ids' ] = $option[ 'deps' ][ 'id' ] = $panel->get_id_field( $dep_id );
978
+ $option[ 'id' ] = $panel->get_id_field( $option[ 'id' ] );
979
+
980
+ $deps_data = yith_field_deps_data( $option );
981
+ }
982
+
983
+ return $deps_data;
984
+ }
985
+ }
986
+
987
+ if ( !function_exists( 'yith_plugin_fw_get_field' ) ) {
988
+ /**
989
+ * @param array $field
990
+ * @param bool $echo
991
+ * @param bool $show_container
992
+ *
993
+ * @return string|void
994
+ */
995
+ function yith_plugin_fw_get_field( $field, $echo = false, $show_container = true ) {
996
+ if ( empty( $field[ 'type' ] ) )
997
+ return '';
998
+
999
+ if ( !isset( $field[ 'value' ] ) )
1000
+ $field[ 'value' ] = '';
1001
+
1002
+ if ( !isset( $field[ 'name' ] ) )
1003
+ $field[ 'name' ] = '';
1004
+
1005
+ if ( !isset( $field[ 'custom_attributes' ] ) )
1006
+ $field[ 'custom_attributes' ] = '';
1007
+
1008
+ if ( !isset( $field[ 'default' ] ) && isset( $field[ 'std' ] ) )
1009
+ $field[ 'default' ] = $field[ 'std' ];
1010
+
1011
+
1012
+ $field_template = yith_plugin_fw_get_field_template_path( $field );
1013
+ if ( $field_template ) {
1014
+ if ( !$echo )
1015
+ ob_start();
1016
+
1017
+ if ( $show_container ) echo '<div class="yith-plugin-fw-field-wrapper yith-plugin-fw-' . $field[ 'type' ] . '-field-wrapper">';
1018
+
1019
+ do_action( 'yith_plugin_fw_get_field_before', $field );
1020
+ do_action( 'yith_plugin_fw_get_field_' . $field[ 'type' ] . '_before', $field );
1021
+
1022
+ include( $field_template );
1023
+
1024
+ do_action( 'yith_plugin_fw_get_field_after', $field );
1025
+ do_action( 'yith_plugin_fw_get_field_' . $field[ 'type' ] . '_after', $field );
1026
+
1027
+ if ( $show_container ) echo '</div>';
1028
+
1029
+ if ( !$echo )
1030
+ return ob_get_clean();
1031
+ }
1032
+ }
1033
+ }
1034
+
1035
+ if ( !function_exists( 'yith_plugin_fw_get_field_template_path' ) ) {
1036
+ function yith_plugin_fw_get_field_template_path( $field ) {
1037
+ if ( empty( $field[ 'type' ] ) )
1038
+ return false;
1039
+
1040
+ $field_template = YIT_CORE_PLUGIN_TEMPLATE_PATH . '/fields/' . sanitize_title( $field[ 'type' ] ) . '.php';
1041
+ $field_template = apply_filters( 'yith_plugin_fw_get_field_template_path', $field_template, $field );
1042
+
1043
+ return file_exists( $field_template ) ? $field_template : false;
1044
+ }
1045
+ }
1046
+
1047
+ if ( !function_exists( 'yith_plugin_fw_html_data_to_string' ) ) {
1048
+ function yith_plugin_fw_html_data_to_string( $data = array(), $echo = false ) {
1049
+ $html_data = '';
1050
+
1051
+ if ( is_array( $data ) ) {
1052
+ foreach ( $data as $key => $value ) {
1053
+ $current_value = !is_array( $value ) ? $value : implode( ',', $value );
1054
+ $html_data .= " data-$key='$current_value'";
1055
+ }
1056
+ $html_data .= ' ';
1057
+ }
1058
+
1059
+ if ( $echo )
1060
+ echo $html_data;
1061
+ else
1062
+ return $html_data;
1063
+ }
1064
+ }
1065
+ if ( !function_exists( 'yith_plugin_fw_get_icon' ) ) {
1066
+ function yith_plugin_fw_get_icon( $icon = '', $args = array() ) {
1067
+ return YIT_Icons()->get_icon( $icon, $args );
1068
+ }
1069
+ }
1070
+
1071
+ if ( !function_exists( 'yith_plugin_fw_is_true' ) ) {
1072
+ function yith_plugin_fw_is_true( $value ) {
1073
+ return true === $value || 1 === $value || '1' === $value || 'yes' === $value;
1074
+ }
1075
+ }
plugin-fw/yit-plugin.php CHANGED
@@ -34,6 +34,9 @@ include_once( 'licence/lib/yit-theme-licence.php');
34
  include_once( 'lib/yit-video.php');
35
  include_once( 'lib/yit-upgrade.php');
36
  include_once( 'lib/yit-pointers.php');
 
 
 
37
 
38
  // load from theme folder...
39
  load_textdomain( 'yith-plugin-fw', get_template_directory() . '/core/plugin-fw/yith-plugin-fw-' . apply_filters( 'plugin_locale', get_locale(), 'yith-plugin-fw' ) . '.mo' )
34
  include_once( 'lib/yit-video.php');
35
  include_once( 'lib/yit-upgrade.php');
36
  include_once( 'lib/yit-pointers.php');
37
+ include_once( 'lib/yit-icons.php');
38
+ include_once( 'lib/yit-assets.php');
39
+ include_once( 'lib/yit-debug.php');
40
 
41
  // load from theme folder...
42
  load_textdomain( 'yith-plugin-fw', get_template_directory() . '/core/plugin-fw/yith-plugin-fw-' . apply_filters( 'plugin_locale', get_locale(), 'yith-plugin-fw' ) . '.mo' )