YITH WooCommerce Zoom Magnifier - Version 1.3.2

Version Description

Download this release

Release Info

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

Code changes from version 1.3.1 to 1.3.2

README.txt CHANGED
@@ -4,7 +4,7 @@ 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
 
@@ -25,7 +25,7 @@ The Wordpress plugin also adds a slider below the featured image with your produ
25
  * Add a slider showing product image thumbnails.
26
  * Customize the slider behavior.
27
 
28
- For a more detailed list of options and features of the plugin, please look at the [official documentation](http://yithemes.com/docs-plugins/yith_woocommerce_magnifier/ "Yith WooCommerce Zoom Magnifier official documentation").
29
 
30
  Discover all the features of the plugin and install it in your theme: the result will be extremely satisfying.
31
 
@@ -51,13 +51,19 @@ YITH WooCommerce Zoom Magnifier will add a new tab called "Zoom Magnifier" in "Y
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
@@ -132,14 +138,17 @@ If you have suggestions about how to improve YITH WooCommerce Zoom Magnifier, yo
132
  * Spanish
133
 
134
  If you have created your own language pack, or have an update for an existing one, you can send [gettext PO and MO file](http://codex.wordpress.org/Translating_WordPress "Translating WordPress")
135
- [use](http://yithemes.com/contact/ "Your Inspiration Themes") so we can bundle it into YITH WooCommerce Zoom Magnfier Languages.
136
 
137
  == Documentation ==
138
 
139
- Full documentation is available [here](http://yithemes.com/docs-plugins/yith_woocommerce_magnifier/).
140
 
141
  == Upgrade notice ==
142
 
143
- = 1.0.0 =
144
 
145
- Initial release
 
 
 
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.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
25
  * Add a slider showing product image thumbnails.
26
  * Customize the slider behavior.
27
 
28
+ For a more detailed list of options and features of the plugin, please look at the [official documentation](https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/ "Yith WooCommerce Zoom Magnifier official documentation").
29
 
30
  Discover all the features of the plugin and install it in your theme: the result will be extremely satisfying.
31
 
51
 
52
  == Changelog ==
53
 
54
+ = Version 1.3.2 - Released: Mar 06, 2018 =
55
+
56
+ * New: support to WooCommerce 3.3.3
57
+ * Update: plugin framework 3.0.13
58
+ * Fix: Wrong documentation link.
59
+ * Fix: Remove old plugin framework.
60
+
61
  = Version 1.3.1 - Released: Feb 07, 2018 =
62
 
63
  * New: support to WooCommerce 3.3.1
64
  * New: support to WordPress 4.9.4
65
  * Update: plugin framework 3.0.12
66
 
 
67
  = Version 1.3.0 - Released: Dec 11, 2017 =
68
 
69
  * Update: YITH Plugin Framework to version 3.0
138
  * Spanish
139
 
140
  If you have created your own language pack, or have an update for an existing one, you can send [gettext PO and MO file](http://codex.wordpress.org/Translating_WordPress "Translating WordPress")
141
+ [use](https://yithemes.com/contact/ "Your Inspiration Themes") so we can bundle it into YITH WooCommerce Zoom Magnfier Languages.
142
 
143
  == Documentation ==
144
 
145
+ Full documentation is available [here](https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/).
146
 
147
  == Upgrade notice ==
148
 
149
+ = Version 1.3.2 - Released: Mar 06, 2018 =
150
 
151
+ * New: support to WooCommerce 3.3.3
152
+ * Update: plugin framework 3.0.13
153
+ * Fix: Wrong documentation link.
154
+ * Fix: Remove old plugin framework.
changelog.txt CHANGED
@@ -2,75 +2,6 @@
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,4 +188,4 @@ Full documentation is available [here](http://yithemes.com/docs-plugins/yith_woo
257
 
258
  = 1.0.0 =
259
 
260
- Initial release
2
 
3
  == Changelog History ==
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  = Version 1.2.18 - Released: May 02, 2016 =
6
 
7
  * Updated: plugin compatible with WordPress 4.5
188
 
189
  = 1.0.0 =
190
 
191
+ Initial release
class.yith-wcmg-admin.php CHANGED
@@ -35,9 +35,7 @@ if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
35
  * @access public
36
  * @since 1.0.0
37
  */
38
- public $banner_url = 'http://cdn.yithemes.com/plugins/yith_magnifier.php?url';
39
- public $banner_img = 'http://cdn.yithemes.com/plugins/yith_magnifier.php';
40
- public $doc_url = 'http://yithemes.com/docs-plugins/yith_magnifier/';
41
 
42
  /**
43
  * Constructor
@@ -56,9 +54,6 @@ if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
56
 
57
  add_filter( 'woocommerce_catalog_settings', array( $this, 'add_catalog_image_size' ) );
58
 
59
- //Apply filters
60
- $this->banner_url = apply_filters( 'yith_wcmg_banner_url', $this->banner_url );
61
-
62
  // YITH WCMG Loaded
63
  do_action( 'yith_wcmg_loaded' );
64
  }
35
  * @access public
36
  * @since 1.0.0
37
  */
38
+ public $doc_url = 'https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/';
 
 
39
 
40
  /**
41
  * Constructor
54
 
55
  add_filter( 'woocommerce_catalog_settings', array( $this, 'add_catalog_image_size' ) );
56
 
 
 
 
57
  // YITH WCMG Loaded
58
  do_action( 'yith_wcmg_loaded' );
59
  }
init.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
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
@@ -13,7 +13,7 @@
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
 
@@ -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.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__ ) );
@@ -102,13 +102,6 @@ if ( ! function_exists ( 'yith_ywzm_init' ) ) {
102
  */
103
  function yith_ywzm_init () {
104
 
105
- /**
106
- * Required functions
107
- */
108
- if ( ! defined ( 'YITH_FUNCTIONS' ) ) {
109
- require_once ( 'yit-common/yit-functions.php' );
110
- }
111
-
112
  /**
113
  * Load text domain and start plugin
114
  */
1
  <?php
2
  /**
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
+ * Plugin URI: https://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.2
7
  * Author: YITHEMES
8
+ * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
10
  * Domain Path: /languages/
11
  * WC requires at least: 3.0.0
13
  *
14
  * @author Your Inspiration Themes
15
  * @package YITH WooCommerce Magnifier
16
+ * @version 1.3.2
17
  */
18
  /* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
19
 
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.2' );
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__ ) );
102
  */
103
  function yith_ywzm_init () {
104
 
 
 
 
 
 
 
 
105
  /**
106
  * Load text domain and start plugin
107
  */
plugin-fw/assets/css/yit-plugin-panel.css CHANGED
@@ -46,8 +46,8 @@
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 === */
46
  }
47
 
48
  #plugin-fw-wc h3, #yith-plugin-fw-panel h3 {
49
+ padding : 0 0 0 10px;
50
+ margin : 0;
51
  }
52
 
53
  /* === Plugins Upgrader === */
plugin-fw/assets/css/yith-fields.css CHANGED
@@ -55,7 +55,7 @@
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;
@@ -66,7 +66,7 @@
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 {
@@ -230,6 +230,15 @@ ul.yit-icons-manager-list li.active {
230
  max-height : 200px;
231
  }
232
 
 
 
 
 
 
 
 
 
 
233
  /* ------- Sidebar Layout ------- */
234
  .yith-plugin-fw-sidebar-layout input[type="radio"] {
235
  display : none;
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;
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 {
230
  max-height : 200px;
231
  }
232
 
233
+ /* ------- Radio ------- */
234
+ .yith-plugin-fw-radio input[type=radio] {
235
+ margin : 0 3px 0 0;
236
+ }
237
+
238
+ .yith-plugin-fw-radio__row {
239
+ margin-bottom : 8px;
240
+ }
241
+
242
  /* ------- Sidebar Layout ------- */
243
  .yith-plugin-fw-sidebar-layout input[type="radio"] {
244
  display : none;
plugin-fw/init.php CHANGED
@@ -1,13 +1,13 @@
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.
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 3.0.13
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
+ * @version 3.0.13
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -604,8 +604,11 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
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
  }
604
  return $this->_main_array_options;
605
  }
606
 
607
+ $options_path = $this->settings[ 'options-path' ];
608
+
609
  foreach ( $this->settings[ 'admin-tabs' ] as $item => $v ) {
610
+ $path = $options_path . '/' . $item . '-options.php';
611
+ $path = apply_filters( 'yith_plugin_panel_item_options_path', $path, $options_path, $item, $this );
612
  if ( file_exists( $path ) ) {
613
  $this->_main_array_options = array_merge( $this->_main_array_options, include $path );
614
  }
plugin-fw/lib/yit-upgrade.php CHANGED
@@ -103,6 +103,7 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
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 ) {
@@ -111,9 +112,18 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
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
 
103
  $xml = str_replace( '%plugin_slug%', $plugin_slug, $this->_xml );
104
  $remote_xml = wp_remote_get( $xml );
105
 
106
+ $error = false;
107
  if ( !is_wp_error( $remote_xml ) && isset( $remote_xml[ 'response' ][ 'code' ] ) && '200' == $remote_xml[ 'response' ][ 'code' ] ) {
108
  $plugin_remote_info = @simplexml_load_string( $remote_xml[ 'body' ] );
109
  if ( $plugin_remote_info ) {
112
  YIT_Plugin_Licence()->check( $plugin_slug, false );
113
  set_transient( $transient, $info, DAY_IN_SECONDS );
114
  } else {
115
+ $error = true;
116
  error_log( sprintf( 'SimpleXML error in %s:%s [plugin slug: %s]',
117
  __FILE__, __FUNCTION__, $plugin_slug ) );
118
  }
119
+ } else {
120
+ $error = true;
121
+ }
122
+
123
+ if ( $error ) {
124
+ // If error, set empty value in the transient to prevent multiple requests
125
+ $info = array( 'Latest' => '', 'changelog' => '' );
126
+ set_transient( $transient, $info, HOUR_IN_SECONDS );
127
  }
128
  }
129
 
plugin-fw/templates/fields/radio.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ /** @since 3.0.13 */
14
+
15
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
16
+
17
+ extract( $field );
18
+
19
+ $class = isset( $class ) ? $class : '';
20
+ $class = 'yith-plugin-fw-radio ' . $class;
21
+ ?>
22
+ <div class="<?php echo $class ?>" id="<?php echo $id ?>"
23
+ <?php echo $custom_attributes ?>
24
+ <?php if ( isset( $data ) ) echo yith_plugin_fw_html_data_to_string( $data ); ?> value="<?php echo $value ?>">
25
+ <?php foreach ( $options as $key => $label ) :
26
+ $radio_id = sanitize_key( $id . '-' . $key );
27
+ ?>
28
+ <div class="yith-plugin-fw-radio__row">
29
+ <input type="radio" id="<?php echo $radio_id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $key ) ?>" <?php checked( $key, $value ); ?> />
30
+ <label for="<?php echo $radio_id ?>"><?php echo $label ?></label>
31
+ </div>
32
+ <?php endforeach; ?>
33
+ </div>
yit-common/assets/css/yith-panel.css DELETED
@@ -1,78 +0,0 @@
1
- /* typography */
2
- .typography_container {
3
- padding-bottom:0px;
4
- }
5
- .typography_container .option {
6
- width: 100%;
7
- }
8
- .typography_container input {
9
- float:left;
10
- margin-right:14px;
11
- }
12
-
13
- .typography_container .select-wrapper {
14
- float: left;
15
- width: 150px;
16
- margin-right: 10px;
17
- margin-bottom: 0px !important;
18
- }
19
- .typography_container .select-wrapper.font-unit {
20
- width: 61px;
21
- }
22
- .typography_container .ui-spinner-buttons {
23
- top: 0px !important;
24
- }
25
- .typography_container .select-wrapper.font-style {
26
- width: 93px;
27
- }
28
- .typography_container .select-wrapper select {
29
- width:100%;
30
- }
31
-
32
- .typography_container .font-preview {
33
- border: 1px dashed #ddd;
34
- -webkit-border-radius: 10px;
35
- -moz-border-radius: 10px;
36
- border-radius: 10px;
37
- margin: 10px 0;
38
- padding: 20px;
39
- position: relative;
40
- }
41
- .typography_container .font-preview .refresh_container {
42
- background: rgba(255,255,255,0.82);
43
- -webkit-border-radius: 10px;
44
- -moz-border-radius: 10px;
45
- border-radius: 10px;
46
- position: absolute;
47
- left: 0;
48
- top: 0;
49
- width: 100%;
50
- height: 100%;
51
- z-index: 0;
52
- }
53
- .typography_container button.refresh {
54
- /*background: #F2F2F2 url(../images/white-grad.png) repeat-x scroll left top;*/
55
- border: 1px solid #BBB;
56
- -webkit-border-radius: 11px;
57
- border-radius: 11px;
58
- -moz-box-sizing: content-box;
59
- -webkit-box-sizing: content-box;
60
- box-sizing: content-box;
61
- color: #464646;
62
- cursor: pointer;
63
- font-size: 12px!important;
64
- line-height: 6px;
65
- margin: -16px 0px 0px -105px;
66
- padding: 3px 19px;
67
- position: absolute;
68
- text-shadow: rgba(255, 255, 255, 1) 0 1px 0;
69
- text-decoration: none;
70
- top: 50%;
71
- left: 50%;
72
- width: auto;
73
- height: 18px;
74
- }
75
- .typography_container button.refresh img {
76
- margin-right: 5px;
77
- vertical-align: middle;
78
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
yit-common/assets/js/google_fonts.json DELETED
@@ -1 +0,0 @@
1
- {"items":["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Asap","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda:300","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Caudex","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption:800","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Federant","Federo","Felipa","Fenix","Finger Paint","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Habibi","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Irish Grover","Istok Web","Italiana","Italianno","Jacques Francois","Jacques Francois Shadow","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kameron","Karla","Kaushan Script","Kavoon","Keania One","Kelly Slab","Kenia","Khmer","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","La Belle Aurore","Lancelot","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modern Antiqua","Molengo","Molle:italic","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed:300","Open Sans Condensed:300italic","Open Sans Condensed:700","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Paprika","Parisienne","Passero One","Passion One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Port Lligat Sans","Port Lligat Slab","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Raleway","Raleway Dots","Rambla","Rammetto One","Ranchers","Rancho","Rationale","Redressed","Reenie Beanie","Revalia","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarina","Satisfy","Scada","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slackey","Smokum","Smythe","Sniglet:800","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sunshiney","Supermercado One","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Telex","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook:700","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Yanone Kaffeesatz","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}
 
yit-common/assets/js/yith-panel.js DELETED
@@ -1,302 +0,0 @@
1
- jQuery(document).ready(function($){
2
-
3
- //image uploader
4
- var _custom_media = true,
5
- _orig_send_attachment = wp.media.editor.send.attachment;
6
-
7
- $('.uploader .button').click(function(e) {
8
- var send_attachment_bkp = wp.media.editor.send.attachment;
9
- var button = $(this);
10
- var id = button.attr('id').replace('_button', '');
11
- _custom_media = true;
12
- wp.media.editor.send.attachment = function(props, attachment){
13
- if ( _custom_media ) {
14
- $("#"+id).val(attachment.url);
15
- } else {
16
- return _orig_send_attachment.apply( this, [props, attachment] );
17
- };
18
- }
19
-
20
- wp.media.editor.open(button);
21
- return false;
22
- });
23
-
24
- $('.add_media').on('click', function(){
25
- _custom_media = false;
26
- });
27
-
28
- //color-picker
29
- $('.panel-colorpicker').wpColorPicker({
30
- change: function(event, ui){
31
- $('#'+event.target.id).parents('.typography_container').find('.font-preview > p').css('color', ui.color.toString());
32
- }
33
- });
34
-
35
- //typography
36
- $('.typography_container').yit_panel_typography();
37
-
38
- //datepicker
39
- $('.panel-datepicker').datepicker({
40
- showOtherMonths: true,
41
- selectOtherMonths: true,
42
- numberOfMonths: 2,
43
- minDate: 0
44
- });
45
-
46
- //skin
47
- $('select.skin').on('change', function(){
48
- var img_path = $(this).data('path');
49
- $(this).siblings('.skin-preview').html('<img src="'+ img_path + $(this).val() + '.jpg' +'" alt="preview" />');
50
- }).change();
51
- });
52
-
53
- // typography
54
- (function( window, $, undefined ) {
55
-
56
- $.yit_panel_typography = function( options, element ) {
57
- this.element = $( element );
58
- this._init( options );
59
- };
60
-
61
- $.yit_panel_typography.defaults = {
62
- elements : {
63
- size: '.typography_size',
64
- unit: '.typography_unit',
65
- family: '.typography_family',
66
- style: '.typography_style',
67
- color: '.typography_color',
68
- preview: '.font-preview p',
69
- refresh: '.refresh'
70
- }
71
- };
72
-
73
- $.yit_panel_typography.prototype = {
74
- _init : function( options ) {
75
- this.options = $.extend( true, {}, $.yit_panel_typography.defaults, options );
76
-
77
- //init the options string
78
- if( yit_family_string == '' ) {
79
- //web fonts
80
- var web_fonts = $.parseJSON(yit_web_fonts);
81
- yit_family_string += '<optgroup label="Web Fonts">';
82
- $.each(web_fonts.items, function(i,v){
83
- yit_family_string += '<option>' + v + '</option>';
84
- });
85
- yit_family_string += '</optgroup>';
86
-
87
- //google fonts
88
- var google_fonts = $.parseJSON(yit_google_fonts);
89
- yit_family_string += '<optgroup label="Google Fonts">';
90
- $.each(google_fonts.items, function(i,v){
91
- yit_family_string += '<option>' + v + '</option>';
92
- });
93
- yit_family_string += '</optgroup>';
94
- }
95
-
96
- this._loadElements();
97
- this._initEvents();
98
- },
99
-
100
- _loadElements : function() {
101
- var elements = this.options.elements;
102
- var container = this.element;
103
-
104
- for( var el in elements) {
105
- elements[el] = container.find( elements[el] );
106
- }
107
- },
108
-
109
- _initEvents : function() {
110
- var elements = this.options.elements;
111
- var self = this;
112
-
113
- //refresh
114
- var refresh = elements.refresh;
115
- refresh.on('click', function(e){
116
- e.preventDefault();
117
-
118
- $(this).parent().fadeOut( 'slow' );
119
-
120
- //Set current value, before trigger change event
121
-
122
- //Color
123
- elements.preview.css( 'color', elements.color.val() );
124
-
125
- //Font size
126
- var size = elements.size.val();
127
- var unit = elements.unit.val();
128
-
129
- elements.preview.css( 'font-size', size + unit );
130
- elements.preview.css( 'line-height', ( unit == 'em' || unit == 'rem' ? Number( size ) + 0.4 : Number ( size ) + 4 ) + unit );
131
-
132
- //Font style
133
- var style = elements.style.val();
134
-
135
- if( style == 'italic' ) {
136
- elements.preview.css({ 'font-weight' : 'normal', 'font-style' : 'italic' });
137
- } else if( style == 'bold' ) {
138
- elements.preview.css({ 'font-weight' : 'bold', 'font-style' : 'normal' });
139
- } else if( style == 'extra-bold' ) {
140
- elements.preview.css({ 'font-weight' : '800', 'font-style' : 'normal' });
141
- } else if( style == 'bold-italic' ) {
142
- elements.preview.css({ 'font-weight' : 'bold', 'font-style' : 'italic' });
143
- } else {
144
- elements.preview.css({ 'font-weight' : 'normal', 'font-style' : 'normal' });
145
- }
146
-
147
- //Font Family
148
- var group = elements.family.find( 'option:selected' ).parent().attr( 'label' );
149
-
150
- if( group == 'Web fonts' ) {
151
- //Web font
152
- elements.preview.css( 'font-family', elements.family.val() );
153
- } else {
154
- //Google font
155
- WebFontConfig = {
156
- google: {
157
- families: [ elements.family.find('option:selected' ).text() ] },
158
- fontactive: function( fontFamily, fontDescription ) {
159
- elements.preview.css( 'font-family', fontFamily );
160
- }
161
- };
162
-
163
- (function() {
164
- var wf = document.createElement('script');
165
- wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
166
- '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
167
- wf.type = 'text/javascript';
168
- wf.async = 'true';
169
-
170
- var s = document.getElementsByTagName('script')[0];
171
- s.parentNode.insertBefore(wf, s);
172
- })();
173
- }
174
- });
175
-
176
- //font size, font unit
177
- $([elements.size, elements.unit]).each(function(){
178
- $(this).on('change', function(){
179
- if( elements.refresh.is( ':visible' ) ) { return; }
180
-
181
- var size = elements.size.val();
182
- var unit = elements.unit.val();
183
-
184
- elements.preview.css({
185
- 'font-size' : size + unit,
186
- 'line-height' : ( unit == 'em' || unit == 'rem' ? Number( size ) + 0.4 : Number ( size ) + 4 ) + unit
187
- }).trigger( 'resize' );
188
- });
189
- });
190
-
191
- //font family
192
- var family = elements.family;
193
- family.on('mousedown', function(e){
194
- var t = $(this);
195
- if(t.data('instance') == false) {
196
- var currentElement = {
197
- 'value' : t.val(),
198
- 'text' : t.find('option:selected').text()
199
- };
200
-
201
- t.html(yit_family_string)
202
- .find('option')
203
- .filter(function(){
204
- return $(this).text() == currentElement.text;
205
- }).attr('selected', true);
206
-
207
- t.data('instance', 'true');
208
- }
209
- });
210
- family.on('change', function(){
211
- if( elements.refresh.is( ':visible' ) ) { return; }
212
-
213
- var group = $( this ).find( 'option:selected' ).parent().attr( 'label' );
214
-
215
- if( group == 'Web fonts' ) {
216
- //Web font
217
- elements.preview.css( 'font-family', $( this ).val() );
218
- } else {
219
- //Google font
220
- WebFontConfig = {
221
- google: {
222
- families: [ $( this ).val() ]
223
- },
224
- fontactive: function( fontFamily, fontDescription ) {
225
- elements.preview.css( 'font-family', fontFamily );
226
- }
227
- };
228
-
229
- (function() {
230
- var wf = document.createElement('script');
231
- wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
232
- '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
233
- wf.type = 'text/javascript';
234
- wf.async = 'true';
235
-
236
- var s = document.getElementsByTagName('script')[0];
237
- s.parentNode.insertBefore(wf, s);
238
- })();
239
- }
240
-
241
- elements.preview.trigger( 'resize' );
242
- });
243
-
244
- elements.style.on('change', function(){
245
- if( elements.refresh.is( ':visible' ) ) { return; }
246
-
247
- var style = $( this ).val();
248
-
249
- if( style == 'italic' ) {
250
- elements.preview.css({ 'font-weight' : 'normal', 'font-style' : 'italic' });
251
- } else if( style == 'bold' ) {
252
- elements.preview.css({ 'font-weight' : 'bold', 'font-style' : 'normal' });
253
- } else if( style == 'extra-bold' ) {
254
- elements.preview.css({ 'font-weight' : '800', 'font-style' : 'normal' });
255
- } else if( style == 'bold-italic' ) {
256
- elements.preview.css({ 'font-weight' : 'bold', 'font-style' : 'italic' });
257
- } else {
258
- elements.preview.css({ 'font-weight' : 'normal', 'font-style' : 'normal' });
259
- }
260
-
261
- elements.preview.trigger( 'resize' );
262
- });
263
-
264
- //preview
265
- elements.preview.resize(function(){
266
- var box = $(this).parents('.yit-box');
267
- $(this).parents('form').height( box.height() );
268
- });
269
- }
270
- };
271
-
272
- $.fn.yit_panel_typography = function( options ) {
273
- if ( typeof options === 'string' ) {
274
- var args = Array.prototype.slice.call( arguments, 1 );
275
-
276
- this.each(function() {
277
- var instance = $.data( this, 'yit_panel_typography' );
278
- if ( !instance ) {
279
- console.error( "cannot call methods on yit_checkout prior to initialization; " +
280
- "attempted to call method '" + options + "'" );
281
- return;
282
- }
283
- if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
284
- console.error( "no such method '" + options + "' for yit_panel_typography instance" );
285
- return;
286
- }
287
- instance[ options ].apply( instance, args );
288
- });
289
- }
290
- else {
291
- this.each(function() {
292
- var instance = $.data( this, 'yit_panel_typography' );
293
- if ( !instance ) {
294
- $.data( this, 'yit_panel_typography', new $.yit_panel_typography( options, this ) );
295
- }
296
- });
297
- }
298
- return this;
299
- };
300
-
301
-
302
- })( window, jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
yit-common/google_fonts.php DELETED
@@ -1,68 +0,0 @@
1
- <?php
2
- /**
3
- * Google font management
4
- */
5
-
6
- $yith_google_fonts = new Google_Font();
7
-
8
- class Google_Font {
9
-
10
- /**
11
- * @var array The google fonts to include in the page
12
- */
13
- public $google_fonts = array();
14
-
15
- /**
16
- * Generate the url for the google fonts
17
- */
18
- public function google_fonts_url() {
19
- $base_url = 'http://fonts.googleapis.com/css?family=';
20
- $fonts = array();
21
-
22
- if ( empty( $this->google_fonts ) ) return;
23
-
24
- foreach ( $this->google_fonts as $font => $variants ) {
25
- $fonts[] = urlencode( $font . ':' . implode( ',', $variants ) );
26
- }
27
-
28
- return $base_url . implode( '|', $fonts );
29
- }
30
-
31
- /**
32
- * Add a new google font in queue
33
- *
34
- * @param $font The name of google font
35
- * @param array $variants The variatns for the google font to add
36
- */
37
- public function add_google_font( $font, $variants = array() ) {
38
- if ( ! is_array( $variants ) ) $variants = array( $variants );
39
-
40
- foreach ( $variants as $variant ) {
41
- if ( ! isset( $this->google_fonts[$font] ) ) $this->google_fonts[$font] = array( 300, 400 );
42
- if ( ! in_array( $variant, $this->google_fonts[$font] ) ) $this->google_fonts[$font][] = $variant;
43
- }
44
- }
45
- }
46
-
47
- if ( ! function_exists( 'yith_add_google_font' ) ) {
48
- /**
49
- * Add a new google font in queue
50
- *
51
- * @param $font The name of google font
52
- * @param array $variant The variatns for the google font to add
53
- */
54
- function yith_add_google_font( $font, $variant = array() ) {
55
- global $yith_google_fonts;
56
- $yith_google_fonts->add_google_font( $font, $variant );
57
- }
58
- }
59
-
60
- if ( ! function_exists( 'yith_google_fonts_url' ) ) {
61
- /**
62
- * @return string The url with the google fonts to load
63
- */
64
- function yith_google_fonts_url() {
65
- global $yith_google_fonts;
66
- return $yith_google_fonts->google_fonts_url();
67
- }
68
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
yit-common/yit-functions.php DELETED
@@ -1,233 +0,0 @@
1
- <?php
2
- /**
3
- * Your Inspiration Themes common functions
4
- *
5
- * @author Your Inspiration Themes
6
- * @version 0.0.1
7
- */
8
-
9
- define( 'YITH_FUNCTIONS', true);
10
-
11
- /* === Include Common Framework File === */
12
- require_once( 'google_fonts.php' );
13
- require_once( 'yith-panel.php' );
14
-
15
- if ( ! function_exists( 'yit_is_woocommerce_active' ) ) {
16
- /**
17
- * WC Detection
18
- */
19
- function yit_is_woocommerce_active() {
20
- $active_plugins = (array) get_option( 'active_plugins', array() );
21
-
22
- if ( is_multisite() ) {
23
- $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
24
- }
25
-
26
- $woo = yit_get_plugin_basename_from_slug( 'woocommerce' );
27
- return in_array( $woo, $active_plugins ) || array_key_exists( $woo, $active_plugins );
28
- }
29
- }
30
-
31
- if( ! function_exists( 'yit_get_plugin_basename_from_slug' ) ) {
32
- /**
33
- * Helper function to extract the file path of the plugin file from the
34
- * plugin slug, if the plugin is installed.
35
- *
36
- * @param string $slug Plugin slug (typically folder name) as provided by the developer
37
- * @return string Either file path for plugin if installed, or just the plugin slug
38
- */
39
- function yit_get_plugin_basename_from_slug( $slug ) {
40
- include_once ABSPATH . '/wp-admin/includes/plugin.php';
41
-
42
- $keys = array_keys( get_plugins() );
43
-
44
- foreach ( $keys as $key ) {
45
- if ( preg_match( '|^' . $slug .'|', $key ) )
46
- return $key;
47
- }
48
-
49
- return $slug;
50
- }
51
- }
52
-
53
- if( ! function_exists( 'yith_debug') ) {
54
- /**
55
- * Debug helper function. This is a wrapper for var_dump() that adds
56
- * the <pre /> tags, cleans up newlines and indents, and runs
57
- * htmlentities() before output.
58
- *
59
- * @param mixed $var The variable to dump.
60
- * @param mixed $var2 The second variable to dump
61
- * @param ...
62
- * @return string
63
- */
64
- function yith_debug() {
65
- $args = func_get_args();
66
- if( !empty( $args ) ) {
67
- foreach( $args as $k=>$arg ) {
68
- // var_dump the variable into a buffer and keep the output
69
- ob_start();
70
- var_dump($arg);
71
- $output = ob_get_clean();
72
-
73
- // neaten the newlines and indents
74
- $output = preg_replace("/\]\=\>\n(\s+)/m", "] => ", $output);
75
-
76
- if(!extension_loaded('xdebug')) {
77
- $output = htmlspecialchars($output, ENT_QUOTES);
78
- }
79
-
80
- $output = '<pre class="yit-debug">'
81
- . '<strong>$param_' . ($k+1) . ": </strong>"
82
- . $output
83
- . '</pre>';
84
- echo $output;
85
- }
86
- } else {
87
- trigger_error("yit_debug() expects at least 1 parameter, 0 given.", E_USER_WARNING);
88
- }
89
-
90
- return $args;
91
- }
92
- }
93
-
94
-
95
- if( ! function_exists('yit_get_options_from_prefix') ) {
96
- /**
97
- * Returns an array of all options that starts with a prefix
98
- *
99
- * @param string $prefix
100
- * @return array
101
- */
102
- function yit_get_options_from_prefix( $prefix ) {
103
- if( !$prefix ) return array();
104
-
105
- global $wpdb;
106
-
107
- $sql = "SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE '{$prefix}%'";
108
- $options = $wpdb->get_col( $sql );
109
- $return = array();
110
-
111
- foreach( $options as $option ) {
112
- $return[$option] = get_option( $option );
113
- }
114
-
115
- return $return;
116
- }
117
- }
118
-
119
- if( !function_exists('yit_wp_roles') ) {
120
- /**
121
- * Returns the roles of the site.
122
- *
123
- * @return array
124
- * @since 1.0.0
125
- */
126
- function yit_wp_roles() {
127
- global $wp_roles;
128
-
129
- if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles();
130
-
131
- $roles = array();
132
- foreach( $wp_roles->roles as $k=>$role ) {
133
- $roles[$k] = $role['name'];
134
- }
135
-
136
- return $roles;
137
- }
138
- }
139
-
140
- if( !function_exists('yit_user_roles') ) {
141
- /**
142
- * Returns the roles of the user
143
- *
144
- * @param int $user_id (Optional) The ID of a user. Defaults to the current user.
145
- * @return array()
146
- * @since 1.0.0
147
- */
148
- function yit_user_roles( $user_id = null ) {
149
- if ( is_numeric( $user_id ) )
150
- $user = get_userdata( $user_id );
151
- else
152
- $user = wp_get_current_user();
153
-
154
- if ( empty( $user ) )
155
- return false;
156
-
157
- return (array) $user->roles;
158
- }
159
- }
160
-
161
-
162
- // ADMIN
163
- if( !function_exists('yit_typo_option_to_css') ) {
164
- /**
165
- * Change the typography option saved in database to attributes for css
166
- *
167
- * @param array $option The option as saved in the database
168
- * @return string
169
- * @since 1.0.0
170
- */
171
- function yit_typo_option_to_css( $option ) {
172
- $attrs = $variant = array();
173
-
174
- extract( $option );
175
- $attrs[] = "color: $color;";
176
- $attrs[] = "font-size: {$size}{$unit};";
177
- $attrs[] = "font-family: '{$family}';";
178
- switch ( $style ) {
179
- case 'regular':
180
- $attrs[] = 'font-weight: 400;';
181
- $attrs[] = 'font-style: normal;';
182
- $variant = 400;
183
- break;
184
- case 'bold':
185
- $attrs[] = 'font-weight: 700;';
186
- $attrs[] = 'font-style: normal;';
187
- $variant = 700;
188
- break;
189
- case 'extra-bold':
190
- $attrs[] = 'font-weight: 800;';
191
- $attrs[] = 'font-style: normal;';
192
- $variant = 800;
193
- break;
194
- case 'italic':
195
- $attrs[] = 'font-weight: 400;';
196
- $attrs[] = 'font-style: italic;';
197
- $variant = 400;
198
- break;
199
- case 'bold-italic':
200
- $attrs[] = 'font-weight: 700;';
201
- $attrs[] = 'font-style: italic;';
202
- $variant = 700;
203
- break;
204
- }
205
-
206
- yith_add_google_font( $family, $variant );
207
-
208
- return implode( "\n", $attrs ) . "\n";
209
- }
210
- }
211
-
212
-
213
- if( !function_exists('yit_curPageURL') ) {
214
- /**
215
- * Retrieve the current complete url
216
- *
217
- * @since 1.0
218
- */
219
- function yit_curPageURL() {
220
- $pageURL = 'http';
221
- if ( isset( $_SERVER["HTTPS"] ) AND $_SERVER["HTTPS"] == "on" )
222
- $pageURL .= "s";
223
-
224
- $pageURL .= "://";
225
-
226
- if ( isset( $_SERVER["SERVER_PORT"] ) AND $_SERVER["SERVER_PORT"] != "80" )
227
- $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
228
- else
229
- $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
230
-
231
- return $pageURL;
232
- }
233
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
yit-common/yith-panel.php DELETED
@@ -1,566 +0,0 @@
1
- <?php
2
- /**
3
- * Your Inspiration Themes Panel
4
- *
5
- * @author Your Inspiration Themes
6
- * @version 0.1.0
7
- */
8
-
9
- if (!class_exists('YITH_Panel')) {
10
- /*
11
- * The class manages the theme options for the Plugin
12
- */
13
-
14
- class YITH_Panel
15
- {
16
-
17
- /**
18
- * Class version
19
- *
20
- * @var string
21
- */
22
- public $version = '0.1.0';
23
-
24
- /**
25
- * Parameters for add_submenu_page
26
- *
27
- * add_submenu_page(
28
- * 'themes.php', // The file name of a standard WordPress admin page
29
- * 'Theme Options', // The text to be displayed in the title tags of the page when the menu is selected
30
- * 'Theme Options', // The text to be used for the menu
31
- * 'administrator', // The capability (or role) required for this menu to be displayed to the user.
32
- * 'theme-options', // The slug name to refer to this menu by (should be unique for this menu).
33
- * 'theme_options_display_page' // The function to be called to output the content for this page.
34
- * );
35
- *
36
- * @access protected
37
- */
38
- protected $_submenu = array();
39
-
40
- /**
41
- * Initial Options definition:
42
- * 'tab' => array(
43
- * 'label',
44
- * 'sections' => array(
45
- * 'fields' => array(
46
- * 'option1',
47
- * 'option2',
48
- * ...
49
- * )
50
- * )
51
- * )
52
- *
53
- * @var array
54
- * @access public
55
- */
56
- public $options = array();
57
-
58
- /**
59
- * Options group name
60
- *
61
- * @var string
62
- * @access public
63
- */
64
- public $option_group = 'panel_group';
65
-
66
- /**
67
- * Option name
68
- *
69
- * @var string
70
- * @access public
71
- */
72
- public $option_name = 'panel_options';
73
-
74
- /**
75
- * Banner links
76
- *
77
- * @var string
78
- * @access public
79
- */
80
- public $banner_url = 'http://yithemes.com/?ap_id=plugin';
81
- public $banner_img = '';
82
-
83
- /**
84
- * Constructor
85
- *
86
- * @param array $submenu Parameters for add_submenu_page
87
- * @param array $options Array of plugin options
88
- *
89
- */
90
- public function __construct($submenu, $options, $banner = array(), $option_group = false, $option_name = false)
91
- {
92
- $this->_submenu = apply_filters('yith_panel_submenu', $submenu);
93
- $this->options = apply_filters('yith_panel_options', $options);
94
-
95
- if (!empty($banner)) {
96
- $this->banner_url = $banner['url'];
97
- $this->banner_img = $banner['img'];
98
- }
99
-
100
- if ($option_group) {
101
- $this->option_group = $option_group;
102
- }
103
-
104
- if ($option_name) {
105
- $this->option_name = $option_name;
106
- }
107
-
108
- //add new menu item
109
- //register new settings option group
110
- //include js and css files
111
- //print browser
112
- add_action('admin_menu', array($this, 'add_submenu_page'));
113
- add_action('admin_init', array($this, 'panel_register_setting'));
114
- add_action('admin_enqueue_scripts', array($this, 'panel_enqueue'));
115
-
116
- // add the typography javascript vars
117
- add_action('yith_panel_after_panel', array($this, 'js_typo_vars'));
118
- }
119
-
120
- /**
121
- * Create new submenu page
122
- *
123
- * @return void
124
- * @access public
125
- * @link http://codex.wordpress.org/Function_Reference/add_submenu_page
126
- */
127
- public function add_submenu_page()
128
- {
129
- $submenu = $this->_submenu;
130
- add_submenu_page(
131
- $submenu[0],
132
- $submenu[1],
133
- $submenu[2],
134
- $submenu[3],
135
- $submenu[4],
136
- array($this, isset($submenu[5]) ? $submenu[5] : 'display_panel_page')
137
- );
138
- }
139
-
140
- /**
141
- * Print the Panel page
142
- *
143
- * @return void
144
- * @access public
145
- */
146
- public function display_panel_page()
147
- {
148
- // Create a header in the default WordPress 'wrap' container
149
- $page = $this->_get_tab();
150
- ?>
151
- <div id="icon-themes" class="icon32"><br/></div>
152
- <h2 class="nav-tab-wrapper">
153
- <?php foreach ($this->options as $k => $tab): ?>
154
- <a class="nav-tab<?php if ($page == $k): ?> nav-tab-active<?php endif ?>"
155
- href="<?php echo esc_url(add_query_arg('panel_page', $k)); ?>"><?php echo $tab['label'] ?></a>
156
- <?php endforeach ?>
157
- <?php do_action('yith_panel_after_tabs'); ?>
158
- </h2>
159
-
160
- <div class="wrap">
161
- <?php $this->printBanner() ?>
162
- <?php do_action('yith_panel_before_panel'); ?>
163
- <form action="options.php" method="post">
164
-
165
- <?php do_settings_sections($this->option_name); ?>
166
- <?php settings_fields($this->option_group) ?>
167
-
168
- <p class="submit">
169
- <input type="hidden" name="panel_page" value="<?php echo $page ?>"/>
170
- <input class="button-primary" type="submit" name="save_options" value="Save Options"/>
171
- </p>
172
- </form>
173
- <?php do_action('yith_panel_after_panel'); ?>
174
- </div>
175
- <?php
176
- }
177
-
178
- /**
179
- * Add the vars for the typography options
180
- */
181
- public function js_typo_vars()
182
- {
183
- global $yith_panel_if_typography;
184
- if (!isset($yith_panel_if_typography) || !$yith_panel_if_typography) {
185
- return;
186
- }
187
-
188
- $web_fonts = array(
189
- "Arial",
190
- "Arial Black",
191
- "Comic Sans MS",
192
- "Courier New",
193
- "Georgia",
194
- "Impact",
195
- "Lucida Console",
196
- "Lucida Sans Unicode",
197
- "Thaoma",
198
- "Trebuchet MS",
199
- "Verdana"
200
- );
201
-
202
- // http://niubbys.altervista.org/google_fonts.php
203
- $google_fonts = file_get_contents(dirname(__FILE__) . '/assets/js/google_fonts.json');
204
- ?>
205
- <script type="text/javascript">
206
- var yit_google_fonts = '<?php echo $google_fonts ?>',
207
- yit_web_fonts = '{"items":<?php echo json_encode( $web_fonts ) ?>}',
208
- yit_family_string = '';
209
- </script>
210
- <?php
211
- }
212
-
213
- /**
214
- * Register a new settings option group
215
- *
216
- * @return void
217
- * @access public
218
- * @link http://codex.wordpress.org/Function_Reference/register_setting
219
- * @link http://codex.wordpress.org/Function_Reference/add_settings_section
220
- * @link http://codex.wordpress.org/Function_Reference/add_settings_field
221
- */
222
- public function panel_register_setting()
223
- {
224
- $page = $this->_get_tab();
225
- $tab = isset($this->options[$page]) ? $this->options[$page] : array();
226
-
227
- if (!empty($tab['sections'])) {
228
- //add sections and fields
229
- foreach ($tab['sections'] as $section_name => $section) {
230
- //add the section
231
- add_settings_section(
232
- $section_name,
233
- $section['title'],
234
- array($this, 'panel_section_content'),
235
- $this->option_name
236
- );
237
-
238
- //add the fields
239
- foreach ($section['fields'] as $option_name => $option) {
240
- $option['id'] = $option_name;
241
- $option['label_for'] = $option_name;
242
-
243
- //register settings group
244
- register_setting(
245
- $this->option_group,
246
- $option_name,
247
- array($this, 'panel_sanitize')
248
- );
249
-
250
- add_settings_field(
251
- $option_name,
252
- $option['title'],
253
- array($this, 'panel_field_content'),
254
- $this->option_name,
255
- $section_name,
256
- $option
257
- );
258
- }
259
- }
260
- }
261
- }
262
-
263
- /**
264
- * Display sections content
265
- *
266
- * @return void
267
- * @access public
268
- */
269
- public function panel_section_content($section)
270
- {
271
- $page = $this->_get_tab();
272
- if (isset($this->options[$page]['sections'][$section['id']]['description'])) {
273
- echo "<p class='section-description'>" . $this->options[$page]['sections'][$section['id']]['description'] . "</p>";
274
- }
275
- }
276
-
277
- /**
278
- * Sanitize the option's value
279
- *
280
- * @param array $input
281
- *
282
- * @return array
283
- * @access public
284
- */
285
- public function panel_sanitize($input)
286
- {
287
- return apply_filters('yith_panel_sanitize', $input);
288
- }
289
-
290
- /**
291
- * Get the active tab. If the page isn't provided, the function
292
- * will return the first tab name
293
- *
294
- * @return string
295
- * @access protected
296
- */
297
- public function _get_tab()
298
- {
299
- $panel_page = !empty($_REQUEST['panel_page']) ? sanitize_title_for_query($_REQUEST['panel_page']) : '';
300
- $tabs = array_keys($this->options);
301
- return !empty($panel_page) ? $panel_page : $tabs[0];
302
- }
303
-
304
- /**
305
- * Enqueue scripts and styles
306
- *
307
- * @return void
308
- * @access public
309
- */
310
- public function panel_enqueue($hook)
311
- {
312
- global $pagenow;
313
-
314
- if ($pagenow == $this->_submenu[0] && isset($_GET['page']) && $_GET['page'] == $this->_submenu[4]) {
315
- wp_enqueue_style('wp-color-picker');
316
- wp_enqueue_style('yith-ywzm-jquery-ui', plugin_dir_url(__FILE__) . 'assets/css/jquery-ui.css');
317
- wp_enqueue_script('jquery-ui-datepicker');
318
-
319
- wp_enqueue_style('yith-panel-css', plugin_dir_url(__FILE__) . 'assets/css/yith-panel.css', array('wp-color-picker'), $this->version);
320
- wp_enqueue_script('yith-panel-js', plugin_dir_url(__FILE__) . 'assets/js/yith-panel.js', array(
321
- 'jquery',
322
- 'wp-color-picker'
323
- ), $this->version, true);
324
-
325
- wp_enqueue_media();
326
-
327
- do_action('yith_panel_enqueue');
328
- }
329
- }
330
-
331
-
332
- /**
333
- * Display field content
334
- *
335
- * @return void
336
- * @access public
337
- */
338
- public function panel_field_content($field)
339
- {
340
- $value = get_option($field['id'], isset($field['std']) ? $field['std'] : '');
341
- $id = $field['id'];
342
- $name = $field['id'];
343
-
344
- $echo = '';
345
-
346
- switch ($field['type']) {
347
- case 'text':
348
- $echo = "<input type='text' id='{$id}' name='{$name}' value='{$value}' class='regular-text code' />";
349
-
350
- if (isset($field['description']) && $field['description'] != '') {
351
- $echo .= "<p class='description'>{$field['description']}</p>";
352
- }
353
- break;
354
-
355
- case 'textarea':
356
- $echo = "<textarea name='{$name}' id='{$id}' class='large-text code' rows='10' cols='50'>{$value}</textarea>";
357
- if (isset($field['description']) && $field['description'] != '') {
358
- $echo .= "<p class='description'>{$field['description']}</p>";
359
- }
360
- break;
361
-
362
- case 'checkbox':
363
- $echo = "<input type='checkbox' id='{$id}' name='{$name}' value='1' " . checked($value, true, false) . " />";
364
- if (isset($field['description']) && $field['description'] != '') {
365
- $echo .= " <label for='{$id}'><span class='description'>{$field['description']}</span></label>";
366
- }
367
- break;
368
-
369
- case 'select':
370
- $echo = "<select name='{$name}' id='{$id}'>";
371
- foreach ($field['options'] as $v => $label) {
372
- $echo .= "<option value='{$v}'" . selected($value, $v, false) . ">{$label}</option>";
373
- }
374
- $echo .= "</select>";
375
- if (isset($field['description']) && $field['description'] != '') {
376
- $echo .= "<p class='description'>{$field['description']}</p>";
377
- }
378
- break;
379
-
380
- case 'skin':
381
- $echo = "<select name='{$name}' id='{$id}' class='skin' data-path='{$field['path']}'>";
382
- foreach ($field['options'] as $v => $label) {
383
- $echo .= "<option value='{$v}'" . selected($value, $v, false) . ">{$label}</option>";
384
- }
385
- $echo .= "</select>";
386
- if (isset($field['description']) && $field['description'] != '') {
387
- $echo .= "<p class='description'>{$field['description']}</p><div class='skin-preview'></div>";
388
- }
389
- break;
390
-
391
- case 'number':
392
- $mms = '';
393
- if (isset($field['min'])) {
394
- $mms .= " min='{$field['min']}'";
395
- }
396
-
397
- if (isset($field['max'])) {
398
- $mms .= " max='{$field['max']}'";
399
- }
400
-
401
- if (isset($field['step'])) {
402
- $mms .= " step='{$field['step']}'";
403
- }
404
-
405
- $echo = "<input type='number' id='{$id}' name='{$name}' value='{$value}' class='small-text' {$mms} />";
406
- if (isset($field['description']) && $field['description'] != '') {
407
- $echo .= "<p class='description'>{$field['description']}</p>";
408
- }
409
- break;
410
-
411
- case 'colorpicker':
412
- $std = isset($field['std']) ? $field['std'] : '';
413
-
414
- $echo = "<input type='text' id='{$id}' name='{$name}' value='{$value}' class='medium-text code panel-colorpicker' data-default-color='{$std}' />";
415
- if (isset($field['description']) && $field['description'] != '') {
416
- $echo .= "<p class='description'>{$field['description']}</p>";
417
- }
418
- break;
419
-
420
- case 'datepicker':
421
- $std = isset($field['std']) ? $field['std'] : array(
422
- 'date' => '',
423
- 'hh' => 0,
424
- 'mm' => 0,
425
- 'ss' => 0
426
- );
427
- $value = !empty($value) ? $value : array('date' => '', 'hh' => 0, 'mm' => 0, 'ss' => 0);
428
-
429
- $echo = "<input type='text' id='{$id}_date' name='{$name}[date]' value='{$value['date']}' class='medium-text code panel-datepicker' colorpicker='" . __('Select a date', 'yit') . "' /> - ";
430
- $echo .= "<input type='text' id='{$id}_hh' name='{$name}[hh]' value='{$value['hh']}' class='small-text code' colorpicker='" . __('Hours', 'yit') . "' /> : ";
431
- $echo .= "<input type='text' id='{$id}_mm' name='{$name}[mm]' value='{$value['mm']}' class='small-text code' colorpicker='" . __('Minutes', 'yit') . "' /> : ";
432
- $echo .= "<input type='text' id='{$id}_ss' name='{$name}[ss]' value='{$value['ss']}' class='small-text code' colorpicker='" . __('Minutes', 'yit') . "' />";
433
- if (isset($field['description']) && $field['description'] != '') {
434
- $echo .= "<p class='description'>{$field['description']}</p>";
435
- }
436
- break;
437
-
438
- case 'upload':
439
- $echo = '<div class="uploader">';
440
- $echo .= " <input type='text' id='{$id}' name='{$name}' value='{$value}' class='regular-text code' /> <input type='button' name='' id='{$id}_button' class='button' value='" . __('Upload', 'yit') . "'>";
441
- $echo .= '</div>';
442
- if (isset($field['description']) && $field['description'] != '') {
443
- $echo .= "<p class='description'>{$field['description']}</p>";
444
- }
445
- break;
446
-
447
- case 'checkboxes':
448
- $echo = '<div class="checkboxes">';
449
- foreach ($field['options'] as $check_value => $check_label) {
450
- $echo .= "<label><input type='checkbox' id='{$id}_{$check_value}' name='{$name}[]' value='$check_value' " . checked(in_array($check_value, $value), true, false) . " /> {$check_label}</label><br />";
451
- }
452
-
453
- $echo .= " <p class='description'>{$field['description']}</p>";
454
- break;
455
-
456
- case 'typography':
457
- $value = wp_parse_args($value, $field['std']); ?>
458
- <div class="typography_container typography">
459
- <div class="option">
460
- <!-- Size -->
461
- <div class="spinner_container">
462
- <input class="typography_size number small-text" type="number"
463
- name="<?php echo $name ?>[size]" id="<?php echo $id ?>-size"
464
- value="<?php echo $value['size'] ?>"
465
- data-min="<?php if (isset($field['min'])) {
466
- echo $field['min'];
467
- } ?>" data-max="<?php if (isset($field['max'])) {
468
- echo $field['max'];
469
- } ?>"/>
470
- </div>
471
-
472
- <!-- Unit -->
473
- <div class="select-wrapper font-unit">
474
- <select class="typography_unit" name="<?php echo $name ?>[unit]"
475
- id="<?php echo $id ?>-unit">
476
- <option
477
- value="px" <?php selected($value['unit'], 'px') ?>><?php _e('px', 'yit') ?></option>
478
- <option
479
- value="em" <?php selected($value['unit'], 'em') ?>><?php _e('em', 'yit') ?></option>
480
- <option
481
- value="pt" <?php selected($value['unit'], 'pt') ?>><?php _e('pt', 'yit') ?></option>
482
- <option
483
- value="rem" <?php selected($value['unit'], 'rem') ?>><?php _e('rem', 'yit') ?></option>
484
- </select>
485
- </div>
486
-
487
- <!-- Family -->
488
- <div class="select-wrapper font-family">
489
- <select class="typography_family" name="<?php echo $name ?>[family]"
490
- id="<?php echo $id ?>-family" data-instance="false">
491
- <?php if ($value['family']): ?>
492
- <option
493
- value="<?php echo stripslashes($value['family']) ?>"><?php echo $value['family'] ?></option>
494
- <?php else: ?>
495
- <option value=""><?php _e('Select a font family', 'yit') ?></option>
496
- <?php endif ?>
497
- </select>
498
- </div>
499
-
500
- <!-- Style -->
501
- <div class="select-wrapper font-style">
502
- <select class="typography_style" name="<?php echo $name ?>[style]"
503
- id="<?php echo $id ?>-style">
504
- <option
505
- value="regular" <?php selected($value['style'], 'regular') ?>><?php _e('Regular', 'yit') ?></option>
506
- <option
507
- value="bold" <?php selected($value['style'], 'bold') ?>><?php _e('Bold', 'yit') ?></option>
508
- <option
509
- value="extra-bold" <?php selected($value['style'], 'extra-bold') ?>><?php _e('Extra bold', 'yit') ?></option>
510
- <option
511
- value="italic" <?php selected($value['style'], 'italic') ?>><?php _e('Italic', 'yit') ?></option>
512
- <option
513
- value="bold-italic" <?php selected($value['style'], 'bold-italic') ?>><?php _e('Italic bold', 'yit') ?></option>
514
- </select>
515
- </div>
516
-
517
- <!-- Color -->
518
- <input type='text' id='<?php echo $id ?>-color' name='<?php echo $name ?>[color]'
519
- value='<?php echo $value['color'] ?>'
520
- class='medium-text code panel-colorpicker typography_color'
521
- data-default-color='<?php echo $field['std']['color'] ?>'/>
522
-
523
- </div>
524
- <div class="clear"></div>
525
- <div class="font-preview">
526
- <p>The quick brown fox jumps over the lazy dog</p>
527
- <!-- Refresh -->
528
- <div class="refresh_container">
529
- <button class="refresh"><?php _e('Click to preview', 'yit') ?></button>
530
- </div>
531
- </div>
532
- </div>
533
- <?php
534
- global $yith_panel_if_typography;
535
- $yith_panel_if_typography = true;
536
- break;
537
-
538
- default:
539
- do_action('yith_panel_field_' . $field['type']);
540
- break;
541
- }
542
-
543
- echo $echo;
544
- }
545
-
546
- /**
547
- * Print the banner
548
- *
549
- * @access protected
550
- * @return void
551
- */
552
- public function printBanner()
553
- {
554
- if (!$this->banner_url || !$this->banner_img) {
555
- return;
556
- }
557
- ?>
558
- <div class="yith_banner">
559
- <a href="<?php echo $this->banner_url ?>" target="_blank">
560
- <img src="<?php echo $this->banner_img ?>" alt=""/>
561
- </a>
562
- </div>
563
- <?php
564
- }
565
- }
566
- }