YITH WooCommerce Zoom Magnifier - Version 1.3.1

Version Description

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Zoom Magnifier
Version 1.3.1
Comparing to
See all releases

Code changes from version 1.3.0 to 1.3.1

README.txt CHANGED
@@ -2,9 +2,9 @@
2
 
3
  Contributors: yithemes
4
  Tags: zoom, magnifier, slider, carousel, woocommerce
5
- Requires at least: 3.5.1
6
- Tested up to: 4.9
7
- Stable tag: 1.3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -51,6 +51,13 @@ YITH WooCommerce Zoom Magnifier will add a new tab called "Zoom Magnifier" in "Y
51
 
52
  == Changelog ==
53
 
 
 
 
 
 
 
 
54
  = Version 1.3.0 - Released: Dec 11, 2017 =
55
 
56
  * Update: YITH Plugin Framework to version 3.0
2
 
3
  Contributors: yithemes
4
  Tags: zoom, magnifier, slider, carousel, woocommerce
5
+ Requires at least: 4.0
6
+ Tested up to: 4.9.4
7
+ Stable tag: 1.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
51
 
52
  == Changelog ==
53
 
54
+ = Version 1.3.1 - Released: Feb 07, 2018 =
55
+
56
+ * New: support to WooCommerce 3.3.1
57
+ * New: support to WordPress 4.9.4
58
+ * Update: plugin framework 3.0.12
59
+
60
+
61
  = Version 1.3.0 - Released: Dec 11, 2017 =
62
 
63
  * Update: YITH Plugin Framework to version 3.0
changelog.txt CHANGED
@@ -2,6 +2,75 @@
2
 
3
  == Changelog History ==
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  = Version 1.2.18 - Released: May 02, 2016 =
6
 
7
  * Updated: plugin compatible with WordPress 4.5
@@ -188,4 +257,4 @@ Full documentation is available [here](http://yithemes.com/docs-plugins/yith_woo
188
 
189
  = 1.0.0 =
190
 
191
- Initial release
2
 
3
  == Changelog History ==
4
 
5
+ = Version 1.3.1 - Released: Feb 07, 2018 =
6
+
7
+ * New: support to WooCommerce 3.3.1
8
+ * New: support to WordPress 4.9.4
9
+ * Update: plugin framework 3.0.12
10
+
11
+
12
+ = Version 1.3.0 - Released: Dec 11, 2017 =
13
+
14
+ * Update: YITH Plugin Framework to version 3.0
15
+ * New: support for WooCommerce 3.2.3
16
+ * New: tested up to WordPress 4.9
17
+
18
+ = Version 1.2.30 - Released: Aug 11, 2017 =
19
+
20
+ * New: support for WooCommerce 3.1.
21
+ * New: tested up to WordPress 4.8.
22
+ * Update: YITH Plugin Framework.
23
+
24
+ = Version 1.2.29 - Released: Apr 30, 2017 =
25
+
26
+ * Update: YITH Plugin Framework.
27
+ * Tweak: tested up to WordPress 4.7.4.
28
+ * Tweak: changed plugin tags.
29
+
30
+ = Version 1.2.28 - Released: Apr 06, 2017 =
31
+
32
+ * Fix: Javascript error when a product variation do not have its own image set.
33
+
34
+ = Version 1.2.27 - Released: Apr 05, 2017 =
35
+
36
+ * Fix: Variation images not shown properly.
37
+
38
+ = Version 1.2.26 - Released: Mar 28, 2017 =
39
+
40
+ * Fix: YITH Plugin Framework initialization that prevents the plugin update.
41
+
42
+ = Version 1.2.25 - Released: Mar 08, 2017 =
43
+
44
+ * Fix: removed unused class.yith-wcmg.php file
45
+ * Fix: removed hook 'admin_print_footer_scripts' in class.yith-wcmg-admin.php
46
+
47
+ = Version 1.2.24 - Released: Mar 06, 2017 =
48
+
49
+ * New: Support to WooCommerce 2.7.0-RC1
50
+ * Update: YITH Plugin Framework
51
+
52
+ = Version 1.2.23 - Released: Jan 16, 2017 =
53
+
54
+ * New: WordPress 4.7 ready
55
+
56
+ = Version 1.2.22 - Released: Nov 08, 2016 =
57
+
58
+ * Updated: Compatibility to WordPress up to 4.6.x
59
+ * Updated: YITH Plugin-fw
60
+
61
+ = Version 1.2.21 - Released: Aug 09, 2016 =
62
+
63
+ * Fixed: Javascript error on property 'msie'
64
+
65
+ = Version 1.2.20 - Released: Jun 13, 2016 =
66
+
67
+ * Added: spanish localization
68
+ * Updated: WooCommerce 2.6 100% compatible
69
+
70
+ = Version 1.2.19 - Released: May 04, 2016 =
71
+
72
+ * Fixed: missing YITH Plugin FW files
73
+
74
  = Version 1.2.18 - Released: May 02, 2016 =
75
 
76
  * Updated: plugin compatible with WordPress 4.5
257
 
258
  = 1.0.0 =
259
 
260
+ Initial release
init.php CHANGED
@@ -3,19 +3,19 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
- * Version: 1.3.0
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
10
  * Domain Path: /languages/
11
  * WC requires at least: 3.0.0
12
- * WC tested up to: 3.2.3
13
  *
14
  * @author Your Inspiration Themes
15
  * @package YITH WooCommerce Magnifier
16
- * @version 1.3.0
17
  */
18
- /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
19
 
20
  This program is free software; you can redistribute it and/or modify
21
  it under the terms of the GNU General Public License, version 2, as
@@ -78,7 +78,7 @@ if ( ! function_exists ( 'yith_plugin_registration_hook' ) ) {
78
  register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
79
 
80
  defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
81
- defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.3.0' );
82
  defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
83
  defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
84
  defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
+ * Version: 1.3.1
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
10
  * Domain Path: /languages/
11
  * WC requires at least: 3.0.0
12
+ * WC tested up to: 3.3.x
13
  *
14
  * @author Your Inspiration Themes
15
  * @package YITH WooCommerce Magnifier
16
+ * @version 1.3.1
17
  */
18
+ /* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
19
 
20
  This program is free software; you can redistribute it and/or modify
21
  it under the terms of the GNU General Public License, version 2, as
78
  register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
79
 
80
  defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
81
+ defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.3.1' );
82
  defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
83
  defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
84
  defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
plugin-fw/assets/css/admin.css CHANGED
@@ -1,3 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /*-----------------------
2
  YITH Plugins Columns
3
  ------------------------*/
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
  ------------------------*/
plugin-fw/assets/css/yit-plugin-panel.css CHANGED
@@ -50,70 +50,6 @@
50
  border-bottom : 1px solid #eee;
51
  }
52
 
53
- /* === VIDEO BOX === */
54
- .yith-videobox-wrapper {
55
- padding-top : 20px;
56
- }
57
-
58
- .yith-videobox-wrapper h3 {
59
- padding : 0px 10px 10px;
60
- border-bottom : 1px solid #eee;
61
- }
62
-
63
- .yith-videobox-wrapper .postbox {
64
- display : inline-block;
65
- }
66
-
67
- .yith-videobox-wrapper .yith_videobox .column {
68
- width : 45%;
69
- float : left;
70
- padding-right : 2.5%;
71
- border-right : 1px solid #ebebeb;
72
- padding-bottom : 2em;
73
- }
74
-
75
- .yith-videobox-wrapper .yith_videobox .column.two {
76
- margin-right : 0;
77
- padding-right : 0;
78
- padding-left : 2.5%;
79
- border : 0;
80
- max-width : 49%;
81
- }
82
-
83
- .yith-videobox-wrapper .yith_videobox h2 {
84
- font-size : 16px;
85
- margin-bottom : 20px;
86
- }
87
-
88
- .yith-videobox-wrapper .yith-video-link {
89
- width : 100%;
90
- max-width : 200px;
91
- float : left;
92
- margin : 0 1.5em 1.5em 0;
93
- }
94
-
95
- .yith-videobox-wrapper .yith-video-link {
96
- width : 100%;
97
- max-width : 200px;
98
- float : left;
99
- margin : 0 1.5em 1.5em 0;
100
- }
101
-
102
- .yith-videobox-wrapper .yith-image-frame img {
103
- max-width : 100%;
104
- height : auto;
105
- }
106
-
107
- .yith-videobox-wrapper .yith-video-link img {
108
- max-width : 100%;
109
- height : auto;
110
- }
111
-
112
- .yith-videobox-wrapper .yith-video-iframe {
113
- display : none;
114
-
115
- }
116
-
117
  /* === Plugins Upgrader === */
118
 
119
  .yit-plugin-changelog-wrapper {
50
  border-bottom : 1px solid #eee;
51
  }
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  /* === Plugins Upgrader === */
54
 
55
  .yit-plugin-changelog-wrapper {
plugin-fw/assets/css/yith-fields.css CHANGED
@@ -27,13 +27,16 @@
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):not(.wp-color-picker),
36
  .yith-plugin-fw select,
 
 
 
37
  .woocommerce .yith-plugin-fw table.form-table select {
38
  width : 400px;
39
  max-width : 100%;
@@ -41,14 +44,29 @@
41
  padding : 5px;
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
44
  .woocommerce .yith-plugin-fw table.form-table input[type=text].colorpick,
45
- .yith-plugin-fw input[type=text].colorpick {
46
- width : 6em;
 
 
 
47
  }
48
 
49
- .woocommerce .yith-plugin-fw input[type=text].select2-search__field {
50
- margin : 10px 0 0 2px;
51
- padding : 0;
 
 
52
  }
53
 
54
  .yith-plugin-fw textarea {
@@ -57,12 +75,6 @@
57
  padding : 5px;
58
  }
59
 
60
- .yith-plugin-fw input[type=email],
61
- .yith-plugin-fw input[type=number],
62
- .yith-plugin-fw input[type=text]:not(.select2-search__field) {
63
- padding : 5px 10px;
64
- }
65
-
66
  /* ------------- ICONS ------------- */
67
  .yit-icons-manager-wrapper {
68
  width : 100%;
@@ -180,37 +192,37 @@ ul.yit-icons-manager-list li.active {
180
  }
181
 
182
  .yith-plugin-fw-onoff-container input + span {
183
- cursor : pointer;
184
- text-indent : -9999px;
185
- display : block;
186
- width: 36px;
187
- height: 20px;
188
- background: #a4a4a4;
189
- border-radius: 24px;
190
- position: relative;
191
- transition: all 0.3s;
192
- }
193
-
194
- .yith-plugin-fw-onoff-container input + span:before{
195
- content: '';
196
- background: #fff;
197
- width:16px;
198
- height: 16px;
199
- border-radius: 50%;
200
- position: absolute;
201
- top:2px;
202
- left:2px;
203
- transition: all 0.3s;
204
  }
205
 
206
  .yith-plugin-fw-onoff-container input:checked + span,
207
  .yith-plugin-fw-onoff-container input.onoffchecked + span {
208
- background: #0073aa;
209
  }
210
 
211
  .yith-plugin-fw-onoff-container input:checked + span:before,
212
  .yith-plugin-fw-onoff-container input.onoffchecked + span:before {
213
- left:18px;
214
  }
215
 
216
  /* ------- Preview ------- */
@@ -319,7 +331,13 @@ ul.yit-icons-manager-list li.active {
319
 
320
  /* ------- Textarea ------- */
321
  .yith-plugin-fw-textarea-editor-field-wrapper {
322
- clear : both;
 
 
 
 
 
 
323
  }
324
 
325
  /* ------- Buttons ------- */
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%;
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 {
75
  padding : 5px;
76
  }
77
 
 
 
 
 
 
 
78
  /* ------------- ICONS ------------- */
79
  .yit-icons-manager-wrapper {
80
  width : 100%;
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 ------- */
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 ------- */
plugin-fw/assets/js/yit-cpt-unlimited.js ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ // open media box
15
+ $('.wrap h1, .wrap h2').on( 'click', 'a.multi-uploader', function(event){
16
+ event.preventDefault();
17
+
18
+ var file_frame,
19
+ button = $(this),
20
+ selected = false;
21
+
22
+ // spinner
23
+ button.next('span.spinner').css( 'display', 'inline-block' );
24
+
25
+ // If the media frame already exists, reopen it.
26
+ if ( file_frame ) {
27
+ file_frame.open();
28
+ return;
29
+ }
30
+
31
+ // Create the media frame.
32
+ file_frame = wp.media.frames.file_frame = wp.media({
33
+ title: button.data( 'uploader_title' ),
34
+ button: {
35
+ text: button.data( 'uploader_button_text' )
36
+ },
37
+ library: {
38
+ type: 'image'
39
+ },
40
+ multiple: true // Set to true to allow multiple files to be selected
41
+ });
42
+
43
+ // When an image is selected, run a callback.
44
+ file_frame.on( 'select', function() {
45
+ var selection = file_frame.state().get('selection'),
46
+ images = [];
47
+
48
+ selection.map( function( attachment ) {
49
+ attachment = attachment.toJSON();
50
+
51
+ // Do something with attachment.id and/or attachment.url here
52
+ images.push( { id: attachment.id, url: attachment.url, title: attachment.title } );
53
+ });
54
+
55
+ // make AJAX request
56
+ $.post( ajaxurl, {
57
+ images: images,
58
+ post_type: typenow,
59
+ action: 'yit_cptu_multiuploader'
60
+ }, function( data ){
61
+ location.reload();
62
+ });
63
+
64
+ button.next('span.spinner').css( 'display', 'inline-block' );
65
+
66
+ // flag
67
+ selected = true;
68
+ });
69
+
70
+ // when close
71
+ file_frame.on( 'close', function() {
72
+ if ( ! selected ) button.next('span.spinner').hide();
73
+ });
74
+
75
+ // Finally, open the modal
76
+ file_frame.open();
77
+ });
78
+
79
+ })(jQuery);
plugin-fw/assets/js/yit-cpt-unlimited.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (function(c){c(".wrap h1, .wrap h2").on("click","a.multi-uploader",function(f){f.preventDefault();var a,b=c(this),d=!1;b.next("span.spinner").css("display","inline-block");a||(a=wp.media.frames.file_frame=wp.media({title:b.data("uploader_title"),button:{text:b.data("uploader_button_text")},library:{type:"image"},multiple:!0}),a.on("select",function(){var e=[];a.state().get("selection").map(function(a){a=a.toJSON();e.push({id:a.id,url:a.url,title:a.title})});c.post(ajaxurl,{images:e,post_type:typenow,action:"yit_cptu_multiuploader"},
2
+ function(a){location.reload()});b.next("span.spinner").css("display","inline-block");d=!0}),a.on("close",function(){d||b.next("span.spinner").hide()}));a.open()})})(jQuery);
plugin-fw/assets/js/yit-plugin-panel.js CHANGED
@@ -125,37 +125,6 @@
125
  } ).disableSelection();
126
  } );
127
 
128
- $( document ).ready( function () {
129
-
130
- $( '.yith-video-link' ).click( function ( event ) {
131
- event.preventDefault();
132
- var target = $( this ).data( 'video-id' );
133
-
134
- $( '.' + target ).dialog( {
135
- dialogClass : 'wp-dialog yit-dialog yit-video-dialog',
136
- modal : true,
137
- closeOnEscape: true,
138
- width : 'auto',
139
- resizable : false,
140
- draggable : false,
141
- create : function ( event, ui ) {
142
- $( this ).css( "maxWidth", "853px" );
143
- },
144
- open : function ( event, ui ) {
145
-
146
- $( '.ui-widget-overlay' ).bind( 'click', function () {
147
- $( this ).siblings( '.ui-dialog' ).find( '.ui-dialog-content' ).dialog( 'close' );
148
- } );
149
-
150
- }
151
-
152
- } );
153
-
154
- $( '.ui-dialog :button' ).blur();
155
-
156
- } );
157
- } );
158
-
159
  //google analytics generation
160
  $( document ).ready( function () {
161
  $( '.google-analytic-generate' ).click( function () {
125
  } ).disableSelection();
126
  } );
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  //google analytics generation
129
  $( document ).ready( function () {
130
  $( '.google-analytic-generate' ).click( function () {
plugin-fw/assets/js/yit-plugin-panel.min.js CHANGED
@@ -1,5 +1,7 @@
1
- (function(a){function h(b,d,c,f){var e=!0;if("string"==typeof d){":radio"==d.substr(0,6)&&(d+=":checked");var g=a(d).val();"checkbox"==a(d).attr("type")&&(g=a(d).is(":checked")?"yes":"no");c=c.split(",");for(d=0;d<c.length;d++)if(g!=c[d])e=!1;else{e=!0;break}}c=a(b);b=a(b+"-container").closest("tr");1>b.length&&(b=c.closest(".yith-plugin-fw-panel-wc-row"));f=f.split("-");for(var h in f)if(g=f[h],e)switch(g){case "disable":b.removeClass("yith-disabled");c.attr("disabled",!1);break;case "hideme":c.show();
2
- break;default:b.show()}else switch(g){case "disable":b.addClass("yith-disabled");c.attr("disabled",!0);break;case "hideme":c.hide();break;default:b.hide()}}a("[data-dep-target]").each(function(){var b=a(this),d="#"+b.data("dep-target"),c="#"+b.data("dep-id"),f=b.data("dep-value"),e=b.data("dep-type");h(d,c,f.toString(),e);a(c).on("change",function(){h(d,c,f.toString(),e)}).change()});a(".rm_connectedlist").each(function(){var b=a(this).find("ul"),d=a(this).find(":hidden");b.sortable({connectWith:b,
3
- update:function(c,f){var e={};b.each(function(){var b={};a(this).children().each(function(){b[a(this).data("option")]=a(this).text()});e[a(this).data("list")]=b});d.val(JSON.stringify(e).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()});a(document).ready(function(){a(".yith-video-link").click(function(b){b.preventDefault();b=a(this).data("video-id");a("."+b).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",resizable:!1,draggable:!1,
4
- create:function(b,c){a(this).css("maxWidth","853px")},open:function(b,c){a(".ui-widget-overlay").bind("click",function(){a(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}});a(".ui-dialog :button").blur()})});a(document).ready(function(){a(".google-analytic-generate").click(function(){var b=a("#"+a(this).data("textarea")).data("codemirrorInstance"),d=a("#"+a(this).data("input")).val(),c=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"+
5
- ("ga('create', '"+d+"', '"+c+"');\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);
 
 
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/init.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.0.0
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
- * @version 3.0.0
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
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.
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-plugin-panel-wc.php CHANGED
@@ -93,7 +93,6 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
93
  if ( !static::$_actions_initialized ) {
94
  /* Add VideoBox and InfoBox */
95
  add_action( 'woocommerce_admin_field_boxinfo', array( __CLASS__, 'add_infobox' ), 10, 1 );
96
- add_action( 'woocommerce_admin_field_videobox', array( __CLASS__, 'add_videobox' ), 10, 1 );
97
 
98
  /* Add YITH Fields */
99
  add_action( 'woocommerce_admin_field_yith-field', array( __CLASS__, 'add_yith_field' ), 10, 1 );
@@ -520,6 +519,10 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
520
  if ( isset( $option[ 'yith-type' ] ) && in_array( $option[ 'yith-type' ], array( 'checkbox', 'onoff' ) ) ) {
521
  $value = yith_plugin_fw_is_true( $raw_value ) ? 'yes' : 'no';
522
  }
 
 
 
 
523
  }
524
 
525
  return $value;
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 );
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;
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -150,9 +150,12 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
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
  // YITH Plugins text must not be translated
155
- 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 );
156
  }
157
  }
158
 
@@ -268,7 +271,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
268
  } else {
269
  if ( isset( $option[ 'id' ] ) ) {
270
  $value = isset( $input[ $option[ 'id' ] ] ) ? $input[ $option[ 'id' ] ] : false;
271
- if ( isset( $option[ 'type' ] ) && in_array( $option[ 'yith-type' ], array( 'checkbox', 'onoff' ) ) ) {
272
  $value = yith_plugin_fw_is_true( $value ) ? 'yes' : 'no';
273
  }
274
  $valid_input[ $option[ 'id' ] ] = $value;
@@ -317,7 +320,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
317
  public function add_premium_version_upgrade_to_menu() {
318
  global $submenu;
319
 
320
- if ( apply_filters( 'yit_show_upgrade_to_premium_version', !isset( $submenu[ 'yit_plugin_panel' ][ 'how_to' ] ) ) ) {
321
  $submenu[ 'yit_plugin_panel' ][ 'how_to' ] = array(
322
  sprintf( '%s%s%s', '<span id="yith-how-to-premium">', __( 'How to install premium version', 'yith-plugin-fw' ), '</span>' ),
323
  'install_plugins',
@@ -360,7 +363,6 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
360
  return;
361
  }
362
  ?>
363
- <?php $this->print_video_box(); ?>
364
  <?php
365
  $panel_content_class = apply_filters( 'yit_admin_panel_content_class', 'yit-admin-panel-content-wrap' );
366
  ?>
@@ -851,36 +853,24 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
851
  /**
852
  * Show a box panel with specific content in two columns as a new woocommerce type
853
  *
 
 
854
  * @param array $args
855
  *
856
  * @return void
857
- * @since 1.0
858
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
859
  */
860
  public static function add_videobox( $args = array() ) {
861
- if ( !empty( $args ) ) {
862
- extract( $args );
863
- require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/videobox.php' );
864
- }
865
  }
866
 
867
  /**
868
  * Fire the action to print the custom tab
869
  *
 
870
  * @return void
871
- * @since 1.0
872
- * @author Antonino Scarfì <antonino.scarfi@yithemes.com>
873
  */
874
  public function print_video_box() {
875
- $file = $this->settings[ 'options-path' ] . '/video-box.php';
876
-
877
- if ( !file_exists( $file ) ) {
878
- return;
879
- }
880
-
881
- $args = include_once( $file );
882
 
883
- $this->add_videobox( $args );
884
  }
885
 
886
  /**
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
 
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;
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',
363
  return;
364
  }
365
  ?>
 
366
  <?php
367
  $panel_content_class = apply_filters( 'yit_admin_panel_content_class', 'yit-admin-panel-content-wrap' );
368
  ?>
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
  /**
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
@@ -169,7 +169,7 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
169
  public function admin_enqueue_scripts() {
170
  global $pagenow;
171
  if ( 'plugins.php' === $pagenow )
172
- yit_enqueue_style( 'yit-upgrader', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrader.css' );
173
  }
174
 
175
  /**
@@ -195,7 +195,8 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
195
  } else {
196
  //Bulk action upgrade
197
  $action_url = parse_url( $upgrader->skin->options[ 'url' ] );
198
- parse_str( rawurldecode( htmlspecialchars_decode( $action_url[ 'query' ] ) ) );
 
199
  $plugins = explode( ',', $plugins );
200
  foreach ( $plugins as $plugin_init ) {
201
  $to_upgrade = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_init );
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
  /**
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 );
plugin-fw/licence/lib/yit-plugin-licence.php CHANGED
@@ -86,7 +86,8 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
86
  * @since 3.0.0
87
  */
88
  public function activate_license_notice() {
89
- if ( apply_filters( 'yith_plugin_fw_show_activate_license_notice', !isset( $_GET[ 'page' ] ) || 'yith_plugins_activation' !== $_GET[ 'page' ] ) ) {
 
90
  $products_to_activate = $this->get_to_active_products();
91
  if ( !!$products_to_activate ) {
92
  $product_names = array();
@@ -104,7 +105,7 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
104
  <div class="notice notice-error">
105
  <p><strong>Warning!</strong> You didn't set license key for the following products:
106
  <?php echo $product_list ?>
107
- which means you're missing out on updates and support. <a href='<?php echo $activation_url ?>'>Enter your license key</a></p>
108
  </div>
109
  <?php
110
  }
@@ -144,11 +145,11 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
144
  */
145
  public function add_submenu_page() {
146
  add_submenu_page(
147
- $this->_settings['parent_page'],
148
- $this->_settings['page_title'],
149
- $this->_settings['menu_title'],
150
- $this->_settings['capability'],
151
- $this->_settings['page'],
152
  array( $this, 'show_activation_panel' )
153
  );
154
  }
@@ -157,8 +158,8 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
157
  * Premium plugin registration
158
  *
159
  * @param $plugin_init | string | The plugin init file
160
- * @param $secret_key | string | The product secret key
161
- * @param $product_id | string | The plugin slug (product_id)
162
  *
163
  * @return void
164
  *
@@ -170,10 +171,10 @@ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
170
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
171
  }
172
 
173
- $plugins = get_plugins();
174
- $plugins[$plugin_init]['secret_key'] = $secret_key;
175
- $plugins[$plugin_init]['product_id'] = $product_id;
176
- $this->_products[$plugin_init] = $plugins[$plugin_init];
177
  }
178
 
179
  public function get_product_type() {
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();
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
  }
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/metaboxes/types/icon-list.php CHANGED
@@ -11,7 +11,7 @@
11
  /**
12
  * Awesome Icon Admin View
13
  *
14
- * @package Yithemes
15
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
16
  * @since 1.0.0
17
  */
@@ -19,119 +19,119 @@
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" class="select_icon rm_option rm_input rm_text" <?php echo yith_field_deps_data( $args ); ?>>
35
  <div id="<?php echo $id ?>-container" <?php echo yith_field_deps_data( $args ); ?>>
36
 
37
- <label for="<?php echo $id ?>"><?php echo $label ?></label>
38
 
39
- <div class="option">
40
- <div class="select_wrapper icon_list_type clearfix">
41
- <select name="<?php echo $name ?>[select]" id="<?php echo $id ?>[select]" <?php if ( isset( $std['select'] ) ) : ?>data-std="<?php echo $std['select']; ?>"<?php endif; ?>>
42
- <?php foreach ( $options['select'] as $val => $option ) : ?>
43
- <option value="<?php echo $val ?>" <?php selected( $current_options['select'], $val ); ?> ><?php echo $option ?></option>
44
- <?php endforeach; ?>
45
- </select>
46
- </div>
47
 
48
 
49
- <div class="icon-manager-wrapper">
50
- <div class="icon-manager-text">
51
- <div class="icon-preview" <?php echo $current_icon ?>></div>
52
- <input type="text" id="<?php echo $id ?>[icon]" class="icon-text" name="<?php echo $name ?>[icon]" value="<?php echo $current_options['icon']; ?>" />
53
- </div>
54
 
55
 
56
- <div class="icon-manager">
57
- <ul class="icon-list-wrapper">
58
- <?php foreach ( $options['icon'] as $font => $icons ):
59
- foreach ( $icons as $key => $icon ): ?>
60
- <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>
61
- <?php
62
- endforeach;
63
- endforeach; ?>
64
- </ul>
 
65
  </div>
66
- </div>
67
 
68
 
69
- <div class="input_wrapper custom_icon_wrapper upload" style="clear:both;">
70
- <input type="text" name="<?php echo $name ?>[custom]" id="<?php echo $id ?>[custom]" value="<?php echo $current_options['custom'] ?>" class="yith-plugin-fw-upload-img-url upload_custom_icon" />
71
- <input type="button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>" id="<?php echo $id; ?>-custom-button" class="yith-plugin-fw-upload-button button" />
72
 
73
- <div class="yith-plugin-fw-upload-img-preview" style="margin-top:10px;">
74
- <?php
75
- $file = $current_options['custom'];
76
- if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
77
- echo __('Image preview', 'yith-plugin-fw') . ': ' . "<img src=\"" . YIT_CORE_ASSETS_URL . "/images/sleep.png\" data-src=\"$file\" />";
78
- }
79
- ?>
 
80
  </div>
81
- </div>
82
 
83
- </div>
84
 
85
- <div class="clear"></div>
86
 
87
 
88
- <div class="description">
89
- <?php echo $desc ?>
90
- <?php if( $std['select'] == 'custom' ) : ?>
91
- <?php printf( __( '(Default: %s <img src="%s"/>)', 'yith-plugin-fw' ), $options['select']['custom'], $std['custom'] ) ?>
92
- <?php else: ?>
93
- <?php printf( __( '(Default: <i %s></i> )', 'yith-plugin-fw' ), $std_icon ) ?>
94
- <?php endif; ?>
95
- </div>
96
 
97
- <div class="clear"></div>
98
 
 
99
  </div>
100
 
101
  <script>
102
 
103
- jQuery(document).ready( function($){
104
 
105
- $('.select_wrapper.icon_list_type').on('change', function(){
106
 
107
- var t = $(this);
108
- var parents = $('#' + t.parents('div.select_icon').attr('id'));
109
- var option = $('option:selected', this).val();
110
- var to_show = option == 'none' ? '' : option == 'icon' ? '.icon-manager-wrapper' : '.custom_icon_wrapper';
111
 
112
- parents.find('.option > div:not(.icon_list_type)').removeClass('show').addClass('hidden');
113
  parents.find( to_show ).removeClass( 'hidden' ).addClass( 'show' );
114
- });
115
 
116
- $('.select_wrapper.icon_list_type').trigger('change');
117
 
118
- var $icon_list = $('.select_icon').find('ul.icon-list-wrapper'),
119
- $preview = $('.icon-preview'),
120
- $element_list = $icon_list.find('li'),
121
- $icon_text = $('.icon-text');
122
 
123
- $element_list.on("click", function () {
124
- var $t = $(this);
125
- $element_list.removeClass('active');
126
- $t.addClass('active');
127
- $preview.attr('data-font', $t.data('font'));
128
- $preview.attr('data-icon', $t.data('icon'));
129
- $preview.attr('data-name', $t.data('name'));
130
- $preview.attr('data-key', $t.data('key'));
131
 
132
- $icon_text.val($t.data('font') + ':' + $t.data('name'));
133
 
134
- });
135
- });
136
 
137
  </script>
11
  /**
12
  * Awesome Icon Admin View
13
  *
14
+ * @package Yithemes
15
  * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
16
  * @since 1.0.0
17
  */
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
  <div id="<?php echo $id ?>-container" class="select_icon rm_option rm_input rm_text" <?php echo yith_field_deps_data( $args ); ?>>
34
  <div id="<?php echo $id ?>-container" <?php echo yith_field_deps_data( $args ); ?>>
35
 
36
+ <label for="<?php echo $id ?>"><?php echo $label ?></label>
37
 
38
+ <div class="option">
39
+ <div class="select_wrapper icon_list_type clearfix">
40
+ <select name="<?php echo $name ?>[select]" id="<?php echo $id ?>[select]" <?php if ( isset( $std[ 'select' ] ) ) : ?>data-std="<?php echo $std[ 'select' ]; ?>"<?php endif; ?>>
41
+ <?php foreach ( $options[ 'select' ] as $val => $option ) : ?>
42
+ <option value="<?php echo $val ?>" <?php selected( $current_options[ 'select' ], $val ); ?> ><?php echo $option ?></option>
43
+ <?php endforeach; ?>
44
+ </select>
45
+ </div>
46
 
47
 
48
+ <div class="icon-manager-wrapper">
49
+ <div class="icon-manager-text">
50
+ <div class="icon-preview" <?php echo $current_icon ?>></div>
51
+ <input type="text" id="<?php echo $id ?>[icon]" class="icon-text" name="<?php echo $name ?>[icon]" value="<?php echo $current_options[ 'icon' ]; ?>"/>
52
+ </div>
53
 
54
 
55
+ <div class="icon-manager">
56
+ <ul class="icon-list-wrapper">
57
+ <?php foreach ( $options[ 'icon' ] as $font => $icons ):
58
+ foreach ( $icons as $key => $icon ): ?>
59
+ <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>
60
+ <?php
61
+ endforeach;
62
+ endforeach; ?>
63
+ </ul>
64
+ </div>
65
  </div>
 
66
 
67
 
68
+ <div class="input_wrapper custom_icon_wrapper upload" style="clear:both;">
69
+ <input type="text" name="<?php echo $name ?>[custom]" id="<?php echo $id ?>[custom]" value="<?php echo $current_options[ 'custom' ] ?>" class="yith-plugin-fw-upload-img-url upload_custom_icon"/>
70
+ <input type="button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>" id="<?php echo $id; ?>-custom-button" class="yith-plugin-fw-upload-button button"/>
71
 
72
+ <div class="yith-plugin-fw-upload-img-preview" style="margin-top:10px;">
73
+ <?php
74
+ $file = $current_options[ 'custom' ];
75
+ if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
76
+ echo __( 'Image preview', 'yith-plugin-fw' ) . ': ' . "<img src=\"" . YIT_CORE_ASSETS_URL . "/images/sleep.png\" data-src=\"$file\" />";
77
+ }
78
+ ?>
79
+ </div>
80
  </div>
 
81
 
82
+ </div>
83
 
84
+ <div class="clear"></div>
85
 
86
 
87
+ <div class="description">
88
+ <?php echo $desc ?>
89
+ <?php if ( $std[ 'select' ] == 'custom' ) : ?>
90
+ <?php printf( __( '(Default: %s <img src="%s"/>)', 'yith-plugin-fw' ), $options[ 'select' ][ 'custom' ], $std[ 'custom' ] ) ?>
91
+ <?php else: ?>
92
+ <?php printf( __( '(Default: <i %s></i> )', 'yith-plugin-fw' ), $std_icon ) ?>
93
+ <?php endif; ?>
94
+ </div>
95
 
96
+ <div class="clear"></div>
97
 
98
+ </div>
99
  </div>
100
 
101
  <script>
102
 
103
+ jQuery( document ).ready( function ( $ ) {
104
 
105
+ $( '.select_wrapper.icon_list_type' ).on( 'change', function () {
106
 
107
+ var t = $( this );
108
+ var parents = $( '#' + t.parents( 'div.select_icon' ).attr( 'id' ) );
109
+ var option = $( 'option:selected', this ).val();
110
+ var to_show = option == 'none' ? '' : option == 'icon' ? '.icon-manager-wrapper' : '.custom_icon_wrapper';
111
 
112
+ parents.find( '.option > div:not(.icon_list_type)' ).removeClass( 'show' ).addClass( 'hidden' );
113
  parents.find( to_show ).removeClass( 'hidden' ).addClass( 'show' );
114
+ } );
115
 
116
+ $( '.select_wrapper.icon_list_type' ).trigger( 'change' );
117
 
118
+ var $icon_list = $( '.select_icon' ).find( 'ul.icon-list-wrapper' ),
119
+ $preview = $( '.icon-preview' ),
120
+ $element_list = $icon_list.find( 'li' ),
121
+ $icon_text = $( '.icon-text' );
122
 
123
+ $element_list.on( "click", function () {
124
+ var $t = $( this );
125
+ $element_list.removeClass( 'active' );
126
+ $t.addClass( 'active' );
127
+ $preview.attr( 'data-font', $t.data( 'font' ) );
128
+ $preview.attr( 'data-icon', $t.data( 'icon' ) );
129
+ $preview.attr( 'data-name', $t.data( 'name' ) );
130
+ $preview.attr( 'data-key', $t.data( 'key' ) );
131
 
132
+ $icon_text.val( $t.data( 'font' ) + ':' + $t.data( 'name' ) );
133
 
134
+ } );
135
+ } );
136
 
137
  </script>
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/yit-plugin.php CHANGED
@@ -36,6 +36,7 @@ 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
 
40
  // load from theme folder...
41
  load_textdomain( 'yith-plugin-fw', get_template_directory() . '/core/plugin-fw/yith-plugin-fw-' . apply_filters( 'plugin_locale', get_locale(), 'yith-plugin-fw' ) . '.mo' )
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' )