YITH WooCommerce Ajax Search - Version 1.4.0

Version Description

  • Released: Jun 10, 2016 =
  • Added: Support to WooCommerce 2.6 RC1
  • Updated: Plugin Core Framework
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Ajax Search
Version 1.4.0
Comparing to
See all releases

Code changes from version 1.3.9 to 1.4.0

Files changed (77) hide show
  1. README.txt +6 -2
  2. init.php +4 -7
  3. languages/yith-woocommerce-ajax-search-pt_PT.mo +0 -0
  4. languages/yith-woocommerce-ajax-search-pt_PT.po +3 -3
  5. languages/yith-woocommerce-ajax-search.pot +11 -11
  6. plugin-fw/assets/css/colorbox.css +66 -0
  7. plugin-fw/assets/css/metaboxes.css +663 -629
  8. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  9. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_flat_10_000000_40x100.png +0 -0
  10. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  11. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  12. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  13. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  14. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  15. plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  16. plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_222222_256x240.png +0 -0
  17. plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_228ef1_256x240.png +0 -0
  18. plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ef8c08_256x240.png +0 -0
  19. plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ffd27a_256x240.png +0 -0
  20. plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ffffff_256x240.png +0 -0
  21. plugin-fw/assets/css/overcast/jquery-ui-1.8.9.custom.css +0 -322
  22. plugin-fw/assets/css/overcast/jquery-ui-custom/jquery-ui-1.8.9.custom.css +578 -0
  23. plugin-fw/assets/css/yit-plugin-panel-sidebar.css +388 -0
  24. plugin-fw/assets/css/yit-plugin-panel.css +713 -664
  25. plugin-fw/assets/css/yit-upgrade-to-pro.css +77 -0
  26. plugin-fw/assets/css/yit-upgrader.css +13 -13
  27. plugin-fw/assets/images/colorbox/border1.png +0 -0
  28. plugin-fw/assets/images/colorbox/border2.png +0 -0
  29. plugin-fw/assets/images/colorbox/loading.gif +0 -0
  30. plugin-fw/assets/images/widgets/box-icon.png +0 -0
  31. plugin-fw/assets/images/widgets/box-white-icon.png +0 -0
  32. plugin-fw/assets/images/widgets/despacho.png +0 -0
  33. plugin-fw/assets/images/widgets/info-icon.png +0 -0
  34. plugin-fw/assets/images/widgets/link-bg.png +0 -0
  35. plugin-fw/assets/images/widgets/link-bg2.png +0 -0
  36. plugin-fw/assets/images/widgets/link-icon.png +0 -0
  37. plugin-fw/assets/images/widgets/membership-bg.png +0 -0
  38. plugin-fw/assets/js/chosen/ajax-chosen.jquery.min.js +2 -3
  39. plugin-fw/assets/js/how-to.js +6 -0
  40. plugin-fw/assets/js/jquery.colorbox.js +1105 -0
  41. plugin-fw/assets/js/metabox.js +354 -353
  42. plugin-fw/assets/js/metabox.min.js +6 -6
  43. plugin-fw/assets/js/multisite-updater.js +216 -216
  44. plugin-fw/assets/js/multisite-updater.min.js +1 -4
  45. plugin-fw/assets/js/yit-cpt-unlimited.js +78 -78
  46. plugin-fw/assets/js/yit-cpt-unlimited.min.js +2 -2
  47. plugin-fw/assets/js/yit-cptu-sortable-posts.js +31 -31
  48. plugin-fw/assets/js/yit-plugin-panel-sidebar.js +56 -0
  49. plugin-fw/assets/js/yit-plugin-panel-sidebar.min.js +1 -0
  50. plugin-fw/assets/js/yit-plugin-panel.js +328 -328
  51. plugin-fw/assets/js/yit-plugin-panel.min.js +1 -1
  52. plugin-fw/assets/js/yit-wp-pointer.js +83 -83
  53. plugin-fw/assets/js/yit-wp-pointer.min.js +3 -3
  54. plugin-fw/init.php +57 -57
  55. plugin-fw/languages/yith-plugin-fw-es_ES.mo +0 -0
  56. plugin-fw/languages/yith-plugin-fw-es_ES.po +1170 -0
  57. plugin-fw/languages/yith-plugin-fw-it_IT.mo +0 -0
  58. plugin-fw/languages/yith-plugin-fw-it_IT.po +272 -96
  59. plugin-fw/languages/yith-plugin-fw.pot +217 -93
  60. plugin-fw/lib/yit-ajax.php +76 -0
  61. plugin-fw/lib/yit-cpt-unlimited.php +1774 -1774
  62. plugin-fw/lib/yit-metabox.php +549 -549
  63. plugin-fw/lib/yit-plugin-common.php +1259 -1259
  64. plugin-fw/lib/yit-plugin-gradients.php +535 -535
  65. plugin-fw/lib/yit-plugin-panel-sidebar.php +427 -0
  66. plugin-fw/lib/yit-plugin-panel-wc.php +465 -422
  67. plugin-fw/lib/yit-plugin-panel.php +916 -802
  68. plugin-fw/lib/yit-plugin-subpanel.php +164 -164
  69. plugin-fw/lib/yit-pointers.php +389 -389
  70. plugin-fw/lib/yit-upgrade.php +562 -547
  71. plugin-fw/lib/yit-video.php +203 -199
  72. plugin-fw/licence/assets/css/yit-licence.css +439 -439
  73. plugin-fw/licence/assets/js/yit-licence.js +195 -195
  74. plugin-fw/licence/assets/js/yit-licence.min.js +6 -6
  75. plugin-fw/licence/lib/yit-licence.php +708 -708
  76. plugin-fw/licence/lib/yit-plugin-licence.php +160 -160
  77. plugin-fw/licence/lib/yit-theme-licence.php +136 -190
README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce search by sku, woocommerce search results, woocommerce search shortcode, woocommerce search page, woocommerce search form, woocommerce search filter, woocommerce search products, woocommerce search content, woocommerce search autocomplete, woocommerce advanced search, woocommerce search category, woocommerce search product attributes, woocommerce search by tag, woocommerce search by brand, woocommerce predictive, woocommerce live search, woocommerce single product search, woocommerce site search, woocommerce search tex, tajax, search, woocommerce, products, themes, yit, e-commerce, shop, yith, ajax search, instant search, premium, yithemes, autocomplete, autosuggest, better search, category search, custom search, highlight terms, Live Search, Predictive Search, product search, relevant search, search highlight, search product, suggest, typeahead, WooCommerce Plugin, woocommerce product search, woocommerce search, wordpress ecommerce
5
  Requires at least: 3.5.1
6
  Tested up to: 4.5.1
7
- Stable tag: 1.3.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -139,6 +139,10 @@ If you have created your own language pack for YITH WooCommerce Ajax Search, or
139
 
140
  == Changelog ==
141
 
 
 
 
 
142
  = 1.3.9 - Released: Dec 15, 2015 =
143
  * Added: Support to Wordpress 4.4
144
  * Updated: Plugin Core Framework
@@ -310,4 +314,4 @@ If you have created your own language pack for YITH WooCommerce Ajax Search, or
310
 
311
  = 1.0.0 - Released: Aug 01, 2013 =
312
 
313
- * Initial release
4
  Tags: woocommerce search by sku, woocommerce search results, woocommerce search shortcode, woocommerce search page, woocommerce search form, woocommerce search filter, woocommerce search products, woocommerce search content, woocommerce search autocomplete, woocommerce advanced search, woocommerce search category, woocommerce search product attributes, woocommerce search by tag, woocommerce search by brand, woocommerce predictive, woocommerce live search, woocommerce single product search, woocommerce site search, woocommerce search tex, tajax, search, woocommerce, products, themes, yit, e-commerce, shop, yith, ajax search, instant search, premium, yithemes, autocomplete, autosuggest, better search, category search, custom search, highlight terms, Live Search, Predictive Search, product search, relevant search, search highlight, search product, suggest, typeahead, WooCommerce Plugin, woocommerce product search, woocommerce search, wordpress ecommerce
5
  Requires at least: 3.5.1
6
  Tested up to: 4.5.1
7
+ Stable tag: 1.4.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
139
 
140
  == Changelog ==
141
 
142
+ = 1.4.0 - Released: Jun 10, 2016 =
143
+ * Added: Support to WooCommerce 2.6 RC1
144
+ * Updated: Plugin Core Framework
145
+
146
  = 1.3.9 - Released: Dec 15, 2015 =
147
  * Added: Support to Wordpress 4.4
148
  * Updated: Plugin Core Framework
314
 
315
  = 1.0.0 - Released: Aug 01, 2013 =
316
 
317
+ * Initial release
init.php CHANGED
@@ -3,17 +3,14 @@
3
  * Plugin Name: YITH WooCommerce Ajax Search
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Search allows your users to search products in real time.
6
- * Version: 1.3.9
7
- * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-search
10
  * Domain Path: /languages/
11
- *
12
- * @author Yithemes
13
- * @package YITH WooCommerce Ajax Search
14
- * @version 1.2.6
15
  */
16
 
 
17
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
18
 
19
  This program is free software; you can redistribute it and/or modify
@@ -68,7 +65,7 @@ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
68
  if ( defined( 'YITH_WCAS_VERSION' ) ){
69
  return;
70
  }else{
71
- define( 'YITH_WCAS_VERSION', '1.3.9' );
72
  }
73
 
74
  if ( ! defined( 'YITH_WCAS_FREE_INIT' ) ) {
3
  * Plugin Name: YITH WooCommerce Ajax Search
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Search allows your users to search products in real time.
6
+ * Version: 1.4.0
7
+ * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-search
10
  * Domain Path: /languages/
 
 
 
 
11
  */
12
 
13
+
14
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
15
 
16
  This program is free software; you can redistribute it and/or modify
65
  if ( defined( 'YITH_WCAS_VERSION' ) ){
66
  return;
67
  }else{
68
+ define( 'YITH_WCAS_VERSION', '1.4.0' );
69
  }
70
 
71
  if ( ! defined( 'YITH_WCAS_FREE_INIT' ) ) {
languages/yith-woocommerce-ajax-search-pt_PT.mo CHANGED
Binary file
languages/yith-woocommerce-ajax-search-pt_PT.po CHANGED
@@ -2,16 +2,16 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Search\n"
4
  "POT-Creation-Date: 2015-04-24 14:41+0100\n"
5
- "PO-Revision-Date: 2015-04-24 14:41+0100\n"
6
  "Last-Translator: Luis Maia <lmsm76@gmail.com>\n"
7
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language: it_IT\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.6\n"
13
  "X-Poedit-KeywordsList: __;_e;_x\n"
14
- "X-Poedit-Basepath: ./\n"
15
  "X-Poedit-SearchPath-0: ..\n"
16
 
17
  #: ../class.yith-wcas-admin.php:106 ../class.yith-wcas-admin.php:128
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Search\n"
4
  "POT-Creation-Date: 2015-04-24 14:41+0100\n"
5
+ "PO-Revision-Date: 2016-06-10 15:30+0200\n"
6
  "Last-Translator: Luis Maia <lmsm76@gmail.com>\n"
7
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language: it_IT\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.7.1\n"
13
  "X-Poedit-KeywordsList: __;_e;_x\n"
14
+ "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SearchPath-0: ..\n"
16
 
17
  #: ../class.yith-wcas-admin.php:106 ../class.yith-wcas-admin.php:128
languages/yith-woocommerce-ajax-search.pot CHANGED
@@ -2,7 +2,7 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Ajax Search Free\n"
5
- "POT-Creation-Date: 2015-09-18 11:22+0200\n"
6
  "PO-Revision-Date: 2015-07-17 09:42+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Yithemes <plugins@yithemes.com>\n"
@@ -10,7 +10,7 @@ msgstr ""
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
- "X-Generator: Poedit 1.8.4\n"
14
  "X-Poedit-KeywordsList: __;_e;_x\n"
15
  "X-Poedit-Basepath: .\n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
@@ -40,10 +40,10 @@ msgstr ""
40
 
41
  #: ../class.yith-wcas-admin.php:208
42
  msgid ""
43
- "In the YIT Plugin tab you can find the YITH WooCommerce Ajax Search "
44
- "options.\n"
45
  "With this menu, you can access to all the settings of our plugins that you "
46
- "have activated.\n"
47
  "YITH WooCommerce Ajax Search is available in an outstanding PREMIUM version "
48
  "with many new options, <a href=\""
49
  msgstr ""
@@ -56,23 +56,23 @@ msgstr ""
56
  msgid ""
57
  "From now on, you can find all the options of YITH WooCommerce Ajax Search "
58
  "Updated under YIT Plugin -> Ajax Search instead of WooCommerce -> Settings -"
59
- "> Ajax Search, as in the previous version.\n"
60
- "When one of our plugins updates, a new voice will be added to this menu.\n"
61
  "YITH WooCommerce Ajax Search renovates with new available options, discover "
62
  "the <a href=\""
63
  msgstr ""
64
 
65
- #: ../class.yith-wcas.php:175
66
  msgid "No results"
67
  msgstr ""
68
 
69
- #: ../init.php:40
70
  msgid ""
71
  "You can't activate the free version of YITH WooCommerce Ajax Search while "
72
  "you are using the premium one."
73
  msgstr ""
74
 
75
- #: ../init.php:104
76
  msgid ""
77
  "YITH WooCommerce Ajax Search is enabled but not effective. It requires "
78
  "WooCommerce in order to work."
@@ -88,7 +88,7 @@ msgstr ""
88
 
89
  #: ../plugin-options/settings-options.php:26
90
  msgid ""
91
- "Upgrade to the PREMIUM VERSION\n"
92
  "of YITH WOOCOMMERCE AJAX SEARCH to benefit from all features!"
93
  msgstr ""
94
 
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Ajax Search Free\n"
5
+ "POT-Creation-Date: 2016-06-10 15:29+0200\n"
6
  "PO-Revision-Date: 2015-07-17 09:42+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Yithemes <plugins@yithemes.com>\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 1.8.7.1\n"
14
  "X-Poedit-KeywordsList: __;_e;_x\n"
15
  "X-Poedit-Basepath: .\n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
40
 
41
  #: ../class.yith-wcas-admin.php:208
42
  msgid ""
43
+ "In the YIT Plugin tab you can find the YITH WooCommerce Ajax Search options."
44
+ "\r\n"
45
  "With this menu, you can access to all the settings of our plugins that you "
46
+ "have activated.\r\n"
47
  "YITH WooCommerce Ajax Search is available in an outstanding PREMIUM version "
48
  "with many new options, <a href=\""
49
  msgstr ""
56
  msgid ""
57
  "From now on, you can find all the options of YITH WooCommerce Ajax Search "
58
  "Updated under YIT Plugin -> Ajax Search instead of WooCommerce -> Settings -"
59
+ "> Ajax Search, as in the previous version.\r\n"
60
+ "When one of our plugins updates, a new voice will be added to this menu.\r\n"
61
  "YITH WooCommerce Ajax Search renovates with new available options, discover "
62
  "the <a href=\""
63
  msgstr ""
64
 
65
+ #: ../class.yith-wcas.php:176
66
  msgid "No results"
67
  msgstr ""
68
 
69
+ #: ../init.php:46
70
  msgid ""
71
  "You can't activate the free version of YITH WooCommerce Ajax Search while "
72
  "you are using the premium one."
73
  msgstr ""
74
 
75
+ #: ../init.php:108
76
  msgid ""
77
  "YITH WooCommerce Ajax Search is enabled but not effective. It requires "
78
  "WooCommerce in order to work."
88
 
89
  #: ../plugin-options/settings-options.php:26
90
  msgid ""
91
+ "Upgrade to the PREMIUM VERSION\r\n"
92
  "of YITH WOOCOMMERCE AJAX SEARCH to benefit from all features!"
93
  msgstr ""
94
 
plugin-fw/assets/css/colorbox.css ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Colorbox Core Style:
3
+ The following CSS is consistent between example themes and should not be altered.
4
+ */
5
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden; -webkit-transform: translate3d(0,0,0);}
6
+ #cboxWrapper {max-width:none;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative;}
10
+ #cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
11
+ #cboxTitle{margin:0;}
12
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
13
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
14
+ .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
15
+ .cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
16
+ #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
17
+
18
+ /*
19
+ User Style:
20
+ Change the following styles to modify the appearance of Colorbox. They are
21
+ ordered & tabbed in a way that represents the nesting of the generated HTML.
22
+ */
23
+ #cboxOverlay{background:#fff; opacity: 0.9; filter: alpha(opacity = 90);}
24
+ #colorbox{outline:0;}
25
+ #cboxTopLeft{width:25px; height:25px; background:url(../images/colorbox/border1.png) no-repeat 0 0;}
26
+ #cboxTopCenter{height:25px; background:url(../images/colorbox/border1.png) repeat-x 0 -50px;}
27
+ #cboxTopRight{width:25px; height:25px; background:url(../images/colorbox/border1.png) no-repeat -25px 0;}
28
+ #cboxBottomLeft{width:25px; height:25px; background:url(../images/colorbox/border1.png) no-repeat 0 -25px;}
29
+ #cboxBottomCenter{height:25px; background:url(../images/colorbox/border1.png) repeat-x 0 -75px;}
30
+ #cboxBottomRight{width:25px; height:25px; background:url(../images/colorbox/border1.png) no-repeat -25px -25px;}
31
+ #cboxMiddleLeft{width:25px; background:url(../images/colorbox/border2.png) repeat-y 0 0;}
32
+ #cboxMiddleRight{width:25px; background:url(../images/colorbox/border2.png) repeat-y -25px 0;}
33
+ #cboxContent{background:#fff; overflow:hidden;}
34
+ .cboxIframe{background:#fff;}
35
+ #cboxError{padding:50px; border:1px solid #ccc;}
36
+ #cboxLoadedContent{margin-bottom:20px;}
37
+ #cboxTitle{position:absolute; bottom:0px; left:0; text-align:center; width:100%; color:#999;}
38
+ #cboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;}
39
+ #cboxLoadingOverlay{background:#fff url(../images/colorbox/loading.gif) no-repeat 5px 5px;}
40
+
41
+ /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
42
+ #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
43
+
44
+ /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
45
+ #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
46
+
47
+ #cboxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;}
48
+ #cboxPrevious{position:absolute; bottom:0px; left:0; color:#444;}
49
+ #cboxNext{position:absolute; bottom:0px; left:63px; color:#444;}
50
+ #cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;}
51
+
52
+ /*
53
+ The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
54
+ when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
55
+ See: http://jacklmoore.com/notes/ie-transparency-problems/
56
+ */
57
+ .cboxIE #cboxTopLeft,
58
+ .cboxIE #cboxTopCenter,
59
+ .cboxIE #cboxTopRight,
60
+ .cboxIE #cboxBottomLeft,
61
+ .cboxIE #cboxBottomCenter,
62
+ .cboxIE #cboxBottomRight,
63
+ .cboxIE #cboxMiddleLeft,
64
+ .cboxIE #cboxMiddleRight {
65
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
66
+ }
plugin-fw/assets/css/metaboxes.css CHANGED
@@ -1,630 +1,664 @@
1
- /* self-clear floats */
2
- .clearfix:after { content:"."; display:block; height:0; clear:both; visibility:hidden; overflow:hidden; }
3
- /* ie.css */
4
- * html .clearfix { /* IE6 */
5
- height:1%;
6
- }
7
- *:first-child+html .clearfix { /* IE7 */
8
- min-height:1%;
9
- }
10
-
11
- .clearboth { clear: both }
12
-
13
- /* === TAB STYLE */
14
- .metaboxes-tab { margin:-6px -12px -8px; }
15
- .metaboxes-tab div.tabs-panel { height:auto; overflow:visible; margin-top:0px; padding:0 10px; background:none; border:0; border-top:1px solid #D4D4D4; }
16
- .metaboxes-tab ul.metaboxes-tabs { background:#F5F5F5; margin:0; padding:10px 0 0 5px; }
17
- .metaboxes-tab ul.metaboxes-tabs li { padding:8px 15px; border:1px solid #D4D4D4; float:left; background:#EDEDED; border-bottom-color:#EDEDED; margin:0 0 -1px 5px; box-shadow:1px 1px 1px 0 #FFFFFF inset; }
18
- .metaboxes-tab ul.metaboxes-tabs li a { color:#555; text-decoration:none; }
19
- .metaboxes-tab ul.metaboxes-tabs li.tabs { background:#F6F6F6; border-bottom:1px solid #F6F6F6; }
20
- .metaboxes-tab p.field-row { margin:20px 0; }
21
- .metaboxes-tab div.sep { height:1px; background:#DFDFDF; clear:both; margin-left:-10px; margin-right:-10px; }
22
- .metaboxes-tab label { font-weight:bold; width:160px; float:left; line-height:23px; margin-left:-184px; }
23
- .metaboxes-tab label small { font-weight:normal; line-height:15px; font-style:italic; color:#999; display:block; }
24
- .metaboxes-tab input[type="text"], .metaboxes-tab select, .metaboxes-tab textarea { width:30%; }
25
- .metaboxes-tab input[type="checkbox"] { vertical-align: middle }
26
- .metaboxes-tab select {padding:0;}
27
- .metaboxes-tab input.button-secondary, .metaboxes-tab input.checkbox { width:auto; }
28
- .metaboxes-tab .description { color:#AFAFAF; font-size:90%; font-style:italic; line-height:23px; padding-left:5px; }
29
- .metaboxes-tab p.field-row.textarea .description { vertical-align:top; }
30
- .metaboxes-tab p.field-row.checkbox {background:none;}
31
-
32
- .metaboxes-tab .the-metabox { margin:20px 0; margin-left:184px;}
33
- .metaboxes-tab .the-metabox.no-label { margin:20px 0; margin-left:0;}
34
- .metaboxes-tab hr { height: 0px; border-top: 1px solid #dadada; width: auto; margin-left: -10px; margin-right: -10px; }
35
- .metaboxes-tab .the-metabox p { margin:0;}
36
- .metaboxes-tab .the-metabox:last-child { border-bottom: 0px; }
37
- .metaboxes-tab .the-metabox.checkbox { background:none; }
38
- .metaboxes-tab .the-metabox.slider .ui-slider { margin-right:15px; }
39
-
40
- .metaboxes-tab span.desc { font-size: 11px; color: #AFAFAF; }
41
- .metaboxes-tab span.desc.inline { display: inline-block; vertical-align: top; line-height: 23px; }
42
- .metaboxes-tab .onoff span.desc, .metaboxes-tab .onoff label { padding:6px 0; }
43
- .metaboxes-tab .select span.desc, .metaboxes-tab .select label { padding:2px 0; }
44
- .metaboxes-tab .slider span.desc, .metaboxes-tab .slider label { padding:15px 0; }
45
- .metaboxes-tab .slider span.desc { display:block; padding:20px 0; }
46
-
47
- .metaboxes-tab ul.metaboxes-tabs li {
48
- -webkit-border-top-left-radius: 3px;
49
- -webkit-border-top-right-radius: 3px;
50
- -moz-border-radius-topleft: 3px;
51
- -moz-border-radius-topright: 3px;
52
- border-top-left-radius: 3px;
53
- border-top-right-radius: 3px;
54
- }
55
-
56
- /* image gallery */
57
- .metaboxes-tab .image-gallery ul li{
58
- display: inline-block;
59
- width: 80px;
60
- margin-left: 10px;
61
- position: relative;
62
- }
63
- .metaboxes-tab .image-gallery ul li img{
64
- width: 80px;
65
- border: 1px solid #ccc;
66
- }
67
- .metaboxes-tab .image-gallery ul li ul{
68
- position: absolute;
69
- top: -6px;
70
- right: -1px;
71
- width: 20px;
72
- height: 20px;
73
- }
74
- .metaboxes-tab .image-gallery ul a.delete{
75
- background: url(../images/x.png) no-repeat;
76
- width: 20px;
77
- height: 20px;
78
- display: block;
79
- text-indent: -99999px;
80
- }
81
- /* sidebar layout */
82
- .yit-sidebar-layout input[type="radio"] {
83
- display: none;
84
- width: 0px;
85
- }
86
- .yit-sidebar-layout input[type="radio"]:first-child {
87
- margin-right: -2px;
88
- }
89
-
90
- .yit-sidebar-layout input[type="radio"] + img {
91
- border: 2px solid #fff;
92
- padding: 1px;
93
- }
94
-
95
- .yit-sidebar-layout input[type="radio"] + img:hover {
96
- cursor: pointer;
97
- }
98
-
99
- .yit-sidebar-layout input[checked] + img {
100
- border: 2px solid #f2ad35;
101
- padding: 1px;
102
- }
103
-
104
- .yit-sidebar-layout select {
105
- vertical-align: 12px;
106
- width: inherit !important;
107
- }
108
-
109
- /* wp editor */
110
- .the-metabox.textarea-editor .mceIframeContainer {
111
- background:#fff;
112
- }
113
- .the-metabox.textarea-editor label {
114
- margin-top:24px;
115
- }
116
-
117
- /* categories */
118
- .categories-panel { width:30%; float:left; margin-right:4px; }
119
- .categories-panel .box { height:200px; border:1px solid #DFDFDF; background:#fff; padding:6px 10px; overflow: auto; }
120
- .categories-panel ul { list-style:none; margin:0; }
121
- .categories-panel ul li { line-height: 19px; margin: 0; padding: 0; word-wrap: break-word; }
122
- .categories-panel ul li label { font-weight:normal !important; margin-left:0 !important; }
123
- .categories-panel input.newcategory { width:100%; margin-bottom:3px; }
124
-
125
- /* contact form */
126
- .contactform_item {
127
- border-style: solid;
128
- border-width: 1px;
129
- line-height: 1;
130
- margin-bottom: 20px;
131
- padding: 0;
132
- background-color: #F5F5F5;
133
- background-image: -moz-linear-gradient(center top , #F9F9F9, #F5F5F5);
134
- border-color: #DFDFDF;
135
- border-radius: 3px 3px 3px 3px;
136
- box-shadow: 0 1px 0 #FFFFFF inset;
137
- min-width: 255px;
138
- position: relative;
139
- }
140
- .contactform_item .handlediv { position:relative; top: -4px; }
141
- .contactform_item h3 { min-height: 21px }
142
- .contactform_item .inside { padding: 10px !important; }
143
- .contactform_item .deps { display: none; }
144
- .contactform_item .addoptions p.option { margin: 5px 0 5px 200px }
145
- .contactform_item .addoptions p label { width: 80px !important; }
146
- .contactform_item .add-field-option { margin-bottom: 10px !important; }
147
- .remove_item { float: right; }
148
- .metabox-sortable-placeholder { border: 1px dotted #dedede; margin: 10px 0 }
149
-
150
- /* features tab */
151
- .featurestab_item{
152
- border-style: solid;
153
- border-width: 1px;
154
- line-height: 1;
155
- margin-bottom: 20px;
156
- padding: 0;
157
- background-color: #F5F5F5;
158
- background-image: -moz-linear-gradient(center top , #F9F9F9, #F5F5F5);
159
- border-color: #DFDFDF;
160
- border-radius: 3px 3px 3px 3px;
161
- box-shadow: 0 1px 0 #FFFFFF inset;
162
- min-width: 255px;
163
- position: relative;
164
- }
165
- .featurestab_item .handlediv { position:relative; top: -4px; }
166
- .featurestab_item h3 { min-height: 21px }
167
- .featurestab_item .inside { padding: 10px !important; }
168
- .featurestab_item .deps { display: none; }
169
- .featurestab_item .addoptions p.option { margin: 5px 0 5px 200px }
170
- .featurestab_item .addoptions p label { width: 80px !important; }
171
- .featurestab_item .add-field-option { margin-bottom: 10px !important; }
172
-
173
- /* slider */
174
- .the-metabox.slider { padding-top:20px; }
175
-
176
- /* on off */
177
- .the-metabox .rm_onoff span.onoff { float:left; margin-right:5px; margin-left:-4px; /* image fix */ }
178
-
179
- /* select */
180
- .the-metabox .select_wrapper { width:341px; background-color:#fff; }
181
- .the-metabox .select_wrapper select { width:100%; }
182
- .the-metabox .icon_type{ width:30%; float: left; margin-right: 40px }
183
- .the-metabox .icon_type select, .the-metabox div.option .select_wrapper select{ width: 100% }
184
-
185
- #post-type-settings .category-list label { width: 187px; }
186
- .remove_cat { float: right; text-align:center; display: block; width: 20px; height: 20px; border-radius: 20px; font-weight: bold; font-size: 10px; background: #efefef; text-decoration: none; }
187
-
188
- .the-metabox .select_wrapper {
189
- background: url("../images/select.png") no-repeat scroll right center #FAFAFA;
190
- border-color: #CCCCCC #EEEEEE #EEEEEE #CCCCCC;
191
- border-radius: 4px 4px 4px 4px;
192
- border-style: solid;
193
- border-width: 1px;
194
- color: #555555;
195
- display: block;
196
- float: left;
197
- font-family: sans-serif;
198
- font-size: 12px;
199
- min-height: 26px;
200
- margin-bottom: 9px !important;
201
- margin-left: 0;
202
- margin-right: 5px;
203
- margin-top: 0;
204
- width: 400px;
205
- position: relative;
206
- }
207
-
208
- /*chosen*/
209
-
210
- .chosen .select_wrapper {
211
- background: none;
212
- border: none;
213
- }
214
- .chosen .select_wrapper .chosen-container{
215
- width: 338px!important;
216
- }
217
- .chosen .select_wrapper .chosen-container .search-field input{
218
- height: 27px!important;
219
- color: #333;
220
- }
221
- .chosen .select_wrapper .chosen-container .chosen-choices{
222
- border: 1px solid #ddd;
223
- box-shadow: none;
224
- }
225
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice{
226
- height: 15px!important;
227
- min-width: 105px;
228
- }
229
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice span{
230
- line-height: 15px;
231
- height: 15px;
232
- padding-top: 2px;
233
- }
234
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice a.search-choice-close{
235
- top: 5px;
236
- }
237
- .chosen .select_wrapper .chosen-container .chosen-drop .chosen-search input{
238
- width: 100%!important;
239
- }
240
- .select_wrapper span {
241
- height: 26px;
242
- line-height: 26px;
243
- padding-left: 6px;
244
- position: absolute;
245
- z-index: 2;
246
- overflow: hidden;
247
- }
248
-
249
- .the-metabox .select_wrapper select {
250
- cursor: pointer;
251
- height: 28px;
252
- margin: 0;
253
- opacity: 0;
254
- padding: 0;
255
- position: relative;
256
- width: inherit;
257
- z-index: 4;
258
- background-color: #FAFAFA;
259
- }
260
-
261
-
262
- /* typography */
263
- .the-metabox.typography .select_wrapper.font-family { width:200px; }
264
- .the-metabox.typography .spinner_container { float:left; margin-right:10px; }
265
- .the-metabox.typography .spinner_container input.number {
266
- width:50px !important;
267
- -webkit-border-top-right-radius: 0px;
268
- -webkit-border-bottom-right-radius: 0px;
269
- -moz-border-radius-topright: 0px;
270
- -moz-border-radius-bottomright: 0px;
271
- border-top-right-radius: 0px;
272
- border-bottom-right-radius: 0px;
273
- }
274
-
275
- /* number */
276
- .the-metabox.number input.number { width:50px !important; }
277
- /* number */
278
- .rm_number .number {
279
- width: 70px;
280
- text-align: right;
281
- -webkit-border-top-right-radius: 0px;
282
- -webkit-border-bottom-right-radius: 0px;
283
- -moz-border-radius-topright: 0px;
284
- -moz-border-radius-bottomright: 0px;
285
- border-top-right-radius: 0px;
286
- border-bottom-right-radius: 0px;
287
- }
288
-
289
- .spinner-wrapper { position: relative; height: 23px; overflow: hidden; }
290
- .spinner-wrapper input.number { float: left; }
291
- .spinner-wrapper .spinner-button { cursor:pointer; float: left; position: absolute; left: 69px; width: 15px; height: 12px; border: 1px solid #DFDFDF; background: #fff; margin: 0; padding: 0; line-height: 9999px; overflow: hidden; background: url('../images/spinner.png') no-repeat center -11px }
292
- .spinner-wrapper .spinner-button.button-plus { top: 0; -webkit-border-top-right-radius: 3px !important; -moz-border-radius-topright: 3px !important; border-top-right-radius: 3px !important; }
293
- .spinner-wrapper .spinner-button.button-minus { bottom: 0; background-position: center -30px; -webkit-border-bottom-right-radius: 3px !important; -moz-border-radius-bottomright: 3px !important; border-bottom-right-radius: 3px !important; }
294
-
295
-
296
- .spinner-wrapper .spinner-button.button-plus:active { background-position: center 0px; }
297
- .spinner-wrapper .spinner-button.button-minus:active { background-position: center -20px; }
298
-
299
-
300
- .rm_typography .spinner_container { float: left; margin-right: 10px; }
301
- .rm_typography .spinner-wrapper { height: 28px; }
302
- .rm_typography .spinner-wrapper input.number { height: 28px; }
303
- .rm_typography .spinner-wrapper .spinner-button.button-plus { height: 15px; background-position: center -10px; }
304
- .rm_typography .spinner-wrapper .spinner-button.button-minus { height: 14px; }
305
-
306
- .the-metabox .spinner-wrapper .spinner-button { left: 49px; }
307
- .the-metabox.typography .spinner-wrapper .spinner-button { left: 35px; }
308
-
309
- /* colorpicker */
310
- .the-metabox.colorpicker { display:block; width: auto; height: auto; overflow: visible; background-image: none; position: static; font-family: inherit;}
311
- .the-metabox.colorpicker input { background-color: transparent; border: 1px solid #DFDFDF; position: static; font-size: inherit; font-family: inherit; color: inherit; text-align: center; margin: 0 5px 0px; padding: 0; outline: none; width: auto; }
312
-
313
- /* images */
314
- .the-metabox.images, .the-metabox.images label { margin-left:0; display:block; }
315
- .the-metabox.images .slides-wrapper { clear:both; }
316
- .the-metabox.images .slides-wrapper li { position:relative; }
317
- .the-metabox.images a.delete { display:block; margin-left:4px; text-decoration:none; font-weight:bold; color:red; position:absolute; top:0; right:0; width:10px; height:18px; z-index:10; cursor:pointer !important; }
318
-
319
- /* wp editor */
320
- .wp_themeSkin iframe { background: #fff !important; }
321
-
322
- /* custom tabs */
323
- .customtab_item {
324
- border-style: solid;
325
- border-width: 1px;
326
- line-height: 1;
327
- margin-bottom: 20px;
328
- padding: 0;
329
- background-color: #F5F5F5;
330
- background-image: -moz-linear-gradient(center top , #F9F9F9, #F5F5F5);
331
- border-color: #DFDFDF;
332
- border-radius: 3px 3px 3px 3px;
333
- box-shadow: 0 1px 0 #FFFFFF inset;
334
- min-width: 255px;
335
- position: relative;
336
- }
337
- .customtab_item .handlediv { position:relative; top: -4px; }
338
- .customtab_item h3 { min-height: 21px }
339
- .customtab_item .inside { padding: 10px !important; }
340
- .customtab_item .deps { display: none; }
341
- .customtab_item .addoptions p.option { margin: 5px 0 5px 200px }
342
- .customtab_item .addoptions p label { width: 80px !important; }
343
- .customtab_item .add-field-option { margin-bottom: 10px !important; }
344
- .customtab_item .remove_item { float: right; }
345
- .metabox-sortable-placeholder { border: 1px dotted #dedede; margin: 10px 0 }
346
-
347
- .the-metabox.customtabs {
348
- margin-left: 0;
349
- }
350
-
351
- #customtab_item_sample {
352
- display: none;
353
- }
354
-
355
- .the-metabox.customtabs .field-row {
356
- margin-bottom: 10px;
357
- }
358
-
359
- #yit_custom_tabs label {
360
- font-weight: normal;
361
- width: auto;
362
- float: none;
363
- line-height: auto;
364
- margin-left: 0;
365
- }
366
-
367
-
368
- .wp-admin p label input[type=radio]{
369
- width: 16px;
370
- margin-right: 10px;
371
- margin-top: 3px;
372
- }
373
- .wp-admin .form-field._preset_onsale_icon_field label input[type=radio]{
374
- margin-top: 0;
375
- }
376
-
377
- .the-metabox .spinner {
378
- margin-top: 5px;
379
- float: none;
380
- }
381
-
382
- /* slider */
383
- /*numbers*/
384
- .ui-slider .maxCaption, .ui-slider .minCaption {
385
- margin-bottom: 5px;
386
- }
387
- .ui-slider .feedback {
388
- background: url(../images/slider/tooltip.png) no-repeat center top;
389
- position: absolute;
390
- top: -25px;
391
- width: 35px;
392
- height: 43px;
393
- text-align: center;
394
- width: 100%;
395
- display: block;
396
- }
397
- .ui-slider .feedback strong {
398
- display: inline-block;
399
- padding-top: 4px;
400
- top: -30px;
401
- }
402
- /*handle*/
403
- .ui-slider-horizontal .ui-slider-handle{
404
- background: transparent url(../images/slider/handle.png) no-repeat left top !important;
405
- border: 0px !important;
406
- top: -.35em !important;
407
- width: 18px !important;
408
- height: 19px !important;
409
- }
410
-
411
- /*bg on the left:grey*/
412
- .ui-slider.ui-widget-content {
413
- background: url(../images/slider/grey.gif) repeat-x left center !important;
414
- border-color: #c1c1c0 !important;
415
- height: 10px !important;
416
- }
417
-
418
- .iris-slider-offset.ui-slider.ui-widget-content {
419
- background: transparent!important;
420
- height: auto!important;
421
- }
422
-
423
- /*bg on the right:orange*/
424
- .ui-slider.ui-widget-content .ui-widget-header {
425
- background: url(../images/slider/orange.gif) repeat-x left center !important;
426
- left: 2px !important;
427
- -webkit-border-radius: 15px;
428
- -moz-border-radius: 15px;
429
- -khtml-border-radius: 15px;
430
- border-radius: 15px;
431
- }
432
-
433
-
434
- /*sidebars*/
435
-
436
- #choose-sidebars.choose{
437
- margin-left: 0px;
438
- }
439
-
440
-
441
- #_active_page_options-container label, #_active_page_options-container p{
442
- display: inline-block;
443
- margin: 0px;
444
- }
445
- #_active_page_options-container label{
446
- margin-right: 10px;
447
- margin-top: 3px;
448
- }
449
- #_active_page_options-container {
450
- float: right;
451
- margin-right: 20px;
452
- margin-top: 5px;
453
- }
454
-
455
- /* sortable table posts */
456
-
457
- #the-list.ui-sortable tr:hover {
458
- cursor: move;
459
- }
460
-
461
-
462
- /*datepicker*/
463
- /*! jQuery UI - v1.11.2 - 2015-01-21
464
- * http://jqueryui.com
465
- * Includes: core.css, datepicker.css, theme.css
466
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=0px&bgColorHeader=%23dddddd&bgTextureHeader=flat&bgImgOpacityHeader=60&borderColorHeader=%23aaaaaa&fcHeader=%23222222&iconColorHeader=%23222222&bgColorContent=%23ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=%23aaaaaa&fcContent=%23222222&iconColorContent=%23222222&bgColorDefault=%23e9e9e9&bgTextureDefault=flat&bgImgOpacityDefault=75&borderColorDefault=%23d3d3d3&fcDefault=%23555555&iconColorDefault=%23888888&bgColorHover=%23dadada&bgTextureHover=flat&bgImgOpacityHover=75&borderColorHover=%23999999&fcHover=%23212121&iconColorHover=%23454545&bgColorActive=%23ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=%23aaaaaa&fcActive=%23212121&iconColorActive=%23454545&bgColorHighlight=%23fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=%2389b17e&fcHighlight=%23363636&iconColorHighlight=%232e83ff&bgColorError=%23fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=%23cd0a0a&fcError=%23cd0a0a&iconColorError=%23cd0a0a&bgColorOverlay=%23aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
467
- * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
468
-
469
- /* Layout helpers
470
- ----------------------------------*/
471
- .ui-helper-hidden {
472
- display: none;
473
- }
474
- .ui-helper-hidden-accessible {
475
- border: 0;
476
- clip: rect(0 0 0 0);
477
- height: 1px;
478
- margin: -1px;
479
- overflow: hidden;
480
- padding: 0;
481
- position: absolute;
482
- width: 1px;
483
- }
484
- .ui-helper-reset {
485
- margin: 0;
486
- padding: 0;
487
- border: 0;
488
- outline: 0;
489
- line-height: 1.3;
490
- text-decoration: none;
491
- font-size: 100%;
492
- list-style: none;
493
- }
494
- .ui-helper-clearfix:before,
495
- .ui-helper-clearfix:after {
496
- content: "";
497
- display: table;
498
- border-collapse: collapse;
499
- }
500
- .ui-helper-clearfix:after {
501
- clear: both;
502
- }
503
- .ui-helper-clearfix {
504
- min-height: 0; /* support: IE7 */
505
- }
506
- .ui-helper-zfix {
507
- width: 100%;
508
- height: 100%;
509
- top: 0;
510
- left: 0;
511
- position: absolute;
512
- opacity: 0;
513
- filter:Alpha(Opacity=0); /* support: IE8 */
514
- }
515
-
516
- .ui-front {
517
- z-index: 100;
518
- }
519
-
520
-
521
- /* Interaction Cues
522
- ----------------------------------*/
523
- .ui-state-disabled {
524
- cursor: default !important;
525
- }
526
-
527
-
528
- /* Icons
529
- ----------------------------------*/
530
-
531
- /* states and images */
532
- .ui-icon {
533
- display: block;
534
- text-indent: -99999px;
535
- overflow: hidden;
536
- background-repeat: no-repeat;
537
- }
538
-
539
-
540
- /* DATE PICKER
541
- ----------------------------------*/
542
-
543
- .ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}
544
- .ui-datepicker{width:17em;padding:.2em .2em 0;display:none;z-index:100!important;}
545
- .ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}
546
- .ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}
547
- .ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}
548
- .ui-datepicker .ui-datepicker-prev{left:2px}
549
- .ui-datepicker .ui-datepicker-next{right:2px}
550
- .ui-datepicker .ui-datepicker-prev-hover{left:1px}
551
- .ui-datepicker .ui-datepicker-next-hover{right:1px}
552
- .ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}
553
- .ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}
554
- .ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}
555
- .ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}
556
- .ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}
557
- .ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}
558
- .ui-datepicker td{border:0;padding:1px}
559
- .ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}
560
- .ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}
561
- .ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}
562
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}
563
- .ui-datepicker.ui-datepicker-multi{width:auto}
564
- .ui-datepicker-multi .ui-datepicker-group{float:left}
565
- .ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}
566
- .ui-datepicker-multi-2 .ui-datepicker-group{width:50%}
567
- .ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}
568
- .ui-datepicker-multi-4 .ui-datepicker-group{width:25%}
569
- .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}
570
- .ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}
571
- .ui-datepicker-row-break{clear:both;width:100%;font-size:0}
572
- .ui-datepicker-rtl{direction:rtl}
573
- .ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}
574
- .ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}
575
- .ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}
576
- .ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}
577
- .ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}
578
- .ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}
579
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}
580
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}
581
- .ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}
582
- .ui-widget .ui-widget{font-size:1em}
583
- .ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}
584
- .ui-widget-content{border:1px solid #aaa;background:#fff 50% 50% repeat-x;color:#222}
585
- .ui-widget-content a{color:#222}
586
- .ui-widget-header{border:1px solid #aaa;background:#ddd 50% 50% repeat-x;color:#222;font-weight:700}
587
- .ui-widget-header a{color:#222}
588
- .ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:0 solid #d3d3d3;background:#e9e9e9 50% 50% repeat-x;font-weight:400;color:#555}
589
- .ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}
590
- .ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:0 solid #999;background:#dadada 50% 50% repeat-x;font-weight:400;color:#212121}
591
- .ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}
592
- .ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:0 solid #aaa;background:#fff 50% 50% repeat-x;font-weight:400;color:#212121}
593
- .ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}
594
- .ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:0 solid #89b17e;background:#fbf9ee 50% 50% repeat-x;color:#363636}
595
- .ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}
596
- .ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:0 solid #cd0a0a;background:#fef1ec 50% 50% repeat-x;color:#cd0a0a}
597
- .ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}
598
- .ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}
599
- .ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}
600
- .ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}
601
- .ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}
602
- .ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}
603
- .ui-icon{width:16px;height:16px}
604
- .ui-icon,.ui-widget-content .ui-icon{background-image:url(../images/ui-icons_222222_256x240.png)}
605
- .ui-widget-header .ui-icon{background-image:url(../images/ui-icons_222222_256x240.png)}
606
- .ui-state-default .ui-icon{background-image:url(../images/ui-icons_888888_256x240.png)}
607
- .ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(../images/ui-icons_454545_256x240.png)}
608
- .ui-state-active .ui-icon{background-image:url(../images/ui-icons_454545_256x240.png)}
609
- .ui-state-highlight .ui-icon{background-image:url(../images/ui-icons_2e83ff_256x240.png)}
610
- .ui-icon-circle-triangle-e{background-position:-48px -192px}
611
- .ui-icon-circle-triangle-s{background-position:-64px -192px}
612
- .ui-icon-circle-triangle-w{background-position:-80px -192px}
613
- .ui-icon-circle-triangle-n{background-position:-96px -192px}
614
- .ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:0}
615
- .ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:0}
616
- .ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:0}
617
- .ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:0}
618
- .ui-widget-overlay{background:#aaa 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}
619
- .ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
620
-
621
-
622
- .the-metabox.preview{
623
- float: none;
624
- }
625
- .metaboxes-tab .the-metabox.no-label.preview{
626
- margin-left: 184px;
627
- }
628
- .metaboxes-tab .the-metabox.no-label.preview img{
629
- box-shadow: 0 1px 8px rgba(0,0,0,0.2);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
630
  }
1
+ /* self-clear floats */
2
+ .clearfix:after { content:"."; display:block; height:0; clear:both; visibility:hidden; overflow:hidden; }
3
+ /* ie.css */
4
+ * html .clearfix { /* IE6 */
5
+ height:1%;
6
+ }
7
+ *:first-child+html .clearfix { /* IE7 */
8
+ min-height:1%;
9
+ }
10
+
11
+ .clearboth { clear: both }
12
+
13
+ /* === TAB STYLE */
14
+ .metaboxes-tab { margin:-6px -12px -8px; }
15
+ .metaboxes-tab div.tabs-panel { height:auto; overflow:visible; margin-top:0px; padding:0 10px; background:none; border:0; border-top:1px solid #D4D4D4; }
16
+ .metaboxes-tab ul.metaboxes-tabs { background:#F5F5F5; margin:0; padding:10px 0 0 5px; }
17
+ .metaboxes-tab ul.metaboxes-tabs li { padding:8px 15px; border:1px solid #D4D4D4; float:left; background:#EDEDED; border-bottom-color:#EDEDED; margin:0 0 -1px 5px; box-shadow:1px 1px 1px 0 #FFFFFF inset; }
18
+ .metaboxes-tab ul.metaboxes-tabs li a { color:#555; text-decoration:none; }
19
+ .metaboxes-tab ul.metaboxes-tabs li.tabs { background:#F6F6F6; border-bottom:1px solid #F6F6F6; }
20
+ .metaboxes-tab p.field-row { margin:20px 0; }
21
+ .metaboxes-tab div.sep { height:1px; background:#DFDFDF; clear:both; margin-left:-10px; margin-right:-10px; }
22
+ .metaboxes-tab label { font-weight:bold; width:160px; float:left; line-height:23px; margin-left:-184px; }
23
+ .metaboxes-tab label small { font-weight:normal; line-height:15px; font-style:italic; color:#999; display:block; }
24
+ .metaboxes-tab input[type="text"], .metaboxes-tab select, .metaboxes-tab textarea { width:30%; }
25
+ .metaboxes-tab input[type="checkbox"] { vertical-align: middle }
26
+ .metaboxes-tab select {padding:0;}
27
+ .metaboxes-tab input.button-secondary, .metaboxes-tab input.checkbox { width:auto; }
28
+ .metaboxes-tab .description { color:#AFAFAF; font-size:90%; font-style:italic; line-height:23px; padding-left:5px; }
29
+ .metaboxes-tab p.field-row.textarea .description { vertical-align:top; }
30
+ .metaboxes-tab p.field-row.checkbox {background:none;}
31
+
32
+ .metaboxes-tab .the-metabox { margin:20px 0; margin-left:184px;}
33
+ .metaboxes-tab .the-metabox.no-label { margin:20px 0; margin-left:0;}
34
+ .metaboxes-tab hr { height: 0px; border-top: 1px solid #dadada; width: auto; margin-left: -10px; margin-right: -10px; }
35
+ .metaboxes-tab .the-metabox p { margin:0;}
36
+ .metaboxes-tab .the-metabox:last-child { border-bottom: 0px; }
37
+ .metaboxes-tab .the-metabox.checkbox { background:none; }
38
+ .metaboxes-tab .the-metabox.slider .ui-slider { margin-right:15px; }
39
+
40
+ .metaboxes-tab span.desc { font-size: 11px; color: #AFAFAF; }
41
+ .metaboxes-tab span.desc.inline { display: inline-block; vertical-align: top; line-height: 23px; }
42
+ .metaboxes-tab .onoff span.desc, .metaboxes-tab .onoff label { padding:6px 0; }
43
+ .metaboxes-tab .select span.desc, .metaboxes-tab .select label { padding:2px 0; }
44
+ .metaboxes-tab .slider span.desc, .metaboxes-tab .slider label { padding:15px 0; }
45
+ .metaboxes-tab .slider span.desc { display:block; padding:20px 0; }
46
+
47
+ .metaboxes-tab ul.metaboxes-tabs li {
48
+ -webkit-border-top-left-radius: 3px;
49
+ -webkit-border-top-right-radius: 3px;
50
+ -moz-border-radius-topleft: 3px;
51
+ -moz-border-radius-topright: 3px;
52
+ border-top-left-radius: 3px;
53
+ border-top-right-radius: 3px;
54
+ }
55
+
56
+ /* image gallery */
57
+ .metaboxes-tab .image-gallery ul li{
58
+ display: inline-block;
59
+ width: 80px;
60
+ margin-left: 10px;
61
+ position: relative;
62
+ }
63
+ .metaboxes-tab .image-gallery ul li img{
64
+ width: 80px;
65
+ border: 1px solid #ccc;
66
+ }
67
+ .metaboxes-tab .image-gallery ul li ul{
68
+ position: absolute;
69
+ top: -6px;
70
+ right: -1px;
71
+ width: 20px;
72
+ height: 20px;
73
+ }
74
+ .metaboxes-tab .image-gallery ul a.delete{
75
+ background: url(../images/x.png) no-repeat;
76
+ width: 20px;
77
+ height: 20px;
78
+ display: block;
79
+ text-indent: -99999px;
80
+ }
81
+ /* sidebar layout */
82
+ .yit-sidebar-layout input[type="radio"] {
83
+ display: none;
84
+ width: 0px;
85
+ }
86
+ .yit-sidebar-layout input[type="radio"]:first-child {
87
+ margin-right: -2px;
88
+ }
89
+
90
+ .yit-sidebar-layout input[type="radio"] + img {
91
+ border: 2px solid #fff;
92
+ padding: 1px;
93
+ }
94
+
95
+ .yit-sidebar-layout input[type="radio"] + img:hover {
96
+ cursor: pointer;
97
+ }
98
+
99
+ .yit-sidebar-layout input[checked] + img {
100
+ border: 2px solid #f2ad35;
101
+ padding: 1px;
102
+ }
103
+
104
+ .yit-sidebar-layout select {
105
+ vertical-align: 12px;
106
+ width: inherit !important;
107
+ }
108
+
109
+ /* wp editor */
110
+ .the-metabox.textarea-editor .mceIframeContainer {
111
+ background:#fff;
112
+ }
113
+ .the-metabox.textarea-editor label {
114
+ margin-top:24px;
115
+ }
116
+
117
+ /* categories */
118
+ .categories-panel { width:30%; float:left; margin-right:4px; }
119
+ .categories-panel .box { height:200px; border:1px solid #DFDFDF; background:#fff; padding:6px 10px; overflow: auto; }
120
+ .categories-panel ul { list-style:none; margin:0; }
121
+ .categories-panel ul li { line-height: 19px; margin: 0; padding: 0; word-wrap: break-word; }
122
+ .categories-panel ul li label { font-weight:normal !important; margin-left:0 !important; }
123
+ .categories-panel input.newcategory { width:100%; margin-bottom:3px; }
124
+
125
+ /* contact form */
126
+ .contactform_item {
127
+ border-style: solid;
128
+ border-width: 1px;
129
+ line-height: 1;
130
+ margin-bottom: 20px;
131
+ padding: 0;
132
+ background-color: #F5F5F5;
133
+ background-image: -moz-linear-gradient(center top , #F9F9F9, #F5F5F5);
134
+ border-color: #DFDFDF;
135
+ border-radius: 3px 3px 3px 3px;
136
+ box-shadow: 0 1px 0 #FFFFFF inset;
137
+ min-width: 255px;
138
+ position: relative;
139
+ }
140
+ .contactform_item .handlediv { position:relative; top: -4px; }
141
+ .contactform_item h3 { min-height: 21px }
142
+ .contactform_item .inside { padding: 10px !important; }
143
+ .contactform_item .deps { display: none; }
144
+ .contactform_item .addoptions p.option { margin: 5px 0 5px 200px }
145
+ .contactform_item .addoptions p label { width: 80px !important; }
146
+ .contactform_item .add-field-option { margin-bottom: 10px !important; }
147
+ .remove_item { float: right; }
148
+ .metabox-sortable-placeholder { border: 1px dotted #dedede; margin: 10px 0 }
149
+
150
+ /* features tab */
151
+ .featurestab_item{
152
+ border-style: solid;
153
+ border-width: 1px;
154
+ line-height: 1;
155
+ margin-bottom: 20px;
156
+ padding: 0;
157
+ background-color: #F5F5F5;
158
+ background-image: -moz-linear-gradient(center top , #F9F9F9, #F5F5F5);
159
+ border-color: #DFDFDF;
160
+ border-radius: 3px 3px 3px 3px;
161
+ box-shadow: 0 1px 0 #FFFFFF inset;
162
+ min-width: 255px;
163
+ position: relative;
164
+ }
165
+ .featurestab_item .handlediv { position:relative; top: -4px; }
166
+ .featurestab_item h3 { min-height: 21px }
167
+ .featurestab_item .inside { padding: 10px !important; }
168
+ .featurestab_item .deps { display: none; }
169
+ .featurestab_item .addoptions p.option { margin: 5px 0 5px 200px }
170
+ .featurestab_item .addoptions p label { width: 80px !important; }
171
+ .featurestab_item .add-field-option { margin-bottom: 10px !important; }
172
+
173
+ /* slider */
174
+ .the-metabox.slider { padding-top:20px; }
175
+
176
+ /* on off */
177
+ .the-metabox .rm_onoff span.onoff { float:left; margin-right:5px; margin-left:-4px; /* image fix */ }
178
+
179
+ /* onoff */
180
+ .rm_onoff input {
181
+ display: none;
182
+ }
183
+
184
+ .rm_onoff input + span {
185
+ cursor: pointer;
186
+ text-indent: -9999px;
187
+ display: block;
188
+ width: 85px;
189
+ height: 37px;
190
+ background: transparent url(../images/off.png);
191
+ }
192
+
193
+ .rm_onoff input:checked + span {
194
+ background: transparent url(../images/on.png);
195
+ }
196
+
197
+ .rm_onoff input.onoffchecked + span {
198
+ background: transparent url(../images/on.png);
199
+ }
200
+
201
+ .messages-panel.updated {
202
+ margin: 10px 0px 10px !important;
203
+ max-width: 1200px;
204
+ border-radius: 5px;
205
+ -webkit-box-sizing: border-box;
206
+ box-sizing: border-box;
207
+ }
208
+
209
+ .ui-widget-overlay { background-image: none !important; }
210
+
211
+
212
+
213
+ /* select */
214
+ .the-metabox .select_wrapper { width:341px; background-color:#fff; }
215
+ .the-metabox .select_wrapper select { width:100%; }
216
+ .the-metabox .icon_type{ width:30%; float: left; margin-right: 40px }
217
+ .the-metabox .icon_type select, .the-metabox div.option .select_wrapper select{ width: 100% }
218
+
219
+ #post-type-settings .category-list label { width: 187px; }
220
+ .remove_cat { float: right; text-align:center; display: block; width: 20px; height: 20px; border-radius: 20px; font-weight: bold; font-size: 10px; background: #efefef; text-decoration: none; }
221
+
222
+ .the-metabox .select_wrapper {
223
+ background: url("../images/select.png") no-repeat scroll right center #FAFAFA;
224
+ border-color: #CCCCCC #EEEEEE #EEEEEE #CCCCCC;
225
+ border-radius: 4px 4px 4px 4px;
226
+ border-style: solid;
227
+ border-width: 1px;
228
+ color: #555555;
229
+ display: block;
230
+ float: left;
231
+ font-family: sans-serif;
232
+ font-size: 12px;
233
+ min-height: 26px;
234
+ margin-bottom: 9px !important;
235
+ margin-left: 0;
236
+ margin-right: 5px;
237
+ margin-top: 0;
238
+ width: 400px;
239
+ position: relative;
240
+ }
241
+
242
+ /*chosen*/
243
+
244
+ .chosen .select_wrapper {
245
+ background: none;
246
+ border: none;
247
+ }
248
+ .chosen .select_wrapper .chosen-container{
249
+ width: 338px!important;
250
+ }
251
+ .chosen .select_wrapper .chosen-container .search-field input{
252
+ height: 27px!important;
253
+ color: #333;
254
+ }
255
+ .chosen .select_wrapper .chosen-container .chosen-choices{
256
+ border: 1px solid #ddd;
257
+ box-shadow: none;
258
+ }
259
+ .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice{
260
+ height: 15px!important;
261
+ min-width: 105px;
262
+ }
263
+ .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice span{
264
+ line-height: 15px;
265
+ height: 15px;
266
+ padding-top: 2px;
267
+ }
268
+ .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice a.search-choice-close{
269
+ top: 5px;
270
+ }
271
+ .chosen .select_wrapper .chosen-container .chosen-drop .chosen-search input{
272
+ width: 100%!important;
273
+ }
274
+ .select_wrapper span {
275
+ height: 26px;
276
+ line-height: 26px;
277
+ padding-left: 6px;
278
+ position: absolute;
279
+ z-index: 2;
280
+ overflow: hidden;
281
+ }
282
+
283
+ .the-metabox .select_wrapper select {
284
+ cursor: pointer;
285
+ height: 28px;
286
+ margin: 0;
287
+ opacity: 0;
288
+ padding: 0;
289
+ position: relative;
290
+ width: inherit;
291
+ z-index: 4;
292
+ background-color: #FAFAFA;
293
+ }
294
+
295
+
296
+ /* typography */
297
+ .the-metabox.typography .select_wrapper.font-family { width:200px; }
298
+ .the-metabox.typography .spinner_container { float:left; margin-right:10px; }
299
+ .the-metabox.typography .spinner_container input.number {
300
+ width:50px !important;
301
+ -webkit-border-top-right-radius: 0px;
302
+ -webkit-border-bottom-right-radius: 0px;
303
+ -moz-border-radius-topright: 0px;
304
+ -moz-border-radius-bottomright: 0px;
305
+ border-top-right-radius: 0px;
306
+ border-bottom-right-radius: 0px;
307
+ }
308
+
309
+ /* number */
310
+ .the-metabox.number input.number { width:50px !important; }
311
+ /* number */
312
+ .rm_number .number {
313
+ width: 70px;
314
+ text-align: right;
315
+ -webkit-border-top-right-radius: 0px;
316
+ -webkit-border-bottom-right-radius: 0px;
317
+ -moz-border-radius-topright: 0px;
318
+ -moz-border-radius-bottomright: 0px;
319
+ border-top-right-radius: 0px;
320
+ border-bottom-right-radius: 0px;
321
+ }
322
+
323
+ .spinner-wrapper { position: relative; height: 23px; overflow: hidden; }
324
+ .spinner-wrapper input.number { float: left; }
325
+ .spinner-wrapper .spinner-button { cursor:pointer; float: left; position: absolute; left: 69px; width: 15px; height: 12px; border: 1px solid #DFDFDF; background: #fff; margin: 0; padding: 0; line-height: 9999px; overflow: hidden; background: url('../images/spinner.png') no-repeat center -11px }
326
+ .spinner-wrapper .spinner-button.button-plus { top: 0; -webkit-border-top-right-radius: 3px !important; -moz-border-radius-topright: 3px !important; border-top-right-radius: 3px !important; }
327
+ .spinner-wrapper .spinner-button.button-minus { bottom: 0; background-position: center -30px; -webkit-border-bottom-right-radius: 3px !important; -moz-border-radius-bottomright: 3px !important; border-bottom-right-radius: 3px !important; }
328
+
329
+
330
+ .spinner-wrapper .spinner-button.button-plus:active { background-position: center 0px; }
331
+ .spinner-wrapper .spinner-button.button-minus:active { background-position: center -20px; }
332
+
333
+
334
+ .rm_typography .spinner_container { float: left; margin-right: 10px; }
335
+ .rm_typography .spinner-wrapper { height: 28px; }
336
+ .rm_typography .spinner-wrapper input.number { height: 28px; }
337
+ .rm_typography .spinner-wrapper .spinner-button.button-plus { height: 15px; background-position: center -10px; }
338
+ .rm_typography .spinner-wrapper .spinner-button.button-minus { height: 14px; }
339
+
340
+ .the-metabox .spinner-wrapper .spinner-button { left: 49px; }
341
+ .the-metabox.typography .spinner-wrapper .spinner-button { left: 35px; }
342
+
343
+ /* colorpicker */
344
+ .the-metabox.colorpicker { display:block; width: auto; height: auto; overflow: visible; background-image: none; position: static; font-family: inherit;}
345
+ .the-metabox.colorpicker input { background-color: transparent; border: 1px solid #DFDFDF; position: static; font-size: inherit; font-family: inherit; color: inherit; text-align: center; margin: 0 5px 0px; padding: 0; outline: none; width: auto; }
346
+
347
+ /* images */
348
+ .the-metabox.images, .the-metabox.images label { margin-left:0; display:block; }
349
+ .the-metabox.images .slides-wrapper { clear:both; }
350
+ .the-metabox.images .slides-wrapper li { position:relative; }
351
+ .the-metabox.images a.delete { display:block; margin-left:4px; text-decoration:none; font-weight:bold; color:red; position:absolute; top:0; right:0; width:10px; height:18px; z-index:10; cursor:pointer !important; }
352
+
353
+ /* wp editor */
354
+ .wp_themeSkin iframe { background: #fff !important; }
355
+
356
+ /* custom tabs */
357
+ .customtab_item {
358
+ border-style: solid;
359
+ border-width: 1px;
360
+ line-height: 1;
361
+ margin-bottom: 20px;
362
+ padding: 0;
363
+ background-color: #F5F5F5;
364
+ background-image: -moz-linear-gradient(center top , #F9F9F9, #F5F5F5);
365
+ border-color: #DFDFDF;
366
+ border-radius: 3px 3px 3px 3px;
367
+ box-shadow: 0 1px 0 #FFFFFF inset;
368
+ min-width: 255px;
369
+ position: relative;
370
+ }
371
+ .customtab_item .handlediv { position:relative; top: -4px; }
372
+ .customtab_item h3 { min-height: 21px }
373
+ .customtab_item .inside { padding: 10px !important; }
374
+ .customtab_item .deps { display: none; }
375
+ .customtab_item .addoptions p.option { margin: 5px 0 5px 200px }
376
+ .customtab_item .addoptions p label { width: 80px !important; }
377
+ .customtab_item .add-field-option { margin-bottom: 10px !important; }
378
+ .customtab_item .remove_item { float: right; }
379
+ .metabox-sortable-placeholder { border: 1px dotted #dedede; margin: 10px 0 }
380
+
381
+ .the-metabox.customtabs {
382
+ margin-left: 0;
383
+ }
384
+
385
+ #customtab_item_sample {
386
+ display: none;
387
+ }
388
+
389
+ .the-metabox.customtabs .field-row {
390
+ margin-bottom: 10px;
391
+ }
392
+
393
+ #yit_custom_tabs label {
394
+ font-weight: normal;
395
+ width: auto;
396
+ float: none;
397
+ line-height: auto;
398
+ margin-left: 0;
399
+ }
400
+
401
+
402
+ .wp-admin p label input[type=radio]{
403
+ width: 16px;
404
+ margin-right: 10px;
405
+ margin-top: 3px;
406
+ }
407
+ .wp-admin .form-field._preset_onsale_icon_field label input[type=radio]{
408
+ margin-top: 0;
409
+ }
410
+
411
+ .the-metabox .spinner {
412
+ margin-top: 5px;
413
+ float: none;
414
+ }
415
+
416
+ /* slider */
417
+ /*numbers*/
418
+ .ui-slider .maxCaption, .ui-slider .minCaption {
419
+ margin-bottom: 5px;
420
+ }
421
+ .ui-slider .feedback {
422
+ background: url(../images/slider/tooltip.png) no-repeat center top;
423
+ position: absolute;
424
+ top: -25px;
425
+ width: 35px;
426
+ height: 43px;
427
+ text-align: center;
428
+ width: 100%;
429
+ display: block;
430
+ }
431
+ .ui-slider .feedback strong {
432
+ display: inline-block;
433
+ padding-top: 4px;
434
+ top: -30px;
435
+ }
436
+ /*handle*/
437
+ .ui-slider-horizontal .ui-slider-handle{
438
+ background: transparent url(../images/slider/handle.png) no-repeat left top !important;
439
+ border: 0px !important;
440
+ top: -.35em !important;
441
+ width: 18px !important;
442
+ height: 19px !important;
443
+ }
444
+
445
+ /*bg on the left:grey*/
446
+ .ui-slider.ui-widget-content {
447
+ background: url(../images/slider/grey.gif) repeat-x left center !important;
448
+ border-color: #c1c1c0 !important;
449
+ height: 10px !important;
450
+ }
451
+
452
+ .iris-slider-offset.ui-slider.ui-widget-content {
453
+ background: transparent!important;
454
+ height: auto!important;
455
+ }
456
+
457
+ /*bg on the right:orange*/
458
+ .ui-slider.ui-widget-content .ui-widget-header {
459
+ background: url(../images/slider/orange.gif) repeat-x left center !important;
460
+ left: 2px !important;
461
+ -webkit-border-radius: 15px;
462
+ -moz-border-radius: 15px;
463
+ -khtml-border-radius: 15px;
464
+ border-radius: 15px;
465
+ }
466
+
467
+
468
+ /*sidebars*/
469
+
470
+ #choose-sidebars.choose{
471
+ margin-left: 0px;
472
+ }
473
+
474
+
475
+ #_active_page_options-container label, #_active_page_options-container p{
476
+ display: inline-block;
477
+ margin: 0px;
478
+ }
479
+ #_active_page_options-container label{
480
+ margin-right: 10px;
481
+ margin-top: 3px;
482
+ }
483
+ #_active_page_options-container {
484
+ float: right;
485
+ margin-right: 20px;
486
+ margin-top: 5px;
487
+ }
488
+
489
+ /* sortable table posts */
490
+
491
+ #the-list.ui-sortable tr:hover {
492
+ cursor: move;
493
+ }
494
+
495
+
496
+ /*datepicker*/
497
+ /*! jQuery UI - v1.11.2 - 2015-01-21
498
+ * http://jqueryui.com
499
+ * Includes: core.css, datepicker.css, theme.css
500
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=0px&bgColorHeader=%23dddddd&bgTextureHeader=flat&bgImgOpacityHeader=60&borderColorHeader=%23aaaaaa&fcHeader=%23222222&iconColorHeader=%23222222&bgColorContent=%23ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=%23aaaaaa&fcContent=%23222222&iconColorContent=%23222222&bgColorDefault=%23e9e9e9&bgTextureDefault=flat&bgImgOpacityDefault=75&borderColorDefault=%23d3d3d3&fcDefault=%23555555&iconColorDefault=%23888888&bgColorHover=%23dadada&bgTextureHover=flat&bgImgOpacityHover=75&borderColorHover=%23999999&fcHover=%23212121&iconColorHover=%23454545&bgColorActive=%23ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=%23aaaaaa&fcActive=%23212121&iconColorActive=%23454545&bgColorHighlight=%23fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=%2389b17e&fcHighlight=%23363636&iconColorHighlight=%232e83ff&bgColorError=%23fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=%23cd0a0a&fcError=%23cd0a0a&iconColorError=%23cd0a0a&bgColorOverlay=%23aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
501
+ * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
502
+
503
+ /* Layout helpers
504
+ ----------------------------------*/
505
+ .ui-helper-hidden {
506
+ display: none;
507
+ }
508
+ .ui-helper-hidden-accessible {
509
+ border: 0;
510
+ clip: rect(0 0 0 0);
511
+ height: 1px;
512
+ margin: -1px;
513
+ overflow: hidden;
514
+ padding: 0;
515
+ position: absolute;
516
+ width: 1px;
517
+ }
518
+ .ui-helper-reset {
519
+ margin: 0;
520
+ padding: 0;
521
+ border: 0;
522
+ outline: 0;
523
+ line-height: 1.3;
524
+ text-decoration: none;
525
+ font-size: 100%;
526
+ list-style: none;
527
+ }
528
+ .ui-helper-clearfix:before,
529
+ .ui-helper-clearfix:after {
530
+ content: "";
531
+ display: table;
532
+ border-collapse: collapse;
533
+ }
534
+ .ui-helper-clearfix:after {
535
+ clear: both;
536
+ }
537
+ .ui-helper-clearfix {
538
+ min-height: 0; /* support: IE7 */
539
+ }
540
+ .ui-helper-zfix {
541
+ width: 100%;
542
+ height: 100%;
543
+ top: 0;
544
+ left: 0;
545
+ position: absolute;
546
+ opacity: 0;
547
+ filter:Alpha(Opacity=0); /* support: IE8 */
548
+ }
549
+
550
+ .ui-front {
551
+ z-index: 100;
552
+ }
553
+
554
+
555
+ /* Interaction Cues
556
+ ----------------------------------*/
557
+ .ui-state-disabled {
558
+ cursor: default !important;
559
+ }
560
+
561
+
562
+ /* Icons
563
+ ----------------------------------*/
564
+
565
+ /* states and images */
566
+ .ui-icon {
567
+ display: block;
568
+ text-indent: -99999px;
569
+ overflow: hidden;
570
+ background-repeat: no-repeat;
571
+ }
572
+
573
+
574
+ /* DATE PICKER
575
+ ----------------------------------*/
576
+
577
+ .ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}
578
+ .ui-datepicker{width:17em;padding:.2em .2em 0;display:none;z-index:100!important;}
579
+ .ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}
580
+ .ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}
581
+ .ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}
582
+ .ui-datepicker .ui-datepicker-prev{left:2px}
583
+ .ui-datepicker .ui-datepicker-next{right:2px}
584
+ .ui-datepicker .ui-datepicker-prev-hover{left:1px}
585
+ .ui-datepicker .ui-datepicker-next-hover{right:1px}
586
+ .ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}
587
+ .ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}
588
+ .ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}
589
+ .ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}
590
+ .ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}
591
+ .ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}
592
+ .ui-datepicker td{border:0;padding:1px}
593
+ .ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}
594
+ .ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}
595
+ .ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}
596
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}
597
+ .ui-datepicker.ui-datepicker-multi{width:auto}
598
+ .ui-datepicker-multi .ui-datepicker-group{float:left}
599
+ .ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}
600
+ .ui-datepicker-multi-2 .ui-datepicker-group{width:50%}
601
+ .ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}
602
+ .ui-datepicker-multi-4 .ui-datepicker-group{width:25%}
603
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}
604
+ .ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}
605
+ .ui-datepicker-row-break{clear:both;width:100%;font-size:0}
606
+ .ui-datepicker-rtl{direction:rtl}
607
+ .ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}
608
+ .ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}
609
+ .ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}
610
+ .ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}
611
+ .ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}
612
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}
613
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}
614
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}
615
+ .ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}
616
+ .ui-widget .ui-widget{font-size:1em}
617
+ .ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}
618
+ .ui-widget-content{border:1px solid #aaa;background:#fff 50% 50% repeat-x;color:#222}
619
+ .ui-widget-content a{color:#222}
620
+ .ui-widget-header{border:1px solid #aaa;background:#ddd 50% 50% repeat-x;color:#222;font-weight:700}
621
+ .ui-widget-header a{color:#222}
622
+ .ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:0 solid #d3d3d3;background:#e9e9e9 50% 50% repeat-x;font-weight:400;color:#555}
623
+ .ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}
624
+ .ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:0 solid #999;background:#dadada 50% 50% repeat-x;font-weight:400;color:#212121}
625
+ .ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}
626
+ .ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:0 solid #aaa;background:#fff 50% 50% repeat-x;font-weight:400;color:#212121}
627
+ .ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}
628
+ .ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:0 solid #89b17e;background:#fbf9ee 50% 50% repeat-x;color:#363636}
629
+ .ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}
630
+ .ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:0 solid #cd0a0a;background:#fef1ec 50% 50% repeat-x;color:#cd0a0a}
631
+ .ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}
632
+ .ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}
633
+ .ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}
634
+ .ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}
635
+ .ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}
636
+ .ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}
637
+ .ui-icon{width:16px;height:16px}
638
+ .ui-icon,.ui-widget-content .ui-icon{background-image:url(../images/ui-icons_222222_256x240.png)}
639
+ .ui-widget-header .ui-icon{background-image:url(../images/ui-icons_222222_256x240.png)}
640
+ .ui-state-default .ui-icon{background-image:url(../images/ui-icons_888888_256x240.png)}
641
+ .ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(../images/ui-icons_454545_256x240.png)}
642
+ .ui-state-active .ui-icon{background-image:url(../images/ui-icons_454545_256x240.png)}
643
+ .ui-state-highlight .ui-icon{background-image:url(../images/ui-icons_2e83ff_256x240.png)}
644
+ .ui-icon-circle-triangle-e{background-position:-48px -192px}
645
+ .ui-icon-circle-triangle-s{background-position:-64px -192px}
646
+ .ui-icon-circle-triangle-w{background-position:-80px -192px}
647
+ .ui-icon-circle-triangle-n{background-position:-96px -192px}
648
+ .ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:0}
649
+ .ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:0}
650
+ .ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:0}
651
+ .ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:0}
652
+ .ui-widget-overlay{background:#aaa 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}
653
+ .ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
654
+
655
+
656
+ .the-metabox.preview{
657
+ float: none;
658
+ }
659
+ .metaboxes-tab .the-metabox.no-label.preview{
660
+ margin-left: 184px;
661
+ }
662
+ .metaboxes-tab .the-metabox.no-label.preview img{
663
+ box-shadow: 0 1px 8px rgba(0,0,0,0.2);
664
  }
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_diagonals-thick_18_b81900_40x40.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_flat_10_000000_40x100.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_100_f6f6f6_1x400.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_100_fdf5ce_1x400.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_gloss-wave_35_f6a828_500x100.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_highlight-soft_100_eeeeee_1x100.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-bg_highlight-soft_75_ffe45c_1x100.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_222222_256x240.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_228ef1_256x240.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ef8c08_256x240.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ffd27a_256x240.png ADDED
Binary file
plugin-fw/assets/css/overcast/images/jquery_ui/ui-icons_ffffff_256x240.png ADDED
Binary file
plugin-fw/assets/css/overcast/jquery-ui-1.8.9.custom.css DELETED
@@ -1,322 +0,0 @@
1
- /*
2
- * jQuery UI CSS Framework 1.8.8
3
- *
4
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT or GPL Version 2 licenses.
6
- * http://jquery.org/license
7
- *
8
- * http://docs.jquery.com/UI/Theming/API
9
- */
10
-
11
- /* Layout helpers
12
- ----------------------------------*/
13
- .ui-helper-hidden { display: none; }
14
- .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
- .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
- .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
- .ui-helper-clearfix { display: inline-block; }
18
- /* required comment for clearfix to work in Opera \*/
19
- * html .ui-helper-clearfix { height:1%; }
20
- .ui-helper-clearfix { display:block; }
21
- /* end clearfix */
22
- .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23
-
24
-
25
- /* Interaction Cues
26
- ----------------------------------*/
27
- .ui-state-disabled { cursor: default !important; }
28
-
29
-
30
- /* Icons
31
- ----------------------------------*/
32
-
33
- /* states and images */
34
- .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
35
-
36
-
37
- /* Misc visuals
38
- ----------------------------------*/
39
-
40
- /* Overlays */
41
- .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42
-
43
-
44
- /*
45
- * jQuery UI CSS Framework 1.8.8
46
- *
47
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
48
- * Dual licensed under the MIT or GPL Version 2 licenses.
49
- * http://jquery.org/license
50
- *
51
- * http://docs.jquery.com/UI/Theming/API
52
- *
53
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Helvetica,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=dddddd&bgTextureHeader=02_glass.png&bgImgOpacityHeader=35&borderColorHeader=bbbbbb&fcHeader=444444&iconColorHeader=999999&bgColorContent=c9c9c9&bgTextureContent=05_inset_soft.png&bgImgOpacityContent=50&borderColorContent=aaaaaa&fcContent=333333&iconColorContent=999999&bgColorDefault=eeeeee&bgTextureDefault=02_glass.png&bgImgOpacityDefault=60&borderColorDefault=cccccc&fcDefault=3383bb&iconColorDefault=70b2e1&bgColorHover=f8f8f8&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=bbbbbb&fcHover=599fcf&iconColorHover=3383bb&bgColorActive=999999&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=75&borderColorActive=999999&fcActive=ffffff&iconColorActive=454545&bgColorHighlight=eeeeee&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=ffffff&fcHighlight=444444&iconColorHighlight=3383bb&bgColorError=c0402a&bgTextureError=01_flat.png&bgImgOpacityError=55&borderColorError=c0402a&fcError=ffffff&iconColorError=fbc856&bgColorOverlay=eeeeee&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=80&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=60&thicknessShadow=4px&offsetTopShadow=-4px&offsetLeftShadow=-4px&cornerRadiusShadow=0pxdow=0px
54
- */
55
-
56
-
57
- /* Component containers
58
- ----------------------------------*/
59
- .ui-widget { font-family: Trebuchet MS, Helvetica, Arial, sans-serif; font-size: 1.1em; }
60
- .ui-widget .ui-widget { font-size: 1em; }
61
- .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Helvetica, Arial, sans-serif; font-size: 1em; }
62
- .ui-widget-content { border: 1px solid #aaaaaa; background: #f1f1f1; color: #333333; }
63
- .ui-widget-content a { color: #333333; }
64
- .ui-widget-header { border: 1px solid #bbbbbb; background: #ccc; color: #444444; font-weight: bold; }
65
- .ui-widget-header a { color: #444444; }
66
-
67
- /* Interaction states
68
- ----------------------------------*/
69
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #eeeeee url(images/ui-bg_glass_60_eeeeee_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #3383bb; }
70
- .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #3383bb; text-decoration: none; }
71
- .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #bbbbbb; background: #f8f8f8 url(images/ui-bg_glass_100_f8f8f8_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #599fcf; }
72
- .ui-state-hover a, .ui-state-hover a:hover { color: #599fcf; text-decoration: none; }
73
- .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #999999; background: #999999 url(images/ui-bg_inset-hard_75_999999_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #ffffff; }
74
- .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; }
75
- .ui-widget :active { outline: none; }
76
-
77
- /* Interaction Cues
78
- ----------------------------------*/
79
- .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #ffffff; background: #eeeeee url(images/ui-bg_flat_55_eeeeee_40x100.png) 50% 50% repeat-x; color: #444444; }
80
- .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #444444; }
81
- .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #c0402a; background: #c0402a url(images/ui-bg_flat_55_c0402a_40x100.png) 50% 50% repeat-x; color: #ffffff; }
82
- .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
83
- .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
84
- .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
85
- .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
86
- .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
87
- .ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; }
88
- .ui-sortable-placeholder * { visibility: hidden; }
89
-
90
- /* Icons
91
- ----------------------------------*/
92
-
93
- /* states and images */
94
- /*.ui-widget-content .ui-icon {background-image: url(images/ui-icons_999999_256x240.png); }
95
- .ui-widget-header .ui-icon {background-image: url(images/ui-icons_999999_256x240.png); } */
96
- .ui-state-default .ui-icon { background-image: url(images/ui-icons_70b2e1_256x240.png); }
97
- /*.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_3383bb_256x240.png); }
98
- .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
99
- .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_3383bb_256x240.png); }
100
- .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_fbc856_256x240.png); } */
101
-
102
- /* positioning */
103
- /*.ui-icon-carat-1-n { background-position: 0 0; }
104
- .ui-icon-carat-1-ne { background-position: -16px 0; }
105
- .ui-icon-carat-1-e { background-position: -32px 0; }
106
- .ui-icon-carat-1-se { background-position: -48px 0; }
107
- .ui-icon-carat-1-s { background-position: -64px 0; }
108
- .ui-icon-carat-1-sw { background-position: -80px 0; }
109
- .ui-icon-carat-1-w { background-position: -96px 0; }
110
- .ui-icon-carat-1-nw { background-position: -112px 0; }
111
- .ui-icon-carat-2-n-s { background-position: -128px 0; }
112
- .ui-icon-carat-2-e-w { background-position: -144px 0; }
113
- .ui-icon-triangle-1-n { background-position: 0 -16px; }
114
- .ui-icon-triangle-1-ne { background-position: -16px -16px; }
115
- .ui-icon-triangle-1-e { background-position: -32px -16px; }
116
- .ui-icon-triangle-1-se { background-position: -48px -16px; }
117
- .ui-icon-triangle-1-s { background-position: -64px -16px; }
118
- .ui-icon-triangle-1-sw { background-position: -80px -16px; }
119
- .ui-icon-triangle-1-w { background-position: -96px -16px; }
120
- .ui-icon-triangle-1-nw { background-position: -112px -16px; }
121
- .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
122
- .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
123
- .ui-icon-arrow-1-n { background-position: 0 -32px; }
124
- .ui-icon-arrow-1-ne { background-position: -16px -32px; }
125
- .ui-icon-arrow-1-e { background-position: -32px -32px; }
126
- .ui-icon-arrow-1-se { background-position: -48px -32px; }
127
- .ui-icon-arrow-1-s { background-position: -64px -32px; }
128
- .ui-icon-arrow-1-sw { background-position: -80px -32px; }
129
- .ui-icon-arrow-1-w { background-position: -96px -32px; }
130
- .ui-icon-arrow-1-nw { background-position: -112px -32px; }
131
- .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
132
- .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
133
- .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
134
- .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
135
- .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
136
- .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
137
- .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
138
- .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
139
- .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
140
- .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
141
- .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
142
- .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
143
- .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
144
- .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
145
- .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
146
- .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
147
- .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
148
- .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
149
- .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
150
- .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
151
- .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
152
- .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
153
- .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
154
- .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
155
- .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
156
- .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
157
- .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
158
- .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
159
- .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
160
- .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
161
- .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
162
- .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
163
- .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
164
- .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
165
- .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
166
- .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
167
- .ui-icon-arrow-4 { background-position: 0 -80px; }
168
- .ui-icon-arrow-4-diag { background-position: -16px -80px; }
169
- .ui-icon-extlink { background-position: -32px -80px; }
170
- .ui-icon-newwin { background-position: -48px -80px; }
171
- .ui-icon-refresh { background-position: -64px -80px; }
172
- .ui-icon-shuffle { background-position: -80px -80px; }
173
- .ui-icon-transfer-e-w { background-position: -96px -80px; }
174
- .ui-icon-transferthick-e-w { background-position: -112px -80px; }
175
- .ui-icon-folder-collapsed { background-position: 0 -96px; }
176
- .ui-icon-folder-open { background-position: -16px -96px; }
177
- .ui-icon-document { background-position: -32px -96px; }
178
- .ui-icon-document-b { background-position: -48px -96px; }
179
- .ui-icon-note { background-position: -64px -96px; }
180
- .ui-icon-mail-closed { background-position: -80px -96px; }
181
- .ui-icon-mail-open { background-position: -96px -96px; }
182
- .ui-icon-suitcase { background-position: -112px -96px; }
183
- .ui-icon-comment { background-position: -128px -96px; }
184
- .ui-icon-person { background-position: -144px -96px; }
185
- .ui-icon-print { background-position: -160px -96px; }
186
- .ui-icon-trash { background-position: -176px -96px; }
187
- .ui-icon-locked { background-position: -192px -96px; }
188
- .ui-icon-unlocked { background-position: -208px -96px; }
189
- .ui-icon-bookmark { background-position: -224px -96px; }
190
- .ui-icon-tag { background-position: -240px -96px; }
191
- .ui-icon-home { background-position: 0 -112px; }
192
- .ui-icon-flag { background-position: -16px -112px; }
193
- .ui-icon-calendar { background-position: -32px -112px; }
194
- .ui-icon-cart { background-position: -48px -112px; }
195
- .ui-icon-pencil { background-position: -64px -112px; }
196
- .ui-icon-clock { background-position: -80px -112px; }
197
- .ui-icon-disk { background-position: -96px -112px; }
198
- .ui-icon-calculator { background-position: -112px -112px; }
199
- .ui-icon-zoomin { background-position: -128px -112px; }
200
- .ui-icon-zoomout { background-position: -144px -112px; }
201
- .ui-icon-search { background-position: -160px -112px; }
202
- .ui-icon-wrench { background-position: -176px -112px; }
203
- .ui-icon-gear { background-position: -192px -112px; }
204
- .ui-icon-heart { background-position: -208px -112px; }
205
- .ui-icon-star { background-position: -224px -112px; }
206
- .ui-icon-link { background-position: -240px -112px; }
207
- .ui-icon-cancel { background-position: 0 -128px; } */
208
- .ui-icon-plus { background-position: -16px -128px; }
209
- .ui-icon-minus { background-position: -48px -128px; }
210
- .ui-icon-minusthick { background-position: -64px -128px; }
211
- /*.ui-icon-plusthick { background-position: -32px -128px; }
212
- .ui-icon-close { background-position: -80px -128px; }
213
- .ui-icon-closethick { background-position: -96px -128px; }
214
- .ui-icon-key { background-position: -112px -128px; }
215
- .ui-icon-lightbulb { background-position: -128px -128px; }
216
- .ui-icon-scissors { background-position: -144px -128px; }
217
- .ui-icon-clipboard { background-position: -160px -128px; }
218
- .ui-icon-copy { background-position: -176px -128px; }
219
- .ui-icon-contact { background-position: -192px -128px; }
220
- .ui-icon-image { background-position: -208px -128px; }
221
- .ui-icon-video { background-position: -224px -128px; }
222
- .ui-icon-script { background-position: -240px -128px; }
223
- .ui-icon-alert { background-position: 0 -144px; }
224
- .ui-icon-info { background-position: -16px -144px; }
225
- .ui-icon-notice { background-position: -32px -144px; }
226
- .ui-icon-help { background-position: -48px -144px; }
227
- .ui-icon-check { background-position: -64px -144px; }
228
- .ui-icon-bullet { background-position: -80px -144px; }
229
- .ui-icon-radio-off { background-position: -96px -144px; }
230
- .ui-icon-radio-on { background-position: -112px -144px; }
231
- .ui-icon-pin-w { background-position: -128px -144px; }
232
- .ui-icon-pin-s { background-position: -144px -144px; }
233
- .ui-icon-play { background-position: 0 -160px; }
234
- .ui-icon-pause { background-position: -16px -160px; }
235
- .ui-icon-seek-next { background-position: -32px -160px; }
236
- .ui-icon-seek-prev { background-position: -48px -160px; }
237
- .ui-icon-seek-end { background-position: -64px -160px; }
238
- .ui-icon-seek-start { background-position: -80px -160px; } */
239
- /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
240
- /*.ui-icon-seek-first { background-position: -80px -160px; }
241
- .ui-icon-stop { background-position: -96px -160px; }
242
- .ui-icon-eject { background-position: -112px -160px; }
243
- .ui-icon-volume-off { background-position: -128px -160px; }
244
- .ui-icon-volume-on { background-position: -144px -160px; }
245
- .ui-icon-power { background-position: 0 -176px; }
246
- .ui-icon-signal-diag { background-position: -16px -176px; }
247
- .ui-icon-signal { background-position: -32px -176px; }
248
- .ui-icon-battery-0 { background-position: -48px -176px; }
249
- .ui-icon-battery-1 { background-position: -64px -176px; }
250
- .ui-icon-battery-2 { background-position: -80px -176px; }
251
- .ui-icon-battery-3 { background-position: -96px -176px; }
252
- .ui-icon-circle-plus { background-position: 0 -192px; }
253
- .ui-icon-circle-minus { background-position: -16px -192px; }
254
- .ui-icon-circle-close { background-position: -32px -192px; }
255
- .ui-icon-circle-triangle-e { background-position: -48px -192px; }
256
- .ui-icon-circle-triangle-s { background-position: -64px -192px; }
257
- .ui-icon-circle-triangle-w { background-position: -80px -192px; }
258
- .ui-icon-circle-triangle-n { background-position: -96px -192px; }
259
- .ui-icon-circle-arrow-e { background-position: -112px -192px; }
260
- .ui-icon-circle-arrow-s { background-position: -128px -192px; }
261
- .ui-icon-circle-arrow-w { background-position: -144px -192px; }
262
- .ui-icon-circle-arrow-n { background-position: -160px -192px; }
263
- .ui-icon-circle-zoomin { background-position: -176px -192px; }
264
- .ui-icon-circle-zoomout { background-position: -192px -192px; }
265
- .ui-icon-circle-check { background-position: -208px -192px; }
266
- .ui-icon-circlesmall-plus { background-position: 0 -208px; }
267
- .ui-icon-circlesmall-minus { background-position: -16px -208px; }
268
- .ui-icon-circlesmall-close { background-position: -32px -208px; }
269
- .ui-icon-squaresmall-plus { background-position: -48px -208px; }
270
- .ui-icon-squaresmall-minus { background-position: -64px -208px; }
271
- .ui-icon-squaresmall-close { background-position: -80px -208px; }
272
- .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
273
- .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
274
- .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
275
- .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
276
- .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
277
- .ui-icon-grip-diagonal-se { background-position: -80px -224px; } */
278
-
279
-
280
- /* Misc visuals
281
- ----------------------------------*/
282
-
283
- /* Corner radius */
284
- .ui-corner-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; }
285
- .ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; }
286
- .ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; }
287
- .ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; }
288
- .ui-corner-top { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; }
289
- .ui-corner-bottom { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; }
290
- .ui-corner-right { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; }
291
- .ui-corner-left { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; }
292
- .ui-corner-all { -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; }
293
-
294
- /* Overlays */
295
- .ui-widget-overlay { background: #eeeeee url(images/ui-bg_flat_0_eeeeee_40x100.png) 50% 50% repeat-x; opacity: .80;filter:Alpha(Opacity=80); }
296
- .ui-widget-shadow { margin: -4px 0 0 -4px; padding: 4px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 0pxdow=0px; -webkit-border-radius: 0pxdow=0px; border-radius: 0pxdow=0px; }/*
297
- * jQuery UI Slider 1.8.8
298
- *
299
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
300
- * Dual licensed under the MIT or GPL Version 2 licenses.
301
- * http://jquery.org/license
302
- *
303
- * http://docs.jquery.com/UI/Slider#theming
304
- */
305
- .ui-slider { position: relative; text-align: left; width:340px; float:left }
306
- .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
307
- .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
308
- .ui-slider .minCaption { float: left }
309
- .ui-slider .maxCaption { float: right }
310
- .ui-slider .feedback { text-align:center; width:100%; display:block }
311
-
312
- .ui-slider-horizontal { height: .8em; }
313
- .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
314
- .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
315
- .ui-slider-horizontal .ui-slider-range-min { left: 0; }
316
- .ui-slider-horizontal .ui-slider-range-max { right: 0; }
317
-
318
- .ui-slider-vertical { width: .8em; height: 100px; }
319
- .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
320
- .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
321
- .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
322
- .ui-slider-vertical .ui-slider-range-max { top: 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/assets/css/overcast/jquery-ui-custom/jquery-ui-1.8.9.custom.css ADDED
@@ -0,0 +1,578 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI CSS Framework 1.8.13
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Theming/API
9
+ */
10
+
11
+ /* Layout helpers
12
+ ----------------------------------*/
13
+ .ui-helper-hidden { display: none; }
14
+ .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
+ .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
+ .ui-helper-clearfix { display: inline-block; }
18
+ /* required comment for clearfix to work in Opera \*/
19
+ * html .ui-helper-clearfix { height:1%; }
20
+ .ui-helper-clearfix { display:block; }
21
+ /* end clearfix */
22
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23
+
24
+
25
+ /* Interaction Cues
26
+ ----------------------------------*/
27
+ .ui-state-disabled { cursor: default !important; }
28
+
29
+
30
+ /* Icons
31
+ ----------------------------------*/
32
+
33
+ /* states and images */
34
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
35
+
36
+
37
+ /* Misc visuals
38
+ ----------------------------------*/
39
+
40
+ /* Overlays */
41
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42
+
43
+
44
+ /*
45
+ * jQuery UI CSS Framework 1.8.13
46
+ *
47
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
48
+ * Dual licensed under the MIT or GPL Version 2 licenses.
49
+ * http://jquery.org/license
50
+ *
51
+ * http://docs.jquery.com/UI/Theming/API
52
+ *
53
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
54
+ */
55
+
56
+
57
+ /* Component containers
58
+ ----------------------------------*/
59
+ .ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
60
+ .ui-widget .ui-widget { font-size: 1em; }
61
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
62
+ .ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(../images/jquery_ui/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; }
63
+ .ui-widget-content a { color: #333333; }
64
+ .ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(../images/jquery_ui/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
65
+ .ui-widget-header a { color: #ffffff; }
66
+
67
+ /* Interaction states
68
+ ----------------------------------*/
69
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(../images/jquery_ui/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
70
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
71
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(../images/jquery_ui/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; }
72
+ .ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; }
73
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(../images/jquery_ui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
74
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; }
75
+ .ui-widget :active { outline: none; }
76
+
77
+ /* Interaction Cues
78
+ ----------------------------------*/
79
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(../images/jquery_ui/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; }
80
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
81
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(../images/jquery_ui/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; }
82
+ .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
83
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
84
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
85
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
86
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
87
+
88
+ /* Icons
89
+ ----------------------------------*/
90
+
91
+ /* states and images */
92
+ .ui-icon { width: 16px; height: 16px; background-image: url(../images/jquery_ui/ui-icons_222222_256x240.png); }
93
+ .ui-widget-content .ui-icon {background-image: url(../images/jquery_ui/ui-icons_222222_256x240.png); }
94
+ .ui-widget-header .ui-icon {background-image: url(../images/jquery_ui/ui-icons_ffffff_256x240.png); }
95
+ .ui-state-default .ui-icon { background-image: url(../images/jquery_ui/ui-icons_ef8c08_256x240.png); }
96
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../images/jquery_ui/ui-icons_ef8c08_256x240.png); }
97
+ .ui-state-active .ui-icon {background-image: url(../images/jquery_ui/ui-icons_ef8c08_256x240.png); }
98
+ .ui-state-highlight .ui-icon {background-image: url(../images/jquery_ui/ui-icons_228ef1_256x240.png); }
99
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(../images/jquery_ui/ui-icons_ffd27a_256x240.png); }
100
+
101
+ /* positioning */
102
+ .ui-icon-carat-1-n { background-position: 0 0; }
103
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
104
+ .ui-icon-carat-1-e { background-position: -32px 0; }
105
+ .ui-icon-carat-1-se { background-position: -48px 0; }
106
+ .ui-icon-carat-1-s { background-position: -64px 0; }
107
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
108
+ .ui-icon-carat-1-w { background-position: -96px 0; }
109
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
110
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
111
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
112
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
113
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
114
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
115
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
116
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
117
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
118
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
119
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
120
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
121
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
122
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
123
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
124
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
125
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
126
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
127
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
128
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
129
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
130
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
131
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
132
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
133
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
134
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
135
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
136
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
137
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
138
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
139
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
140
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
141
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
142
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
143
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
144
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
145
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
146
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
147
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
148
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
149
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
150
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
151
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
152
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
153
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
154
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
155
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
156
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
157
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
158
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
159
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
160
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
161
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
162
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
163
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
164
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
165
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
166
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
167
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
168
+ .ui-icon-extlink { background-position: -32px -80px; }
169
+ .ui-icon-newwin { background-position: -48px -80px; }
170
+ .ui-icon-refresh { background-position: -64px -80px; }
171
+ .ui-icon-shuffle { background-position: -80px -80px; }
172
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
173
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
174
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
175
+ .ui-icon-folder-open { background-position: -16px -96px; }
176
+ .ui-icon-document { background-position: -32px -96px; }
177
+ .ui-icon-document-b { background-position: -48px -96px; }
178
+ .ui-icon-note { background-position: -64px -96px; }
179
+ .ui-icon-mail-closed { background-position: -80px -96px; }
180
+ .ui-icon-mail-open { background-position: -96px -96px; }
181
+ .ui-icon-suitcase { background-position: -112px -96px; }
182
+ .ui-icon-comment { background-position: -128px -96px; }
183
+ .ui-icon-person { background-position: -144px -96px; }
184
+ .ui-icon-print { background-position: -160px -96px; }
185
+ .ui-icon-trash { background-position: -176px -96px; }
186
+ .ui-icon-locked { background-position: -192px -96px; }
187
+ .ui-icon-unlocked { background-position: -208px -96px; }
188
+ .ui-icon-bookmark { background-position: -224px -96px; }
189
+ .ui-icon-tag { background-position: -240px -96px; }
190
+ .ui-icon-home { background-position: 0 -112px; }
191
+ .ui-icon-flag { background-position: -16px -112px; }
192
+ .ui-icon-calendar { background-position: -32px -112px; }
193
+ .ui-icon-cart { background-position: -48px -112px; }
194
+ .ui-icon-pencil { background-position: -64px -112px; }
195
+ .ui-icon-clock { background-position: -80px -112px; }
196
+ .ui-icon-disk { background-position: -96px -112px; }
197
+ .ui-icon-calculator { background-position: -112px -112px; }
198
+ .ui-icon-zoomin { background-position: -128px -112px; }
199
+ .ui-icon-zoomout { background-position: -144px -112px; }
200
+ .ui-icon-search { background-position: -160px -112px; }
201
+ .ui-icon-wrench { background-position: -176px -112px; }
202
+ .ui-icon-gear { background-position: -192px -112px; }
203
+ .ui-icon-heart { background-position: -208px -112px; }
204
+ .ui-icon-star { background-position: -224px -112px; }
205
+ .ui-icon-link { background-position: -240px -112px; }
206
+ .ui-icon-cancel { background-position: 0 -128px; }
207
+ .ui-icon-plus { background-position: -16px -128px; }
208
+ .ui-icon-plusthick { background-position: -32px -128px; }
209
+ .ui-icon-minus { background-position: -48px -128px; }
210
+ .ui-icon-minusthick { background-position: -64px -128px; }
211
+ .ui-icon-close { background-position: -80px -128px; }
212
+ .ui-icon-closethick { background-position: -96px -128px; }
213
+ .ui-icon-key { background-position: -112px -128px; }
214
+ .ui-icon-lightbulb { background-position: -128px -128px; }
215
+ .ui-icon-scissors { background-position: -144px -128px; }
216
+ .ui-icon-clipboard { background-position: -160px -128px; }
217
+ .ui-icon-copy { background-position: -176px -128px; }
218
+ .ui-icon-contact { background-position: -192px -128px; }
219
+ .ui-icon-image { background-position: -208px -128px; }
220
+ .ui-icon-video { background-position: -224px -128px; }
221
+ .ui-icon-script { background-position: -240px -128px; }
222
+ .ui-icon-alert { background-position: 0 -144px; }
223
+ .ui-icon-info { background-position: -16px -144px; }
224
+ .ui-icon-notice { background-position: -32px -144px; }
225
+ .ui-icon-help { background-position: -48px -144px; }
226
+ .ui-icon-check { background-position: -64px -144px; }
227
+ .ui-icon-bullet { background-position: -80px -144px; }
228
+ .ui-icon-radio-off { background-position: -96px -144px; }
229
+ .ui-icon-radio-on { background-position: -112px -144px; }
230
+ .ui-icon-pin-w { background-position: -128px -144px; }
231
+ .ui-icon-pin-s { background-position: -144px -144px; }
232
+ .ui-icon-play { background-position: 0 -160px; }
233
+ .ui-icon-pause { background-position: -16px -160px; }
234
+ .ui-icon-seek-next { background-position: -32px -160px; }
235
+ .ui-icon-seek-prev { background-position: -48px -160px; }
236
+ .ui-icon-seek-end { background-position: -64px -160px; }
237
+ .ui-icon-seek-start { background-position: -80px -160px; }
238
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
239
+ .ui-icon-seek-first { background-position: -80px -160px; }
240
+ .ui-icon-stop { background-position: -96px -160px; }
241
+ .ui-icon-eject { background-position: -112px -160px; }
242
+ .ui-icon-volume-off { background-position: -128px -160px; }
243
+ .ui-icon-volume-on { background-position: -144px -160px; }
244
+ .ui-icon-power { background-position: 0 -176px; }
245
+ .ui-icon-signal-diag { background-position: -16px -176px; }
246
+ .ui-icon-signal { background-position: -32px -176px; }
247
+ .ui-icon-battery-0 { background-position: -48px -176px; }
248
+ .ui-icon-battery-1 { background-position: -64px -176px; }
249
+ .ui-icon-battery-2 { background-position: -80px -176px; }
250
+ .ui-icon-battery-3 { background-position: -96px -176px; }
251
+ .ui-icon-circle-plus { background-position: 0 -192px; }
252
+ .ui-icon-circle-minus { background-position: -16px -192px; }
253
+ .ui-icon-circle-close { background-position: -32px -192px; }
254
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
255
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
256
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
257
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
258
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
259
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
260
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
261
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
262
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
263
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
264
+ .ui-icon-circle-check { background-position: -208px -192px; }
265
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
266
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
267
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
268
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
269
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
270
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
271
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
272
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
273
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
274
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
275
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
276
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
277
+
278
+
279
+ /* Misc visuals
280
+ ----------------------------------*/
281
+
282
+ /* Corner radius */
283
+ .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; }
284
+ .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
285
+ .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
286
+ .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
287
+ .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
288
+ .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
289
+ .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
290
+ .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
291
+ .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
292
+
293
+ /* Overlays */
294
+ .ui-widget-overlay { background: #666666 url(../images/jquery_ui/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); }
295
+ .ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(../images/jquery_ui/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/*
296
+ * jQuery UI Resizable 1.8.13
297
+ *
298
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
299
+ * Dual licensed under the MIT or GPL Version 2 licenses.
300
+ * http://jquery.org/license
301
+ *
302
+ * http://docs.jquery.com/UI/Resizable#theming
303
+ */
304
+ .ui-resizable { position: relative;}
305
+ .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;
306
+ /* http://bugs.jqueryui.com/ticket/7233
307
+ - Resizable: resizable handles fail to work in IE if transparent and content overlaps
308
+ */
309
+ background-image:url(data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=);
310
+ }
311
+ .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
312
+ .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
313
+ .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
314
+ .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
315
+ .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
316
+ .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
317
+ .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
318
+ .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
319
+ .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
320
+ * jQuery UI Selectable 1.8.13
321
+ *
322
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
323
+ * Dual licensed under the MIT or GPL Version 2 licenses.
324
+ * http://jquery.org/license
325
+ *
326
+ * http://docs.jquery.com/UI/Selectable#theming
327
+ */
328
+ .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
329
+ /*
330
+ * jQuery UI Accordion 1.8.13
331
+ *
332
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
333
+ * Dual licensed under the MIT or GPL Version 2 licenses.
334
+ * http://jquery.org/license
335
+ *
336
+ * http://docs.jquery.com/UI/Accordion#theming
337
+ */
338
+ /* IE/Win - Fix animation bug - #4615 */
339
+ .ui-accordion { width: 100%; }
340
+ .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
341
+ .ui-accordion .ui-accordion-li-fix { display: inline; }
342
+ .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
343
+ .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
344
+ .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
345
+ .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
346
+ .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
347
+ .ui-accordion .ui-accordion-content-active { display: block; }
348
+ /*
349
+ * jQuery UI Autocomplete 1.8.13
350
+ *
351
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
352
+ * Dual licensed under the MIT or GPL Version 2 licenses.
353
+ * http://jquery.org/license
354
+ *
355
+ * http://docs.jquery.com/UI/Autocomplete#theming
356
+ */
357
+ .ui-autocomplete { position: absolute; cursor: default; }
358
+
359
+ /* workarounds */
360
+ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
361
+
362
+ /*
363
+ * jQuery UI Menu 1.8.13
364
+ *
365
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
366
+ * Dual licensed under the MIT or GPL Version 2 licenses.
367
+ * http://jquery.org/license
368
+ *
369
+ * http://docs.jquery.com/UI/Menu#theming
370
+ */
371
+ .ui-menu {
372
+ list-style:none;
373
+ padding: 2px;
374
+ margin: 0;
375
+ display:block;
376
+ float: left;
377
+ }
378
+ .ui-menu .ui-menu {
379
+ margin-top: -3px;
380
+ }
381
+ .ui-menu .ui-menu-item {
382
+ margin:0;
383
+ padding: 0;
384
+ zoom: 1;
385
+ float: left;
386
+ clear: left;
387
+ width: 100%;
388
+ }
389
+ .ui-menu .ui-menu-item a {
390
+ text-decoration:none;
391
+ display:block;
392
+ padding:.2em .4em;
393
+ line-height:1.5;
394
+ zoom:1;
395
+ }
396
+ .ui-menu .ui-menu-item a.ui-state-hover,
397
+ .ui-menu .ui-menu-item a.ui-state-active {
398
+ font-weight: normal;
399
+ margin: -1px;
400
+ }
401
+ /*
402
+ * jQuery UI Button 1.8.13
403
+ *
404
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
405
+ * Dual licensed under the MIT or GPL Version 2 licenses.
406
+ * http://jquery.org/license
407
+ *
408
+ * http://docs.jquery.com/UI/Button#theming
409
+ */
410
+ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
411
+ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
412
+ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
413
+ .ui-button-icons-only { width: 3.4em; }
414
+ button.ui-button-icons-only { width: 3.7em; }
415
+
416
+ /*button text element */
417
+ .ui-button .ui-button-text { display: block; line-height: 1.4; }
418
+ .ui-button-text-only .ui-button-text { padding: .4em 1em; }
419
+ .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
420
+ .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
421
+ .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
422
+ .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
423
+ /* no icon support for input elements, provide padding by default */
424
+ input.ui-button { padding: .4em 1em; }
425
+
426
+ /*button icon element(s) */
427
+ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
428
+ .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
429
+ .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
430
+ .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
431
+ .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
432
+
433
+ /*button sets*/
434
+ .ui-buttonset { margin-right: 7px; }
435
+ .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
436
+
437
+ /* workarounds */
438
+ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
439
+ /*
440
+ * jQuery UI Dialog 1.8.13
441
+ *
442
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
443
+ * Dual licensed under the MIT or GPL Version 2 licenses.
444
+ * http://jquery.org/license
445
+ *
446
+ * http://docs.jquery.com/UI/Dialog#theming
447
+ */
448
+ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
449
+ .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
450
+ .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
451
+ .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
452
+ .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
453
+ .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
454
+ .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
455
+ .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
456
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
457
+ .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
458
+ .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
459
+ .ui-draggable .ui-dialog-titlebar { cursor: move; }
460
+ /*
461
+ * jQuery UI Slider 1.8.13
462
+ *
463
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
464
+ * Dual licensed under the MIT or GPL Version 2 licenses.
465
+ * http://jquery.org/license
466
+ *
467
+ * http://docs.jquery.com/UI/Slider#theming
468
+ */
469
+ .ui-slider { position: relative; text-align: left; }
470
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
471
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
472
+
473
+ .ui-slider-horizontal { height: .8em; }
474
+ .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
475
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
476
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
477
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
478
+
479
+ .ui-slider-vertical { width: .8em; height: 100px; }
480
+ .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
481
+ .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
482
+ .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
483
+ .ui-slider-vertical .ui-slider-range-max { top: 0; }/*
484
+ * jQuery UI Tabs 1.8.13
485
+ *
486
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
487
+ * Dual licensed under the MIT or GPL Version 2 licenses.
488
+ * http://jquery.org/license
489
+ *
490
+ * http://docs.jquery.com/UI/Tabs#theming
491
+ */
492
+ .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
493
+ .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
494
+ .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
495
+ .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
496
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
497
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
498
+ .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
499
+ .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
500
+ .ui-tabs .ui-tabs-hide { display: none !important; }
501
+ /*
502
+ * jQuery UI Datepicker 1.8.13
503
+ *
504
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
505
+ * Dual licensed under the MIT or GPL Version 2 licenses.
506
+ * http://jquery.org/license
507
+ *
508
+ * http://docs.jquery.com/UI/Datepicker#theming
509
+ */
510
+ .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
511
+ .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
512
+ .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
513
+ .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
514
+ .ui-datepicker .ui-datepicker-prev { left:2px; }
515
+ .ui-datepicker .ui-datepicker-next { right:2px; }
516
+ .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
517
+ .ui-datepicker .ui-datepicker-next-hover { right:1px; }
518
+ .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
519
+ .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
520
+ .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
521
+ .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
522
+ .ui-datepicker select.ui-datepicker-month,
523
+ .ui-datepicker select.ui-datepicker-year { width: 49%;}
524
+ .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
525
+ .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
526
+ .ui-datepicker td { border: 0; padding: 1px; }
527
+ .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
528
+ .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
529
+ .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
530
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
531
+
532
+ /* with multiple calendars */
533
+ .ui-datepicker.ui-datepicker-multi { width:auto; }
534
+ .ui-datepicker-multi .ui-datepicker-group { float:left; }
535
+ .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
536
+ .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
537
+ .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
538
+ .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
539
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
540
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
541
+ .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
542
+ .ui-datepicker-row-break { clear:both; width:100%; }
543
+
544
+ /* RTL support */
545
+ .ui-datepicker-rtl { direction: rtl; }
546
+ .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
547
+ .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
548
+ .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
549
+ .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
550
+ .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
551
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
552
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
553
+ .ui-datepicker-rtl .ui-datepicker-group { float:right; }
554
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
555
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
556
+
557
+ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
558
+ .ui-datepicker-cover {
559
+ display: none; /*sorry for IE5*/
560
+ display/**/: block; /*sorry for IE5*/
561
+ position: absolute; /*must have*/
562
+ z-index: -1; /*must have*/
563
+ filter: mask(); /*must have*/
564
+ top: -4px; /*must have*/
565
+ left: -4px; /*must have*/
566
+ width: 200px; /*must have*/
567
+ height: 200px; /*must have*/
568
+ }/*
569
+ * jQuery UI Progressbar 1.8.13
570
+ *
571
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
572
+ * Dual licensed under the MIT or GPL Version 2 licenses.
573
+ * http://jquery.org/license
574
+ *
575
+ * http://docs.jquery.com/UI/Progressbar#theming
576
+ */
577
+ .ui-progressbar { height:2em; text-align: left; }
578
+ .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
plugin-fw/assets/css/yit-plugin-panel-sidebar.css ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This file belongs to the YIT Plugin Framework.
3
+ *
4
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
+ * that is bundled with this package in the file LICENSE.txt.
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.gnu.org/licenses/gpl-3.0.txt
8
+ */
9
+
10
+ /* === Panel Sidebar === */
11
+ #yit-panel-sidebar {
12
+ width : 275px;
13
+ float : right;
14
+ margin : 10px 0 0 10px;
15
+ }
16
+
17
+ #yit-panel-sidebar.yith-panel-sidebar-hidden {
18
+ position : absolute;
19
+ top : 0;
20
+ right : 0;
21
+ }
22
+
23
+ #yit-panel-sidebar.yith-panel-sidebar-hidden #yit-panel-sidebar-widgets-container {
24
+ display : none;
25
+ }
26
+
27
+ .yit-panel-sidebar-widget-wrapper {
28
+ position : relative;
29
+ margin : 10px 0 30px 0;
30
+ }
31
+
32
+ .yit-panel-sidebar-widget-container {
33
+ border-radius : 5px;
34
+ border : 1px solid #ddd;
35
+ background : #fff;
36
+ box-shadow : 0 2px 1px -1px #ccc;
37
+ overflow : hidden;
38
+ }
39
+
40
+ .yit-panel-sidebar-widget-container a {
41
+ text-decoration : none;
42
+ }
43
+
44
+ .yit-panel-sidebar-widget-container img.yit-panel-sidebar-widget-image {
45
+ width : 100%;
46
+ position : relative;
47
+ bottom : -5px;
48
+ }
49
+
50
+ .yit-panel-sidebar-widget-title {
51
+ padding : 12px 10px;
52
+ background : #f4f4f4;
53
+ font-size : 10px;
54
+ text-transform : uppercase;
55
+ font-weight : 700;
56
+ }
57
+
58
+ .yit-panel-sidebar-widget-title.dashicons {
59
+ width : auto !important;
60
+ height : auto !important;
61
+ display : block;
62
+ font-family : "Open Sans", sans-serif;
63
+ text-align : left;
64
+ }
65
+
66
+ .yit-panel-sidebar-widget-title.dashicons::before {
67
+ font-family : "Dashicons";
68
+ font-size : 18px;
69
+ display : inline-block;
70
+ vertical-align : middle;
71
+ margin-right : 10px;
72
+ font-weight : normal;
73
+ }
74
+
75
+ .yit-panel-sidebar-widget-title.orange {
76
+ background : #ff643e;
77
+ color : #fff;
78
+ }
79
+
80
+ .yit-panel-sidebar-widget-title.green {
81
+ background : #a3c401;
82
+ color : #fff;
83
+ }
84
+
85
+ .yit-panel-sidebar-widget-title.red {
86
+ background : #e4313c;
87
+ color : #fff;
88
+ }
89
+
90
+ .yit-panel-sidebar-widget-title.yellow {
91
+ background : #ffc400;
92
+ color : #333;
93
+ }
94
+
95
+ .yit-panel-sidebar-widget-title.center {
96
+ text-align : center;
97
+ }
98
+
99
+ .yit-panel-sidebar-widget-title.right {
100
+ text-align : right;
101
+ }
102
+
103
+ .yit-panel-sidebar-widget-content {
104
+ padding : 15px;
105
+ }
106
+
107
+ .yit-panel-sidebar-widget-content p {
108
+ font-size : 11px;
109
+ line-height : 18px;
110
+ margin : 0;
111
+ text-align : justify;
112
+ }
113
+
114
+ .yit-panel-sidebar-widget-badge.gift-tape {
115
+ color : #000;
116
+ font-family : "Open Sans", sans-serif;
117
+ box-sizing : border-box;
118
+ position : absolute;
119
+ background-color : transparent;
120
+ width : 70px;
121
+ height : 70px;
122
+ overflow : hidden;
123
+ top : 0;
124
+ right : 0;
125
+ }
126
+
127
+ .yit-panel-sidebar-widget-badge.gift-tape div.yit-panel-sidebar-widget-badge-text {
128
+ background : #ffd600;
129
+ background : -webkit-linear-gradient(left, #fe8502, #ffe400); /* For Safari 5.1 to 6.0 */
130
+ background : -o-linear-gradient(right, #fe8502, #ffe400); /* For Opera 11.1 to 12.0 */
131
+ background : -moz-linear-gradient(right, #fe8502, #ffe400); /* For Firefox 3.6 to 15 */
132
+ background : linear-gradient(to right, #fe8502, #ffe400); /* Standard syntax */
133
+ font-size : 10px;
134
+ font-weight : bold;
135
+ line-height : 24px;
136
+ position : absolute;
137
+ text-align : center;
138
+ z-index : 100;
139
+ -webkit-transform : rotate(45deg);
140
+ -ms-transform : rotate(45deg);
141
+ transform : rotate(45deg);
142
+ top : 15px;
143
+ left : -6px;
144
+ width : 100px;
145
+ text-shadow : 1px 1px 1px #fff;
146
+ }
147
+
148
+ img.yit-panel-sidebar-widget-despacho-image {
149
+ background : #ffffff;
150
+ background : -webkit-linear-gradient(#ffffff, #a5b7c5); /* For Safari 5.1 to 6.0 */
151
+ background : -o-linear-gradient(#ffffff, #a5b7c5); /* For Opera 11.1 to 12.0 */
152
+ background : -moz-linear-gradient(#ffffff, #a5b7c5); /* For Firefox 3.6 to 15 */
153
+ background : linear-gradient(#ffffff, #a5b7c5); /* Standard syntax */
154
+ }
155
+
156
+ /* ==== Buttons ==== */
157
+ #yit-panel-sidebar .button {
158
+ color : #ffffff;
159
+ border : none;
160
+ background : #666666;
161
+ -webkit-box-shadow : none;
162
+ box-shadow : none;
163
+ vertical-align : middle;
164
+ text-transform : uppercase;
165
+ font-size : 11px;
166
+ font-weight : 700;
167
+ height : 32px;
168
+ line-height : 32px;
169
+ padding : 0 18px 1px;
170
+ }
171
+
172
+ #yit-panel-sidebar .button.orange {
173
+ background : #ff6340;
174
+ }
175
+
176
+ #yit-panel-sidebar .button.green {
177
+ background : #a3c401;
178
+ }
179
+
180
+ #yit-panel-sidebar .button.red {
181
+ background : #e4313c;
182
+ }
183
+
184
+ #yit-panel-sidebar .button.yellow {
185
+ background : #ffc400;
186
+ }
187
+
188
+ /* === Title Icons === */
189
+ #yit-panel-sidebar .yit-panel-sidebar-widget-icon:before {
190
+ content : " ";
191
+ width : 16px;
192
+ height : 16px;
193
+ display : inline-block;
194
+ vertical-align : middle;
195
+ margin-right : 10px;
196
+ }
197
+
198
+ #yit-panel-sidebar .yit-panel-sidebar-widget-icon.link-icon:before {
199
+ background : transparent url('../images/widgets/link-icon.png') no-repeat;
200
+ background-size : contain;
201
+ }
202
+
203
+ #yit-panel-sidebar .yit-panel-sidebar-widget-icon.info-icon:before {
204
+ background : transparent url('../images/widgets/info-icon.png') no-repeat;
205
+ background-size : contain;
206
+ }
207
+
208
+ #yit-panel-sidebar .yit-panel-sidebar-widget-icon.box-icon:before {
209
+ background : transparent url('../images/widgets/box-icon.png') no-repeat;
210
+ background-size : contain;
211
+ }
212
+
213
+ #yit-panel-sidebar .yit-panel-sidebar-widget-icon.box-white-icon:before {
214
+ background : transparent url('../images/widgets/box-white-icon.png') no-repeat;
215
+ background-size : contain;
216
+ }
217
+
218
+ /* ==== Membership Widget ==== */
219
+ #yit-panel-sidebar-membership-widget {
220
+
221
+ }
222
+
223
+ #yit-panel-sidebar-membership-widget .yit-panel-sidebar-widget-title {
224
+ text-align : center;
225
+ }
226
+
227
+ #yit-panel-sidebar-membership-widget .yit-panel-sidebar-widget-content {
228
+ background : transparent url('../images/widgets/membership-bg.png') no-repeat;
229
+ background-position : 105% 160%;
230
+ background-size : 50%;
231
+ }
232
+
233
+ #yit-panel-sidebar-membership-widget .membership-row {
234
+ margin-bottom: 20px;
235
+ clear : both;
236
+ overflow: hidden;
237
+ }
238
+
239
+ #yit-panel-sidebar-membership-widget .membership-total-price {
240
+ font-size : 25px;
241
+ font-weight : 700;
242
+ display : block;
243
+ width : 50%;
244
+ box-sizing : border-box;
245
+ float : left;
246
+ line-height : 37px;
247
+
248
+ }
249
+
250
+ #yit-panel-sidebar-membership-widget .membership-offer-text {
251
+ display : block;
252
+ font-size : 10px;
253
+ text-transform : uppercase;
254
+ width : 50%;
255
+ line-height : 14px;
256
+ box-sizing : border-box;
257
+ float : left;
258
+ }
259
+
260
+ #yit-panel-sidebar-membership-widget .membership-offer-text2 {
261
+ display : block;
262
+ font-size : 10px;
263
+ text-transform : uppercase;
264
+ text-align : right;
265
+ vertical-align : middle;
266
+ float : left;
267
+ }
268
+
269
+ #yit-panel-sidebar-membership-widget .membership-offer-sale-text {
270
+ display : block;
271
+ font-size : 22px;
272
+ color : #ff6340;
273
+ text-transform : uppercase;
274
+ text-align : left;
275
+ vertical-align : middle;
276
+ margin-left : 6px;
277
+ font-weight : 600;
278
+ float : left;
279
+ }
280
+
281
+ #yit-panel-sidebar-membership-widget .membership-buttons {
282
+ text-align : center;
283
+ margin-bottom : 10px;
284
+ }
285
+
286
+ /* ==== Important Links Widget ==== */
287
+ #yit-panel-sidebar-links-widget .yit-panel-sidebar-widget-content {
288
+ background : transparent url('../images/widgets/link-bg.png') no-repeat;
289
+ background-position : 110% 120%;
290
+ background-size : 50%;
291
+ }
292
+
293
+ ul.yit-panel-sidebar-links-list {
294
+ margin : 0;
295
+ }
296
+
297
+ ul.yit-panel-sidebar-links-list li {
298
+ margin : 0 0 10px 0;
299
+ }
300
+
301
+ ul.yit-panel-sidebar-links-list li:before {
302
+ content : " ";
303
+ width : 15px;
304
+ height : 13px;
305
+ display : inline-block;
306
+ background : transparent url('../images/ui-icons_454545_256x240.png') no-repeat -64px -144px;
307
+ margin-right : 7px;
308
+ }
309
+
310
+ /* === Sidebar Actions ===*/
311
+ #yit-panel-sidebar-actions {
312
+ text-align : right;
313
+ }
314
+
315
+ .yit-panel-sidebar-action-title {
316
+ margin-right : 5px;
317
+ text-transform : uppercase;
318
+ font-size : 11px;
319
+ }
320
+
321
+ #yit-panel-sidebar-action-hide {
322
+ text-align : right;
323
+ cursor : pointer;
324
+ }
325
+
326
+ .yit-panel-sidebar-action-hide-icon {
327
+ color : #f4f4f4;
328
+ background : #565656;
329
+ border-radius : 50%;
330
+ }
331
+
332
+ #yit-panel-sidebar-action-hide:hover .yit-panel-sidebar-action-title {
333
+ color : #000;
334
+ }
335
+
336
+ #yit-panel-sidebar-action-hide:hover .yit-panel-sidebar-action-hide-icon {
337
+ background : #000;
338
+ }
339
+
340
+ .hide-on-click .yit-panel-sidebar-action-hide-icon:before {
341
+ content : "\f139" !important;
342
+ }
343
+
344
+ /* === Responsive === */
345
+
346
+ @media (min-width : 767px) {
347
+ #wpbody-content #yit-panel-sidebar {
348
+ margin-right : 15px;
349
+ }
350
+ }
351
+
352
+ @media (max-width : 767px) {
353
+ #yit-panel-sidebar {
354
+ width : 275px;
355
+ margin : 20px auto 0 auto;
356
+ float : none;
357
+ display : block;
358
+ }
359
+
360
+ #yit-panel-sidebar.yith-panel-sidebar-hidden {
361
+ position : static;
362
+ }
363
+
364
+ #yit-panel-sidebar-actions {
365
+ text-align : center;
366
+ }
367
+
368
+ #yit-panel-sidebar-action-hide {
369
+ text-align : center;
370
+ }
371
+ }
372
+
373
+ @media (max-width : 480px) {
374
+
375
+ }
376
+
377
+ @media (min-width : 768px) and (max-width : 992px) {
378
+ }
379
+
380
+ @media (min-width : 980px) and (max-width : 1199px) {
381
+ }
382
+
383
+ @media (min-width : 1200px) {
384
+
385
+ }
386
+
387
+ @media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (-o-min-device-pixel-ratio : 3/2), only screen and (min--moz-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) {
388
+ }
plugin-fw/assets/css/yit-plugin-panel.css CHANGED
@@ -1,664 +1,713 @@
1
- /*
2
- * This file belongs to the YIT Plugin Framework.
3
- *
4
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
- * that is bundled with this package in the file LICENSE.txt.
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.gnu.org/licenses/gpl-3.0.txt
8
- */
9
-
10
- /* onoff */
11
- .rm_onoff input {
12
- display: none;
13
- }
14
-
15
- .rm_onoff input + span {
16
- cursor: pointer;
17
- text-indent: -9999px;
18
- display: block;
19
- width: 85px;
20
- height: 37px;
21
- background: transparent url(../images/off.png);
22
- }
23
-
24
- .rm_onoff input:checked + span {
25
- background: transparent url(../images/on.png);
26
- }
27
-
28
- .rm_onoff input.onoffchecked + span {
29
- background: transparent url(../images/on.png);
30
- }
31
-
32
- /* slider */
33
- /*numbers*/
34
- .ui-slider .maxCaption, .ui-slider .minCaption {
35
- margin-bottom: 5px;
36
- }
37
- .ui-slider .feedback {
38
- background: url(../images/slider/tooltip.png) no-repeat center top;
39
- position: absolute;
40
- top: -25px;
41
- width: 35px;
42
- height: 43px;
43
- text-align: center;
44
- width: 100%;
45
- display: block;
46
- }
47
- .ui-slider .feedback strong {
48
- display: inline-block;
49
- padding-top: 4px;
50
- top: -30px;
51
- }
52
- /*handle*/
53
- .yit-options .ui-slider-horizontal .ui-slider-handle,
54
- .yit_options .ui-slider-horizontal .ui-slider-handle {
55
- background: transparent url(../images/slider/handle.png) no-repeat left top !important;
56
- border: 0px !important;
57
- top: -.35em !important;
58
- width: 18px !important;
59
- height: 19px !important;
60
- }
61
-
62
- /*bg on the left:grey*/
63
- .yit-options .ui-slider.ui-widget-content,
64
- .yit_options .ui-slider.ui-widget-content {
65
- background: url(../images/slider/grey.gif) repeat-x left center !important;
66
- border-color: #c1c1c0 !important;
67
- height: 10px !important;
68
- }
69
-
70
- .iris-slider-offset.ui-slider.ui-widget-content {
71
- background: transparent!important;
72
- height: auto!important;
73
- }
74
-
75
- /*bg on the right:orange*/
76
- .ui-slider.ui-widget-content .ui-widget-header {
77
- background: url(../images/slider/orange.gif) repeat-x left center !important;
78
- left: 2px !important;
79
- -webkit-border-radius: 15px;
80
- -moz-border-radius: 15px;
81
- -khtml-border-radius: 15px;
82
- border-radius: 15px;
83
- }
84
-
85
- .plugin-option tr{
86
- border-bottom: 1px solid #ccc;
87
- }
88
- .plugin-option .yit_options,
89
- .plugin-option .yit-options{
90
- border-bottom: 0px;
91
- }
92
- .plugin-option .yit-options .option,
93
- .plugin-option .yit_options .option {
94
- width: 600px;
95
- float: left;
96
- }
97
-
98
- .plugin-option .form-table td{
99
- padding: 25px 10px;
100
- }
101
-
102
- .yit_options .select_wrapper,
103
- .yit-options .select_wrapper {
104
- background: url("../images/select.png") no-repeat scroll right center #FAFAFA;
105
- border-color: #CCCCCC #EEEEEE #EEEEEE #CCCCCC;
106
- border-radius: 4px 4px 4px 4px;
107
- border-style: solid;
108
- border-width: 1px;
109
- color: #555555;
110
- display: block;
111
- float: left;
112
- font-family: sans-serif;
113
- font-size: 12px;
114
- height: 26px;
115
- margin-bottom: 9px !important;
116
- margin-left: 0;
117
- margin-right: 5px;
118
- margin-top: 0;
119
- width: 400px;
120
- }
121
- .chosen .select_wrapper {
122
- background: none;
123
- border: none;
124
- }
125
- .chosen .select_wrapper .chosen-container{
126
- width: 338px!important;
127
- }
128
- .chosen .select_wrapper .chosen-container .search-field input{
129
- height: 27px!important;
130
- color: #333;
131
- }
132
- .chosen .select_wrapper .chosen-container .chosen-choices{
133
- border: 1px solid #ddd;
134
- box-shadow: none;
135
- }
136
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice{
137
- height: 15px!important;
138
- min-width: 105px;
139
- }
140
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice span{
141
- line-height: 15px;
142
- height: 15px;
143
- padding-top: 2px;
144
- }
145
- .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice a.search-choice-close{
146
- top: 5px;
147
- }
148
- .chosen .select_wrapper .chosen-container .chosen-drop .chosen-search input{
149
- width: 100%!important;
150
- }
151
-
152
- /* === Multiple Chosen Customizzation === */
153
-
154
- .yith-choosen .chosen-choices {
155
- line-height: 27px;
156
- min-height: 27px;
157
- border: 1px solid #ddd;
158
- }
159
-
160
- .yith-choosen .chosen-container-active .chosen-choices{
161
- border: 1px solid #5b9dd9;
162
- -webkit-box-shadow: 0 0 2px rgba(30,140,190,.8);
163
- box-shadow: 0 0 2px rgba(30,140,190,.8);
164
- }
165
-
166
- .select_wrapper span {
167
- height: 26px;
168
- line-height: 26px;
169
- padding-left: 6px;
170
- position: absolute;
171
- z-index: 2;
172
- overflow: hidden;
173
- }
174
- .ie8 .yit_options select,
175
- .ie8 .yit-options select {
176
- height: 26px;
177
- }
178
- .yit_options select, .yit-options select, .the-metabox .select_wrapper select {
179
- cursor: pointer;
180
- height: 28px;
181
- margin: 0;
182
- opacity: 0;
183
- padding: 0;
184
- position: relative;
185
- width: inherit;
186
- z-index: 4;
187
- background-color: #FAFAFA;
188
- }
189
-
190
- /* === Single Chosen Customizzation === */
191
-
192
- .yith-choosen .chosen-container-single .chosen-default {
193
- background: transparent;
194
- border-color: #ddd;
195
- }
196
-
197
- .yith-choosen .chosen-search > input[type=text]{
198
- width: 100% !important;
199
- }
200
-
201
- .yith-choosen .chosen-container-single .chosen-single {
202
- background: transparent;
203
- border-color: #ddd;
204
- }
205
-
206
-
207
- /* Style to woocommerce panel*/
208
-
209
- #plugin-fw-wc{
210
- padding-top: 20px;
211
- }
212
- #plugin-fw-wc table.form-table{
213
- background-color: #fff;
214
- margin-bottom: 20px;
215
- }
216
- #plugin-fw-wc table.form-table th {
217
- padding: 20px;
218
- }
219
- #plugin-fw-wc h3{
220
- padding:0px 10px 10px ;
221
- border-bottom: 1px solid #eee;
222
- }
223
-
224
- /* === VIDEO BOX === */
225
-
226
- .yith-videobox-wrapper {
227
- padding-top: 20px;
228
- }
229
- .yith-videobox-wrapper h3{
230
- padding:0px 10px 10px ;
231
- border-bottom: 1px solid #eee;
232
- }
233
-
234
- .yith-videobox-wrapper .postbox {
235
- display: inline-block;
236
- }
237
- .yith-videobox-wrapper .yith_videobox .column {
238
- width: 45%;
239
- float: left;
240
- padding-right: 2.5%;
241
- border-right: 1px solid #ebebeb;
242
- padding-bottom: 2em;
243
- }
244
- .yith-videobox-wrapper .yith_videobox .column.two {
245
- margin-right: 0;
246
- padding-right: 0;
247
- padding-left: 2.5%;
248
- border: 0;
249
- max-width: 49%;
250
- }
251
- .yith-videobox-wrapper .yith_videobox h2{
252
- font-size: 16px;
253
- margin-bottom: 20px;
254
- }
255
- .yith-videobox-wrapper .yith-video-link {
256
- width: 100%;
257
- max-width: 200px;
258
- float: left;
259
- margin: 0 1.5em 1.5em 0;
260
- }
261
- .yith-videobox-wrapper .yith-video-link {
262
- width: 100%;
263
- max-width: 200px;
264
- float: left;
265
- margin: 0 1.5em 1.5em 0;
266
- }
267
- .yith-videobox-wrapper .yith-image-frame img {
268
- max-width: 100%;
269
- height: auto;
270
- }
271
- .yith-videobox-wrapper .yith-video-link img {
272
- max-width: 100%;
273
- height: auto;
274
- }
275
- .yith-videobox-wrapper .yith-video-iframe {
276
- display: none;
277
-
278
- }
279
-
280
- /* === Plugins Upgrader === */
281
-
282
- .yit-plugin-changelog-wrapper {
283
- display: none;
284
- }
285
-
286
- .yit-plugin-changelog-title {
287
- text-transform: uppercase;
288
- }
289
-
290
- .yit-plugin-changelog {
291
- background: #fcfcfc;
292
- height: 97%;
293
- z-index: 999;
294
- overflow: auto;
295
- }
296
-
297
- /* === Plugins Licence Activation === */
298
-
299
- .yit-container.plugin-licence-activation {
300
- font-family: 'Raleway', sans-serif;
301
- }
302
-
303
- .yit-container.plugin-licence-activation .to-active-wrapper {
304
- margin-bottom: 60px;
305
- }
306
-
307
- .yit-container.plugin-licence-activation .to-active-wrapper form.to-active-form {
308
- position: relative;
309
- border-color: #e1e1e1;
310
- border-style: solid;
311
- border-width: 0;
312
- }
313
-
314
- .yit-container.plugin-licence-activation .to-active-wrapper form.to-active-form:first-child {
315
- border-top-width: 1px;
316
- }
317
-
318
- .yit-container.plugin-licence-activation .to-active-wrapper form.to-active-form:last-child {
319
- border-bottom-width: 1px;
320
- }
321
-
322
- .yit-container.plugin-licence-activation .to-active-wrapper table.to-active-table {
323
- border-width: 0;
324
- border-spacing: 0;
325
- width: 100%;
326
- }
327
-
328
- .yit-container.plugin-licence-activation .message {
329
- display: none;
330
- line-height: normal;
331
- background: #ffffff url(../images/licence-error.png) 15px center no-repeat;
332
- padding-left: 65px;
333
- padding-right: 15px;
334
- width: 150px;
335
- }
336
-
337
- .yit-container.plugin-licence-activation .message-wrapper {
338
- height: 75px;
339
- display: none;
340
- position: absolute;
341
- top: 0;
342
- right: -250px;
343
- border: 1px solid #ff3838;
344
- }
345
-
346
- .yit-container.plugin-licence-activation .message-wrapper.visible {
347
- display: table;
348
- }
349
-
350
- .yit-container.plugin-licence-activation .message {
351
- display: table-cell;
352
- vertical-align: middle;
353
- }
354
-
355
- .yit-container.plugin-licence-activation .arrow-left:after,
356
- .yit-container.plugin-licence-activation .arrow-left:before {
357
- content: "";
358
- display: block;
359
- width: 0;
360
- height: 0;
361
- position: absolute;
362
- }
363
-
364
- .yit-container.plugin-licence-activation .arrow-left:before {
365
- border-top: 9px solid transparent;
366
- border-bottom: 9px solid transparent;
367
- border-right: 9px solid #ff3838;
368
- top: 26px;
369
- left: -9px;
370
- }
371
-
372
- .yit-container.plugin-licence-activation .arrow-left:after {
373
- border-top: 8px solid transparent;
374
- border-bottom: 8px solid transparent;
375
- border-right: 8px solid #fff;
376
- left: -8px;
377
- top: 27px;
378
- }
379
-
380
- .yit-container.plugin-licence-activation h2,
381
- .yit-container.plugin-licence-activation h3 {
382
- text-transform: uppercase;
383
- font-weight: 800;
384
- margin-bottom: 30px;
385
- }
386
-
387
- .yit-container.plugin-licence-activation h2 {
388
- color: #808a97;
389
- font-size: 25px;
390
- }
391
- .yit-container.plugin-licence-activation h3 {
392
- color: #313131;
393
- font-size: 15px;
394
- height: 20px;
395
- }
396
-
397
- .yit-container.plugin-licence-activation h3.to-active {
398
- height: 20px;
399
- position: relative;
400
- vertical-align: top;
401
- }
402
-
403
- .yit-container.plugin-licence-activation .spinner.show{
404
- display: inline-block;
405
- vertical-align: middle;
406
- float: none;
407
- }
408
-
409
- .yit-container.plugin-licence-activation h3.to-active > .spinner.show {
410
- display: inline-block;
411
- float: none;
412
- top: -3px;
413
- position: relative;
414
- }
415
-
416
- .yit-container.plugin-licence-activation .licence-check-section{
417
- margin-bottom: 60px;
418
- }
419
-
420
- .yit-container.plugin-licence-activation span.licence-label {
421
- font-weight: 500;
422
- color: #606060;
423
- margin-bottom: 30px;
424
- }
425
-
426
- .yit-container.plugin-licence-activation .button-licence {
427
- border: 0;
428
- font-size: 13px;
429
- text-transform: uppercase;
430
- background-color: #808a97;
431
- color: #fff;
432
- font-weight: 700;
433
- border-radius: 3px;
434
- cursor: pointer;
435
- text-decoration: none;
436
- padding: 5px 7px;
437
- -webkit-transition: background-color 0.3s ease;
438
- -moz-transition: background-color 0.3s ease;
439
- -ms-transition: background-color 0.3s ease;
440
- -o-transition: background-color 0.3s ease;
441
- transition: background-color 0.3s ease;
442
- }
443
-
444
- .yit-container.plugin-licence-activation .button-licence:hover {
445
- background-color: #4d5c6f;
446
- }
447
-
448
- .yit-container.plugin-licence-activation .button-licence.clicked {
449
- cursor: not-allowed;
450
- background-color: #e2e2e2 !important;
451
- }
452
-
453
- .yit-container.plugin-licence-activation .button-licence.licence-check {
454
- font-weight: 400;
455
- padding: 12px 19px;
456
- }
457
-
458
- .yit-container.plugin-licence-activation .button-licence.licence-renew {
459
- text-decoration: none;
460
- padding: 7px 12px;
461
- font-size: 9px;
462
- }
463
-
464
- .yit-container.plugin-licence-activation .button-licence.licence-renew:focus {
465
- box-shadow: none;
466
- }
467
-
468
- .yit-container.plugin-licence-activation table:not(.to-active-table) {
469
- width: 100%;
470
- border: 1px solid #dcdcdc;
471
- border-spacing: 0;
472
- border-radius: 5px;
473
- border-collapse: separate;
474
- overflow: hidden;
475
- }
476
-
477
- .yit-container.plugin-licence-activation table:not(.to-active-table) th {
478
- border-bottom: 1px solid #dcdcdc;
479
- }
480
-
481
- .yit-container.plugin-licence-activation table:not(.to-active-table) td,
482
- .yit-container.plugin-licence-activation table:not(.to-active-table) th {
483
- border-right: 1px solid #dcdcdc;
484
- }
485
- .yit-container.plugin-licence-activation table td:last-child,
486
- .yit-container.plugin-licence-activation table th:last-child {
487
- border-right: 0;
488
- }
489
-
490
- .yit-container.plugin-licence-activation table thead tr {
491
- background-color: #f6f4f4;
492
- }
493
-
494
- .yit-container.plugin-licence-activation table tbody tr {
495
- background-color: #ffffff;
496
- }
497
-
498
- .yit-container.plugin-licence-activation table thead tr th {
499
- font-size: 13px;
500
- color: #313131;
501
- text-transform: uppercase;
502
- font-weight: bold;
503
- }
504
-
505
- .yit-container.plugin-licence-activation table thead tr,
506
- .yit-container.plugin-licence-activation table tbody tr {
507
- line-height: 60px;
508
- }
509
-
510
- .yit-container.plugin-licence-activation table tbody tr td{
511
- text-align: center;
512
- line-height: 20px;
513
- padding: 10px 5px;
514
- }
515
-
516
- .yit-container.plugin-licence-activation .button-licence.licence-activation {
517
- padding: 12px 18px;
518
- }
519
-
520
- .yit-container.plugin-licence-activation .to-active-table tr {
521
- line-height: 75px;
522
- }
523
-
524
- .yit-container.plugin-licence-activation .to-active-table tr.plugin-row {
525
- background-color: transparent;
526
- -webkit-transition: all 0.3s ease;
527
- -moz-transition: all 0.3s ease;
528
- -ms-transition: all 0.3s ease;
529
- -o-transition: all 0.3s ease;
530
- transition: all 0.3s ease;
531
- }
532
-
533
- .yit-container.plugin-licence-activation .to-active-table tr.plugin-row.error {
534
- background-color: #ffdcdc;
535
- }
536
-
537
- .yit-container.plugin-licence-activation .to-active-table td {
538
- padding-right: 12px;
539
- width: 33%;
540
- }
541
-
542
-
543
- .yit-container.plugin-licence-activation .to-active-table td.plugin-name {
544
- color: #808a97;
545
- font-size: 12px;
546
- text-transform: uppercase;
547
- font-weight: bold;
548
- line-height: 20px;
549
- width: 20%;
550
- padding-left: 20px;
551
- }
552
-
553
- .yit-container.plugin-licence-activation .to-active-table td.activate-button {
554
- width: 15%;
555
- position: relative;
556
- }
557
-
558
- .yit-container.plugin-licence-activation input[type=text],
559
- .yit-container.plugin-licence-activation input[type=email]{
560
- -webkit-transition: all 0.3s ease;
561
- -moz-transition: all 0.3s ease;
562
- -ms-transition: all 0.3s ease;
563
- -o-transition: all 0.3s ease;
564
- transition: all 0.3s ease;
565
-
566
- border: 1px solid #dcdcdc;
567
- padding: 0 15px;
568
- border-radius: 3px;
569
- height: 41px;
570
- width: 100%;
571
- }
572
-
573
- .yit-container.plugin-licence-activation input[type=text].require,
574
- .yit-container.plugin-licence-activation input[type=email].require {
575
- border: 1px solid #ff3838;
576
- }
577
-
578
- .yit-container.plugin-licence-activation input[type=text]:focus,
579
- .yit-container.plugin-licence-activation input[type=email]:focus{
580
- webkit-box-shadow: 0 0 1px rgba(30,140,190,.8);
581
- box-shadow: 0 0 1px rgba(30,140,190,.8);
582
- }
583
-
584
- .yit-container.plugin-licence-activation input[type=text]{
585
- text-transform: uppercase;
586
- text-align: center;
587
- }
588
-
589
- .yit-container.plugin-licence-activation input[type=email] {
590
- text-align: left;
591
- }
592
-
593
- .yit-container.plugin-licence-activation input[type=submit]:focus{
594
- outline: 0;
595
- }
596
-
597
- /* === Woocommerce panel === */
598
- #plugin-fw-wc .yit_options{
599
- padding: 0;
600
- border: 0;
601
- }
602
- #plugin-fw-wc .yit_options input.upload_button, .yit_options input.button{
603
- background: none;
604
- border: 1px solid #ccc;
605
- }
606
-
607
- /* === WP Pointers === */
608
-
609
- #adminmenu li.menu-top.yit-pointer-selected-row,
610
- #adminmenu li.menu-top.yit-pointer-selected-row:hover,
611
- #adminmenu li.yit-pointer-selected-row a.menu-top {
612
- background-color: #acc327;
613
- color: #000;
614
- }
615
-
616
- #adminmenu a.menu-top.toplevel_page_yit_plugin_panel.yit-pointer{
617
- color: #000;
618
- }
619
-
620
- #adminmenu a.menu-top.toplevel_page_yit_plugin_panel.yit-pointer:hover,
621
- #adminmenu .wp-submenu a.yit-pointer-selected-row {
622
- color: #fff;
623
- }
624
-
625
- #adminmenu .wp-submenu a.yit-pointer-selected-row:hover {
626
- color: #45bbe6;
627
- }
628
-
629
- /* WooCommerce 2.4 Support */
630
- .woocommerce table.form-table .colorpick{
631
- width: 6em;
632
- }
633
-
634
- #wpwrap h2.nav-tab-wrapper {
635
- border-bottom: 1px solid #ccc;
636
- }
637
-
638
- /* === YIT FRAMEWORK === */
639
- .plugin-card .plugin-icon img {
640
- max-width: 100%;
641
- width: auto;
642
- height: auto;
643
- }
644
-
645
- /* === Responsive === */
646
-
647
- @media (max-width: 767px) {}
648
-
649
- @media (max-width: 480px) {}
650
-
651
- @media (min-width: 768px) and (max-width: 992px) {}
652
-
653
- @media (min-width: 980px) and (max-width: 1199px) {}
654
-
655
- @media (min-width: 1200px) {
656
- .yit-container.plugin-licence-activation{
657
- width: 900px;
658
- }
659
- }
660
-
661
- @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
662
- only screen and (-o-min-device-pixel-ratio: 3/2),
663
- only screen and (min--moz-device-pixel-ratio: 1.5),
664
- only screen and (min-device-pixel-ratio: 1.5) {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This file belongs to the YIT Plugin Framework.
3
+ *
4
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
+ * that is bundled with this package in the file LICENSE.txt.
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.gnu.org/licenses/gpl-3.0.txt
8
+ */
9
+
10
+ /* onoff */
11
+ .rm_onoff input {
12
+ display : none;
13
+ }
14
+
15
+ .rm_onoff input + span {
16
+ cursor : pointer;
17
+ text-indent : -9999px;
18
+ display : block;
19
+ width : 85px;
20
+ height : 37px;
21
+ background : transparent url(../images/off.png);
22
+ }
23
+
24
+ .rm_onoff input:checked + span {
25
+ background : transparent url(../images/on.png);
26
+ }
27
+
28
+ .rm_onoff input.onoffchecked + span {
29
+ background : transparent url(../images/on.png);
30
+ }
31
+
32
+ /* slider */
33
+ /*numbers*/
34
+ .ui-slider .maxCaption, .ui-slider .minCaption {
35
+ margin-bottom : 5px;
36
+ }
37
+
38
+ .ui-slider .feedback {
39
+ background : url(../images/slider/tooltip.png) no-repeat center top;
40
+ position : absolute;
41
+ top : -25px;
42
+ width : 35px;
43
+ height : 43px;
44
+ text-align : center;
45
+ width : 100%;
46
+ display : block;
47
+ }
48
+
49
+ .ui-slider .feedback strong {
50
+ display : inline-block;
51
+ padding-top : 4px;
52
+ top : -30px;
53
+ }
54
+
55
+ /*handle*/
56
+ .yit-options .ui-slider-horizontal .ui-slider-handle,
57
+ .yit_options .ui-slider-horizontal .ui-slider-handle {
58
+ background : transparent url(../images/slider/handle.png) no-repeat left top !important;
59
+ border : 0px !important;
60
+ top : -.35em !important;
61
+ width : 18px !important;
62
+ height : 19px !important;
63
+ }
64
+
65
+ /*bg on the left:grey*/
66
+ .yit-options .ui-slider.ui-widget-content,
67
+ .yit_options .ui-slider.ui-widget-content {
68
+ background : url(../images/slider/grey.gif) repeat-x left center !important;
69
+ border-color : #c1c1c0 !important;
70
+ height : 10px !important;
71
+ }
72
+
73
+ .iris-slider-offset.ui-slider.ui-widget-content {
74
+ background : transparent !important;
75
+ height : auto !important;
76
+ }
77
+
78
+ /*bg on the right:orange*/
79
+ .ui-slider.ui-widget-content .ui-widget-header {
80
+ background : url(../images/slider/orange.gif) repeat-x left center !important;
81
+ left : 2px !important;
82
+ -webkit-border-radius : 15px;
83
+ -moz-border-radius : 15px;
84
+ -khtml-border-radius : 15px;
85
+ border-radius : 15px;
86
+ }
87
+
88
+ .plugin-option tr {
89
+ border-bottom : 1px solid #ccc;
90
+ }
91
+
92
+ .plugin-option .yit_options,
93
+ .plugin-option .yit-options {
94
+ border-bottom : 0px;
95
+ }
96
+
97
+ .plugin-option .yit-options .option,
98
+ .plugin-option .yit_options .option {
99
+ width : 600px;
100
+ float : left;
101
+ }
102
+
103
+ .plugin-option .form-table td {
104
+ padding : 25px 10px;
105
+ }
106
+
107
+ .yit_options .select_wrapper,
108
+ .yit-options .select_wrapper {
109
+ background : url("../images/select.png") no-repeat scroll right center #FAFAFA;
110
+ border-color : #CCCCCC #EEEEEE #EEEEEE #CCCCCC;
111
+ border-radius : 4px 4px 4px 4px;
112
+ border-style : solid;
113
+ border-width : 1px;
114
+ color : #555555;
115
+ display : block;
116
+ float : left;
117
+ font-family : sans-serif;
118
+ font-size : 12px;
119
+ height : 26px;
120
+ margin-bottom : 9px !important;
121
+ margin-left : 0;
122
+ margin-right : 5px;
123
+ margin-top : 0;
124
+ width : 400px;
125
+ }
126
+
127
+ .chosen .select_wrapper {
128
+ background : none;
129
+ border : none;
130
+ }
131
+
132
+ .chosen .select_wrapper .chosen-container {
133
+ width : 338px !important;
134
+ }
135
+
136
+ .chosen .select_wrapper .chosen-container .search-field input {
137
+ height : 27px !important;
138
+ color : #333;
139
+ }
140
+
141
+ .chosen .select_wrapper .chosen-container .chosen-choices {
142
+ border : 1px solid #ddd;
143
+ box-shadow : none;
144
+ }
145
+
146
+ .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice {
147
+ height : 15px !important;
148
+ min-width : 105px;
149
+ }
150
+
151
+ .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice span {
152
+ line-height : 15px;
153
+ height : 15px;
154
+ padding-top : 2px;
155
+ }
156
+
157
+ .chosen .select_wrapper .chosen-container .chosen-choices li.search-choice a.search-choice-close {
158
+ top : 5px;
159
+ }
160
+
161
+ .chosen .select_wrapper .chosen-container .chosen-drop .chosen-search input {
162
+ width : 100% !important;
163
+ }
164
+
165
+ /* === Multiple Chosen Customizzation === */
166
+
167
+ .yith-choosen .chosen-choices {
168
+ line-height : 27px;
169
+ min-height : 27px;
170
+ border : 1px solid #ddd;
171
+ }
172
+
173
+ .yith-choosen .chosen-container-active .chosen-choices {
174
+ border : 1px solid #5b9dd9;
175
+ -webkit-box-shadow : 0 0 2px rgba(30, 140, 190, .8);
176
+ box-shadow : 0 0 2px rgba(30, 140, 190, .8);
177
+ }
178
+
179
+ .select_wrapper span {
180
+ height : 26px;
181
+ line-height : 26px;
182
+ padding-left : 6px;
183
+ position : absolute;
184
+ z-index : 2;
185
+ overflow : hidden;
186
+ }
187
+
188
+ .ie8 .yit_options select,
189
+ .ie8 .yit-options select {
190
+ height : 26px;
191
+ }
192
+
193
+ .yit_options select, .yit-options select, .the-metabox .select_wrapper select {
194
+ cursor : pointer;
195
+ height : 28px;
196
+ margin : 0;
197
+ opacity : 0;
198
+ padding : 0;
199
+ position : relative;
200
+ width : inherit;
201
+ z-index : 4;
202
+ background-color : #FAFAFA;
203
+ }
204
+
205
+ /* === Single Chosen Customizzation === */
206
+
207
+ .yith-choosen .chosen-container-single .chosen-default {
208
+ background : transparent;
209
+ border-color : #ddd;
210
+ }
211
+
212
+ .yith-choosen .chosen-search > input[type=text] {
213
+ width : 100% !important;
214
+ }
215
+
216
+ .yith-choosen .chosen-container-single .chosen-single {
217
+ background : transparent;
218
+ border-color : #ddd;
219
+ }
220
+
221
+ /* Style to woocommerce panel*/
222
+
223
+ #plugin-fw-wc {
224
+ padding-top : 20px;
225
+ }
226
+
227
+ #plugin-fw-wc table.form-table {
228
+ background-color : #fff;
229
+ margin-bottom : 20px;
230
+ }
231
+
232
+ #plugin-fw-wc table.form-table th {
233
+ padding : 20px;
234
+ }
235
+
236
+ #plugin-fw-wc h3 {
237
+ padding : 0px 10px 10px;
238
+ border-bottom : 1px solid #eee;
239
+ }
240
+
241
+ /* === VIDEO BOX === */
242
+
243
+ .yith-videobox-wrapper {
244
+ padding-top : 20px;
245
+ }
246
+
247
+ .yith-videobox-wrapper h3 {
248
+ padding : 0px 10px 10px;
249
+ border-bottom : 1px solid #eee;
250
+ }
251
+
252
+ .yith-videobox-wrapper .postbox {
253
+ display : inline-block;
254
+ }
255
+
256
+ .yith-videobox-wrapper .yith_videobox .column {
257
+ width : 45%;
258
+ float : left;
259
+ padding-right : 2.5%;
260
+ border-right : 1px solid #ebebeb;
261
+ padding-bottom : 2em;
262
+ }
263
+
264
+ .yith-videobox-wrapper .yith_videobox .column.two {
265
+ margin-right : 0;
266
+ padding-right : 0;
267
+ padding-left : 2.5%;
268
+ border : 0;
269
+ max-width : 49%;
270
+ }
271
+
272
+ .yith-videobox-wrapper .yith_videobox h2 {
273
+ font-size : 16px;
274
+ margin-bottom : 20px;
275
+ }
276
+
277
+ .yith-videobox-wrapper .yith-video-link {
278
+ width : 100%;
279
+ max-width : 200px;
280
+ float : left;
281
+ margin : 0 1.5em 1.5em 0;
282
+ }
283
+
284
+ .yith-videobox-wrapper .yith-video-link {
285
+ width : 100%;
286
+ max-width : 200px;
287
+ float : left;
288
+ margin : 0 1.5em 1.5em 0;
289
+ }
290
+
291
+ .yith-videobox-wrapper .yith-image-frame img {
292
+ max-width : 100%;
293
+ height : auto;
294
+ }
295
+
296
+ .yith-videobox-wrapper .yith-video-link img {
297
+ max-width : 100%;
298
+ height : auto;
299
+ }
300
+
301
+ .yith-videobox-wrapper .yith-video-iframe {
302
+ display : none;
303
+
304
+ }
305
+
306
+ /* === Plugins Upgrader === */
307
+
308
+ .yit-plugin-changelog-wrapper {
309
+ display : none;
310
+ }
311
+
312
+ .yit-plugin-changelog-title {
313
+ text-transform : uppercase;
314
+ }
315
+
316
+ .yit-plugin-changelog {
317
+ background : #fcfcfc;
318
+ height : 97%;
319
+ z-index : 999;
320
+ overflow : auto;
321
+ }
322
+
323
+ /* === Plugins Licence Activation === */
324
+
325
+ .yit-container.plugin-licence-activation {
326
+ font-family : 'Raleway', sans-serif;
327
+ }
328
+
329
+ .yit-container.plugin-licence-activation .to-active-wrapper {
330
+ margin-bottom : 60px;
331
+ }
332
+
333
+ .yit-container.plugin-licence-activation .to-active-wrapper form.to-active-form {
334
+ position : relative;
335
+ border-color : #e1e1e1;
336
+ border-style : solid;
337
+ border-width : 0;
338
+ }
339
+
340
+ .yit-container.plugin-licence-activation .to-active-wrapper form.to-active-form:first-child {
341
+ border-top-width : 1px;
342
+ }
343
+
344
+ .yit-container.plugin-licence-activation .to-active-wrapper form.to-active-form:last-child {
345
+ border-bottom-width : 1px;
346
+ }
347
+
348
+ .yit-container.plugin-licence-activation .to-active-wrapper table.to-active-table {
349
+ border-width : 0;
350
+ border-spacing : 0;
351
+ width : 100%;
352
+ }
353
+
354
+ .yit-container.plugin-licence-activation .message {
355
+ display : none;
356
+ line-height : normal;
357
+ background : #ffffff url(../images/licence-error.png) 15px center no-repeat;
358
+ padding-left : 65px;
359
+ padding-right : 15px;
360
+ width : 150px;
361
+ }
362
+
363
+ .yit-container.plugin-licence-activation .message-wrapper {
364
+ height : 75px;
365
+ display : none;
366
+ position : absolute;
367
+ top : 0;
368
+ right : -250px;
369
+ border : 1px solid #ff3838;
370
+ }
371
+
372
+ .yit-container.plugin-licence-activation .message-wrapper.visible {
373
+ display : table;
374
+ }
375
+
376
+ .yit-container.plugin-licence-activation .message {
377
+ display : table-cell;
378
+ vertical-align : middle;
379
+ }
380
+
381
+ .yit-container.plugin-licence-activation .arrow-left:after,
382
+ .yit-container.plugin-licence-activation .arrow-left:before {
383
+ content : "";
384
+ display : block;
385
+ width : 0;
386
+ height : 0;
387
+ position : absolute;
388
+ }
389
+
390
+ .yit-container.plugin-licence-activation .arrow-left:before {
391
+ border-top : 9px solid transparent;
392
+ border-bottom : 9px solid transparent;
393
+ border-right : 9px solid #ff3838;
394
+ top : 26px;
395
+ left : -9px;
396
+ }
397
+
398
+ .yit-container.plugin-licence-activation .arrow-left:after {
399
+ border-top : 8px solid transparent;
400
+ border-bottom : 8px solid transparent;
401
+ border-right : 8px solid #fff;
402
+ left : -8px;
403
+ top : 27px;
404
+ }
405
+
406
+ .yit-container.plugin-licence-activation h2,
407
+ .yit-container.plugin-licence-activation h3 {
408
+ text-transform : uppercase;
409
+ font-weight : 800;
410
+ margin-bottom : 30px;
411
+ }
412
+
413
+ .yit-container.plugin-licence-activation h2 {
414
+ color : #808a97;
415
+ font-size : 25px;
416
+ }
417
+
418
+ .yit-container.plugin-licence-activation h3 {
419
+ color : #313131;
420
+ font-size : 15px;
421
+ height : 20px;
422
+ }
423
+
424
+ .yit-container.plugin-licence-activation h3.to-active {
425
+ height : 20px;
426
+ position : relative;
427
+ vertical-align : top;
428
+ }
429
+
430
+ .yit-container.plugin-licence-activation .spinner.show {
431
+ display : inline-block;
432
+ vertical-align : middle;
433
+ float : none;
434
+ }
435
+
436
+ .yit-container.plugin-licence-activation h3.to-active > .spinner.show {
437
+ display : inline-block;
438
+ float : none;
439
+ top : -3px;
440
+ position : relative;
441
+ }
442
+
443
+ .yit-container.plugin-licence-activation .licence-check-section {
444
+ margin-bottom : 60px;
445
+ }
446
+
447
+ .yit-container.plugin-licence-activation span.licence-label {
448
+ font-weight : 500;
449
+ color : #606060;
450
+ margin-bottom : 30px;
451
+ }
452
+
453
+ .yit-container.plugin-licence-activation .button-licence {
454
+ border : 0;
455
+ font-size : 13px;
456
+ text-transform : uppercase;
457
+ background-color : #808a97;
458
+ color : #fff;
459
+ font-weight : 700;
460
+ border-radius : 3px;
461
+ cursor : pointer;
462
+ text-decoration : none;
463
+ padding : 5px 7px;
464
+ -webkit-transition : background-color 0.3s ease;
465
+ -moz-transition : background-color 0.3s ease;
466
+ -ms-transition : background-color 0.3s ease;
467
+ -o-transition : background-color 0.3s ease;
468
+ transition : background-color 0.3s ease;
469
+ }
470
+
471
+ .yit-container.plugin-licence-activation .button-licence:hover {
472
+ background-color : #4d5c6f;
473
+ }
474
+
475
+ .yit-container.plugin-licence-activation .button-licence.clicked {
476
+ cursor : not-allowed;
477
+ background-color : #e2e2e2 !important;
478
+ }
479
+
480
+ .yit-container.plugin-licence-activation .button-licence.licence-check {
481
+ font-weight : 400;
482
+ padding : 12px 19px;
483
+ }
484
+
485
+ .yit-container.plugin-licence-activation .button-licence.licence-renew {
486
+ text-decoration : none;
487
+ padding : 7px 12px;
488
+ font-size : 9px;
489
+ }
490
+
491
+ .yit-container.plugin-licence-activation .button-licence.licence-renew:focus {
492
+ box-shadow : none;
493
+ }
494
+
495
+ .yit-container.plugin-licence-activation table:not(.to-active-table) {
496
+ width : 100%;
497
+ border : 1px solid #dcdcdc;
498
+ border-spacing : 0;
499
+ border-radius : 5px;
500
+ border-collapse : separate;
501
+ overflow : hidden;
502
+ }
503
+
504
+ .yit-container.plugin-licence-activation table:not(.to-active-table) th {
505
+ border-bottom : 1px solid #dcdcdc;
506
+ }
507
+
508
+ .yit-container.plugin-licence-activation table:not(.to-active-table) td,
509
+ .yit-container.plugin-licence-activation table:not(.to-active-table) th {
510
+ border-right : 1px solid #dcdcdc;
511
+ }
512
+
513
+ .yit-container.plugin-licence-activation table td:last-child,
514
+ .yit-container.plugin-licence-activation table th:last-child {
515
+ border-right : 0;
516
+ }
517
+
518
+ .yit-container.plugin-licence-activation table thead tr {
519
+ background-color : #f6f4f4;
520
+ }
521
+
522
+ .yit-container.plugin-licence-activation table tbody tr {
523
+ background-color : #ffffff;
524
+ }
525
+
526
+ .yit-container.plugin-licence-activation table thead tr th {
527
+ font-size : 13px;
528
+ color : #313131;
529
+ text-transform : uppercase;
530
+ font-weight : bold;
531
+ }
532
+
533
+ .yit-container.plugin-licence-activation table thead tr,
534
+ .yit-container.plugin-licence-activation table tbody tr {
535
+ line-height : 60px;
536
+ }
537
+
538
+ .yit-container.plugin-licence-activation table tbody tr td {
539
+ text-align : center;
540
+ line-height : 20px;
541
+ padding : 10px 5px;
542
+ }
543
+
544
+ .yit-container.plugin-licence-activation .button-licence.licence-activation {
545
+ padding : 12px 18px;
546
+ }
547
+
548
+ .yit-container.plugin-licence-activation .to-active-table tr {
549
+ line-height : 75px;
550
+ }
551
+
552
+ .yit-container.plugin-licence-activation .to-active-table tr.plugin-row {
553
+ background-color : transparent;
554
+ -webkit-transition : all 0.3s ease;
555
+ -moz-transition : all 0.3s ease;
556
+ -ms-transition : all 0.3s ease;
557
+ -o-transition : all 0.3s ease;
558
+ transition : all 0.3s ease;
559
+ }
560
+
561
+ .yit-container.plugin-licence-activation .to-active-table tr.plugin-row.error {
562
+ background-color : #ffdcdc;
563
+ }
564
+
565
+ .yit-container.plugin-licence-activation .to-active-table td {
566
+ padding-right : 12px;
567
+ width : 33%;
568
+ }
569
+
570
+ .yit-container.plugin-licence-activation .to-active-table td.plugin-name {
571
+ color : #808a97;
572
+ font-size : 12px;
573
+ text-transform : uppercase;
574
+ font-weight : bold;
575
+ line-height : 20px;
576
+ width : 20%;
577
+ padding-left : 20px;
578
+ }
579
+
580
+ .yit-container.plugin-licence-activation .to-active-table td.activate-button {
581
+ width : 15%;
582
+ position : relative;
583
+ }
584
+
585
+ .yit-container.plugin-licence-activation input[type=text],
586
+ .yit-container.plugin-licence-activation input[type=email] {
587
+ -webkit-transition : all 0.3s ease;
588
+ -moz-transition : all 0.3s ease;
589
+ -ms-transition : all 0.3s ease;
590
+ -o-transition : all 0.3s ease;
591
+ transition : all 0.3s ease;
592
+
593
+ border : 1px solid #dcdcdc;
594
+ padding : 0 15px;
595
+ border-radius : 3px;
596
+ height : 41px;
597
+ width : 100%;
598
+ }
599
+
600
+ .yit-container.plugin-licence-activation input[type=text].require,
601
+ .yit-container.plugin-licence-activation input[type=email].require {
602
+ border : 1px solid #ff3838;
603
+ }
604
+
605
+ .yit-container.plugin-licence-activation input[type=text]:focus,
606
+ .yit-container.plugin-licence-activation input[type=email]:focus {
607
+ webkit-box-shadow : 0 0 1px rgba(30, 140, 190, .8);
608
+ box-shadow : 0 0 1px rgba(30, 140, 190, .8);
609
+ }
610
+
611
+ .yit-container.plugin-licence-activation input[type=text] {
612
+ text-transform : uppercase;
613
+ text-align : center;
614
+ }
615
+
616
+ .yit-container.plugin-licence-activation input[type=email] {
617
+ text-align : left;
618
+ }
619
+
620
+ .yit-container.plugin-licence-activation input[type=submit]:focus {
621
+ outline : 0;
622
+ }
623
+
624
+ /* === Woocommerce panel === */
625
+ #plugin-fw-wc .yit_options {
626
+ padding : 0;
627
+ border : 0;
628
+ }
629
+
630
+ #plugin-fw-wc .yit_options input.upload_button, .yit_options input.button {
631
+ background : none;
632
+ border : 1px solid #ccc;
633
+ }
634
+
635
+ /* === WP Pointers === */
636
+
637
+ #adminmenu li.menu-top.yit-pointer-selected-row,
638
+ #adminmenu li.menu-top.yit-pointer-selected-row:hover,
639
+ #adminmenu li.yit-pointer-selected-row a.menu-top {
640
+ background-color : #acc327;
641
+ color : #000;
642
+ }
643
+
644
+ #adminmenu a.menu-top.toplevel_page_yit_plugin_panel.yit-pointer {
645
+ color : #000;
646
+ }
647
+
648
+ #adminmenu a.menu-top.toplevel_page_yit_plugin_panel.yit-pointer:hover,
649
+ #adminmenu .wp-submenu a.yit-pointer-selected-row {
650
+ color : #fff;
651
+ }
652
+
653
+ #adminmenu .wp-submenu a.yit-pointer-selected-row:hover {
654
+ color : #45bbe6;
655
+ }
656
+
657
+ /* WooCommerce 2.4 Support */
658
+ .woocommerce table.form-table .colorpick {
659
+ width : 6em;
660
+ }
661
+
662
+ #wpwrap h2.nav-tab-wrapper , #wpbody-content h2.nav-tab-wrapper {
663
+ border-bottom: 1px solid #ccc;
664
+ }
665
+
666
+ /* === YIT FRAMEWORK === */
667
+ .plugin-card .plugin-icon img {
668
+ max-width : 100%;
669
+ width : auto;
670
+ height : auto;
671
+ }
672
+
673
+ /* === Panel Content and Container === */
674
+ .yit-admin-panel-container{
675
+ position:relative;
676
+ }
677
+ .yit-admin-panel-content-wrap {
678
+ width : calc(100% - 300px);
679
+ display : inline-block;
680
+ }
681
+
682
+ .yit-admin-panel-content-wrap.yit-admin-panel-content-wrap-full {
683
+ width : 100%;
684
+ display : block;
685
+ }
686
+
687
+ /* === Responsive === */
688
+
689
+ @media (max-width : 767px) {
690
+ .yit-admin-panel-content-wrap {
691
+ width : 100%;
692
+ display : block;
693
+ }
694
+ }
695
+
696
+ @media (max-width : 480px) {
697
+
698
+ }
699
+
700
+ @media (min-width : 768px) and (max-width : 992px) {
701
+ }
702
+
703
+ @media (min-width : 980px) and (max-width : 1199px) {
704
+ }
705
+
706
+ @media (min-width : 1200px) {
707
+ .yit-container.plugin-licence-activation {
708
+ width : 900px;
709
+ }
710
+ }
711
+
712
+ @media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (-o-min-device-pixel-ratio : 3/2), only screen and (min--moz-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) {
713
+ }
plugin-fw/assets/css/yit-upgrade-to-pro.css ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* === Upgrade to Premium Landing page === */
2
+
3
+ #upgrade-to-premium{
4
+ width: 900px;
5
+ }
6
+ #upgrade-to-premium h1{
7
+ font-family: 'Raleway',san-serif;
8
+ text-transform: uppercase;
9
+ font-size: 30px;
10
+ font-weight: 700;
11
+ color: #808a97;
12
+ }
13
+
14
+ #upgrade-to-premium h3{
15
+ font-family: 'Raleway',san-serif;
16
+ font-size: 20px;
17
+ line-height: 29px;
18
+ font-weight: 700;
19
+ color: #808a97;
20
+ }
21
+
22
+ #upgrade-to-premium p{
23
+ font-family: 'Open Sans',san-serif;
24
+ font-size: 15px;
25
+ line-height: 29px;
26
+ font-weight: 400;
27
+ color: #6a6a6b;
28
+ }
29
+ #upgrade-to-premium p.highlighted{
30
+ font-family: 'Raleway',san-serif;
31
+ font-size: 20px;
32
+ line-height: 27px;
33
+ color: #808a97;
34
+ font-weight: 400;
35
+ }
36
+ #upgrade-to-premium ol{
37
+ counter-reset: item;
38
+ list-style-type: none;
39
+ margin-left: 0;
40
+ }
41
+ #upgrade-to-premium li.step{
42
+ font-family: 'open sans',san-serif;
43
+ font-size: 15px;
44
+ color: #6a6a6b;
45
+ font-weight: 400;
46
+ position: relative;
47
+ padding-left: 50px;
48
+ line-height: 25px;
49
+ margin-bottom: 25px;
50
+ }
51
+ #upgrade-to-premium li.step:before{
52
+ content: counters(item, ".") " ";
53
+ counter-increment: item;
54
+ position: absolute;
55
+ left: 0;
56
+ top: 0;
57
+ border: 1px solid #808a97;
58
+ width: 30px;
59
+ height: 30px;
60
+ border-radius: 16px;
61
+ background-color: #808a97;
62
+ color: #ffffff;
63
+ font-weight: 700;
64
+ font-size: 18px;
65
+ text-align: center;
66
+ line-height: 27px;
67
+ }
68
+ #upgrade-to-premium li.step img{
69
+ border: 1px solid #b8b8b8;
70
+ width: 600px;
71
+ display: block;
72
+ margin: 15px 0 25px 0;
73
+ }
74
+
75
+ #cboxLoadedContent {
76
+ margin-bottom: 60px!important;
77
+ }
plugin-fw/assets/css/yit-upgrader.css CHANGED
@@ -1,14 +1,14 @@
1
- /* === Plugins Upgrader === */
2
-
3
- .yit-plugin-changelog-wrapper {
4
- display: none;
5
- }
6
-
7
- .yit-plugin-changelog-title {
8
- text-transform: uppercase;
9
- }
10
-
11
- .yit-plugin-changelog {
12
- background: #fcfcfc;
13
- height: 97%;
14
  }
1
+ /* === Plugins Upgrader === */
2
+
3
+ .yit-plugin-changelog-wrapper {
4
+ display: none;
5
+ }
6
+
7
+ .yit-plugin-changelog-title {
8
+ text-transform: uppercase;
9
+ }
10
+
11
+ .yit-plugin-changelog {
12
+ background: #fcfcfc;
13
+ height: 97%;
14
  }
plugin-fw/assets/images/colorbox/border1.png ADDED
Binary file
plugin-fw/assets/images/colorbox/border2.png ADDED
Binary file
plugin-fw/assets/images/colorbox/loading.gif ADDED
Binary file
plugin-fw/assets/images/widgets/box-icon.png ADDED
Binary file
plugin-fw/assets/images/widgets/box-white-icon.png ADDED
Binary file
plugin-fw/assets/images/widgets/despacho.png ADDED
Binary file
plugin-fw/assets/images/widgets/info-icon.png ADDED
Binary file
plugin-fw/assets/images/widgets/link-bg.png ADDED
Binary file
plugin-fw/assets/images/widgets/link-bg2.png ADDED
Binary file
plugin-fw/assets/images/widgets/link-icon.png ADDED
Binary file
plugin-fw/assets/images/widgets/membership-bg.png ADDED
Binary file
plugin-fw/assets/js/chosen/ajax-chosen.jquery.min.js CHANGED
@@ -1,3 +1,2 @@
1
- (function(b){return b.fn.ajaxChosen=function(d,g){var e,a,f;null==d&&(d={});null==g&&(g=function(){});f=this;e=null;a=b.extend({},{minTermLength:3,afterTypeDelay:500,jsonTermKey:"term"},d);this.chosen();return this.each(function(){return b(this).next(".chosen-container").find(".search-field > input, .chosen-search > input").bind("keyup",function(){var d,l,h,c;c=b.trim(b(this).attr("value"));l=c.length<a.minTermLength?"Keep typing...":"Looking for '"+c+"'";f.next(".chosen-container").find(".no-results").text(l);
2
- if(c===b(this).data("prevVal"))return!1;b(this).data("prevVal",c);this.timer&&clearTimeout(this.timer);if(c.length<a.minTermLength)return!1;d=b(this);null==a.data&&(a.data={});a.data[a.jsonTermKey]=c;null!=a.dataCallback&&(a.data=a.dataCallback(a.data));h=a.success;a.success=function(a){var e,k;if(null!=a)return k=[],f.find("option").each(function(){return b(this).is(":selected")?k.push(b(this).val()+"-"+b(this).text()):b(this).remove()}),e=g(a),b.each(e,function(a,c){if(-1===b.inArray(a+"-"+c,k))return b("<option />").attr("value",
3
- a).html(c).appendTo(f)}),f.trigger("chosen:updated"),null!=h&&h(a),d.attr("value",c),d.css("width","auto")};return this.timer=setTimeout(function(){e&&e.abort();return e=b.ajax(a)},a.afterTypeDelay)})})}})(jQuery);
1
+ // Generated by CoffeeScript 1.3.1
2
+ (function(e){return e.fn.ajaxChosen=function(t,n){var r,i,s,o;t==null&&(t={});n==null&&(n=function(){});i={minTermLength:3,afterTypeDelay:500,jsonTermKey:"term"};o=this;r=null;s=e.extend({},i,t);this.chosen();return this.each(function(){return e(this).next(".chosen-container").find(".search-field > input, .chosen-search > input").bind("keyup",function(){var t,i,u,a;a=e.trim(e(this).attr("value"));i=a.length<s.minTermLength?"Keep typing...":"Looking for '"+a+"'";o.next(".chosen-container").find(".no-results").text(i);if(a===e(this).data("prevVal"))return!1;e(this).data("prevVal",a);this.timer&&clearTimeout(this.timer);if(a.length<s.minTermLength)return!1;t=e(this);s.data==null&&(s.data={});s.data[s.jsonTermKey]=a;s.dataCallback!=null&&(s.data=s.dataCallback(s.data));u=s.success;s.success=function(r){var i,s;if(r==null)return;s=[];o.find("option").each(function(){return e(this).is(":selected")?s.push(e(this).val()+"-"+e(this).text()):e(this).remove()});i=n(r);e.each(i,function(t,n){if(e.inArray(t+"-"+n,s)===-1)return e("<option />").attr("value",t).html(n).appendTo(o)});o.trigger("chosen:updated");u!=null&&u(r);t.attr("value",a);return t.css("width","auto")};return this.timer=setTimeout(function(){r&&r.abort();return r=e.ajax(s)},s.afterTypeDelay)})})}})(jQuery);
 
plugin-fw/assets/js/how-to.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ (function($){
2
+ var how_to_link = $('#yith-how-to-premium').parent();
3
+ if( typeof how_to_link != 'undefined' ){
4
+ how_to_link.prop( 'target', '_blank' );
5
+ }
6
+ })(jQuery);
plugin-fw/assets/js/jquery.colorbox.js ADDED
@@ -0,0 +1,1105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Colorbox 1.6.3
3
+ license: MIT
4
+ http://www.jacklmoore.com/colorbox
5
+ */
6
+ (function ($, document, window) {
7
+ var
8
+ // Default settings object.
9
+ // See http://jacklmoore.com/colorbox for details.
10
+ defaults = {
11
+ // data sources
12
+ html: false,
13
+ photo: false,
14
+ iframe: false,
15
+ inline: false,
16
+
17
+ // behavior and appearance
18
+ transition: "elastic",
19
+ speed: 300,
20
+ fadeOut: 300,
21
+ width: false,
22
+ initialWidth: "600",
23
+ innerWidth: false,
24
+ maxWidth: false,
25
+ height: false,
26
+ initialHeight: "450",
27
+ innerHeight: false,
28
+ maxHeight: false,
29
+ scalePhotos: true,
30
+ scrolling: true,
31
+ opacity: 0.9,
32
+ preloading: true,
33
+ className: false,
34
+ overlayClose: true,
35
+ escKey: true,
36
+ arrowKey: true,
37
+ top: false,
38
+ bottom: false,
39
+ left: false,
40
+ right: false,
41
+ fixed: false,
42
+ data: undefined,
43
+ closeButton: true,
44
+ fastIframe: true,
45
+ open: false,
46
+ reposition: true,
47
+ loop: true,
48
+ slideshow: false,
49
+ slideshowAuto: true,
50
+ slideshowSpeed: 2500,
51
+ slideshowStart: "start slideshow",
52
+ slideshowStop: "stop slideshow",
53
+ photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,
54
+
55
+ // alternate image paths for high-res displays
56
+ retinaImage: false,
57
+ retinaUrl: false,
58
+ retinaSuffix: '@2x.$1',
59
+
60
+ // internationalization
61
+ current: "image {current} of {total}",
62
+ previous: "previous",
63
+ next: "next",
64
+ close: "close",
65
+ xhrError: "This content failed to load.",
66
+ imgError: "This image failed to load.",
67
+
68
+ // accessbility
69
+ returnFocus: true,
70
+ trapFocus: true,
71
+
72
+ // callbacks
73
+ onOpen: false,
74
+ onLoad: false,
75
+ onComplete: false,
76
+ onCleanup: false,
77
+ onClosed: false,
78
+
79
+ rel: function() {
80
+ return this.rel;
81
+ },
82
+ href: function() {
83
+ // using this.href would give the absolute url, when the href may have been inteded as a selector (e.g. '#container')
84
+ return $(this).attr('href');
85
+ },
86
+ title: function() {
87
+ return this.title;
88
+ },
89
+ createImg: function() {
90
+ var img = new Image();
91
+ var attrs = $(this).data('cbox-img-attrs');
92
+
93
+ if (typeof attrs === 'object') {
94
+ $.each(attrs, function(key, val){
95
+ img[key] = val;
96
+ });
97
+ }
98
+
99
+ return img;
100
+ },
101
+ createIframe: function() {
102
+ var iframe = document.createElement('iframe');
103
+ var attrs = $(this).data('cbox-iframe-attrs');
104
+
105
+ if (typeof attrs === 'object') {
106
+ $.each(attrs, function(key, val){
107
+ iframe[key] = val;
108
+ });
109
+ }
110
+
111
+ if ('frameBorder' in iframe) {
112
+ iframe.frameBorder = 0;
113
+ }
114
+ if ('allowTransparency' in iframe) {
115
+ iframe.allowTransparency = "true";
116
+ }
117
+ iframe.name = (new Date()).getTime(); // give the iframe a unique name to prevent caching
118
+ iframe.allowFullscreen = true;
119
+
120
+ return iframe;
121
+ }
122
+ },
123
+
124
+ // Abstracting the HTML and event identifiers for easy rebranding
125
+ colorbox = 'colorbox',
126
+ prefix = 'cbox',
127
+ boxElement = prefix + 'Element',
128
+
129
+ // Events
130
+ event_open = prefix + '_open',
131
+ event_load = prefix + '_load',
132
+ event_complete = prefix + '_complete',
133
+ event_cleanup = prefix + '_cleanup',
134
+ event_closed = prefix + '_closed',
135
+ event_purge = prefix + '_purge',
136
+
137
+ // Cached jQuery Object Variables
138
+ $overlay,
139
+ $box,
140
+ $wrap,
141
+ $content,
142
+ $topBorder,
143
+ $leftBorder,
144
+ $rightBorder,
145
+ $bottomBorder,
146
+ $related,
147
+ $window,
148
+ $loaded,
149
+ $loadingBay,
150
+ $loadingOverlay,
151
+ $title,
152
+ $current,
153
+ $slideshow,
154
+ $next,
155
+ $prev,
156
+ $close,
157
+ $groupControls,
158
+ $events = $('<a/>'), // $({}) would be prefered, but there is an issue with jQuery 1.4.2
159
+
160
+ // Variables for cached values or use across multiple functions
161
+ settings,
162
+ interfaceHeight,
163
+ interfaceWidth,
164
+ loadedHeight,
165
+ loadedWidth,
166
+ index,
167
+ photo,
168
+ open,
169
+ active,
170
+ closing,
171
+ loadingTimer,
172
+ publicMethod,
173
+ div = "div",
174
+ requests = 0,
175
+ previousCSS = {},
176
+ init;
177
+
178
+ // ****************
179
+ // HELPER FUNCTIONS
180
+ // ****************
181
+
182
+ // Convenience function for creating new jQuery objects
183
+ function $tag(tag, id, css) {
184
+ var element = document.createElement(tag);
185
+
186
+ if (id) {
187
+ element.id = prefix + id;
188
+ }
189
+
190
+ if (css) {
191
+ element.style.cssText = css;
192
+ }
193
+
194
+ return $(element);
195
+ }
196
+
197
+ // Get the window height using innerHeight when available to avoid an issue with iOS
198
+ // http://bugs.jquery.com/ticket/6724
199
+ function winheight() {
200
+ return window.innerHeight ? window.innerHeight : $(window).height();
201
+ }
202
+
203
+ function Settings(element, options) {
204
+ if (options !== Object(options)) {
205
+ options = {};
206
+ }
207
+
208
+ this.cache = {};
209
+ this.el = element;
210
+
211
+ this.value = function(key) {
212
+ var dataAttr;
213
+
214
+ if (this.cache[key] === undefined) {
215
+ dataAttr = $(this.el).attr('data-cbox-'+key);
216
+
217
+ if (dataAttr !== undefined) {
218
+ this.cache[key] = dataAttr;
219
+ } else if (options[key] !== undefined) {
220
+ this.cache[key] = options[key];
221
+ } else if (defaults[key] !== undefined) {
222
+ this.cache[key] = defaults[key];
223
+ }
224
+ }
225
+
226
+ return this.cache[key];
227
+ };
228
+
229
+ this.get = function(key) {
230
+ var value = this.value(key);
231
+ return $.isFunction(value) ? value.call(this.el, this) : value;
232
+ };
233
+ }
234
+
235
+ // Determine the next and previous members in a group.
236
+ function getIndex(increment) {
237
+ var
238
+ max = $related.length,
239
+ newIndex = (index + increment) % max;
240
+
241
+ return (newIndex < 0) ? max + newIndex : newIndex;
242
+ }
243
+
244
+ // Convert '%' and 'px' values to integers
245
+ function setSize(size, dimension) {
246
+ return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
247
+ }
248
+
249
+ // Checks an href to see if it is a photo.
250
+ // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
251
+ function isImage(settings, url) {
252
+ return settings.get('photo') || settings.get('photoRegex').test(url);
253
+ }
254
+
255
+ function retinaUrl(settings, url) {
256
+ return settings.get('retinaUrl') && window.devicePixelRatio > 1 ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')) : url;
257
+ }
258
+
259
+ function trapFocus(e) {
260
+ if ('contains' in $box[0] && !$box[0].contains(e.target) && e.target !== $overlay[0]) {
261
+ e.stopPropagation();
262
+ $box.focus();
263
+ }
264
+ }
265
+
266
+ function setClass(str) {
267
+ if (setClass.str !== str) {
268
+ $box.add($overlay).removeClass(setClass.str).addClass(str);
269
+ setClass.str = str;
270
+ }
271
+ }
272
+
273
+ function getRelated(rel) {
274
+ index = 0;
275
+
276
+ if (rel && rel !== false && rel !== 'nofollow') {
277
+ $related = $('.' + boxElement).filter(function () {
278
+ var options = $.data(this, colorbox);
279
+ var settings = new Settings(this, options);
280
+ return (settings.get('rel') === rel);
281
+ });
282
+ index = $related.index(settings.el);
283
+
284
+ // Check direct calls to Colorbox.
285
+ if (index === -1) {
286
+ $related = $related.add(settings.el);
287
+ index = $related.length - 1;
288
+ }
289
+ } else {
290
+ $related = $(settings.el);
291
+ }
292
+ }
293
+
294
+ function trigger(event) {
295
+ // for external use
296
+ $(document).trigger(event);
297
+ // for internal use
298
+ $events.triggerHandler(event);
299
+ }
300
+
301
+ var slideshow = (function(){
302
+ var active,
303
+ className = prefix + "Slideshow_",
304
+ click = "click." + prefix,
305
+ timeOut;
306
+
307
+ function clear () {
308
+ clearTimeout(timeOut);
309
+ }
310
+
311
+ function set() {
312
+ if (settings.get('loop') || $related[index + 1]) {
313
+ clear();
314
+ timeOut = setTimeout(publicMethod.next, settings.get('slideshowSpeed'));
315
+ }
316
+ }
317
+
318
+ function start() {
319
+ $slideshow
320
+ .html(settings.get('slideshowStop'))
321
+ .unbind(click)
322
+ .one(click, stop);
323
+
324
+ $events
325
+ .bind(event_complete, set)
326
+ .bind(event_load, clear);
327
+
328
+ $box.removeClass(className + "off").addClass(className + "on");
329
+ }
330
+
331
+ function stop() {
332
+ clear();
333
+
334
+ $events
335
+ .unbind(event_complete, set)
336
+ .unbind(event_load, clear);
337
+
338
+ $slideshow
339
+ .html(settings.get('slideshowStart'))
340
+ .unbind(click)
341
+ .one(click, function () {
342
+ publicMethod.next();
343
+ start();
344
+ });
345
+
346
+ $box.removeClass(className + "on").addClass(className + "off");
347
+ }
348
+
349
+ function reset() {
350
+ active = false;
351
+ $slideshow.hide();
352
+ clear();
353
+ $events
354
+ .unbind(event_complete, set)
355
+ .unbind(event_load, clear);
356
+ $box.removeClass(className + "off " + className + "on");
357
+ }
358
+
359
+ return function(){
360
+ if (active) {
361
+ if (!settings.get('slideshow')) {
362
+ $events.unbind(event_cleanup, reset);
363
+ reset();
364
+ }
365
+ } else {
366
+ if (settings.get('slideshow') && $related[1]) {
367
+ active = true;
368
+ $events.one(event_cleanup, reset);
369
+ if (settings.get('slideshowAuto')) {
370
+ start();
371
+ } else {
372
+ stop();
373
+ }
374
+ $slideshow.show();
375
+ }
376
+ }
377
+ };
378
+
379
+ }());
380
+
381
+
382
+ function launch(element) {
383
+ var options;
384
+
385
+ if (!closing) {
386
+
387
+ options = $(element).data(colorbox);
388
+
389
+ settings = new Settings(element, options);
390
+
391
+ getRelated(settings.get('rel'));
392
+
393
+ if (!open) {
394
+ open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
395
+
396
+ setClass(settings.get('className'));
397
+
398
+ // Show colorbox so the sizes can be calculated in older versions of jQuery
399
+ $box.css({visibility:'hidden', display:'block', opacity:''});
400
+
401
+ $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden; visibility:hidden');
402
+ $content.css({width:'', height:''}).append($loaded);
403
+
404
+ // Cache values needed for size calculations
405
+ interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();
406
+ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
407
+ loadedHeight = $loaded.outerHeight(true);
408
+ loadedWidth = $loaded.outerWidth(true);
409
+
410
+ // Opens inital empty Colorbox prior to content being loaded.
411
+ var initialWidth = setSize(settings.get('initialWidth'), 'x');
412
+ var initialHeight = setSize(settings.get('initialHeight'), 'y');
413
+ var maxWidth = settings.get('maxWidth');
414
+ var maxHeight = settings.get('maxHeight');
415
+
416
+ settings.w = Math.max((maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth, 0);
417
+ settings.h = Math.max((maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight, 0);
418
+
419
+ $loaded.css({width:'', height:settings.h});
420
+ publicMethod.position();
421
+
422
+ trigger(event_open);
423
+ settings.get('onOpen');
424
+
425
+ $groupControls.add($title).hide();
426
+
427
+ $box.focus();
428
+
429
+ if (settings.get('trapFocus')) {
430
+ // Confine focus to the modal
431
+ // Uses event capturing that is not supported in IE8-
432
+ if (document.addEventListener) {
433
+
434
+ document.addEventListener('focus', trapFocus, true);
435
+
436
+ $events.one(event_closed, function () {
437
+ document.removeEventListener('focus', trapFocus, true);
438
+ });
439
+ }
440
+ }
441
+
442
+ // Return focus on closing
443
+ if (settings.get('returnFocus')) {
444
+ $events.one(event_closed, function () {
445
+ $(settings.el).focus();
446
+ });
447
+ }
448
+ }
449
+
450
+ var opacity = parseFloat(settings.get('opacity'));
451
+ $overlay.css({
452
+ opacity: opacity === opacity ? opacity : '',
453
+ cursor: settings.get('overlayClose') ? 'pointer' : '',
454
+ visibility: 'visible'
455
+ }).show();
456
+
457
+ if (settings.get('closeButton')) {
458
+ $close.html(settings.get('close')).appendTo($content);
459
+ } else {
460
+ $close.appendTo('<div/>'); // replace with .detach() when dropping jQuery < 1.4
461
+ }
462
+
463
+ load();
464
+ }
465
+ }
466
+
467
+ // Colorbox's markup needs to be added to the DOM prior to being called
468
+ // so that the browser will go ahead and load the CSS background images.
469
+ function appendHTML() {
470
+ if (!$box) {
471
+ init = false;
472
+ $window = $(window);
473
+ $box = $tag(div).attr({
474
+ id: colorbox,
475
+ 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
476
+ role: 'dialog',
477
+ tabindex: '-1'
478
+ }).hide();
479
+ $overlay = $tag(div, "Overlay").hide();
480
+ $loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]);
481
+ $wrap = $tag(div, "Wrapper");
482
+ $content = $tag(div, "Content").append(
483
+ $title = $tag(div, "Title"),
484
+ $current = $tag(div, "Current"),
485
+ $prev = $('<button type="button"/>').attr({id:prefix+'Previous'}),
486
+ $next = $('<button type="button"/>').attr({id:prefix+'Next'}),
487
+ $slideshow = $tag('button', "Slideshow"),
488
+ $loadingOverlay
489
+ );
490
+
491
+ $close = $('<button type="button"/>').attr({id:prefix+'Close'});
492
+
493
+ $wrap.append( // The 3x3 Grid that makes up Colorbox
494
+ $tag(div).append(
495
+ $tag(div, "TopLeft"),
496
+ $topBorder = $tag(div, "TopCenter"),
497
+ $tag(div, "TopRight")
498
+ ),
499
+ $tag(div, false, 'clear:left').append(
500
+ $leftBorder = $tag(div, "MiddleLeft"),
501
+ $content,
502
+ $rightBorder = $tag(div, "MiddleRight")
503
+ ),
504
+ $tag(div, false, 'clear:left').append(
505
+ $tag(div, "BottomLeft"),
506
+ $bottomBorder = $tag(div, "BottomCenter"),
507
+ $tag(div, "BottomRight")
508
+ )
509
+ ).find('div div').css({'float': 'left'});
510
+
511
+ $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');
512
+
513
+ $groupControls = $next.add($prev).add($current).add($slideshow);
514
+ }
515
+ if (document.body && !$box.parent().length) {
516
+ $(document.body).append($overlay, $box.append($wrap, $loadingBay));
517
+ }
518
+ }
519
+
520
+ // Add Colorbox's event bindings
521
+ function addBindings() {
522
+ function clickHandler(e) {
523
+ // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
524
+ // See: http://jacklmoore.com/notes/click-events/
525
+ if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
526
+ e.preventDefault();
527
+ launch(this);
528
+ }
529
+ }
530
+
531
+ if ($box) {
532
+ if (!init) {
533
+ init = true;
534
+
535
+ // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
536
+ $next.click(function () {
537
+ publicMethod.next();
538
+ });
539
+ $prev.click(function () {
540
+ publicMethod.prev();
541
+ });
542
+ $close.click(function () {
543
+ publicMethod.close();
544
+ });
545
+ $overlay.click(function () {
546
+ if (settings.get('overlayClose')) {
547
+ publicMethod.close();
548
+ }
549
+ });
550
+
551
+ // Key Bindings
552
+ $(document).bind('keydown.' + prefix, function (e) {
553
+ var key = e.keyCode;
554
+ if (open && settings.get('escKey') && key === 27) {
555
+ e.preventDefault();
556
+ publicMethod.close();
557
+ }
558
+ if (open && settings.get('arrowKey') && $related[1] && !e.altKey) {
559
+ if (key === 37) {
560
+ e.preventDefault();
561
+ $prev.click();
562
+ } else if (key === 39) {
563
+ e.preventDefault();
564
+ $next.click();
565
+ }
566
+ }
567
+ });
568
+
569
+ if ($.isFunction($.fn.on)) {
570
+ // For jQuery 1.7+
571
+ $(document).on('click.'+prefix, '.'+boxElement, clickHandler);
572
+ } else {
573
+ // For jQuery 1.3.x -> 1.6.x
574
+ // This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
575
+ // This is not here for jQuery 1.9, it's here for legacy users.
576
+ $('.'+boxElement).live('click.'+prefix, clickHandler);
577
+ }
578
+ }
579
+ return true;
580
+ }
581
+ return false;
582
+ }
583
+
584
+ // Don't do anything if Colorbox already exists.
585
+ if ($[colorbox]) {
586
+ return;
587
+ }
588
+
589
+ // Append the HTML when the DOM loads
590
+ $(appendHTML);
591
+
592
+
593
+ // ****************
594
+ // PUBLIC FUNCTIONS
595
+ // Usage format: $.colorbox.close();
596
+ // Usage from within an iframe: parent.jQuery.colorbox.close();
597
+ // ****************
598
+
599
+ publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
600
+ var settings;
601
+ var $obj = this;
602
+
603
+ options = options || {};
604
+
605
+ if ($.isFunction($obj)) { // assume a call to $.colorbox
606
+ $obj = $('<a/>');
607
+ options.open = true;
608
+ }
609
+
610
+ if (!$obj[0]) { // colorbox being applied to empty collection
611
+ return $obj;
612
+ }
613
+
614
+ appendHTML();
615
+
616
+ if (addBindings()) {
617
+
618
+ if (callback) {
619
+ options.onComplete = callback;
620
+ }
621
+
622
+ $obj.each(function () {
623
+ var old = $.data(this, colorbox) || {};
624
+ $.data(this, colorbox, $.extend(old, options));
625
+ }).addClass(boxElement);
626
+
627
+ settings = new Settings($obj[0], options);
628
+
629
+ if (settings.get('open')) {
630
+ launch($obj[0]);
631
+ }
632
+ }
633
+
634
+ return $obj;
635
+ };
636
+
637
+ publicMethod.position = function (speed, loadedCallback) {
638
+ var
639
+ css,
640
+ top = 0,
641
+ left = 0,
642
+ offset = $box.offset(),
643
+ scrollTop,
644
+ scrollLeft;
645
+
646
+ $window.unbind('resize.' + prefix);
647
+
648
+ // remove the modal so that it doesn't influence the document width/height
649
+ $box.css({top: -9e4, left: -9e4});
650
+
651
+ scrollTop = $window.scrollTop();
652
+ scrollLeft = $window.scrollLeft();
653
+
654
+ if (settings.get('fixed')) {
655
+ offset.top -= scrollTop;
656
+ offset.left -= scrollLeft;
657
+ $box.css({position: 'fixed'});
658
+ } else {
659
+ top = scrollTop;
660
+ left = scrollLeft;
661
+ $box.css({position: 'absolute'});
662
+ }
663
+
664
+ // keeps the top and left positions within the browser's viewport.
665
+ if (settings.get('right') !== false) {
666
+ left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.get('right'), 'x'), 0);
667
+ } else if (settings.get('left') !== false) {
668
+ left += setSize(settings.get('left'), 'x');
669
+ } else {
670
+ left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
671
+ }
672
+
673
+ if (settings.get('bottom') !== false) {
674
+ top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.get('bottom'), 'y'), 0);
675
+ } else if (settings.get('top') !== false) {
676
+ top += setSize(settings.get('top'), 'y');
677
+ } else {
678
+ top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
679
+ }
680
+
681
+ $box.css({top: offset.top, left: offset.left, visibility:'visible'});
682
+
683
+ // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
684
+ // but it has to be shrank down around the size of div#colorbox when it's done. If not,
685
+ // it can invoke an obscure IE bug when using iframes.
686
+ $wrap[0].style.width = $wrap[0].style.height = "9999px";
687
+
688
+ function modalDimensions() {
689
+ $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px';
690
+ $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px';
691
+ }
692
+
693
+ css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
694
+
695
+ // setting the speed to 0 if the content hasn't changed size or position
696
+ if (speed) {
697
+ var tempSpeed = 0;
698
+ $.each(css, function(i){
699
+ if (css[i] !== previousCSS[i]) {
700
+ tempSpeed = speed;
701
+ return;
702
+ }
703
+ });
704
+ speed = tempSpeed;
705
+ }
706
+
707
+ previousCSS = css;
708
+
709
+ if (!speed) {
710
+ $box.css(css);
711
+ }
712
+
713
+ $box.dequeue().animate(css, {
714
+ duration: speed || 0,
715
+ complete: function () {
716
+ modalDimensions();
717
+
718
+ active = false;
719
+
720
+ // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
721
+ $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
722
+ $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
723
+
724
+ if (settings.get('reposition')) {
725
+ setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
726
+ $window.bind('resize.' + prefix, publicMethod.position);
727
+ }, 1);
728
+ }
729
+
730
+ if ($.isFunction(loadedCallback)) {
731
+ loadedCallback();
732
+ }
733
+ },
734
+ step: modalDimensions
735
+ });
736
+ };
737
+
738
+ publicMethod.resize = function (options) {
739
+ var scrolltop;
740
+
741
+ if (open) {
742
+ options = options || {};
743
+
744
+ if (options.width) {
745
+ settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
746
+ }
747
+
748
+ if (options.innerWidth) {
749
+ settings.w = setSize(options.innerWidth, 'x');
750
+ }
751
+
752
+ $loaded.css({width: settings.w});
753
+
754
+ if (options.height) {
755
+ settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
756
+ }
757
+
758
+ if (options.innerHeight) {
759
+ settings.h = setSize(options.innerHeight, 'y');
760
+ }
761
+
762
+ if (!options.innerHeight && !options.height) {
763
+ scrolltop = $loaded.scrollTop();
764
+ $loaded.css({height: "auto"});
765
+ settings.h = $loaded.height();
766
+ }
767
+
768
+ $loaded.css({height: settings.h});
769
+
770
+ if(scrolltop) {
771
+ $loaded.scrollTop(scrolltop);
772
+ }
773
+
774
+ publicMethod.position(settings.get('transition') === "none" ? 0 : settings.get('speed'));
775
+ }
776
+ };
777
+
778
+ publicMethod.prep = function (object) {
779
+ if (!open) {
780
+ return;
781
+ }
782
+
783
+ var callback, speed = settings.get('transition') === "none" ? 0 : settings.get('speed');
784
+
785
+ $loaded.remove();
786
+
787
+ $loaded = $tag(div, 'LoadedContent').append(object);
788
+
789
+ function getWidth() {
790
+ settings.w = settings.w || $loaded.width();
791
+ settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
792
+ return settings.w;
793
+ }
794
+ function getHeight() {
795
+ settings.h = settings.h || $loaded.height();
796
+ settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
797
+ return settings.h;
798
+ }
799
+
800
+ $loaded.hide()
801
+ .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
802
+ .css({width: getWidth(), overflow: settings.get('scrolling') ? 'auto' : 'hidden'})
803
+ .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
804
+ .prependTo($content);
805
+
806
+ $loadingBay.hide();
807
+
808
+ // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
809
+
810
+ $(photo).css({'float': 'none'});
811
+
812
+ setClass(settings.get('className'));
813
+
814
+ callback = function () {
815
+ var total = $related.length,
816
+ iframe,
817
+ complete;
818
+
819
+ if (!open) {
820
+ return;
821
+ }
822
+
823
+ function removeFilter() { // Needed for IE8 in versions of jQuery prior to 1.7.2
824
+ if ($.support.opacity === false) {
825
+ $box[0].style.removeAttribute('filter');
826
+ }
827
+ }
828
+
829
+ complete = function () {
830
+ clearTimeout(loadingTimer);
831
+ $loadingOverlay.hide();
832
+ trigger(event_complete);
833
+ settings.get('onComplete');
834
+ };
835
+
836
+
837
+ $title.html(settings.get('title')).show();
838
+ $loaded.show();
839
+
840
+ if (total > 1) { // handle grouping
841
+ if (typeof settings.get('current') === "string") {
842
+ $current.html(settings.get('current').replace('{current}', index + 1).replace('{total}', total)).show();
843
+ }
844
+
845
+ $next[(settings.get('loop') || index < total - 1) ? "show" : "hide"]().html(settings.get('next'));
846
+ $prev[(settings.get('loop') || index) ? "show" : "hide"]().html(settings.get('previous'));
847
+
848
+ slideshow();
849
+
850
+ // Preloads images within a rel group
851
+ if (settings.get('preloading')) {
852
+ $.each([getIndex(-1), getIndex(1)], function(){
853
+ var img,
854
+ i = $related[this],
855
+ settings = new Settings(i, $.data(i, colorbox)),
856
+ src = settings.get('href');
857
+
858
+ if (src && isImage(settings, src)) {
859
+ src = retinaUrl(settings, src);
860
+ img = document.createElement('img');
861
+ img.src = src;
862
+ }
863
+ });
864
+ }
865
+ } else {
866
+ $groupControls.hide();
867
+ }
868
+
869
+ if (settings.get('iframe')) {
870
+
871
+ iframe = settings.get('createIframe');
872
+
873
+ if (!settings.get('scrolling')) {
874
+ iframe.scrolling = "no";
875
+ }
876
+
877
+ $(iframe)
878
+ .attr({
879
+ src: settings.get('href'),
880
+ 'class': prefix + 'Iframe'
881
+ })
882
+ .one('load', complete)
883
+ .appendTo($loaded);
884
+
885
+ $events.one(event_purge, function () {
886
+ iframe.src = "//about:blank";
887
+ });
888
+
889
+ if (settings.get('fastIframe')) {
890
+ $(iframe).trigger('load');
891
+ }
892
+ } else {
893
+ complete();
894
+ }
895
+
896
+ if (settings.get('transition') === 'fade') {
897
+ $box.fadeTo(speed, 1, removeFilter);
898
+ } else {
899
+ removeFilter();
900
+ }
901
+ };
902
+
903
+ if (settings.get('transition') === 'fade') {
904
+ $box.fadeTo(speed, 0, function () {
905
+ publicMethod.position(0, callback);
906
+ });
907
+ } else {
908
+ publicMethod.position(speed, callback);
909
+ }
910
+ };
911
+
912
+ function load () {
913
+ var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
914
+
915
+ active = true;
916
+
917
+ photo = false;
918
+
919
+ trigger(event_purge);
920
+ trigger(event_load);
921
+ settings.get('onLoad');
922
+
923
+ settings.h = settings.get('height') ?
924
+ setSize(settings.get('height'), 'y') - loadedHeight - interfaceHeight :
925
+ settings.get('innerHeight') && setSize(settings.get('innerHeight'), 'y');
926
+
927
+ settings.w = settings.get('width') ?
928
+ setSize(settings.get('width'), 'x') - loadedWidth - interfaceWidth :
929
+ settings.get('innerWidth') && setSize(settings.get('innerWidth'), 'x');
930
+
931
+ // Sets the minimum dimensions for use in image scaling
932
+ settings.mw = settings.w;
933
+ settings.mh = settings.h;
934
+
935
+ // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
936
+ // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
937
+ if (settings.get('maxWidth')) {
938
+ settings.mw = setSize(settings.get('maxWidth'), 'x') - loadedWidth - interfaceWidth;
939
+ settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
940
+ }
941
+ if (settings.get('maxHeight')) {
942
+ settings.mh = setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight;
943
+ settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
944
+ }
945
+
946
+ href = settings.get('href');
947
+
948
+ loadingTimer = setTimeout(function () {
949
+ $loadingOverlay.show();
950
+ }, 100);
951
+
952
+ if (settings.get('inline')) {
953
+ var $target = $(href);
954
+ // Inserts an empty placeholder where inline content is being pulled from.
955
+ // An event is bound to put inline content back when Colorbox closes or loads new content.
956
+ $inline = $('<div>').hide().insertBefore($target);
957
+
958
+ $events.one(event_purge, function () {
959
+ $inline.replaceWith($target);
960
+ });
961
+
962
+ prep($target);
963
+ } else if (settings.get('iframe')) {
964
+ // IFrame element won't be added to the DOM until it is ready to be displayed,
965
+ // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
966
+ prep(" ");
967
+ } else if (settings.get('html')) {
968
+ prep(settings.get('html'));
969
+ } else if (isImage(settings, href)) {
970
+
971
+ href = retinaUrl(settings, href);
972
+
973
+ photo = settings.get('createImg');
974
+
975
+ $(photo)
976
+ .addClass(prefix + 'Photo')
977
+ .bind('error.'+prefix,function () {
978
+ prep($tag(div, 'Error').html(settings.get('imgError')));
979
+ })
980
+ .one('load', function () {
981
+ if (request !== requests) {
982
+ return;
983
+ }
984
+
985
+ // A small pause because some browsers will occassionaly report a
986
+ // img.width and img.height of zero immediately after the img.onload fires
987
+ setTimeout(function(){
988
+ var percent;
989
+
990
+ if (settings.get('retinaImage') && window.devicePixelRatio > 1) {
991
+ photo.height = photo.height / window.devicePixelRatio;
992
+ photo.width = photo.width / window.devicePixelRatio;
993
+ }
994
+
995
+ if (settings.get('scalePhotos')) {
996
+ setResize = function () {
997
+ photo.height -= photo.height * percent;
998
+ photo.width -= photo.width * percent;
999
+ };
1000
+ if (settings.mw && photo.width > settings.mw) {
1001
+ percent = (photo.width - settings.mw) / photo.width;
1002
+ setResize();
1003
+ }
1004
+ if (settings.mh && photo.height > settings.mh) {
1005
+ percent = (photo.height - settings.mh) / photo.height;
1006
+ setResize();
1007
+ }
1008
+ }
1009
+
1010
+ if (settings.h) {
1011
+ photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
1012
+ }
1013
+
1014
+ if ($related[1] && (settings.get('loop') || $related[index + 1])) {
1015
+ photo.style.cursor = 'pointer';
1016
+
1017
+ $(photo).bind('click.'+prefix, function () {
1018
+ publicMethod.next();
1019
+ });
1020
+ }
1021
+
1022
+ photo.style.width = photo.width + 'px';
1023
+ photo.style.height = photo.height + 'px';
1024
+ prep(photo);
1025
+ }, 1);
1026
+ });
1027
+
1028
+ photo.src = href;
1029
+
1030
+ } else if (href) {
1031
+ $loadingBay.load(href, settings.get('data'), function (data, status) {
1032
+ if (request === requests) {
1033
+ prep(status === 'error' ? $tag(div, 'Error').html(settings.get('xhrError')) : $(this).contents());
1034
+ }
1035
+ });
1036
+ }
1037
+ }
1038
+
1039
+ // Navigates to the next page/image in a set.
1040
+ publicMethod.next = function () {
1041
+ if (!active && $related[1] && (settings.get('loop') || $related[index + 1])) {
1042
+ index = getIndex(1);
1043
+ launch($related[index]);
1044
+ }
1045
+ };
1046
+
1047
+ publicMethod.prev = function () {
1048
+ if (!active && $related[1] && (settings.get('loop') || index)) {
1049
+ index = getIndex(-1);
1050
+ launch($related[index]);
1051
+ }
1052
+ };
1053
+
1054
+ // Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close();
1055
+ publicMethod.close = function () {
1056
+ if (open && !closing) {
1057
+
1058
+ closing = true;
1059
+ open = false;
1060
+ trigger(event_cleanup);
1061
+ settings.get('onCleanup');
1062
+ $window.unbind('.' + prefix);
1063
+ $overlay.fadeTo(settings.get('fadeOut') || 0, 0);
1064
+
1065
+ $box.stop().fadeTo(settings.get('fadeOut') || 0, 0, function () {
1066
+ $box.hide();
1067
+ $overlay.hide();
1068
+ trigger(event_purge);
1069
+ $loaded.remove();
1070
+
1071
+ setTimeout(function () {
1072
+ closing = false;
1073
+ trigger(event_closed);
1074
+ settings.get('onClosed');
1075
+ }, 1);
1076
+ });
1077
+ }
1078
+ };
1079
+
1080
+ // Removes changes Colorbox made to the document, but does not remove the plugin.
1081
+ publicMethod.remove = function () {
1082
+ if (!$box) { return; }
1083
+
1084
+ $box.stop();
1085
+ $[colorbox].close();
1086
+ $box.stop(false, true).remove();
1087
+ $overlay.remove();
1088
+ closing = false;
1089
+ $box = null;
1090
+ $('.' + boxElement)
1091
+ .removeData(colorbox)
1092
+ .removeClass(boxElement);
1093
+
1094
+ $(document).unbind('click.'+prefix).unbind('keydown.'+prefix);
1095
+ };
1096
+
1097
+ // A method for fetching the current element Colorbox is referencing.
1098
+ // returns a jQuery object.
1099
+ publicMethod.element = function () {
1100
+ return $(settings.el);
1101
+ };
1102
+
1103
+ publicMethod.settings = defaults;
1104
+
1105
+ }(jQuery, document, window));
plugin-fw/assets/js/metabox.js CHANGED
@@ -1,354 +1,355 @@
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
- (function ($) {
10
-
11
- $('.metaboxes-tab').each(function () {
12
- $('.tabs-panel', this).hide();
13
-
14
- var active_tab = wpCookies.get('active_metabox_tab');
15
- if (active_tab == null) {
16
- active_tab = $('ul.metaboxes-tabs li:first-child a', this).attr('href');
17
- } else {
18
- active_tab = '#' + active_tab;
19
- }
20
-
21
- $(active_tab).show();
22
-
23
- $('.metaboxes-tabs a', this).click(function (e) {
24
- if ($(this).parent().hasClass('tabs')) {
25
- e.preventDefault();
26
- return;
27
- }
28
-
29
- var t = $(this).attr('href');
30
- $(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
31
- $(this).closest('.metaboxes-tab').find('.tabs-panel').slideUp('fast');
32
- $(t).delay(350).slideDown('fast');
33
-
34
- return false;
35
- });
36
- });
37
-
38
- //upload
39
- var _custom_media = true,
40
- _orig_send_attachment = wp.media.editor.send.attachment;
41
-
42
- $(document).on('click', '.metaboxes-tab .upload_button', function(e) {
43
- var send_attachment_bkp = wp.media.editor.send.attachment;
44
- var button = $(this);
45
- if( typeof button.attr('id') != 'undefined' ) {
46
-
47
- var id = button.attr('id').replace('-button', '');
48
- _custom_media = true;
49
- wp.media.editor.send.attachment = function(props, attachment){
50
- if ( _custom_media ) {
51
- if( $("#"+id).is('input[type=text]') ) {
52
- $("#"+id).val(attachment.url);
53
- } else {
54
- $("#"+id + '_custom').val(attachment.url);
55
- }
56
- } else {
57
- return _orig_send_attachment.apply( this, [props, attachment] );
58
- };
59
- }
60
-
61
- wp.media.editor.open(button);
62
- return false;
63
- }
64
-
65
- });
66
-
67
- $('.metaboxes-tab .add_media').on('click', function(){
68
- _custom_media = false;
69
- });
70
-
71
- //colorpicker
72
- $('.metaboxes-tab .panel-colorpicker').wpColorPicker({
73
- onInit: function(){ console.log('test');},
74
- change: function(event, ui){
75
- },
76
- clear: function(){
77
- var input = $(this);
78
- input.val(input.data('default-color'));
79
- input.change();
80
- }
81
- });
82
-
83
-
84
- $('.metaboxes-tab .panel-colorpicker').each( function() {
85
- var select_label = $(this).data('variations-label');
86
- $(this).parent().parent().find('a.wp-color-result').attr('title', select_label);
87
- });
88
-
89
- //datepicker
90
- $('.metaboxes-tab .panel-datepicker').each( function() {
91
- $(this).datepicker();
92
- });
93
-
94
-
95
- // select
96
- var select_value = function() {
97
- var value = '';
98
-
99
- if( $(this).attr('multiple')){
100
- $(this).children("option:selected").each(function(i,v){
101
- if( i != 0)
102
- value += ', ';
103
-
104
- value += $(v).text();
105
- });
106
-
107
- if( value == '' ){
108
- $(this).children().children("option:selected").each(function(i,v){
109
- if( i != 0)
110
- value += ', ';
111
-
112
- value += $(v).text();
113
- });
114
- }
115
- }
116
- else{
117
- value = $(this).children("option:selected").text();
118
-
119
- if( value == '' )
120
- value = $(this).children().children("option:selected").text();
121
- }
122
-
123
-
124
- if ( $(this).parent().find('span').length <= 0 ) {
125
- $(this).before('<span></span>');
126
- }
127
-
128
- $(this).parent().children('span').replaceWith('<span>'+value +'</span>');
129
- };
130
- $('.metaboxes-tab .select_wrapper select').not('.chosen').each(select_value).change(select_value);
131
-
132
- //Open select multiple
133
- $('.metaboxes-tab .select_wrapper').click( function(e){
134
- e.stopPropagation();
135
- $(this).find('select[multiple]').not('.chosen').toggle();
136
- });
137
- //Stops click propagation on select, to prevent select hide
138
- $('.metaboxes-tab .select_wrapper select[multiple]').not('.chosen').click( function(e){
139
- e.stopPropagation();
140
- });
141
- //Hides select on window click
142
- $(window).click(function(){
143
- $('.metaboxes-tab .select_wrapper select[multiple]').not('.chosen').hide();
144
- })
145
-
146
- //on-off
147
- $('.metaboxes-tab .onoff_container span').on('click', function(){
148
-
149
- var input = $( this ).prev( 'input' );
150
- var checked = input.prop( 'checked' );
151
-
152
- if( checked ) {
153
- input.prop( 'checked', false ).attr( 'value', 'no' ).removeClass('onoffchecked');
154
- } else {
155
- input.prop( 'checked', true ).attr( 'value', 'yes' ).addClass('onoffchecked');
156
- }
157
-
158
- input.change();
159
- });
160
-
161
- //chosen
162
- $('.metaboxes-tab .chosen .select_wrapper select').chosen();
163
-
164
-
165
- $('.metaboxes-tab .slider_container .ui-slider-horizontal').each(function(){
166
- var val = $(this).data('val');
167
- var minValue = $(this).data('min');
168
- var maxValue = $(this).data('max');
169
- var step = $(this).data('step');
170
- var labels = $(this).data('labels');
171
-
172
- $(this).slider({
173
- value: val,
174
- min: minValue,
175
- max: maxValue,
176
- range: 'min',
177
- step: step,
178
-
179
- slide: function( event, ui ) {
180
- $(this).find('input').val( ui.value );
181
- $(this).siblings('.feedback').find('strong' ).text( ui.value + labels );
182
- }
183
- });
184
- });
185
-
186
-
187
- var act_page_option = $('#_active_page_options-container').parent().html();
188
- $('#_active_page_options-container').parent().remove();
189
- $(act_page_option).insertAfter('#yit-post-setting .handlediv');
190
- $(act_page_option).insertAfter('#yit-page-setting .handlediv');
191
-
192
-
193
- $('#_active_page_options-container').on('click', function(){
194
- if( $('#_active_page_options').is(":checked") ){
195
- $('#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab').css( { 'opacity' : 1 , 'pointer-events' : 'auto' } );
196
- }else{
197
- $('#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab').css( { 'opacity' : 0.5 , 'pointer-events' : 'none' } );
198
- }
199
- }).click();
200
-
201
-
202
- //dependencies handler
203
- $('.metaboxes-tab [data-field]').each(function(){
204
- var t = $(this);
205
-
206
- var field = '#' + t.data('field'),
207
- dep = '#' + t.data('dep'),
208
- value = t.data('value');
209
-
210
-
211
- dependencies_handler( field, dep, value.toString() );
212
-
213
- $(dep).on('change', function(){
214
- dependencies_handler( field, dep, value.toString() );
215
- }).change();
216
- });
217
-
218
- //Handle dependencies.
219
- function dependencies_handler ( id, deps, values ) {
220
- var result = true;
221
-
222
-
223
- //Single dependency
224
- if( typeof( deps ) == 'string' ) {
225
- if( deps.substr( 0, 6 ) == ':radio' )
226
- {deps = deps + ':checked'; }
227
-
228
- var val = $( deps ).val();
229
-
230
- if( $(deps).attr('type') == 'checkbox'){
231
- var thisCheck = $(deps);
232
- if ( thisCheck.is ( ':checked' ) ) {
233
- val = 'yes';
234
- }
235
- else {
236
- val = 'no';
237
- }
238
- }
239
-
240
- var values = values.split( ',' );
241
-
242
- for( var i = 0; i < values.length; i++ ) {
243
- if( val != values[i] )
244
- { result = false; }
245
- else
246
- { result = true; break; }
247
- }
248
- }
249
-
250
- if( !result ) {
251
- $( id + '-container' ).parent().hide();
252
- } else {
253
- $( id + '-container' ).parent().show();
254
- }
255
- };
256
-
257
- // Image gallery
258
- $(document).on('click', '.image-gallery-button', function (e) {
259
- var $t = $(this),
260
- $container = $t.closest('.image-gallery'),
261
- $image_gallery_ids = $container.find('.image_gallery_ids'),
262
- attachment_ids = $image_gallery_ids.val(),
263
- $gallery_images_wrapper = $container.find('ul.slides-wrapper');
264
-
265
-
266
- // Create the media frame.
267
- var image_gallery_frame = wp.media.frames.image_gallery = wp.media({
268
- // Set the title of the modal.
269
- title : $t.data('choose'),
270
- button: {
271
- text: $t.data('update')
272
- },
273
- states: [
274
- new wp.media.controller.Library({
275
- title : $t.data('choose'),
276
- filterable: 'all',
277
- multiple : true
278
- })
279
- ]
280
- });
281
-
282
- // When an image is selected, run a callback.
283
- image_gallery_frame.on('select', function () {
284
- var selection = image_gallery_frame.state().get('selection');
285
- selection.map(function (attachment) {
286
- attachment = attachment.toJSON();
287
-
288
- if (attachment.id) {
289
- attachment_ids = attachment_ids ? attachment_ids + "," + attachment.id : attachment.id;
290
- $gallery_images_wrapper.append('<li class="image" data-attachment_id="' + attachment.id + '"><img src="' + attachment.sizes.thumbnail.url + '"/><ul class="actions"><li><a href="#" class="delete" title="' + $t.data('delete') + '">x</a></li></ul></li>');
291
- }
292
- });
293
-
294
- $image_gallery_ids.val(attachment_ids);
295
- });
296
-
297
- image_gallery_frame.open();
298
-
299
- });
300
-
301
- // Image ordering
302
- $('.image-gallery ul.slides-wrapper').each(function(){
303
- var $t = $(this);
304
- $t.sortable({
305
- items : 'li.image',
306
- cursor : 'move',
307
- scrollSensitivity : 40,
308
- forcePlaceholderSize: true,
309
- forceHelperSize : false,
310
- helper : 'clone',
311
- opacity : 0.65,
312
- start : function (event, ui) {
313
- ui.item.css('background-color', '#f6f6f6');
314
- },
315
- stop : function (event, ui) {
316
- ui.item.removeAttr('style');
317
- },
318
- update : function (event, ui) {
319
- var attachment_ids = '';
320
-
321
- $t.find('li.image').css('cursor', 'default').each(function () {
322
- var attachment_id = $(this).attr('data-attachment_id');
323
- attachment_ids = attachment_ids + attachment_id + ',';
324
- });
325
-
326
- $t.closest('.image-gallery').find('.image_gallery_ids').val(attachment_ids);
327
- }
328
- });
329
- });
330
-
331
- // Remove images
332
- $('.image-gallery ul.slides-wrapper').on( 'click', 'a.delete', function() {
333
-
334
- var $wrapper = $(this).closest('.image-gallery'),
335
- $gallery = $(this).closest('.image-gallery ul.slides-wrapper'),
336
- $image_gallery_ids = $wrapper.find('.image_gallery_ids'),
337
- attachment_ids = '';
338
-
339
- $(this).closest('li.image').remove();
340
-
341
- $gallery.find('li.image').css('cursor','default').each(function() {
342
- var attachment_id = $(this).attr( 'data-attachment_id' );
343
- attachment_ids = attachment_ids + attachment_id + ',';
344
- });
345
-
346
- $image_gallery_ids.val( attachment_ids );
347
-
348
- return false;
349
- });
350
-
351
-
352
-
353
-
 
354
  })(jQuery);
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
+ (function ($) {
10
+
11
+ $('.metaboxes-tab').each(function () {
12
+ $('.tabs-panel', this).hide();
13
+
14
+ var active_tab = wpCookies.get('active_metabox_tab');
15
+ if (active_tab == null) {
16
+ active_tab = $('ul.metaboxes-tabs li:first-child a', this).attr('href');
17
+ } else {
18
+ active_tab = '#' + active_tab;
19
+ }
20
+
21
+ $(active_tab).show();
22
+
23
+ $('.metaboxes-tabs a', this).click(function (e) {
24
+ if ($(this).parent().hasClass('tabs')) {
25
+ e.preventDefault();
26
+ return;
27
+ }
28
+
29
+ var t = $(this).attr('href');
30
+ $(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
31
+ $(this).closest('.metaboxes-tab').find('.tabs-panel').slideUp('fast');
32
+ $(t).delay(350).slideDown('fast');
33
+
34
+ return false;
35
+ });
36
+ });
37
+
38
+ //upload
39
+ var _custom_media = true,
40
+ _orig_send_attachment = wp.media.editor.send.attachment;
41
+
42
+ $(document).on('click', '.metaboxes-tab .upload_button', function(e) {
43
+ var send_attachment_bkp = wp.media.editor.send.attachment;
44
+ var button = $(this);
45
+ if( typeof button.attr('id') != 'undefined' ) {
46
+
47
+ var id = button.attr('id').replace('-button', '');
48
+ _custom_media = true;
49
+ wp.media.editor.send.attachment = function(props, attachment){
50
+ if ( _custom_media ) {
51
+ if( $("#"+id).is('input[type=text]') ) {
52
+ $("#"+id).val(attachment.url);
53
+ } else {
54
+ $("#"+id + '_custom').val(attachment.url);
55
+ }
56
+ } else {
57
+ return _orig_send_attachment.apply( this, [props, attachment] );
58
+ };
59
+ }
60
+
61
+ wp.media.editor.open(button);
62
+ return false;
63
+ }
64
+
65
+ });
66
+
67
+ $('.metaboxes-tab .add_media').on('click', function(){
68
+ _custom_media = false;
69
+ });
70
+
71
+ //colorpicker
72
+ $('.metaboxes-tab .panel-colorpicker').wpColorPicker({
73
+ onInit: function(){ console.log('test');},
74
+ change: function(event, ui){
75
+ },
76
+ clear: function(){
77
+ var input = $(this);
78
+ input.val(input.data('default-color'));
79
+ input.change();
80
+ }
81
+ });
82
+
83
+
84
+ $('.metaboxes-tab .panel-colorpicker').each( function() {
85
+ var select_label = $(this).data('variations-label');
86
+ $(this).parent().parent().find('a.wp-color-result').attr('title', select_label);
87
+ });
88
+
89
+ //datepicker
90
+ $('.metaboxes-tab .panel-datepicker').each( function() {
91
+ $(this).datepicker();
92
+ });
93
+
94
+
95
+ // select
96
+ var select_value = function() {
97
+ var value = '';
98
+
99
+ if( $(this).attr('multiple')){
100
+ $(this).children("option:selected").each(function(i,v){
101
+ if( i != 0)
102
+ value += ', ';
103
+
104
+ value += $(v).text();
105
+ });
106
+
107
+ if( value == '' ){
108
+ $(this).children().children("option:selected").each(function(i,v){
109
+ if( i != 0)
110
+ value += ', ';
111
+
112
+ value += $(v).text();
113
+ });
114
+ }
115
+ }
116
+ else{
117
+ value = $(this).children("option:selected").text();
118
+
119
+ if( value == '' )
120
+ value = $(this).children().children("option:selected").text();
121
+ }
122
+
123
+
124
+ if ( $(this).parent().find('span').length <= 0 ) {
125
+ $(this).before('<span></span>');
126
+ }
127
+
128
+ $(this).parent().children('span').replaceWith('<span>'+value +'</span>');
129
+ };
130
+ $('.metaboxes-tab .select_wrapper select').not('.chosen').each(select_value).change(select_value);
131
+
132
+ //Open select multiple
133
+ $('.metaboxes-tab .select_wrapper').click( function(e){
134
+ e.stopPropagation();
135
+ $(this).find('select[multiple]').not('.chosen').toggle();
136
+ });
137
+ //Stops click propagation on select, to prevent select hide
138
+ $('.metaboxes-tab .select_wrapper select[multiple]').not('.chosen').click( function(e){
139
+ e.stopPropagation();
140
+ });
141
+ //Hides select on window click
142
+ $(window).click(function(){
143
+ $('.metaboxes-tab .select_wrapper select[multiple]').not('.chosen').hide();
144
+ })
145
+
146
+ //chosen
147
+ $('.metaboxes-tab .chosen .select_wrapper select').chosen();
148
+
149
+
150
+ $('.metaboxes-tab .slider_container .ui-slider-horizontal').each(function(){
151
+ var val = $(this).data('val');
152
+ var minValue = $(this).data('min');
153
+ var maxValue = $(this).data('max');
154
+ var step = $(this).data('step');
155
+ var labels = $(this).data('labels');
156
+
157
+ $(this).slider({
158
+ value: val,
159
+ min: minValue,
160
+ max: maxValue,
161
+ range: 'min',
162
+ step: step,
163
+
164
+ slide: function( event, ui ) {
165
+ $(this).find('input').val( ui.value );
166
+ $(this).siblings('.feedback').find('strong' ).text( ui.value + labels );
167
+ }
168
+ });
169
+ });
170
+
171
+
172
+ var act_page_option = $('#_active_page_options-container').parent().html();
173
+ $('#_active_page_options-container').parent().remove();
174
+ $(act_page_option).insertAfter('#yit-post-setting .handlediv');
175
+ $(act_page_option).insertAfter('#yit-page-setting .handlediv');
176
+
177
+
178
+ $('#_active_page_options-container').on('click', function(){
179
+ if( $('#_active_page_options').is(":checked") ){
180
+ $('#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab').css( { 'opacity' : 1 , 'pointer-events' : 'auto' } );
181
+ }else{
182
+ $('#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab').css( { 'opacity' : 0.5 , 'pointer-events' : 'none' } );
183
+ }
184
+ }).click();
185
+
186
+
187
+ //dependencies handler
188
+ $('.metaboxes-tab [data-field]').each(function(){
189
+ var t = $(this);
190
+
191
+ var field = '#' + t.data('field'),
192
+ dep = '#' + t.data('dep'),
193
+ value = t.data('value');
194
+
195
+
196
+ dependencies_handler( field, dep, value.toString() );
197
+
198
+ $(dep).on('change', function(){
199
+ dependencies_handler( field, dep, value.toString() );
200
+ }).change();
201
+ });
202
+
203
+ //Handle dependencies.
204
+ function dependencies_handler ( id, deps, values ) {
205
+ var result = true;
206
+
207
+
208
+ //Single dependency
209
+ if( typeof( deps ) == 'string' ) {
210
+ if( deps.substr( 0, 6 ) == ':radio' )
211
+ {deps = deps + ':checked'; }
212
+
213
+ var val = $( deps ).val();
214
+
215
+ if( $(deps).attr('type') == 'checkbox'){
216
+ var thisCheck = $(deps);
217
+ if ( thisCheck.is ( ':checked' ) ) {
218
+ val = 'yes';
219
+ }
220
+ else {
221
+ val = 'no';
222
+ }
223
+ }
224
+
225
+ var values = values.split( ',' );
226
+
227
+ for( var i = 0; i < values.length; i++ ) {
228
+ if( val != values[i] )
229
+ { result = false; }
230
+ else
231
+ { result = true; break; }
232
+ }
233
+ }
234
+
235
+ if( !result ) {
236
+ $( id + '-container' ).parent().hide();
237
+ } else {
238
+ $( id + '-container' ).parent().show();
239
+ }
240
+ };
241
+
242
+ // Image gallery
243
+ $(document).on('click', '.image-gallery-button', function (e) {
244
+ var $t = $(this),
245
+ $container = $t.closest('.image-gallery'),
246
+ $image_gallery_ids = $container.find('.image_gallery_ids'),
247
+ attachment_ids = $image_gallery_ids.val(),
248
+ $gallery_images_wrapper = $container.find('ul.slides-wrapper');
249
+
250
+
251
+ // Create the media frame.
252
+ var image_gallery_frame = wp.media.frames.image_gallery = wp.media({
253
+ // Set the title of the modal.
254
+ title : $t.data('choose'),
255
+ button: {
256
+ text: $t.data('update')
257
+ },
258
+ states: [
259
+ new wp.media.controller.Library({
260
+ title : $t.data('choose'),
261
+ filterable: 'all',
262
+ multiple : true
263
+ })
264
+ ]
265
+ });
266
+
267
+ // When an image is selected, run a callback.
268
+ image_gallery_frame.on('select', function () {
269
+ var selection = image_gallery_frame.state().get('selection');
270
+ selection.map(function (attachment) {
271
+ attachment = attachment.toJSON();
272
+
273
+ if (attachment.id) {
274
+ attachment_ids = attachment_ids ? attachment_ids + "," + attachment.id : attachment.id;
275
+ $gallery_images_wrapper.append('<li class="image" data-attachment_id="' + attachment.id + '"><img src="' + attachment.sizes.thumbnail.url + '"/><ul class="actions"><li><a href="#" class="delete" title="' + $t.data('delete') + '">x</a></li></ul></li>');
276
+ }
277
+ });
278
+
279
+ $image_gallery_ids.val(attachment_ids);
280
+ });
281
+
282
+ image_gallery_frame.open();
283
+
284
+ });
285
+
286
+ // Image ordering
287
+ $('.image-gallery ul.slides-wrapper').each(function(){
288
+ var $t = $(this);
289
+ $t.sortable({
290
+ items : 'li.image',
291
+ cursor : 'move',
292
+ scrollSensitivity : 40,
293
+ forcePlaceholderSize: true,
294
+ forceHelperSize : false,
295
+ helper : 'clone',
296
+ opacity : 0.65,
297
+ start : function (event, ui) {
298
+ ui.item.css('background-color', '#f6f6f6');
299
+ },
300
+ stop : function (event, ui) {
301
+ ui.item.removeAttr('style');
302
+ },
303
+ update : function (event, ui) {
304
+ var attachment_ids = '';
305
+
306
+ $t.find('li.image').css('cursor', 'default').each(function () {
307
+ var attachment_id = $(this).attr('data-attachment_id');
308
+ attachment_ids = attachment_ids + attachment_id + ',';
309
+ });
310
+
311
+ $t.closest('.image-gallery').find('.image_gallery_ids').val(attachment_ids);
312
+ }
313
+ });
314
+ });
315
+
316
+ // Remove images
317
+ $('.image-gallery ul.slides-wrapper').on( 'click', 'a.delete', function() {
318
+
319
+ var $wrapper = $(this).closest('.image-gallery'),
320
+ $gallery = $(this).closest('.image-gallery ul.slides-wrapper'),
321
+ $image_gallery_ids = $wrapper.find('.image_gallery_ids'),
322
+ attachment_ids = '';
323
+
324
+ $(this).closest('li.image').remove();
325
+
326
+ $gallery.find('li.image').css('cursor','default').each(function() {
327
+ var attachment_id = $(this).attr( 'data-attachment_id' );
328
+ attachment_ids = attachment_ids + attachment_id + ',';
329
+ });
330
+
331
+ $image_gallery_ids.val( attachment_ids );
332
+
333
+ return false;
334
+ });
335
+
336
+
337
+ //on-off
338
+ $('.the-metabox .rm_onoff.onoff_container span').on('click', function(ev){
339
+
340
+ var input = $( this ).prev( 'input' );
341
+ var checked = input.prop( 'checked' );
342
+
343
+ if( checked ) {
344
+ input.prop( 'checked', false ).attr( 'value', 'no' ).removeClass('onoffchecked');
345
+ } else {
346
+ input.prop( 'checked', true ).attr( 'value', 'yes' ).addClass('onoffchecked');
347
+ }
348
+
349
+ input.change();
350
+ });
351
+
352
+
353
+
354
+
355
  })(jQuery);
plugin-fw/assets/js/metabox.min.js CHANGED
@@ -3,9 +3,9 @@
3
  "");h=!0;wp.media.editor.send.attachment=function(b,e){if(h)a("#"+c).is("input[type=text]")?a("#"+c).val(e.url):a("#"+c+"_custom").val(e.url);else return l.apply(this,[b,e])};wp.media.editor.open(b);return!1}});a(".metaboxes-tab .add_media").on("click",function(){h=!1});a(".metaboxes-tab .panel-colorpicker").wpColorPicker({onInit:function(){console.log("test")},change:function(a,c){},clear:function(){var b=a(this);b.val(b.data("default-color"));b.change()}});a(".metaboxes-tab .panel-colorpicker").each(function(){var b=
4
  a(this).data("variations-label");a(this).parent().parent().find("a.wp-color-result").attr("title",b)});a(".metaboxes-tab .panel-datepicker").each(function(){a(this).datepicker()});var f=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));
5
  0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+"</span>")};a(".metaboxes-tab .select_wrapper select").not(".chosen").each(f).change(f);a(".metaboxes-tab .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".metaboxes-tab .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".metaboxes-tab .select_wrapper select[multiple]").not(".chosen").hide()});
6
- a(".metaboxes-tab .onoff_container span").on("click",function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a(".metaboxes-tab .chosen .select_wrapper select").chosen();a(".metaboxes-tab .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),g=a(this).data("labels");
7
- a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);a(this).siblings(".feedback").find("strong").text(c.value+g)}})});f=a("#_active_page_options-container").parent().html();a("#_active_page_options-container").parent().remove();a(f).insertAfter("#yit-post-setting .handlediv");a(f).insertAfter("#yit-page-setting .handlediv");a("#_active_page_options-container").on("click",function(){a("#_active_page_options").is(":checked")?a("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:1,
8
- "pointer-events":"auto"}):a("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:.5,"pointer-events":"none"})}).click();a(".metaboxes-tab [data-field]").each(function(){var b=a(this),c="#"+b.data("field"),d="#"+b.data("dep"),e=b.data("value");k(c,d,e.toString());a(d).on("change",function(){k(c,d,e.toString())}).change()});a(document).on("click",".image-gallery-button",function(b){var c=a(this);b=c.closest(".image-gallery");var d=b.find(".image_gallery_ids"),
9
- e=d.val(),g=b.find("ul.slides-wrapper"),f=wp.media.frames.image_gallery=wp.media({title:c.data("choose"),button:{text:c.data("update")},states:[new wp.media.controller.Library({title:c.data("choose"),filterable:"all",multiple:!0})]});f.on("select",function(){f.state().get("selection").map(function(a){a=a.toJSON();a.id&&(e=e?e+","+a.id:a.id,g.append('<li class="image" data-attachment_id="'+a.id+'"><img src="'+a.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+c.data("delete")+
10
- '">x</a></li></ul></li>'))});d.val(e)});f.open()});a(".image-gallery ul.slides-wrapper").each(function(){var b=a(this);b.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,start:function(a,b){b.item.css("background-color","#f6f6f6")},stop:function(a,b){b.item.removeAttr("style")},update:function(c,d){var e="";b.find("li.image").css("cursor","default").each(function(){var b=a(this).attr("data-attachment_id");e=e+b+","});
11
- b.closest(".image-gallery").find(".image_gallery_ids").val(e)}})});a(".image-gallery ul.slides-wrapper").on("click","a.delete",function(){var b=a(this).closest(".image-gallery"),c=a(this).closest(".image-gallery ul.slides-wrapper"),b=b.find(".image_gallery_ids"),d="";a(this).closest("li.image").remove();c.find("li.image").css("cursor","default").each(function(){var b=a(this).attr("data-attachment_id");d=d+b+","});b.val(d);return!1})})(jQuery);
3
  "");h=!0;wp.media.editor.send.attachment=function(b,e){if(h)a("#"+c).is("input[type=text]")?a("#"+c).val(e.url):a("#"+c+"_custom").val(e.url);else return l.apply(this,[b,e])};wp.media.editor.open(b);return!1}});a(".metaboxes-tab .add_media").on("click",function(){h=!1});a(".metaboxes-tab .panel-colorpicker").wpColorPicker({onInit:function(){console.log("test")},change:function(a,c){},clear:function(){var b=a(this);b.val(b.data("default-color"));b.change()}});a(".metaboxes-tab .panel-colorpicker").each(function(){var b=
4
  a(this).data("variations-label");a(this).parent().parent().find("a.wp-color-result").attr("title",b)});a(".metaboxes-tab .panel-datepicker").each(function(){a(this).datepicker()});var f=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));
5
  0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+"</span>")};a(".metaboxes-tab .select_wrapper select").not(".chosen").each(f).change(f);a(".metaboxes-tab .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".metaboxes-tab .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".metaboxes-tab .select_wrapper select[multiple]").not(".chosen").hide()});
6
+ a(".metaboxes-tab .chosen .select_wrapper select").chosen();a(".metaboxes-tab .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),g=a(this).data("labels");a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);a(this).siblings(".feedback").find("strong").text(c.value+g)}})});f=a("#_active_page_options-container").parent().html();a("#_active_page_options-container").parent().remove();
7
+ a(f).insertAfter("#yit-post-setting .handlediv");a(f).insertAfter("#yit-page-setting .handlediv");a("#_active_page_options-container").on("click",function(){a("#_active_page_options").is(":checked")?a("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:1,"pointer-events":"auto"}):a("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:.5,"pointer-events":"none"})}).click();a(".metaboxes-tab [data-field]").each(function(){var b=
8
+ a(this),c="#"+b.data("field"),d="#"+b.data("dep"),e=b.data("value");k(c,d,e.toString());a(d).on("change",function(){k(c,d,e.toString())}).change()});a(document).on("click",".image-gallery-button",function(b){var c=a(this);b=c.closest(".image-gallery");var d=b.find(".image_gallery_ids"),e=d.val(),g=b.find("ul.slides-wrapper"),f=wp.media.frames.image_gallery=wp.media({title:c.data("choose"),button:{text:c.data("update")},states:[new wp.media.controller.Library({title:c.data("choose"),filterable:"all",
9
+ multiple:!0})]});f.on("select",function(){f.state().get("selection").map(function(a){a=a.toJSON();a.id&&(e=e?e+","+a.id:a.id,g.append('<li class="image" data-attachment_id="'+a.id+'"><img src="'+a.sizes.thumbnail.url+'"/><ul class="actions"><li><a href="#" class="delete" title="'+c.data("delete")+'">x</a></li></ul></li>'))});d.val(e)});f.open()});a(".image-gallery ul.slides-wrapper").each(function(){var b=a(this);b.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,
10
+ forceHelperSize:!1,helper:"clone",opacity:.65,start:function(a,b){b.item.css("background-color","#f6f6f6")},stop:function(a,b){b.item.removeAttr("style")},update:function(c,d){var e="";b.find("li.image").css("cursor","default").each(function(){var b=a(this).attr("data-attachment_id");e=e+b+","});b.closest(".image-gallery").find(".image_gallery_ids").val(e)}})});a(".image-gallery ul.slides-wrapper").on("click","a.delete",function(){var b=a(this).closest(".image-gallery"),c=a(this).closest(".image-gallery ul.slides-wrapper"),
11
+ b=b.find(".image_gallery_ids"),d="";a(this).closest("li.image").remove();c.find("li.image").css("cursor","default").each(function(){var b=a(this).attr("data-attachment_id");d=d+b+","});b.val(d);return!1});a(".the-metabox .rm_onoff.onoff_container span").on("click",function(b){b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()})})(jQuery);
plugin-fw/assets/js/multisite-updater.js CHANGED
@@ -1,216 +1,216 @@
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
- (function ($) {
10
-
11
- var plugins_menu_item = $( '#menu-plugins' ),
12
- update = plugins_menu_item.find('.update-plugins'),
13
- count = update.find(".update-count").text(),
14
- registered = plugins.registered,
15
- activated = plugins.activated;
16
-
17
- if( count == 0 || count == ''){
18
- var update_row = '<span class="update-plugins"><span class="plugin-count"></span></span>';
19
- count = 0;
20
- plugins_menu_item.find( '.wp-menu-name').append( update_row );
21
- }
22
-
23
- /**
24
- * Add the plugin update rows for old plugins
25
- */
26
- update_plugins_row( registered, activated, count, plugins );
27
-
28
- /**
29
- *
30
- * Add the update plugin rows for old plugin
31
- *
32
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
33
- *
34
- * @param registered Registred plugins
35
- * @param activated Activated plugins
36
- * @param count Number of old plugins
37
- * @param localize Localize strings array
38
- *
39
- * @return void
40
- */
41
- function update_plugins_row( registered, activated, count, localize ){
42
- for( var init in registered ){
43
- var plugin = registered[init];
44
- for( var headers in plugin ){
45
-
46
- if( headers == 'slug' || version_compare( plugin[headers].Version, plugin[headers].Latest, '>=' ) ) {
47
- continue;
48
- }
49
-
50
- count = parseInt(count) + 1;
51
- $(".plugin-count").empty().html(count);
52
-
53
- var regex = new RegExp(' ', 'g'),
54
- info = plugin[headers],
55
- name = '' + info.Name,
56
- id = name.replace(regex, '-').trim(),
57
- row = '#' + id.toLowerCase();
58
-
59
- $(row).addClass("update");
60
-
61
- var html = '<tr class="plugin-update-tr">' +
62
- '<td colspan="3" class="plugin-update colspanchange">' +
63
- '<div class="update-message">' + localize.strings.new_version.replace( '%plugin_name%', name ) +
64
- '<a class="thickbox" href="' + localize.details_url[init] + '">' + localize.strings.latest.replace( '%latest%', plugin[headers].Latest ) + '</a>';
65
-
66
- if( typeof activated[init] == "undefined" ) {
67
-
68
- html = html +
69
- ' <em>' + localize.strings.unavailable + '</em>' +
70
- localize.strings.activate.replace( '%activate_link%', localize.licence_activation_url ).replace( '%plugin_name%', name );
71
- } else {
72
- html = html +
73
- '. <a href="' + localize.update_url[init] + '">' + localize.strings.update_now + '</a>';
74
- }
75
-
76
- if( typeof localize.changelogs[init] != 'undefined' ){
77
- html = html + localize.changelogs[init];
78
- }
79
-
80
- html = html +
81
- '</div>' +
82
- '</td>' +
83
- '</tr>';
84
-
85
- $(html).insertAfter(row);
86
- }
87
- }
88
- }
89
-
90
- /**
91
- *
92
- * @param v1 Version 1
93
- * @param v2 Version 2
94
- * @param operator Compare type
95
- * @returns bool
96
- *
97
- * @see php.js library http://phpjs.org/
98
- */
99
- function version_compare(v1, v2, operator) {
100
- // discuss at: http://phpjs.org/functions/version_compare/
101
- // original by: Philippe Jausions (http://pear.php.net/user/jausions)
102
- // original by: Aidan Lister (http://aidanlister.com/)
103
- // reimplemented by: Kankrelune (http://www.webfaktory.info/)
104
- // improved by: Brett Zamir (http://brett-zamir.me)
105
- // improved by: Scott Baker
106
- // improved by: Theriault
107
- // example 1: version_compare('8.2.5rc', '8.2.5a');
108
- // returns 1: 1
109
- // example 2: version_compare('8.2.50', '8.2.52', '<');
110
- // returns 2: true
111
- // example 3: version_compare('5.3.0-dev', '5.3.0');
112
- // returns 3: -1
113
- // example 4: version_compare('4.1.0.52','4.01.0.51');
114
- // returns 4: 1
115
-
116
- this.php_js = this.php_js || {};
117
- this.php_js.ENV = this.php_js.ENV || {};
118
- // END REDUNDANT
119
- // Important: compare must be initialized at 0.
120
- var i = 0,
121
- x = 0,
122
- compare = 0,
123
- // vm maps textual PHP versions to negatives so they're less than 0.
124
- // PHP currently defines these as CASE-SENSITIVE. It is important to
125
- // leave these as negatives so that they can come before numerical versions
126
- // and as if no letters were there to begin with.
127
- // (1alpha is < 1 and < 1.1 but > 1dev1)
128
- // If a non-numerical value can't be mapped to this table, it receives
129
- // -7 as its value.
130
- vm = {
131
- 'dev' : -6,
132
- 'alpha': -5,
133
- 'a' : -5,
134
- 'beta' : -4,
135
- 'b' : -4,
136
- 'RC' : -3,
137
- 'rc' : -3,
138
- '#' : -2,
139
- 'p' : 1,
140
- 'pl' : 1
141
- },
142
- // This function will be called to prepare each version argument.
143
- // It replaces every _, -, and + with a dot.
144
- // It surrounds any nonsequence of numbers/dots with dots.
145
- // It replaces sequences of dots with a single dot.
146
- // version_compare('4..0', '4.0') == 0
147
- // Important: A string of 0 length needs to be converted into a value
148
- // even less than an unexisting value in vm (-7), hence [-8].
149
- // It's also important to not strip spaces because of this.
150
- // version_compare('', ' ') == 1
151
- prepVersion = function (v) {
152
- v = ('' + v)
153
- .replace(/[_\-+]/g, '.');
154
- v = v.replace(/([^.\d]+)/g, '.$1.')
155
- .replace(/\.{2,}/g, '.');
156
- return (!v.length ? [-8] : v.split('.'));
157
- };
158
- // This converts a version component to a number.
159
- // Empty component becomes 0.
160
- // Non-numerical component becomes a negative number.
161
- // Numerical component becomes itself as an integer.
162
- numVersion = function (v) {
163
- return !v ? 0 : (isNaN(v) ? vm[v] || -7 : parseInt(v, 10));
164
- };
165
- v1 = prepVersion(v1);
166
- v2 = prepVersion(v2);
167
- x = Math.max(v1.length, v2.length);
168
- for (i = 0; i < x; i++) {
169
- if (v1[i] == v2[i]) {
170
- continue;
171
- }
172
- v1[i] = numVersion(v1[i]);
173
- v2[i] = numVersion(v2[i]);
174
- if (v1[i] < v2[i]) {
175
- compare = -1;
176
- break;
177
- } else if (v1[i] > v2[i]) {
178
- compare = 1;
179
- break;
180
- }
181
- }
182
- if (!operator) {
183
- return compare;
184
- }
185
-
186
- // Important: operator is CASE-SENSITIVE.
187
- // "No operator" seems to be treated as "<."
188
- // Any other values seem to make the function return null.
189
- switch (operator) {
190
- case '>':
191
- case 'gt':
192
- return (compare > 0);
193
- case '>=':
194
- case 'ge':
195
- return (compare >= 0);
196
- case '<=':
197
- case 'le':
198
- return (compare <= 0);
199
- case '==':
200
- case '=':
201
- case 'eq':
202
- return (compare === 0);
203
- case '<>':
204
- case '!=':
205
- case 'ne':
206
- return (compare !== 0);
207
- case '':
208
- case '<':
209
- case 'lt':
210
- return (compare < 0);
211
- default:
212
- return null;
213
- }
214
- }
215
-
216
- })(jQuery);
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
+ (function ($) {
10
+
11
+ var plugins_menu_item = $( '#menu-plugins' ),
12
+ update = plugins_menu_item.find('.update-plugins'),
13
+ count = update.find(".update-count").text(),
14
+ registered = plugins.registered,
15
+ activated = plugins.activated;
16
+
17
+ if( count == 0 || count == ''){
18
+ var update_row = '<span class="update-plugins"><span class="plugin-count"></span></span>';
19
+ count = 0;
20
+ plugins_menu_item.find( '.wp-menu-name').append( update_row );
21
+ }
22
+
23
+ /**
24
+ * Add the plugin update rows for old plugins
25
+ */
26
+ update_plugins_row( registered, activated, count, plugins );
27
+
28
+ /**
29
+ *
30
+ * Add the update plugin rows for old plugin
31
+ *
32
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
33
+ *
34
+ * @param registered Registred plugins
35
+ * @param activated Activated plugins
36
+ * @param count Number of old plugins
37
+ * @param localize Localize strings array
38
+ *
39
+ * @return void
40
+ */
41
+ function update_plugins_row( registered, activated, count, localize ){
42
+ for( var init in registered ){
43
+ var plugin = registered[init];
44
+ for( var headers in plugin ){
45
+
46
+ if( headers == 'slug' || version_compare( plugin[headers].Version, plugin[headers].Latest, '>=' ) ) {
47
+ continue;
48
+ }
49
+
50
+ count = parseInt(count) + 1;
51
+ $(".plugin-count").empty().html(count);
52
+
53
+ var regex = new RegExp(' ', 'g'),
54
+ info = plugin[headers],
55
+ name = '' + info.Name,
56
+ id = name.replace(regex, '-').trim(),
57
+ row = '*[data-slug="' + id.toLowerCase() +'"]';
58
+
59
+ $(row).addClass("update");
60
+
61
+ var html = '<tr class="plugin-update-tr">' +
62
+ '<td colspan="3" class="plugin-update colspanchange">' +
63
+ '<div class="update-message">' + localize.strings.new_version.replace( '%plugin_name%', name ) +
64
+ '<a class="thickbox" href="' + localize.details_url[init] + '">' + localize.strings.latest.replace( '%latest%', plugin[headers].Latest ) + '</a>';
65
+
66
+ if( typeof activated[init] == "undefined" ) {
67
+
68
+ html = html +
69
+ ' <em>' + localize.strings.unavailable + '</em>' +
70
+ localize.strings.activate.replace( '%activate_link%', localize.licence_activation_url ).replace( '%plugin_name%', name );
71
+ } else {
72
+ html = html +
73
+ '. <a href="' + localize.update_url[init] + '">' + localize.strings.update_now + '</a>';
74
+ }
75
+
76
+ if( typeof localize.changelogs[init] != 'undefined' ){
77
+ html = html + localize.changelogs[init];
78
+ }
79
+
80
+ html = html +
81
+ '</div>' +
82
+ '</td>' +
83
+ '</tr>';
84
+
85
+ $(html).insertAfter(row);
86
+ }
87
+ }
88
+ }
89
+
90
+ /**
91
+ *
92
+ * @param v1 Version 1
93
+ * @param v2 Version 2
94
+ * @param operator Compare type
95
+ * @returns bool
96
+ *
97
+ * @see php.js library http://phpjs.org/
98
+ */
99
+ function version_compare(v1, v2, operator) {
100
+ // discuss at: http://phpjs.org/functions/version_compare/
101
+ // original by: Philippe Jausions (http://pear.php.net/user/jausions)
102
+ // original by: Aidan Lister (http://aidanlister.com/)
103
+ // reimplemented by: Kankrelune (http://www.webfaktory.info/)
104
+ // improved by: Brett Zamir (http://brett-zamir.me)
105
+ // improved by: Scott Baker
106
+ // improved by: Theriault
107
+ // example 1: version_compare('8.2.5rc', '8.2.5a');
108
+ // returns 1: 1
109
+ // example 2: version_compare('8.2.50', '8.2.52', '<');
110
+ // returns 2: true
111
+ // example 3: version_compare('5.3.0-dev', '5.3.0');
112
+ // returns 3: -1
113
+ // example 4: version_compare('4.1.0.52','4.01.0.51');
114
+ // returns 4: 1
115
+
116
+ this.php_js = this.php_js || {};
117
+ this.php_js.ENV = this.php_js.ENV || {};
118
+ // END REDUNDANT
119
+ // Important: compare must be initialized at 0.
120
+ var i = 0,
121
+ x = 0,
122
+ compare = 0,
123
+ // vm maps textual PHP versions to negatives so they're less than 0.
124
+ // PHP currently defines these as CASE-SENSITIVE. It is important to
125
+ // leave these as negatives so that they can come before numerical versions
126
+ // and as if no letters were there to begin with.
127
+ // (1alpha is < 1 and < 1.1 but > 1dev1)
128
+ // If a non-numerical value can't be mapped to this table, it receives
129
+ // -7 as its value.
130
+ vm = {
131
+ 'dev' : -6,
132
+ 'alpha': -5,
133
+ 'a' : -5,
134
+ 'beta' : -4,
135
+ 'b' : -4,
136
+ 'RC' : -3,
137
+ 'rc' : -3,
138
+ '#' : -2,
139
+ 'p' : 1,
140
+ 'pl' : 1
141
+ },
142
+ // This function will be called to prepare each version argument.
143
+ // It replaces every _, -, and + with a dot.
144
+ // It surrounds any nonsequence of numbers/dots with dots.
145
+ // It replaces sequences of dots with a single dot.
146
+ // version_compare('4..0', '4.0') == 0
147
+ // Important: A string of 0 length needs to be converted into a value
148
+ // even less than an unexisting value in vm (-7), hence [-8].
149
+ // It's also important to not strip spaces because of this.
150
+ // version_compare('', ' ') == 1
151
+ prepVersion = function (v) {
152
+ v = ('' + v)
153
+ .replace(/[_\-+]/g, '.');
154
+ v = v.replace(/([^.\d]+)/g, '.$1.')
155
+ .replace(/\.{2,}/g, '.');
156
+ return (!v.length ? [-8] : v.split('.'));
157
+ };
158
+ // This converts a version component to a number.
159
+ // Empty component becomes 0.
160
+ // Non-numerical component becomes a negative number.
161
+ // Numerical component becomes itself as an integer.
162
+ numVersion = function (v) {
163
+ return !v ? 0 : (isNaN(v) ? vm[v] || -7 : parseInt(v, 10));
164
+ };
165
+ v1 = prepVersion(v1);
166
+ v2 = prepVersion(v2);
167
+ x = Math.max(v1.length, v2.length);
168
+ for (i = 0; i < x; i++) {
169
+ if (v1[i] == v2[i]) {
170
+ continue;
171
+ }
172
+ v1[i] = numVersion(v1[i]);
173
+ v2[i] = numVersion(v2[i]);
174
+ if (v1[i] < v2[i]) {
175
+ compare = -1;
176
+ break;
177
+ } else if (v1[i] > v2[i]) {
178
+ compare = 1;
179
+ break;
180
+ }
181
+ }
182
+ if (!operator) {
183
+ return compare;
184
+ }
185
+
186
+ // Important: operator is CASE-SENSITIVE.
187
+ // "No operator" seems to be treated as "<."
188
+ // Any other values seem to make the function return null.
189
+ switch (operator) {
190
+ case '>':
191
+ case 'gt':
192
+ return (compare > 0);
193
+ case '>=':
194
+ case 'ge':
195
+ return (compare >= 0);
196
+ case '<=':
197
+ case 'le':
198
+ return (compare <= 0);
199
+ case '==':
200
+ case '=':
201
+ case 'eq':
202
+ return (compare === 0);
203
+ case '<>':
204
+ case '!=':
205
+ case 'ne':
206
+ return (compare !== 0);
207
+ case '':
208
+ case '<':
209
+ case 'lt':
210
+ return (compare < 0);
211
+ default:
212
+ return null;
213
+ }
214
+ }
215
+
216
+ })(jQuery);
plugin-fw/assets/js/multisite-updater.min.js CHANGED
@@ -1,4 +1 @@
1
- (function(m){function n(c,d,k){this.php_js=this.php_js||{};this.php_js.ENV=this.php_js.ENV||{};var a=0,e=0,b=0,f={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},a=function(a){a=(""+a).replace(/[_\-+]/g,".");a=a.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".");return a.length?a.split("."):[-8]};numVersion=function(a){return a?isNaN(a)?f[a]||-7:parseInt(a,10):0};c=a(c);d=a(d);e=Math.max(c.length,d.length);for(a=0;a<e;a++)if(c[a]!=d[a])if(c[a]=numVersion(c[a]),d[a]=numVersion(d[a]),
2
- c[a]<d[a]){b=-1;break}else if(c[a]>d[a]){b=1;break}if(!k)return b;switch(k){case ">":case "gt":return 0<b;case ">=":case "ge":return 0<=b;case "<=":case "le":return 0>=b;case "==":case "=":case "eq":return 0===b;case "<>":case "!=":case "ne":return 0!==b;case "":case "<":case "lt":return 0>b;default:return null}}var l=m("#menu-plugins"),g=l.find(".update-plugins").find(".update-count").text(),p=plugins.registered,q=plugins.activated;if(0==g||""==g)g=0,l.find(".wp-menu-name").append('<span class="update-plugins"><span class="plugin-count"></span></span>');
3
- (function(c,d,k,a){for(var e in c){var b=c[e],f;for(f in b)if("slug"!=f&&!n(b[f].Version,b[f].Latest,">=")){k=parseInt(k)+1;m(".plugin-count").empty().html(k);var g=""+b[f].Name,l="#"+g.replace(RegExp(" ","g"),"-").trim().toLowerCase();m(l).addClass("update");var h='<tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message">'+a.strings.new_version.replace("%plugin_name%",g)+'<a class="thickbox" href="'+a.details_url[e]+'">'+a.strings.latest.replace("%latest%",
4
- b[f].Latest)+"</a>",h="undefined"==typeof d[e]?h+" <em>"+a.strings.unavailable+"</em>"+a.strings.activate.replace("%activate_link%",a.licence_activation_url).replace("%plugin_name%",g):h+'. <a href="'+a.update_url[e]+'">'+a.strings.update_now+"</a>";"undefined"!=typeof a.changelogs[e]&&(h+=a.changelogs[e]);h+="</div></td></tr>";m(h).insertAfter(l)}}})(p,q,g,plugins)})(jQuery);
1
+ !function(e){function a(a,s,t,r){for(var i in a){var p=a[i];for(var l in p)if("slug"!=l&&!n(p[l].Version,p[l].Latest,">=")){t=parseInt(t)+1,e(".plugin-count").empty().html(t);var u=new RegExp(" ","g"),c=p[l],g=""+c.Name,d=g.replace(u,"-").trim(),o='*[data-slug="'+d.toLowerCase()+'"]';e(o).addClass("update");var f='<tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message">'+r.strings.new_version.replace("%plugin_name%",g)+'<a class="thickbox" href="'+r.details_url[i]+'">'+r.strings.latest.replace("%latest%",p[l].Latest)+"</a>";f="undefined"==typeof s[i]?f+" <em>"+r.strings.unavailable+"</em>"+r.strings.activate.replace("%activate_link%",r.licence_activation_url).replace("%plugin_name%",g):f+'. <a href="'+r.update_url[i]+'">'+r.strings.update_now+"</a>","undefined"!=typeof r.changelogs[i]&&(f+=r.changelogs[i]),f+="</div></td></tr>",e(f).insertAfter(o)}}}function n(e,a,n){this.php_js=this.php_js||{},this.php_js.ENV=this.php_js.ENV||{};var s=0,t=0,r=0,i={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},p=function(e){return e=(""+e).replace(/[_\-+]/g,"."),e=e.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),e.length?e.split("."):[-8]};for(numVersion=function(e){return e?isNaN(e)?i[e]||-7:parseInt(e,10):0},e=p(e),a=p(a),t=Math.max(e.length,a.length),s=0;t>s;s++)if(e[s]!=a[s]){if(e[s]=numVersion(e[s]),a[s]=numVersion(a[s]),e[s]<a[s]){r=-1;break}if(e[s]>a[s]){r=1;break}}if(!n)return r;switch(n){case">":case"gt":return r>0;case">=":case"ge":return r>=0;case"<=":case"le":return 0>=r;case"==":case"=":case"eq":return 0===r;case"<>":case"!=":case"ne":return 0!==r;case"":case"<":case"lt":return 0>r;default:return null}}var s=e("#menu-plugins"),t=s.find(".update-plugins"),r=t.find(".update-count").text(),i=plugins.registered,p=plugins.activated;if(0==r||""==r){var l='<span class="update-plugins"><span class="plugin-count"></span></span>';r=0,s.find(".wp-menu-name").append(l)}a(i,p,r,plugins)}(jQuery);
 
 
 
plugin-fw/assets/js/yit-cpt-unlimited.js CHANGED
@@ -1,79 +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);
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 CHANGED
@@ -1,2 +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,
2
- action:"yit_cptu_multiuploader"},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);
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-cptu-sortable-posts.js CHANGED
@@ -1,32 +1,32 @@
1
- /**
2
- * This file belongs to the YIT Framework.
3
- *
4
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
- * that is bundled with this package in the file LICENSE.txt.
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.gnu.org/licenses/gpl-3.0.txt
8
- */
9
-
10
- (function($) {
11
- "use strict";
12
- // Author code here
13
-
14
- $("#the-list").sortable({
15
- items : 'tr',
16
- axis : 'y',
17
- helper : function(e, ui) {
18
- ui.children().children().each(function() {
19
- $(this).width( $(this).width() );
20
- });
21
- return ui;
22
- },
23
- update : function(e, ui) {
24
- $.post( ajaxurl, {
25
- action: 'cpt_sort_posts',
26
- order: $("#the-list").sortable("serialize"),
27
- post_type: typenow
28
- });
29
- }
30
- });
31
-
32
  })(jQuery);
1
+ /**
2
+ * This file belongs to the YIT Framework.
3
+ *
4
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
+ * that is bundled with this package in the file LICENSE.txt.
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.gnu.org/licenses/gpl-3.0.txt
8
+ */
9
+
10
+ (function($) {
11
+ "use strict";
12
+ // Author code here
13
+
14
+ $("#the-list").sortable({
15
+ items : 'tr',
16
+ axis : 'y',
17
+ helper : function(e, ui) {
18
+ ui.children().children().each(function() {
19
+ $(this).width( $(this).width() );
20
+ });
21
+ return ui;
22
+ },
23
+ update : function(e, ui) {
24
+ $.post( ajaxurl, {
25
+ action: 'cpt_sort_posts',
26
+ order: $("#the-list").sortable("serialize"),
27
+ post_type: typenow
28
+ });
29
+ }
30
+ });
31
+
32
  })(jQuery);
plugin-fw/assets/js/yit-plugin-panel-sidebar.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * This file belongs to the YIT Plugin Framework.
3
+ *
4
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
+ * that is bundled with this package in the file LICENSE.txt.
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.gnu.org/licenses/gpl-3.0.txt
8
+ */
9
+
10
+
11
+ (function ( $ ) {
12
+ var hide_sidebar_btn = $( '#yit-panel-sidebar-action-hide' ),
13
+ hide_sidebar_text = hide_sidebar_btn.find( '.yit-panel-sidebar-action-title' ),
14
+ sidebar = $( '#yit-panel-sidebar' ),
15
+ panel_wrapper = $( '.' + sidebar_labels.wrapper_class ),
16
+ ajax_hide_option_save_call,
17
+ ajax_hide_option_save = function ( option ) {
18
+ if ( ajax_hide_option_save_call ) {
19
+ ajax_hide_option_save_call.abort();
20
+ }
21
+
22
+ var post_data = {
23
+ option: option,
24
+ action: 'yith_plugin_panel_sidebar_set_collapse_option'
25
+ };
26
+
27
+ ajax_hide_option_save_call = $.ajax( {
28
+ type: "POST",
29
+ data: post_data,
30
+ url: ajaxurl
31
+ } );
32
+ },
33
+ hide_sidebar = function () {
34
+ hide_sidebar_btn.removeClass( 'hide-on-click' );
35
+ hide_sidebar_text.html( sidebar_labels.show_sidebar );
36
+ sidebar.addClass( 'yith-panel-sidebar-hidden' );
37
+ panel_wrapper.addClass( 'yit-admin-panel-content-wrap-full' );
38
+ ajax_hide_option_save( 'yes' );
39
+ },
40
+ show_sidebar = function () {
41
+ hide_sidebar_btn.addClass( 'hide-on-click' );
42
+ hide_sidebar_text.html( sidebar_labels.hide_sidebar );
43
+ sidebar.removeClass( 'yith-panel-sidebar-hidden' );
44
+ panel_wrapper.removeClass( 'yit-admin-panel-content-wrap-full' );
45
+ ajax_hide_option_save( 'no' );
46
+ };
47
+
48
+ hide_sidebar_btn.on( 'click', function () {
49
+ if ( $( this ).is( '.hide-on-click' ) ) {
50
+ hide_sidebar();
51
+ } else {
52
+ show_sidebar();
53
+ }
54
+ } );
55
+
56
+ })( jQuery );
plugin-fw/assets/js/yit-plugin-panel-sidebar.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a){var i,e=a("#yit-panel-sidebar-action-hide"),n=e.find(".yit-panel-sidebar-action-title"),l=a("#yit-panel-sidebar"),s=a("."+sidebar_labels.wrapper_class),t=function(e){i&&i.abort();var n={option:e,action:"yith_plugin_panel_sidebar_set_collapse_option"};i=a.ajax({type:"POST",data:n,url:ajaxurl})},d=function(){e.removeClass("hide-on-click"),n.html(sidebar_labels.show_sidebar),l.addClass("yith-panel-sidebar-hidden"),s.addClass("yit-admin-panel-content-wrap-full"),t("yes")},o=function(){e.addClass("hide-on-click"),n.html(sidebar_labels.hide_sidebar),l.removeClass("yith-panel-sidebar-hidden"),s.removeClass("yit-admin-panel-content-wrap-full"),t("no")};e.on("click",function(){a(this).is(".hide-on-click")?d():o()})}(jQuery);
plugin-fw/assets/js/yit-plugin-panel.js CHANGED
@@ -1,329 +1,329 @@
1
- /**
2
- * This file belongs to the YIT Plugin Framework.
3
- *
4
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
- * that is bundled with this package in the file LICENSE.txt.
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.gnu.org/licenses/gpl-3.0.txt
8
- */
9
-
10
-
11
- (function ($) {
12
-
13
- // select
14
- var select_value = function () {
15
-
16
- var value = '';
17
-
18
- if ($(this).attr('multiple')) {
19
- $(this).children("option:selected").each(function (i, v) {
20
- if (i != 0)
21
- value += ', ';
22
-
23
- value += $(v).text();
24
- });
25
-
26
- if (value == '') {
27
- $(this).children().children("option:selected").each(function (i, v) {
28
- if (i != 0)
29
- value += ', ';
30
-
31
- value += $(v).text();
32
- });
33
- }
34
- }
35
- else {
36
- value = $(this).children("option:selected").text();
37
-
38
- if (value == '')
39
- value = $(this).children().children("option:selected").text();
40
- }
41
-
42
-
43
- if ($(this).parent().find('span').length <= 0) {
44
- $(this).before('<span></span>');
45
- }
46
-
47
- $(this).parent().children('span').replaceWith('<span>' + value + '</span>');
48
- };
49
- $('.plugin-option .select_wrapper select').not('.chosen').each(select_value).change(select_value);
50
-
51
- //Open select multiple
52
- $('.plugin-option .select_wrapper').click(function (e) {
53
- e.stopPropagation();
54
- $(this).find('select[multiple]').not('.chosen').toggle();
55
- });
56
- //Stops click propagation on select, to prevent select hide
57
- $('.plugin-option .select_wrapper select[multiple]').not('.chosen').click(function (e) {
58
- e.stopPropagation();
59
- });
60
- //Hides select on window click
61
- $(window).click(function () {
62
- $('.plugin-option .select_wrapper select[multiple]').not('.chosen').hide();
63
- })
64
- //chosen
65
- $('.plugin-option .chosen .select_wrapper select').chosen();
66
-
67
- // on-off
68
- $('.plugin-option .on_off_container span').on('click', function () {
69
- var input = $(this).prev('input');
70
- var checked = input.prop('checked');
71
-
72
- if (checked) {
73
- input.prop('checked', false).attr('value', 'no').removeClass('onoffchecked');
74
- } else {
75
- input.prop('checked', true).attr('value', 'yes').addClass('onoffchecked');
76
- }
77
-
78
- input.change();
79
- });
80
-
81
-
82
- //slider
83
- $('.plugin-option .slider_container .ui-slider-horizontal').each(function () {
84
- var val = $(this).data('val');
85
- var minValue = $(this).data('min');
86
- var maxValue = $(this).data('max');
87
- var step = $(this).data('step');
88
- var labels = $(this).data('labels');
89
-
90
- $(this).slider({
91
- value: val,
92
- min : minValue,
93
- max : maxValue,
94
- range: 'min',
95
- step : step,
96
-
97
- slide: function (event, ui) {
98
- $(this).find('input').val(ui.value);
99
- $(this).siblings('.feedback').find('strong').text(ui.value + labels);
100
- }
101
- });
102
- });
103
-
104
-
105
- if (typeof wp !== 'undefined' && typeof wp.media !== 'undefined') {
106
-
107
- //upload
108
- var _custom_media = true,
109
- _orig_send_attachment = wp.media.editor.send.attachment;
110
-
111
- // preview
112
- $('.plugin-option .upload_img_url').change(function () {
113
- var url = $(this).val();
114
- var re = new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)");
115
-
116
- var preview = $(this).parents().siblings('.upload_img_preview');
117
- if (re.test(url)) {
118
- preview.html('<img src="' + url + '" style="max-width:600px; max-height:300px;" />');
119
- } else {
120
- preview.html('');
121
- }
122
- }).trigger( 'change' );
123
-
124
- $( document ).on( 'click', '.plugin-option .upload_button', function(e) {
125
- e.preventDefault();
126
-
127
- var t = $(this),
128
- custom_uploader,
129
- id = t.attr('id').replace(/-button$/, '');
130
-
131
- //If the uploader object has already been created, reopen the dialog
132
- if (custom_uploader) {
133
- custom_uploader.open();
134
- return;
135
- }
136
-
137
- var custom_uploader_states = [
138
- // Main states.
139
- new wp.media.controller.Library({
140
- library: wp.media.query(),
141
- multiple: false,
142
- title: 'Choose Image',
143
- priority: 20,
144
- filterable: 'uploaded'
145
- })
146
- ];
147
-
148
- // Create the media frame.
149
- custom_uploader = wp.media.frames.downloadable_file = wp.media({
150
- // Set the title of the modal.
151
- title: 'Choose Image',
152
- library: {
153
- type: ''
154
- },
155
- button: {
156
- text: 'Choose Image'
157
- },
158
- multiple: false,
159
- states: custom_uploader_states
160
- });
161
-
162
-
163
- //When a file is selected, grab the URL and set it as the text field's value
164
- custom_uploader.on( 'select' , function() {
165
- var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
166
-
167
- $("#" + id).val( attachment.url );
168
- // Save the id of the selected element to an element which name is the same with
169
- // a suffix "-yith-attachment-id"
170
- if ($("#" + id + "-yith-attachment-id")) {
171
- $("#" + id + "-yith-attachment-id").val(attachment.id);
172
- }
173
-
174
- $('.plugin-option .upload_img_url').trigger('change');
175
- });
176
-
177
- //Open the uploader dialog
178
- custom_uploader.open();
179
- });
180
-
181
- $( document).on( 'click', '.plugin-option .upload_button_reset', function(e){
182
- var t = $(this),
183
- id = t.attr('id'),
184
- input_id = t.attr('id').replace(/-button_reset$/, ''),
185
- default_value = $('#' + id).data('default');
186
-
187
- $("#" + input_id).val( default_value );
188
- $('.plugin-option .upload_img_url').trigger('change');
189
- } );
190
- }
191
-
192
- $('.plugin-option .add_media').on('click', function () {
193
- _custom_media = false;
194
- });
195
-
196
- //dependencies handler
197
- $('[data-field]').each(function () {
198
- var t = $(this);
199
-
200
- var field = '#' + t.data('field'),
201
- dep = '#' + t.data('dep'),
202
- value = t.data('value');
203
-
204
- $(dep).on('change',function () {
205
- dependencies_handler(field, dep, value.toString());
206
- }).change();
207
- });
208
-
209
- //Handle dependencies.
210
- function dependencies_handler(id, deps, values) {
211
- var result = true;
212
-
213
- //Single dependency
214
- if (typeof( deps ) == 'string') {
215
- if (deps.substr(0, 6) == ':radio') {
216
- deps = deps + ':checked';
217
- }
218
-
219
- var values = values.split(',');
220
-
221
- for (var i = 0; i < values.length; i++) {
222
-
223
- if ($(deps).val() != values[i]) {
224
- result = false;
225
- }
226
- else {
227
- result = true;
228
- break;
229
- }
230
- }
231
- }
232
-
233
- if (!result) {
234
- $(id + '-container').closest('tr').hide();
235
- } else {
236
- $(id + '-container').closest('tr').show();
237
- }
238
- };
239
-
240
- //connected list
241
- $('.rm_connectedlist').each(function () {
242
- var ul = $(this).find('ul');
243
- var input = $(this).find(':hidden');
244
- var sortable = ul.sortable({
245
- connectWith: ul,
246
- update : function (event, ui) {
247
- var value = {};
248
-
249
- ul.each(function () {
250
- var options = {};
251
-
252
- $(this).children().each(function () {
253
- options[ $(this).data('option') ] = $(this).text();
254
- });
255
-
256
- value[ $(this).data('list') ] = options;
257
- });
258
-
259
- input.val((JSON.stringify(value)).replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0'));
260
- }
261
- }).disableSelection();
262
- });
263
-
264
- $(document).ready(function () {
265
-
266
- $('.yith-video-link').click(function (event) {
267
- event.preventDefault();
268
- var target = $(this).data('video-id');
269
-
270
- $('.' + target).dialog({
271
- dialogClass : 'wp-dialog yit-dialog yit-video-dialog',
272
- modal : true,
273
- closeOnEscape: true,
274
- width : 'auto',
275
- resizable : false,
276
- draggable : false,
277
- create : function (event, ui) {
278
- $(this).css("maxWidth", "853px");
279
- },
280
- open : function (event, ui) {
281
-
282
- $('.ui-widget-overlay').bind('click', function () {
283
- $(this).siblings('.ui-dialog').find('.ui-dialog-content').dialog('close');
284
- });
285
-
286
- }
287
-
288
- });
289
-
290
- $('.ui-dialog :button').blur();
291
-
292
- });
293
- });
294
-
295
- //codemirror
296
- $(document).ready(function () {
297
- $('.codemirror').each(function (i, v) {
298
- var editor = CodeMirror.fromTextArea(v, {
299
- lineNumbers : 1,
300
- mode : 'javascript',
301
- showCursorWhenSelecting: true
302
- })
303
-
304
- $(v).data('codemirrorInstance', editor);
305
- })
306
- })
307
-
308
- //google analytics generation
309
- $(document).ready(function () {
310
- $('.google-analytic-generate').click(function () {
311
- var editor = $('#' + $(this).data('textarea')).data('codemirrorInstance');
312
- var gatc = $('#' + $(this).data('input')).val();
313
- var basename = $(this).data('basename');
314
-
315
- var text = "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n";
316
- text += "(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\n";
317
- text += "m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n";
318
- text += "})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n";
319
- text += "ga('create', '" + gatc + "', '" + basename + "');\n";
320
- text += "ga('send', 'pageview');\n";
321
- editor.replaceRange(
322
- text,
323
- editor.getCursor('start'),
324
- editor.getCursor('end')
325
- )
326
- })
327
- })
328
-
329
  })(jQuery);
1
+ /**
2
+ * This file belongs to the YIT Plugin Framework.
3
+ *
4
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
+ * that is bundled with this package in the file LICENSE.txt.
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.gnu.org/licenses/gpl-3.0.txt
8
+ */
9
+
10
+
11
+ (function ($) {
12
+
13
+ // select
14
+ var select_value = function () {
15
+
16
+ var value = '';
17
+
18
+ if ($(this).attr('multiple')) {
19
+ $(this).children("option:selected").each(function (i, v) {
20
+ if (i != 0)
21
+ value += ', ';
22
+
23
+ value += $(v).text();
24
+ });
25
+
26
+ if (value == '') {
27
+ $(this).children().children("option:selected").each(function (i, v) {
28
+ if (i != 0)
29
+ value += ', ';
30
+
31
+ value += $(v).text();
32
+ });
33
+ }
34
+ }
35
+ else {
36
+ value = $(this).children("option:selected").text();
37
+
38
+ if (value == '')
39
+ value = $(this).children().children("option:selected").text();
40
+ }
41
+
42
+
43
+ if ($(this).parent().find('span').length <= 0) {
44
+ $(this).before('<span></span>');
45
+ }
46
+
47
+ $(this).parent().children('span').replaceWith('<span>' + value + '</span>');
48
+ };
49
+ $('.plugin-option .select_wrapper select').not('.chosen').each(select_value).change(select_value);
50
+
51
+ //Open select multiple
52
+ $('.plugin-option .select_wrapper').click(function (e) {
53
+ e.stopPropagation();
54
+ $(this).find('select[multiple]').not('.chosen').toggle();
55
+ });
56
+ //Stops click propagation on select, to prevent select hide
57
+ $('.plugin-option .select_wrapper select[multiple]').not('.chosen').click(function (e) {
58
+ e.stopPropagation();
59
+ });
60
+ //Hides select on window click
61
+ $(window).click(function () {
62
+ $('.plugin-option .select_wrapper select[multiple]').not('.chosen').hide();
63
+ })
64
+ //chosen
65
+ $('.plugin-option .chosen .select_wrapper select').chosen();
66
+
67
+ // on-off
68
+ $('.plugin-option .onoff_container span').on('click', function () {
69
+ var input = $(this).prev('input');
70
+ var checked = input.prop('checked');
71
+
72
+ if (checked) {
73
+ input.prop('checked', false).attr('value', 'no').removeClass('onoffchecked');
74
+ } else {
75
+ input.prop('checked', true).attr('value', 'yes').addClass('onoffchecked');
76
+ }
77
+
78
+ input.change();
79
+ });
80
+
81
+
82
+ //slider
83
+ $('.plugin-option .slider_container .ui-slider-horizontal').each(function () {
84
+ var val = $(this).data('val');
85
+ var minValue = $(this).data('min');
86
+ var maxValue = $(this).data('max');
87
+ var step = $(this).data('step');
88
+ var labels = $(this).data('labels');
89
+
90
+ $(this).slider({
91
+ value: val,
92
+ min : minValue,
93
+ max : maxValue,
94
+ range: 'min',
95
+ step : step,
96
+
97
+ slide: function (event, ui) {
98
+ $(this).find('input').val(ui.value);
99
+ $(this).siblings('.feedback').find('strong').text(ui.value + labels);
100
+ }
101
+ });
102
+ });
103
+
104
+
105
+ if (typeof wp !== 'undefined' && typeof wp.media !== 'undefined') {
106
+
107
+ //upload
108
+ var _custom_media = true,
109
+ _orig_send_attachment = wp.media.editor.send.attachment;
110
+
111
+ // preview
112
+ $('.plugin-option .upload_img_url').change(function () {
113
+ var url = $(this).val();
114
+ var re = new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)");
115
+
116
+ var preview = $(this).parents().siblings('.upload_img_preview');
117
+ if (re.test(url)) {
118
+ preview.html('<img src="' + url + '" style="max-width:600px; max-height:300px;" />');
119
+ } else {
120
+ preview.html('');
121
+ }
122
+ }).trigger( 'change' );
123
+
124
+ $( document ).on( 'click', '.plugin-option .upload_button', function(e) {
125
+ e.preventDefault();
126
+
127
+ var t = $(this),
128
+ custom_uploader,
129
+ id = t.attr('id').replace(/-button$/, '');
130
+
131
+ //If the uploader object has already been created, reopen the dialog
132
+ if (custom_uploader) {
133
+ custom_uploader.open();
134
+ return;
135
+ }
136
+
137
+ var custom_uploader_states = [
138
+ // Main states.
139
+ new wp.media.controller.Library({
140
+ library: wp.media.query(),
141
+ multiple: false,
142
+ title: 'Choose Image',
143
+ priority: 20,
144
+ filterable: 'uploaded'
145
+ })
146
+ ];
147
+
148
+ // Create the media frame.
149
+ custom_uploader = wp.media.frames.downloadable_file = wp.media({
150
+ // Set the title of the modal.
151
+ title: 'Choose Image',
152
+ library: {
153
+ type: ''
154
+ },
155
+ button: {
156
+ text: 'Choose Image'
157
+ },
158
+ multiple: false,
159
+ states: custom_uploader_states
160
+ });
161
+
162
+
163
+ //When a file is selected, grab the URL and set it as the text field's value
164
+ custom_uploader.on( 'select' , function() {
165
+ var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
166
+
167
+ $("#" + id).val( attachment.url );
168
+ // Save the id of the selected element to an element which name is the same with
169
+ // a suffix "-yith-attachment-id"
170
+ if ($("#" + id + "-yith-attachment-id")) {
171
+ $("#" + id + "-yith-attachment-id").val(attachment.id);
172
+ }
173
+
174
+ $('.plugin-option .upload_img_url').trigger('change');
175
+ });
176
+
177
+ //Open the uploader dialog
178
+ custom_uploader.open();
179
+ });
180
+
181
+ $( document).on( 'click', '.plugin-option .upload_button_reset', function(e){
182
+ var t = $(this),
183
+ id = t.attr('id'),
184
+ input_id = t.attr('id').replace(/-button_reset$/, ''),
185
+ default_value = $('#' + id).data('default');
186
+
187
+ $("#" + input_id).val( default_value );
188
+ $('.plugin-option .upload_img_url').trigger('change');
189
+ } );
190
+ }
191
+
192
+ $('.plugin-option .add_media').on('click', function () {
193
+ _custom_media = false;
194
+ });
195
+
196
+ //dependencies handler
197
+ $('[data-field]').each(function () {
198
+ var t = $(this);
199
+
200
+ var field = '#' + t.data('field'),
201
+ dep = '#' + t.data('dep'),
202
+ value = t.data('value');
203
+
204
+ $(dep).on('change',function () {
205
+ dependencies_handler(field, dep, value.toString());
206
+ }).change();
207
+ });
208
+
209
+ //Handle dependencies.
210
+ function dependencies_handler(id, deps, values) {
211
+ var result = true;
212
+
213
+ //Single dependency
214
+ if (typeof( deps ) == 'string') {
215
+ if (deps.substr(0, 6) == ':radio') {
216
+ deps = deps + ':checked';
217
+ }
218
+
219
+ var values = values.split(',');
220
+
221
+ for (var i = 0; i < values.length; i++) {
222
+
223
+ if ($(deps).val() != values[i]) {
224
+ result = false;
225
+ }
226
+ else {
227
+ result = true;
228
+ break;
229
+ }
230
+ }
231
+ }
232
+
233
+ if (!result) {
234
+ $(id + '-container').closest('tr').hide();
235
+ } else {
236
+ $(id + '-container').closest('tr').show();
237
+ }
238
+ };
239
+
240
+ //connected list
241
+ $('.rm_connectedlist').each(function () {
242
+ var ul = $(this).find('ul');
243
+ var input = $(this).find(':hidden');
244
+ var sortable = ul.sortable({
245
+ connectWith: ul,
246
+ update : function (event, ui) {
247
+ var value = {};
248
+
249
+ ul.each(function () {
250
+ var options = {};
251
+
252
+ $(this).children().each(function () {
253
+ options[ $(this).data('option') ] = $(this).text();
254
+ });
255
+
256
+ value[ $(this).data('list') ] = options;
257
+ });
258
+
259
+ input.val((JSON.stringify(value)).replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0'));
260
+ }
261
+ }).disableSelection();
262
+ });
263
+
264
+ $(document).ready(function () {
265
+
266
+ $('.yith-video-link').click(function (event) {
267
+ event.preventDefault();
268
+ var target = $(this).data('video-id');
269
+
270
+ $('.' + target).dialog({
271
+ dialogClass : 'wp-dialog yit-dialog yit-video-dialog',
272
+ modal : true,
273
+ closeOnEscape: true,
274
+ width : 'auto',
275
+ resizable : false,
276
+ draggable : false,
277
+ create : function (event, ui) {
278
+ $(this).css("maxWidth", "853px");
279
+ },
280
+ open : function (event, ui) {
281
+
282
+ $('.ui-widget-overlay').bind('click', function () {
283
+ $(this).siblings('.ui-dialog').find('.ui-dialog-content').dialog('close');
284
+ });
285
+
286
+ }
287
+
288
+ });
289
+
290
+ $('.ui-dialog :button').blur();
291
+
292
+ });
293
+ });
294
+
295
+ //codemirror
296
+ $(document).ready(function () {
297
+ $('.codemirror').each(function (i, v) {
298
+ var editor = CodeMirror.fromTextArea(v, {
299
+ lineNumbers : 1,
300
+ mode : 'javascript',
301
+ showCursorWhenSelecting: true
302
+ })
303
+
304
+ $(v).data('codemirrorInstance', editor);
305
+ })
306
+ })
307
+
308
+ //google analytics generation
309
+ $(document).ready(function () {
310
+ $('.google-analytic-generate').click(function () {
311
+ var editor = $('#' + $(this).data('textarea')).data('codemirrorInstance');
312
+ var gatc = $('#' + $(this).data('input')).val();
313
+ var basename = $(this).data('basename');
314
+
315
+ var text = "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n";
316
+ text += "(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\n";
317
+ text += "m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n";
318
+ text += "})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n";
319
+ text += "ga('create', '" + gatc + "', '" + basename + "');\n";
320
+ text += "ga('send', 'pageview');\n";
321
+ editor.replaceRange(
322
+ text,
323
+ editor.getCursor('start'),
324
+ editor.getCursor('end')
325
+ )
326
+ })
327
+ })
328
+
329
  })(jQuery);
plugin-fw/assets/js/yit-plugin-panel.min.js CHANGED
@@ -1,5 +1,5 @@
1
  (function(a){var l=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+
2
- "</span>")};a(".plugin-option .select_wrapper select").not(".chosen").each(l).change(l);a(".plugin-option .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()});a(".plugin-option .chosen .select_wrapper select").chosen();a(".plugin-option .on_off_container span").on("click",
3
  function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),f=a(this).data("labels");a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);
4
  a(this).siblings(".feedback").find("strong").text(c.value+f)}})});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&(a(".plugin-option .upload_img_url").change(function(){var b=a(this).val(),c=a(this).parents().siblings(".upload_img_preview");/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?c.html('<img src="'+b+'" style="max-width:600px; max-height:300px;" />'):c.html("")}).trigger("change"),a(document).on("click",".plugin-option .upload_button",function(b){b.preventDefault();
5
  var c,d=a(this).attr("id").replace(/-button$/,"");c||(b=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})],c=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:b}),c.on("select",function(){var b=c.state().get("selection").first().toJSON();a("#"+d).val(b.url);a("#"+d+"-yith-attachment-id")&&a("#"+d+"-yith-attachment-id").val(b.id);a(".plugin-option .upload_img_url").trigger("change")}));
1
  (function(a){var l=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+
2
+ "</span>")};a(".plugin-option .select_wrapper select").not(".chosen").each(l).change(l);a(".plugin-option .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()});a(".plugin-option .chosen .select_wrapper select").chosen();a(".plugin-option .onoff_container span").on("click",
3
  function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),f=a(this).data("labels");a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);
4
  a(this).siblings(".feedback").find("strong").text(c.value+f)}})});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&(a(".plugin-option .upload_img_url").change(function(){var b=a(this).val(),c=a(this).parents().siblings(".upload_img_preview");/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?c.html('<img src="'+b+'" style="max-width:600px; max-height:300px;" />'):c.html("")}).trigger("change"),a(document).on("click",".plugin-option .upload_button",function(b){b.preventDefault();
5
  var c,d=a(this).attr("id").replace(/-button$/,"");c||(b=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})],c=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:b}),c.on("select",function(){var b=c.state().get("selection").first().toJSON();a("#"+d).val(b.url);a("#"+d+"-yith-attachment-id")&&a("#"+d+"-yith-attachment-id").val(b.id);a(".plugin-option .upload_img_url").trigger("change")}));
plugin-fw/assets/js/yit-wp-pointer.js CHANGED
@@ -1,84 +1,84 @@
1
- jQuery(document).ready( function($) {
2
-
3
- var pointers = custom_pointer.pointers[0],
4
- options = pointers.options,
5
- target = $(pointers.target),
6
- pointer_id = pointers.pointer_id;
7
-
8
- $(target).find('.wp-submenu li a').each(function () {
9
-
10
- var t = $(this),
11
- href = t.attr('href');
12
-
13
- href = href.replace('admin.php?page=', '');
14
-
15
- if( href == pointer_id ){
16
-
17
- var selected_plugin_row = t.add( target ),
18
- top_level_menu = target.find( pointers.target.replace( '#', '.' ) );
19
-
20
- target.toggleClass('wp-no-current-submenu wp-menu-open wp-has-current-submenu');
21
-
22
- t.pointer({
23
- pointerClass: 'yit-wp-pointer',
24
- content : options.content,
25
- position: options.position,
26
- open : function () {
27
- selected_plugin_row.toggleClass( 'yit-pointer-selected-row' );
28
- top_level_menu.addClass( 'yit-pointer' );
29
- },
30
-
31
-
32
- close : function () {
33
- target.toggleClass('wp-no-current-submenu wp-menu-open wp-has-current-submenu');
34
- selected_plugin_row.toggleClass( 'yit-pointer-selected-row' );
35
- top_level_menu.removeClass( 'yit-pointer' );
36
-
37
- $.ajax({
38
- type : 'POST',
39
- url : ajaxurl,
40
- data : {
41
- "action" : "dismiss-wp-pointer",
42
- "pointer": pointer_id
43
- },
44
- success: function (response) {
45
- }
46
- });
47
-
48
- }
49
- }).pointer('open');
50
- } else if( 'yith_default_pointer' == pointer_id ) {
51
-
52
- var selected_plugin_row = t.add( target ),
53
- top_level_menu = target.find( pointers.target.replace( '#', '.' )),
54
- yit_plugins = $( pointers.target );
55
-
56
- yit_plugins.addClass('wp-has-current-submenu');
57
-
58
- top_level_menu.pointer({
59
- pointerClass: 'yit-wp-pointer',
60
- content : options.content,
61
- position: options.position,
62
-
63
- open : function () {
64
- yit_plugins.addClass( 'yit-pointer-selected-row' );
65
- },
66
-
67
- close : function () {
68
- yit_plugins.removeClass( 'yit-pointer-selected-row wp-has-current-submenu' );
69
-
70
- $.ajax({
71
- type : 'POST',
72
- url : ajaxurl,
73
- data : {
74
- "action" : "dismiss-wp-pointer",
75
- "pointer": pointer_id
76
- },
77
- success: function (response) {
78
- }
79
- });
80
- }
81
- }).pointer('open');
82
- }
83
- });
84
  });
1
+ jQuery(document).ready( function($) {
2
+
3
+ var pointers = custom_pointer.pointers[0],
4
+ options = pointers.options,
5
+ target = $(pointers.target),
6
+ pointer_id = pointers.pointer_id;
7
+
8
+ $(target).find('.wp-submenu li a').each(function () {
9
+
10
+ var t = $(this),
11
+ href = t.attr('href');
12
+
13
+ href = href.replace('admin.php?page=', '');
14
+
15
+ if( href == pointer_id ){
16
+
17
+ var selected_plugin_row = t.add( target ),
18
+ top_level_menu = target.find( pointers.target.replace( '#', '.' ) );
19
+
20
+ target.toggleClass('wp-no-current-submenu wp-menu-open wp-has-current-submenu');
21
+
22
+ t.pointer({
23
+ pointerClass: 'yit-wp-pointer',
24
+ content : options.content,
25
+ position: options.position,
26
+ open : function () {
27
+ selected_plugin_row.toggleClass( 'yit-pointer-selected-row' );
28
+ top_level_menu.addClass( 'yit-pointer' );
29
+ },
30
+
31
+
32
+ close : function () {
33
+ target.toggleClass('wp-no-current-submenu wp-menu-open wp-has-current-submenu');
34
+ selected_plugin_row.toggleClass( 'yit-pointer-selected-row' );
35
+ top_level_menu.removeClass( 'yit-pointer' );
36
+
37
+ $.ajax({
38
+ type : 'POST',
39
+ url : ajaxurl,
40
+ data : {
41
+ "action" : "dismiss-wp-pointer",
42
+ "pointer": pointer_id
43
+ },
44
+ success: function (response) {
45
+ }
46
+ });
47
+
48
+ }
49
+ }).pointer('open');
50
+ } else if( 'yith_default_pointer' == pointer_id ) {
51
+
52
+ var selected_plugin_row = t.add( target ),
53
+ top_level_menu = target.find( pointers.target.replace( '#', '.' )),
54
+ yit_plugins = $( pointers.target );
55
+
56
+ yit_plugins.addClass('wp-has-current-submenu');
57
+
58
+ top_level_menu.pointer({
59
+ pointerClass: 'yit-wp-pointer',
60
+ content : options.content,
61
+ position: options.position,
62
+
63
+ open : function () {
64
+ yit_plugins.addClass( 'yit-pointer-selected-row' );
65
+ },
66
+
67
+ close : function () {
68
+ yit_plugins.removeClass( 'yit-pointer-selected-row wp-has-current-submenu' );
69
+
70
+ $.ajax({
71
+ type : 'POST',
72
+ url : ajaxurl,
73
+ data : {
74
+ "action" : "dismiss-wp-pointer",
75
+ "pointer": pointer_id
76
+ },
77
+ success: function (response) {
78
+ }
79
+ });
80
+ }
81
+ }).pointer('open');
82
+ }
83
+ });
84
  });
plugin-fw/assets/js/yit-wp-pointer.min.js CHANGED
@@ -1,3 +1,3 @@
1
- jQuery(document).ready(function(b){var c=custom_pointer.pointers[0],d=c.options,a=b(c.target),e=c.pointer_id;b(a).find(".wp-submenu li a").each(function(){var f=b(this),h=f.attr("href"),h=h.replace("admin.php?page=","");if(h==e){var k=f.add(a),g=a.find(c.target.replace("#","."));a.toggleClass("wp-no-current-submenu wp-menu-open wp-has-current-submenu");f.pointer({pointerClass:"yit-wp-pointer",content:d.content,position:d.position,open:function(){k.toggleClass("yit-pointer-selected-row");g.addClass("yit-pointer")},
2
- close:function(){a.toggleClass("wp-no-current-submenu wp-menu-open wp-has-current-submenu");k.toggleClass("yit-pointer-selected-row");g.removeClass("yit-pointer");b.ajax({type:"POST",url:ajaxurl,data:{action:"dismiss-wp-pointer",pointer:e},success:function(a){}})}}).pointer("open")}else if("yith_default_pointer"==e){var k=f.add(a),g=a.find(c.target.replace("#",".")),l=b(c.target);l.addClass("wp-has-current-submenu");g.pointer({pointerClass:"yit-wp-pointer",content:d.content,position:d.position,open:function(){l.addClass("yit-pointer-selected-row")},
3
- close:function(){l.removeClass("yit-pointer-selected-row wp-has-current-submenu");b.ajax({type:"POST",url:ajaxurl,data:{action:"dismiss-wp-pointer",pointer:e},success:function(a){}})}}).pointer("open")}})});
1
+ jQuery(document).ready(function(b){var c=custom_pointer.pointers[0],d=c.options,a=b(c.target),e=c.pointer_id;b(a).find(".wp-submenu li a").each(function(){var f=b(this),h=f.attr("href"),h=h.replace("admin.php?page=","");if(h==e){var k=f.add(a),g=a.find(c.target.replace("#","."));a.toggleClass("wp-no-current-submenu wp-menu-open wp-has-current-submenu");f.pointer({pointerClass:"yit-wp-pointer",content:d.content,position:d.position,open:function(){console.log("here");k.toggleClass("yit-pointer-selected-row");
2
+ g.addClass("yit-pointer")},close:function(){a.toggleClass("wp-no-current-submenu wp-menu-open wp-has-current-submenu");k.toggleClass("yit-pointer-selected-row");g.removeClass("yit-pointer");b.ajax({type:"POST",url:ajaxurl,data:{action:"dismiss-wp-pointer",pointer:e},success:function(a){}})}}).pointer("open")}else if("yith_default_pointer"==e){var k=f.add(a),g=a.find(c.target.replace("#",".")),l=b(c.target);l.addClass("wp-has-current-submenu");g.pointer({pointerClass:"yit-wp-pointer",content:d.content,
3
+ position:d.position,open:function(){l.addClass("yit-pointer-selected-row")},close:function(){l.removeClass("yit-pointer-selected-row wp-has-current-submenu");b.ajax({type:"POST",url:ajaxurl,data:{action:"dismiss-wp-pointer",pointer:e},success:function(a){}})}}).pointer("open")}})});
plugin-fw/init.php CHANGED
@@ -1,57 +1,57 @@
1
- <?php
2
- /**
3
- * Framework Name: YIT Plugin Framework
4
- * Version: 2.9.5
5
- * Author: Yithemes
6
- * Text Domain: yith-plugin-fw
7
- * Domain Path: /languages/
8
- *
9
- * @author Your Inspiration Themes
10
- * @package YITH WooCommerce Ajax Navigation
11
- * @version 2.0
12
- */
13
- /**
14
- * This file belongs to the YIT Plugin Framework.
15
- *
16
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
17
- * that is bundled with this package in the file LICENSE.txt.
18
- * It is also available through the world-wide-web at this URL:
19
- * http://www.gnu.org/licenses/gpl-3.0.txt
20
- */
21
-
22
-
23
- if ( ! defined ( 'ABSPATH' ) ) {
24
- exit;
25
- } // Exit if accessed directly
26
-
27
- if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) ) {
28
- /**
29
- * YITH WooCommerce Ajax Navigation
30
- *
31
- * @since 1.0.0
32
- */
33
- function yit_maybe_plugin_fw_loader ( $plugin_path ) {
34
- global $plugin_fw_data;
35
-
36
- $default_headers = array (
37
- 'Name' => 'Framework Name',
38
- 'Version' => 'Version',
39
- 'Author' => 'Author',
40
- 'TextDomain' => 'Text Domain',
41
- 'DomainPath' => 'Domain Path',
42
- );
43
-
44
- $framework_data = get_file_data ( trailingslashit ( $plugin_path ) . 'plugin-fw/init.php', $default_headers );
45
- $plugin_fw_main_file = trailingslashit ( $plugin_path ) . 'plugin-fw/yit-plugin.php';
46
-
47
- if ( ! empty( $plugin_fw_data ) ) {
48
- foreach ( $plugin_fw_data as $version => $path ) {
49
- if ( version_compare ( $version, $framework_data[ 'Version' ], '<' ) ) {
50
- $plugin_fw_data = array ( $framework_data[ 'Version' ] => $plugin_fw_main_file );
51
- }
52
- }
53
- } else {
54
- $plugin_fw_data = array ( $framework_data[ 'Version' ] => $plugin_fw_main_file );
55
- }
56
- }
57
- }
1
+ <?php
2
+ /**
3
+ * Framework Name: YIT Plugin Framework
4
+ * Version: 2.9.32
5
+ * Author: Yithemes
6
+ * Text Domain: yith-plugin-fw
7
+ * Domain Path: /languages/
8
+ *
9
+ * @author Your Inspiration Themes
10
+ * @package YITH WooCommerce Ajax Navigation
11
+ * @version 2.0
12
+ */
13
+ /**
14
+ * This file belongs to the YIT Plugin Framework.
15
+ *
16
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
17
+ * that is bundled with this package in the file LICENSE.txt.
18
+ * It is also available through the world-wide-web at this URL:
19
+ * http://www.gnu.org/licenses/gpl-3.0.txt
20
+ */
21
+
22
+
23
+ if ( ! defined ( 'ABSPATH' ) ) {
24
+ exit;
25
+ } // Exit if accessed directly
26
+
27
+ if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) ) {
28
+ /**
29
+ * YITH WooCommerce Ajax Navigation
30
+ *
31
+ * @since 1.0.0
32
+ */
33
+ function yit_maybe_plugin_fw_loader ( $plugin_path ) {
34
+ global $plugin_fw_data;
35
+
36
+ $default_headers = array (
37
+ 'Name' => 'Framework Name',
38
+ 'Version' => 'Version',
39
+ 'Author' => 'Author',
40
+ 'TextDomain' => 'Text Domain',
41
+ 'DomainPath' => 'Domain Path',
42
+ );
43
+
44
+ $framework_data = get_file_data ( trailingslashit ( $plugin_path ) . 'plugin-fw/init.php', $default_headers );
45
+ $plugin_fw_main_file = trailingslashit ( $plugin_path ) . 'plugin-fw/yit-plugin.php';
46
+
47
+ if ( ! empty( $plugin_fw_data ) ) {
48
+ foreach ( $plugin_fw_data as $version => $path ) {
49
+ if ( version_compare ( $version, $framework_data[ 'Version' ], '<' ) ) {
50
+ $plugin_fw_data = array ( $framework_data[ 'Version' ] => $plugin_fw_main_file );
51
+ }
52
+ }
53
+ } else {
54
+ $plugin_fw_data = array ( $framework_data[ 'Version' ] => $plugin_fw_main_file );
55
+ }
56
+ }
57
+ }
plugin-fw/languages/yith-plugin-fw-es_ES.mo ADDED
Binary file
plugin-fw/languages/yith-plugin-fw-es_ES.po ADDED
@@ -0,0 +1,1170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2015 YIThemes
2
+ # This file is distributed under the same license as the YITH Plugin Starter package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
6
+ "Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
7
+ "POT-Creation-Date: 2016-05-16 16:37+0200\n"
8
+ "PO-Revision-Date: 2016-05-24 15:45+0100\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: Your Inspiration Themes <info@yithemes.com>\n"
11
+ "Language: es_ES\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.8.7\n"
16
+ "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
17
+ "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
18
+ "esc_html_x:1,2c\n"
19
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
+ "X-Poedit-SourceCharset: UTF-8\n"
21
+ "X-Poedit-Basepath: ..\n"
22
+ "X-Textdomain-Support: yes\n"
23
+ "X-Poedit-SearchPath-0: .\n"
24
+
25
+ #: lib/yit-cpt-unlimited.php:460 lib/yit-cpt-unlimited.php:574
26
+ #: lib/yit-cpt-unlimited.php:719 lib/yit-cpt-unlimited.php:1632
27
+ #, php-format
28
+ msgid "Add %s"
29
+ msgstr "Añadir %s"
30
+
31
+ #: lib/yit-cpt-unlimited.php:461 lib/yit-cpt-unlimited.php:575
32
+ #, php-format
33
+ msgid "Add New %s"
34
+ msgstr "Añadir nuevo/a %s"
35
+
36
+ #: lib/yit-cpt-unlimited.php:462 lib/yit-cpt-unlimited.php:576
37
+ #: lib/yit-cpt-unlimited.php:1267 lib/yit-cpt-unlimited.php:1304
38
+ #, php-format
39
+ msgid "Edit %s"
40
+ msgstr "Editar %s"
41
+
42
+ #: lib/yit-cpt-unlimited.php:463 lib/yit-cpt-unlimited.php:577
43
+ #, php-format
44
+ msgid "New %s"
45
+ msgstr "Nuevo/a %s"
46
+
47
+ #: lib/yit-cpt-unlimited.php:464 lib/yit-cpt-unlimited.php:578
48
+ #, php-format
49
+ msgid "All %s"
50
+ msgstr "Todo %s"
51
+
52
+ #: lib/yit-cpt-unlimited.php:465 lib/yit-cpt-unlimited.php:579
53
+ #: lib/yit-cpt-unlimited.php:1251 lib/yit-cpt-unlimited.php:1305
54
+ #, php-format
55
+ msgid "View %s"
56
+ msgstr "Ver %s"
57
+
58
+ #: lib/yit-cpt-unlimited.php:466 lib/yit-cpt-unlimited.php:580
59
+ #, php-format
60
+ msgid "Search %s"
61
+ msgstr "Buscar %s"
62
+
63
+ #: lib/yit-cpt-unlimited.php:467 lib/yit-cpt-unlimited.php:581
64
+ #, php-format
65
+ msgid "No %s found"
66
+ msgstr "No se encontraron %s"
67
+
68
+ #: lib/yit-cpt-unlimited.php:468 lib/yit-cpt-unlimited.php:582
69
+ #, php-format
70
+ msgid "No %s found in Trash"
71
+ msgstr "No se encontraron %s en la Papelera"
72
+
73
+ #: lib/yit-cpt-unlimited.php:625
74
+ #, php-format
75
+ msgctxt "taxonomy general name"
76
+ msgid "%s Categories"
77
+ msgstr "%s Categorías"
78
+
79
+ #: lib/yit-cpt-unlimited.php:626
80
+ msgctxt "taxonomy singular name"
81
+ msgid "Category"
82
+ msgstr "Categoría"
83
+
84
+ #: lib/yit-cpt-unlimited.php:627
85
+ msgid "Search Categories"
86
+ msgstr "Buscar Categorías"
87
+
88
+ #: lib/yit-cpt-unlimited.php:628
89
+ msgid "All Categories"
90
+ msgstr "Todas las categorías"
91
+
92
+ #: lib/yit-cpt-unlimited.php:629
93
+ msgid "Parent Category"
94
+ msgstr "Categoría Madre"
95
+
96
+ #: lib/yit-cpt-unlimited.php:630
97
+ msgid "Parent Category:"
98
+ msgstr "Categoría Madre:"
99
+
100
+ #: lib/yit-cpt-unlimited.php:631
101
+ msgid "Edit Category"
102
+ msgstr "Editar Categoría:"
103
+
104
+ #: lib/yit-cpt-unlimited.php:632
105
+ msgid "Update Category"
106
+ msgstr "Actualizar Categoría:"
107
+
108
+ #: lib/yit-cpt-unlimited.php:633
109
+ msgid "Add New Category"
110
+ msgstr "Añadir nueva categoría"
111
+
112
+ #: lib/yit-cpt-unlimited.php:634
113
+ msgid "New Category Name"
114
+ msgstr "Nuevo nombre de categoría"
115
+
116
+ #: lib/yit-cpt-unlimited.php:635
117
+ msgid "Category"
118
+ msgstr "Categoría"
119
+
120
+ #: lib/yit-cpt-unlimited.php:724
121
+ msgid "Categories"
122
+ msgstr "Categorías"
123
+
124
+ #: lib/yit-cpt-unlimited.php:1042
125
+ #, php-format
126
+ msgid "%s Settings"
127
+ msgstr "%s Ajustes"
128
+
129
+ #: lib/yit-cpt-unlimited.php:1048 lib/yit-cpt-unlimited.php:1196
130
+ #: lib/yit-cpt-unlimited.php:1202 lib/yit-plugin-panel.php:74
131
+ msgid "Settings"
132
+ msgstr "Ajustes"
133
+
134
+ #: lib/yit-cpt-unlimited.php:1051
135
+ msgid "Type"
136
+ msgstr "Tipos"
137
+
138
+ #: lib/yit-cpt-unlimited.php:1052
139
+ #, php-format
140
+ msgid "Layout for this %s"
141
+ msgstr "Diseño para este %s"
142
+
143
+ #: lib/yit-cpt-unlimited.php:1058
144
+ msgid "Rewrite"
145
+ msgstr "Reescribir"
146
+
147
+ #: lib/yit-cpt-unlimited.php:1059
148
+ msgid ""
149
+ "Univocal identification name in the URL for each product (slug from post if empty)"
150
+ msgstr ""
151
+ "Nombre de identificación único en la URL para cada producto (slug desde la entrada "
152
+ "si está vacío)"
153
+
154
+ #: lib/yit-cpt-unlimited.php:1064
155
+ msgid "Label in Singular"
156
+ msgstr "Etiqueta en singular"
157
+
158
+ #: lib/yit-cpt-unlimited.php:1065
159
+ msgid "Set a label in singular (title of portfolio if empty)"
160
+ msgstr "Establecer una etiqueta en singular (título del portafolio si está vacío)"
161
+
162
+ #: lib/yit-cpt-unlimited.php:1070
163
+ msgid "Label in Plural"
164
+ msgstr "Etiqueta en Plural"
165
+
166
+ #: lib/yit-cpt-unlimited.php:1071
167
+ msgid "Set a label in plural (title of portfolio if empty)"
168
+ msgstr "Establecer una etiqueta en plural (título del portafolio si está vacío)"
169
+
170
+ #: lib/yit-cpt-unlimited.php:1076
171
+ msgid "Taxonomy"
172
+ msgstr "Taxonomía"
173
+
174
+ #: lib/yit-cpt-unlimited.php:1077
175
+ msgid ""
176
+ "If you want to use categories in the portfolio, set a name for taxonomy. Name "
177
+ "should be a slug (must not contain capital letters nor spaces) and must not be "
178
+ "more than 32 characters long (database structure restriction)."
179
+ msgstr ""
180
+ "Si quieres usar categorías en el portafolio, establece un nombre para la "
181
+ "taxonomía. El nombre debería ser un slug (no debe contener mayúsculas ni espacios) "
182
+ "y no debe ser más largo de 32 caracteres (restricción de estructura de base de "
183
+ "datos)."
184
+
185
+ #: lib/yit-cpt-unlimited.php:1082
186
+ msgid "Taxonomy Rewrite"
187
+ msgstr "Taxonomía de reescritura"
188
+
189
+ #: lib/yit-cpt-unlimited.php:1083
190
+ msgid "Set univocal name for each category page URL."
191
+ msgstr "Establecer nombre único para cada página URL de categoría."
192
+
193
+ #: lib/yit-cpt-unlimited.php:1088
194
+ msgid "Single layout"
195
+ msgstr "Diseño Simple"
196
+
197
+ #: lib/yit-cpt-unlimited.php:1089
198
+ msgid "Layout for single page of this portfolio"
199
+ msgstr "Diseño para cada página de este portafolio"
200
+
201
+ #: lib/yit-cpt-unlimited.php:1130
202
+ msgid "layout settings"
203
+ msgstr "Ajustes de diseño"
204
+
205
+ #: lib/yit-cpt-unlimited.php:1222 lib/yit-cpt-unlimited.php:1235
206
+ msgid "Quick links"
207
+ msgstr "Enlaces rápidos"
208
+
209
+ #: lib/yit-cpt-unlimited.php:1475
210
+ #, php-format
211
+ msgid "Show frontend of the %s"
212
+ msgstr "Mostrar parte delantera de %s"
213
+
214
+ #: lib/yit-cpt-unlimited.php:1482 templates/metaboxes/types/customtabs.php:46
215
+ #: templates/metaboxes/types/customtabs.php:90
216
+ msgid "Name"
217
+ msgstr "Nombre"
218
+
219
+ #: lib/yit-cpt-unlimited.php:1631
220
+ #, php-format
221
+ msgid "Add %s from images"
222
+ msgstr "Añadir %s desde imágenes"
223
+
224
+ #: lib/yit-cpt-unlimited.php:1633
225
+ msgid "Upload multiple files"
226
+ msgstr "Cargar archivos múltiples"
227
+
228
+ #: lib/yit-plugin-panel-sidebar.php:421 templates/panel/sidebar/sidebar.php:3
229
+ msgid "Hide sidebar"
230
+ msgstr "Ocultar barra lateral"
231
+
232
+ #: lib/yit-plugin-panel-sidebar.php:422 templates/panel/sidebar/sidebar.php:3
233
+ msgid "Show sidebar"
234
+ msgstr "Mostrar barra lateral"
235
+
236
+ #: lib/yit-plugin-panel-wc.php:359
237
+ msgid "The changes you have made will be lost if you leave this page."
238
+ msgstr "Los cambios que has hecho se perderán si sales de esta página."
239
+
240
+ #: lib/yit-plugin-panel.php:73
241
+ msgid "Plugin Settings"
242
+ msgstr "Ajustes del plugin"
243
+
244
+ #: lib/yit-plugin-panel.php:293
245
+ msgid "Premium version upgrade"
246
+ msgstr "Actualiza a la versión premium"
247
+
248
+ #: lib/yit-plugin-panel.php:344 lib/yit-plugin-subpanel.php:146
249
+ #: templates/panel/woocommerce/woocommerce-form.php:11
250
+ msgid "Save Changes"
251
+ msgstr "Guardar cambios"
252
+
253
+ #: lib/yit-plugin-panel.php:347 templates/panel/woocommerce/woocommerce-form.php:14
254
+ msgid "If you continue with this action, you will reset all options in this page."
255
+ msgstr "Si sigues con esta acción, se reiniciarán todas las opciones en esta página."
256
+
257
+ #: lib/yit-plugin-panel.php:349 lib/yit-plugin-subpanel.php:151
258
+ msgid "Reset to default"
259
+ msgstr "Reiniciar a predeterminado"
260
+
261
+ #: lib/yit-plugin-panel.php:349 lib/yit-plugin-subpanel.php:151
262
+ #: templates/panel/woocommerce/woocommerce-form.php:18
263
+ msgid "Are you sure?"
264
+ msgstr "¿Estás seguro/a?"
265
+
266
+ #: lib/yit-plugin-panel.php:545
267
+ msgid "The element you have entered already exists. Please, enter another name."
268
+ msgstr "El elemento que has introducido ya existe. Por favor, introduce otro nombre."
269
+
270
+ #: lib/yit-plugin-panel.php:546
271
+ msgid "Settings saved"
272
+ msgstr "Ajustes guardados"
273
+
274
+ #: lib/yit-plugin-panel.php:547
275
+ msgid "Settings reset"
276
+ msgstr "Ajustes reiniciados"
277
+
278
+ #: lib/yit-plugin-panel.php:548
279
+ msgid "Element deleted correctly."
280
+ msgstr "Elemento borrado correctamente."
281
+
282
+ #: lib/yit-plugin-panel.php:549 lib/yit-plugin-panel.php:550
283
+ msgid "Element updated correctly."
284
+ msgstr "Elemento actualizado correctamente."
285
+
286
+ #: lib/yit-plugin-panel.php:551
287
+ msgid "Database imported correctly."
288
+ msgstr "Base de datos importada correctamente."
289
+
290
+ #: lib/yit-plugin-panel.php:552
291
+ msgid "An error has occurred during import. Please try again."
292
+ msgstr "Ha ocurrido un error durante la importación. Por favor, inténtalo de nuevo."
293
+
294
+ #: lib/yit-plugin-panel.php:553
295
+ msgid "The added file is not valid."
296
+ msgstr "El archivo añadido no es válido."
297
+
298
+ #: lib/yit-plugin-panel.php:554
299
+ msgid "Sorry, import is disabled."
300
+ msgstr "Lo sentimos, la importación está deshabilitada."
301
+
302
+ #: lib/yit-plugin-panel.php:555
303
+ msgid "Sorting successful."
304
+ msgstr "Clasificación fue realizada con éxito."
305
+
306
+ #: lib/yit-plugin-subpanel.php:149
307
+ msgid ""
308
+ "If you continue with this action, you will reset all the options in this page."
309
+ msgstr "Si continúas con esta acción, reiniciarás todas las opciones de esta página."
310
+
311
+ #: lib/yit-pointers.php:70
312
+ msgid "Plugins Activated"
313
+ msgstr "Plugins Activados"
314
+
315
+ #: lib/yit-pointers.php:71
316
+ msgid ""
317
+ "From now on, you can find all plugin options in YIT Plugin menu.\n"
318
+ " For each plugin installed, customization "
319
+ "settings will be available as a new entry in YIT Plugin menu."
320
+ msgstr ""
321
+ "De ahora en adelante, puedes encontrar todas las opciones del plugin en el menú "
322
+ "YIT Plugin.\n"
323
+ " Para cada plugin instalado, los ajustes de "
324
+ "personalización estarán disponibles como una nueva entrada en el menú YIT Plugin."
325
+
326
+ #: lib/yit-pointers.php:73 lib/yit-pointers.php:89
327
+ msgid "Discover all our plugins available on:"
328
+ msgstr "Descubre todos nuestros plugins disponibles en:"
329
+
330
+ #: lib/yit-pointers.php:74 lib/yit-pointers.php:90
331
+ msgid "and"
332
+ msgstr "y"
333
+
334
+ #: lib/yit-pointers.php:84
335
+ msgid "Plugins Upgraded"
336
+ msgstr "Plugins Actualizados"
337
+
338
+ #: lib/yit-pointers.php:85
339
+ msgid ""
340
+ "From now on, you can find all options of your plugins in YIT Plugin menu.\n"
341
+ " Any time one of our plugins is updated, a new "
342
+ "entry will be added to this menu.\n"
343
+ " For example, after the update, plugin options "
344
+ "(such as for YITH WooCommerce Wishlist, YITH WooCommerce Ajax Search, etc.)\n"
345
+ " will be moved from previous location to YIT "
346
+ "Plugin tab."
347
+ msgstr ""
348
+ "De ahora en adelante, puedes encontrar todas las opciones de tus plugins en el "
349
+ "menú YIT Plugin.\n"
350
+ " Cada vez que uno de nuestros plugins sea "
351
+ "actualizado, se añadirá una nueva entrada a este menú.\n"
352
+ " Por ejemplo, después de actualizar, las "
353
+ "opciones del plugin (como las de YITH WooCommerce Wishlist, YITH WooCommerce Ajax "
354
+ "Search, etc.)\n"
355
+ " se moverán de su posición anterior a la "
356
+ "pestaña YIT Plugin."
357
+
358
+ #: lib/yit-upgrade.php:136
359
+ msgid "There is a new version of %plugin_name% available."
360
+ msgstr "Hay una nueva versión de %plugin_name% disponible."
361
+
362
+ #: lib/yit-upgrade.php:137
363
+ msgid "View version %latest% details."
364
+ msgstr "Ver detalles de la %latest% versión"
365
+
366
+ #: lib/yit-upgrade.php:138
367
+ msgid "Automatic update is unavailable for this plugin,"
368
+ msgstr "Las actualizaciones automáticas no están disponibles para este plugin,"
369
+
370
+ #: lib/yit-upgrade.php:139
371
+ msgid "please <a href=\"%activate_link%\">activate</a> your copy of %plugin_name%."
372
+ msgstr "por favor, <a href=\"%activate_link%\">activa</a> tu copia de %plugin_name%."
373
+
374
+ #: lib/yit-upgrade.php:140
375
+ msgid "Update now."
376
+ msgstr "Actualiza ahora."
377
+
378
+ #: lib/yit-upgrade.php:243
379
+ msgid "YIThemes Repository"
380
+ msgstr "Repositorio YIThemes"
381
+
382
+ #: lib/yit-upgrade.php:277
383
+ msgid "Invalid URL Provided."
384
+ msgstr "La URL proporcionada no es válida."
385
+
386
+ #: lib/yit-upgrade.php:290
387
+ msgid "Could not create Temporary file."
388
+ msgstr "No se pudo crear un archivo temporal."
389
+
390
+ #: lib/yit-upgrade.php:432
391
+ #, php-format
392
+ msgid ""
393
+ "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
394
+ "changelog-button\" title=\"%3$s\">View version %4$s details</a>."
395
+ msgstr ""
396
+ "Hay una nueva versión de %1$s disponible. <a href=\"%2$s\" class=\"thickbox yit-"
397
+ "changelog-button\" title=\"%3$s\">Ver detalles de la versión %4$s</a>."
398
+
399
+ #: lib/yit-upgrade.php:434
400
+ #, php-format
401
+ msgid ""
402
+ "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
403
+ "changelog-button\" title=\"%3$s\">View version %4$s details</a>. <em>You have to "
404
+ "activate the plugin on a single site of the network to benefit from automatic "
405
+ "updates.</em>"
406
+ msgstr ""
407
+ "Hay una nueva versión de %1$s disponible. <a href=\"%2$s\" class=\"thickbox yit-"
408
+ "changelog-button\" title=\"%3$s\">Ver detalles de la versión %4$s</a>. <em>Tienes "
409
+ "que activar el plugin en un único sitio web desdela red para beneficiarte de las "
410
+ "actualizaciones automáticas.</em>"
411
+
412
+ #: lib/yit-upgrade.php:436
413
+ #, php-format
414
+ msgid ""
415
+ "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
416
+ "changelog-button\" title=\"%3$s\">View version %4$s details</a>. <em>Automatic "
417
+ "update is unavailable for this plugin, please <a href=\"%5$s\" title=\"License "
418
+ "activation\">activate</a> your copy of %6s.</em>"
419
+ msgstr ""
420
+ "Hay una nueva versión de %1$s disponible. <a href=\"%2$s\" class=\"thickbox yit-"
421
+ "changelog-button\" title=\"%3$s\">Ver detalles de la versión %4$s</a>. <em>Las "
422
+ "actualizaciones automáticas no están disponibles para este plugin, por favor <a "
423
+ "href=\"%5$s\" title=\"License activation\">activa</a> tu copia de %6s.</em>"
424
+
425
+ #: lib/yit-upgrade.php:438
426
+ #, php-format
427
+ msgid ""
428
+ "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
429
+ "changelog-button\" title=\"%3$s\">View version %4$s details</a> or <a href=\"%5$s"
430
+ "\">update now</a>."
431
+ msgstr ""
432
+ "Hay una nueva versión de %1$s disponible. <a href=\"%2$s\" class=\"thickbox yit-"
433
+ "changelog-button\" title=\"%3$s\">Ver detalles de la versión %4$s</a> o <a href="
434
+ "\"%5$s\">actualizar ahora</a>."
435
+
436
+ #: lib/yit-upgrade.php:511
437
+ msgid "You can't update the plugins for this site."
438
+ msgstr "No puedes actualizar los plugins para este sitio web."
439
+
440
+ #: lib/yit-upgrade.php:515
441
+ msgid "You do not have sufficient permissions to update the plugins for this site."
442
+ msgstr ""
443
+ "No tienes suficientes permisos para actualizar los plugins para este sitio web."
444
+
445
+ #: lib/yit-upgrade.php:522
446
+ msgid "Update Plugin"
447
+ msgstr "Actualizar Plugin"
448
+
449
+ #: licence/lib/yit-licence.php:182
450
+ #, php-format
451
+ msgctxt "%s = field name"
452
+ msgid "%s field cannot be empty"
453
+ msgstr "%s el campo no puede estar vacío"
454
+
455
+ #: licence/lib/yit-licence.php:183
456
+ #, php-format
457
+ msgid "%s and %s fields cannot be empty"
458
+ msgstr "Los campos %s y %s no pueden estar vacíos"
459
+
460
+ #: licence/lib/yit-licence.php:184
461
+ msgid "Unable to contact the remote server, please try again later. Thanks!"
462
+ msgstr ""
463
+ "No fue posible contactar con el servidor remoto, por favor, inténtalo de nuevo más "
464
+ "tarde. ¡Gracias!"
465
+
466
+ #: licence/lib/yit-licence.php:185
467
+ #: licence/templates/panel/activation/activation-panel.php:88
468
+ #: licence/templates/panel/activation/activation-panel.php:166
469
+ #: licence/templates/panel/activation/activation-panel.php:197
470
+ #: templates/metaboxes/types/contactform.php:148
471
+ #: templates/metaboxes/types/contactform.php:340
472
+ msgid "Email"
473
+ msgstr "Email"
474
+
475
+ #: licence/lib/yit-licence.php:186
476
+ #: licence/templates/panel/activation/activation-panel.php:89
477
+ #: licence/templates/panel/activation/activation-panel.php:167
478
+ #: licence/templates/panel/activation/activation-panel.php:198
479
+ msgid "License Key"
480
+ msgstr "Clave de Licencia"
481
+
482
+ #: licence/lib/yit-licence.php:187
483
+ msgid "Are you sure you want to deactivate the license for current site?"
484
+ msgstr ""
485
+ "¿Estás seguro/a de que quieres desactivar la licencia para el sitio web actual?"
486
+
487
+ #: licence/lib/yit-licence.php:667
488
+ msgid "Invalid Request"
489
+ msgstr "Solicitud inválida"
490
+
491
+ #: licence/lib/yit-licence.php:668
492
+ msgid "Invalid license key"
493
+ msgstr "Clave de solicitud inválida"
494
+
495
+ #: licence/lib/yit-licence.php:669
496
+ msgid "Software has been deactivated"
497
+ msgstr "El software ha sido desactivado"
498
+
499
+ #: licence/lib/yit-licence.php:670
500
+ msgid "Maximum number of activations exceeded"
501
+ msgstr "Se ha excedido el número máximo de solicitudes"
502
+
503
+ #: licence/lib/yit-licence.php:671
504
+ msgid "Invalid instance ID"
505
+ msgstr "Instancia ID inválida"
506
+
507
+ #: licence/lib/yit-licence.php:672
508
+ msgid "Invalid security key"
509
+ msgstr "Clave de seguridad inválida"
510
+
511
+ #: licence/lib/yit-licence.php:673
512
+ msgid "License key has expired"
513
+ msgstr "La clave de licencia ha caducado"
514
+
515
+ #: licence/lib/yit-licence.php:674
516
+ msgid "License key has been banned"
517
+ msgstr "La clave de licencia ha sido bloqueada"
518
+
519
+ #: licence/lib/yit-licence.php:675
520
+ msgid "Current product is not included with your membership key"
521
+ msgstr "El producto actual no está incluido en tu clave de suscripción"
522
+
523
+ #: licence/lib/yit-licence.php:676
524
+ msgid "Great"
525
+ msgstr "Excelente"
526
+
527
+ #: licence/lib/yit-licence.php:676
528
+ msgid "License successfully activated"
529
+ msgstr "Licencia activada con éxito"
530
+
531
+ #: licence/lib/yit-licence.php:677
532
+ msgid "License key deactivated for website"
533
+ msgstr "Clave de licencia desactivada para nuestro sitio web"
534
+
535
+ #: licence/lib/yit-plugin-licence.php:67 licence/lib/yit-plugin-licence.php:68
536
+ #: licence/lib/yit-theme-licence.php:69 licence/lib/yit-theme-licence.php:70
537
+ #: licence/lib/yit-theme-licence.php:109 licence/lib/yit-theme-licence.php:110
538
+ msgid "License Activation"
539
+ msgstr "Activación de la Licencia"
540
+
541
+ #: licence/lib/yit-theme-licence.php:117 licence/lib/yit-theme-licence.php:118
542
+ #, php-format
543
+ msgid "%s"
544
+ msgstr "%s"
545
+
546
+ #: licence/lib/yit-theme-licence.php:159
547
+ msgid ""
548
+ "I cannot find the license key for activating the theme I have bought some time "
549
+ "ago. Where can I find it?"
550
+ msgstr ""
551
+ "No puedo encontrar la clave de licencia para activar el tema que compré hace "
552
+ "tiempo. ¿Dónde la puedo encontrar?"
553
+
554
+ #: licence/lib/yit-theme-licence.php:163
555
+ msgid ""
556
+ "If you have purchased one of our products before 27 January 2015, you can benefit "
557
+ "from support and updates (the services offered with the license)\n"
558
+ " until 27 January 2016 and you do not have to purchase it again "
559
+ "to get a new license key, because, before this date, your license used to be "
560
+ "activated automatically by our system.\n"
561
+ " After 27 January 2016, instead, if you want to benefit from "
562
+ "support and updates you have to buy a new license and activate it through the "
563
+ "license key you will be\n"
564
+ " provided with and that you can find in your YIThemes account, "
565
+ "in section \"My licenses\"."
566
+ msgstr ""
567
+ "Si has comprado uno de nuestros productos antes del 27 de enero de 2015, puedes "
568
+ "beneficiarte del soporte y actualizaciones (los servicios incluidos con la "
569
+ "licencia)\n"
570
+ " hasta el 27 de enero de 2016 y no tendrás que comprarla otra "
571
+ "vez para conseguir una nueva clave de licencia, porque, antes de esta fecha, tu "
572
+ "licencia se activaba automáticamente por nuestro sistema.\n"
573
+ " Después del 27 de enero de 2016, sin embargo, si quieres "
574
+ "beneficiarte de nuestro soporte y actualizaciones, tienes que comprar una nueva "
575
+ "licencia y activarla a través de la clave de licencia que \n"
576
+ " se te proporcionará y que podrás encontrar en tu cuenta "
577
+ "YIThemes, en la sección \"My licenses\"."
578
+
579
+ #: licence/templates/panel/activation/activation-panel.php:23
580
+ msgid "Yithemes License Activation"
581
+ msgstr "Licencia de Activación Yithemes"
582
+
583
+ #: licence/templates/panel/activation/activation-panel.php:27
584
+ msgid ""
585
+ "Have you updated your licenses? Have you asked for an extension? Update "
586
+ "information concerning your products."
587
+ msgstr "¿Has actualizado tus licencias? ¿Has pedido una extensión? Actualiza"
588
+
589
+ #: licence/templates/panel/activation/activation-panel.php:29
590
+ msgid "Update license information"
591
+ msgstr "Actualizar la información de la licencia"
592
+
593
+ #: licence/templates/panel/activation/activation-panel.php:42
594
+ msgid "Product to activate"
595
+ msgid_plural "Products to activate"
596
+ msgstr[0] "Producto que activar"
597
+ msgstr[1] "Productos que activar"
598
+
599
+ #: licence/templates/panel/activation/activation-panel.php:61
600
+ msgid "Activate"
601
+ msgstr "Activar"
602
+
603
+ #: licence/templates/panel/activation/activation-panel.php:80
604
+ msgid "Activated"
605
+ msgstr "Activado/a"
606
+
607
+ #: licence/templates/panel/activation/activation-panel.php:86
608
+ #: licence/templates/panel/activation/activation-panel.php:164
609
+ #: licence/templates/panel/activation/activation-panel.php:194
610
+ msgid "Product Name"
611
+ msgstr "Nombre de Producto"
612
+
613
+ #: licence/templates/panel/activation/activation-panel.php:92
614
+ #: licence/templates/panel/activation/activation-panel.php:201
615
+ msgid "Expires"
616
+ msgstr "Caduca"
617
+
618
+ #: licence/templates/panel/activation/activation-panel.php:95
619
+ msgid "Remaining"
620
+ msgstr "Queda"
621
+
622
+ #: licence/templates/panel/activation/activation-panel.php:97
623
+ msgid "Membership"
624
+ msgstr "Suscripción"
625
+
626
+ #: licence/templates/panel/activation/activation-panel.php:101
627
+ msgid "License Actions"
628
+ msgstr "Acciones de Licencia"
629
+
630
+ #: licence/templates/panel/activation/activation-panel.php:126
631
+ #, php-format
632
+ msgid "%1s out of %2s"
633
+ msgstr "%1s de %2s"
634
+
635
+ #: licence/templates/panel/activation/activation-panel.php:142
636
+ msgid "Deactivate"
637
+ msgstr "Desactivar"
638
+
639
+ #: licence/templates/panel/activation/activation-panel.php:147
640
+ #: licence/templates/panel/activation/activation-panel.php:204
641
+ msgid "Renew"
642
+ msgstr "Renovado"
643
+
644
+ #: licence/templates/panel/activation/activation-panel.php:160
645
+ msgid "Banned"
646
+ msgstr "Bloqueado"
647
+
648
+ #: licence/templates/panel/activation/activation-panel.php:190
649
+ msgid "Expired"
650
+ msgstr "Caducado"
651
+
652
+ #: licence/templates/panel/activation/activation-panel.php:226
653
+ msgid "Order again"
654
+ msgstr "Comprar de nuevo"
655
+
656
+ #: licence/templates/panel/activation/activation-panel.php:228
657
+ msgid "Renew license"
658
+ msgstr "Renovar licencia"
659
+
660
+ #: templates/metaboxes/types/ajax-products.php:23
661
+ msgid "Search for a product"
662
+ msgstr "Buscar un producto"
663
+
664
+ #: templates/metaboxes/types/categories.php:36
665
+ msgid "No categories."
666
+ msgstr "Ninguna categoría."
667
+
668
+ #: templates/metaboxes/types/categories.php:42
669
+ msgid "+ Add New Category"
670
+ msgstr "+ Añadir Nueva Categoría"
671
+
672
+ #: templates/metaboxes/types/categories.php:46
673
+ msgid "Add"
674
+ msgstr "Añadir"
675
+
676
+ #: templates/metaboxes/types/contactform.php:7
677
+ msgid "Text Input"
678
+ msgstr "Text Input"
679
+
680
+ #: templates/metaboxes/types/contactform.php:8
681
+ msgid "Checkbox"
682
+ msgstr "Casilla"
683
+
684
+ #: templates/metaboxes/types/contactform.php:9
685
+ msgid "Select"
686
+ msgstr "Seleciona"
687
+
688
+ #: templates/metaboxes/types/contactform.php:10
689
+ msgid "Textarea"
690
+ msgstr "Área de texto"
691
+
692
+ #: templates/metaboxes/types/contactform.php:11
693
+ msgid "Radio Input"
694
+ msgstr "Radio Input"
695
+
696
+ #: templates/metaboxes/types/contactform.php:12
697
+ msgid "Password Field"
698
+ msgstr "Campo de contraseña"
699
+
700
+ #: templates/metaboxes/types/contactform.php:13
701
+ msgid "File Upload"
702
+ msgstr "Carga de archivo"
703
+
704
+ #: templates/metaboxes/types/contactform.php:47
705
+ msgid "Theme Icon"
706
+ msgstr "Icono del tema"
707
+
708
+ #: templates/metaboxes/types/contactform.php:48
709
+ msgid "Custom Icon"
710
+ msgstr "Icono Personalizado"
711
+
712
+ #: templates/metaboxes/types/contactform.php:49
713
+ #: templates/metaboxes/types/responsivesliders.php:24
714
+ msgid "None"
715
+ msgstr "Ninguno"
716
+
717
+ #: templates/metaboxes/types/contactform.php:60
718
+ msgid "Add field"
719
+ msgstr "Añadir campo"
720
+
721
+ #: templates/metaboxes/types/contactform.php:69
722
+ #: templates/metaboxes/types/contactform.php:261
723
+ #: templates/metaboxes/types/customtabs.php:37
724
+ #: templates/metaboxes/types/customtabs.php:82
725
+ msgid "Remove"
726
+ msgstr "Borrar"
727
+
728
+ #: templates/metaboxes/types/contactform.php:70
729
+ #: templates/metaboxes/types/contactform.php:262
730
+ msgid "Click to toggle"
731
+ msgstr "Haz click para alternar"
732
+
733
+ #: templates/metaboxes/types/contactform.php:77
734
+ #: templates/metaboxes/types/contactform.php:269
735
+ msgid "Field Title"
736
+ msgstr "Campo de título"
737
+
738
+ #: templates/metaboxes/types/contactform.php:81
739
+ #: templates/metaboxes/types/contactform.php:273
740
+ msgid "Insert the title for the field."
741
+ msgstr "Inserta el título del campo."
742
+
743
+ #: templates/metaboxes/types/contactform.php:86
744
+ #: templates/metaboxes/types/contactform.php:278
745
+ msgid "Data Name"
746
+ msgstr "Nombre del dato."
747
+
748
+ #: templates/metaboxes/types/contactform.php:90
749
+ #: templates/metaboxes/types/contactform.php:282
750
+ msgid ""
751
+ "REQUIRED: Field identification name to be entered into email body. <strong>Note:</"
752
+ "strong>Use only lowercase characters and underscores."
753
+ msgstr ""
754
+ "OBLIGATORIO: El nombre del campo de identificación debe introducirse en el cuerpo "
755
+ "del email. <strong> Nota: </strong> Usa sólo minúsculas y guiones bajos."
756
+
757
+ #: templates/metaboxes/types/contactform.php:95
758
+ #: templates/metaboxes/types/contactform.php:287
759
+ msgid "Field Type"
760
+ msgstr "Tipo de campo"
761
+
762
+ #: templates/metaboxes/types/contactform.php:103
763
+ #: templates/metaboxes/types/contactform.php:295
764
+ msgid "Select the type for this field."
765
+ msgstr "Selecciona el tipo para este campo."
766
+
767
+ #: templates/metaboxes/types/contactform.php:108
768
+ #: templates/metaboxes/types/contactform.php:300
769
+ msgid "Checked"
770
+ msgstr "Campo seleccionado"
771
+
772
+ #: templates/metaboxes/types/contactform.php:112
773
+ #: templates/metaboxes/types/contactform.php:304
774
+ msgid "Select this option if you want this field appears as already checked."
775
+ msgstr "Selecciona esta opción si quieres que este campo aparezca como ya marcado."
776
+
777
+ #: templates/metaboxes/types/contactform.php:117
778
+ #: templates/metaboxes/types/contactform.php:309
779
+ msgid "Add options "
780
+ msgstr "Añadir opciones"
781
+
782
+ #: templates/metaboxes/types/contactform.php:118
783
+ #: templates/metaboxes/types/contactform.php:310
784
+ msgid "Add option"
785
+ msgstr "Añadir opción"
786
+
787
+ #: templates/metaboxes/types/contactform.php:121
788
+ #: templates/metaboxes/types/contactform.php:313
789
+ #: templates/metaboxes/types/contactform.php:436
790
+ msgid "Selected"
791
+ msgstr "Selecionado"
792
+
793
+ #: templates/metaboxes/types/contactform.php:124
794
+ #: templates/metaboxes/types/contactform.php:316
795
+ #: templates/metaboxes/types/contactform.php:436
796
+ msgid "Delete option"
797
+ msgstr "Borrar opción"
798
+
799
+ #: templates/metaboxes/types/contactform.php:130
800
+ #: templates/metaboxes/types/contactform.php:322
801
+ msgid "Error Message"
802
+ msgstr "Mensaje de error"
803
+
804
+ #: templates/metaboxes/types/contactform.php:134
805
+ #: templates/metaboxes/types/contactform.php:326
806
+ msgid "Insert the error message for validation."
807
+ msgstr "Inserta el mensaje de error para la validación."
808
+
809
+ #: templates/metaboxes/types/contactform.php:139
810
+ #: templates/metaboxes/types/contactform.php:331
811
+ msgid "Required"
812
+ msgstr "Campo obligatorio"
813
+
814
+ #: templates/metaboxes/types/contactform.php:143
815
+ #: templates/metaboxes/types/contactform.php:335
816
+ msgid "Select this option if it must be required."
817
+ msgstr "Selecciona esta opción si este campo debe ser obligatorio."
818
+
819
+ #: templates/metaboxes/types/contactform.php:152
820
+ #: templates/metaboxes/types/contactform.php:344
821
+ msgid "Select this option if the email must be valid."
822
+ msgstr "Selecciona esta opción si el email debe ser válido."
823
+
824
+ #: templates/metaboxes/types/contactform.php:157
825
+ #: templates/metaboxes/types/contactform.php:349
826
+ msgid "Reply To"
827
+ msgstr "Responder a"
828
+
829
+ #: templates/metaboxes/types/contactform.php:161
830
+ #: templates/metaboxes/types/contactform.php:353
831
+ msgid "Select this if it is the email you can reply to."
832
+ msgstr "Selecciona si este es el email al que puedes responder."
833
+
834
+ #: templates/metaboxes/types/contactform.php:166
835
+ #: templates/metaboxes/types/contactform.php:358
836
+ msgid "Class"
837
+ msgstr "Clase"
838
+
839
+ #: templates/metaboxes/types/contactform.php:170
840
+ #: templates/metaboxes/types/contactform.php:362
841
+ msgid "Insert additional class(es) (separated by commas) for more personalization."
842
+ msgstr "Inserta clase(s) adicionales (separados por comas) para más personalización."
843
+
844
+ #: templates/metaboxes/types/contactform.php:175
845
+ #: templates/metaboxes/types/contactform.php:367
846
+ msgid "Icon"
847
+ msgstr "Icono"
848
+
849
+ #: templates/metaboxes/types/contactform.php:203
850
+ #: templates/metaboxes/types/contactform.php:391
851
+ #: templates/metaboxes/types/icon-list.php:69
852
+ #: templates/metaboxes/types/select-icon.php:33
853
+ #: templates/metaboxes/types/upload.php:21 templates/panel/types/upload.php:31
854
+ #: templates/panel/woocommerce/woocommerce-upload.php:40
855
+ msgid "Upload"
856
+ msgstr "Actualiza"
857
+
858
+ #: templates/metaboxes/types/contactform.php:209
859
+ #: templates/metaboxes/types/contactform.php:397
860
+ #: templates/metaboxes/types/icon-list.php:75
861
+ #: templates/metaboxes/types/select-icon.php:39
862
+ msgid "Image preview"
863
+ msgstr "Previsualización de imagen"
864
+
865
+ #: templates/metaboxes/types/contactform.php:217
866
+ #: templates/metaboxes/types/contactform.php:405
867
+ msgid "Insert an icon for more personalization."
868
+ msgstr "Inserta un icono para más personalización"
869
+
870
+ #: templates/metaboxes/types/contactform.php:222
871
+ #: templates/metaboxes/types/contactform.php:409
872
+ msgid "Width"
873
+ msgstr "Ancho"
874
+
875
+ #: templates/metaboxes/types/contactform.php:247
876
+ #: templates/metaboxes/types/contactform.php:421
877
+ msgid "Set field length."
878
+ msgstr "Establecer el ancho de campo"
879
+
880
+ #: templates/metaboxes/types/customtabs.php:28
881
+ msgid "Close all"
882
+ msgstr "Cerrar todos"
883
+
884
+ #: templates/metaboxes/types/customtabs.php:28
885
+ msgid "Expand all"
886
+ msgstr "Expandir todos"
887
+
888
+ #: templates/metaboxes/types/customtabs.php:52
889
+ #: templates/metaboxes/types/customtabs.php:95
890
+ msgid "Value"
891
+ msgstr "Valor"
892
+
893
+ #: templates/metaboxes/types/customtabs.php:53
894
+ #: templates/metaboxes/types/customtabs.php:96
895
+ msgid "Content of the tab. (HTML is supported)"
896
+ msgstr "Contenido de la pestaña. (HTML se soporta)"
897
+
898
+ #: templates/metaboxes/types/customtabs.php:65
899
+ msgid "Add custom product tab"
900
+ msgstr "Añadir etiqueta de producto personalizado"
901
+
902
+ #: templates/metaboxes/types/customtabs.php:107
903
+ msgid "Do you want to remove the custom tab?"
904
+ msgstr "¿Quieres borrar la etiqueta personalizada?"
905
+
906
+ #: templates/metaboxes/types/icon-list.php:89
907
+ #, php-format
908
+ msgid "(Default: %s <img src=\"%s\"/>)"
909
+ msgstr "(Por defecto: %s <img src=\"%s\"/>)"
910
+
911
+ #: templates/metaboxes/types/icon-list.php:91
912
+ #, php-format
913
+ msgid "(Default: <i %s></i> )"
914
+ msgstr "(Por defecto: <i %s></i> )"
915
+
916
+ #: templates/metaboxes/types/image-gallery.php:40
917
+ #: templates/metaboxes/types/image-gallery.php:45
918
+ #: templates/metaboxes/types/images.php:38 templates/metaboxes/types/images.php:64
919
+ msgid "Delete image"
920
+ msgstr "Borrar imagen"
921
+
922
+ #: templates/metaboxes/types/image-gallery.php:45
923
+ msgid "Add Images to Gallery"
924
+ msgstr "Añadir imágenes a la Galería"
925
+
926
+ #: templates/metaboxes/types/image-gallery.php:45
927
+ msgid "Add to gallery"
928
+ msgstr "Añadir a la galería"
929
+
930
+ #: templates/metaboxes/types/image-gallery.php:45
931
+ msgid "Add images"
932
+ msgstr "Añadir imágenes"
933
+
934
+ #: templates/metaboxes/types/image-gallery.php:45
935
+ msgid "Delete"
936
+ msgstr "Borrar"
937
+
938
+ #: templates/metaboxes/types/images.php:42
939
+ msgid "Upload new images"
940
+ msgstr "Cargar nuevas imágenes"
941
+
942
+ #: templates/metaboxes/types/images.php:75
943
+ msgid "Are you sure you want to remove this image?"
944
+ msgstr "¿Estás seguro/a de que quieres borrar esta imagen?"
945
+
946
+ #: templates/metaboxes/types/sidebar-layout.php:25
947
+ #: templates/metaboxes/types/sidebars.php:36
948
+ msgid "Left sidebar"
949
+ msgstr "Barra lateral izquierda"
950
+
951
+ #: templates/metaboxes/types/sidebar-layout.php:28
952
+ #: templates/metaboxes/types/sidebars.php:42
953
+ #: templates/metaboxes/types/sidebars.php:45
954
+ msgid "No sidebar"
955
+ msgstr "Sin barra lateral"
956
+
957
+ #: templates/metaboxes/types/sidebar-layout.php:31
958
+ #: templates/metaboxes/types/sidebars.php:39
959
+ msgid "Right sidebar"
960
+ msgstr "Barra lateral derecha"
961
+
962
+ #: templates/metaboxes/types/sidebar-layout.php:34
963
+ #: templates/metaboxes/types/sidebars.php:53
964
+ #: templates/metaboxes/types/sidebars.php:64
965
+ msgid "Choose a sidebar"
966
+ msgstr "Elige una barra lateral"
967
+
968
+ #: templates/metaboxes/types/sidebars.php:51
969
+ msgid "Left Sidebar"
970
+ msgstr "Barra lateral izquierda"
971
+
972
+ #: templates/metaboxes/types/sidebars.php:62
973
+ msgid "Right Sidebar"
974
+ msgstr "Barra lateral derecha"
975
+
976
+ #: templates/metaboxes/types/typography.php:42
977
+ msgid "px"
978
+ msgstr "px"
979
+
980
+ #: templates/metaboxes/types/typography.php:43
981
+ msgid "em"
982
+ msgstr "em"
983
+
984
+ #: templates/metaboxes/types/typography.php:44
985
+ msgid "pt"
986
+ msgstr "pt"
987
+
988
+ #: templates/metaboxes/types/typography.php:45
989
+ msgid "rem"
990
+ msgstr "rem"
991
+
992
+ #: templates/metaboxes/types/typography.php:59
993
+ #: templates/metaboxes/types/typography.php:153
994
+ #: templates/metaboxes/types/typography.php:217
995
+ msgid "Web fonts"
996
+ msgstr "Fuentes web"
997
+
998
+ #: templates/metaboxes/types/typography.php:71
999
+ msgid "Google fonts"
1000
+ msgstr "Fuentes Google"
1001
+
1002
+ #: templates/metaboxes/types/typography.php:96
1003
+ msgid "Regular"
1004
+ msgstr "Normal"
1005
+
1006
+ #: templates/metaboxes/types/typography.php:97
1007
+ msgid "Bold"
1008
+ msgstr "Negrita"
1009
+
1010
+ #: templates/metaboxes/types/typography.php:98
1011
+ msgid "Extra bold"
1012
+ msgstr "Extra negrita"
1013
+
1014
+ #: templates/metaboxes/types/typography.php:99
1015
+ msgid "Italic"
1016
+ msgstr "Cursiva"
1017
+
1018
+ #: templates/metaboxes/types/typography.php:100
1019
+ msgid "Italic bold"
1020
+ msgstr "Cursiva negrita"
1021
+
1022
+ #: templates/panel/sidebar/widgets/widgets.php:17
1023
+ msgid "Join the club"
1024
+ msgstr "Únete al club"
1025
+
1026
+ #: templates/panel/sidebar/widgets/widgets.php:24
1027
+ msgid "Despacho Theme - 100% FREE"
1028
+ msgstr "Despacho Theme - 100% GRATIS"
1029
+
1030
+ #: templates/panel/sidebar/widgets/widgets.php:28
1031
+ msgid "FREE!"
1032
+ msgstr "¡GRATIS!"
1033
+
1034
+ #: templates/panel/sidebar/widgets/widgets.php:34
1035
+ msgid "Important Links"
1036
+ msgstr "Enlaces importantes"
1037
+
1038
+ #: templates/panel/types/upload.php:32
1039
+ msgid "Reset"
1040
+ msgstr "Reinicia"
1041
+
1042
+ #: templates/panel/woocommerce/woocommerce-form.php:17
1043
+ msgid "Reset Defaults"
1044
+ msgstr "Ajustes predeterminados"
1045
+
1046
+ #: templates/upgrade/upgrade-to-pro-version.php:2
1047
+ msgid "Upgrade to Premium Version"
1048
+ msgstr "Actualizar a la Versión Premium"
1049
+
1050
+ #: templates/upgrade/upgrade-to-pro-version.php:3
1051
+ msgid ""
1052
+ "Have you purchased the premium version of a plugin? Don't you know how to activate "
1053
+ "the license after the purchase?"
1054
+ msgstr ""
1055
+ "¿Has comprado la versión premium de un plugin? ¿No sabes cómo activar la licencia "
1056
+ "después de la compra?"
1057
+
1058
+ #: templates/upgrade/upgrade-to-pro-version.php:5
1059
+ msgid ""
1060
+ "To upgrade from a FREE to a PREMIUM plugin is not suffice to insert the license "
1061
+ "key provided after the purchase.\n"
1062
+ " The reason is that they are two distinct products, with significant "
1063
+ "differences both for available options and for number of files included in the "
1064
+ "plugin package.\n"
1065
+ " To start to use the PREMIUM version of the plugin, you simply need to "
1066
+ "download the PREMIUM packet and install it on your site."
1067
+ msgstr ""
1068
+ "Para actualizar a del plugin FREE al PREMIUMT no es suficiente con insertar la "
1069
+ "clave de licencia proporcionada después de la compra.\n"
1070
+ " La razón es que son dos productos diferentes, con diferencias "
1071
+ "significativas en las opciones disponibles para el número de archivos incluidos en "
1072
+ "el paquete del plugin.\n"
1073
+ " Para empezar a usar la versión PREMIUM del plugin, simplemente necesitas "
1074
+ "descargar el paquete PREMIUM e instalarlo en tu sitio web."
1075
+
1076
+ #: templates/upgrade/upgrade-to-pro-version.php:9
1077
+ #, php-format
1078
+ msgid ""
1079
+ "%1$sDo you need to know how to do it?%2$s Easy! %1$sFollow this list of steps%2$s "
1080
+ "and in a few minutes the plugin you purchased will be installed on your site"
1081
+ msgstr ""
1082
+ "%1$s¿Necesitas saber cómo hacerlo?%2$s ¡Fácil! %1$sSigue estos pasos%2$s y en unos "
1083
+ "minutos el plugin que has comprado estará instalado en tu sitio web"
1084
+
1085
+ #: templates/upgrade/upgrade-to-pro-version.php:12
1086
+ msgid "Go to yithemes.com and login to \"My Account\" page"
1087
+ msgstr "Ve a yithemes.com e inicia sesión en la página \"Mi cuenta\""
1088
+
1089
+ #: templates/upgrade/upgrade-to-pro-version.php:18
1090
+ msgid ""
1091
+ "From the menu on the left, click on \"My Downloads\", look for the plugin you want "
1092
+ "to install among the available downloads and click on \"Download\" button"
1093
+ msgstr ""
1094
+ "Desde el menú de la izquierda, haz click en \"Mis Descargas\", busca el plugin que "
1095
+ "te quieres descargar entre las descargas disponibles y haz click en el botón "
1096
+ "\"Descargar\""
1097
+
1098
+ #: templates/upgrade/upgrade-to-pro-version.php:24
1099
+ msgid ""
1100
+ "After downloading the packet, go to your website and login to WordPress "
1101
+ "administration area."
1102
+ msgstr ""
1103
+ "Después de descargar el paquete, ve a tu sitio web y regístrate en el área de "
1104
+ "administración de WordPress."
1105
+
1106
+ #: templates/upgrade/upgrade-to-pro-version.php:30
1107
+ msgid ""
1108
+ "From the menu on the left, click on \"Plugins\". You will be redirected to the "
1109
+ "page where you will find the complete list of all the plugins available on your "
1110
+ "site. Click on \"Add New\" button that you find above on the left to add a new "
1111
+ "plugin"
1112
+ msgstr ""
1113
+ "Desde el menú de la izquierda, haz click en \"Plugins\". Serás redirigido/a a la "
1114
+ "página donde podrás encontrar la lista completa de plugins disponible en tu sitio "
1115
+ "web. Haz click en el botón \"Añadir Nuevo\" que encontrarás arriba a la izquierda "
1116
+ "para añadir un nuevo plugin"
1117
+
1118
+ #: templates/upgrade/upgrade-to-pro-version.php:36
1119
+ msgid ""
1120
+ "You will be redirected to a new page where you will find, above on the left next "
1121
+ "to the page title, the \"Upload Plugin\" button."
1122
+ msgstr ""
1123
+ "Serás redirigido/a a una nueva página donde encontrarás, en la parte superior "
1124
+ "izquierda, junto al título de la página, el botón \"Actualizar Plugin\""
1125
+
1126
+ #: templates/upgrade/upgrade-to-pro-version.php:42
1127
+ msgid ""
1128
+ "Click on \"Upload Plugins\" button to start the upload of the PREMIUM version of "
1129
+ "the plugin previously downloaded. Click on \"Select File\", search for the "
1130
+ "download folder related to the plugin and upload the package. Now you only need to "
1131
+ "wait a few minutes for the upload and the installation on your site. (We used YITH "
1132
+ "Live Chat plugin by way of example)"
1133
+ msgstr ""
1134
+ "Haz click en el botón \"Actualizar Plugins\" para actualizar la versión premium "
1135
+ "del plugin anteriormente descargada. Haz click en \"Seleccionar Archivo\", busca "
1136
+ "la carpeta relacionada al plugin y actualiza el paquete. Ahora sólo necesitas "
1137
+ "esperar unos minutos para actualizarlo e instalarlo en tu sitio web. (Usamos YITH "
1138
+ "Live Chat a modo de ejemplo)"
1139
+
1140
+ #: templates/upgrade/upgrade-to-pro-version.php:48
1141
+ msgid "After completing the installation, click on \"Activate plugin\""
1142
+ msgstr "Después de completar la instalación, haz click en \"Activar plugin\""
1143
+
1144
+ #: templates/upgrade/upgrade-to-pro-version.php:52
1145
+ msgid ""
1146
+ "If everything worked allright, your plugin is now correctly installed on your "
1147
+ "website. Enjoy it :-)"
1148
+ msgstr ""
1149
+ "Si todo funcionó bien, tu plugin está ahora correctamente instalado en tu sitio "
1150
+ "web. Disfrútalo :-)"
1151
+
1152
+ #: templates/upgrade/upgrade-to-pro-version.php:55
1153
+ msgid ""
1154
+ "The last step is the activation of the plugin through its license key you received "
1155
+ "after the purchase. Click on \"License Activation\" that you find in \"YITH Plugins"
1156
+ "\" and insert the license key and the email address you used during the purchase."
1157
+ msgstr ""
1158
+ "El último paso es la activación del plugin a través de la clave de licencia, que "
1159
+ "recibiste después de la compra. Haz click en \"Activación de la licencia\", que "
1160
+ "encontrarás en \"YITH Plugins\" e introduce la dirección de email que usaste "
1161
+ "durante la compra."
1162
+
1163
+ #: templates/upgrade/upgrade-to-pro-version.php:61
1164
+ msgid ""
1165
+ "In case you had difficulty to recover the license key we sent you by email, you "
1166
+ "can easily find it in \"My Licenses\" section of your account on yithemes.com"
1167
+ msgstr ""
1168
+ "En caso de que hayas tenido dificultad para recuperar la clave de licencia que te "
1169
+ "enviamos por email, puedes encontrarla fácilmente en la sección \"Mis Licencias\" "
1170
+ "de tu cuenta en yithemes.com"
plugin-fw/languages/yith-plugin-fw-it_IT.mo CHANGED
Binary file
plugin-fw/languages/yith-plugin-fw-it_IT.po CHANGED
@@ -4,21 +4,21 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
6
  "Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
7
- "POT-Creation-Date: 2015-11-16 12:23+0100\n"
8
- "PO-Revision-Date: 2015-11-16 12:24+0100\n"
9
  "Last-Translator: \n"
10
  "Language-Team: YIThemes <plugins@yithemes.com>\n"
11
  "Language: it_IT\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 1.8.1\n"
16
  "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
17
  "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
18
  "esc_html_x:1,2c\n"
19
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
  "X-Poedit-SourceCharset: UTF-8\n"
21
- "X-Poedit-Basepath: ../\n"
22
  "X-Textdomain-Support: yes\n"
23
  "X-Poedit-SearchPath-0: .\n"
24
 
@@ -127,7 +127,7 @@ msgid "%s Settings"
127
  msgstr "Impostazioni %s"
128
 
129
  #: lib/yit-cpt-unlimited.php:1048 lib/yit-cpt-unlimited.php:1196
130
- #: lib/yit-cpt-unlimited.php:1202 lib/yit-plugin-panel.php:64
131
  msgid "Settings"
132
  msgstr "Impostazioni"
133
 
@@ -224,79 +224,87 @@ msgstr "Aggiungi %s dalla immagini"
224
  msgid "Upload multiple files"
225
  msgstr ""
226
 
227
- #: lib/yit-plugin-panel-wc.php:336
 
 
 
 
 
 
 
 
228
  msgid "The changes you have made will be lost if you leave this page."
229
  msgstr "Perderai tutti i cambiamenti effettuati se lasci questa pagina."
230
 
231
- #: lib/yit-plugin-panel.php:63
232
  msgid "Plugin Settings"
233
  msgstr "Impostazioni plugin"
234
 
235
- #: lib/yit-plugin-panel.php:96 lib/yit-plugin-subpanel.php:101
236
- msgid "YIT Plugins"
237
- msgstr "YIT Plugins"
238
 
239
- #: lib/yit-plugin-panel.php:288 lib/yit-plugin-subpanel.php:143
240
- #: templates/panel/woocommerce/woocommerce-form.php:5
241
  msgid "Save Changes"
242
  msgstr "Salva modifiche"
243
 
244
- #: lib/yit-plugin-panel.php:291 templates/panel/woocommerce/woocommerce-form.php:8
245
  msgid "If you continue with this action, you will reset all options in this page."
246
  msgstr ""
247
  "Se prosegui con questa azione, tutte le opzioni di questa pagina saranno "
248
  "reimpostate."
249
 
250
- #: lib/yit-plugin-panel.php:293 lib/yit-plugin-subpanel.php:148
251
  msgid "Reset to default"
252
  msgstr ""
253
 
254
- #: lib/yit-plugin-panel.php:293 lib/yit-plugin-subpanel.php:148
255
- #: templates/panel/woocommerce/woocommerce-form.php:11
256
  msgid "Are you sure?"
257
  msgstr "Sei sicuro?"
258
 
259
- #: lib/yit-plugin-panel.php:427
260
  msgid "The element you have entered already exists. Please, enter another name."
261
  msgstr "L'elemento inserito esiste già. Per favore, inserisci un altro nome."
262
 
263
- #: lib/yit-plugin-panel.php:428
264
  msgid "Settings saved"
265
  msgstr "Impostazioni salvate"
266
 
267
- #: lib/yit-plugin-panel.php:429
268
  msgid "Settings reset"
269
  msgstr "Impostazioni azzerate"
270
 
271
- #: lib/yit-plugin-panel.php:430
272
  msgid "Element deleted correctly."
273
  msgstr "Elemento rimosso correttamente."
274
 
275
- #: lib/yit-plugin-panel.php:431 lib/yit-plugin-panel.php:432
276
  msgid "Element updated correctly."
277
  msgstr "Elemento aggiornato correttamente."
278
 
279
- #: lib/yit-plugin-panel.php:433
280
  msgid "Database imported correctly."
281
  msgstr "Database importato correttamente."
282
 
283
- #: lib/yit-plugin-panel.php:434
284
  msgid "An error has occurred during import. Please try again."
285
  msgstr "Si è verificato un errore durante l'importazione. Prova di nuovo."
286
 
287
- #: lib/yit-plugin-panel.php:435
288
  msgid "The added file is not valid."
289
  msgstr "Il file aggiunto non è valido."
290
 
291
- #: lib/yit-plugin-panel.php:436
292
  msgid "Sorry, import is disabled."
293
  msgstr "Ci dispiace, l'importazione è disabilitata."
294
 
295
- #: lib/yit-plugin-panel.php:437
296
  msgid "Sorting successful."
297
  msgstr "Ordinamento effettuato con successo."
298
 
299
- #: lib/yit-plugin-subpanel.php:146
300
  msgid ""
301
  "If you continue with this action, you will reset all the options in this page."
302
  msgstr ""
@@ -347,40 +355,40 @@ msgstr ""
347
  "di YITH WooCommerce Wishlist, YITH WooCommerce Ajax Search etc.)\n"
348
  "saranno trasferite nella scheda Plugin YIT."
349
 
350
- #: lib/yit-upgrade.php:123
351
  msgid "There is a new version of %plugin_name% available."
352
  msgstr "Una nuova versione di %plugin_name% è disponibile."
353
 
354
- #: lib/yit-upgrade.php:124
355
  msgid "View version %latest% details."
356
  msgstr "Visualizza i dettagli della versione %latest%."
357
 
358
- #: lib/yit-upgrade.php:125
359
  msgid "Automatic update is unavailable for this plugin,"
360
  msgstr "L'aggiornamento automatico non è disponibile per questo plugin,"
361
 
362
- #: lib/yit-upgrade.php:126
363
  msgid "please <a href=\"%activate_link%\">activate</a> your copy of %plugin_name%."
364
  msgstr ""
365
  "per favore, <a href=\"%activate_link%\">attiva</a> la tua copia di %plugin_name%."
366
 
367
- #: lib/yit-upgrade.php:127
368
  msgid "Update now."
369
  msgstr "Aggiorna adesso."
370
 
371
- #: lib/yit-upgrade.php:250
372
- msgid "Yithemes Repository"
373
- msgstr "Repository YIThemes"
374
 
375
- #: lib/yit-upgrade.php:284
376
  msgid "Invalid URL Provided."
377
  msgstr "L'URL inserito non è valido."
378
 
379
- #: lib/yit-upgrade.php:297
380
  msgid "Could not create Temporary file."
381
  msgstr "Non è stato possibile creare il file temporaneo."
382
 
383
- #: lib/yit-upgrade.php:439
384
  #, php-format
385
  msgid ""
386
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
@@ -389,7 +397,7 @@ msgstr ""
389
  "È disponibile una nuova versione di %1$s. <a href=\"%2$s\" class=\"thickbox yit-"
390
  "changelog-button\" title=\"%3$s\">Visualizza i dettagli della versione %4$s</a>."
391
 
392
- #: lib/yit-upgrade.php:441
393
  #, php-format
394
  msgid ""
395
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
@@ -402,7 +410,7 @@ msgstr ""
402
  "<em>Per poter usufruire degli aggiornamenti automatici è necessario attivare il "
403
  "plugin su un solo sito.</em>"
404
 
405
- #: lib/yit-upgrade.php:443
406
  #, php-format
407
  msgid ""
408
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
@@ -411,7 +419,7 @@ msgid ""
411
  "activation\">activate</a> your copy of %6s.</em>"
412
  msgstr ""
413
 
414
- #: lib/yit-upgrade.php:445
415
  #, php-format
416
  msgid ""
417
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
@@ -422,111 +430,115 @@ msgstr ""
422
  "changelog-button\" title=\"%3$s\">Visualizza i dettagli della versione %4$s</a> "
423
  "oppure <a href=\"%5$s\">aggiorna adesso</a>."
424
 
425
- #: lib/yit-upgrade.php:518
426
  msgid "You can't update the plugins for this site."
427
  msgstr "Non è possibile aggiornare i plugin per questo sito."
428
 
429
- #: lib/yit-upgrade.php:522
430
  msgid "You do not have sufficient permissions to update the plugins for this site."
431
  msgstr ""
432
  "Non sei in possesso delle autorizzazioni necessarie per aggiornare i plugin in "
433
  "questo sito."
434
 
435
- #: lib/yit-upgrade.php:529
436
  msgid "Update Plugin"
437
  msgstr "Aggiorna plugin"
438
 
439
- #: licence/lib/yit-licence.php:170
440
  #, php-format
441
  msgctxt "%s = field name"
442
  msgid "%s field cannot be empty"
443
  msgstr "Il campo %s non può essere vuoto"
444
 
445
- #: licence/lib/yit-licence.php:171
446
  #, php-format
447
  msgid "%s and %s fields cannot be empty"
448
  msgstr "I campi %s e %s non possono essere vuoti"
449
 
450
- #: licence/lib/yit-licence.php:172
451
  msgid "Unable to contact the remote server, please try again later. Thanks!"
452
  msgstr "Impossibile contattare il server remoto, prova più tardi. Grazie!"
453
 
454
- #: licence/lib/yit-licence.php:173
455
- #: licence/templates/panel/activation/activation-panel.php:89
456
- #: licence/templates/panel/activation/activation-panel.php:164
457
- #: licence/templates/panel/activation/activation-panel.php:195
458
  #: templates/metaboxes/types/contactform.php:148
459
  #: templates/metaboxes/types/contactform.php:340
460
  msgid "Email"
461
  msgstr "Email"
462
 
463
- #: licence/lib/yit-licence.php:174
464
- #: licence/templates/panel/activation/activation-panel.php:90
465
- #: licence/templates/panel/activation/activation-panel.php:165
466
- #: licence/templates/panel/activation/activation-panel.php:196
467
  msgid "License Key"
468
  msgstr ""
469
 
470
- #: licence/lib/yit-licence.php:175
471
  msgid "Are you sure you want to deactivate the license for current site?"
472
  msgstr ""
473
 
474
- #: licence/lib/yit-licence.php:638
475
  msgid "Invalid Request"
476
  msgstr "Richiesta non valida"
477
 
478
- #: licence/lib/yit-licence.php:639
479
  msgid "Invalid license key"
480
  msgstr ""
481
 
482
- #: licence/lib/yit-licence.php:640
483
  msgid "Software has been deactivated"
484
  msgstr "Il software è stato disattivato"
485
 
486
- #: licence/lib/yit-licence.php:641
487
  msgid "Maximum number of activations exceeded"
488
  msgstr "Hai raggiunto il numero massimo di attivazioni"
489
 
490
- #: licence/lib/yit-licence.php:642
491
  msgid "Invalid instance ID"
492
  msgstr "Istanza ID non valida"
493
 
494
- #: licence/lib/yit-licence.php:643
495
  msgid "Invalid security key"
496
  msgstr "Chiave di sicurezza non valida"
497
 
498
- #: licence/lib/yit-licence.php:644
499
  msgid "License key has expired"
500
  msgstr ""
501
 
502
- #: licence/lib/yit-licence.php:645
503
  msgid "License key has been banned"
504
  msgstr ""
505
 
506
- #: licence/lib/yit-licence.php:646
 
 
 
 
507
  msgid "Great"
508
  msgstr ""
509
 
510
- #: licence/lib/yit-licence.php:646
511
  msgid "License successfully activated"
512
  msgstr ""
513
 
514
- #: licence/lib/yit-licence.php:647
515
  msgid "License key deactivated for website"
516
  msgstr ""
517
 
518
- #: licence/lib/yit-plugin-licence.php:68 licence/lib/yit-plugin-licence.php:69
519
- #: licence/lib/yit-theme-licence.php:70 licence/lib/yit-theme-licence.php:71
520
- #: licence/lib/yit-theme-licence.php:110 licence/lib/yit-theme-licence.php:111
521
  msgid "License Activation"
522
  msgstr ""
523
 
524
- #: licence/lib/yit-theme-licence.php:118 licence/lib/yit-theme-licence.php:119
525
  #, php-format
526
  msgid "%s"
527
  msgstr "%s"
528
 
529
- #: licence/lib/yit-theme-licence.php:160
530
  msgid ""
531
  "I cannot find the license key for activating the theme I have bought some time "
532
  "ago. Where can I find it?"
@@ -548,11 +560,11 @@ msgid ""
548
  "in section \"My licenses\"."
549
  msgstr ""
550
 
551
- #: licence/templates/panel/activation/activation-panel.php:22
552
  msgid "Yithemes License Activation"
553
  msgstr ""
554
 
555
- #: licence/templates/panel/activation/activation-panel.php:28
556
  msgid ""
557
  "Have you updated your licenses? Have you asked for an extension? Update "
558
  "information concerning your products."
@@ -560,73 +572,75 @@ msgstr ""
560
  "Hai aggiornato la tua licenza? Hai richiesto un'estensione? Aggiorna le "
561
  "informazioni dei tuoi prodotti."
562
 
563
- #: licence/templates/panel/activation/activation-panel.php:30
564
  msgid "Update license information"
565
  msgstr ""
566
 
567
- #: licence/templates/panel/activation/activation-panel.php:43
568
  msgid "Product to activate"
569
  msgid_plural "Products to activate"
570
  msgstr[0] ""
571
  msgstr[1] ""
572
 
573
- #: licence/templates/panel/activation/activation-panel.php:62
574
  msgid "Activate"
575
  msgstr "Attiva"
576
 
577
- #: licence/templates/panel/activation/activation-panel.php:81
578
  msgid "Activated"
579
  msgstr "Attivato"
580
 
581
- #: licence/templates/panel/activation/activation-panel.php:87
582
- #: licence/templates/panel/activation/activation-panel.php:162
583
- #: licence/templates/panel/activation/activation-panel.php:192
584
  msgid "Product Name"
585
  msgstr "Nome prodotto"
586
 
587
- #: licence/templates/panel/activation/activation-panel.php:93
588
- #: licence/templates/panel/activation/activation-panel.php:199
589
  msgid "Expires"
590
  msgstr "Scadenza"
591
 
592
- #: licence/templates/panel/activation/activation-panel.php:96
593
  msgid "Remaining"
594
  msgstr "Tempo rimanente"
595
 
596
  #: licence/templates/panel/activation/activation-panel.php:97
597
- #: licence/templates/panel/activation/activation-panel.php:223
598
  msgid "Membership"
599
  msgstr ""
600
 
601
- #: licence/templates/panel/activation/activation-panel.php:100
602
  msgid "License Actions"
603
  msgstr ""
604
 
605
- #: licence/templates/panel/activation/activation-panel.php:125
606
  #, php-format
607
  msgid "%1s out of %2s"
608
  msgstr "%1s di %2s"
609
 
610
- #: licence/templates/panel/activation/activation-panel.php:140
611
  msgid "Deactivate"
612
  msgstr ""
613
 
614
- #: licence/templates/panel/activation/activation-panel.php:145
615
- #: licence/templates/panel/activation/activation-panel.php:202
616
- #: licence/templates/panel/activation/activation-panel.php:223
617
  msgid "Renew"
618
  msgstr "Rinnova"
619
 
620
- #: licence/templates/panel/activation/activation-panel.php:158
621
  msgid "Banned"
622
  msgstr "Bloccato"
623
 
624
- #: licence/templates/panel/activation/activation-panel.php:188
625
  msgid "Expired"
626
  msgstr "Non più valido"
627
 
628
- #: licence/templates/panel/activation/activation-panel.php:223
629
- msgid "License"
 
 
 
 
630
  msgstr ""
631
 
632
  #: templates/metaboxes/types/ajax-products.php:23
@@ -993,10 +1007,172 @@ msgstr "Corsivo"
993
  msgid "Italic bold"
994
  msgstr "Grassetto corsivo"
995
 
996
- #: templates/panel/woocommerce/woocommerce-form.php:11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
997
  msgid "Reset Defaults"
998
  msgstr "Ripristina impostazioni iniziali"
999
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1000
  #~ msgid "Layout for this "
1001
  #~ msgstr "Layout per questo"
1002
 
4
  msgstr ""
5
  "Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
6
  "Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
7
+ "POT-Creation-Date: 2016-05-16 16:37+0200\n"
8
+ "PO-Revision-Date: 2016-05-16 16:37+0200\n"
9
  "Last-Translator: \n"
10
  "Language-Team: YIThemes <plugins@yithemes.com>\n"
11
  "Language: it_IT\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.8.4\n"
16
  "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
17
  "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
18
  "esc_html_x:1,2c\n"
19
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
  "X-Poedit-SourceCharset: UTF-8\n"
21
+ "X-Poedit-Basepath: ..\n"
22
  "X-Textdomain-Support: yes\n"
23
  "X-Poedit-SearchPath-0: .\n"
24
 
127
  msgstr "Impostazioni %s"
128
 
129
  #: lib/yit-cpt-unlimited.php:1048 lib/yit-cpt-unlimited.php:1196
130
+ #: lib/yit-cpt-unlimited.php:1202 lib/yit-plugin-panel.php:74
131
  msgid "Settings"
132
  msgstr "Impostazioni"
133
 
224
  msgid "Upload multiple files"
225
  msgstr ""
226
 
227
+ #: lib/yit-plugin-panel-sidebar.php:421 templates/panel/sidebar/sidebar.php:3
228
+ msgid "Hide sidebar"
229
+ msgstr ""
230
+
231
+ #: lib/yit-plugin-panel-sidebar.php:422 templates/panel/sidebar/sidebar.php:3
232
+ msgid "Show sidebar"
233
+ msgstr ""
234
+
235
+ #: lib/yit-plugin-panel-wc.php:359
236
  msgid "The changes you have made will be lost if you leave this page."
237
  msgstr "Perderai tutti i cambiamenti effettuati se lasci questa pagina."
238
 
239
+ #: lib/yit-plugin-panel.php:73
240
  msgid "Plugin Settings"
241
  msgstr "Impostazioni plugin"
242
 
243
+ #: lib/yit-plugin-panel.php:293
244
+ msgid "Premium version upgrade"
245
+ msgstr ""
246
 
247
+ #: lib/yit-plugin-panel.php:344 lib/yit-plugin-subpanel.php:146
248
+ #: templates/panel/woocommerce/woocommerce-form.php:11
249
  msgid "Save Changes"
250
  msgstr "Salva modifiche"
251
 
252
+ #: lib/yit-plugin-panel.php:347 templates/panel/woocommerce/woocommerce-form.php:14
253
  msgid "If you continue with this action, you will reset all options in this page."
254
  msgstr ""
255
  "Se prosegui con questa azione, tutte le opzioni di questa pagina saranno "
256
  "reimpostate."
257
 
258
+ #: lib/yit-plugin-panel.php:349 lib/yit-plugin-subpanel.php:151
259
  msgid "Reset to default"
260
  msgstr ""
261
 
262
+ #: lib/yit-plugin-panel.php:349 lib/yit-plugin-subpanel.php:151
263
+ #: templates/panel/woocommerce/woocommerce-form.php:18
264
  msgid "Are you sure?"
265
  msgstr "Sei sicuro?"
266
 
267
+ #: lib/yit-plugin-panel.php:545
268
  msgid "The element you have entered already exists. Please, enter another name."
269
  msgstr "L'elemento inserito esiste già. Per favore, inserisci un altro nome."
270
 
271
+ #: lib/yit-plugin-panel.php:546
272
  msgid "Settings saved"
273
  msgstr "Impostazioni salvate"
274
 
275
+ #: lib/yit-plugin-panel.php:547
276
  msgid "Settings reset"
277
  msgstr "Impostazioni azzerate"
278
 
279
+ #: lib/yit-plugin-panel.php:548
280
  msgid "Element deleted correctly."
281
  msgstr "Elemento rimosso correttamente."
282
 
283
+ #: lib/yit-plugin-panel.php:549 lib/yit-plugin-panel.php:550
284
  msgid "Element updated correctly."
285
  msgstr "Elemento aggiornato correttamente."
286
 
287
+ #: lib/yit-plugin-panel.php:551
288
  msgid "Database imported correctly."
289
  msgstr "Database importato correttamente."
290
 
291
+ #: lib/yit-plugin-panel.php:552
292
  msgid "An error has occurred during import. Please try again."
293
  msgstr "Si è verificato un errore durante l'importazione. Prova di nuovo."
294
 
295
+ #: lib/yit-plugin-panel.php:553
296
  msgid "The added file is not valid."
297
  msgstr "Il file aggiunto non è valido."
298
 
299
+ #: lib/yit-plugin-panel.php:554
300
  msgid "Sorry, import is disabled."
301
  msgstr "Ci dispiace, l'importazione è disabilitata."
302
 
303
+ #: lib/yit-plugin-panel.php:555
304
  msgid "Sorting successful."
305
  msgstr "Ordinamento effettuato con successo."
306
 
307
+ #: lib/yit-plugin-subpanel.php:149
308
  msgid ""
309
  "If you continue with this action, you will reset all the options in this page."
310
  msgstr ""
355
  "di YITH WooCommerce Wishlist, YITH WooCommerce Ajax Search etc.)\n"
356
  "saranno trasferite nella scheda Plugin YIT."
357
 
358
+ #: lib/yit-upgrade.php:136
359
  msgid "There is a new version of %plugin_name% available."
360
  msgstr "Una nuova versione di %plugin_name% è disponibile."
361
 
362
+ #: lib/yit-upgrade.php:137
363
  msgid "View version %latest% details."
364
  msgstr "Visualizza i dettagli della versione %latest%."
365
 
366
+ #: lib/yit-upgrade.php:138
367
  msgid "Automatic update is unavailable for this plugin,"
368
  msgstr "L'aggiornamento automatico non è disponibile per questo plugin,"
369
 
370
+ #: lib/yit-upgrade.php:139
371
  msgid "please <a href=\"%activate_link%\">activate</a> your copy of %plugin_name%."
372
  msgstr ""
373
  "per favore, <a href=\"%activate_link%\">attiva</a> la tua copia di %plugin_name%."
374
 
375
+ #: lib/yit-upgrade.php:140
376
  msgid "Update now."
377
  msgstr "Aggiorna adesso."
378
 
379
+ #: lib/yit-upgrade.php:243
380
+ msgid "YIThemes Repository"
381
+ msgstr ""
382
 
383
+ #: lib/yit-upgrade.php:277
384
  msgid "Invalid URL Provided."
385
  msgstr "L'URL inserito non è valido."
386
 
387
+ #: lib/yit-upgrade.php:290
388
  msgid "Could not create Temporary file."
389
  msgstr "Non è stato possibile creare il file temporaneo."
390
 
391
+ #: lib/yit-upgrade.php:432
392
  #, php-format
393
  msgid ""
394
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
397
  "È disponibile una nuova versione di %1$s. <a href=\"%2$s\" class=\"thickbox yit-"
398
  "changelog-button\" title=\"%3$s\">Visualizza i dettagli della versione %4$s</a>."
399
 
400
+ #: lib/yit-upgrade.php:434
401
  #, php-format
402
  msgid ""
403
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
410
  "<em>Per poter usufruire degli aggiornamenti automatici è necessario attivare il "
411
  "plugin su un solo sito.</em>"
412
 
413
+ #: lib/yit-upgrade.php:436
414
  #, php-format
415
  msgid ""
416
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
419
  "activation\">activate</a> your copy of %6s.</em>"
420
  msgstr ""
421
 
422
+ #: lib/yit-upgrade.php:438
423
  #, php-format
424
  msgid ""
425
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
430
  "changelog-button\" title=\"%3$s\">Visualizza i dettagli della versione %4$s</a> "
431
  "oppure <a href=\"%5$s\">aggiorna adesso</a>."
432
 
433
+ #: lib/yit-upgrade.php:511
434
  msgid "You can't update the plugins for this site."
435
  msgstr "Non è possibile aggiornare i plugin per questo sito."
436
 
437
+ #: lib/yit-upgrade.php:515
438
  msgid "You do not have sufficient permissions to update the plugins for this site."
439
  msgstr ""
440
  "Non sei in possesso delle autorizzazioni necessarie per aggiornare i plugin in "
441
  "questo sito."
442
 
443
+ #: lib/yit-upgrade.php:522
444
  msgid "Update Plugin"
445
  msgstr "Aggiorna plugin"
446
 
447
+ #: licence/lib/yit-licence.php:182
448
  #, php-format
449
  msgctxt "%s = field name"
450
  msgid "%s field cannot be empty"
451
  msgstr "Il campo %s non può essere vuoto"
452
 
453
+ #: licence/lib/yit-licence.php:183
454
  #, php-format
455
  msgid "%s and %s fields cannot be empty"
456
  msgstr "I campi %s e %s non possono essere vuoti"
457
 
458
+ #: licence/lib/yit-licence.php:184
459
  msgid "Unable to contact the remote server, please try again later. Thanks!"
460
  msgstr "Impossibile contattare il server remoto, prova più tardi. Grazie!"
461
 
462
+ #: licence/lib/yit-licence.php:185
463
+ #: licence/templates/panel/activation/activation-panel.php:88
464
+ #: licence/templates/panel/activation/activation-panel.php:166
465
+ #: licence/templates/panel/activation/activation-panel.php:197
466
  #: templates/metaboxes/types/contactform.php:148
467
  #: templates/metaboxes/types/contactform.php:340
468
  msgid "Email"
469
  msgstr "Email"
470
 
471
+ #: licence/lib/yit-licence.php:186
472
+ #: licence/templates/panel/activation/activation-panel.php:89
473
+ #: licence/templates/panel/activation/activation-panel.php:167
474
+ #: licence/templates/panel/activation/activation-panel.php:198
475
  msgid "License Key"
476
  msgstr ""
477
 
478
+ #: licence/lib/yit-licence.php:187
479
  msgid "Are you sure you want to deactivate the license for current site?"
480
  msgstr ""
481
 
482
+ #: licence/lib/yit-licence.php:667
483
  msgid "Invalid Request"
484
  msgstr "Richiesta non valida"
485
 
486
+ #: licence/lib/yit-licence.php:668
487
  msgid "Invalid license key"
488
  msgstr ""
489
 
490
+ #: licence/lib/yit-licence.php:669
491
  msgid "Software has been deactivated"
492
  msgstr "Il software è stato disattivato"
493
 
494
+ #: licence/lib/yit-licence.php:670
495
  msgid "Maximum number of activations exceeded"
496
  msgstr "Hai raggiunto il numero massimo di attivazioni"
497
 
498
+ #: licence/lib/yit-licence.php:671
499
  msgid "Invalid instance ID"
500
  msgstr "Istanza ID non valida"
501
 
502
+ #: licence/lib/yit-licence.php:672
503
  msgid "Invalid security key"
504
  msgstr "Chiave di sicurezza non valida"
505
 
506
+ #: licence/lib/yit-licence.php:673
507
  msgid "License key has expired"
508
  msgstr ""
509
 
510
+ #: licence/lib/yit-licence.php:674
511
  msgid "License key has been banned"
512
  msgstr ""
513
 
514
+ #: licence/lib/yit-licence.php:675
515
+ msgid "Current product is not included with your membership key"
516
+ msgstr ""
517
+
518
+ #: licence/lib/yit-licence.php:676
519
  msgid "Great"
520
  msgstr ""
521
 
522
+ #: licence/lib/yit-licence.php:676
523
  msgid "License successfully activated"
524
  msgstr ""
525
 
526
+ #: licence/lib/yit-licence.php:677
527
  msgid "License key deactivated for website"
528
  msgstr ""
529
 
530
+ #: licence/lib/yit-plugin-licence.php:67 licence/lib/yit-plugin-licence.php:68
531
+ #: licence/lib/yit-theme-licence.php:69 licence/lib/yit-theme-licence.php:70
532
+ #: licence/lib/yit-theme-licence.php:109 licence/lib/yit-theme-licence.php:110
533
  msgid "License Activation"
534
  msgstr ""
535
 
536
+ #: licence/lib/yit-theme-licence.php:117 licence/lib/yit-theme-licence.php:118
537
  #, php-format
538
  msgid "%s"
539
  msgstr "%s"
540
 
541
+ #: licence/lib/yit-theme-licence.php:159
542
  msgid ""
543
  "I cannot find the license key for activating the theme I have bought some time "
544
  "ago. Where can I find it?"
560
  "in section \"My licenses\"."
561
  msgstr ""
562
 
563
+ #: licence/templates/panel/activation/activation-panel.php:23
564
  msgid "Yithemes License Activation"
565
  msgstr ""
566
 
567
+ #: licence/templates/panel/activation/activation-panel.php:27
568
  msgid ""
569
  "Have you updated your licenses? Have you asked for an extension? Update "
570
  "information concerning your products."
572
  "Hai aggiornato la tua licenza? Hai richiesto un'estensione? Aggiorna le "
573
  "informazioni dei tuoi prodotti."
574
 
575
+ #: licence/templates/panel/activation/activation-panel.php:29
576
  msgid "Update license information"
577
  msgstr ""
578
 
579
+ #: licence/templates/panel/activation/activation-panel.php:42
580
  msgid "Product to activate"
581
  msgid_plural "Products to activate"
582
  msgstr[0] ""
583
  msgstr[1] ""
584
 
585
+ #: licence/templates/panel/activation/activation-panel.php:61
586
  msgid "Activate"
587
  msgstr "Attiva"
588
 
589
+ #: licence/templates/panel/activation/activation-panel.php:80
590
  msgid "Activated"
591
  msgstr "Attivato"
592
 
593
+ #: licence/templates/panel/activation/activation-panel.php:86
594
+ #: licence/templates/panel/activation/activation-panel.php:164
595
+ #: licence/templates/panel/activation/activation-panel.php:194
596
  msgid "Product Name"
597
  msgstr "Nome prodotto"
598
 
599
+ #: licence/templates/panel/activation/activation-panel.php:92
600
+ #: licence/templates/panel/activation/activation-panel.php:201
601
  msgid "Expires"
602
  msgstr "Scadenza"
603
 
604
+ #: licence/templates/panel/activation/activation-panel.php:95
605
  msgid "Remaining"
606
  msgstr "Tempo rimanente"
607
 
608
  #: licence/templates/panel/activation/activation-panel.php:97
 
609
  msgid "Membership"
610
  msgstr ""
611
 
612
+ #: licence/templates/panel/activation/activation-panel.php:101
613
  msgid "License Actions"
614
  msgstr ""
615
 
616
+ #: licence/templates/panel/activation/activation-panel.php:126
617
  #, php-format
618
  msgid "%1s out of %2s"
619
  msgstr "%1s di %2s"
620
 
621
+ #: licence/templates/panel/activation/activation-panel.php:142
622
  msgid "Deactivate"
623
  msgstr ""
624
 
625
+ #: licence/templates/panel/activation/activation-panel.php:147
626
+ #: licence/templates/panel/activation/activation-panel.php:204
 
627
  msgid "Renew"
628
  msgstr "Rinnova"
629
 
630
+ #: licence/templates/panel/activation/activation-panel.php:160
631
  msgid "Banned"
632
  msgstr "Bloccato"
633
 
634
+ #: licence/templates/panel/activation/activation-panel.php:190
635
  msgid "Expired"
636
  msgstr "Non più valido"
637
 
638
+ #: licence/templates/panel/activation/activation-panel.php:226
639
+ msgid "Order again"
640
+ msgstr ""
641
+
642
+ #: licence/templates/panel/activation/activation-panel.php:228
643
+ msgid "Renew license"
644
  msgstr ""
645
 
646
  #: templates/metaboxes/types/ajax-products.php:23
1007
  msgid "Italic bold"
1008
  msgstr "Grassetto corsivo"
1009
 
1010
+ #: templates/panel/sidebar/widgets/widgets.php:17
1011
+ msgid "Join the club"
1012
+ msgstr ""
1013
+
1014
+ #: templates/panel/sidebar/widgets/widgets.php:24
1015
+ msgid "Despacho Theme - 100% FREE"
1016
+ msgstr ""
1017
+
1018
+ #: templates/panel/sidebar/widgets/widgets.php:28
1019
+ msgid "FREE!"
1020
+ msgstr ""
1021
+
1022
+ #: templates/panel/sidebar/widgets/widgets.php:34
1023
+ msgid "Important Links"
1024
+ msgstr ""
1025
+
1026
+ #: templates/panel/types/upload.php:32
1027
+ msgid "Reset"
1028
+ msgstr ""
1029
+
1030
+ #: templates/panel/woocommerce/woocommerce-form.php:17
1031
  msgid "Reset Defaults"
1032
  msgstr "Ripristina impostazioni iniziali"
1033
 
1034
+ #: templates/upgrade/upgrade-to-pro-version.php:2
1035
+ msgid "Upgrade to Premium Version"
1036
+ msgstr ""
1037
+
1038
+ #: templates/upgrade/upgrade-to-pro-version.php:3
1039
+ msgid ""
1040
+ "Have you purchased the premium version of a plugin? Don't you know how to activate "
1041
+ "the license after the purchase?"
1042
+ msgstr ""
1043
+ "Hai comprato la versione premium di un plugin ? Dopo l'acquisto non trovi dove "
1044
+ "attivare la licenza del tuo plugin premium ? "
1045
+
1046
+ #: templates/upgrade/upgrade-to-pro-version.php:5
1047
+ msgid ""
1048
+ "To upgrade from a FREE to a PREMIUM plugin is not suffice to insert the license "
1049
+ "key provided after the purchase.\n"
1050
+ " The reason is that they are two distinct products, with significant "
1051
+ "differences both for available options and for number of files included in the "
1052
+ "plugin package.\n"
1053
+ " To start to use the PREMIUM version of the plugin, you simply need to "
1054
+ "download the PREMIUM packet and install it on your site."
1055
+ msgstr ""
1056
+ "Per passare da un plugin FREE ad uno PREMIUM non basta semplicemnete inserire la "
1057
+ "chiave di licenza che ti è stata fornita dopo aver completato l'acquisto. Questo "
1058
+ "perchè fisicamente si tratta di due prodotti diversi, con differenze sostanziali "
1059
+ "sia nelle opzioni disponibili sia sul numero di file presenti all'interno del "
1060
+ "pacchetto del plugin stesso. \n"
1061
+ "Per iniziare ad usare il plugin PREMIUM che hai appena acquistato devi "
1062
+ "semplicemente scaricare il pacchetto PREMIUM ed installarlo sul tuo sito."
1063
+
1064
+ #: templates/upgrade/upgrade-to-pro-version.php:9
1065
+ #, php-format
1066
+ msgid ""
1067
+ "%1$sDo you need to know how to do it?%2$s Easy! %1$sFollow this list of steps%2$s "
1068
+ "and in a few minutes the plugin you purchased will be installed on your site"
1069
+ msgstr ""
1070
+ "%1$sNon sai come fare ?%2$s Non è un problema%1$s, segui i passi elencati qui sotto"
1071
+ "%2$s ed in pochi minuti avrai il plugin acquistato correttamente installato sul "
1072
+ "tuo sito."
1073
+
1074
+ #: templates/upgrade/upgrade-to-pro-version.php:12
1075
+ msgid "Go to yithemes.com and login to \"My Account\" page"
1076
+ msgstr "Vai su yithemes.com ed effettua il login alla sezione \"My Account \""
1077
+
1078
+ #: templates/upgrade/upgrade-to-pro-version.php:18
1079
+ msgid ""
1080
+ "From the menu on the left, click on \"My Downloads\", look for the plugin you want "
1081
+ "to install among the available downloads and click on \"Download\" button"
1082
+ msgstr ""
1083
+ "Dal menù di sinistra clicca su \"My Downloads\" e cerca tra i download disponibili "
1084
+ "il plugin che vuoi installare, e clicca su \"Download\""
1085
+
1086
+ #: templates/upgrade/upgrade-to-pro-version.php:24
1087
+ msgid ""
1088
+ "After downloading the packet, go to your website and login to WordPress "
1089
+ "administration area."
1090
+ msgstr ""
1091
+ "Non appena il download del pacchetto sarà completato recati sul tuo sito web ed "
1092
+ "effettua il login all'area amministrazione di WordPress."
1093
+
1094
+ #: templates/upgrade/upgrade-to-pro-version.php:30
1095
+ msgid ""
1096
+ "From the menu on the left, click on \"Plugins\". You will be redirected to the "
1097
+ "page where you will find the complete list of all the plugins available on your "
1098
+ "site. Click on \"Add New\" button that you find above on the left to add a new "
1099
+ "plugin"
1100
+ msgstr ""
1101
+ "Dal menù di sinistra clicca sulla voce Plugins. Verrai indirizzato su una pagina "
1102
+ "con la lista dei plugin disponibili sul tuo sito. Clicca sul pulsante \"Add New\" "
1103
+ "che trovi in alto a sinistra vicino al titolo della pagina."
1104
+
1105
+ #: templates/upgrade/upgrade-to-pro-version.php:36
1106
+ msgid ""
1107
+ "You will be redirected to a new page where you will find, above on the left next "
1108
+ "to the page title, the \"Upload Plugin\" button."
1109
+ msgstr ""
1110
+ "Verrai indirizzato su una nuova pagina dove trovi, in alto a sinistra vicino al "
1111
+ "titolo della pagina, il pulsante \"Upload Plugin\"."
1112
+
1113
+ #: templates/upgrade/upgrade-to-pro-version.php:42
1114
+ msgid ""
1115
+ "Click on \"Upload Plugins\" button to start the upload of the PREMIUM version of "
1116
+ "the plugin previously downloaded. Click on \"Select File\", search for the "
1117
+ "download folder related to the plugin and upload the package. Now you only need to "
1118
+ "wait a few minutes for the upload and the installation on your site. (We used YITH "
1119
+ "Live Chat plugin by way of example)"
1120
+ msgstr ""
1121
+ "Cliccando su \"Upload Plugins\", ti troverai in una pagina dove poter effettuare "
1122
+ "l'upload del pacchetto del plugin PREMIUM da te precedentemente scaricato. Clicca "
1123
+ "quindi su \"Scegli File\", cerca la cartella di download dove hai scaricato il "
1124
+ "plugin ed effettua il caricamento del pacchetto. A questo punto ti basta attendere "
1125
+ "qualche minuto che il pacchetto venga caricato ed installato sul tuo sito. "
1126
+ "(Abbiamo usato YITH Live Chat come esempio) "
1127
+
1128
+ #: templates/upgrade/upgrade-to-pro-version.php:48
1129
+ msgid "After completing the installation, click on \"Activate plugin\""
1130
+ msgstr "Al termine della procedura di installazione clicca su \"Attiva\""
1131
+
1132
+ #: templates/upgrade/upgrade-to-pro-version.php:52
1133
+ msgid ""
1134
+ "If everything worked allright, your plugin is now correctly installed on your "
1135
+ "website. Enjoy it :-)"
1136
+ msgstr ""
1137
+ "Se tutto è andato per il meglio il tuo plugin è correttamente installato sul tuo "
1138
+ "sito web. Enjoy it :-)"
1139
+
1140
+ #: templates/upgrade/upgrade-to-pro-version.php:55
1141
+ msgid ""
1142
+ "The last step is the activation of the plugin through its license key you received "
1143
+ "after the purchase. Click on \"License Activation\" that you find in \"YITH Plugins"
1144
+ "\" and insert the license key and the email address you used during the purchase."
1145
+ msgstr ""
1146
+
1147
+ #: templates/upgrade/upgrade-to-pro-version.php:61
1148
+ msgid ""
1149
+ "In case you had difficulty to recover the license key we sent you by email, you "
1150
+ "can easily find it in \"My Licenses\" section of your account on yithemes.com"
1151
+ msgstr ""
1152
+ "Se non trovi l'email che ti abbiamo inviato contenete la license key puoi "
1153
+ "facilmente recuperarla dalla sezione \"My Licenses\" all'interno della sezione My "
1154
+ "Account del nostro sito yithemes.com."
1155
+
1156
+ #~ msgid "YITH Plugins"
1157
+ #~ msgstr "YITH Plugins"
1158
+
1159
+ #~ msgid ""
1160
+ #~ "The last step is the activation of the plugin through its license key you "
1161
+ #~ "received after the purchase. Click on \"License Activation\" that you find in "
1162
+ #~ "\"YITH Plugins\" and insert the license key and the email address you used "
1163
+ #~ "during the purchas."
1164
+ #~ msgstr ""
1165
+ #~ "Ultimo step è attivare il plugin con la chiave di licenza che hai ricevuto dopo "
1166
+ #~ "l'acquisto. Clicca quindi sul link \"License Activation\" che trovi sotto "
1167
+ #~ "\"YITH Plugins\" ed inserisci la license key in tuo possesso ed email "
1168
+ #~ "utilizzata in fase di acquisto."
1169
+
1170
+ #~ msgid "YIT Plugins"
1171
+ #~ msgstr "YIT Plugins"
1172
+
1173
+ #~ msgid "Yithemes Repository"
1174
+ #~ msgstr "Repository YIThemes"
1175
+
1176
  #~ msgid "Layout for this "
1177
  #~ msgstr "Layout per questo"
1178
 
plugin-fw/languages/yith-plugin-fw.pot CHANGED
@@ -5,7 +5,7 @@ msgid ""
5
  msgstr ""
6
  "Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
7
  "Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
8
- "POT-Creation-Date: 2015-11-16 12:23+0100\n"
9
  "PO-Revision-Date: 2015-05-05 10:38+0100\n"
10
  "Last-Translator: \n"
11
  "Language-Team: Your Inspiration Themes <info@yithemes.com>\n"
@@ -13,13 +13,13 @@ msgstr ""
13
  "MIME-Version: 1.0\n"
14
  "Content-Type: text/plain; charset=utf-8\n"
15
  "Content-Transfer-Encoding: 8bit\n"
16
- "X-Generator: Poedit 1.8.1\n"
17
  "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
18
  "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
19
  "esc_html_x:1,2c\n"
20
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
21
  "X-Poedit-SourceCharset: UTF-8\n"
22
- "X-Poedit-Basepath: ../\n"
23
  "X-Textdomain-Support: yes\n"
24
  "X-Poedit-SearchPath-0: .\n"
25
 
@@ -128,7 +128,7 @@ msgid "%s Settings"
128
  msgstr ""
129
 
130
  #: lib/yit-cpt-unlimited.php:1048 lib/yit-cpt-unlimited.php:1196
131
- #: lib/yit-cpt-unlimited.php:1202 lib/yit-plugin-panel.php:64
132
  msgid "Settings"
133
  msgstr ""
134
 
@@ -220,77 +220,85 @@ msgstr ""
220
  msgid "Upload multiple files"
221
  msgstr ""
222
 
223
- #: lib/yit-plugin-panel-wc.php:336
 
 
 
 
 
 
 
 
224
  msgid "The changes you have made will be lost if you leave this page."
225
  msgstr ""
226
 
227
- #: lib/yit-plugin-panel.php:63
228
  msgid "Plugin Settings"
229
  msgstr ""
230
 
231
- #: lib/yit-plugin-panel.php:96 lib/yit-plugin-subpanel.php:101
232
- msgid "YIT Plugins"
233
  msgstr ""
234
 
235
- #: lib/yit-plugin-panel.php:288 lib/yit-plugin-subpanel.php:143
236
- #: templates/panel/woocommerce/woocommerce-form.php:5
237
  msgid "Save Changes"
238
  msgstr ""
239
 
240
- #: lib/yit-plugin-panel.php:291 templates/panel/woocommerce/woocommerce-form.php:8
241
  msgid "If you continue with this action, you will reset all options in this page."
242
  msgstr ""
243
 
244
- #: lib/yit-plugin-panel.php:293 lib/yit-plugin-subpanel.php:148
245
  msgid "Reset to default"
246
  msgstr ""
247
 
248
- #: lib/yit-plugin-panel.php:293 lib/yit-plugin-subpanel.php:148
249
- #: templates/panel/woocommerce/woocommerce-form.php:11
250
  msgid "Are you sure?"
251
  msgstr ""
252
 
253
- #: lib/yit-plugin-panel.php:427
254
  msgid "The element you have entered already exists. Please, enter another name."
255
  msgstr ""
256
 
257
- #: lib/yit-plugin-panel.php:428
258
  msgid "Settings saved"
259
  msgstr ""
260
 
261
- #: lib/yit-plugin-panel.php:429
262
  msgid "Settings reset"
263
  msgstr ""
264
 
265
- #: lib/yit-plugin-panel.php:430
266
  msgid "Element deleted correctly."
267
  msgstr ""
268
 
269
- #: lib/yit-plugin-panel.php:431 lib/yit-plugin-panel.php:432
270
  msgid "Element updated correctly."
271
  msgstr ""
272
 
273
- #: lib/yit-plugin-panel.php:433
274
  msgid "Database imported correctly."
275
  msgstr ""
276
 
277
- #: lib/yit-plugin-panel.php:434
278
  msgid "An error has occurred during import. Please try again."
279
  msgstr ""
280
 
281
- #: lib/yit-plugin-panel.php:435
282
  msgid "The added file is not valid."
283
  msgstr ""
284
 
285
- #: lib/yit-plugin-panel.php:436
286
  msgid "Sorry, import is disabled."
287
  msgstr ""
288
 
289
- #: lib/yit-plugin-panel.php:437
290
  msgid "Sorting successful."
291
  msgstr ""
292
 
293
- #: lib/yit-plugin-subpanel.php:146
294
  msgid ""
295
  "If you continue with this action, you will reset all the options in this page."
296
  msgstr ""
@@ -329,46 +337,46 @@ msgid ""
329
  "Plugin tab."
330
  msgstr ""
331
 
332
- #: lib/yit-upgrade.php:123
333
  msgid "There is a new version of %plugin_name% available."
334
  msgstr ""
335
 
336
- #: lib/yit-upgrade.php:124
337
  msgid "View version %latest% details."
338
  msgstr ""
339
 
340
- #: lib/yit-upgrade.php:125
341
  msgid "Automatic update is unavailable for this plugin,"
342
  msgstr ""
343
 
344
- #: lib/yit-upgrade.php:126
345
  msgid "please <a href=\"%activate_link%\">activate</a> your copy of %plugin_name%."
346
  msgstr ""
347
 
348
- #: lib/yit-upgrade.php:127
349
  msgid "Update now."
350
  msgstr ""
351
 
352
- #: lib/yit-upgrade.php:250
353
- msgid "Yithemes Repository"
354
  msgstr ""
355
 
356
- #: lib/yit-upgrade.php:284
357
  msgid "Invalid URL Provided."
358
  msgstr ""
359
 
360
- #: lib/yit-upgrade.php:297
361
  msgid "Could not create Temporary file."
362
  msgstr ""
363
 
364
- #: lib/yit-upgrade.php:439
365
  #, php-format
366
  msgid ""
367
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
368
  "changelog-button\" title=\"%3$s\">View version %4$s details</a>."
369
  msgstr ""
370
 
371
- #: lib/yit-upgrade.php:441
372
  #, php-format
373
  msgid ""
374
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
@@ -377,7 +385,7 @@ msgid ""
377
  "updates.</em>"
378
  msgstr ""
379
 
380
- #: lib/yit-upgrade.php:443
381
  #, php-format
382
  msgid ""
383
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
@@ -386,7 +394,7 @@ msgid ""
386
  "activation\">activate</a> your copy of %6s.</em>"
387
  msgstr ""
388
 
389
- #: lib/yit-upgrade.php:445
390
  #, php-format
391
  msgid ""
392
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
@@ -394,109 +402,113 @@ msgid ""
394
  "\">update now</a>."
395
  msgstr ""
396
 
397
- #: lib/yit-upgrade.php:518
398
  msgid "You can't update the plugins for this site."
399
  msgstr ""
400
 
401
- #: lib/yit-upgrade.php:522
402
  msgid "You do not have sufficient permissions to update the plugins for this site."
403
  msgstr ""
404
 
405
- #: lib/yit-upgrade.php:529
406
  msgid "Update Plugin"
407
  msgstr ""
408
 
409
- #: licence/lib/yit-licence.php:170
410
  #, php-format
411
  msgctxt "%s = field name"
412
  msgid "%s field cannot be empty"
413
  msgstr ""
414
 
415
- #: licence/lib/yit-licence.php:171
416
  #, php-format
417
  msgid "%s and %s fields cannot be empty"
418
  msgstr ""
419
 
420
- #: licence/lib/yit-licence.php:172
421
  msgid "Unable to contact the remote server, please try again later. Thanks!"
422
  msgstr ""
423
 
424
- #: licence/lib/yit-licence.php:173
425
- #: licence/templates/panel/activation/activation-panel.php:89
426
- #: licence/templates/panel/activation/activation-panel.php:164
427
- #: licence/templates/panel/activation/activation-panel.php:195
428
  #: templates/metaboxes/types/contactform.php:148
429
  #: templates/metaboxes/types/contactform.php:340
430
  msgid "Email"
431
  msgstr ""
432
 
433
- #: licence/lib/yit-licence.php:174
434
- #: licence/templates/panel/activation/activation-panel.php:90
435
- #: licence/templates/panel/activation/activation-panel.php:165
436
- #: licence/templates/panel/activation/activation-panel.php:196
437
  msgid "License Key"
438
  msgstr ""
439
 
440
- #: licence/lib/yit-licence.php:175
441
  msgid "Are you sure you want to deactivate the license for current site?"
442
  msgstr ""
443
 
444
- #: licence/lib/yit-licence.php:638
445
  msgid "Invalid Request"
446
  msgstr ""
447
 
448
- #: licence/lib/yit-licence.php:639
449
  msgid "Invalid license key"
450
  msgstr ""
451
 
452
- #: licence/lib/yit-licence.php:640
453
  msgid "Software has been deactivated"
454
  msgstr ""
455
 
456
- #: licence/lib/yit-licence.php:641
457
  msgid "Maximum number of activations exceeded"
458
  msgstr ""
459
 
460
- #: licence/lib/yit-licence.php:642
461
  msgid "Invalid instance ID"
462
  msgstr ""
463
 
464
- #: licence/lib/yit-licence.php:643
465
  msgid "Invalid security key"
466
  msgstr ""
467
 
468
- #: licence/lib/yit-licence.php:644
469
  msgid "License key has expired"
470
  msgstr ""
471
 
472
- #: licence/lib/yit-licence.php:645
473
  msgid "License key has been banned"
474
  msgstr ""
475
 
476
- #: licence/lib/yit-licence.php:646
 
 
 
 
477
  msgid "Great"
478
  msgstr ""
479
 
480
- #: licence/lib/yit-licence.php:646
481
  msgid "License successfully activated"
482
  msgstr ""
483
 
484
- #: licence/lib/yit-licence.php:647
485
  msgid "License key deactivated for website"
486
  msgstr ""
487
 
488
- #: licence/lib/yit-plugin-licence.php:68 licence/lib/yit-plugin-licence.php:69
489
- #: licence/lib/yit-theme-licence.php:70 licence/lib/yit-theme-licence.php:71
490
- #: licence/lib/yit-theme-licence.php:110 licence/lib/yit-theme-licence.php:111
491
  msgid "License Activation"
492
  msgstr ""
493
 
494
- #: licence/lib/yit-theme-licence.php:118 licence/lib/yit-theme-licence.php:119
495
  #, php-format
496
  msgid "%s"
497
  msgstr ""
498
 
499
- #: licence/lib/yit-theme-licence.php:160
500
  msgid ""
501
  "I cannot find the license key for activating the theme I have bought some time "
502
  "ago. Where can I find it?"
@@ -516,83 +528,85 @@ msgid ""
516
  "in section \"My licenses\"."
517
  msgstr ""
518
 
519
- #: licence/templates/panel/activation/activation-panel.php:22
520
  msgid "Yithemes License Activation"
521
  msgstr ""
522
 
523
- #: licence/templates/panel/activation/activation-panel.php:28
524
  msgid ""
525
  "Have you updated your licenses? Have you asked for an extension? Update "
526
  "information concerning your products."
527
  msgstr ""
528
 
529
- #: licence/templates/panel/activation/activation-panel.php:30
530
  msgid "Update license information"
531
  msgstr ""
532
 
533
- #: licence/templates/panel/activation/activation-panel.php:43
534
  msgid "Product to activate"
535
  msgid_plural "Products to activate"
536
  msgstr[0] ""
537
  msgstr[1] ""
538
 
539
- #: licence/templates/panel/activation/activation-panel.php:62
540
  msgid "Activate"
541
  msgstr ""
542
 
543
- #: licence/templates/panel/activation/activation-panel.php:81
544
  msgid "Activated"
545
  msgstr ""
546
 
547
- #: licence/templates/panel/activation/activation-panel.php:87
548
- #: licence/templates/panel/activation/activation-panel.php:162
549
- #: licence/templates/panel/activation/activation-panel.php:192
550
  msgid "Product Name"
551
  msgstr ""
552
 
553
- #: licence/templates/panel/activation/activation-panel.php:93
554
- #: licence/templates/panel/activation/activation-panel.php:199
555
  msgid "Expires"
556
  msgstr ""
557
 
558
- #: licence/templates/panel/activation/activation-panel.php:96
559
  msgid "Remaining"
560
  msgstr ""
561
 
562
  #: licence/templates/panel/activation/activation-panel.php:97
563
- #: licence/templates/panel/activation/activation-panel.php:223
564
  msgid "Membership"
565
  msgstr ""
566
 
567
- #: licence/templates/panel/activation/activation-panel.php:100
568
  msgid "License Actions"
569
  msgstr ""
570
 
571
- #: licence/templates/panel/activation/activation-panel.php:125
572
  #, php-format
573
  msgid "%1s out of %2s"
574
  msgstr ""
575
 
576
- #: licence/templates/panel/activation/activation-panel.php:140
577
  msgid "Deactivate"
578
  msgstr ""
579
 
580
- #: licence/templates/panel/activation/activation-panel.php:145
581
- #: licence/templates/panel/activation/activation-panel.php:202
582
- #: licence/templates/panel/activation/activation-panel.php:223
583
  msgid "Renew"
584
  msgstr ""
585
 
586
- #: licence/templates/panel/activation/activation-panel.php:158
587
  msgid "Banned"
588
  msgstr ""
589
 
590
- #: licence/templates/panel/activation/activation-panel.php:188
591
  msgid "Expired"
592
  msgstr ""
593
 
594
- #: licence/templates/panel/activation/activation-panel.php:223
595
- msgid "License"
 
 
 
 
596
  msgstr ""
597
 
598
  #: templates/metaboxes/types/ajax-products.php:23
@@ -955,6 +969,116 @@ msgstr ""
955
  msgid "Italic bold"
956
  msgstr ""
957
 
958
- #: templates/panel/woocommerce/woocommerce-form.php:11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
959
  msgid "Reset Defaults"
960
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  msgstr ""
6
  "Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
7
  "Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
8
+ "POT-Creation-Date: 2016-05-16 16:37+0200\n"
9
  "PO-Revision-Date: 2015-05-05 10:38+0100\n"
10
  "Last-Translator: \n"
11
  "Language-Team: Your Inspiration Themes <info@yithemes.com>\n"
13
  "MIME-Version: 1.0\n"
14
  "Content-Type: text/plain; charset=utf-8\n"
15
  "Content-Transfer-Encoding: 8bit\n"
16
+ "X-Generator: Poedit 1.8.4\n"
17
  "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
18
  "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
19
  "esc_html_x:1,2c\n"
20
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
21
  "X-Poedit-SourceCharset: UTF-8\n"
22
+ "X-Poedit-Basepath: ..\n"
23
  "X-Textdomain-Support: yes\n"
24
  "X-Poedit-SearchPath-0: .\n"
25
 
128
  msgstr ""
129
 
130
  #: lib/yit-cpt-unlimited.php:1048 lib/yit-cpt-unlimited.php:1196
131
+ #: lib/yit-cpt-unlimited.php:1202 lib/yit-plugin-panel.php:74
132
  msgid "Settings"
133
  msgstr ""
134
 
220
  msgid "Upload multiple files"
221
  msgstr ""
222
 
223
+ #: lib/yit-plugin-panel-sidebar.php:421 templates/panel/sidebar/sidebar.php:3
224
+ msgid "Hide sidebar"
225
+ msgstr ""
226
+
227
+ #: lib/yit-plugin-panel-sidebar.php:422 templates/panel/sidebar/sidebar.php:3
228
+ msgid "Show sidebar"
229
+ msgstr ""
230
+
231
+ #: lib/yit-plugin-panel-wc.php:359
232
  msgid "The changes you have made will be lost if you leave this page."
233
  msgstr ""
234
 
235
+ #: lib/yit-plugin-panel.php:73
236
  msgid "Plugin Settings"
237
  msgstr ""
238
 
239
+ #: lib/yit-plugin-panel.php:293
240
+ msgid "Premium version upgrade"
241
  msgstr ""
242
 
243
+ #: lib/yit-plugin-panel.php:344 lib/yit-plugin-subpanel.php:146
244
+ #: templates/panel/woocommerce/woocommerce-form.php:11
245
  msgid "Save Changes"
246
  msgstr ""
247
 
248
+ #: lib/yit-plugin-panel.php:347 templates/panel/woocommerce/woocommerce-form.php:14
249
  msgid "If you continue with this action, you will reset all options in this page."
250
  msgstr ""
251
 
252
+ #: lib/yit-plugin-panel.php:349 lib/yit-plugin-subpanel.php:151
253
  msgid "Reset to default"
254
  msgstr ""
255
 
256
+ #: lib/yit-plugin-panel.php:349 lib/yit-plugin-subpanel.php:151
257
+ #: templates/panel/woocommerce/woocommerce-form.php:18
258
  msgid "Are you sure?"
259
  msgstr ""
260
 
261
+ #: lib/yit-plugin-panel.php:545
262
  msgid "The element you have entered already exists. Please, enter another name."
263
  msgstr ""
264
 
265
+ #: lib/yit-plugin-panel.php:546
266
  msgid "Settings saved"
267
  msgstr ""
268
 
269
+ #: lib/yit-plugin-panel.php:547
270
  msgid "Settings reset"
271
  msgstr ""
272
 
273
+ #: lib/yit-plugin-panel.php:548
274
  msgid "Element deleted correctly."
275
  msgstr ""
276
 
277
+ #: lib/yit-plugin-panel.php:549 lib/yit-plugin-panel.php:550
278
  msgid "Element updated correctly."
279
  msgstr ""
280
 
281
+ #: lib/yit-plugin-panel.php:551
282
  msgid "Database imported correctly."
283
  msgstr ""
284
 
285
+ #: lib/yit-plugin-panel.php:552
286
  msgid "An error has occurred during import. Please try again."
287
  msgstr ""
288
 
289
+ #: lib/yit-plugin-panel.php:553
290
  msgid "The added file is not valid."
291
  msgstr ""
292
 
293
+ #: lib/yit-plugin-panel.php:554
294
  msgid "Sorry, import is disabled."
295
  msgstr ""
296
 
297
+ #: lib/yit-plugin-panel.php:555
298
  msgid "Sorting successful."
299
  msgstr ""
300
 
301
+ #: lib/yit-plugin-subpanel.php:149
302
  msgid ""
303
  "If you continue with this action, you will reset all the options in this page."
304
  msgstr ""
337
  "Plugin tab."
338
  msgstr ""
339
 
340
+ #: lib/yit-upgrade.php:136
341
  msgid "There is a new version of %plugin_name% available."
342
  msgstr ""
343
 
344
+ #: lib/yit-upgrade.php:137
345
  msgid "View version %latest% details."
346
  msgstr ""
347
 
348
+ #: lib/yit-upgrade.php:138
349
  msgid "Automatic update is unavailable for this plugin,"
350
  msgstr ""
351
 
352
+ #: lib/yit-upgrade.php:139
353
  msgid "please <a href=\"%activate_link%\">activate</a> your copy of %plugin_name%."
354
  msgstr ""
355
 
356
+ #: lib/yit-upgrade.php:140
357
  msgid "Update now."
358
  msgstr ""
359
 
360
+ #: lib/yit-upgrade.php:243
361
+ msgid "YIThemes Repository"
362
  msgstr ""
363
 
364
+ #: lib/yit-upgrade.php:277
365
  msgid "Invalid URL Provided."
366
  msgstr ""
367
 
368
+ #: lib/yit-upgrade.php:290
369
  msgid "Could not create Temporary file."
370
  msgstr ""
371
 
372
+ #: lib/yit-upgrade.php:432
373
  #, php-format
374
  msgid ""
375
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
376
  "changelog-button\" title=\"%3$s\">View version %4$s details</a>."
377
  msgstr ""
378
 
379
+ #: lib/yit-upgrade.php:434
380
  #, php-format
381
  msgid ""
382
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
385
  "updates.</em>"
386
  msgstr ""
387
 
388
+ #: lib/yit-upgrade.php:436
389
  #, php-format
390
  msgid ""
391
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
394
  "activation\">activate</a> your copy of %6s.</em>"
395
  msgstr ""
396
 
397
+ #: lib/yit-upgrade.php:438
398
  #, php-format
399
  msgid ""
400
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
402
  "\">update now</a>."
403
  msgstr ""
404
 
405
+ #: lib/yit-upgrade.php:511
406
  msgid "You can't update the plugins for this site."
407
  msgstr ""
408
 
409
+ #: lib/yit-upgrade.php:515
410
  msgid "You do not have sufficient permissions to update the plugins for this site."
411
  msgstr ""
412
 
413
+ #: lib/yit-upgrade.php:522
414
  msgid "Update Plugin"
415
  msgstr ""
416
 
417
+ #: licence/lib/yit-licence.php:182
418
  #, php-format
419
  msgctxt "%s = field name"
420
  msgid "%s field cannot be empty"
421
  msgstr ""
422
 
423
+ #: licence/lib/yit-licence.php:183
424
  #, php-format
425
  msgid "%s and %s fields cannot be empty"
426
  msgstr ""
427
 
428
+ #: licence/lib/yit-licence.php:184
429
  msgid "Unable to contact the remote server, please try again later. Thanks!"
430
  msgstr ""
431
 
432
+ #: licence/lib/yit-licence.php:185
433
+ #: licence/templates/panel/activation/activation-panel.php:88
434
+ #: licence/templates/panel/activation/activation-panel.php:166
435
+ #: licence/templates/panel/activation/activation-panel.php:197
436
  #: templates/metaboxes/types/contactform.php:148
437
  #: templates/metaboxes/types/contactform.php:340
438
  msgid "Email"
439
  msgstr ""
440
 
441
+ #: licence/lib/yit-licence.php:186
442
+ #: licence/templates/panel/activation/activation-panel.php:89
443
+ #: licence/templates/panel/activation/activation-panel.php:167
444
+ #: licence/templates/panel/activation/activation-panel.php:198
445
  msgid "License Key"
446
  msgstr ""
447
 
448
+ #: licence/lib/yit-licence.php:187
449
  msgid "Are you sure you want to deactivate the license for current site?"
450
  msgstr ""
451
 
452
+ #: licence/lib/yit-licence.php:667
453
  msgid "Invalid Request"
454
  msgstr ""
455
 
456
+ #: licence/lib/yit-licence.php:668
457
  msgid "Invalid license key"
458
  msgstr ""
459
 
460
+ #: licence/lib/yit-licence.php:669
461
  msgid "Software has been deactivated"
462
  msgstr ""
463
 
464
+ #: licence/lib/yit-licence.php:670
465
  msgid "Maximum number of activations exceeded"
466
  msgstr ""
467
 
468
+ #: licence/lib/yit-licence.php:671
469
  msgid "Invalid instance ID"
470
  msgstr ""
471
 
472
+ #: licence/lib/yit-licence.php:672
473
  msgid "Invalid security key"
474
  msgstr ""
475
 
476
+ #: licence/lib/yit-licence.php:673
477
  msgid "License key has expired"
478
  msgstr ""
479
 
480
+ #: licence/lib/yit-licence.php:674
481
  msgid "License key has been banned"
482
  msgstr ""
483
 
484
+ #: licence/lib/yit-licence.php:675
485
+ msgid "Current product is not included with your membership key"
486
+ msgstr ""
487
+
488
+ #: licence/lib/yit-licence.php:676
489
  msgid "Great"
490
  msgstr ""
491
 
492
+ #: licence/lib/yit-licence.php:676
493
  msgid "License successfully activated"
494
  msgstr ""
495
 
496
+ #: licence/lib/yit-licence.php:677
497
  msgid "License key deactivated for website"
498
  msgstr ""
499
 
500
+ #: licence/lib/yit-plugin-licence.php:67 licence/lib/yit-plugin-licence.php:68
501
+ #: licence/lib/yit-theme-licence.php:69 licence/lib/yit-theme-licence.php:70
502
+ #: licence/lib/yit-theme-licence.php:109 licence/lib/yit-theme-licence.php:110
503
  msgid "License Activation"
504
  msgstr ""
505
 
506
+ #: licence/lib/yit-theme-licence.php:117 licence/lib/yit-theme-licence.php:118
507
  #, php-format
508
  msgid "%s"
509
  msgstr ""
510
 
511
+ #: licence/lib/yit-theme-licence.php:159
512
  msgid ""
513
  "I cannot find the license key for activating the theme I have bought some time "
514
  "ago. Where can I find it?"
528
  "in section \"My licenses\"."
529
  msgstr ""
530
 
531
+ #: licence/templates/panel/activation/activation-panel.php:23
532
  msgid "Yithemes License Activation"
533
  msgstr ""
534
 
535
+ #: licence/templates/panel/activation/activation-panel.php:27
536
  msgid ""
537
  "Have you updated your licenses? Have you asked for an extension? Update "
538
  "information concerning your products."
539
  msgstr ""
540
 
541
+ #: licence/templates/panel/activation/activation-panel.php:29
542
  msgid "Update license information"
543
  msgstr ""
544
 
545
+ #: licence/templates/panel/activation/activation-panel.php:42
546
  msgid "Product to activate"
547
  msgid_plural "Products to activate"
548
  msgstr[0] ""
549
  msgstr[1] ""
550
 
551
+ #: licence/templates/panel/activation/activation-panel.php:61
552
  msgid "Activate"
553
  msgstr ""
554
 
555
+ #: licence/templates/panel/activation/activation-panel.php:80
556
  msgid "Activated"
557
  msgstr ""
558
 
559
+ #: licence/templates/panel/activation/activation-panel.php:86
560
+ #: licence/templates/panel/activation/activation-panel.php:164
561
+ #: licence/templates/panel/activation/activation-panel.php:194
562
  msgid "Product Name"
563
  msgstr ""
564
 
565
+ #: licence/templates/panel/activation/activation-panel.php:92
566
+ #: licence/templates/panel/activation/activation-panel.php:201
567
  msgid "Expires"
568
  msgstr ""
569
 
570
+ #: licence/templates/panel/activation/activation-panel.php:95
571
  msgid "Remaining"
572
  msgstr ""
573
 
574
  #: licence/templates/panel/activation/activation-panel.php:97
 
575
  msgid "Membership"
576
  msgstr ""
577
 
578
+ #: licence/templates/panel/activation/activation-panel.php:101
579
  msgid "License Actions"
580
  msgstr ""
581
 
582
+ #: licence/templates/panel/activation/activation-panel.php:126
583
  #, php-format
584
  msgid "%1s out of %2s"
585
  msgstr ""
586
 
587
+ #: licence/templates/panel/activation/activation-panel.php:142
588
  msgid "Deactivate"
589
  msgstr ""
590
 
591
+ #: licence/templates/panel/activation/activation-panel.php:147
592
+ #: licence/templates/panel/activation/activation-panel.php:204
 
593
  msgid "Renew"
594
  msgstr ""
595
 
596
+ #: licence/templates/panel/activation/activation-panel.php:160
597
  msgid "Banned"
598
  msgstr ""
599
 
600
+ #: licence/templates/panel/activation/activation-panel.php:190
601
  msgid "Expired"
602
  msgstr ""
603
 
604
+ #: licence/templates/panel/activation/activation-panel.php:226
605
+ msgid "Order again"
606
+ msgstr ""
607
+
608
+ #: licence/templates/panel/activation/activation-panel.php:228
609
+ msgid "Renew license"
610
  msgstr ""
611
 
612
  #: templates/metaboxes/types/ajax-products.php:23
969
  msgid "Italic bold"
970
  msgstr ""
971
 
972
+ #: templates/panel/sidebar/widgets/widgets.php:17
973
+ msgid "Join the club"
974
+ msgstr ""
975
+
976
+ #: templates/panel/sidebar/widgets/widgets.php:24
977
+ msgid "Despacho Theme - 100% FREE"
978
+ msgstr ""
979
+
980
+ #: templates/panel/sidebar/widgets/widgets.php:28
981
+ msgid "FREE!"
982
+ msgstr ""
983
+
984
+ #: templates/panel/sidebar/widgets/widgets.php:34
985
+ msgid "Important Links"
986
+ msgstr ""
987
+
988
+ #: templates/panel/types/upload.php:32
989
+ msgid "Reset"
990
+ msgstr ""
991
+
992
+ #: templates/panel/woocommerce/woocommerce-form.php:17
993
  msgid "Reset Defaults"
994
  msgstr ""
995
+
996
+ #: templates/upgrade/upgrade-to-pro-version.php:2
997
+ msgid "Upgrade to Premium Version"
998
+ msgstr ""
999
+
1000
+ #: templates/upgrade/upgrade-to-pro-version.php:3
1001
+ msgid ""
1002
+ "Have you purchased the premium version of a plugin? Don't you know how to activate "
1003
+ "the license after the purchase?"
1004
+ msgstr ""
1005
+
1006
+ #: templates/upgrade/upgrade-to-pro-version.php:5
1007
+ msgid ""
1008
+ "To upgrade from a FREE to a PREMIUM plugin is not suffice to insert the license "
1009
+ "key provided after the purchase.\n"
1010
+ " The reason is that they are two distinct products, with significant "
1011
+ "differences both for available options and for number of files included in the "
1012
+ "plugin package.\n"
1013
+ " To start to use the PREMIUM version of the plugin, you simply need to "
1014
+ "download the PREMIUM packet and install it on your site."
1015
+ msgstr ""
1016
+
1017
+ #: templates/upgrade/upgrade-to-pro-version.php:9
1018
+ #, php-format
1019
+ msgid ""
1020
+ "%1$sDo you need to know how to do it?%2$s Easy! %1$sFollow this list of steps%2$s "
1021
+ "and in a few minutes the plugin you purchased will be installed on your site"
1022
+ msgstr ""
1023
+
1024
+ #: templates/upgrade/upgrade-to-pro-version.php:12
1025
+ msgid "Go to yithemes.com and login to \"My Account\" page"
1026
+ msgstr ""
1027
+
1028
+ #: templates/upgrade/upgrade-to-pro-version.php:18
1029
+ msgid ""
1030
+ "From the menu on the left, click on \"My Downloads\", look for the plugin you want "
1031
+ "to install among the available downloads and click on \"Download\" button"
1032
+ msgstr ""
1033
+
1034
+ #: templates/upgrade/upgrade-to-pro-version.php:24
1035
+ msgid ""
1036
+ "After downloading the packet, go to your website and login to WordPress "
1037
+ "administration area."
1038
+ msgstr ""
1039
+
1040
+ #: templates/upgrade/upgrade-to-pro-version.php:30
1041
+ msgid ""
1042
+ "From the menu on the left, click on \"Plugins\". You will be redirected to the "
1043
+ "page where you will find the complete list of all the plugins available on your "
1044
+ "site. Click on \"Add New\" button that you find above on the left to add a new "
1045
+ "plugin"
1046
+ msgstr ""
1047
+
1048
+ #: templates/upgrade/upgrade-to-pro-version.php:36
1049
+ msgid ""
1050
+ "You will be redirected to a new page where you will find, above on the left next "
1051
+ "to the page title, the \"Upload Plugin\" button."
1052
+ msgstr ""
1053
+
1054
+ #: templates/upgrade/upgrade-to-pro-version.php:42
1055
+ msgid ""
1056
+ "Click on \"Upload Plugins\" button to start the upload of the PREMIUM version of "
1057
+ "the plugin previously downloaded. Click on \"Select File\", search for the "
1058
+ "download folder related to the plugin and upload the package. Now you only need to "
1059
+ "wait a few minutes for the upload and the installation on your site. (We used YITH "
1060
+ "Live Chat plugin by way of example)"
1061
+ msgstr ""
1062
+
1063
+ #: templates/upgrade/upgrade-to-pro-version.php:48
1064
+ msgid "After completing the installation, click on \"Activate plugin\""
1065
+ msgstr ""
1066
+
1067
+ #: templates/upgrade/upgrade-to-pro-version.php:52
1068
+ msgid ""
1069
+ "If everything worked allright, your plugin is now correctly installed on your "
1070
+ "website. Enjoy it :-)"
1071
+ msgstr ""
1072
+
1073
+ #: templates/upgrade/upgrade-to-pro-version.php:55
1074
+ msgid ""
1075
+ "The last step is the activation of the plugin through its license key you received "
1076
+ "after the purchase. Click on \"License Activation\" that you find in \"YITH Plugins"
1077
+ "\" and insert the license key and the email address you used during the purchase."
1078
+ msgstr ""
1079
+
1080
+ #: templates/upgrade/upgrade-to-pro-version.php:61
1081
+ msgid ""
1082
+ "In case you had difficulty to recover the license key we sent you by email, you "
1083
+ "can easily find it in \"My Licenses\" section of your account on yithemes.com"
1084
+ msgstr ""
plugin-fw/lib/yit-ajax.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( !class_exists( 'YIT_Ajax' ) ) {
16
+ /**
17
+ * YIT Ajax
18
+ *
19
+ * @class YIT_Ajax
20
+ * @package Yithemes
21
+ * @since 1.0
22
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
23
+ */
24
+ class YIT_Ajax {
25
+ /**
26
+ * @var string version of class
27
+ */
28
+ public $version = '1.0.0';
29
+
30
+ /**
31
+ * @var object The single instance of the class
32
+ * @since 1.0
33
+ */
34
+ protected static $_instance = null;
35
+
36
+ /**
37
+ * Constructor
38
+ *
39
+ * @since 1.0
40
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
41
+ */
42
+ private function __construct() {
43
+ add_action( 'wp_ajax_yith_plugin_panel_sidebar_set_collapse_option', array( $this, 'set_ajax_sidebar_collapse_option' ) );
44
+ }
45
+
46
+ /**
47
+ * get single instance
48
+ *
49
+ * @static
50
+ * @return YIT_Ajax
51
+ *
52
+ * @since 1.0
53
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
54
+ */
55
+ public static function instance() {
56
+ if ( is_null( self::$_instance ) ) {
57
+ self::$_instance = new self();
58
+ }
59
+
60
+ return self::$_instance;
61
+ }
62
+
63
+ /**
64
+ * Set Sidebar collapse option [AJAX]
65
+ */
66
+ public function set_ajax_sidebar_collapse_option() {
67
+ if ( isset( $_REQUEST[ 'option' ] ) ) {
68
+ $option = $_REQUEST[ 'option' ];
69
+ update_option( YIT_Plugin_Panel_Sidebar::$collapse_option, $option );
70
+ }
71
+ die();
72
+ }
73
+ }
74
+ }
75
+
76
+ YIT_Ajax::instance();
plugin-fw/lib/yit-cpt-unlimited.php CHANGED
@@ -1,1775 +1,1775 @@
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
- if (!defined('ABSPATH')) {exit('Direct access forbidden.');
11
- }
12
-
13
- /**
14
- * Manage the custom post types as Portfolio, Contact Forms and similar (called CPTU)
15
- *
16
- * @class YIT_CPT_Unlimited
17
- * @package Yithemes
18
- * @since 2.0.0
19
- * @author Your Inspiration Themes
20
- *
21
- */
22
-
23
- class YIT_CPT_Unlimited {
24
-
25
- /**
26
- * @var string The name of main post type of CPTU
27
- * @since 1.0
28
- */
29
- protected $_name = '';
30
-
31
- /**
32
- * @var string The prefix of each post type created by the post of main CPTU
33
- * @since 1.0
34
- */
35
- protected $_prefix_cpt = '';
36
-
37
- /**
38
- * @var string The labels defined for the main CPTU
39
- * @since 1.0
40
- */
41
- protected $_labels = '';
42
-
43
- /**
44
- * @var string The configuration arguments of post type
45
- * @since 1.0
46
- */
47
- protected $_args = '';
48
-
49
- /**
50
- * @var array All post types created by the post of main CPTU
51
- * @since 1.0
52
- */
53
- public $post_types = array();
54
-
55
- /**
56
- * @var array $layouts Array with all portfolio layouts available for this site
57
- * @since 1.0
58
- */
59
- public $layouts = array();
60
-
61
- /**
62
- * @var string $template_path The pathname of template folder
63
- * @since 1.0
64
- */
65
- protected $template_path = '';
66
-
67
- /**
68
- * @var string $template_url The URL of template folder
69
- * @since 1.0
70
- */
71
- protected $template_url = '';
72
-
73
- /**
74
- * @var int $_index Unique sequential ID to differentiate same shortcodes in the same page
75
- */
76
- public $index = 0;
77
-
78
- /**
79
- * @var string $_layout Temporary attribute to load automatically the settings for each layout
80
- * @since 1.0
81
- */
82
- private $_layout = '';
83
-
84
-
85
- /**
86
- * Constructor
87
- *
88
- * Accept an array of arguments to define the characteristics of CPTU to register.
89
- *
90
- * @since 1.0
91
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
92
- */
93
- public function __construct( $args = array() ) {
94
-
95
- $defaults = array(
96
- 'name' => '',
97
- 'post_type_prefix' => '',
98
- 'labels' => array(
99
- 'main_name' => '',
100
- 'singular' => '',
101
- 'plural' => '',
102
- 'menu' => ''
103
- ),
104
- 'manage_layouts' => false,
105
- 'add_multiuploader' => false,
106
- 'sortable' => false,
107
- 'has_single' => false,
108
- 'has_taxonomy' => false,
109
- 'label_item_sing' => '',
110
- 'label_item_plur' => '',
111
- 'shortcode_name' => '',
112
- 'shortcode_icon' => '', // URL or icon name from http://melchoyce.github.io/dashicons/
113
- 'layout_option' => '_type' // the option ID of layout metabox
114
- );
115
- $this->_args = wp_parse_args( $args, $defaults );
116
-
117
- // fix labels
118
- if ( empty( $this->_args['labels']['main_name'] ) ) {
119
- $this->_args['labels']['main_name'] = $this->_args['labels']['singular'];
120
- }
121
- if ( empty( $this->_args['labels']['menu'] ) ) {
122
- $this->_args['labels']['menu'] = $this->_args['labels']['singular'];
123
- }
124
-
125
- /* populate */
126
- $this->_name = $this->_args['name'];
127
- $this->_prefix_cpt = $this->_args['post_type_prefix'];
128
- $this->_labels = $this->_args['labels'];
129
-
130
- add_action( 'init', array( $this, 'register_post_type' ) );
131
- add_action( 'init', array( $this, 'register_cptu_post_types' ) );
132
-
133
- add_action( 'save_post', array( $this, 'rewrite_flush') );
134
-
135
- // admin interface
136
- add_action( 'admin_head', array( $this, 'add_cptu_menu_item' ) );
137
- add_action( 'admin_init', array( $this, 'add_quick_links_metaboxes' ) );
138
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_assets' ) );
139
-
140
- // metaboxes
141
- add_action( 'after_setup_theme', array( $this, 'add_metabox_cptu' ), 2 );
142
- add_action( 'after_setup_theme', array( $this, 'add_metabox_item_fields' ), 2 );
143
-
144
- // multiuploader
145
- if ( $this->_args['add_multiuploader'] ) {
146
- add_action( 'admin_footer', array( $this, 'add_button_multiuploader' ) );
147
- add_action( 'wp_ajax_yit_cptu_multiuploader', array( $this, 'post_multiuploader' ) );
148
- }
149
-
150
- // layouts
151
- if ( $this->_args['manage_layouts'] ) {
152
- // get all layouts available
153
- $this->get_layouts();
154
- }
155
-
156
- // single layout
157
- if ( $this->_args['has_single'] ) {
158
- add_action( 'yit_loop', array( $this, 'single_template' ) );
159
- add_action( 'wp', array( $this, 'single_template_config' ) );
160
-
161
- if ( defined('DOING_AJAX') && DOING_AJAX ) {
162
- add_action( 'init', array( $this, 'single_template_config' ) );
163
- }
164
- }
165
-
166
- // archive template
167
- add_action( 'wp', array( $this, 'archive_template' ) );
168
-
169
- // enqueue the assets of each layout
170
- add_action( 'wp_enqueue_scripts', array( $this, 'frontend_assets' ) );
171
-
172
- // add the shortcode, used to show the frontend
173
- if ( ! empty( $this->_args['shortcode_name'] ) ) {
174
- add_shortcode( $this->_args['shortcode_name'], array( &$this, 'add_shortcode' ) );
175
- add_filter( 'yit_shortcode_' . $this->_args['shortcode_name'] . '_icon', array( $this, 'shortcode_icon') );
176
- add_filter( 'yit-shortcode-plugin-init', array( $this, 'add_shortcode_to_box' ) );
177
- }
178
-
179
- // add sortable feature
180
- if ( $this->_args['sortable'] ) {
181
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_sortable_assets' ) );
182
- add_action( 'wp_ajax_cpt_sort_posts', array( $this, 'sort_posts' ) );
183
- add_action( 'admin_init', array( $this, 'init_menu_order' ) );
184
- add_filter( 'pre_get_posts', array( $this, 'filter_active' ) );
185
- add_filter( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
186
- add_filter( 'get_next_post_where', array( $this, 'sorted_next_post_where' ) );
187
- add_filter( 'get_previous_post_where', array( $this, 'sorted_prev_post_where' ) );
188
- add_filter( 'get_next_post_sort', array( $this, 'sorted_next_post_sort' ) );
189
- add_filter( 'get_previous_post_sort', array( $this, 'sorted_prev_post_sort' ) );
190
- }
191
-
192
- // add default columns to post type table list
193
- add_filter( 'manage_edit-' . $this->_name . '_columns', array( $this, 'cptu_define_columns' ) );
194
- add_action( 'manage_' . $this->_name . '_posts_custom_column' , array( $this, 'cptu_change_columns' ), 10, 2 );
195
-
196
- // add required post type for wordpress importer
197
- add_filter( 'wp_import_post_data_raw', array( $this, 'add_importer_required_post_type' ) );
198
- add_filter( 'wp_import_terms', array( $this, 'add_importer_required_taxonomy' ) );
199
- add_action( 'wp_import_set_post_terms', array( $this, 'recount_terms_post' ), 10, 3 );
200
-
201
- }
202
-
203
- /**
204
- * Enqueue the assets for the sortable feature
205
- *
206
- * @return void
207
- * @since 1.0
208
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
209
- */
210
- public function admin_sortable_assets() {
211
- global $post;
212
-
213
- if ( ! isset( $post->post_type ) || ! $this->_is_valid( $post->post_type ) ) {
214
- return;
215
- }
216
-
217
- wp_enqueue_script( 'yit-cptu-sortable-posts', YIT_CORE_PLUGIN_URL . '/assets/js/yit-cptu-sortable-posts.js', array( 'jquery', 'jquery-ui-sortable' ), '1.0', true );
218
- }
219
-
220
- public function init_menu_order( $post_types = array() ) {
221
- global $wpdb;
222
-
223
- if ( empty( $post_types ) ) {
224
- $post_types = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT post_type FROM $wpdb->posts WHERE post_type LIKE %s", str_replace( '_', '\_', $this->_prefix_cpt ) . '%' ) );
225
- } elseif ( ! is_array( $post_types ) ) {
226
- $post_types = array( $post_types );
227
- }
228
-
229
- foreach ( $post_types as $post_type ) {
230
- $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = '{$post_type}' AND post_status IN ('publish', 'pending', 'draft', 'private', 'future') AND menu_order = 0" );
231
-
232
- if ( empty( $count ) ) {
233
- continue;
234
- }
235
-
236
- $sql = "SELECT ID
237
- FROM $wpdb->posts
238
- WHERE post_type = '" . $post_type . "'
239
- AND post_status IN ('publish', 'pending', 'draft', 'private', 'future')
240
- ORDER BY post_date DESC
241
- ";
242
-
243
- $results = $wpdb->get_results( $sql );
244
-
245
- foreach ( $results as $key => $result ) {
246
- $wpdb->update( $wpdb->posts, array( 'menu_order' => $key + 1 ), array( 'ID' => $result->ID ) );
247
- }
248
- }
249
- }
250
-
251
- /**
252
- * Save the order of posts from sortable feature
253
- *
254
- * @return void
255
- * @since 1.0
256
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
257
- */
258
- public function sort_posts() {
259
- global $wpdb;
260
-
261
- parse_str( $_REQUEST['order'], $data );
262
-
263
- if ( is_array( $data ) ) {
264
- //$this->init_menu_order( $_REQUEST['post_type'] );
265
-
266
- $id_arr = array( );
267
- foreach ( $data as $key => $values ) {
268
- foreach ( $values as $position => $id ) {
269
- $id_arr[] = $id;
270
- }
271
- }
272
-
273
-
274
- $menu_order_arr = array( );
275
- foreach ( $id_arr as $key => $id ) {
276
- $results = $wpdb->get_results( "SELECT menu_order FROM $wpdb->posts WHERE ID = " . $id );
277
- foreach ( $results as $result ) {
278
- $menu_order_arr[] = $result->menu_order;
279
- }
280
- }
281
-
282
- sort( $menu_order_arr );
283
-
284
- foreach ( $data as $key => $values ) {
285
- foreach ( $values as $position => $id ) {
286
- $wpdb->update( $wpdb->posts, array( 'menu_order' => $menu_order_arr[$position] ), array( 'ID' => $id ) );
287
- }
288
- }
289
- }
290
-
291
- die();
292
- }
293
-
294
- public function filter_active( $wp_query ) {
295
- if ( is_admin() && isset( $wp_query->query['suppress_filters'] ) )
296
- $wp_query->query['suppress_filters'] = false;
297
- if ( is_admin() && isset( $wp_query->query_vars['suppress_filters'] ) )
298
- $wp_query->query_vars['suppress_filters'] = false;
299
- return $wp_query;
300
- }
301
-
302
- public function pre_get_posts( $wp_query ) {
303
- if ( is_admin() && !defined( 'DOING_AJAX' ) ) {
304
- if ( isset( $wp_query->query['post_type'] ) ) {
305
- $post_types = (array) $wp_query->query['post_type'];
306
- foreach ( $post_types as $post_type ) {
307
- if ( $this->_is_valid( $post_type ) ) {
308
- $wp_query->set( 'orderby', 'menu_order' );
309
- $wp_query->set( 'order', 'ASC' );
310
- }
311
- }
312
- }
313
-
314
- } else {
315
-
316
- $active = false;
317
-
318
- if ( isset( $wp_query->query['suppress_filters'] ) || isset( $wp_query->query['post_type'] ) ) {
319
- $post_types = (array) $wp_query->query['post_type'];
320
- foreach ( $post_types as $post_type ) {
321
- if ( $this->_is_valid( $post_type ) ) {
322
- $active = true;
323
- }
324
- }
325
- }
326
-
327
- if ( $active ) {
328
- if ( !isset( $wp_query->query['orderby'] ) || $wp_query->query['orderby'] == 'post_date' )
329
- $wp_query->set( 'orderby', 'menu_order' );
330
- if ( !isset( $wp_query->query['order'] ) || $wp_query->query['order'] == 'DESC' )
331
- $wp_query->set( 'order', 'ASC' );
332
- }
333
- }
334
- }
335
-
336
- /**
337
- * Filters where clause for get next post
338
- *
339
- * @param $where
340
- *
341
- * @return string
342
- * @since 1.0
343
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
344
- */
345
- public function sorted_next_post_where( $where ){
346
- global $post;
347
- if( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ){
348
- $post = get_post( intval( $_REQUEST['post_id'] ) );
349
- }
350
- else{
351
- $post = get_post();
352
- }
353
-
354
- if( ! $post || ! $this->_is_valid( $post->post_type ) ){
355
- return $where;
356
- }
357
-
358
- $result = str_replace( "'" . $post->post_date . "'", $post->menu_order, $where );
359
- $result = str_replace( 'p.post_date', 'p.menu_order', $result );
360
-
361
- return $result;
362
- }
363
-
364
- /**
365
- * Filters where clause for get prev post
366
- *
367
- * @param $where
368
- *
369
- * @return string
370
- * @since 1.0
371
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
372
- */
373
- public function sorted_prev_post_where( $where ){
374
- global $post;
375
-
376
- if( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ){
377
- $post = get_post( intval( $_REQUEST['post_id'] ) );
378
- }
379
- else{
380
- $post = get_post();
381
- }
382
-
383
- if( ! $post || ! $this->_is_valid( $post->post_type ) ){
384
- return $where;
385
- }
386
-
387
- $result = str_replace( "'" . $post->post_date . "'", $post->menu_order, $where );
388
- $result = str_replace( 'p.post_date', 'p.menu_order', $result );
389
-
390
- return $result;
391
- }
392
-
393
- /**
394
- * Filters sort clause for get next post
395
- *
396
- * @param $sort
397
- *
398
- * @return string
399
- * @since 1.0
400
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
401
- */
402
- public function sorted_next_post_sort( $sort ){
403
- global $post;
404
-
405
- if( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ){
406
- $post = get_post( intval( $_REQUEST['post_id'] ) );
407
- }
408
- else{
409
- $post = get_post();
410
- }
411
-
412
- if( ! $post || ! $this->_is_valid( $post->post_type ) ){
413
- return $sort;
414
- }
415
-
416
- $result = str_replace( 'p.post_date', 'p.menu_order', $sort );
417
- return $result;
418
- }
419
-
420
- /**
421
- * Filters sort clause for get prev post
422
- *
423
- * @param $sort
424
- *
425
- * @return string
426
- * @since 1.0
427
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
428
- */
429
- public function sorted_prev_post_sort( $sort ){
430
- global $post;
431
-
432
- if( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ){
433
- $post = get_post( intval( $_REQUEST['post_id'] ) );
434
- }
435
- else{
436
- $post = get_post();
437
- }
438
-
439
- if( ! $post || ! $this->_is_valid( $post->post_type ) ){
440
- return $sort;
441
- }
442
-
443
- $result = str_replace( 'p.post_date', 'p.menu_order', $sort );
444
- return $result;
445
- }
446
-
447
- /**
448
- * Register post type
449
- *
450
- * Register the post type for the creation of portfolios
451
- *
452
- * @return void
453
- * @since 1.0
454
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
455
- */
456
- public function register_post_type() {
457
- $labels = array(
458
- 'name' => ucfirst( $this->_labels['main_name'] ),
459
- 'singular_name' => ucfirst( $this->_labels['singular'] ),
460
- 'add_new' => sprintf( __( 'Add %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ),
461
- 'add_new_item' => sprintf( __( 'Add New %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ),
462
- 'edit_item' => sprintf( __( 'Edit %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ),
463
- 'new_item' => sprintf( __( 'New %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ),
464
- 'all_items' => sprintf( __( 'All %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['plural'] ) ),
465
- 'view_item' => sprintf( __( 'View %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ),
466
- 'search_items' => sprintf( __( 'Search %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['plural'] ) ),
467
- 'not_found' => sprintf( __( 'No %s found', 'yith-plugin-fw' ), ucfirst( $this->_labels['plural'] ) ),
468
- 'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'yith-plugin-fw' ), ucfirst( $this->_labels['plural'] ) ),
469
- 'parent_item_colon' => '',
470
- 'menu_name' => ucfirst( $this->_labels['menu'] )
471
- );
472
-
473
- $args = array(
474
- 'labels' => apply_filters( 'yit_' . $this->_name . '_labels', $labels ),
475
- 'public' => false,
476
- 'publicly_queryable' => false,
477
- 'show_ui' => true,
478
- 'show_in_menu' => true,
479
- 'query_var' => false,
480
- 'capability_type' => 'post',
481
- 'hierarchical' => false,
482
- 'menu_position' => null,
483
- 'supports' => array( 'title' )
484
- );
485
-
486
- if ( ! empty( $this->_args['menu_icon'] ) ) {
487
- $args['menu_icon'] = $this->_args['menu_icon'];
488
- }
489
-
490
- register_post_type( $this->_name, apply_filters( 'yit_' . $this->_name . '_args', $args ) );
491
- }
492
-
493
- /**
494
- * Retrieve the values configured inside the custom post type
495
- *
496
- * @param $post /WP_Query The post where get the arguments configured in the cpt
497
- *
498
- * @return array
499
- * @since 1.0
500
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
501
- */
502
- protected function _cpt_args( $post ) {
503
- if ( ! isset( $post->ID ) ) {
504
- return;
505
- }
506
-
507
- $args = apply_filters( 'yit_cptu_register_post_type_args', array(
508
- 'layout' => get_post_meta( $post->ID, $this->_args['layout_option'], true ),
509
- 'rewrite' => get_post_meta( $post->ID, '_rewrite', true ),
510
- 'label_singular' => ! empty( $this->_args['label_item_sing'] ) ? $this->_args['label_item_sing'] : get_post_meta( $post->ID, '_label_singular', true ),
511
- 'label_plural' => ! empty( $this->_args['label_item_plur'] ) ? $this->_args['label_item_plur'] : get_post_meta( $post->ID, '_label_plural', true ),
512
- 'taxonomy' => get_post_meta( $post->ID, '_taxonomy', true ),
513
- 'taxonomy_rewrite' => get_post_meta( $post->ID, '_taxonomy_rewrite', true ),
514
- ), $this->_name, $post );
515
-
516
- $title = $post->post_title;
517
-
518
- if ( empty( $args['label_singular'] ) ) {
519
- $args['label_singular'] = $title;
520
- }
521
-
522
- if ( empty( $args['label_plural'] ) ) {
523
- $args['label_plural'] = $title;
524
- }
525
-
526
- return $args;
527
- }
528
-
529
- /**
530
- * Retrieve the post types created for this CPTU
531
- *
532
- * @return array The link changed
533
- * @since 1.0
534
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
535
- */
536
- public function get_post_types() {
537
- if ( ! empty( $this->post_types ) ) {
538
- return $this->post_types;
539
- }
540
-
541
- $args = array(
542
- 'post_type' => $this->_name,
543
- 'posts_per_page' => -1,
544
- 'post_status' => 'publish'
545
- );
546
- $this->post_types = get_posts( $args );
547
-
548
- return $this->post_types;
549
- }
550
-
551
- /**
552
- * Register portfolio post types
553
- *
554
- * Register the post types for each portfolio created by admin
555
- *
556
- * @return void
557
- * @since 1.0
558
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
559
- */
560
- public function register_cptu_post_types() {
561
- $post_types = $this->get_post_types();
562
- $pts = array();
563
-
564
- foreach ( $post_types as $pt ) {
565
-
566
- extract( $this->_cpt_args( $pt ) );
567
-
568
- $name = $pt->post_name;
569
- $title = $pt->post_title;
570
-
571
- $labels = array(
572
- 'name' => $title,
573
- 'singular_name' => $label_singular,
574
- 'add_new' => sprintf( __( 'Add %s', 'yith-plugin-fw' ), $label_singular ),
575
- 'add_new_item' => sprintf( __( 'Add New %s', 'yith-plugin-fw' ), $label_singular ),
576
- 'edit_item' => sprintf( __( 'Edit %s', 'yith-plugin-fw' ), $label_singular ),
577
- 'new_item' => sprintf( __( 'New %s', 'yith-plugin-fw' ), $label_singular ),
578
- 'all_items' => sprintf( __( 'All %s', 'yith-plugin-fw' ), $label_plural ),
579
- 'view_item' => sprintf( __( 'View %s', 'yith-plugin-fw' ), $label_singular ),
580
- 'search_items' => sprintf( __( 'Search %s', 'yith-plugin-fw' ), $label_plural ),
581
- 'not_found' => sprintf( __( 'No %s found', 'yith-plugin-fw' ), $label_plural ),
582
- 'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'yith-plugin-fw' ), $label_plural ),
583
- 'parent_item_colon' => '',
584
- 'menu_name' => $title
585
- );
586
-
587
- $args = array(
588
- 'labels' => apply_filters( 'yit_' . $this->_prefix_cpt . $name . '_labels', $labels ),
589
- 'public' => true,
590
- 'publicly_queryable' => true,
591
- 'show_ui' => true,
592
- 'show_in_menu' => false,
593
- 'query_var' => true,
594
- 'capability_type' => 'post',
595
- 'hierarchical' => false,
596
- 'menu_position' => null,
597
- 'supports' => array( 'title', 'editor', 'thumbnail' )
598
- );
599
-
600
- if ( ! $this->_args['has_single'] ) {
601
- $args['public'] = false;
602
- $args['publicly_queryable'] = false;
603
- $args['query_var'] = false;
604
- }
605
-
606
- if ( $this->_args['manage_layouts'] && isset($this->layouts[ $layout ]) && ! $this->layouts[ $layout ]['support']['description'] ) {
607
- unset( $args['supports'][1] ); // remove 'editor'
608
- }
609
-
610
- if ( ! empty( $rewrite ) ) {
611
- $args['rewrite'] = array( 'slug' => $rewrite );
612
- }
613
-
614
- // register post type
615
- $post_type = yit_avoid_duplicate( str_replace( '-', '_', substr( $this->_prefix_cpt . $name, 0, 16) ), $post_types );
616
- register_post_type( $post_type, apply_filters( 'yit_' . $this->_prefix_cpt . $name . '_args', $args, $pt ) ); // save the post type in post meta
617
-
618
- update_post_meta( $pt->ID, '_post_type', $post_type );
619
- $pts[] = $post_type;
620
-
621
- // register taxonomy
622
- if ( $this->_args['has_taxonomy'] && ! empty( $taxonomy ) ) {
623
-
624
- $labels = array(
625
- 'name' => sprintf( _x( '%s Categories', 'taxonomy general name', 'yith-plugin-fw' ), $label_singular ),
626
- 'singular_name' => _x( 'Category', 'taxonomy singular name', 'yith-plugin-fw' ),
627
- 'search_items' => __( 'Search Categories', 'yith-plugin-fw' ),
628
- 'all_items' => __( 'All Categories', 'yith-plugin-fw' ),
629
- 'parent_item' => __( 'Parent Category', 'yith-plugin-fw' ),
630
- 'parent_item_colon' => __( 'Parent Category:', 'yith-plugin-fw' ),
631
- 'edit_item' => __( 'Edit Category', 'yith-plugin-fw' ),
632
- 'update_item' => __( 'Update Category', 'yith-plugin-fw' ),
633
- 'add_new_item' => __( 'Add New Category', 'yith-plugin-fw' ),
634
- 'new_item_name' => __( 'New Category Name', 'yith-plugin-fw' ),
635
- 'menu_name' => __( 'Category', 'yith-plugin-fw' ),
636
- );
637
-
638
- $args = array(
639
- 'hierarchical' => true,
640
- 'labels' => $labels,
641
- 'show_ui' => true,
642
- 'show_admin_column' => true,
643
- 'query_var' => true,
644
- );
645
-
646
- if ( ! empty( $taxonomy_rewrite ) ) {
647
- $args['rewrite'] = array( 'slug' => $taxonomy_rewrite );
648
- }
649
-
650
- register_taxonomy( substr( $taxonomy, 0, 32 ), $post_type, $args );
651
-
652
- }
653
-
654
- }
655
-
656
- wp_cache_set( 'yit_cptu_post_types', $post_types );
657
- }
658
-
659
- /**
660
- * Flush Rewrite Rules
661
- *
662
- * rewrite rules when a cpt unlimited is saved
663
- *
664
- * @return void
665
- * @since 1.0
666
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
667
- */
668
-
669
- public function rewrite_flush( $post ){
670
-
671
- if ( isset( $post ) && $this->_is_valid( get_post_type( intval( $post ) ) ) ) {
672
- flush_rewrite_rules();
673
- }
674
-
675
- }
676
-
677
- /**
678
- * Add the item for each portfolio under "Portfolios"
679
- *
680
- * @return void
681
- * @since 1.0
682
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
683
- */
684
- public function add_cptu_menu_item() {
685
- global $submenu, $post, $parent_file, $pagenow;
686
-
687
- // get current post type
688
- if ( isset( $post->post_type ) ) {
689
- $post_type = $post->post_type;
690
- } else if ( isset( $_REQUEST['post_type'] ) ) {
691
- $post_type = $_REQUEST['post_type'];
692
- } else {
693
- return;
694
- }
695
-
696
- $item = 'edit.php?post_type=' . $this->_name;
697
-
698
- // add new items
699
- if ( strpos( $post_type, $this->_prefix_cpt ) !== false ) {
700
- global $wpdb;
701
- $portfolio = $wpdb->get_row( $wpdb->prepare( "SELECT p.* FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %s AND p.post_type = %s", '_post_type', $post_type, $this->_name ) );
702
-
703
- if ( ! isset( $portfolio->ID ) ) {
704
- return;
705
- }
706
-
707
- $label_singular = ! empty( $this->_args['label_item_sing'] ) ? $this->_args['label_item_sing'] : get_post_meta( $portfolio->ID, '_label_singular', true );
708
- $label_plural = ! empty( $this->_args['label_item_plur'] ) ? $this->_args['label_item_plur'] : get_post_meta( $portfolio->ID, '_label_plural', true );
709
-
710
- if ( empty( $label_plural ) ) {
711
- $label_plural = $portfolio->post_title;
712
- }
713
-
714
- if ( empty( $label_singular ) ) {
715
- $label_singular = $portfolio->post_title;
716
- }
717
-
718
- $submenu[ $item ][15] = array( ucfirst( $label_plural ), 'edit_posts', 'edit.php?post_type=' . $post_type );
719
- $submenu[ $item ][20] = array( sprintf( __('Add %s', 'yith-plugin-fw'), ucfirst( $label_singular ) ), 'edit_posts', 'post-new.php?post_type=' . $post_type );
720
-
721
- global $wp_taxonomies;
722
- $taxonomy = get_post_meta( $portfolio->ID, '_taxonomy', true );
723
- if ( isset( $wp_taxonomies[ $taxonomy ] ) ) {
724
- $submenu[ $item ][25] = array( __('Categories', 'yith-plugin-fw'), 'edit_posts', 'edit-tags.php?taxonomy=' . $taxonomy . '&post_type=' . $post_type );
725
- }
726
- }
727
-
728
- // set the parent item inside the single of each post type
729
- if ( $pagenow == 'post.php' && isset( $_GET['post'] ) && $this->_is_valid( get_post_type( intval( $_GET['post'] ) ) ) ) {
730
- $parent_file = 'edit.php?post_type=' . $this->_name;
731
- }
732
- }
733
-
734
- /**
735
- * Locate folder of CPTU templates, if there isn't a layouts management
736
- *
737
- * @return string
738
- * @since 1.0
739
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
740
- */
741
- public function template_path() {
742
- if ( ! empty( $this->template_path ) ) {
743
- return $this->template_path;
744
- }
745
-
746
- // paths
747
- $stylesheet_path_1 = get_stylesheet_directory() . '/theme/templates/' . $this->_name . '/';
748
- $stylesheet_path_2 = get_template_directory() . '/theme/templates/' . $this->_name . '/';
749
- $template_path_1 = get_stylesheet_directory() . '/' . $this->_name . '/';
750
- $template_path_2 = get_template_directory() . '/' . $this->_name . '/';
751
- $plugin_path = $this->_args['plugin_path'] . '/templates/';
752
-
753
- foreach ( array( 'stylesheet_path_1', 'stylesheet_path_2', 'template_path_1', 'template_path_2', 'plugin_path' ) as $var ) {
754
- $path = ${$var};
755
-
756
- if ( file_exists( $path ) ) {
757
- $this->template_path = $path;
758
- }
759
- }
760
-
761
- return $this->template_path;
762
- }
763
-
764
- /**
765
- * Locate folder of CPTU templates, if there isn't a layouts management
766
- *
767
- * @return string
768
- * @since 1.0
769
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
770
- */
771
- public function template_url() {
772
- if ( ! empty( $this->template_url ) ) {
773
- return $this->template_path;
774
- }
775
-
776
- $this->template_url = str_replace( array(
777
- get_stylesheet_directory(),
778
- get_template_directory(),
779
- $this->_args['plugin_path']
780
- ), array(
781
- get_stylesheet_directory_uri(),
782
- get_template_directory_uri(),
783
- $this->_args['plugin_url']
784
- ), $this->template_path() );
785
-
786
- return $this->template_url;
787
- }
788
-
789
- /**
790
- * Retrieve all layouts to manage by custom post type added in the site in this order:
791
- * 1. Child theme (if exists)
792
- * 2. Theme
793
- * 3. Plugin
794
- *
795
- * It also load the config.php file of each layout
796
- *
797
- * @return void
798
- * @since 1.0
799
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
800
- */
801
- public function get_layouts() {
802
-
803
- // paths
804
- $stylesheet_path_1 = get_stylesheet_directory() . '/theme/templates/' . $this->_name . '/';
805
- $stylesheet_path_2 = get_template_directory() . '/theme/templates/' . $this->_name . '/';
806
- $template_path_1 = get_stylesheet_directory() . '/' . $this->_name . '/';
807
- $template_path_2 = get_template_directory() . '/' . $this->_name . '/';
808
- $plugin_path = $this->_args['plugin_path'] . '/templates/';
809
-
810
- foreach ( array( 'stylesheet_path_1', 'stylesheet_path_2', 'template_path_1', 'template_path_2', 'plugin_path' ) as $var ) {
811
- $path = ${$var};
812
-
813
- if ( file_exists( $path ) ) {
814
- foreach ( scandir( $path ) as $scan ) {
815
- if ( ! isset( $this->layouts[$scan] ) && is_dir( $path . $scan ) && ! in_array( $scan, array( '.', '..', '.svn' ) ) && $scan[0] != '_' ) {
816
- $this->layouts[$scan] = array(
817
- 'name' => ucfirst( str_replace( '-', ' ', $scan ) ),
818
- 'path' => $path . $scan,
819
- 'url' => str_replace( array(
820
- get_stylesheet_directory(),
821
- get_template_directory(),
822
- $this->_args['plugin_path']
823
- ), array(
824
- get_stylesheet_directory_uri(),
825
- get_template_directory_uri(),
826
- $this->_args['plugin_url']
827
- ), $path . $scan ),
828
- 'css' => array(),
829
- 'js' => array(),
830
- 'support' => array(
831
- 'description' => true
832
- ),
833
- 'columns' => array()
834
- );
835
-
836
- // set the vars for config.php
837
- $layout = $scan;
838
- $this->_layout = $layout; // temporary attribute to load automatically the configuration inside the config.php, for this layout
839
-
840
- // TODO Fare in modo di caricare il file config.php soltanto quando realmente serve
841
- if ( ! in_array( $scan, array( 'single' ) ) && file_exists( $path . $scan . '/config.php' ) ) {
842
- include_once( $path . $scan . '/config.php' );
843
- }
844
- }
845
- }
846
- }
847
-
848
- }
849
- }
850
-
851
- /**
852
- * Say if you want to set description for the current layout or not. This method must be used only inside the
853
- * config.php file of layout
854
- *
855
- * @param $v string 'yes' or 'no'
856
- *
857
- * @return void
858
- * @since 1.0
859
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
860
- */
861
- public function add_description_field( $v ) {
862
- $this->layouts[ $this->_layout ]['support']['description'] = $v == 'yes' ? true : false;
863
- }
864
-
865
- /**
866
- * Add the extra fields for the specific layout type of portfolio
867
- *
868
- * @param array $fields The fields to add
869
- *
870
- * @return void
871
- * @since 1.0
872
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
873
- */
874
- public function add_layout_fields( $fields = array() ) {
875
- // change the ID
876
- foreach ( $fields as $id => $val ) {
877
- unset( $fields[ $id ] );
878
- $id = $this->_layout . '_' . $id;
879
- $fields[ $id ] = $val;
880
- }
881
-
882
- $this->layouts[ $this->_layout ]['fields'] = $fields;
883
- }
884
-
885
- /**
886
- * Add fields to add to the metabox of each item of each post type created
887
- *
888
- * @param array $fields The fields to add
889
- *
890
- * @return void
891
- * @since 1.0
892
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
893
- */
894
- public function add_item_fields( $fields = array() ) {
895
- // change the ID
896
- foreach ( $fields as $id => $val ) {
897
- unset( $fields[ $id ] );
898
- //$id = $this->_layout . '_' . $id;
899
- $fields[ $id ] = $val;
900
- }
901
- $this->layouts[ $this->_layout ]['item_fields'] = $fields;
902
- }
903
-
904
- /**
905
- * Add columns to the table list
906
- *
907
- * @param array $columns The columns to add in the table list
908
- *
909
- * @return void
910
- * @since 1.0
911
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
912
- */
913
- public function add_table_columns( $columns ) {
914
- $this->layouts[ $this->_layout ]['columns'] = $columns;
915
- }
916
-
917
- /**
918
- * Enqueue the css files of layout
919
- *
920
- * @param string $handle Name of the stylesheet.
921
- * @param string|bool $src Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.
922
- * @param array $deps An array of registered style handles this stylesheet depends on. Default empty array.
923
- * @param string|bool $ver String specifying the stylesheet version number, if it has one. This parameter is used
924
- * to ensure that the correct version is sent to the client regardless of caching, and so
925
- * should be included if a version number is available and makes sense for the stylesheet.
926
- * @param string $media Optional. The media for which this stylesheet has been defined.
927
- * Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print',
928
- * 'screen', 'tty', or 'tv'.
929
- *
930
- * @return void
931
- * @since 1.0
932
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
933
- */
934
- public function enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' ) {
935
- $this->layouts[ $this->_layout ]['css'][] = compact( 'handle', 'src', 'deps', 'ver', 'media' );
936
- }
937
-
938
- /**
939
- * Enqueue the js files of layout
940
- *
941
- * @param string $handle Name of the script.
942
- * @param string|bool $src Path to the script from the root directory of WordPress. Example: '/js/myscript.js'.
943
- * @param array $deps An array of registered handles this script depends on. Default empty array.
944
- * @param string|bool $ver Optional. String specifying the script version number, if it has one. This parameter
945
- * is used to ensure that the correct version is sent to the client regardless of caching,
946
- * and so should be included if a version number is available and makes sense for the script.
947
- * @param bool $in_footer Optional. Whether to enqueue the script before </head> or before </body>.
948
- * Default 'false'. Accepts 'false' or 'true'.
949
- *
950
- * @return void
951
- * @since 1.0
952
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
953
- */
954
- public function enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) {
955
- $this->layouts[ $this->_layout ]['js'][] = compact( 'handle', 'src', 'deps', 'ver', 'in_footer' );
956
- }
957
-
958
- /**
959
- * Enqueue the assets for the frontend
960
- *
961
- * @return void
962
- * @since 1.0
963
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
964
- */
965
- public function frontend_assets() {
966
- global $post;
967
-
968
- // not single
969
- if ( ! is_single() || ! isset( $post->post_type ) || ! $this->_is_valid( $post->post_type ) ) {
970
- $posts = get_posts(array(
971
- 'post_type' => $this->_name,
972
- 'posts_per_page' => -1,
973
- 'post_status' => 'publish',
974
- 'fields' => 'ids'
975
- ));
976
-
977
- $enqueued = array();
978
-
979
- foreach ( $posts as $post_id ) {
980
- $layout = get_post_meta( $post_id, $this->_args['layout_option'], true );
981
-
982
- if ( in_array( $layout, array( $enqueued ) ) || ! isset( $this->layouts[ $layout ]['css'] ) ) {
983
- continue;
984
- }
985
-
986
- foreach ( $this->layouts[ $layout ]['css'] as $asset ) {
987
- if ( empty( $asset ) ) {
988
- continue;
989
- }
990
- yit_enqueue_style( $asset['handle'], empty( $asset['src'] ) ? false : $this->locate_url( $layout ) . $asset['src'], $asset['deps'], $asset['ver'], $asset['media'] );
991
- }
992
-
993
- $enqueued[] = $layout;
994
- }
995
- }
996
-
997
- // load assets of single template
998
- else {
999
- $layout = 'single';
1000
-
1001
- if ( ! isset( $this->layouts[ $layout ]['css'] ) ) {
1002
- return;
1003
- }
1004
-
1005
- foreach ( $this->layouts[ $layout ]['css'] as $asset ) {
1006
- if ( empty( $asset ) ) {
1007
- continue;
1008
- }
1009
- yit_enqueue_style( $asset['handle'], $this->locate_url( $layout ) . $asset['src'], $asset['deps'], $asset['ver'], $asset['media'] );
1010
- }
1011
- }
1012
-
1013
- }
1014
-
1015
- /**
1016
- * Register Metaboxes options
1017
- *
1018
- * Add the metabox for the portfolio settings
1019
- *
1020
- * @return void
1021
- * @since 1.0
1022
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1023
- */
1024
- public function add_metabox_cptu() {
1025
-
1026
- // Reorganize layouts
1027
- if ( $this->_args['manage_layouts'] ) {
1028
- $layouts = array();
1029
- foreach ( $this->layouts as $layout_id => $layout ) {
1030
- if ( 'single' == $layout_id ) {
1031
- continue;
1032
- }
1033
- $layouts[ $layout_id ] = $layout['name'];
1034
- }
1035
-
1036
- $layouts = apply_filters( 'yit_cptu_' . $this->_name . '_layout_values', $layouts );
1037
- }
1038
-
1039
- $single_layouts = apply_filters( 'yit_cptu_' . $this->_name . '_single_layout_values', array() );
1040
-
1041
- $metabox_args = array(
1042
- 'label' => sprintf( __( '%s Settings', 'yith-plugin-fw' ), $this->_labels['singular'] ),
1043
- 'pages' => $this->_name, //or array( 'post-type1', 'post-type2')
1044
- 'context' => 'normal', //('normal', 'advanced', or 'side')
1045
- 'priority' => 'default',
1046
- 'tabs' => array(
1047
- 'settings' => array(
1048
- 'label' => __( 'Settings', 'yith-plugin-fw' ),
1049
- 'fields' => apply_filters( 'yit_cptu_fields', array(
1050
- 'type' => array(
1051
- 'label' => __( 'Type', 'yith-plugin-fw' ),
1052
- 'desc' => sprintf( __( 'Layout for this %s' , 'yith-plugin-fw' ), strtolower( $this->_labels['singular'] ) ),
1053
- 'type' => 'select',
1054
- 'options' => isset( $layouts ) ? $layouts : array(),
1055
- 'std' => '' ),
1056
-
1057
- 'rewrite' => array(
1058
- 'label' => __( 'Rewrite', 'yith-plugin-fw' ),
1059
- 'desc' => __( 'Univocal identification name in the URL for each product (slug from post if empty)', 'yith-plugin-fw' ),
1060
- 'type' => 'text',
1061
- 'std' => '' ),
1062
-
1063
- 'label_singular' => array(
1064
- 'label' => __( 'Label in Singular', 'yith-plugin-fw' ),
1065
- 'desc' => __( 'Set a label in singular (title of portfolio if empty)', 'yith-plugin-fw' ),
1066
- 'type' => 'text',
1067
- 'std' => '' ),
1068
-
1069
- 'label_plural' => array(
1070
- 'label' => __( 'Label in Plural', 'yith-plugin-fw' ),
1071
- 'desc' => __( 'Set a label in plural (title of portfolio if empty)', 'yith-plugin-fw' ),
1072
- 'type' => 'text',
1073
- 'std' => '' ),
1074
-
1075
- 'taxonomy' => array(
1076
- 'label' => __( 'Taxonomy', 'yith-plugin-fw' ),
1077
- 'desc' => __( 'If you want to use categories in the portfolio, set a name for taxonomy. Name should be a slug (must not contain capital letters nor spaces) and must not be more than 32 characters long (database structure restriction).', 'yith-plugin-fw' ),
1078
- 'type' => 'text',
1079
- 'std' => '' ),
1080
-
1081
- 'taxonomy_rewrite' => array(
1082
- 'label' => __( 'Taxonomy Rewrite', 'yith-plugin-fw' ),
1083
- 'desc' => __( 'Set univocal name for each category page URL.', 'yith-plugin-fw' ),
1084
- 'type' => 'text',
1085
- 'std' => '' ),
1086
-
1087
- 'single_layout' => array(
1088
- 'label' => __( 'Single layout', 'yith-plugin-fw' ),
1089
- 'desc' => __( 'Layout for single page of this portfolio', 'yith-plugin-fw' ),
1090
- 'type' => 'select',
1091
- 'options' => $single_layouts,
1092
- 'std' => '' ),
1093
- ) )
1094
- )
1095
- )
1096
-
1097
- );
1098
-
1099
- if ( ! $this->_args['has_single'] ) {
1100
- unset( $metabox_args['tabs']['settings']['fields']['rewrite'] );
1101
- }
1102
-
1103
- if ( ! $this->_args['has_taxonomy'] ) {
1104
- unset( $metabox_args['tabs']['settings']['fields']['taxonomy'] );
1105
- unset( $metabox_args['tabs']['settings']['fields']['taxonomy_rewrite'] );
1106
- }
1107
-
1108
- if ( ! empty( $this->_args['label_item_sing'] ) ) {
1109
- unset( $metabox_args['tabs']['settings']['fields']['label_singular'] );
1110
- }
1111
-
1112
- if ( ! empty( $this->_args['label_item_plur'] ) ) {
1113
- unset( $metabox_args['tabs']['settings']['fields']['label_plural'] );
1114
- }
1115
-
1116
- if ( $this->_args['manage_layouts'] ) {
1117
-
1118
- if ( count( $layouts ) < 1 ) {
1119
- unset( $metabox_args['tabs']['settings']['fields']['type'] );
1120
- }
1121
-
1122
- // Layouts options
1123
- foreach ( $this->layouts as $layout => $args ) {
1124
- if ( ! isset( $args['fields'] ) ) {
1125
- continue;
1126
- }
1127
-
1128
- // Section title
1129
- $metabox_args['tabs']['settings']['fields'][ $layout . '_title' ] = array(
1130
- 'desc' => $args['name'] . ' ' . __( 'layout settings', 'yith-plugin-fw' ),
1131
- 'type' => 'title',
1132
- 'deps' => array(
1133
- 'ids' => '_type',
1134
- 'values' => $layout
1135
- )
1136
- );
1137
-
1138
- // Options
1139
- foreach( $args['fields'] as $field_id => $field ) {
1140
- $metabox_args['tabs']['settings']['fields'][ $field_id ] = $field;
1141
- $metabox_args['tabs']['settings']['fields'][ $field_id ]['deps'] = array(
1142
- 'ids' => '_type',
1143
- 'values' => $layout
1144
- );
1145
- }
1146
- }
1147
- }else {
1148
- unset( $metabox_args['tabs']['settings']['fields']['type'] );
1149
- }
1150
-
1151
- if( count( $single_layouts ) < 1 ){
1152
- unset( $metabox_args['tabs']['settings']['fields']['single_layout'] );
1153
- }
1154
-
1155
- // undo if tab empty
1156
- if ( empty( $metabox_args['tabs']['settings']['fields'] ) ) {
1157
- return;
1158
- }
1159
-
1160
- $metabox = YIT_Metabox( $this->_name . '_cptu_settings' );
1161
- $metabox->init( $metabox_args );
1162
- }
1163
-
1164
- /**
1165
- * Register Metaboxes options
1166
- *
1167
- * Add the metabox for the portfolio settings
1168
- *
1169
- * @return void
1170
- * @since 1.0
1171
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1172
- */
1173
- public function add_metabox_item_fields() {
1174
- global $pagenow, $post_type;
1175
-
1176
- // get the actual post type, to add the metabox only if necessary
1177
- if ( $pagenow == 'post.php' && isset( $_REQUEST['post'] ) ) {
1178
- $post_type = get_post_type( intval( $_REQUEST['post'] ) );
1179
- }
1180
- elseif( $pagenow == 'post.php' && isset( $_REQUEST['post_ID'] ) ){
1181
- $post_type = get_post_type( intval( $_REQUEST['post_ID'] ) );
1182
- }
1183
- elseif ( $pagenow == 'post-new.php' && isset( $_REQUEST['post_type'] ) ) {
1184
- $post_type = $_REQUEST['post_type'];
1185
- } else {
1186
- return;
1187
- }
1188
-
1189
- $layout = get_post_meta( $this->_get_id_by_name( $post_type ), $this->_args['layout_option'], true );
1190
-
1191
- if ( empty( $this->layouts[ $layout ]['item_fields'] ) ) {
1192
- return;
1193
- }
1194
-
1195
- $metabox_args = array(
1196
- 'label' => __( 'Settings', 'yith-plugin-fw' ),
1197
- 'pages' => $post_type, //or array( 'post-type1', 'post-type2')
1198
- 'context' => 'normal', //('normal', 'advanced', or 'side')
1199
- 'priority' => 'default',
1200
- 'tabs' => array(
1201
- 'settings' => array(
1202
- 'label' => __( 'Settings', 'yith-plugin-fw' ),
1203
- 'fields' => $this->layouts[ $layout ]['item_fields']
1204
- )
1205
- )
1206
- );
1207
-
1208
- $metabox = YIT_Metabox( $post_type . '_item_fields' );
1209
- $metabox->init( $metabox_args );
1210
-
1211
- }
1212
-
1213
- /**
1214
- * Add quick links inside the editing page of CPTU and Custom Post Types
1215
- *
1216
- * @return void
1217
- * @since 1.0
1218
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1219
- */
1220
- public function add_quick_links_metaboxes() {
1221
- // CPTU
1222
- add_meta_box( $this->_name . '_quick_links', __( 'Quick links', 'yith-plugin-fw' ), array( $this, 'quick_links_cptu_inner' ), $this->_name, 'side', 'high' );
1223
-
1224
- // CPTs
1225
- $args = array(
1226
- 'post_type' => $this->_name,
1227
- 'posts_per_page' => -1,
1228
- 'post_status' => 'publish'
1229
- );
1230
- $post_types = get_posts( $args );
1231
-
1232
- foreach ( $post_types as $post ) {
1233
- $post_type = get_post_meta( $post->ID, '_post_type', true );
1234
- extract( $this->_cpt_args( $post ) );
1235
- add_meta_box( $post->post_type . '_quick_links', __( 'Quick links', 'yith-plugin-fw' ), array( $this, 'quick_links_cpt_inner' ), $post_type, 'side', 'high' );
1236
- }
1237
- }
1238
-
1239
- /**
1240
- * Link to: "View Items", inside the CPTU
1241
- *
1242
- * @param $post
1243
- *
1244
- * @return void
1245
- * @since 1.0
1246
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1247
- */
1248
- public function quick_links_cptu_inner( $post ) {
1249
- extract( $this->_cpt_args( $post ) );
1250
- ?>
1251
- <a href="<?php echo admin_url( 'edit.php?post_type=' . get_post_meta( $post->ID, '_post_type', true ) ) ?>"><?php printf( __( 'View %s', 'yith-plugin-fw' ), $label_plural ) ?></a>
1252
- <?php
1253
- }
1254
-
1255
- /**
1256
- * Link to: "Edit %s", inside the CPTU
1257
- *
1258
- * @param $post
1259
- *
1260
- * @return void
1261
- * @since 1.0
1262
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1263
- */
1264
- public function quick_links_cpt_inner( $post ) {
1265
- $post = get_post( $this->_get_id_by_name( $post->post_type ) );
1266
- ?>
1267
- <a href="<?php echo admin_url( "post.php?post={$post->ID}&action=edit" ) ?>"><?php printf( __( 'Edit %s', 'yith-plugin-fw' ), $post->post_title ) ?></a>
1268
- <?php
1269
- }
1270
-
1271
- /**
1272
- * Define the columns to use in the list table of main sliders post type
1273
- *
1274
- * @param $columns array The columns used in the list table
1275
- *
1276
- * @return array
1277
- * @since 1.0
1278
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1279
- */
1280
- public function cptu_define_columns( $columns ) {
1281
- unset( $columns['date'] );
1282
-
1283
- $columns['actions'] = '';
1284
-
1285
- return $columns;
1286
- }
1287
-
1288
- /**
1289
- * Change the content of each column of the table list
1290
- *
1291
- * @param $column string The current column
1292
- * @param $post_id int The current post ID
1293
- *
1294
- * @return void
1295
- * @since 1.0
1296
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1297
- */
1298
- public function cptu_change_columns( $column, $post_id ) {
1299
- $post = get_post( $post_id );
1300
- extract( $this->_cpt_args( $post ) );
1301
-
1302
- switch ( $column ) {
1303
- case 'actions' :
1304
- echo '<a href="' . admin_url( "post.php?post={$post_id}&action=edit" ) . '" class="button-secondary">' . sprintf( __( 'Edit %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ) . '</a> ';
1305
- echo '<a href="' . admin_url( 'edit.php?post_type=' . get_post_meta( $post_id, '_post_type', true ) ) . '" class="button-secondary">' . sprintf( __( 'View %s', 'yith-plugin-fw' ), $label_plural ) . '</a> ';
1306
- break;
1307
- }
1308
- }
1309
-
1310
- /**
1311
- * Retrieve the path of layout specified in parameter
1312
- *
1313
- * @param $layout
1314
- * @param $file string The file to find
1315
- *
1316
- * @return bool|string
1317
- * @since 1.0
1318
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1319
- */
1320
- public function locate_file( $layout, $file = '' ) {
1321
- if ( ! $this->_args['manage_layouts'] ) {
1322
- return $this->template_path(). '/' . ( ! empty( $file ) ? $file . '.php' : '' );
1323
- }
1324
-
1325
- if ( ! isset( $this->layouts[ $layout ] ) ) {
1326
- $layout = 'default';
1327
- }
1328
-
1329
- return $this->layouts[ $layout ]['path'] . '/' . ( ! empty( $file ) ? $file . '.php' : '' );
1330
- }
1331
-
1332
- /**
1333
- * Retrieve the URL of layout specified in parameter
1334
- *
1335
- * @param $layout
1336
- * @param $file string The file to find
1337
- *
1338
- * @return bool|string
1339
- * @since 1.0
1340
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1341
- */
1342
- public function locate_url( $layout, $file = '' ) {
1343
- if ( ! $this->_args['manage_layouts'] ) {
1344
- return $this->template_url();
1345
-
1346
- }
1347
-
1348
- if ( ! isset( $this->layouts[ $layout ] ) ) {
1349
- $layout = 'default';
1350
- }
1351
-
1352
- return $this->layouts[ $layout ]['url'] . '/' . ( ! empty( $file ) ? $file . '.php' : '' );
1353
- }
1354
-
1355
- /**
1356
- * Retrieve the post ID relative to the post of post type
1357
- *
1358
- * @param $name string
1359
- *
1360
- * @return mixed
1361
- * @since 1.0
1362
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1363
- */
1364
- protected function _get_id_by_name( $name ) {
1365
- global $wpdb;
1366
- return $wpdb->get_var( $wpdb->prepare( "SELECT pm.post_id FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %s AND p.post_type = %s", '_post_type', $name, $this->_name ) );
1367
- }
1368
-
1369
- /**
1370
- * Retrieve the post_type of portfolio by portfolio name
1371
- *
1372
- * @param $name string
1373
- *
1374
- * @return mixed
1375
- * @since 1.0
1376
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1377
- */
1378
- protected function _get_post_type_by_name( $name ) {
1379
- global $wpdb;
1380
- return $wpdb->get_var( $wpdb->prepare( "SELECT pm.meta_value FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND p.post_name = %s AND p.post_type = %s", '_post_type', $name, $this->_name ) );
1381
- }
1382
-
1383
- /**
1384
- * The shortcode used to show the frontend
1385
- *
1386
- * @param array $atts
1387
- * @param null $content
1388
- *
1389
- * @return string|null
1390
- * @since 1.0
1391
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1392
- */
1393
- public function add_shortcode( $atts, $content = null ) {
1394
- $atts = wp_parse_args( $atts, array(
1395
- 'name' => null,
1396
- 'cat' => array(),
1397
- 'posts_per_page' => false,
1398
- 'style' => null,
1399
- ) );
1400
-
1401
- // don't show the slider if 'name' is empty or is 'none'
1402
- if ( empty( $atts['name'] ) || 'none' == $atts['name'] ) return null;
1403
-
1404
- // compatibility fix: remove prefix if exists in portfolio object
1405
- if( function_exists( 'YIT_Portfolio' ) && method_exists( YIT_Portfolio(), 'is' ) && YIT_Portfolio()->is( $atts['name'] ) ){
1406
- $atts['name'] = str_replace( YIT_Portfolio()->post_type_prefix, '', $atts['name'] );
1407
- }
1408
-
1409
- // pass vars to template
1410
- $atts['post_type'] = $this->_get_post_type_by_name( $atts['name'] );
1411
- $atts['layout'] = $this->_args['manage_layouts'] ? get_post_meta( $this->_get_id_by_name( $atts['post_type'] ), $this->_args['layout_option'], true ) : '';
1412
- extract( apply_filters( 'yit_cptu_frontend_vars', $atts, $this->_name ) );
1413
-
1414
- // add the javascript assets
1415
- if ( $this->_args['manage_layouts'] && isset( $this->layouts[ $layout ]['js'] ) && ! empty( $this->layouts[ $layout ]['js'] ) ) {
1416
- foreach ( $this->layouts[ $layout ]['js'] as $asset ) {
1417
- if ( empty( $asset ) ) continue;
1418
-
1419
- if ( empty( $asset['src'] ) ) {
1420
- wp_enqueue_script( $asset['handle'] );
1421
- continue;
1422
- }
1423
-
1424
- yit_enqueue_script( $asset['handle'], $this->locate_url( $layout ) . $asset['src'], $asset['deps'], $asset['ver'], $asset['in_footer'] );
1425
- }
1426
- }
1427
-
1428
- // Unique sequential index to differentiate more cpt in the same page
1429
- ++$this->index;
1430
-
1431
- ob_start();
1432
-
1433
- include( $this->locate_file( $layout, 'markup' ) );
1434
-
1435
- return ob_get_clean();
1436
-
1437
- }
1438
-
1439
- /**
1440
- * Shortcode icon
1441
- *
1442
- * Return the shortcode icone to display on shortcode panel
1443
- *
1444
- * @param $icon_url string Icone url found by yit_shortcode plugin
1445
- *
1446
- * @return string
1447
- * @since 1.0.0
1448
- * @author Antonino Scarfi' <antonio.scarfi@yithemes.it>
1449
- */
1450
- public function shortcode_icon( $icon_url ) {
1451
- return ! empty( $this->_args['shortcode_icon'] ) ? $this->_args['shortcode_icon'] : $icon_url;
1452
- }
1453
-
1454
- /**
1455
- * Return an array with cptu options to shortcode panel
1456
- *
1457
- * All definition settings to add cptu shortcode to Yit Shortcode Panel
1458
- *
1459
- * @param array $shortcodes
1460
- *
1461
- * @return array
1462
- * @since 1.0
1463
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1464
- */
1465
- public function add_shortcode_to_box( $shortcodes ) {
1466
- $post_types = array();
1467
-
1468
- foreach ( $this->get_post_types() as $post ) {
1469
- $post_types[ $post->post_name ] = $post->post_title;
1470
- }
1471
-
1472
- $args = array(
1473
- $this->_args['shortcode_name'] => array(
1474
- 'title' => $this->_labels['singular'],
1475
- 'description' => sprintf( __( 'Show frontend of the %s', 'yith-plugin-fw' ), $this->_labels['main_name'] ),
1476
- 'tab' => 'cpt',
1477
- 'create' => false,
1478
- 'has_content' => false,
1479
- 'in_visual_composer' => true,
1480
- 'attributes' => array(
1481
- 'name' => array(
1482
- 'title' => __( 'Name', 'yith-plugin-fw' ),
1483
- 'type' => 'select',
1484
- 'options' => $post_types,
1485
- 'std' => ''
1486
- ),
1487
- )
1488
- )
1489
- );
1490
-
1491
- return array_merge( $shortcodes, $args );
1492
- }
1493
-
1494
- /**
1495
- * Check the post type passed in parameter, if is generated by this CPTU
1496
- *
1497
- * @param $post_type string The post type to check
1498
- *
1499
- * @return bool
1500
- * @since 1.0
1501
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1502
- */
1503
- protected function _is_valid( $post_type ) {
1504
- return (bool)( strpos( $post_type, $this->_args['post_type_prefix'] ) !== false );
1505
- }
1506
-
1507
- /**
1508
- * Add as a valid post type all cptu when importing dummy data
1509
- *
1510
- * @param $post array The post object
1511
- *
1512
- * @return array
1513
- * @since 1.0
1514
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
1515
- */
1516
- public function add_importer_required_post_type( $post ){
1517
- global $wp_post_types, $wp_taxonomies;
1518
-
1519
- if( strpos( $post['post_type'], $this->_prefix_cpt ) === FALSE ){
1520
- return $post;
1521
- }
1522
-
1523
- if( ! isset( $wp_post_types[ $post['post_type'] ] ) ){
1524
- $wp_post_types[ $post['post_type'] ] = array(
1525
- 'name' => ''
1526
- );
1527
- }
1528
-
1529
- if( ! empty( $post['terms'] ) ){
1530
- foreach( $post['terms'] as $term ){
1531
- if( ! isset( $wp_taxonomies[ $term['domain'] ] ) ){
1532
- $wp_taxonomies[ $term['domain'] ] = array(
1533
- 'name' => ''
1534
- );
1535
- }
1536
- }
1537
- }
1538
-
1539
-
1540
- return $post;
1541
- }
1542
-
1543
- /**
1544
- * Add taxonomy when importing dummy data
1545
- *
1546
- * @param $terms array Array of terms
1547
- *
1548
- * @return array
1549
- * @since 1.0
1550
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
1551
- */
1552
- public function add_importer_required_taxonomy( $terms ){
1553
- global $wp_taxonomies;
1554
-
1555
- if( ! empty( $terms ) ){
1556
- foreach ( $terms as $term ) {
1557
- if( isset( $term['domain'] ) && ! isset( $wp_taxonomies[ $term['domain'] ] ) ){
1558
- $wp_taxonomies[ $term['domain'] ] = array(
1559
- 'name' => ''
1560
- );
1561
- }
1562
- }
1563
- }
1564
-
1565
- return $terms;
1566
- }
1567
-
1568
- /**
1569
- * Force terms recount for imported taxonomy
1570
- *
1571
- * @param $tt_ids array Terms ids
1572
- * @param $ids array Post ids
1573
- * @param $tax string Taxonomy name
1574
- *
1575
- * @return void
1576
- * @since 1.0
1577
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
1578
- */
1579
- public function recount_terms_post( $tt_ids, $ids, $tax ){
1580
- wp_update_term_count( $tt_ids, $tax );
1581
- }
1582
-
1583
- // ### ASSETS ###
1584
-
1585
- /**
1586
- * Enqueue the assets for the admin
1587
- *
1588
- * @return void
1589
- * @since 1.0
1590
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1591
- */
1592
- public function admin_assets() {
1593
- wp_enqueue_media();
1594
- wp_enqueue_script( 'yit-cptu', YIT_CORE_PLUGIN_URL . '/assets/js/yit-cpt-unlimited.js', array('jquery'), '', true );
1595
- }
1596
-
1597
- /**
1598
- * Add the button to the top of the list table page of CPTU
1599
- *
1600
- * @return void
1601
- * @since 1.0
1602
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1603
- */
1604
- public function add_button_multiuploader() {
1605
- global $pagenow, $post_type, $wpdb;
1606
-
1607
- if( $pagenow != 'edit.php' ){
1608
- return;
1609
- }
1610
-
1611
- $cptu = $wpdb->get_var( $wpdb->prepare( "SELECT p.post_type FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %s", '_post_type', $post_type ) );
1612
-
1613
- $post = get_post( $this->_get_id_by_name( $post_type ) );
1614
- if ( empty( $post ) ) {
1615
- return;
1616
- }
1617
- extract( $this->_cpt_args( $post ) );
1618
-
1619
- if ( $cptu != $this->_name || ! $this->_is_valid( $post_type ) ) {
1620
- return;
1621
- }
1622
- ?>
1623
- <script>
1624
- (function($) {
1625
- "use strict";
1626
- // Author code here
1627
-
1628
- var button = $('<a />', {
1629
- href: '#',
1630
- class: 'multi-uploader add-new-h2',
1631
- 'data-uploader_title': '<?php printf( __( 'Add %s from images', 'yith-plugin-fw' ), $label_plural ) ?>',
1632
- 'data-uploader_button_text': '<?php printf( __( 'Add %s', 'yith-plugin-fw' ), $label_plural ) ?>'
1633
- }).text('<?php _e( 'Upload multiple files', 'yith-plugin-fw' ) ?>');
1634
-
1635
- var spinner = $('<span />', {
1636
- class: 'spinner',
1637
- style: 'float: none;'
1638
- });
1639
-
1640
- button.appendTo('.wrap h2, .wrap h1').after(spinner);
1641
-
1642
- })(jQuery);
1643
- </script>
1644
- <?php
1645
- }
1646
-
1647
- /**
1648
- * Add more posts by multiupload
1649
- *
1650
- * @return void
1651
- * @since 1.0
1652
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1653
- */
1654
- public function post_multiuploader() {
1655
- if ( ! isset( $_REQUEST['images'] ) || ! isset( $_REQUEST['post_type'] ) && $this->_is_valid( $_REQUEST['post_type'] ) ) {
1656
- return;
1657
- }
1658
-
1659
- foreach ( $_REQUEST['images'] as $the ) {
1660
-
1661
- // Create post object
1662
- $arg = array(
1663
- 'post_title' => $the['title'],
1664
- 'post_type' => $_REQUEST['post_type']
1665
- );
1666
- $post_id = wp_insert_post( $arg );
1667
-
1668
- set_post_thumbnail( $post_id, $the['id'] );
1669
-
1670
- }
1671
-
1672
- die();
1673
- }
1674
-
1675
-
1676
- // ###### SINGLE TEMPLATE ######
1677
-
1678
- /**
1679
- * Load the single template file
1680
- *
1681
- * @return void
1682
- * @since 1.0
1683
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1684
- */
1685
- public function single_template() {
1686
- global $post, $wpdb;
1687
-
1688
- // if ( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ) {
1689
- // $post = get_post( $_REQUEST['post_id'] );
1690
- // }
1691
-
1692
- if ( ( ( ! defined('DOING_AJAX') || ! DOING_AJAX ) && ! is_single() ) || ! isset( $post->post_type ) || ! $this->_is_valid( $post->post_type ) ) {
1693
- return;
1694
- }
1695
-
1696
- // add the javascript assets
1697
- if ( $this->_args['manage_layouts'] ) {
1698
- foreach ( $this->layouts[ 'single' ]['js'] as $asset ) {
1699
- yit_enqueue_script( $asset['handle'], $this->locate_url( 'single' ) . $asset['src'], $asset['deps'], $asset['ver'], $asset['in_footer'] );
1700
- }
1701
- }
1702
-
1703
- $post_name = $wpdb->get_var( $wpdb->prepare( "SELECT p.post_name FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %s AND p.post_type = %s", '_post_type', $post->post_type, $this->_name ) );
1704
- extract( apply_filters( 'yit_cptu_frontend_vars', array( 'name' => $post_name ), $this->_name ) );
1705
-
1706
- include( $this->locate_file( 'single', 'markup' ) );
1707
- }
1708
-
1709
- /**
1710
- * Load a file for the configuration of single template page of portfolio
1711
- *
1712
- * @return void
1713
- * @since 1.0
1714
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1715
- */
1716
- public function single_template_config() {
1717
- global $post, $wpdb;
1718
-
1719
- if ( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ) {
1720
- $post = get_post( $_REQUEST['post_id'] );
1721
- }
1722
-
1723
- if ( ( ( ! defined('DOING_AJAX') || ! DOING_AJAX ) && ! is_single() ) || ! isset( $post->post_type ) || ! $this->_is_valid( $post->post_type ) ) {
1724
- return;
1725
- }
1726
-
1727
- $this->_layout = 'single';
1728
- $path = $this->locate_file( 'single', 'config' );
1729
-
1730
- if ( file_exists( $path ) ) {
1731
- $post_name = $wpdb->get_var( $wpdb->prepare( "SELECT p.post_name FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %s AND p.post_type = %s", '_post_type', $post->post_type, $this->_name ) );
1732
- extract( apply_filters( 'yit_cptu_frontend_vars', array( 'name' => $post_name ), $this->_name ) );
1733
-
1734
- include( $path );
1735
- }
1736
- }
1737
-
1738
-
1739
- // ########################## ARCHIVE TEMPLATE ###############################
1740
-
1741
-
1742
- /**
1743
- * Load the template for archive page
1744
- *
1745
- * @return void
1746
- * @since 1.0
1747
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1748
- */
1749
- public function archive_template() {
1750
- global $wp_query;
1751
-
1752
-
1753
- // check if we are in archive template
1754
- if ( !( ! is_admin() && is_archive() && isset($wp_query->post) && $this->_is_valid( $wp_query->post->post_type ) ) ) {
1755
- return;
1756
- }
1757
-
1758
- // remove the action from loop of theme
1759
- remove_action( 'yit_content_loop', 'yit_content_loop', 10 );
1760
- add_action( 'yit_content_loop', array( $this, 'archive_template_loop' ), 10 );
1761
-
1762
- }
1763
-
1764
- /**
1765
- * Load loop for the archive template
1766
- *
1767
- * @return void
1768
- * @since 1.0
1769
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1770
- */
1771
- public function archive_template_loop() {
1772
- echo $this->add_shortcode( array( 'name' => $GLOBALS['wp_query']->post->post_type ) );
1773
- }
1774
-
1775
  }
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
+ if (!defined('ABSPATH')) {exit('Direct access forbidden.');
11
+ }
12
+
13
+ /**
14
+ * Manage the custom post types as Portfolio, Contact Forms and similar (called CPTU)
15
+ *
16
+ * @class YIT_CPT_Unlimited
17
+ * @package Yithemes
18
+ * @since 2.0.0
19
+ * @author Your Inspiration Themes
20
+ *
21
+ */
22
+
23
+ class YIT_CPT_Unlimited {
24
+
25
+ /**
26
+ * @var string The name of main post type of CPTU
27
+ * @since 1.0
28
+ */
29
+ protected $_name = '';
30
+
31
+ /**
32
+ * @var string The prefix of each post type created by the post of main CPTU
33
+ * @since 1.0
34
+ */
35
+ protected $_prefix_cpt = '';
36
+
37
+ /**
38
+ * @var string The labels defined for the main CPTU
39
+ * @since 1.0
40
+ */
41
+ protected $_labels = '';
42
+
43
+ /**
44
+ * @var string The configuration arguments of post type
45
+ * @since 1.0
46
+ */
47
+ protected $_args = '';
48
+
49
+ /**
50
+ * @var array All post types created by the post of main CPTU
51
+ * @since 1.0
52
+ */
53
+ public $post_types = array();
54
+
55
+ /**
56
+ * @var array $layouts Array with all portfolio layouts available for this site
57
+ * @since 1.0
58
+ */
59
+ public $layouts = array();
60
+
61
+ /**
62
+ * @var string $template_path The pathname of template folder
63
+ * @since 1.0
64
+ */
65
+ protected $template_path = '';
66
+
67
+ /**
68
+ * @var string $template_url The URL of template folder
69
+ * @since 1.0
70
+ */
71
+ protected $template_url = '';
72
+
73
+ /**
74
+ * @var int $_index Unique sequential ID to differentiate same shortcodes in the same page
75
+ */
76
+ public $index = 0;
77
+
78
+ /**
79
+ * @var string $_layout Temporary attribute to load automatically the settings for each layout
80
+ * @since 1.0
81
+ */
82
+ private $_layout = '';
83
+
84
+
85
+ /**
86
+ * Constructor
87
+ *
88
+ * Accept an array of arguments to define the characteristics of CPTU to register.
89
+ *
90
+ * @since 1.0
91
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
92
+ */
93
+ public function __construct( $args = array() ) {
94
+
95
+ $defaults = array(
96
+ 'name' => '',
97
+ 'post_type_prefix' => '',
98
+ 'labels' => array(
99
+ 'main_name' => '',
100
+ 'singular' => '',
101
+ 'plural' => '',
102
+ 'menu' => ''
103
+ ),
104
+ 'manage_layouts' => false,
105
+ 'add_multiuploader' => false,
106
+ 'sortable' => false,
107
+ 'has_single' => false,
108
+ 'has_taxonomy' => false,
109
+ 'label_item_sing' => '',
110
+ 'label_item_plur' => '',
111
+ 'shortcode_name' => '',
112
+ 'shortcode_icon' => '', // URL or icon name from http://melchoyce.github.io/dashicons/
113
+ 'layout_option' => '_type' // the option ID of layout metabox
114
+ );
115
+ $this->_args = wp_parse_args( $args, $defaults );
116
+
117
+ // fix labels
118
+ if ( empty( $this->_args['labels']['main_name'] ) ) {
119
+ $this->_args['labels']['main_name'] = $this->_args['labels']['singular'];
120
+ }
121
+ if ( empty( $this->_args['labels']['menu'] ) ) {
122
+ $this->_args['labels']['menu'] = $this->_args['labels']['singular'];
123
+ }
124
+
125
+ /* populate */
126
+ $this->_name = $this->_args['name'];
127
+ $this->_prefix_cpt = $this->_args['post_type_prefix'];
128
+ $this->_labels = $this->_args['labels'];
129
+
130
+ add_action( 'init', array( $this, 'register_post_type' ) );
131
+ add_action( 'init', array( $this, 'register_cptu_post_types' ) );
132
+
133
+ add_action( 'save_post', array( $this, 'rewrite_flush') );
134
+
135
+ // admin interface
136
+ add_action( 'admin_head', array( $this, 'add_cptu_menu_item' ) );
137
+ add_action( 'admin_init', array( $this, 'add_quick_links_metaboxes' ) );
138
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_assets' ) );
139
+
140
+ // metaboxes
141
+ add_action( 'after_setup_theme', array( $this, 'add_metabox_cptu' ), 2 );
142
+ add_action( 'after_setup_theme', array( $this, 'add_metabox_item_fields' ), 2 );
143
+
144
+ // multiuploader
145
+ if ( $this->_args['add_multiuploader'] ) {
146
+ add_action( 'admin_footer', array( $this, 'add_button_multiuploader' ) );
147
+ add_action( 'wp_ajax_yit_cptu_multiuploader', array( $this, 'post_multiuploader' ) );
148
+ }
149
+
150
+ // layouts
151
+ if ( $this->_args['manage_layouts'] ) {
152
+ // get all layouts available
153
+ $this->get_layouts();
154
+ }
155
+
156
+ // single layout
157
+ if ( $this->_args['has_single'] ) {
158
+ add_action( 'yit_loop', array( $this, 'single_template' ) );
159
+ add_action( 'wp', array( $this, 'single_template_config' ) );
160
+
161
+ if ( defined('DOING_AJAX') && DOING_AJAX ) {
162
+ add_action( 'init', array( $this, 'single_template_config' ) );
163
+ }
164
+ }
165
+
166
+ // archive template
167
+ add_action( 'wp', array( $this, 'archive_template' ) );
168
+
169
+ // enqueue the assets of each layout
170
+ add_action( 'wp_enqueue_scripts', array( $this, 'frontend_assets' ) );
171
+
172
+ // add the shortcode, used to show the frontend
173
+ if ( ! empty( $this->_args['shortcode_name'] ) ) {
174
+ add_shortcode( $this->_args['shortcode_name'], array( &$this, 'add_shortcode' ) );
175
+ add_filter( 'yit_shortcode_' . $this->_args['shortcode_name'] . '_icon', array( $this, 'shortcode_icon') );
176
+ add_filter( 'yit-shortcode-plugin-init', array( $this, 'add_shortcode_to_box' ) );
177
+ }
178
+
179
+ // add sortable feature
180
+ if ( $this->_args['sortable'] ) {
181
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_sortable_assets' ) );
182
+ add_action( 'wp_ajax_cpt_sort_posts', array( $this, 'sort_posts' ) );
183
+ add_action( 'admin_init', array( $this, 'init_menu_order' ) );
184
+ add_filter( 'pre_get_posts', array( $this, 'filter_active' ) );
185
+ add_filter( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
186
+ add_filter( 'get_next_post_where', array( $this, 'sorted_next_post_where' ) );
187
+ add_filter( 'get_previous_post_where', array( $this, 'sorted_prev_post_where' ) );
188
+ add_filter( 'get_next_post_sort', array( $this, 'sorted_next_post_sort' ) );
189
+ add_filter( 'get_previous_post_sort', array( $this, 'sorted_prev_post_sort' ) );
190
+ }
191
+
192
+ // add default columns to post type table list
193
+ add_filter( 'manage_edit-' . $this->_name . '_columns', array( $this, 'cptu_define_columns' ) );
194
+ add_action( 'manage_' . $this->_name . '_posts_custom_column' , array( $this, 'cptu_change_columns' ), 10, 2 );
195
+
196
+ // add required post type for wordpress importer
197
+ add_filter( 'wp_import_post_data_raw', array( $this, 'add_importer_required_post_type' ) );
198
+ add_filter( 'wp_import_terms', array( $this, 'add_importer_required_taxonomy' ) );
199
+ add_action( 'wp_import_set_post_terms', array( $this, 'recount_terms_post' ), 10, 3 );
200
+
201
+ }
202
+
203
+ /**
204
+ * Enqueue the assets for the sortable feature
205
+ *
206
+ * @return void
207
+ * @since 1.0
208
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
209
+ */
210
+ public function admin_sortable_assets() {
211
+ global $post;
212
+
213
+ if ( ! isset( $post->post_type ) || ! $this->_is_valid( $post->post_type ) ) {
214
+ return;
215
+ }
216
+
217
+ wp_enqueue_script( 'yit-cptu-sortable-posts', YIT_CORE_PLUGIN_URL . '/assets/js/yit-cptu-sortable-posts.js', array( 'jquery', 'jquery-ui-sortable' ), '1.0', true );
218
+ }
219
+
220
+ public function init_menu_order( $post_types = array() ) {
221
+ global $wpdb;
222
+
223
+ if ( empty( $post_types ) ) {
224
+ $post_types = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT post_type FROM $wpdb->posts WHERE post_type LIKE %s", str_replace( '_', '\_', $this->_prefix_cpt ) . '%' ) );
225
+ } elseif ( ! is_array( $post_types ) ) {
226
+ $post_types = array( $post_types );
227
+ }
228
+
229
+ foreach ( $post_types as $post_type ) {
230
+ $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = '{$post_type}' AND post_status IN ('publish', 'pending', 'draft', 'private', 'future') AND menu_order = 0" );
231
+
232
+ if ( empty( $count ) ) {
233
+ continue;
234
+ }
235
+
236
+ $sql = "SELECT ID
237
+ FROM $wpdb->posts
238
+ WHERE post_type = '" . $post_type . "'
239
+ AND post_status IN ('publish', 'pending', 'draft', 'private', 'future')
240
+ ORDER BY post_date DESC
241
+ ";
242
+
243
+ $results = $wpdb->get_results( $sql );
244
+
245
+ foreach ( $results as $key => $result ) {
246
+ $wpdb->update( $wpdb->posts, array( 'menu_order' => $key + 1 ), array( 'ID' => $result->ID ) );
247
+ }
248
+ }
249
+ }
250
+
251
+ /**
252
+ * Save the order of posts from sortable feature
253
+ *
254
+ * @return void
255
+ * @since 1.0
256
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
257
+ */
258
+ public function sort_posts() {
259
+ global $wpdb;
260
+
261
+ parse_str( $_REQUEST['order'], $data );
262
+
263
+ if ( is_array( $data ) ) {
264
+ //$this->init_menu_order( $_REQUEST['post_type'] );
265
+
266
+ $id_arr = array( );
267
+ foreach ( $data as $key => $values ) {
268
+ foreach ( $values as $position => $id ) {
269
+ $id_arr[] = $id;
270
+ }
271
+ }
272
+
273
+
274
+ $menu_order_arr = array( );
275
+ foreach ( $id_arr as $key => $id ) {
276
+ $results = $wpdb->get_results( "SELECT menu_order FROM $wpdb->posts WHERE ID = " . $id );
277
+ foreach ( $results as $result ) {
278
+ $menu_order_arr[] = $result->menu_order;
279
+ }
280
+ }
281
+
282
+ sort( $menu_order_arr );
283
+
284
+ foreach ( $data as $key => $values ) {
285
+ foreach ( $values as $position => $id ) {
286
+ $wpdb->update( $wpdb->posts, array( 'menu_order' => $menu_order_arr[$position] ), array( 'ID' => $id ) );
287
+ }
288
+ }
289
+ }
290
+
291
+ die();
292
+ }
293
+
294
+ public function filter_active( $wp_query ) {
295
+ if ( is_admin() && isset( $wp_query->query['suppress_filters'] ) )
296
+ $wp_query->query['suppress_filters'] = false;
297
+ if ( is_admin() && isset( $wp_query->query_vars['suppress_filters'] ) )
298
+ $wp_query->query_vars['suppress_filters'] = false;
299
+ return $wp_query;
300
+ }
301
+
302
+ public function pre_get_posts( $wp_query ) {
303
+ if ( is_admin() && !defined( 'DOING_AJAX' ) ) {
304
+ if ( isset( $wp_query->query['post_type'] ) ) {
305
+ $post_types = (array) $wp_query->query['post_type'];
306
+ foreach ( $post_types as $post_type ) {
307
+ if ( $this->_is_valid( $post_type ) ) {
308
+ $wp_query->set( 'orderby', 'menu_order' );
309
+ $wp_query->set( 'order', 'ASC' );
310
+ }
311
+ }
312
+ }
313
+
314
+ } else {
315
+
316
+ $active = false;
317
+
318
+ if ( isset( $wp_query->query['suppress_filters'] ) || isset( $wp_query->query['post_type'] ) ) {
319
+ $post_types = (array) $wp_query->query['post_type'];
320
+ foreach ( $post_types as $post_type ) {
321
+ if ( $this->_is_valid( $post_type ) ) {
322
+ $active = true;
323
+ }
324
+ }
325
+ }
326
+
327
+ if ( $active ) {
328
+ if ( !isset( $wp_query->query['orderby'] ) || $wp_query->query['orderby'] == 'post_date' )
329
+ $wp_query->set( 'orderby', 'menu_order' );
330
+ if ( !isset( $wp_query->query['order'] ) || $wp_query->query['order'] == 'DESC' )
331
+ $wp_query->set( 'order', 'ASC' );
332
+ }
333
+ }
334
+ }
335
+
336
+ /**
337
+ * Filters where clause for get next post
338
+ *
339
+ * @param $where
340
+ *
341
+ * @return string
342
+ * @since 1.0
343
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
344
+ */
345
+ public function sorted_next_post_where( $where ){
346
+ global $post;
347
+ if( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ){
348
+ $post = get_post( intval( $_REQUEST['post_id'] ) );
349
+ }
350
+ else{
351
+ $post = get_post();
352
+ }
353
+
354
+ if( ! $post || ! $this->_is_valid( $post->post_type ) ){
355
+ return $where;
356
+ }
357
+
358
+ $result = str_replace( "'" . $post->post_date . "'", $post->menu_order, $where );
359
+ $result = str_replace( 'p.post_date', 'p.menu_order', $result );
360
+
361
+ return $result;
362
+ }
363
+
364
+ /**
365
+ * Filters where clause for get prev post
366
+ *
367
+ * @param $where
368
+ *
369
+ * @return string
370
+ * @since 1.0
371
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
372
+ */
373
+ public function sorted_prev_post_where( $where ){
374
+ global $post;
375
+
376
+ if( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ){
377
+ $post = get_post( intval( $_REQUEST['post_id'] ) );
378
+ }
379
+ else{
380
+ $post = get_post();
381
+ }
382
+
383
+ if( ! $post || ! $this->_is_valid( $post->post_type ) ){
384
+ return $where;
385
+ }
386
+
387
+ $result = str_replace( "'" . $post->post_date . "'", $post->menu_order, $where );
388
+ $result = str_replace( 'p.post_date', 'p.menu_order', $result );
389
+
390
+ return $result;
391
+ }
392
+
393
+ /**
394
+ * Filters sort clause for get next post
395
+ *
396
+ * @param $sort
397
+ *
398
+ * @return string
399
+ * @since 1.0
400
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
401
+ */
402
+ public function sorted_next_post_sort( $sort ){
403
+ global $post;
404
+
405
+ if( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ){
406
+ $post = get_post( intval( $_REQUEST['post_id'] ) );
407
+ }
408
+ else{
409
+ $post = get_post();
410
+ }
411
+
412
+ if( ! $post || ! $this->_is_valid( $post->post_type ) ){
413
+ return $sort;
414
+ }
415
+
416
+ $result = str_replace( 'p.post_date', 'p.menu_order', $sort );
417
+ return $result;
418
+ }
419
+
420
+ /**
421
+ * Filters sort clause for get prev post
422
+ *
423
+ * @param $sort
424
+ *
425
+ * @return string
426
+ * @since 1.0
427
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
428
+ */
429
+ public function sorted_prev_post_sort( $sort ){
430
+ global $post;
431
+
432
+ if( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ){
433
+ $post = get_post( intval( $_REQUEST['post_id'] ) );
434
+ }
435
+ else{
436
+ $post = get_post();
437
+ }
438
+
439
+ if( ! $post || ! $this->_is_valid( $post->post_type ) ){
440
+ return $sort;
441
+ }
442
+
443
+ $result = str_replace( 'p.post_date', 'p.menu_order', $sort );
444
+ return $result;
445
+ }
446
+
447
+ /**
448
+ * Register post type
449
+ *
450
+ * Register the post type for the creation of portfolios
451
+ *
452
+ * @return void
453
+ * @since 1.0
454
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
455
+ */
456
+ public function register_post_type() {
457
+ $labels = array(
458
+ 'name' => ucfirst( $this->_labels['main_name'] ),
459
+ 'singular_name' => ucfirst( $this->_labels['singular'] ),
460
+ 'add_new' => sprintf( __( 'Add %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ),
461
+ 'add_new_item' => sprintf( __( 'Add New %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ),
462
+ 'edit_item' => sprintf( __( 'Edit %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ),
463
+ 'new_item' => sprintf( __( 'New %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ),
464
+ 'all_items' => sprintf( __( 'All %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['plural'] ) ),
465
+ 'view_item' => sprintf( __( 'View %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ),
466
+ 'search_items' => sprintf( __( 'Search %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['plural'] ) ),
467
+ 'not_found' => sprintf( __( 'No %s found', 'yith-plugin-fw' ), ucfirst( $this->_labels['plural'] ) ),
468
+ 'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'yith-plugin-fw' ), ucfirst( $this->_labels['plural'] ) ),
469
+ 'parent_item_colon' => '',
470
+ 'menu_name' => ucfirst( $this->_labels['menu'] )
471
+ );
472
+
473
+ $args = array(
474
+ 'labels' => apply_filters( 'yit_' . $this->_name . '_labels', $labels ),
475
+ 'public' => false,
476
+ 'publicly_queryable' => false,
477
+ 'show_ui' => true,
478
+ 'show_in_menu' => true,
479
+ 'query_var' => false,
480
+ 'capability_type' => 'post',
481
+ 'hierarchical' => false,
482
+ 'menu_position' => null,
483
+ 'supports' => array( 'title' )
484
+ );
485
+
486
+ if ( ! empty( $this->_args['menu_icon'] ) ) {
487
+ $args['menu_icon'] = $this->_args['menu_icon'];
488
+ }
489
+
490
+ register_post_type( $this->_name, apply_filters( 'yit_' . $this->_name . '_args', $args ) );
491
+ }
492
+
493
+ /**
494
+ * Retrieve the values configured inside the custom post type
495
+ *
496
+ * @param $post /WP_Query The post where get the arguments configured in the cpt
497
+ *
498
+ * @return array
499
+ * @since 1.0
500
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
501
+ */
502
+ protected function _cpt_args( $post ) {
503
+ if ( ! isset( $post->ID ) ) {
504
+ return;
505
+ }
506
+
507
+ $args = apply_filters( 'yit_cptu_register_post_type_args', array(
508
+ 'layout' => get_post_meta( $post->ID, $this->_args['layout_option'], true ),
509
+ 'rewrite' => get_post_meta( $post->ID, '_rewrite', true ),
510
+ 'label_singular' => ! empty( $this->_args['label_item_sing'] ) ? $this->_args['label_item_sing'] : get_post_meta( $post->ID, '_label_singular', true ),
511
+ 'label_plural' => ! empty( $this->_args['label_item_plur'] ) ? $this->_args['label_item_plur'] : get_post_meta( $post->ID, '_label_plural', true ),
512
+ 'taxonomy' => get_post_meta( $post->ID, '_taxonomy', true ),
513
+ 'taxonomy_rewrite' => get_post_meta( $post->ID, '_taxonomy_rewrite', true ),
514
+ ), $this->_name, $post );
515
+
516
+ $title = $post->post_title;
517
+
518
+ if ( empty( $args['label_singular'] ) ) {
519
+ $args['label_singular'] = $title;
520
+ }
521
+
522
+ if ( empty( $args['label_plural'] ) ) {
523
+ $args['label_plural'] = $title;
524
+ }
525
+
526
+ return $args;
527
+ }
528
+
529
+ /**
530
+ * Retrieve the post types created for this CPTU
531
+ *
532
+ * @return array The link changed
533
+ * @since 1.0
534
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
535
+ */
536
+ public function get_post_types() {
537
+ if ( ! empty( $this->post_types ) ) {
538
+ return $this->post_types;
539
+ }
540
+
541
+ $args = array(
542
+ 'post_type' => $this->_name,
543
+ 'posts_per_page' => -1,
544
+ 'post_status' => 'publish'
545
+ );
546
+ $this->post_types = get_posts( $args );
547
+
548
+ return $this->post_types;
549
+ }
550
+
551
+ /**
552
+ * Register portfolio post types
553
+ *
554
+ * Register the post types for each portfolio created by admin
555
+ *
556
+ * @return void
557
+ * @since 1.0
558
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
559
+ */
560
+ public function register_cptu_post_types() {
561
+ $post_types = $this->get_post_types();
562
+ $pts = array();
563
+
564
+ foreach ( $post_types as $pt ) {
565
+
566
+ extract( $this->_cpt_args( $pt ) );
567
+
568
+ $name = $pt->post_name;
569
+ $title = $pt->post_title;
570
+
571
+ $labels = array(
572
+ 'name' => $title,
573
+ 'singular_name' => $label_singular,
574
+ 'add_new' => sprintf( __( 'Add %s', 'yith-plugin-fw' ), $label_singular ),
575
+ 'add_new_item' => sprintf( __( 'Add New %s', 'yith-plugin-fw' ), $label_singular ),
576
+ 'edit_item' => sprintf( __( 'Edit %s', 'yith-plugin-fw' ), $label_singular ),
577
+ 'new_item' => sprintf( __( 'New %s', 'yith-plugin-fw' ), $label_singular ),
578
+ 'all_items' => sprintf( __( 'All %s', 'yith-plugin-fw' ), $label_plural ),
579
+ 'view_item' => sprintf( __( 'View %s', 'yith-plugin-fw' ), $label_singular ),
580
+ 'search_items' => sprintf( __( 'Search %s', 'yith-plugin-fw' ), $label_plural ),
581
+ 'not_found' => sprintf( __( 'No %s found', 'yith-plugin-fw' ), $label_plural ),
582
+ 'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'yith-plugin-fw' ), $label_plural ),
583
+ 'parent_item_colon' => '',
584
+ 'menu_name' => $title
585
+ );
586
+
587
+ $args = array(
588
+ 'labels' => apply_filters( 'yit_' . $this->_prefix_cpt . $name . '_labels', $labels ),
589
+ 'public' => true,
590
+ 'publicly_queryable' => true,
591
+ 'show_ui' => true,
592
+ 'show_in_menu' => false,
593
+ 'query_var' => true,
594
+ 'capability_type' => 'post',
595
+ 'hierarchical' => false,
596
+ 'menu_position' => null,
597
+ 'supports' => array( 'title', 'editor', 'thumbnail' )
598
+ );
599
+
600
+ if ( ! $this->_args['has_single'] ) {
601
+ $args['public'] = false;
602
+ $args['publicly_queryable'] = false;
603
+ $args['query_var'] = false;
604
+ }
605
+
606
+ if ( $this->_args['manage_layouts'] && isset($this->layouts[ $layout ]) && ! $this->layouts[ $layout ]['support']['description'] ) {
607
+ unset( $args['supports'][1] ); // remove 'editor'
608
+ }
609
+
610
+ if ( ! empty( $rewrite ) ) {
611
+ $args['rewrite'] = array( 'slug' => $rewrite );
612
+ }
613
+
614
+ // register post type
615
+ $post_type = yit_avoid_duplicate( str_replace( '-', '_', substr( $this->_prefix_cpt . $name, 0, 16) ), $post_types );
616
+ register_post_type( $post_type, apply_filters( 'yit_' . $this->_prefix_cpt . $name . '_args', $args, $pt ) ); // save the post type in post meta
617
+
618
+ update_post_meta( $pt->ID, '_post_type', $post_type );
619
+ $pts[] = $post_type;
620
+
621
+ // register taxonomy
622
+ if ( $this->_args['has_taxonomy'] && ! empty( $taxonomy ) ) {
623
+
624
+ $labels = array(
625
+ 'name' => sprintf( _x( '%s Categories', 'taxonomy general name', 'yith-plugin-fw' ), $label_singular ),
626
+ 'singular_name' => _x( 'Category', 'taxonomy singular name', 'yith-plugin-fw' ),
627
+ 'search_items' => __( 'Search Categories', 'yith-plugin-fw' ),
628
+ 'all_items' => __( 'All Categories', 'yith-plugin-fw' ),
629
+ 'parent_item' => __( 'Parent Category', 'yith-plugin-fw' ),
630
+ 'parent_item_colon' => __( 'Parent Category:', 'yith-plugin-fw' ),
631
+ 'edit_item' => __( 'Edit Category', 'yith-plugin-fw' ),
632
+ 'update_item' => __( 'Update Category', 'yith-plugin-fw' ),
633
+ 'add_new_item' => __( 'Add New Category', 'yith-plugin-fw' ),
634
+ 'new_item_name' => __( 'New Category Name', 'yith-plugin-fw' ),
635
+ 'menu_name' => __( 'Category', 'yith-plugin-fw' ),
636
+ );
637
+
638
+ $args = array(
639
+ 'hierarchical' => true,
640
+ 'labels' => $labels,
641
+ 'show_ui' => true,
642
+ 'show_admin_column' => true,
643
+ 'query_var' => true,
644
+ );
645
+
646
+ if ( ! empty( $taxonomy_rewrite ) ) {
647
+ $args['rewrite'] = array( 'slug' => $taxonomy_rewrite );
648
+ }
649
+
650
+ register_taxonomy( substr( $taxonomy, 0, 32 ), $post_type, $args );
651
+
652
+ }
653
+
654
+ }
655
+
656
+ wp_cache_set( 'yit_cptu_post_types', $post_types );
657
+ }
658
+
659
+ /**
660
+ * Flush Rewrite Rules
661
+ *
662
+ * rewrite rules when a cpt unlimited is saved
663
+ *
664
+ * @return void
665
+ * @since 1.0
666
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
667
+ */
668
+
669
+ public function rewrite_flush( $post ){
670
+
671
+ if ( isset( $post ) && $this->_is_valid( get_post_type( intval( $post ) ) ) ) {
672
+ flush_rewrite_rules();
673
+ }
674
+
675
+ }
676
+
677
+ /**
678
+ * Add the item for each portfolio under "Portfolios"
679
+ *
680
+ * @return void
681
+ * @since 1.0
682
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
683
+ */
684
+ public function add_cptu_menu_item() {
685
+ global $submenu, $post, $parent_file, $pagenow;
686
+
687
+ // get current post type
688
+ if ( isset( $post->post_type ) ) {
689
+ $post_type = $post->post_type;
690
+ } else if ( isset( $_REQUEST['post_type'] ) ) {
691
+ $post_type = $_REQUEST['post_type'];
692
+ } else {
693
+ return;
694
+ }
695
+
696
+ $item = 'edit.php?post_type=' . $this->_name;
697
+
698
+ // add new items
699
+ if ( strpos( $post_type, $this->_prefix_cpt ) !== false ) {
700
+ global $wpdb;
701
+ $portfolio = $wpdb->get_row( $wpdb->prepare( "SELECT p.* FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %s AND p.post_type = %s", '_post_type', $post_type, $this->_name ) );
702
+
703
+ if ( ! isset( $portfolio->ID ) ) {
704
+ return;
705
+ }
706
+
707
+ $label_singular = ! empty( $this->_args['label_item_sing'] ) ? $this->_args['label_item_sing'] : get_post_meta( $portfolio->ID, '_label_singular', true );
708
+ $label_plural = ! empty( $this->_args['label_item_plur'] ) ? $this->_args['label_item_plur'] : get_post_meta( $portfolio->ID, '_label_plural', true );
709
+
710
+ if ( empty( $label_plural ) ) {
711
+ $label_plural = $portfolio->post_title;
712
+ }
713
+
714
+ if ( empty( $label_singular ) ) {
715
+ $label_singular = $portfolio->post_title;
716
+ }
717
+
718
+ $submenu[ $item ][15] = array( ucfirst( $label_plural ), 'edit_posts', 'edit.php?post_type=' . $post_type );
719
+ $submenu[ $item ][20] = array( sprintf( __('Add %s', 'yith-plugin-fw'), ucfirst( $label_singular ) ), 'edit_posts', 'post-new.php?post_type=' . $post_type );
720
+
721
+ global $wp_taxonomies;
722
+ $taxonomy = get_post_meta( $portfolio->ID, '_taxonomy', true );
723
+ if ( isset( $wp_taxonomies[ $taxonomy ] ) ) {
724
+ $submenu[ $item ][25] = array( __('Categories', 'yith-plugin-fw'), 'edit_posts', 'edit-tags.php?taxonomy=' . $taxonomy . '&post_type=' . $post_type );
725
+ }
726
+ }
727
+
728
+ // set the parent item inside the single of each post type
729
+ if ( $pagenow == 'post.php' && isset( $_GET['post'] ) && $this->_is_valid( get_post_type( intval( $_GET['post'] ) ) ) ) {
730
+ $parent_file = 'edit.php?post_type=' . $this->_name;
731
+ }
732
+ }
733
+
734
+ /**
735
+ * Locate folder of CPTU templates, if there isn't a layouts management
736
+ *
737
+ * @return string
738
+ * @since 1.0
739
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
740
+ */
741
+ public function template_path() {
742
+ if ( ! empty( $this->template_path ) ) {
743
+ return $this->template_path;
744
+ }
745
+
746
+ // paths
747
+ $stylesheet_path_1 = get_stylesheet_directory() . '/theme/templates/' . $this->_name . '/';
748
+ $stylesheet_path_2 = get_template_directory() . '/theme/templates/' . $this->_name . '/';
749
+ $template_path_1 = get_stylesheet_directory() . '/' . $this->_name . '/';
750
+ $template_path_2 = get_template_directory() . '/' . $this->_name . '/';
751
+ $plugin_path = $this->_args['plugin_path'] . '/templates/';
752
+
753
+ foreach ( array( 'stylesheet_path_1', 'stylesheet_path_2', 'template_path_1', 'template_path_2', 'plugin_path' ) as $var ) {
754
+ $path = ${$var};
755
+
756
+ if ( file_exists( $path ) ) {
757
+ $this->template_path = $path;
758
+ }
759
+ }
760
+
761
+ return $this->template_path;
762
+ }
763
+
764
+ /**
765
+ * Locate folder of CPTU templates, if there isn't a layouts management
766
+ *
767
+ * @return string
768
+ * @since 1.0
769
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
770
+ */
771
+ public function template_url() {
772
+ if ( ! empty( $this->template_url ) ) {
773
+ return $this->template_path;
774
+ }
775
+
776
+ $this->template_url = str_replace( array(
777
+ get_stylesheet_directory(),
778
+ get_template_directory(),
779
+ $this->_args['plugin_path']
780
+ ), array(
781
+ get_stylesheet_directory_uri(),
782
+ get_template_directory_uri(),
783
+ $this->_args['plugin_url']
784
+ ), $this->template_path() );
785
+
786
+ return $this->template_url;
787
+ }
788
+
789
+ /**
790
+ * Retrieve all layouts to manage by custom post type added in the site in this order:
791
+ * 1. Child theme (if exists)
792
+ * 2. Theme
793
+ * 3. Plugin
794
+ *
795
+ * It also load the config.php file of each layout
796
+ *
797
+ * @return void
798
+ * @since 1.0
799
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
800
+ */
801
+ public function get_layouts() {
802
+
803
+ // paths
804
+ $stylesheet_path_1 = get_stylesheet_directory() . '/theme/templates/' . $this->_name . '/';
805
+ $stylesheet_path_2 = get_template_directory() . '/theme/templates/' . $this->_name . '/';
806
+ $template_path_1 = get_stylesheet_directory() . '/' . $this->_name . '/';
807
+ $template_path_2 = get_template_directory() . '/' . $this->_name . '/';
808
+ $plugin_path = $this->_args['plugin_path'] . '/templates/';
809
+
810
+ foreach ( array( 'stylesheet_path_1', 'stylesheet_path_2', 'template_path_1', 'template_path_2', 'plugin_path' ) as $var ) {
811
+ $path = ${$var};
812
+
813
+ if ( file_exists( $path ) ) {
814
+ foreach ( scandir( $path ) as $scan ) {
815
+ if ( ! isset( $this->layouts[$scan] ) && is_dir( $path . $scan ) && ! in_array( $scan, array( '.', '..', '.svn' ) ) && $scan[0] != '_' ) {
816
+ $this->layouts[$scan] = array(
817
+ 'name' => ucfirst( str_replace( '-', ' ', $scan ) ),
818
+ 'path' => $path . $scan,
819
+ 'url' => str_replace( array(
820
+ get_stylesheet_directory(),
821
+ get_template_directory(),
822
+ $this->_args['plugin_path']
823
+ ), array(
824
+ get_stylesheet_directory_uri(),
825
+ get_template_directory_uri(),
826
+ $this->_args['plugin_url']
827
+ ), $path . $scan ),
828
+ 'css' => array(),
829
+ 'js' => array(),
830
+ 'support' => array(
831
+ 'description' => true
832
+ ),
833
+ 'columns' => array()
834
+ );
835
+
836
+ // set the vars for config.php
837
+ $layout = $scan;
838
+ $this->_layout = $layout; // temporary attribute to load automatically the configuration inside the config.php, for this layout
839
+
840
+ // TODO Fare in modo di caricare il file config.php soltanto quando realmente serve
841
+ if ( ! in_array( $scan, array( 'single' ) ) && file_exists( $path . $scan . '/config.php' ) ) {
842
+ include_once( $path . $scan . '/config.php' );
843
+ }
844
+ }
845
+ }
846
+ }
847
+
848
+ }
849
+ }
850
+
851
+ /**
852
+ * Say if you want to set description for the current layout or not. This method must be used only inside the
853
+ * config.php file of layout
854
+ *
855
+ * @param $v string 'yes' or 'no'
856
+ *
857
+ * @return void
858
+ * @since 1.0
859
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
860
+ */
861
+ public function add_description_field( $v ) {
862
+ $this->layouts[ $this->_layout ]['support']['description'] = $v == 'yes' ? true : false;
863
+ }
864
+
865
+ /**
866
+ * Add the extra fields for the specific layout type of portfolio
867
+ *
868
+ * @param array $fields The fields to add
869
+ *
870
+ * @return void
871
+ * @since 1.0
872
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
873
+ */
874
+ public function add_layout_fields( $fields = array() ) {
875
+ // change the ID
876
+ foreach ( $fields as $id => $val ) {
877
+ unset( $fields[ $id ] );
878
+ $id = $this->_layout . '_' . $id;
879
+ $fields[ $id ] = $val;
880
+ }
881
+
882
+ $this->layouts[ $this->_layout ]['fields'] = $fields;
883
+ }
884
+
885
+ /**
886
+ * Add fields to add to the metabox of each item of each post type created
887
+ *
888
+ * @param array $fields The fields to add
889
+ *
890
+ * @return void
891
+ * @since 1.0
892
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
893
+ */
894
+ public function add_item_fields( $fields = array() ) {
895
+ // change the ID
896
+ foreach ( $fields as $id => $val ) {
897
+ unset( $fields[ $id ] );
898
+ //$id = $this->_layout . '_' . $id;
899
+ $fields[ $id ] = $val;
900
+ }
901
+ $this->layouts[ $this->_layout ]['item_fields'] = $fields;
902
+ }
903
+
904
+ /**
905
+ * Add columns to the table list
906
+ *
907
+ * @param array $columns The columns to add in the table list
908
+ *
909
+ * @return void
910
+ * @since 1.0
911
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
912
+ */
913
+ public function add_table_columns( $columns ) {
914
+ $this->layouts[ $this->_layout ]['columns'] = $columns;
915
+ }
916
+
917
+ /**
918
+ * Enqueue the css files of layout
919
+ *
920
+ * @param string $handle Name of the stylesheet.
921
+ * @param string|bool $src Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.
922
+ * @param array $deps An array of registered style handles this stylesheet depends on. Default empty array.
923
+ * @param string|bool $ver String specifying the stylesheet version number, if it has one. This parameter is used
924
+ * to ensure that the correct version is sent to the client regardless of caching, and so
925
+ * should be included if a version number is available and makes sense for the stylesheet.
926
+ * @param string $media Optional. The media for which this stylesheet has been defined.
927
+ * Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print',
928
+ * 'screen', 'tty', or 'tv'.
929
+ *
930
+ * @return void
931
+ * @since 1.0
932
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
933
+ */
934
+ public function enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' ) {
935
+ $this->layouts[ $this->_layout ]['css'][] = compact( 'handle', 'src', 'deps', 'ver', 'media' );
936
+ }
937
+
938
+ /**
939
+ * Enqueue the js files of layout
940
+ *
941
+ * @param string $handle Name of the script.
942
+ * @param string|bool $src Path to the script from the root directory of WordPress. Example: '/js/myscript.js'.
943
+ * @param array $deps An array of registered handles this script depends on. Default empty array.
944
+ * @param string|bool $ver Optional. String specifying the script version number, if it has one. This parameter
945
+ * is used to ensure that the correct version is sent to the client regardless of caching,
946
+ * and so should be included if a version number is available and makes sense for the script.
947
+ * @param bool $in_footer Optional. Whether to enqueue the script before </head> or before </body>.
948
+ * Default 'false'. Accepts 'false' or 'true'.
949
+ *
950
+ * @return void
951
+ * @since 1.0
952
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
953
+ */
954
+ public function enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) {
955
+ $this->layouts[ $this->_layout ]['js'][] = compact( 'handle', 'src', 'deps', 'ver', 'in_footer' );
956
+ }
957
+
958
+ /**
959
+ * Enqueue the assets for the frontend
960
+ *
961
+ * @return void
962
+ * @since 1.0
963
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
964
+ */
965
+ public function frontend_assets() {
966
+ global $post;
967
+
968
+ // not single
969
+ if ( ! is_single() || ! isset( $post->post_type ) || ! $this->_is_valid( $post->post_type ) ) {
970
+ $posts = get_posts(array(
971
+ 'post_type' => $this->_name,
972
+ 'posts_per_page' => -1,
973
+ 'post_status' => 'publish',
974
+ 'fields' => 'ids'
975
+ ));
976
+
977
+ $enqueued = array();
978
+
979
+ foreach ( $posts as $post_id ) {
980
+ $layout = get_post_meta( $post_id, $this->_args['layout_option'], true );
981
+
982
+ if ( in_array( $layout, array( $enqueued ) ) || ! isset( $this->layouts[ $layout ]['css'] ) ) {
983
+ continue;
984
+ }
985
+
986
+ foreach ( $this->layouts[ $layout ]['css'] as $asset ) {
987
+ if ( empty( $asset ) ) {
988
+ continue;
989
+ }
990
+ yit_enqueue_style( $asset['handle'], empty( $asset['src'] ) ? false : $this->locate_url( $layout ) . $asset['src'], $asset['deps'], $asset['ver'], $asset['media'] );
991
+ }
992
+
993
+ $enqueued[] = $layout;
994
+ }
995
+ }
996
+
997
+ // load assets of single template
998
+ else {
999
+ $layout = 'single';
1000
+
1001
+ if ( ! isset( $this->layouts[ $layout ]['css'] ) ) {
1002
+ return;
1003
+ }
1004
+
1005
+ foreach ( $this->layouts[ $layout ]['css'] as $asset ) {
1006
+ if ( empty( $asset ) ) {
1007
+ continue;
1008
+ }
1009
+ yit_enqueue_style( $asset['handle'], $this->locate_url( $layout ) . $asset['src'], $asset['deps'], $asset['ver'], $asset['media'] );
1010
+ }
1011
+ }
1012
+
1013
+ }
1014
+
1015
+ /**
1016
+ * Register Metaboxes options
1017
+ *
1018
+ * Add the metabox for the portfolio settings
1019
+ *
1020
+ * @return void
1021
+ * @since 1.0
1022
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1023
+ */
1024
+ public function add_metabox_cptu() {
1025
+
1026
+ // Reorganize layouts
1027
+ if ( $this->_args['manage_layouts'] ) {
1028
+ $layouts = array();
1029
+ foreach ( $this->layouts as $layout_id => $layout ) {
1030
+ if ( 'single' == $layout_id ) {
1031
+ continue;
1032
+ }
1033
+ $layouts[ $layout_id ] = $layout['name'];
1034
+ }
1035
+
1036
+ $layouts = apply_filters( 'yit_cptu_' . $this->_name . '_layout_values', $layouts );
1037
+ }
1038
+
1039
+ $single_layouts = apply_filters( 'yit_cptu_' . $this->_name . '_single_layout_values', array() );
1040
+
1041
+ $metabox_args = array(
1042
+ 'label' => sprintf( __( '%s Settings', 'yith-plugin-fw' ), $this->_labels['singular'] ),
1043
+ 'pages' => $this->_name, //or array( 'post-type1', 'post-type2')
1044
+ 'context' => 'normal', //('normal', 'advanced', or 'side')
1045
+ 'priority' => 'default',
1046
+ 'tabs' => array(
1047
+ 'settings' => array(
1048
+ 'label' => __( 'Settings', 'yith-plugin-fw' ),
1049
+ 'fields' => apply_filters( 'yit_cptu_fields', array(
1050
+ 'type' => array(
1051
+ 'label' => __( 'Type', 'yith-plugin-fw' ),
1052
+ 'desc' => sprintf( __( 'Layout for this %s' , 'yith-plugin-fw' ), strtolower( $this->_labels['singular'] ) ),
1053
+ 'type' => 'select',
1054
+ 'options' => isset( $layouts ) ? $layouts : array(),
1055
+ 'std' => '' ),
1056
+
1057
+ 'rewrite' => array(
1058
+ 'label' => __( 'Rewrite', 'yith-plugin-fw' ),
1059
+ 'desc' => __( 'Univocal identification name in the URL for each product (slug from post if empty)', 'yith-plugin-fw' ),
1060
+ 'type' => 'text',
1061
+ 'std' => '' ),
1062
+
1063
+ 'label_singular' => array(
1064
+ 'label' => __( 'Label in Singular', 'yith-plugin-fw' ),
1065
+ 'desc' => __( 'Set a label in singular (title of portfolio if empty)', 'yith-plugin-fw' ),
1066
+ 'type' => 'text',
1067
+ 'std' => '' ),
1068
+
1069
+ 'label_plural' => array(
1070
+ 'label' => __( 'Label in Plural', 'yith-plugin-fw' ),
1071
+ 'desc' => __( 'Set a label in plural (title of portfolio if empty)', 'yith-plugin-fw' ),
1072
+ 'type' => 'text',
1073
+ 'std' => '' ),
1074
+
1075
+ 'taxonomy' => array(
1076
+ 'label' => __( 'Taxonomy', 'yith-plugin-fw' ),
1077
+ 'desc' => __( 'If you want to use categories in the portfolio, set a name for taxonomy. Name should be a slug (must not contain capital letters nor spaces) and must not be more than 32 characters long (database structure restriction).', 'yith-plugin-fw' ),
1078
+ 'type' => 'text',
1079
+ 'std' => '' ),
1080
+
1081
+ 'taxonomy_rewrite' => array(
1082
+ 'label' => __( 'Taxonomy Rewrite', 'yith-plugin-fw' ),
1083
+ 'desc' => __( 'Set univocal name for each category page URL.', 'yith-plugin-fw' ),
1084
+ 'type' => 'text',
1085
+ 'std' => '' ),
1086
+
1087
+ 'single_layout' => array(
1088
+ 'label' => __( 'Single layout', 'yith-plugin-fw' ),
1089
+ 'desc' => __( 'Layout for single page of this portfolio', 'yith-plugin-fw' ),
1090
+ 'type' => 'select',
1091
+ 'options' => $single_layouts,
1092
+ 'std' => '' ),
1093
+ ) )
1094
+ )
1095
+ )
1096
+
1097
+ );
1098
+
1099
+ if ( ! $this->_args['has_single'] ) {
1100
+ unset( $metabox_args['tabs']['settings']['fields']['rewrite'] );
1101
+ }
1102
+
1103
+ if ( ! $this->_args['has_taxonomy'] ) {
1104
+ unset( $metabox_args['tabs']['settings']['fields']['taxonomy'] );
1105
+ unset( $metabox_args['tabs']['settings']['fields']['taxonomy_rewrite'] );
1106
+ }
1107
+
1108
+ if ( ! empty( $this->_args['label_item_sing'] ) ) {
1109
+ unset( $metabox_args['tabs']['settings']['fields']['label_singular'] );
1110
+ }
1111
+
1112
+ if ( ! empty( $this->_args['label_item_plur'] ) ) {
1113
+ unset( $metabox_args['tabs']['settings']['fields']['label_plural'] );
1114
+ }
1115
+
1116
+ if ( $this->_args['manage_layouts'] ) {
1117
+
1118
+ if ( count( $layouts ) < 1 ) {
1119
+ unset( $metabox_args['tabs']['settings']['fields']['type'] );
1120
+ }
1121
+
1122
+ // Layouts options
1123
+ foreach ( $this->layouts as $layout => $args ) {
1124
+ if ( ! isset( $args['fields'] ) ) {
1125
+ continue;
1126
+ }
1127
+
1128
+ // Section title
1129
+ $metabox_args['tabs']['settings']['fields'][ $layout . '_title' ] = array(
1130
+ 'desc' => $args['name'] . ' ' . __( 'layout settings', 'yith-plugin-fw' ),
1131
+ 'type' => 'title',
1132
+ 'deps' => array(
1133
+ 'ids' => '_type',
1134
+ 'values' => $layout
1135
+ )
1136
+ );
1137
+
1138
+ // Options
1139
+ foreach( $args['fields'] as $field_id => $field ) {
1140
+ $metabox_args['tabs']['settings']['fields'][ $field_id ] = $field;
1141
+ $metabox_args['tabs']['settings']['fields'][ $field_id ]['deps'] = array(
1142
+ 'ids' => '_type',
1143
+ 'values' => $layout
1144
+ );
1145
+ }
1146
+ }
1147
+ }else {
1148
+ unset( $metabox_args['tabs']['settings']['fields']['type'] );
1149
+ }
1150
+
1151
+ if( count( $single_layouts ) < 1 ){
1152
+ unset( $metabox_args['tabs']['settings']['fields']['single_layout'] );
1153
+ }
1154
+
1155
+ // undo if tab empty
1156
+ if ( empty( $metabox_args['tabs']['settings']['fields'] ) ) {
1157
+ return;
1158
+ }
1159
+
1160
+ $metabox = YIT_Metabox( $this->_name . '_cptu_settings' );
1161
+ $metabox->init( $metabox_args );
1162
+ }
1163
+
1164
+ /**
1165
+ * Register Metaboxes options
1166
+ *
1167
+ * Add the metabox for the portfolio settings
1168
+ *
1169
+ * @return void
1170
+ * @since 1.0
1171
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1172
+ */
1173
+ public function add_metabox_item_fields() {
1174
+ global $pagenow, $post_type;
1175
+
1176
+ // get the actual post type, to add the metabox only if necessary
1177
+ if ( $pagenow == 'post.php' && isset( $_REQUEST['post'] ) ) {
1178
+ $post_type = get_post_type( intval( $_REQUEST['post'] ) );
1179
+ }
1180
+ elseif( $pagenow == 'post.php' && isset( $_REQUEST['post_ID'] ) ){
1181
+ $post_type = get_post_type( intval( $_REQUEST['post_ID'] ) );
1182
+ }
1183
+ elseif ( $pagenow == 'post-new.php' && isset( $_REQUEST['post_type'] ) ) {
1184
+ $post_type = $_REQUEST['post_type'];
1185
+ } else {
1186
+ return;
1187
+ }
1188
+
1189
+ $layout = get_post_meta( $this->_get_id_by_name( $post_type ), $this->_args['layout_option'], true );
1190
+
1191
+ if ( empty( $this->layouts[ $layout ]['item_fields'] ) ) {
1192
+ return;
1193
+ }
1194
+
1195
+ $metabox_args = array(
1196
+ 'label' => __( 'Settings', 'yith-plugin-fw' ),
1197
+ 'pages' => $post_type, //or array( 'post-type1', 'post-type2')
1198
+ 'context' => 'normal', //('normal', 'advanced', or 'side')
1199
+ 'priority' => 'default',
1200
+ 'tabs' => array(
1201
+ 'settings' => array(
1202
+ 'label' => __( 'Settings', 'yith-plugin-fw' ),
1203
+ 'fields' => $this->layouts[ $layout ]['item_fields']
1204
+ )
1205
+ )
1206
+ );
1207
+
1208
+ $metabox = YIT_Metabox( $post_type . '_item_fields' );
1209
+ $metabox->init( $metabox_args );
1210
+
1211
+ }
1212
+
1213
+ /**
1214
+ * Add quick links inside the editing page of CPTU and Custom Post Types
1215
+ *
1216
+ * @return void
1217
+ * @since 1.0
1218
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1219
+ */
1220
+ public function add_quick_links_metaboxes() {
1221
+ // CPTU
1222
+ add_meta_box( $this->_name . '_quick_links', __( 'Quick links', 'yith-plugin-fw' ), array( $this, 'quick_links_cptu_inner' ), $this->_name, 'side', 'high' );
1223
+
1224
+ // CPTs
1225
+ $args = array(
1226
+ 'post_type' => $this->_name,
1227
+ 'posts_per_page' => -1,
1228
+ 'post_status' => 'publish'
1229
+ );
1230
+ $post_types = get_posts( $args );
1231
+
1232
+ foreach ( $post_types as $post ) {
1233
+ $post_type = get_post_meta( $post->ID, '_post_type', true );
1234
+ extract( $this->_cpt_args( $post ) );
1235
+ add_meta_box( $post->post_type . '_quick_links', __( 'Quick links', 'yith-plugin-fw' ), array( $this, 'quick_links_cpt_inner' ), $post_type, 'side', 'high' );
1236
+ }
1237
+ }
1238
+
1239
+ /**
1240
+ * Link to: "View Items", inside the CPTU
1241
+ *
1242
+ * @param $post
1243
+ *
1244
+ * @return void
1245
+ * @since 1.0
1246
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1247
+ */
1248
+ public function quick_links_cptu_inner( $post ) {
1249
+ extract( $this->_cpt_args( $post ) );
1250
+ ?>
1251
+ <a href="<?php echo admin_url( 'edit.php?post_type=' . get_post_meta( $post->ID, '_post_type', true ) ) ?>"><?php printf( __( 'View %s', 'yith-plugin-fw' ), $label_plural ) ?></a>
1252
+ <?php
1253
+ }
1254
+
1255
+ /**
1256
+ * Link to: "Edit %s", inside the CPTU
1257
+ *
1258
+ * @param $post
1259
+ *
1260
+ * @return void
1261
+ * @since 1.0
1262
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1263
+ */
1264
+ public function quick_links_cpt_inner( $post ) {
1265
+ $post = get_post( $this->_get_id_by_name( $post->post_type ) );
1266
+ ?>
1267
+ <a href="<?php echo admin_url( "post.php?post={$post->ID}&action=edit" ) ?>"><?php printf( __( 'Edit %s', 'yith-plugin-fw' ), $post->post_title ) ?></a>
1268
+ <?php
1269
+ }
1270
+
1271
+ /**
1272
+ * Define the columns to use in the list table of main sliders post type
1273
+ *
1274
+ * @param $columns array The columns used in the list table
1275
+ *
1276
+ * @return array
1277
+ * @since 1.0
1278
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1279
+ */
1280
+ public function cptu_define_columns( $columns ) {
1281
+ unset( $columns['date'] );
1282
+
1283
+ $columns['actions'] = '';
1284
+
1285
+ return $columns;
1286
+ }
1287
+
1288
+ /**
1289
+ * Change the content of each column of the table list
1290
+ *
1291
+ * @param $column string The current column
1292
+ * @param $post_id int The current post ID
1293
+ *
1294
+ * @return void
1295
+ * @since 1.0
1296
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1297
+ */
1298
+ public function cptu_change_columns( $column, $post_id ) {
1299
+ $post = get_post( $post_id );
1300
+ extract( $this->_cpt_args( $post ) );
1301
+
1302
+ switch ( $column ) {
1303
+ case 'actions' :
1304
+ echo '<a href="' . admin_url( "post.php?post={$post_id}&action=edit" ) . '" class="button-secondary">' . sprintf( __( 'Edit %s', 'yith-plugin-fw' ), ucfirst( $this->_labels['singular'] ) ) . '</a> ';
1305
+ echo '<a href="' . admin_url( 'edit.php?post_type=' . get_post_meta( $post_id, '_post_type', true ) ) . '" class="button-secondary">' . sprintf( __( 'View %s', 'yith-plugin-fw' ), $label_plural ) . '</a> ';
1306
+ break;
1307
+ }
1308
+ }
1309
+
1310
+ /**
1311
+ * Retrieve the path of layout specified in parameter
1312
+ *
1313
+ * @param $layout
1314
+ * @param $file string The file to find
1315
+ *
1316
+ * @return bool|string
1317
+ * @since 1.0
1318
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1319
+ */
1320
+ public function locate_file( $layout, $file = '' ) {
1321
+ if ( ! $this->_args['manage_layouts'] ) {
1322
+ return $this->template_path(). '/' . ( ! empty( $file ) ? $file . '.php' : '' );
1323
+ }
1324
+
1325
+ if ( ! isset( $this->layouts[ $layout ] ) ) {
1326
+ $layout = 'default';
1327
+ }
1328
+
1329
+ return $this->layouts[ $layout ]['path'] . '/' . ( ! empty( $file ) ? $file . '.php' : '' );
1330
+ }
1331
+
1332
+ /**
1333
+ * Retrieve the URL of layout specified in parameter
1334
+ *
1335
+ * @param $layout
1336
+ * @param $file string The file to find
1337
+ *
1338
+ * @return bool|string
1339
+ * @since 1.0
1340
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1341
+ */
1342
+ public function locate_url( $layout, $file = '' ) {
1343
+ if ( ! $this->_args['manage_layouts'] ) {
1344
+ return $this->template_url();
1345
+
1346
+ }
1347
+
1348
+ if ( ! isset( $this->layouts[ $layout ] ) ) {
1349
+ $layout = 'default';
1350
+ }
1351
+
1352
+ return $this->layouts[ $layout ]['url'] . '/' . ( ! empty( $file ) ? $file . '.php' : '' );
1353
+ }
1354
+
1355
+ /**
1356
+ * Retrieve the post ID relative to the post of post type
1357
+ *
1358
+ * @param $name string
1359
+ *
1360
+ * @return mixed
1361
+ * @since 1.0
1362
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1363
+ */
1364
+ protected function _get_id_by_name( $name ) {
1365
+ global $wpdb;
1366
+ return $wpdb->get_var( $wpdb->prepare( "SELECT pm.post_id FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %s AND p.post_type = %s", '_post_type', $name, $this->_name ) );
1367
+ }
1368
+
1369
+ /**
1370
+ * Retrieve the post_type of portfolio by portfolio name
1371
+ *
1372
+ * @param $name string
1373
+ *
1374
+ * @return mixed
1375
+ * @since 1.0
1376
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1377
+ */
1378
+ protected function _get_post_type_by_name( $name ) {
1379
+ global $wpdb;
1380
+ return $wpdb->get_var( $wpdb->prepare( "SELECT pm.meta_value FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND p.post_name = %s AND p.post_type = %s", '_post_type', $name, $this->_name ) );
1381
+ }
1382
+
1383
+ /**
1384
+ * The shortcode used to show the frontend
1385
+ *
1386
+ * @param array $atts
1387
+ * @param null $content
1388
+ *
1389
+ * @return string|null
1390
+ * @since 1.0
1391
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1392
+ */
1393
+ public function add_shortcode( $atts, $content = null ) {
1394
+ $atts = wp_parse_args( $atts, array(
1395
+ 'name' => null,
1396
+ 'cat' => array(),
1397
+ 'posts_per_page' => false,
1398
+ 'style' => null,
1399
+ ) );
1400
+
1401
+ // don't show the slider if 'name' is empty or is 'none'
1402
+ if ( empty( $atts['name'] ) || 'none' == $atts['name'] ) return null;
1403
+
1404
+ // compatibility fix: remove prefix if exists in portfolio object
1405
+ if( function_exists( 'YIT_Portfolio' ) && method_exists( YIT_Portfolio(), 'is' ) && YIT_Portfolio()->is( $atts['name'] ) ){
1406
+ $atts['name'] = str_replace( YIT_Portfolio()->post_type_prefix, '', $atts['name'] );
1407
+ }
1408
+
1409
+ // pass vars to template
1410
+ $atts['post_type'] = $this->_get_post_type_by_name( $atts['name'] );
1411
+ $atts['layout'] = $this->_args['manage_layouts'] ? get_post_meta( $this->_get_id_by_name( $atts['post_type'] ), $this->_args['layout_option'], true ) : '';
1412
+ extract( apply_filters( 'yit_cptu_frontend_vars', $atts, $this->_name ) );
1413
+
1414
+ // add the javascript assets
1415
+ if ( $this->_args['manage_layouts'] && isset( $this->layouts[ $layout ]['js'] ) && ! empty( $this->layouts[ $layout ]['js'] ) ) {
1416
+ foreach ( $this->layouts[ $layout ]['js'] as $asset ) {
1417
+ if ( empty( $asset ) ) continue;
1418
+
1419
+ if ( empty( $asset['src'] ) ) {
1420
+ wp_enqueue_script( $asset['handle'] );
1421
+ continue;
1422
+ }
1423
+
1424
+ yit_enqueue_script( $asset['handle'], $this->locate_url( $layout ) . $asset['src'], $asset['deps'], $asset['ver'], $asset['in_footer'] );
1425
+ }
1426
+ }
1427
+
1428
+ // Unique sequential index to differentiate more cpt in the same page
1429
+ ++$this->index;
1430
+
1431
+ ob_start();
1432
+
1433
+ include( $this->locate_file( $layout, 'markup' ) );
1434
+
1435
+ return ob_get_clean();
1436
+
1437
+ }
1438
+
1439
+ /**
1440
+ * Shortcode icon
1441
+ *
1442
+ * Return the shortcode icone to display on shortcode panel
1443
+ *
1444
+ * @param $icon_url string Icone url found by yit_shortcode plugin
1445
+ *
1446
+ * @return string
1447
+ * @since 1.0.0
1448
+ * @author Antonino Scarfi' <antonio.scarfi@yithemes.it>
1449
+ */
1450
+ public function shortcode_icon( $icon_url ) {
1451
+ return ! empty( $this->_args['shortcode_icon'] ) ? $this->_args['shortcode_icon'] : $icon_url;
1452
+ }
1453
+
1454
+ /**
1455
+ * Return an array with cptu options to shortcode panel
1456
+ *
1457
+ * All definition settings to add cptu shortcode to Yit Shortcode Panel
1458
+ *
1459
+ * @param array $shortcodes
1460
+ *
1461
+ * @return array
1462
+ * @since 1.0
1463
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1464
+ */
1465
+ public function add_shortcode_to_box( $shortcodes ) {
1466
+ $post_types = array();
1467
+
1468
+ foreach ( $this->get_post_types() as $post ) {
1469
+ $post_types[ $post->post_name ] = $post->post_title;
1470
+ }
1471
+
1472
+ $args = array(
1473
+ $this->_args['shortcode_name'] => array(
1474
+ 'title' => $this->_labels['singular'],
1475
+ 'description' => sprintf( __( 'Show frontend of the %s', 'yith-plugin-fw' ), $this->_labels['main_name'] ),
1476
+ 'tab' => 'cpt',
1477
+ 'create' => false,
1478
+ 'has_content' => false,
1479
+ 'in_visual_composer' => true,
1480
+ 'attributes' => array(
1481
+ 'name' => array(
1482
+ 'title' => __( 'Name', 'yith-plugin-fw' ),
1483
+ 'type' => 'select',
1484
+ 'options' => $post_types,
1485
+ 'std' => ''
1486
+ ),
1487
+ )
1488
+ )
1489
+ );
1490
+
1491
+ return array_merge( $shortcodes, $args );
1492
+ }
1493
+
1494
+ /**
1495
+ * Check the post type passed in parameter, if is generated by this CPTU
1496
+ *
1497
+ * @param $post_type string The post type to check
1498
+ *
1499
+ * @return bool
1500
+ * @since 1.0
1501
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1502
+ */
1503
+ protected function _is_valid( $post_type ) {
1504
+ return (bool)( strpos( $post_type, $this->_args['post_type_prefix'] ) !== false );
1505
+ }
1506
+
1507
+ /**
1508
+ * Add as a valid post type all cptu when importing dummy data
1509
+ *
1510
+ * @param $post array The post object
1511
+ *
1512
+ * @return array
1513
+ * @since 1.0
1514
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
1515
+ */
1516
+ public function add_importer_required_post_type( $post ){
1517
+ global $wp_post_types, $wp_taxonomies;
1518
+
1519
+ if( strpos( $post['post_type'], $this->_prefix_cpt ) === FALSE ){
1520
+ return $post;
1521
+ }
1522
+
1523
+ if( ! isset( $wp_post_types[ $post['post_type'] ] ) ){
1524
+ $wp_post_types[ $post['post_type'] ] = array(
1525
+ 'name' => ''
1526
+ );
1527
+ }
1528
+
1529
+ if( ! empty( $post['terms'] ) ){
1530
+ foreach( $post['terms'] as $term ){
1531
+ if( ! isset( $wp_taxonomies[ $term['domain'] ] ) ){
1532
+ $wp_taxonomies[ $term['domain'] ] = array(
1533
+ 'name' => ''
1534
+ );
1535
+ }
1536
+ }
1537
+ }
1538
+
1539
+
1540
+ return $post;
1541
+ }
1542
+
1543
+ /**
1544
+ * Add taxonomy when importing dummy data
1545
+ *
1546
+ * @param $terms array Array of terms
1547
+ *
1548
+ * @return array
1549
+ * @since 1.0
1550
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
1551
+ */
1552
+ public function add_importer_required_taxonomy( $terms ){
1553
+ global $wp_taxonomies;
1554
+
1555
+ if( ! empty( $terms ) ){
1556
+ foreach ( $terms as $term ) {
1557
+ if( isset( $term['domain'] ) && ! isset( $wp_taxonomies[ $term['domain'] ] ) ){
1558
+ $wp_taxonomies[ $term['domain'] ] = array(
1559
+ 'name' => ''
1560
+ );
1561
+ }
1562
+ }
1563
+ }
1564
+
1565
+ return $terms;
1566
+ }
1567
+
1568
+ /**
1569
+ * Force terms recount for imported taxonomy
1570
+ *
1571
+ * @param $tt_ids array Terms ids
1572
+ * @param $ids array Post ids
1573
+ * @param $tax string Taxonomy name
1574
+ *
1575
+ * @return void
1576
+ * @since 1.0
1577
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
1578
+ */
1579
+ public function recount_terms_post( $tt_ids, $ids, $tax ){
1580
+ wp_update_term_count( $tt_ids, $tax );
1581
+ }
1582
+
1583
+ // ### ASSETS ###
1584
+
1585
+ /**
1586
+ * Enqueue the assets for the admin
1587
+ *
1588
+ * @return void
1589
+ * @since 1.0
1590
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1591
+ */
1592
+ public function admin_assets() {
1593
+ wp_enqueue_media();
1594
+ wp_enqueue_script( 'yit-cptu', YIT_CORE_PLUGIN_URL . '/assets/js/yit-cpt-unlimited.js', array('jquery'), '', true );
1595
+ }
1596
+
1597
+ /**
1598
+ * Add the button to the top of the list table page of CPTU
1599
+ *
1600
+ * @return void
1601
+ * @since 1.0
1602
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1603
+ */
1604
+ public function add_button_multiuploader() {
1605
+ global $pagenow, $post_type, $wpdb;
1606
+
1607
+ if( $pagenow != 'edit.php' ){
1608
+ return;
1609
+ }
1610
+
1611
+ $cptu = $wpdb->get_var( $wpdb->prepare( "SELECT p.post_type FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %s", '_post_type', $post_type ) );
1612
+
1613
+ $post = get_post( $this->_get_id_by_name( $post_type ) );
1614
+ if ( empty( $post ) ) {
1615
+ return;
1616
+ }
1617
+ extract( $this->_cpt_args( $post ) );
1618
+
1619
+ if ( $cptu != $this->_name || ! $this->_is_valid( $post_type ) ) {
1620
+ return;
1621
+ }
1622
+ ?>
1623
+ <script>
1624
+ (function($) {
1625
+ "use strict";
1626
+ // Author code here
1627
+
1628
+ var button = $('<a />', {
1629
+ href: '#',
1630
+ class: 'multi-uploader add-new-h2',
1631
+ 'data-uploader_title': '<?php printf( __( 'Add %s from images', 'yith-plugin-fw' ), $label_plural ) ?>',
1632
+ 'data-uploader_button_text': '<?php printf( __( 'Add %s', 'yith-plugin-fw' ), $label_plural ) ?>'
1633
+ }).text('<?php _e( 'Upload multiple files', 'yith-plugin-fw' ) ?>');
1634
+
1635
+ var spinner = $('<span />', {
1636
+ class: 'spinner',
1637
+ style: 'float: none;'
1638
+ });
1639
+
1640
+ button.appendTo('.wrap h2, .wrap h1').after(spinner);
1641
+
1642
+ })(jQuery);
1643
+ </script>
1644
+ <?php
1645
+ }
1646
+
1647
+ /**
1648
+ * Add more posts by multiupload
1649
+ *
1650
+ * @return void
1651
+ * @since 1.0
1652
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1653
+ */
1654
+ public function post_multiuploader() {
1655
+ if ( ! isset( $_REQUEST['images'] ) || ! isset( $_REQUEST['post_type'] ) && $this->_is_valid( $_REQUEST['post_type'] ) ) {
1656
+ return;
1657
+ }
1658
+
1659
+ foreach ( $_REQUEST['images'] as $the ) {
1660
+
1661
+ // Create post object
1662
+ $arg = array(
1663
+ 'post_title' => $the['title'],
1664
+ 'post_type' => $_REQUEST['post_type']
1665
+ );
1666
+ $post_id = wp_insert_post( $arg );
1667
+
1668
+ set_post_thumbnail( $post_id, $the['id'] );
1669
+
1670
+ }
1671
+
1672
+ die();
1673
+ }
1674
+
1675
+
1676
+ // ###### SINGLE TEMPLATE ######
1677
+
1678
+ /**
1679
+ * Load the single template file
1680
+ *
1681
+ * @return void
1682
+ * @since 1.0
1683
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1684
+ */
1685
+ public function single_template() {
1686
+ global $post, $wpdb;
1687
+
1688
+ // if ( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ) {
1689
+ // $post = get_post( $_REQUEST['post_id'] );
1690
+ // }
1691
+
1692
+ if ( ( ( ! defined('DOING_AJAX') || ! DOING_AJAX ) && ! is_single() ) || ! isset( $post->post_type ) || ! $this->_is_valid( $post->post_type ) ) {
1693
+ return;
1694
+ }
1695
+
1696
+ // add the javascript assets
1697
+ if ( $this->_args['manage_layouts'] ) {
1698
+ foreach ( $this->layouts[ 'single' ]['js'] as $asset ) {
1699
+ yit_enqueue_script( $asset['handle'], $this->locate_url( 'single' ) . $asset['src'], $asset['deps'], $asset['ver'], $asset['in_footer'] );
1700
+ }
1701
+ }
1702
+
1703
+ $post_name = $wpdb->get_var( $wpdb->prepare( "SELECT p.post_name FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %s AND p.post_type = %s", '_post_type', $post->post_type, $this->_name ) );
1704
+ extract( apply_filters( 'yit_cptu_frontend_vars', array( 'name' => $post_name ), $this->_name ) );
1705
+
1706
+ include( $this->locate_file( 'single', 'markup' ) );
1707
+ }
1708
+
1709
+ /**
1710
+ * Load a file for the configuration of single template page of portfolio
1711
+ *
1712
+ * @return void
1713
+ * @since 1.0
1714
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1715
+ */
1716
+ public function single_template_config() {
1717
+ global $post, $wpdb;
1718
+
1719
+ if ( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ) {
1720
+ $post = get_post( $_REQUEST['post_id'] );
1721
+ }
1722
+
1723
+ if ( ( ( ! defined('DOING_AJAX') || ! DOING_AJAX ) && ! is_single() ) || ! isset( $post->post_type ) || ! $this->_is_valid( $post->post_type ) ) {
1724
+ return;
1725
+ }
1726
+
1727
+ $this->_layout = 'single';
1728
+ $path = $this->locate_file( 'single', 'config' );
1729
+
1730
+ if ( file_exists( $path ) ) {
1731
+ $post_name = $wpdb->get_var( $wpdb->prepare( "SELECT p.post_name FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %s AND p.post_type = %s", '_post_type', $post->post_type, $this->_name ) );
1732
+ extract( apply_filters( 'yit_cptu_frontend_vars', array( 'name' => $post_name ), $this->_name ) );
1733
+
1734
+ include( $path );
1735
+ }
1736
+ }
1737
+
1738
+
1739
+ // ########################## ARCHIVE TEMPLATE ###############################
1740
+
1741
+
1742
+ /**
1743
+ * Load the template for archive page
1744
+ *
1745
+ * @return void
1746
+ * @since 1.0
1747
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1748
+ */
1749
+ public function archive_template() {
1750
+ global $wp_query;
1751
+
1752
+
1753
+ // check if we are in archive template
1754
+ if ( !( ! is_admin() && is_archive() && isset($wp_query->post) && $this->_is_valid( $wp_query->post->post_type ) ) ) {
1755
+ return;
1756
+ }
1757
+
1758
+ // remove the action from loop of theme
1759
+ remove_action( 'yit_content_loop', 'yit_content_loop', 10 );
1760
+ add_action( 'yit_content_loop', array( $this, 'archive_template_loop' ), 10 );
1761
+
1762
+ }
1763
+
1764
+ /**
1765
+ * Load loop for the archive template
1766
+ *
1767
+ * @return void
1768
+ * @since 1.0
1769
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
1770
+ */
1771
+ public function archive_template_loop() {
1772
+ echo $this->add_shortcode( array( 'name' => $GLOBALS['wp_query']->post->post_type ) );
1773
+ }
1774
+
1775
  }
plugin-fw/lib/yit-metabox.php CHANGED
@@ -1,549 +1,549 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
-
12
- if (!defined('ABSPATH')) {
13
- exit;
14
- } // Exit if accessed directly
15
-
16
- if (!class_exists('YIT_Metabox')) {
17
- /**
18
- * YIT Metabox
19
- *
20
- * the metabox can be created using this code
21
- * <code>
22
- * $args1 = array(
23
- * 'label' => __( 'Metabox Label', 'yith-plugin-fw' ),
24
- * 'pages' => 'page', //or array( 'post-type1', 'post-type2')
25
- * 'context' => 'normal', //('normal', 'advanced', or 'side')
26
- * 'priority' => 'default',
27
- * 'tabs' => array(
28
- * 'settings' => array( //tab
29
- * 'label' => __( 'Settings', 'yith-plugin-fw' ),
30
- * 'fields' => array(
31
- * 'meta_checkbox' => array(
32
- * 'label' => __( 'Show title', 'yith-plugin-fw' ),
33
- * 'desc' => __( 'Choose whether to show title of the page or not.', 'yith-plugin-fw' ),
34
- * 'type' => 'checkbox',
35
- * 'private' => false,
36
- * 'std' => '1'),
37
- * ),
38
- * ),
39
- * );
40
- *
41
- * $metabox1 = YIT_Metabox( 'yit-metabox-id' );
42
- * $metabox1->init( $args );
43
- * </code>
44
- *
45
- * @class YIT_Metaboxes
46
- * @package Yithemes
47
- * @since 1.0.0
48
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
49
- *
50
- */
51
- class YIT_Metabox
52
- {
53
-
54
- /**
55
- * @var string the id of metabox
56
- *
57
- * @since 1.0
58
- */
59
-
60
- public $id;
61
-
62
- /**
63
- * @var array An array where are saved all metabox settings options
64
- *
65
- * @since 1.0
66
- */
67
- private $options = array();
68
-
69
- /**
70
- * @var array An array where are saved all tabs of metabox
71
- *
72
- * @since 1.0
73
- */
74
- private $tabs = array();
75
-
76
- /**
77
- * @var object The single instance of the class
78
- * @since 1.0
79
- */
80
- protected static $_instance = array();
81
-
82
- /**
83
- * Main Instance
84
- *
85
- * @static
86
- *
87
- * @param $id
88
- *
89
- * @return object Main instance
90
- *
91
- * @since 1.0
92
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
93
- */
94
- public static function instance($id)
95
- {
96
- if (!isset(self::$_instance[$id])) {
97
- self::$_instance[$id] = new self($id);
98
- }
99
- return self::$_instance[$id];
100
- }
101
-
102
- /**
103
- * Constructor
104
- *
105
- * @param string $id
106
- *
107
- * @return \YIT_Metabox
108
- * @since 1.0
109
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
110
- */
111
- function __construct($id = '')
112
- {
113
- $this->id = $id;
114
-
115
- }
116
-
117
-
118
- /**
119
- * Init
120
- *
121
- * set options and tabs, add actions to register metabox, scripts and save data
122
- *
123
- * @param array $options
124
- *
125
- * @return void
126
- * @since 1.0
127
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
128
- */
129
- public function init($options = array())
130
- {
131
-
132
- $this->set_options($options);
133
- $this->set_tabs();
134
-
135
-
136
- add_action('add_meta_boxes', array($this, 'register_metabox'));
137
- add_action('save_post', array($this, 'save_postdata'));
138
- add_action('admin_enqueue_scripts', array($this, 'enqueue'), 15);
139
-
140
- }
141
-
142
- /**
143
- * Enqueue script and styles in admin side
144
- *
145
- * Add style and scripts to administrator
146
- *
147
- * @return void
148
- * @since 1.0
149
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
150
- */
151
- public function enqueue()
152
- {
153
-
154
- wp_enqueue_media();
155
- wp_enqueue_style('wp-color-picker');
156
- wp_enqueue_style('yit-plugin-metaboxes', YIT_CORE_PLUGIN_URL . '/assets/css/metaboxes.css');
157
- wp_enqueue_style('jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css');
158
- wp_enqueue_script('jquery-ui-datepicker');
159
- wp_enqueue_script('yit-spinner', YIT_CORE_PLUGIN_URL . '/assets/js/panel.spinner.js', array('jquery'), '0.0.1', true);
160
- wp_enqueue_script('jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array('jquery'), '1.1.0', true);
161
- wp_enqueue_script('ajax-chosen', yit_load_js_file(YIT_CORE_PLUGIN_URL . '/assets/js/chosen/ajax-chosen.jquery.js'), array('jquery'), '1.1.0', true);
162
- wp_enqueue_script('yit-metabox', YIT_CORE_PLUGIN_URL . '/assets/js/metabox.js', array('jquery', 'wp-color-picker'), '1.0.0', true);
163
- wp_enqueue_style('jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all');
164
- }
165
-
166
- /**
167
- * Set Options
168
- *
169
- * Set the variable options
170
- *
171
- * @param array $options
172
- *
173
- * @return void
174
- * @since 1.0
175
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
176
- */
177
- public function set_options($options = array())
178
- {
179
- $this->options = $options;
180
-
181
- }
182
-
183
- /**
184
- * Set Tabs
185
- *
186
- * Set the variable tabs
187
- *
188
- * @internal param array $tabs
189
- *
190
- * @return void
191
- * @since 1.0
192
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
193
- */
194
- public function set_tabs()
195
- {
196
- if (!isset($this->options['tabs'])) {
197
- return;
198
- }
199
- $this->tabs = $this->options['tabs'];
200
- if (isset($this->tabs['settings']['fields'])) {
201
- $this->tabs['settings']['fields'] = array_filter($this->tabs['settings']['fields']);
202
- }
203
- }
204
-
205
-
206
- /**
207
- * Add Tab
208
- *
209
- * Add a tab inside the metabox
210
- *
211
- * @internal param array $tabs
212
- *
213
- * @param array $tab the new tab to add to the metabox
214
- * @param string $where tell where insert the tab if after or before a $refer
215
- * @param null $refer an existent tab inside metabox
216
- *
217
- * @return void
218
- * @since 1.0
219
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
220
- */
221
- public function add_tab($tab, $where = 'after', $refer = null)
222
- {
223
- if (!is_null($refer)) {
224
- $ref_pos = array_search($refer, array_keys($this->tabs));
225
- if ($ref_pos !== false) {
226
- if ($where == 'after') {
227
- $this->tabs = array_slice($this->tabs, 0, $ref_pos + 1, true) +
228
- $tab +
229
- array_slice($this->tabs, $ref_pos + 1, count($this->tabs) - 1, true);
230
- } else {
231
- $this->tabs = array_slice($this->tabs, 0, $ref_pos, true) +
232
- $tab +
233
- array_slice($this->tabs, $ref_pos, count($this->tabs), true);
234
- }
235
- }
236
- } else {
237
- $this->tabs = array_merge($tab, $this->tabs);
238
- }
239
-
240
- }
241
-
242
- /**
243
- * Remove Tab
244
- *
245
- * Remove a tab from the tabs of metabox
246
- *
247
- * @internal param array $tabs
248
- *
249
- * @param $id_tab
250
- *
251
- * @return void
252
- * @since 1.0
253
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
254
- */
255
- public function remove_tab($id_tab)
256
- {
257
- if (isset($this->tabs[$id_tab])) {
258
- unset ($this->tabs[$id_tab]);
259
- }
260
- }
261
-
262
-
263
- /**
264
- * Add Field
265
- *
266
- * Add a field inside a tab of metabox
267
- *
268
- * @internal param array $tabs
269
- *
270
- * @param string $tab_id the id of the tabs where add the field
271
- * @param array $args the field to add
272
- * @param string $where tell where insert the field if after or before a $refer
273
- * @param null $refer an existent field inside tab
274
- *
275
- * @return void
276
- * @since 1.0
277
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
278
- */
279
- public function add_field($tab_id, $args, $where = 'after', $refer = null)
280
- {
281
- if (isset($this->tabs[$tab_id])) {
282
-
283
- $cf = $this->tabs[$tab_id]['fields'];
284
- if (!is_null($refer)) {
285
- $ref_pos = array_search($refer, array_keys($cf));
286
- if ($ref_pos !== false) {
287
- if ($where == 'after') {
288
- $this->tabs[$tab_id]['fields'] = array_slice($cf, 0, $ref_pos + 1, true) +
289
- $args +
290
- array_slice($cf, $ref_pos, count($cf) - 1, true);
291
-
292
- } elseif ($where == 'before') {
293
- $this->tabs[$tab_id]['fields'] = array_slice($cf, 0, $ref_pos, true) +
294
- $args +
295
- array_slice($cf, $ref_pos, count($cf), true);
296
-
297
- }
298
- }
299
- } else {
300
- if ($where == 'first') {
301
- $this->tabs[$tab_id]['fields'] = $args + $cf;
302
-
303
- } else {
304
- $this->tabs[$tab_id]['fields'] = array_merge($this->tabs[$tab_id]['fields'], $args);
305
- }
306
- }
307
-
308
- }
309
-
310
-
311
- }
312
-
313
- /**
314
- * Remove Field
315
- *
316
- * Remove a field from the metabox, search inside the tabs and remove it if exists
317
- *
318
- * @param $id_field
319
- *
320
- * @return void
321
- * @since 1.0
322
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
323
- */
324
- public function remove_field($id_field)
325
- {
326
- foreach ($this->tabs as $tab_name => $tab) {
327
- if (isset($tab['fields'][$id_field])) {
328
- unset ($this->tabs[$tab_name]['fields'][$id_field]);
329
- }
330
- }
331
- }
332
-
333
- /**
334
- * Reorder tabs
335
- *
336
- * Order the tabs and fields and set id and name to each field
337
- *
338
- * @internal param $id_field
339
- *
340
- * @return void
341
- * @since 1.0
342
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
343
- */
344
- public function reorder_tabs()
345
- {
346
- foreach ($this->tabs as $tab_name => $tab) {
347
- foreach ($tab['fields'] as $id_field => $field) {
348
- $this->tabs[$tab_name]['fields'][$id_field]['private'] = (isset($field['private'])) ? $field['private'] : true;
349
- $this->tabs[$tab_name]['fields'][$id_field]['id'] = $this->get_option_metabox_id($id_field, $this->tabs[$tab_name]['fields'][$id_field]['private']);
350
- $this->tabs[$tab_name]['fields'][$id_field]['name'] = $this->get_option_metabox_name($this->tabs[$tab_name]['fields'][$id_field]['id']);
351
- }
352
- }
353
-
354
- }
355
-
356
-
357
- /**
358
- * Get Option Metabox ID
359
- *
360
- * return the id of the field
361
- *
362
- * @param string $id_field
363
- * @param bool $private if private add an _befor the id
364
- *
365
- * @return string
366
- * @since 1.0
367
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
368
- */
369
- public function get_option_metabox_id($id_field, $private = true)
370
- {
371
- if ($private) {
372
- return '_' . $id_field;
373
- } else {
374
- return $id_field;
375
- }
376
- }
377
-
378
- /**
379
- * Get Option Metabox Name
380
- *
381
- * return the name of the field, this name will be used as attribute name of the input field
382
- *
383
- * @param string $id_field
384
- * @param bool $private if private add an _befor the id
385
- *
386
- * @return string
387
- * @since 1.0
388
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
389
- */
390
- public function get_option_metabox_name($id_field, $private = true)
391
- {
392
- $db_name = apply_filters('yit_metaboxes_option_main_name', 'yit_metaboxes');
393
- $return = $db_name . '[';
394
-
395
- if (!strpos($id_field, '[')) {
396
- return $return . $id_field . ']';
397
- }
398
- $return .= substr($id_field, 0, strpos($id_field, '['));
399
- $return .= ']';
400
- $return .= substr($id_field, strpos($id_field, '['));
401
-
402
- return $return;
403
- }
404
-
405
- /**
406
- * Register the metabox
407
- *
408
- * call the wp function add_metabox to add the metabox
409
- *
410
- *
411
- * @return void
412
- * @since 1.0
413
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
414
- */
415
- public function register_metabox($post_type)
416
- {
417
- if (in_array($post_type, (array)$this->options['pages'])) {
418
- add_meta_box($this->id, $this->options['label'], array($this, 'show'), $post_type, $this->options['context'], $this->options['priority']);
419
- }
420
- }
421
-
422
- /**
423
- * Show metabox
424
- *
425
- * show the html of metabox
426
- *
427
- *
428
- * @return void
429
- * @since 1.0
430
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
431
- */
432
- public function show()
433
- {
434
- $this->reorder_tabs();
435
-
436
- yit_plugin_get_template(YIT_CORE_PLUGIN_PATH, 'metaboxes/tab.php', array('tabs' => $this->tabs));
437
- }
438
-
439
- /**
440
- * Save Post Data
441
- *
442
- * Save the post data in the database when save the post
443
- *
444
- * @param $post_id
445
- *
446
- * @return int
447
- * @since 1.0
448
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
449
- */
450
- public function save_postdata($post_id)
451
- {
452
-
453
-
454
- if (!isset($_POST['yit_metaboxes_nonce']) || !wp_verify_nonce($_POST['yit_metaboxes_nonce'], 'metaboxes-fields-nonce')) {
455
- return $post_id;
456
- }
457
-
458
-
459
- if ((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || (defined('DOING_AJAX') && DOING_AJAX)) {
460
- return $post_id;
461
- }
462
-
463
- if (isset($_POST['post_type'])) {
464
- $post_type = $_POST['post_type'];
465
- } else {
466
- return $post_id;
467
- }
468
-
469
- if ('page' == $post_type) {
470
- if (!current_user_can('edit_page', $post_id)) {
471
- return $post_id;
472
- }
473
- } else {
474
- if (!current_user_can('edit_post', $post_id)) {
475
- return $post_id;
476
- }
477
- }
478
-
479
- if (!in_array($post_type, (array)$this->options['pages'])) {
480
- return $post_id;
481
- }
482
-
483
- $this->reorder_tabs();
484
-
485
-
486
- foreach ($this->tabs as $tab) {
487
-
488
- foreach ($tab['fields'] as $field) {
489
-
490
- if (in_array($field['type'], array('title'))) {
491
- continue;
492
- }
493
-
494
- if (isset($_POST['yit_metaboxes'][$field['id']])) {
495
-
496
- add_post_meta($post_id, $field['id'], $_POST['yit_metaboxes'][$field['id']], true) || update_post_meta($post_id, $field['id'], $_POST['yit_metaboxes'][$field['id']]);
497
- } elseif (in_array($field['type'], array('onoff', 'checkbox'))) {
498
- update_post_meta($post_id, $field['id'], '0');
499
- } else {
500
- delete_post_meta($post_id, $field['id']);
501
- }
502
- }
503
- }
504
-
505
-
506
- }
507
-
508
- /**
509
- * Remove Fields
510
- *
511
- * Remove a fields list from the metabox, search inside the tabs and remove it if exists
512
- *
513
- * @param $id_fields
514
- *
515
- * @return void
516
- * @since 2.0.0
517
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
518
- */
519
- public function remove_fields($id_fields)
520
- {
521
- foreach ($id_fields as $k => $field) {
522
- $this->remove_field($field);
523
- }
524
- }
525
- }
526
- }
527
-
528
- if (!function_exists('YIT_Metabox')) {
529
-
530
- /**
531
- * Main instance of plugin
532
- *
533
- * @param $id
534
- *
535
- * @return \YIT_Metabox
536
- * @since 1.0
537
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
538
- */
539
-
540
-
541
- function YIT_Metabox($id)
542
- {
543
- return YIT_Metabox::instance($id);
544
- }
545
- }
546
-
547
-
548
-
549
-
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+
12
+ if (!defined('ABSPATH')) {
13
+ exit;
14
+ } // Exit if accessed directly
15
+
16
+ if (!class_exists('YIT_Metabox')) {
17
+ /**
18
+ * YIT Metabox
19
+ *
20
+ * the metabox can be created using this code
21
+ * <code>
22
+ * $args1 = array(
23
+ * 'label' => __( 'Metabox Label', 'yith-plugin-fw' ),
24
+ * 'pages' => 'page', //or array( 'post-type1', 'post-type2')
25
+ * 'context' => 'normal', //('normal', 'advanced', or 'side')
26
+ * 'priority' => 'default',
27
+ * 'tabs' => array(
28
+ * 'settings' => array( //tab
29
+ * 'label' => __( 'Settings', 'yith-plugin-fw' ),
30
+ * 'fields' => array(
31
+ * 'meta_checkbox' => array(
32
+ * 'label' => __( 'Show title', 'yith-plugin-fw' ),
33
+ * 'desc' => __( 'Choose whether to show title of the page or not.', 'yith-plugin-fw' ),
34
+ * 'type' => 'checkbox',
35
+ * 'private' => false,
36
+ * 'std' => '1'),
37
+ * ),
38
+ * ),
39
+ * );
40
+ *
41
+ * $metabox1 = YIT_Metabox( 'yit-metabox-id' );
42
+ * $metabox1->init( $args );
43
+ * </code>
44
+ *
45
+ * @class YIT_Metaboxes
46
+ * @package Yithemes
47
+ * @since 1.0.0
48
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
49
+ *
50
+ */
51
+ class YIT_Metabox
52
+ {
53
+
54
+ /**
55
+ * @var string the id of metabox
56
+ *
57
+ * @since 1.0
58
+ */
59
+
60
+ public $id;
61
+
62
+ /**
63
+ * @var array An array where are saved all metabox settings options
64
+ *
65
+ * @since 1.0
66
+ */
67
+ private $options = array();
68
+
69
+ /**
70
+ * @var array An array where are saved all tabs of metabox
71
+ *
72
+ * @since 1.0
73
+ */
74
+ private $tabs = array();
75
+
76
+ /**
77
+ * @var object The single instance of the class
78
+ * @since 1.0
79
+ */
80
+ protected static $_instance = array();
81
+
82
+ /**
83
+ * Main Instance
84
+ *
85
+ * @static
86
+ *
87
+ * @param $id
88
+ *
89
+ * @return object Main instance
90
+ *
91
+ * @since 1.0
92
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
93
+ */
94
+ public static function instance($id)
95
+ {
96
+ if (!isset(self::$_instance[$id])) {
97
+ self::$_instance[$id] = new self($id);
98
+ }
99
+ return self::$_instance[$id];
100
+ }
101
+
102
+ /**
103
+ * Constructor
104
+ *
105
+ * @param string $id
106
+ *
107
+ * @return \YIT_Metabox
108
+ * @since 1.0
109
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
110
+ */
111
+ function __construct($id = '')
112
+ {
113
+ $this->id = $id;
114
+
115
+ }
116
+
117
+
118
+ /**
119
+ * Init
120
+ *
121
+ * set options and tabs, add actions to register metabox, scripts and save data
122
+ *
123
+ * @param array $options
124
+ *
125
+ * @return void
126
+ * @since 1.0
127
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
128
+ */
129
+ public function init($options = array())
130
+ {
131
+
132
+ $this->set_options($options);
133
+ $this->set_tabs();
134
+
135
+
136
+ add_action('add_meta_boxes', array($this, 'register_metabox'));
137
+ add_action('save_post', array($this, 'save_postdata'));
138
+ add_action('admin_enqueue_scripts', array($this, 'enqueue'), 15);
139
+
140
+ }
141
+
142
+ /**
143
+ * Enqueue script and styles in admin side
144
+ *
145
+ * Add style and scripts to administrator
146
+ *
147
+ * @return void
148
+ * @since 1.0
149
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
150
+ */
151
+ public function enqueue()
152
+ {
153
+
154
+ wp_enqueue_media();
155
+ wp_enqueue_style('wp-color-picker');
156
+ wp_enqueue_style('yit-plugin-metaboxes', YIT_CORE_PLUGIN_URL . '/assets/css/metaboxes.css');
157
+ wp_enqueue_style('jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css');
158
+ wp_enqueue_script('jquery-ui-datepicker');
159
+ wp_enqueue_script('yit-spinner', YIT_CORE_PLUGIN_URL . '/assets/js/panel.spinner.js', array('jquery'), '0.0.1', true);
160
+ wp_enqueue_script('jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array('jquery'), '1.1.0', true);
161
+ wp_enqueue_script('ajax-chosen', yit_load_js_file(YIT_CORE_PLUGIN_URL . '/assets/js/chosen/ajax-chosen.jquery.js'), array('jquery'), '1.1.0', true);
162
+ wp_enqueue_script('yit-metabox', YIT_CORE_PLUGIN_URL . '/assets/js/metabox.js', array('jquery', 'wp-color-picker'), '1.0.0', true);
163
+ wp_enqueue_style('jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-custom/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all');
164
+ }
165
+
166
+ /**
167
+ * Set Options
168
+ *
169
+ * Set the variable options
170
+ *
171
+ * @param array $options
172
+ *
173
+ * @return void
174
+ * @since 1.0
175
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
176
+ */
177
+ public function set_options($options = array())
178
+ {
179
+ $this->options = $options;
180
+
181
+ }
182
+
183
+ /**
184
+ * Set Tabs
185
+ *
186
+ * Set the variable tabs
187
+ *
188
+ * @internal param array $tabs
189
+ *
190
+ * @return void
191
+ * @since 1.0
192
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
193
+ */
194
+ public function set_tabs()
195
+ {
196
+ if (!isset($this->options['tabs'])) {
197
+ return;
198
+ }
199
+ $this->tabs = $this->options['tabs'];
200
+ if (isset($this->tabs['settings']['fields'])) {
201
+ $this->tabs['settings']['fields'] = array_filter($this->tabs['settings']['fields']);
202
+ }
203
+ }
204
+
205
+
206
+ /**
207
+ * Add Tab
208
+ *
209
+ * Add a tab inside the metabox
210
+ *
211
+ * @internal param array $tabs
212
+ *
213
+ * @param array $tab the new tab to add to the metabox
214
+ * @param string $where tell where insert the tab if after or before a $refer
215
+ * @param null $refer an existent tab inside metabox
216
+ *
217
+ * @return void
218
+ * @since 1.0
219
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
220
+ */
221
+ public function add_tab($tab, $where = 'after', $refer = null)
222
+ {
223
+ if (!is_null($refer)) {
224
+ $ref_pos = array_search($refer, array_keys($this->tabs));
225
+ if ($ref_pos !== false) {
226
+ if ($where == 'after') {
227
+ $this->tabs = array_slice($this->tabs, 0, $ref_pos + 1, true) +
228
+ $tab +
229
+ array_slice($this->tabs, $ref_pos + 1, count($this->tabs) - 1, true);
230
+ } else {
231
+ $this->tabs = array_slice($this->tabs, 0, $ref_pos, true) +
232
+ $tab +
233
+ array_slice($this->tabs, $ref_pos, count($this->tabs), true);
234
+ }
235
+ }
236
+ } else {
237
+ $this->tabs = array_merge($tab, $this->tabs);
238
+ }
239
+
240
+ }
241
+
242
+ /**
243
+ * Remove Tab
244
+ *
245
+ * Remove a tab from the tabs of metabox
246
+ *
247
+ * @internal param array $tabs
248
+ *
249
+ * @param $id_tab
250
+ *
251
+ * @return void
252
+ * @since 1.0
253
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
254
+ */
255
+ public function remove_tab($id_tab)
256
+ {
257
+ if (isset($this->tabs[$id_tab])) {
258
+ unset ($this->tabs[$id_tab]);
259
+ }
260
+ }
261
+
262
+
263
+ /**
264
+ * Add Field
265
+ *
266
+ * Add a field inside a tab of metabox
267
+ *
268
+ * @internal param array $tabs
269
+ *
270
+ * @param string $tab_id the id of the tabs where add the field
271
+ * @param array $args the field to add
272
+ * @param string $where tell where insert the field if after or before a $refer
273
+ * @param null $refer an existent field inside tab
274
+ *
275
+ * @return void
276
+ * @since 1.0
277
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
278
+ */
279
+ public function add_field($tab_id, $args, $where = 'after', $refer = null)
280
+ {
281
+ if (isset($this->tabs[$tab_id])) {
282
+
283
+ $cf = $this->tabs[$tab_id]['fields'];
284
+ if (!is_null($refer)) {
285
+ $ref_pos = array_search($refer, array_keys($cf));
286
+ if ($ref_pos !== false) {
287
+ if ($where == 'after') {
288
+ $this->tabs[$tab_id]['fields'] = array_slice($cf, 0, $ref_pos + 1, true) +
289
+ $args +
290
+ array_slice($cf, $ref_pos, count($cf) - 1, true);
291
+
292
+ } elseif ($where == 'before') {
293
+ $this->tabs[$tab_id]['fields'] = array_slice($cf, 0, $ref_pos, true) +
294
+ $args +
295
+ array_slice($cf, $ref_pos, count($cf), true);
296
+
297
+ }
298
+ }
299
+ } else {
300
+ if ($where == 'first') {
301
+ $this->tabs[$tab_id]['fields'] = $args + $cf;
302
+
303
+ } else {
304
+ $this->tabs[$tab_id]['fields'] = array_merge($this->tabs[$tab_id]['fields'], $args);
305
+ }
306
+ }
307
+
308
+ }
309
+
310
+
311
+ }
312
+
313
+ /**
314
+ * Remove Field
315
+ *
316
+ * Remove a field from the metabox, search inside the tabs and remove it if exists
317
+ *
318
+ * @param $id_field
319
+ *
320
+ * @return void
321
+ * @since 1.0
322
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
323
+ */
324
+ public function remove_field($id_field)
325
+ {
326
+ foreach ($this->tabs as $tab_name => $tab) {
327
+ if (isset($tab['fields'][$id_field])) {
328
+ unset ($this->tabs[$tab_name]['fields'][$id_field]);
329
+ }
330
+ }
331
+ }
332
+
333
+ /**
334
+ * Reorder tabs
335
+ *
336
+ * Order the tabs and fields and set id and name to each field
337
+ *
338
+ * @internal param $id_field
339
+ *
340
+ * @return void
341
+ * @since 1.0
342
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
343
+ */
344
+ public function reorder_tabs()
345
+ {
346
+ foreach ($this->tabs as $tab_name => $tab) {
347
+ foreach ($tab['fields'] as $id_field => $field) {
348
+ $this->tabs[$tab_name]['fields'][$id_field]['private'] = (isset($field['private'])) ? $field['private'] : true;
349
+ $this->tabs[$tab_name]['fields'][$id_field]['id'] = $this->get_option_metabox_id($id_field, $this->tabs[$tab_name]['fields'][$id_field]['private']);
350
+ $this->tabs[$tab_name]['fields'][$id_field]['name'] = $this->get_option_metabox_name($this->tabs[$tab_name]['fields'][$id_field]['id']);
351
+ }
352
+ }
353
+
354
+ }
355
+
356
+
357
+ /**
358
+ * Get Option Metabox ID
359
+ *
360
+ * return the id of the field
361
+ *
362
+ * @param string $id_field
363
+ * @param bool $private if private add an _befor the id
364
+ *
365
+ * @return string
366
+ * @since 1.0
367
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
368
+ */
369
+ public function get_option_metabox_id($id_field, $private = true)
370
+ {
371
+ if ($private) {
372
+ return '_' . $id_field;
373
+ } else {
374
+ return $id_field;
375
+ }
376
+ }
377
+
378
+ /**
379
+ * Get Option Metabox Name
380
+ *
381
+ * return the name of the field, this name will be used as attribute name of the input field
382
+ *
383
+ * @param string $id_field
384
+ * @param bool $private if private add an _befor the id
385
+ *
386
+ * @return string
387
+ * @since 1.0
388
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
389
+ */
390
+ public function get_option_metabox_name($id_field, $private = true)
391
+ {
392
+ $db_name = apply_filters('yit_metaboxes_option_main_name', 'yit_metaboxes');
393
+ $return = $db_name . '[';
394
+
395
+ if (!strpos($id_field, '[')) {
396
+ return $return . $id_field . ']';
397
+ }
398
+ $return .= substr($id_field, 0, strpos($id_field, '['));
399
+ $return .= ']';
400
+ $return .= substr($id_field, strpos($id_field, '['));
401
+
402
+ return $return;
403
+ }
404
+
405
+ /**
406
+ * Register the metabox
407
+ *
408
+ * call the wp function add_metabox to add the metabox
409
+ *
410
+ *
411
+ * @return void
412
+ * @since 1.0
413
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
414
+ */
415
+ public function register_metabox($post_type)
416
+ {
417
+ if (in_array($post_type, (array)$this->options['pages'])) {
418
+ add_meta_box($this->id, $this->options['label'], array($this, 'show'), $post_type, $this->options['context'], $this->options['priority']);
419
+ }
420
+ }
421
+
422
+ /**
423
+ * Show metabox
424
+ *
425
+ * show the html of metabox
426
+ *
427
+ *
428
+ * @return void
429
+ * @since 1.0
430
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
431
+ */
432
+ public function show()
433
+ {
434
+ $this->reorder_tabs();
435
+
436
+ yit_plugin_get_template(YIT_CORE_PLUGIN_PATH, 'metaboxes/tab.php', array('tabs' => $this->tabs));
437
+ }
438
+
439
+ /**
440
+ * Save Post Data
441
+ *
442
+ * Save the post data in the database when save the post
443
+ *
444
+ * @param $post_id
445
+ *
446
+ * @return int
447
+ * @since 1.0
448
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
449
+ */
450
+ public function save_postdata($post_id)
451
+ {
452
+
453
+
454
+ if (!isset($_POST['yit_metaboxes_nonce']) || !wp_verify_nonce($_POST['yit_metaboxes_nonce'], 'metaboxes-fields-nonce')) {
455
+ return $post_id;
456
+ }
457
+
458
+
459
+ if ((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || (defined('DOING_AJAX') && DOING_AJAX)) {
460
+ return $post_id;
461
+ }
462
+
463
+ if (isset($_POST['post_type'])) {
464
+ $post_type = $_POST['post_type'];
465
+ } else {
466
+ return $post_id;
467
+ }
468
+
469
+ if ('page' == $post_type) {
470
+ if (!current_user_can('edit_page', $post_id)) {
471
+ return $post_id;
472
+ }
473
+ } else {
474
+ if (!current_user_can('edit_post', $post_id)) {
475
+ return $post_id;
476
+ }
477
+ }
478
+
479
+ if (!in_array($post_type, (array)$this->options['pages'])) {
480
+ return $post_id;
481
+ }
482
+
483
+ $this->reorder_tabs();
484
+
485
+
486
+ foreach ($this->tabs as $tab) {
487
+
488
+ foreach ($tab['fields'] as $field) {
489
+
490
+ if (in_array($field['type'], array('title'))) {
491
+ continue;
492
+ }
493
+
494
+ if (isset($_POST['yit_metaboxes'][$field['id']])) {
495
+
496
+ add_post_meta($post_id, $field['id'], $_POST['yit_metaboxes'][$field['id']], true) || update_post_meta($post_id, $field['id'], $_POST['yit_metaboxes'][$field['id']]);
497
+ } elseif (in_array($field['type'], array('onoff', 'checkbox'))) {
498
+ update_post_meta($post_id, $field['id'], '0');
499
+ } else {
500
+ delete_post_meta($post_id, $field['id']);
501
+ }
502
+ }
503
+ }
504
+
505
+
506
+ }
507
+
508
+ /**
509
+ * Remove Fields
510
+ *
511
+ * Remove a fields list from the metabox, search inside the tabs and remove it if exists
512
+ *
513
+ * @param $id_fields
514
+ *
515
+ * @return void
516
+ * @since 2.0.0
517
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
518
+ */
519
+ public function remove_fields($id_fields)
520
+ {
521
+ foreach ($id_fields as $k => $field) {
522
+ $this->remove_field($field);
523
+ }
524
+ }
525
+ }
526
+ }
527
+
528
+ if (!function_exists('YIT_Metabox')) {
529
+
530
+ /**
531
+ * Main instance of plugin
532
+ *
533
+ * @param $id
534
+ *
535
+ * @return \YIT_Metabox
536
+ * @since 1.0
537
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
538
+ */
539
+
540
+
541
+ function YIT_Metabox($id)
542
+ {
543
+ return YIT_Metabox::instance($id);
544
+ }
545
+ }
546
+
547
+
548
+
549
+
plugin-fw/lib/yit-plugin-common.php CHANGED
@@ -1,1260 +1,1260 @@
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 ( ! class_exists( 'YIT_Plugin_Common' ) ) :
12
-
13
- /**
14
- * Core configuration class
15
- *
16
- * @since 1.0.0
17
- */
18
- class YIT_Plugin_Common {
19
-
20
- /**
21
- * Config array
22
- *
23
- * @var array
24
- */
25
- protected static $_config = array(
26
- 'slider' => array( 'nivo', 'elegant' ),
27
-
28
-
29
- 'awesome_icons' => array(
30
- '' => 'no-icon',
31
- 'f042' => 'adjust',
32
- 'f170' => 'adn',
33
- 'f037' => 'align-center',
34
- 'f039' => 'align-justify',
35
- 'f036' => 'align-left',
36
- 'f038' => 'align-right',
37
- 'f0f9' => 'ambulance',
38
- 'f13d' => 'anchor',
39
- 'f17b' => 'android',
40
- 'f103' => 'angle-double-down',
41
- 'f100' => 'angle-double-left',
42
- 'f101' => 'angle-double-right',
43
- 'f102' => 'angle-double-up',
44
- 'f107' => 'angle-down',
45
- 'f104' => 'angle-left',
46
- 'f105' => 'angle-right',
47
- 'f106' => 'angle-up',
48
- 'f179' => 'apple',
49
- 'f187' => 'archive',
50
- 'f0ab' => 'arrow-circle-down',
51
- 'f0a8' => 'arrow-circle-left',
52
- 'f01a' => 'arrow-circle-o-down',
53
- 'f190' => 'arrow-circle-o-left',
54
- 'f18e' => 'arrow-circle-o-right',
55
- 'f01b' => 'arrow-circle-o-up',
56
- 'f0a9' => 'arrow-circle-right',
57
- 'f0aa' => 'arrow-circle-up',
58
- 'f063' => 'arrow-down',
59
- 'f060' => 'arrow-left',
60
- 'f061' => 'arrow-right',
61
- 'f062' => 'arrow-up',
62
- 'f047' => 'arrows',
63
- 'f0b2' => 'arrows-alt',
64
- 'f07e' => 'arrows-h',
65
- 'f07d' => 'arrows-v',
66
- 'f069' => 'asterisk',
67
- 'f04a' => 'backward',
68
- 'f05e' => 'ban',
69
- 'f080' => 'bar-chart-o',
70
- 'f02a' => 'barcode',
71
- 'f0c9' => 'bars',
72
- 'f0fc' => 'beer',
73
- 'f0f3' => 'bell',
74
- 'f0a2' => 'bell-o',
75
- 'f171' => 'bitbucket',
76
- 'f172' => 'bitbucket-square',
77
- 'f032' => 'bold',
78
- 'f0e7' => 'bolt',
79
- 'f02d' => 'book',
80
- 'f02e' => 'bookmark',
81
- 'f097' => 'bookmark-o',
82
- 'f0b1' => 'briefcase',
83
- 'f15a' => 'btc',
84
- 'f188' => 'bug',
85
- 'f0f7' => 'building-o',
86
- 'f0a1' => 'bullhorn',
87
- 'f140' => 'bullseye',
88
- 'f073' => 'calendar',
89
- 'f133' => 'calendar-o',
90
- 'f030' => 'camera',
91
- 'f083' => 'camera-retro',
92
- 'f0d7' => 'caret-down',
93
- 'f0d9' => 'caret-left',
94
- 'f0da' => 'caret-right',
95
- 'f150' => 'caret-square-o-down',
96
- 'f191' => 'caret-square-o-left',
97
- 'f152' => 'caret-square-o-right',
98
- 'f151' => 'caret-square-o-up',
99
- 'f0d8' => 'caret-up',
100
- 'f0a3' => 'certificate',
101
- 'f127' => 'chain-broken',
102
- 'f00c' => 'check',
103
- 'f058' => 'check-circle',
104
- 'f05d' => 'check-circle-o',
105
- 'f14a' => 'check-square',
106
- 'f046' => 'check-square-o',
107
- 'f13a' => 'chevron-circle-down',
108
- 'f137' => 'chevron-circle-left',
109
- 'f138' => 'chevron-circle-right',
110
- 'f139' => 'chevron-circle-up',
111
- 'f078' => 'chevron-down',
112
- 'f053' => 'chevron-left',
113
- 'f054' => 'chevron-right',
114
- 'f077' => 'chevron-up',
115
- 'f10c' => 'circle-o',
116
- 'f0ea' => 'clipboard',
117
- 'f017' => 'clock-o',
118
- 'f0c2' => 'cloud',
119
- 'f0ed' => 'cloud-download',
120
- 'f0ee' => 'cloud-upload',
121
- 'f121' => 'code',
122
- 'f126' => 'code-fork',
123
- 'f0f4' => 'coffee',
124
- 'f013' => 'cog',
125
- 'f085' => 'cogs',
126
- 'f0db' => 'columns',
127
- 'f075' => 'comment',
128
- 'f0e5' => 'comment-o',
129
- 'f086' => 'comments',
130
- 'f0e6' => 'comments-o',
131
- 'f14e' => 'compass',
132
- 'f066' => 'compress',
133
- 'f09d' => 'credit-card',
134
- 'f125' => 'crop',
135
- 'f05b' => 'crosshairs',
136
- 'f13c' => 'css3',
137
- 'f0f5' => 'cutlery',
138
- 'f108' => 'desktop',
139
- 'f192' => 'dot-circle-o',
140
- 'f019' => 'download',
141
- 'f17d' => 'dribbble',
142
- 'f16b' => 'dropbox',
143
- 'f052' => 'eject',
144
- 'f141' => 'ellipsis-h',
145
- 'f142' => 'ellipsis-v',
146
- 'f0e0' => 'envelope',
147
- 'f003' => 'envelope-o',
148
- 'f12d' => 'eraser',
149
- 'f153' => 'eur',
150
- 'f0ec' => 'exchange',
151
- 'f12a' => 'exclamation',
152
- 'f06a' => 'exclamation-circle',
153
- 'f071' => 'exclamation-triangle',
154
- 'f065' => 'expand',
155
- 'f08e' => 'external-link',
156
- 'f14c' => 'external-link-square',
157
- 'f06e' => 'eye',
158
- 'f070' => 'eye-slash',
159
- 'f09a' => 'facebook',
160
- 'f082' => 'facebook-square',
161
- 'f049' => 'fast-backward',
162
- 'f050' => 'fast-forward',
163
- 'f182' => 'female',
164
- 'f0fb' => 'fighter-jet',
165
- 'f15b' => 'file',
166
- 'f016' => 'file-o',
167
- 'f15c' => 'file-text',
168
- 'f0f6' => 'file-text-o',
169
- 'f0c5' => 'files-o',
170
- 'f008' => 'film',
171
- 'f0b0' => 'filter',
172
- 'f06d' => 'fire',
173
- 'f134' => 'fire-extinguisher',
174
- 'f024' => 'flag',
175
- 'f11e' => 'flag-checkered',
176
- 'f11d' => 'flag-o',
177
- 'f0c3' => 'flask',
178
- 'f16e' => 'flickr',
179
- 'f0c7' => 'floppy-o',
180
- 'f07b' => 'folder',
181
- 'f114' => 'folder-o',
182
- 'f07c' => 'folder-open',
183
- 'f115' => 'folder-open-o',
184
- 'f031' => 'font',
185
- 'f04e' => 'forward',
186
- 'f180' => 'foursquare',
187
- 'f119' => 'frown-o',
188
- 'f11b' => 'gamepad',
189
- 'f0e3' => 'gavel',
190
- 'f154' => 'gbp',
191
- 'f06b' => 'gift',
192
- 'f09b' => 'github',
193
- 'f113' => 'github-alt',
194
- 'f092' => 'github-square',
195
- 'f184' => 'gittip',
196
- 'f000' => 'glass',
197
- 'f0ac' => 'globe',
198
- 'f0d5' => 'google-plus',
199
- 'f0d4' => 'google-plus-square',
200
- 'f0fd' => 'h-square',
201
- 'f0a7' => 'hand-o-down',
202
- 'f0a5' => 'hand-o-left',
203
- 'f0a4' => 'hand-o-right',
204
- 'f0a6' => 'hand-o-up',
205
- 'f0a0' => 'hdd-o',
206
- 'f025' => 'headphones',
207
- 'f004' => 'heart',
208
- 'f08a' => 'heart-o',
209
- 'f015' => 'home',
210
- 'f0f8' => 'hospital-o',
211
- 'f13b' => 'html5',
212
- 'f01c' => 'inbox',
213
- 'f03c' => 'indent',
214
- 'f129' => 'info',
215
- 'f05a' => 'info-circle',
216
- 'f156' => 'inr',
217
- 'f16d' => 'instagram',
218
- 'f033' => 'italic',
219
- 'f157' => 'jpy',
220
- 'f084' => 'key',
221
- 'f11c' => 'keyboard-o',
222
- 'f159' => 'krw',
223
- 'f109' => 'laptop',
224
- 'f06c' => 'leaf',
225
- 'f094' => 'lemon-o',
226
- 'f149' => 'level-down',
227
- 'f148' => 'level-up',
228
- 'f0eb' => 'lightbulb-o',
229
- 'f0c1' => 'link',
230
- 'f0e1' => 'linkedin',
231
- 'f08c' => 'linkedin-square',
232
- 'f17c' => 'linux',
233
- 'f03a' => 'list',
234
- 'f022' => 'list-alt',
235
- 'f0cb' => 'list-ol',
236
- 'f0ca' => 'list-ul',
237
- 'f124' => 'location-arrow',
238
- 'f023' => 'lock',
239
- 'f175' => 'long-arrow-down',
240
- 'f177' => 'long-arrow-left',
241
- 'f178' => 'long-arrow-right',
242
- 'f176' => 'long-arrow-up',
243
- 'f0d0' => 'magic',
244
- 'f076' => 'magnet',
245
- 'f122' => 'mail-reply-all',
246
- 'f183' => 'male',
247
- 'f041' => 'map-marker',
248
- 'f136' => 'maxcdn',
249
- 'f0fa' => 'medkit',
250
- 'f11a' => 'meh-o',
251
- 'f130' => 'microphone',
252
- 'f131' => 'microphone-slash',
253
- 'f068' => 'minus',
254
- 'f056' => 'minus-circle',
255
- 'f146' => 'minus-square',
256
- 'f147' => 'minus-square-o',
257
- 'f10b' => 'mobile',
258
- 'f0d6' => 'money',
259
- 'f186' => 'moon-o',
260
- 'f001' => 'music',
261
- 'f03b' => 'outdent',
262
- 'f18c' => 'pagelines',
263
- 'f0c6' => 'paperclip',
264
- 'f04c' => 'pause',
265
- 'f040' => 'pencil',
266
- 'f14b' => 'pencil-square',
267
- 'f044' => 'pencil-square-o',
268
- 'f095' => 'phone',
269
- 'f098' => 'phone-square',
270
- 'f03e' => 'picture-o',
271
- 'f0d2' => 'pinterest',
272
- 'f0d3' => 'pinterest-square',
273
- 'f072' => 'plane',
274
- 'f04b' => 'play',
275
- 'f144' => 'play-circle',
276
- 'f01d' => 'play-circle-o',
277
- 'f067' => 'plus',
278
- 'f055' => 'plus-circle',
279
- 'f0fe' => 'plus-square',
280
- 'f196' => 'plus-square-o',
281
- 'f011' => 'power-off',
282
- 'f02f' => 'print',
283
- 'f12e' => 'puzzle-piece',
284
- 'f029' => 'qrcode',
285
- 'f128' => 'question',
286
- 'f059' => 'question-circle',
287
- 'f10d' => 'quote-left',
288
- 'f10e' => 'quote-right',
289
- 'f074' => 'random',
290
- 'f021' => 'refresh',
291
- 'f18b' => 'renren',
292
- 'f01e' => 'repeat',
293
- 'f112' => 'reply',
294
- 'f122' => 'reply-all',
295
- 'f079' => 'retweet',
296
- 'f018' => 'road',
297
- 'f135' => 'rocket',
298
- 'f09e' => 'rss',
299
- 'f143' => 'rss-square',
300
- 'f158' => 'rub',
301
- 'f0c4' => 'scissors',
302
- 'f002' => 'search',
303
- 'f010' => 'search-minus',
304
- 'f00e' => 'search-plus',
305
- 'f064' => 'share',
306
- 'f14d' => 'share-square',
307
- 'f045' => 'share-square-o',
308
- 'f132' => 'shield',
309
- 'f07a' => 'shopping-cart',
310
- 'f090' => 'sign-in',
311
- 'f08b' => 'sign-out',
312
- 'f012' => 'signal',
313
- 'f0e8' => 'sitemap',
314
- 'f17e' => 'skype',
315
- 'f118' => 'smile-o',
316
- 'f0dc' => 'sort',
317
- 'f15d' => 'sort-alpha-asc',
318
- 'f15e' => 'sort-alpha-desc',
319
- 'f160' => 'sort-amount-asc',
320
- 'f161' => 'sort-amount-desc',
321
- 'f0dd' => 'sort-asc',
322
- 'f0de' => 'sort-desc',
323
- 'f162' => 'sort-numeric-asc',
324
- 'f163' => 'sort-numeric-desc',
325
- 'f110' => 'spinner',
326
- 'f0c8' => 'square',
327
- 'f096' => 'square-o',
328
- 'f18d' => 'stack-exchange',
329
- 'f16c' => 'stack-overflow',
330
- 'f005' => 'star',
331
- 'f089' => 'star-half',
332
- 'f123' => 'star-half-o',
333
- 'f006' => 'star-o',
334
- 'f048' => 'step-backward',
335
- 'f051' => 'step-forward',
336
- 'f0f1' => 'stethoscope',
337
- 'f04d' => 'stop',
338
- 'f0cc' => 'strikethrough',
339
- 'f12c' => 'subscript',
340
- 'f0f2' => 'suitcase',
341
- 'f185' => 'sun-o',
342
- 'f12b' => 'superscript',
343
- 'f0ce' => 'table',
344
- 'f10a' => 'tablet',
345
- 'f0e4' => 'tachometer',
346
- 'f02b' => 'tag',
347
- 'f02c' => 'tags',
348
- 'f0ae' => 'tasks',
349
- 'f120' => 'terminal',
350
- 'f034' => 'text-height',
351
- 'f035' => 'text-width',
352
- 'f00a' => 'th',
353
- 'f009' => 'th-large',
354
- 'f00b' => 'th-list',
355
- 'f08d' => 'thumb-tack',
356
- 'f165' => 'thumbs-down',
357
- 'f088' => 'thumbs-o-down',
358
- 'f087' => 'thumbs-o-up',
359
- 'f164' => 'thumbs-up',
360
- 'f145' => 'ticket',
361
- 'f00d' => 'times',
362
- 'f057' => 'times-circle',
363
- 'f05c' => 'times-circle-o',
364
- 'f043' => 'tint',
365
- 'f014' => 'trash-o',
366
- 'f181' => 'trello',
367
- 'f091' => 'trophy',
368
- 'f0d1' => 'truck',
369
- 'f195' => 'try',
370
- 'f173' => 'tumblr',
371
- 'f174' => 'tumblr-square',
372
- 'f099' => 'twitter',
373
- 'f081' => 'twitter-square',
374
- 'f0e9' => 'umbrella',
375
- 'f0cd' => 'underline',
376
- 'f0e2' => 'undo',
377
- 'f09c' => 'unlock',
378
- 'f13e' => 'unlock-alt',
379
- 'f093' => 'upload',
380
- 'f155' => 'usd',
381
- 'f007' => 'user',
382
- 'f0f0' => 'user-md',
383
- 'f0c0' => 'users',
384
- 'f03d' => 'video-camera',
385
- 'f194' => 'vimeo-square',
386
- 'f189' => 'vk',
387
- 'f027' => 'volume-down',
388
- 'f026' => 'volume-off',
389
- 'f028' => 'volume-up',
390
- 'f18a' => 'weibo',
391
- 'f193' => 'wheelchair',
392
- 'f17a' => 'windows',
393
- 'f0ad' => 'wrench',
394
- 'f168' => 'xing',
395
- 'f169' => 'xing-square',
396
- 'f167' => 'youtube',
397
- 'f16a' => 'youtube-play',
398
- 'f166' => 'youtube-square'
399
- ),
400
- 'awesome_icons2' => array(
401
- '\f042' => 'adjust',
402
- '\f170' => 'adn',
403
- '\f037' => 'align-center',
404
- '\f039' => 'align-justify',
405
- '\f036' => 'align-left',
406
- '\f038' => 'align-right',
407
- '\f0f9' => 'ambulance',
408
- '\f13d' => 'anchor',
409
- '\f17b' => 'android',
410
- '\f209' => 'angellist',
411
- '\f103' => 'angle-double-down',
412
- '\f100' => 'angle-double-left',
413
- '\f101' => 'angle-double-right',
414
- '\f102' => 'angle-double-up',
415
- '\f107' => 'angle-down',
416
- '\f104' => 'angle-left',
417
- '\f105' => 'angle-right',
418
- '\f106' => 'angle-up',
419
- '\f179' => 'apple',
420
- '\f187' => 'archive',
421
- '\f1fe' => 'area-chart',
422
- '\f0ab' => 'arrow-circle-down',
423
- '\f0a8' => 'arrow-circle-left',
424
- '\f01a' => 'arrow-circle-o-down',
425
- '\f190' => 'arrow-circle-o-left',
426
- '\f18e' => 'arrow-circle-o-right',
427
- '\f01b' => 'arrow-circle-o-up',
428
- '\f0a9' => 'arrow-circle-right',
429
- '\f0aa' => 'arrow-circle-up',
430
- '\f063' => 'arrow-down',
431
- '\f060' => 'arrow-left',
432
- '\f061' => 'arrow-right',
433
- '\f062' => 'arrow-up',
434
- '\f047' => 'arrows',
435
- '\f0b2' => 'arrows-alt',
436
- '\f07e' => 'arrows-h',
437
- '\f07d' => 'arrows-v',
438
- '\f069' => 'asterisk',
439
- '\f1fa' => 'at',
440
- '\f1b9' => 'automobile',
441
- '\f04a' => 'backward',
442
- '\f05e' => 'ban',
443
- '\f19c' => 'bank',
444
- '\f080' => 'bar-chart',
445
- '\f080' => 'bar-chart-o',
446
- '\f02a' => 'barcode',
447
- '\f0c9' => 'bars',
448
- '\f236' => 'bed',
449
- '\f0fc' => 'beer',
450
- '\f1b4' => 'behance',
451
- '\f1b5' => 'behance-square',
452
- '\f0f3' => 'bell',
453
- '\f0a2' => 'bell-o',
454
- '\f1f6' => 'bell-slash',
455
- '\f1f7' => 'bell-slash-o',
456
- '\f206' => 'bicycle',
457
- '\f1e5' => 'binoculars',
458
- '\f1fd' => 'birthday-cake',
459
- '\f171' => 'bitbucket',
460
- '\f172' => 'bitbucket-square',
461
- '\f15a' => 'bitcoin',
462
- '\f032' => 'bold',
463
- '\f0e7' => 'bolt',
464
- '\f1e2' => 'bomb',
465
- '\f02d' => 'book',
466
- '\f02e' => 'bookmark',
467
- '\f097' => 'bookmark-o',
468
- '\f0b1' => 'briefcase',
469
- '\f15a' => 'btc',
470
- '\f188' => 'bug',
471
- '\f1ad' => 'building',
472
- '\f0f7' => 'building-o',
473
- '\f0a1' => 'bullhorn',
474
- '\f140' => 'bullseye',
475
- '\f207' => 'bus',
476
- '\f20d' => 'buysellads',
477
- '\f1ba' => 'cab',
478
- '\f1ec' => 'calculator',
479
- '\f073' => 'calendar',
480
- '\f133' => 'calendar-o',
481
- '\f030' => 'camera',
482
- '\f083' => 'camera-retro',
483
- '\f1b9' => 'car',
484
- '\f0d7' => 'caret-down',
485
- '\f0d9' => 'caret-left',
486
- '\f0da' => 'caret-right',
487
- '\f150' => 'caret-square-o-down',
488
- '\f191' => 'caret-square-o-left',
489
- '\f152' => 'caret-square-o-right',
490
- '\f151' => 'caret-square-o-up',
491
- '\f0d8' => 'caret-up',
492
- '\f218' => 'cart-arrow-down',
493
- '\f217' => 'cart-plus',
494
- '\f20a' => 'cc',
495
- '\f1f3' => 'cc-amex',
496
- '\f1f2' => 'cc-discover',
497
- '\f1f1' => 'cc-mastercard',
498
- '\f1f4' => 'cc-paypal',
499
- '\f1f5' => 'cc-stripe',
500
- '\f1f0' => 'cc-visa',
501
- '\f0a3' => 'certificate',
502
- '\f0c1' => 'chain',
503
- '\f127' => 'chain-broken',
504
- '\f00c' => 'check',
505
- '\f058' => 'check-circle',
506
- '\f05d' => 'check-circle-o',
507
- '\f14a' => 'check-square',
508
- '\f046' => 'check-square-o',
509
- '\f13a' => 'chevron-circle-down',
510
- '\f137' => 'chevron-circle-left',
511
- '\f138' => 'chevron-circle-right',
512
- '\f139' => 'chevron-circle-up',
513
- '\f078' => 'chevron-down',
514
- '\f053' => 'chevron-left',
515
- '\f054' => 'chevron-right',
516
- '\f077' => 'chevron-up',
517
- '\f1ae' => 'child',
518
- '\f111' => 'circle',
519
- '\f10c' => 'circle-o',
520
- '\f1ce' => 'circle-o-notch',
521
- '\f1db' => 'circle-thin',
522
- '\f0ea' => 'clipboard',
523
- '\f017' => 'clock-o',
524
- '\f00d' => 'close',
525
- '\f0c2' => 'cloud',
526
- '\f0ed' => 'cloud-download',
527
- '\f0ee' => 'cloud-upload',
528
- '\f157' => 'cny',
529
- '\f121' => 'code',
530
- '\f126' => 'code-fork',
531
- '\f1cb' => 'codepen',
532
- '\f0f4' => 'coffee',
533
- '\f013' => 'cog',
534
- '\f085' => 'cogs',
535
- '\f0db' => 'columns',
536
- '\f075' => 'comment',
537
- '\f0e5' => 'comment-o',
538
- '\f086' => 'comments',
539
- '\f0e6' => 'comments-o',
540
- '\f14e' => 'compass',
541
- '\f066' => 'compress',
542
- '\f20e' => 'connectdevelop',
543
- '\f0c5' => 'copy',
544
- '\f1f9' => 'copyright',
545
- '\f09d' => 'credit-card',
546
- '\f125' => 'crop',
547
- '\f05b' => 'crosshairs',
548
- '\f13c' => 'css3',
549
- '\f1b2' => 'cube',
550
- '\f1b3' => 'cubes',
551
- '\f0c4' => 'cut',
552
- '\f0f5' => 'cutlery',
553
- '\f0e4' => 'dashboard',
554
- '\f210' => 'dashcube',
555
- '\f1c0' => 'database',
556
- '\f03b' => 'dedent',
557
- '\f1a5' => 'delicious',
558
- '\f108' => 'desktop',
559
- '\f1bd' => 'deviantart',
560
- '\f219' => 'diamond',
561
- '\f1a6' => 'digg',
562
- '\f155' => 'dollar',
563
- '\f192' => 'dot-circle-o',
564
- '\f019' => 'download',
565
- '\f17d' => 'dribbble',
566
- '\f16b' => 'dropbox',
567
- '\f1a9' => 'drupal',
568
- '\f044' => 'edit',
569
- '\f052' => 'eject',
570
- '\f141' => 'ellipsis-h',
571
- '\f142' => 'ellipsis-v',
572
- '\f1d1' => 'empire',
573
- '\f0e0' => 'envelope',
574
- '\f003' => 'envelope-o',
575
- '\f199' => 'envelope-square',
576
- '\f12d' => 'eraser',
577
- '\f153' => 'eur',
578
- '\f153' => 'euro',
579
- '\f0ec' => 'exchange',
580
- '\f12a' => 'exclamation',
581
- '\f06a' => 'exclamation-circle',
582
- '\f071' => 'exclamation-triangle',
583
- '\f065' => 'expand',
584
- '\f08e' => 'external-link',
585
- '\f14c' => 'external-link-square',
586
- '\f06e' => 'eye',
587
- '\f070' => 'eye-slash',
588
- '\f1fb' => 'eyedropper',
589
- '\f09a' => 'facebook',
590
- '\f09a' => 'facebook-f',
591
- '\f230' => 'facebook-official',
592
- '\f082' => 'facebook-square',
593
- '\f049' => 'fast-backward',
594
- '\f050' => 'fast-forward',
595
- '\f1ac' => 'fax',
596
- '\f182' => 'female',
597
- '\f0fb' => 'fighter-jet',
598
- '\f15b' => 'file',
599
- '\f1c6' => 'file-archive-o',
600
- '\f1c7' => 'file-audio-o',
601
- '\f1c9' => 'file-code-o',
602
- '\f1c3' => 'file-excel-o',
603
- '\f1c5' => 'file-image-o',
604
- '\f1c8' => 'file-movie-o',
605
- '\f016' => 'file-o',
606
- '\f1c1' => 'file-pdf-o',
607
- '\f1c5' => 'file-photo-o',
608
- '\f1c5' => 'file-picture-o',
609
- '\f1c4' => 'file-powerpoint-o',
610
- '\f1c7' => 'file-sound-o',
611
- '\f15c' => 'file-text',
612
- '\f0f6' => 'file-text-o',
613
- '\f1c8' => 'file-video-o',
614
- '\f1c2' => 'file-word-o',
615
- '\f1c6' => 'file-zip-o',
616
- '\f0c5' => 'files-o',
617
- '\f008' => 'film',
618
- '\f0b0' => 'filter',
619
- '\f06d' => 'fire',
620
- '\f134' => 'fire-extinguisher',
621
- '\f024' => 'flag',
622
- '\f11e' => 'flag-checkered',
623
- '\f11d' => 'flag-o',
624
- '\f0e7' => 'flash',
625
- '\f0c3' => 'flask',
626
- '\f16e' => 'flickr',
627
- '\f0c7' => 'floppy-o',
628
- '\f07b' => 'folder',
629
- '\f114' => 'folder-o',
630
- '\f07c' => 'folder-open',
631
- '\f115' => 'folder-open-o',
632
- '\f031' => 'font',
633
- '\f211' => 'forumbee',
634
- '\f04e' => 'forward',
635
- '\f180' => 'foursquare',
636
- '\f119' => 'frown-o',
637
- '\f1e3' => 'futbol-o',
638
- '\f11b' => 'gamepad',
639
- '\f0e3' => 'gavel',
640
- '\f154' => 'gbp',
641
- '\f1d1' => 'ge',
642
- '\f013' => 'gear',
643
- '\f085' => 'gears',
644
- '\f1db' => 'genderless',
645
- '\f06b' => 'gift',
646
- '\f1d3' => 'git',
647
- '\f1d2' => 'git-square',
648
- '\f09b' => 'github',
649
- '\f113' => 'github-alt',
650
- '\f092' => 'github-square',
651
- '\f184' => 'gittip',
652
- '\f000' => 'glass',
653
- '\f0ac' => 'globe',
654
- '\f1a0' => 'google',
655
- '\f0d5' => 'google-plus',
656
- '\f0d4' => 'google-plus-square',
657
- '\f1ee' => 'google-wallet',
658
- '\f19d' => 'graduation-cap',
659
- '\f184' => 'gratipay',
660
- '\f0c0' => 'group',
661
- '\f0fd' => 'h-square',
662
- '\f1d4' => 'hacker-news',
663
- '\f0a7' => 'hand-o-down',
664
- '\f0a5' => 'hand-o-left',
665
- '\f0a4' => 'hand-o-right',
666
- '\f0a6' => 'hand-o-up',
667
- '\f0a0' => 'hdd-o',
668
- '\f1dc' => 'header',
669
- '\f025' => 'headphones',
670
- '\f004' => 'heart',
671
- '\f08a' => 'heart-o',
672
- '\f21e' => 'heartbeat',
673
- '\f1da' => 'history',
674
- '\f015' => 'home',
675
- '\f0f8' => 'hospital-o',
676
- '\f236' => 'hotel',
677
- '\f13b' => 'html5',
678
- '\f20b' => 'ils',
679
- '\f03e' => 'image',
680
- '\f01c' => 'inbox',
681
- '\f03c' => 'indent',
682
- '\f129' => 'info',
683
- '\f05a' => 'info-circle',
684
- '\f156' => 'inr',
685
- '\f16d' => 'instagram',
686
- '\f19c' => 'institution',
687
- '\f208' => 'ioxhost',
688
- '\f033' => 'italic',
689
- '\f1aa' => 'joomla',
690
- '\f157' => 'jpy',
691
- '\f1cc' => 'jsfiddle',
692
- '\f084' => 'key',
693
- '\f11c' => 'keyboard-o',
694
- '\f159' => 'krw',
695
- '\f1ab' => 'language',
696
- '\f109' => 'laptop',
697
- '\f202' => 'lastfm',
698
- '\f203' => 'lastfm-square',
699
- '\f06c' => 'leaf',
700
- '\f212' => 'leanpub',
701
- '\f0e3' => 'legal',
702
- '\f094' => 'lemon-o',
703
- '\f149' => 'level-down',
704
- '\f148' => 'level-up',
705
- '\f1cd' => 'life-bouy',
706
- '\f1cd' => 'life-buoy',
707
- '\f1cd' => 'life-ring',
708
- '\f1cd' => 'life-saver',
709
- '\f0eb' => 'lightbulb-o',
710
- '\f201' => 'line-chart',
711
- '\f0c1' => 'link',
712
- '\f0e1' => 'linkedin',
713
- '\f08c' => 'linkedin-square',
714
- '\f17c' => 'linux',
715
- '\f03a' => 'list',
716
- '\f022' => 'list-alt',
717
- '\f0cb' => 'list-ol',
718
- '\f0ca' => 'list-ul',
719
- '\f124' => 'location-arrow',
720
- '\f023' => 'lock',
721
- '\f175' => 'long-arrow-down',
722
- '\f177' => 'long-arrow-left',
723
- '\f178' => 'long-arrow-right',
724
- '\f176' => 'long-arrow-up',
725
- '\f0d0' => 'magic',
726
- '\f076' => 'magnet',
727
- '\f064' => 'mail-forward',
728
- '\f112' => 'mail-reply',
729
- '\f122' => 'mail-reply-all',
730
- '\f183' => 'male',
731
- '\f041' => 'map-marker',
732
- '\f222' => 'mars',
733
- '\f227' => 'mars-double',
734
- '\f229' => 'mars-stroke',
735
- '\f22b' => 'mars-stroke-h',
736
- '\f22a' => 'mars-stroke-v',
737
- '\f136' => 'maxcdn',
738
- '\f20c' => 'meanpath',
739
- '\f23a' => 'medium',
740
- '\f0fa' => 'medkit',
741
- '\f11a' => 'meh-o',
742
- '\f223' => 'mercury',
743
- '\f130' => 'microphone',
744
- '\f131' => 'microphone-slash',
745
- '\f068' => 'minus',
746
- '\f056' => 'minus-circle',
747
- '\f146' => 'minus-square',
748
- '\f147' => 'minus-square-o',
749
- '\f10b' => 'mobile',
750
- '\f10b' => 'mobile-phone',
751
- '\f0d6' => 'money',
752
- '\f186' => 'moon-o',
753
- '\f19d' => 'mortar-board',
754
- '\f21c' => 'motorcycle',
755
- '\f001' => 'music',
756
- '\f0c9' => 'navicon',
757
- '\f22c' => 'neuter',
758
- '\f1ea' => 'newspaper-o',
759
- '\f19b' => 'openid',
760
- '\f03b' => 'outdent',
761
- '\f18c' => 'pagelines',
762
- '\f1fc' => 'paint-brush',
763
- '\f1d8' => 'paper-plane',
764
- '\f1d9' => 'paper-plane-o',
765
- '\f0c6' => 'paperclip',
766
- '\f1dd' => 'paragraph',
767
- '\f0ea' => 'paste',
768
- '\f04c' => 'pause',
769
- '\f1b0' => 'paw',
770
- '\f1ed' => 'paypal',
771
- '\f040' => 'pencil',
772
- '\f14b' => 'pencil-square',
773
- '\f044' => 'pencil-square-o',
774
- '\f095' => 'phone',
775
- '\f098' => 'phone-square',
776
- '\f03e' => 'photo',
777
- '\f03e' => 'picture-o',
778
- '\f200' => 'pie-chart',
779
- '\f1a7' => 'pied-piper',
780
- '\f1a8' => 'pied-piper-alt',
781
- '\f0d2' => 'pinterest',
782
- '\f231' => 'pinterest-p',
783
- '\f0d3' => 'pinterest-square',
784
- '\f072' => 'plane',
785
- '\f04b' => 'play',
786
- '\f144' => 'play-circle',
787
- '\f01d' => 'play-circle-o',
788
- '\f1e6' => 'plug',
789
- '\f067' => 'plus',
790
- '\f055' => 'plus-circle',
791
- '\f0fe' => 'plus-square',
792
- '\f196' => 'plus-square-o',
793
- '\f011' => 'power-off',
794
- '\f02f' => 'print',
795
- '\f12e' => 'puzzle-piece',
796
- '\f1d6' => 'qq',
797
- '\f029' => 'qrcode',
798
- '\f128' => 'question',
799
- '\f059' => 'question-circle',
800
- '\f10d' => 'quote-left',
801
- '\f10e' => 'quote-right',
802
- '\f1d0' => 'ra',
803
- '\f074' => 'random',
804
- '\f1d0' => 'rebel',
805
- '\f1b8' => 'recycle',
806
- '\f1a1' => 'reddit',
807
- '\f1a2' => 'reddit-square',
808
- '\f021' => 'refresh',
809
- '\f00d' => 'remove',
810
- '\f18b' => 'renren',
811
- '\f0c9' => 'reorder',
812
- '\f01e' => 'repeat',
813
- '\f112' => 'reply',
814
- '\f122' => 'reply-all',
815
- '\f079' => 'retweet',
816
- '\f157' => 'rmb',
817
- '\f018' => 'road',
818
- '\f135' => 'rocket',
819
- '\f0e2' => 'rotate-left',
820
- '\f01e' => 'rotate-right',
821
- '\f158' => 'rouble',
822
- '\f09e' => 'rss',
823
- '\f143' => 'rss-square',
824
- '\f158' => 'rub',
825
- '\f158' => 'ruble',
826
- '\f156' => 'rupee',
827
- '\f0c7' => 'save',
828
- '\f0c4' => 'scissors',
829
- '\f002' => 'search',
830
- '\f010' => 'search-minus',
831
- '\f00e' => 'search-plus',
832
- '\f213' => 'sellsy',
833
- '\f1d8' => 'send',
834
- '\f1d9' => 'send-o',
835
- '\f233' => 'server',
836
- '\f064' => 'share',
837
- '\f1e0' => 'share-alt',
838
- '\f1e1' => 'share-alt-square',
839
- '\f14d' => 'share-square',
840
- '\f045' => 'share-square-o',
841
- '\f20b' => 'shekel',
842
- '\f20b' => 'sheqel',
843
- '\f132' => 'shield',
844
- '\f21a' => 'ship',
845
- '\f214' => 'shirtsinbulk',
846
- '\f07a' => 'shopping-cart',
847
- '\f090' => 'sign-in',
848
- '\f08b' => 'sign-out',
849
- '\f012' => 'signal',
850
- '\f215' => 'simplybuilt',
851
- '\f0e8' => 'sitemap',
852
- '\f216' => 'skyatlas',
853
- '\f17e' => 'skype',
854
- '\f198' => 'slack',
855
- '\f1de' => 'sliders',
856
- '\f1e7' => 'slideshare',
857
- '\f118' => 'smile-o',
858
- '\f1e3' => 'soccer-ball-o',
859
- '\f0dc' => 'sort',
860
- '\f15d' => 'sort-alpha-asc',
861
- '\f15e' => 'sort-alpha-desc',
862
- '\f160' => 'sort-amount-asc',
863
- '\f161' => 'sort-amount-desc',
864
- '\f0de' => 'sort-asc',
865
- '\f0dd' => 'sort-desc',
866
- '\f0dd' => 'sort-down',
867
- '\f162' => 'sort-numeric-asc',
868
- '\f163' => 'sort-numeric-desc',
869
- '\f0de' => 'sort-up',
870
- '\f1be' => 'soundcloud',
871
- '\f197' => 'space-shuttle',
872
- '\f110' => 'spinner',
873
- '\f1b1' => 'spoon',
874
- '\f1bc' => 'spotify',
875
- '\f0c8' => 'square',
876
- '\f096' => 'square-o',
877
- '\f18d' => 'stack-exchange',
878
- '\f16c' => 'stack-overflow',
879
- '\f005' => 'star',
880
- '\f089' => 'star-half',
881
- '\f123' => 'star-half-empty',
882
- '\f123' => 'star-half-full',
883
- '\f123' => 'star-half-o',
884
- '\f006' => 'star-o',
885
- '\f1b6' => 'steam',
886
- '\f1b7' => 'steam-square',
887
- '\f048' => 'step-backward',
888
- '\f051' => 'step-forward',
889
- '\f0f1' => 'stethoscope',
890
- '\f04d' => 'stop',
891
- '\f21d' => 'street-view',
892
- '\f0cc' => 'strikethrough',
893
- '\f1a4' => 'stumbleupon',
894
- '\f1a3' => 'stumbleupon-circle',
895
- '\f12c' => 'subscript',
896
- '\f239' => 'subway',
897
- '\f0f2' => 'suitcase',
898
- '\f185' => 'sun-o',
899
- '\f12b' => 'superscript',
900
- '\f1cd' => 'support',
901
- '\f0ce' => 'table',
902
- '\f10a' => 'tablet',
903
- '\f0e4' => 'tachometer',
904
- '\f02b' => 'tag',
905
- '\f02c' => 'tags',
906
- '\f0ae' => 'tasks',
907
- '\f1ba' => 'taxi',
908
- '\f1d5' => 'tencent-weibo',
909
- '\f120' => 'terminal',
910
- '\f034' => 'text-height',
911
- '\f035' => 'text-width',
912
- '\f00a' => 'th',
913
- '\f009' => 'th-large',
914
- '\f00b' => 'th-list',
915
- '\f08d' => 'thumb-tack',
916
- '\f165' => 'thumbs-down',
917
- '\f088' => 'thumbs-o-down',
918
- '\f087' => 'thumbs-o-up',
919
- '\f164' => 'thumbs-up',
920
- '\f145' => 'ticket',
921
- '\f00d' => 'times',
922
- '\f057' => 'times-circle',
923
- '\f05c' => 'times-circle-o',
924
- '\f043' => 'tint',
925
- '\f150' => 'toggle-down',
926
- '\f191' => 'toggle-left',
927
- '\f204' => 'toggle-off',
928
- '\f205' => 'toggle-on',
929
- '\f152' => 'toggle-right',
930
- '\f151' => 'toggle-up',
931
- '\f238' => 'train',
932
- '\f224' => 'transgender',
933
- '\f225' => 'transgender-alt',
934
- '\f1f8' => 'trash',
935
- '\f014' => 'trash-o',
936
- '\f1bb' => 'tree',
937
- '\f181' => 'trello',
938
- '\f091' => 'trophy',
939
- '\f0d1' => 'truck',
940
- '\f195' => 'try',
941
- '\f1e4' => 'tty',
942
- '\f173' => 'tumblr',
943
- '\f174' => 'tumblr-square',
944
- '\f195' => 'turkish-lira',
945
- '\f1e8' => 'twitch',
946
- '\f099' => 'twitter',
947
- '\f081' => 'twitter-square',
948
- '\f0e9' => 'umbrella',
949
- '\f0cd' => 'underline',
950
- '\f0e2' => 'undo',
951
- '\f19c' => 'university',
952
- '\f127' => 'unlink',
953
- '\f09c' => 'unlock',
954
- '\f13e' => 'unlock-alt',
955
- '\f0dc' => 'unsorted',
956
- '\f093' => 'upload',
957
- '\f155' => 'usd',
958
- '\f007' => 'user',
959
- '\f0f0' => 'user-md',
960
- '\f234' => 'user-plus',
961
- '\f21b' => 'user-secret',
962
- '\f235' => 'user-times',
963
- '\f0c0' => 'users',
964
- '\f221' => 'venus',
965
- '\f226' => 'venus-double',
966
- '\f228' => 'venus-mars',
967
- '\f237' => 'viacoin',
968
- '\f03d' => 'video-camera',
969
- '\f194' => 'vimeo-square',
970
- '\f1ca' => 'vine',
971
- '\f189' => 'vk',
972
- '\f027' => 'volume-down',
973
- '\f026' => 'volume-off',
974
- '\f028' => 'volume-up',
975
- '\f071' => 'warning',
976
- '\f1d7' => 'wechat',
977
- '\f18a' => 'weibo',
978
- '\f1d7' => 'weixin',
979
- '\f232' => 'whatsapp',
980
- '\f193' => 'wheelchair',
981
- '\f1eb' => 'wifi',
982
- '\f17a' => 'windows',
983
- '\f159' => 'won',
984
- '\f19a' => 'wordpress',
985
- '\f0ad' => 'wrench',
986
- '\f168' => 'xing',
987
- '\f169' => 'xing-square',
988
- '\f19e' => 'yahoo',
989
- '\f1e9' => 'yelp',
990
- '\f157' => 'yen',
991
- '\f167' => 'youtube',
992
- '\f16a' => 'youtube-play',
993
- '\f166' => 'youtube-square',
994
- ),
995
-
996
- 'awesome_icons_socials' =>array(
997
- 'f170' => 'adn',
998
- 'f17b' => 'android',
999
- 'f179' => 'apple',
1000
- 'f171' => 'bitbucket',
1001
- 'f171' => 'bitbucket-square',
1002
- 'f02e' => 'bookmark',
1003
- 'f097' => 'bookmark-o',
1004
- 'f15a' => 'btc',
1005
- 'f13c' => 'css3',
1006
- 'f17d' => 'dribble',
1007
- 'f16b' => 'dropbox',
1008
- 'f09a' => 'facebook',
1009
- 'f082' => 'facebook-square',
1010
- 'f16e' => 'flickr',
1011
- 'f180' => 'foursquare',
1012
- 'f09b'=> 'github' ,
1013
- 'f113'=> 'github-alt',
1014
- 'f092' => 'github-square',
1015
- 'f184' => 'gittip',
1016
- 'f0d5' => 'google-plus',
1017
- 'f0d4' => 'google-plus-square',
1018
- 'f13b' => 'html5',
1019
- 'f16d' => 'instagram',
1020
- 'f0e1' => 'linkedin',
1021
- 'f08c' => 'linkedin-square',
1022
- 'f17c' => 'Linux',
1023
- 'f136' => 'maxcdn',
1024
- 'f18c' => 'pagelines',
1025
- 'f0d2' => 'pinterest',
1026
- 'f0d3' => 'pinterest-square',
1027
- 'f18b' => 'renren',
1028
- 'f09e' => 'rss',
1029
- 'f17e' => 'skype',
1030
- 'f18d' => 'stack-exchange',
1031
- 'f16c' => 'stack-overflow',
1032
- 'f181' => 'trello',
1033
- 'f173' => 'tumblr',
1034
- 'f174' => 'Tumblr Square',
1035
- 'f099' => 'twitter',
1036
- 'f081' => 'twitter-square',
1037
- 'f194' => 'vimeo-square',
1038
- 'f189' => 'vk',
1039
- 'f18a' => 'weibo',
1040
- 'f17a' => 'windows',
1041
- 'f168' => 'xing',
1042
- 'f169' => 'xing-square',
1043
- 'f167' => 'youtube'
1044
- ),
1045
- 'header_backgrounds' => array(),
1046
- 'body_backgrounds' => array(),
1047
-
1048
- // tags used in theme options (e.g. %tag%) to have some common informations
1049
- 'tag' => array( //'themeurl' => get_template_directory_uri()
1050
- ),
1051
-
1052
- 'cycle_fx' => array(
1053
- 'blindX' => 'blindX', 'blindY' => 'blindY', 'blindZ' => 'blindZ', 'cover' => 'cover', 'curtainX' => 'curtainX',
1054
- 'curtainY' => 'curtainY', 'fade' => 'fade', 'fadeZoom' => 'fadeZoom', 'growX' => 'growX', 'growY' => 'growY',
1055
- 'scrollUp' => 'scrollUp', 'scrollDown' => 'scrollDown', 'scrollLeft' => 'scrollLeft', 'scrollRight' => 'scrollRight', 'scrollHorz' => 'scrollHorz',
1056
- 'shuffle' => 'shuffle', 'slideX' => 'slideX', 'slideY' => 'slideY', 'toss' => 'toss', 'turnUp' => 'turnUp',
1057
- 'turnLeft' => 'turnLeft', 'turnRight' => 'turnRight', 'uncover' => 'uncover', 'wipe' => 'wipe', 'zoom' => 'zoom',
1058
- 'none' => 'none', 'turnDown' => 'turnDown', 'scrollVert' => 'scrollVert'
1059
- ),
1060
-
1061
- 'animate' => array(
1062
- '' => "none",
1063
- "bounce" => "bounce",
1064
- "flash" =>"flash",
1065
- "pulse" =>"pulse",
1066
- //"rubberBand"=>"rubberBand",
1067
- "shake" =>"shake",
1068
- "swing"=>"swing",
1069
- "tada" =>"tada",
1070
- "wobble"=>"wobble",
1071
- "bounceIn"=>"bounceIn",
1072
- "bounceInDown"=>"bounceInDown",
1073
- "bounceInLeft"=>"bounceInLeft",
1074
- "bounceInRight"=>"bounceInRight",
1075
- "bounceInUp"=>"bounceInUp",
1076
- "fadeIn"=>"fadeIn",
1077
- "fadeInDown"=>"fadeInDown",
1078
- "fadeInDownBig"=>"fadeInDownBig",
1079
- "fadeInLeft"=>"fadeInLeft",
1080
- "fadeInLeftBig"=>"fadeInLeftBig",
1081
- "fadeInRight"=>"fadeInRight",
1082
- "fadeInRightBig"=>"fadeInRightBig",
1083
- "fadeInUp"=>"fadeInUp",
1084
- "fadeInUpBig"=>"fadeInUpBig",
1085
- "flip"=>"flip",
1086
- "flipInX"=>"flipInX",
1087
- "flipInY"=>"flipInY",
1088
- "lightSpeedIn"=>"lightSpeedIn",
1089
- "rotateIn"=>"rotateIn",
1090
- "rotateInDownLeft"=>"rotateInDownLeft",
1091
- "rotateInDownRight"=>"rotateInDownRight",
1092
- "rotateInUpLeft"=>"rotateInUpLeft",
1093
- "rotateInUpRight"=>"rotateInUpRight",
1094
- //"slideInDown"=>"slideInDown",
1095
- //"slideInLeft"=>"slideInLeft",
1096
- //"slideInRight"=>"slideInRight",
1097
- "rollIn"=>"rollIn",
1098
- ),
1099
-
1100
- 'easings' => array(
1101
- FALSE => 'none',
1102
- 'easeInQuad' => 'easeInQuad',
1103
- 'easeOutQuad' => 'easeOutQuad',
1104
- 'easeInOutQuad' => 'easeInOutQuad',
1105
- 'easeInCubic' => 'easeInCubic',
1106
- 'easeOutCubic' => 'easeOutCubic',
1107
- 'easeInOutCubic' => 'easeInOutCubic',
1108
- 'easeInQuart' => 'easeInQuart',
1109
- 'easeOutQuart' => 'easeOutQuart',
1110
- 'easeInOutQuart' => 'easeInOutQuart',
1111
- 'easeInQuint' => 'easeInQuint',
1112
- 'easeOutQuint' => 'easeOutQuint',
1113
- 'easeInOutQuint' => 'easeInOutQuint',
1114
- 'easeInSine' => 'easeInSine',
1115
- 'easeOutSine' => 'easeOutSine',
1116
- 'easeInOutSine' => 'easeInOutSine',
1117
- 'easeInExpo' => 'easeInExpo',
1118
- 'easeOutExpo' => 'easeOutExpo',
1119
- 'easeInOutExpo' => 'easeInOutExpo',
1120
- 'easeInCirc' => 'easeInCirc',
1121
- 'easeOutCirc' => 'easeOutCirc',
1122
- 'easeInOutCirc' => 'easeInOutCirc',
1123
- 'easeInElastic' => 'easeInElastic',
1124
- 'easeOutElastic' => 'easeOutElastic',
1125
- 'easeInOutElastic' => 'easeInOutElastic',
1126
- 'easeInBack' => 'easeInBack',
1127
- 'easeOutBack' => 'easeOutBack',
1128
- 'easeInOutBack' => 'easeInOutBack',
1129
- 'easeInBounce' => 'easeInBounce',
1130
- 'easeOutBounce' => 'easeOutBounce',
1131
- 'easeInOutBounce' => 'easeInOutBounce'
1132
- )
1133
- );
1134
-
1135
- /**
1136
- * Get configuration array
1137
- *
1138
- * @return array
1139
- */
1140
- public static function load() {
1141
- self::_loadThemeInfo();
1142
- //ksort( self::$_config['awesome_icons'] );
1143
-
1144
- return self::$_config;
1145
- }
1146
-
1147
- /**
1148
- * Return theme data
1149
- *
1150
- * First the method checks if the wp_get_theme() function exists (WP 3.4.0 at least).
1151
- * If not, the method calls the deprecated function get_template_directory()
1152
- *
1153
- * @return array
1154
- */
1155
- protected static function _loadThemeInfo() {
1156
- $theme = wp_get_theme();
1157
-
1158
- self::$_config['theme'] = array(
1159
- 'name' => $theme->Name,
1160
- 'description' => $theme->Description,
1161
- 'author' => $theme->Author,
1162
- 'authoruri' => $theme->{'Author URI'},
1163
- 'version' => $theme->Version,
1164
- 'template' => $theme->Template,
1165
- 'status' => $theme->Status,
1166
- 'tags' => $theme->Tags
1167
- );
1168
- }
1169
-
1170
-
1171
- public function init() {
1172
- self::$_config['header_backgrounds'] = apply_filters( 'yit_header_backgrounds', self::$_config['header_backgrounds'] );
1173
- self::$_config['body_backgrounds'] = apply_filters( 'yit_body_backgrounds', self::$_config['body_backgrounds'] );
1174
- }
1175
-
1176
- /**
1177
- * Return the font awesome array icon
1178
- *
1179
- * @return string Array
1180
- * @access public
1181
- * @since 1.0.0
1182
- */
1183
- public static function get_awesome_icons() {
1184
- return self::$_config['awesome_icons'];
1185
- }
1186
-
1187
- /**
1188
- * Return the font awesome array socials icon
1189
- *
1190
- * @return string Array
1191
- * @access public
1192
- * @since 1.0.0
1193
- */
1194
- public static function get_awesome_icons_socials() {
1195
- return self::$_config['awesome_icons_socials'];
1196
- }
1197
-
1198
-
1199
- /**
1200
- * Return the list of icons
1201
- *
1202
- * @return string Array
1203
- * @access public
1204
- * @since 1.0.0
1205
- */
1206
- public static function get_icon_list() {
1207
-
1208
- $standard_icon_list = array(
1209
- 'FontAwesome' => self::$_config['awesome_icons2']
1210
- );
1211
-
1212
- return apply_filters( 'yit_icon_list', $standard_icon_list );
1213
- }
1214
-
1215
- /**
1216
- * Return the data of icon
1217
- *
1218
- * @return string Array
1219
- * @access public
1220
- * @since 1.0.0
1221
- */
1222
- public static function get_icon( $icon ) {
1223
-
1224
- $icon_list = self::get_icon_list();
1225
- $icon_data = '';
1226
- if ( $icon != '' ) {
1227
- $ic = explode( ':', $icon );
1228
- $icon_code = array_search( $ic[1], $icon_list[$ic[0]] );
1229
-
1230
- if( $icon_code ){
1231
- $icon_code = ( strpos( $icon_code, '\\' ) === 0 ) ? '&#x' . substr( $icon_code, 1 ) . ';' : $icon_code;
1232
- }
1233
-
1234
- $icon_data = 'data-font="' . $ic[0] . '" data-key="' . $ic[1] . '" data-icon="' . $icon_code . '"';
1235
- }
1236
-
1237
- return $icon_data;
1238
- }
1239
-
1240
-
1241
- /*
1242
- * Return the code of the relative awesome class name
1243
- *
1244
- * @return string
1245
- * @access public
1246
- * @since 1.0.0
1247
- */
1248
- public static function get_awesome_icons_code_by_value($class){
1249
- $awesome_icons=self::$_config['awesome_icons'];
1250
- foreach($awesome_icons as $key => $value){
1251
- if($class==$value) {
1252
- return $key;
1253
- }
1254
- }
1255
-
1256
- return "";
1257
- }
1258
- }
1259
-
1260
  endif;
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 ( ! class_exists( 'YIT_Plugin_Common' ) ) :
12
+
13
+ /**
14
+ * Core configuration class
15
+ *
16
+ * @since 1.0.0
17
+ */
18
+ class YIT_Plugin_Common {
19
+
20
+ /**
21
+ * Config array
22
+ *
23
+ * @var array
24
+ */
25
+ protected static $_config = array(
26
+ 'slider' => array( 'nivo', 'elegant' ),
27
+
28
+
29
+ 'awesome_icons' => array(
30
+ '' => 'no-icon',
31
+ 'f042' => 'adjust',
32
+ 'f170' => 'adn',
33
+ 'f037' => 'align-center',
34
+ 'f039' => 'align-justify',
35
+ 'f036' => 'align-left',
36
+ 'f038' => 'align-right',
37
+ 'f0f9' => 'ambulance',
38
+ 'f13d' => 'anchor',
39
+ 'f17b' => 'android',
40
+ 'f103' => 'angle-double-down',
41
+ 'f100' => 'angle-double-left',
42
+ 'f101' => 'angle-double-right',
43
+ 'f102' => 'angle-double-up',
44
+ 'f107' => 'angle-down',
45
+ 'f104' => 'angle-left',
46
+ 'f105' => 'angle-right',
47
+ 'f106' => 'angle-up',
48
+ 'f179' => 'apple',
49
+ 'f187' => 'archive',
50
+ 'f0ab' => 'arrow-circle-down',
51
+ 'f0a8' => 'arrow-circle-left',
52
+ 'f01a' => 'arrow-circle-o-down',
53
+ 'f190' => 'arrow-circle-o-left',
54
+ 'f18e' => 'arrow-circle-o-right',
55
+ 'f01b' => 'arrow-circle-o-up',
56
+ 'f0a9' => 'arrow-circle-right',
57
+ 'f0aa' => 'arrow-circle-up',
58
+ 'f063' => 'arrow-down',
59
+ 'f060' => 'arrow-left',
60
+ 'f061' => 'arrow-right',
61
+ 'f062' => 'arrow-up',
62
+ 'f047' => 'arrows',
63
+ 'f0b2' => 'arrows-alt',
64
+ 'f07e' => 'arrows-h',
65
+ 'f07d' => 'arrows-v',
66
+ 'f069' => 'asterisk',
67
+ 'f04a' => 'backward',
68
+ 'f05e' => 'ban',
69
+ 'f080' => 'bar-chart-o',
70
+ 'f02a' => 'barcode',
71
+ 'f0c9' => 'bars',
72
+ 'f0fc' => 'beer',
73
+ 'f0f3' => 'bell',
74
+ 'f0a2' => 'bell-o',
75
+ 'f171' => 'bitbucket',
76
+ 'f172' => 'bitbucket-square',
77
+ 'f032' => 'bold',
78
+ 'f0e7' => 'bolt',
79
+ 'f02d' => 'book',
80
+ 'f02e' => 'bookmark',
81
+ 'f097' => 'bookmark-o',
82
+ 'f0b1' => 'briefcase',
83
+ 'f15a' => 'btc',
84
+ 'f188' => 'bug',
85
+ 'f0f7' => 'building-o',
86
+ 'f0a1' => 'bullhorn',
87
+ 'f140' => 'bullseye',
88
+ 'f073' => 'calendar',
89
+ 'f133' => 'calendar-o',
90
+ 'f030' => 'camera',
91
+ 'f083' => 'camera-retro',
92
+ 'f0d7' => 'caret-down',
93
+ 'f0d9' => 'caret-left',
94
+ 'f0da' => 'caret-right',
95
+ 'f150' => 'caret-square-o-down',
96
+ 'f191' => 'caret-square-o-left',
97
+ 'f152' => 'caret-square-o-right',
98
+ 'f151' => 'caret-square-o-up',
99
+ 'f0d8' => 'caret-up',
100
+ 'f0a3' => 'certificate',
101
+ 'f127' => 'chain-broken',
102
+ 'f00c' => 'check',
103
+ 'f058' => 'check-circle',
104
+ 'f05d' => 'check-circle-o',
105
+ 'f14a' => 'check-square',
106
+ 'f046' => 'check-square-o',
107
+ 'f13a' => 'chevron-circle-down',
108
+ 'f137' => 'chevron-circle-left',
109
+ 'f138' => 'chevron-circle-right',
110
+ 'f139' => 'chevron-circle-up',
111
+ 'f078' => 'chevron-down',
112
+ 'f053' => 'chevron-left',
113
+ 'f054' => 'chevron-right',
114
+ 'f077' => 'chevron-up',
115
+ 'f10c' => 'circle-o',
116
+ 'f0ea' => 'clipboard',
117
+ 'f017' => 'clock-o',
118
+ 'f0c2' => 'cloud',
119
+ 'f0ed' => 'cloud-download',
120
+ 'f0ee' => 'cloud-upload',
121
+ 'f121' => 'code',
122
+ 'f126' => 'code-fork',
123
+ 'f0f4' => 'coffee',
124
+ 'f013' => 'cog',
125
+ 'f085' => 'cogs',
126
+ 'f0db' => 'columns',
127
+ 'f075' => 'comment',
128
+ 'f0e5' => 'comment-o',
129
+ 'f086' => 'comments',
130
+ 'f0e6' => 'comments-o',
131
+ 'f14e' => 'compass',
132
+ 'f066' => 'compress',
133
+ 'f09d' => 'credit-card',
134
+ 'f125' => 'crop',
135
+ 'f05b' => 'crosshairs',
136
+ 'f13c' => 'css3',
137
+ 'f0f5' => 'cutlery',
138
+ 'f108' => 'desktop',
139
+ 'f192' => 'dot-circle-o',
140
+ 'f019' => 'download',
141
+ 'f17d' => 'dribbble',
142
+ 'f16b' => 'dropbox',
143
+ 'f052' => 'eject',
144
+ 'f141' => 'ellipsis-h',
145
+ 'f142' => 'ellipsis-v',
146
+ 'f0e0' => 'envelope',
147
+ 'f003' => 'envelope-o',
148
+ 'f12d' => 'eraser',
149
+ 'f153' => 'eur',
150
+ 'f0ec' => 'exchange',
151
+ 'f12a' => 'exclamation',
152
+ 'f06a' => 'exclamation-circle',
153
+ 'f071' => 'exclamation-triangle',
154
+ 'f065' => 'expand',
155
+ 'f08e' => 'external-link',
156
+ 'f14c' => 'external-link-square',
157
+ 'f06e' => 'eye',
158
+ 'f070' => 'eye-slash',
159
+ 'f09a' => 'facebook',
160
+ 'f082' => 'facebook-square',
161
+ 'f049' => 'fast-backward',
162
+ 'f050' => 'fast-forward',
163
+ 'f182' => 'female',
164
+ 'f0fb' => 'fighter-jet',
165
+ 'f15b' => 'file',
166
+ 'f016' => 'file-o',
167
+ 'f15c' => 'file-text',
168
+ 'f0f6' => 'file-text-o',
169
+ 'f0c5' => 'files-o',
170
+ 'f008' => 'film',
171
+ 'f0b0' => 'filter',
172
+ 'f06d' => 'fire',
173
+ 'f134' => 'fire-extinguisher',
174
+ 'f024' => 'flag',
175
+ 'f11e' => 'flag-checkered',
176
+ 'f11d' => 'flag-o',
177
+ 'f0c3' => 'flask',
178
+ 'f16e' => 'flickr',
179
+ 'f0c7' => 'floppy-o',
180
+ 'f07b' => 'folder',
181
+ 'f114' => 'folder-o',
182
+ 'f07c' => 'folder-open',
183
+ 'f115' => 'folder-open-o',
184
+ 'f031' => 'font',
185
+ 'f04e' => 'forward',
186
+ 'f180' => 'foursquare',
187
+ 'f119' => 'frown-o',
188
+ 'f11b' => 'gamepad',
189
+ 'f0e3' => 'gavel',
190
+ 'f154' => 'gbp',
191
+ 'f06b' => 'gift',
192
+ 'f09b' => 'github',
193
+ 'f113' => 'github-alt',
194
+ 'f092' => 'github-square',
195
+ 'f184' => 'gittip',
196
+ 'f000' => 'glass',
197
+ 'f0ac' => 'globe',
198
+ 'f0d5' => 'google-plus',
199
+ 'f0d4' => 'google-plus-square',
200
+ 'f0fd' => 'h-square',
201
+ 'f0a7' => 'hand-o-down',
202
+ 'f0a5' => 'hand-o-left',
203
+ 'f0a4' => 'hand-o-right',
204
+ 'f0a6' => 'hand-o-up',
205
+ 'f0a0' => 'hdd-o',
206
+ 'f025' => 'headphones',
207
+ 'f004' => 'heart',
208
+ 'f08a' => 'heart-o',
209
+ 'f015' => 'home',
210
+ 'f0f8' => 'hospital-o',
211
+ 'f13b' => 'html5',
212
+ 'f01c' => 'inbox',
213
+ 'f03c' => 'indent',
214
+ 'f129' => 'info',
215
+ 'f05a' => 'info-circle',
216
+ 'f156' => 'inr',
217
+ 'f16d' => 'instagram',
218
+ 'f033' => 'italic',
219
+ 'f157' => 'jpy',
220
+ 'f084' => 'key',
221
+ 'f11c' => 'keyboard-o',
222
+ 'f159' => 'krw',
223
+ 'f109' => 'laptop',
224
+ 'f06c' => 'leaf',
225
+ 'f094' => 'lemon-o',
226
+ 'f149' => 'level-down',
227
+ 'f148' => 'level-up',
228
+ 'f0eb' => 'lightbulb-o',
229
+ 'f0c1' => 'link',
230
+ 'f0e1' => 'linkedin',
231
+ 'f08c' => 'linkedin-square',
232
+ 'f17c' => 'linux',
233
+ 'f03a' => 'list',
234
+ 'f022' => 'list-alt',
235
+ 'f0cb' => 'list-ol',
236
+ 'f0ca' => 'list-ul',
237
+ 'f124' => 'location-arrow',
238
+ 'f023' => 'lock',
239
+ 'f175' => 'long-arrow-down',
240
+ 'f177' => 'long-arrow-left',
241
+ 'f178' => 'long-arrow-right',
242
+ 'f176' => 'long-arrow-up',
243
+ 'f0d0' => 'magic',
244
+ 'f076' => 'magnet',
245
+ 'f122' => 'mail-reply-all',
246
+ 'f183' => 'male',
247
+ 'f041' => 'map-marker',
248
+ 'f136' => 'maxcdn',
249
+ 'f0fa' => 'medkit',
250
+ 'f11a' => 'meh-o',
251
+ 'f130' => 'microphone',
252
+ 'f131' => 'microphone-slash',
253
+ 'f068' => 'minus',
254
+ 'f056' => 'minus-circle',
255
+ 'f146' => 'minus-square',
256
+ 'f147' => 'minus-square-o',
257
+ 'f10b' => 'mobile',
258
+ 'f0d6' => 'money',
259
+ 'f186' => 'moon-o',
260
+ 'f001' => 'music',
261
+ 'f03b' => 'outdent',
262
+ 'f18c' => 'pagelines',
263
+ 'f0c6' => 'paperclip',
264
+ 'f04c' => 'pause',
265
+ 'f040' => 'pencil',
266
+ 'f14b' => 'pencil-square',
267
+ 'f044' => 'pencil-square-o',
268
+ 'f095' => 'phone',
269
+ 'f098' => 'phone-square',
270
+ 'f03e' => 'picture-o',
271
+ 'f0d2' => 'pinterest',
272
+ 'f0d3' => 'pinterest-square',
273
+ 'f072' => 'plane',
274
+ 'f04b' => 'play',
275
+ 'f144' => 'play-circle',
276
+ 'f01d' => 'play-circle-o',
277
+ 'f067' => 'plus',
278
+ 'f055' => 'plus-circle',
279
+ 'f0fe' => 'plus-square',
280
+ 'f196' => 'plus-square-o',
281
+ 'f011' => 'power-off',
282
+ 'f02f' => 'print',
283
+ 'f12e' => 'puzzle-piece',
284
+ 'f029' => 'qrcode',
285
+ 'f128' => 'question',
286
+ 'f059' => 'question-circle',
287
+ 'f10d' => 'quote-left',
288
+ 'f10e' => 'quote-right',
289
+ 'f074' => 'random',
290
+ 'f021' => 'refresh',
291
+ 'f18b' => 'renren',
292
+ 'f01e' => 'repeat',
293
+ 'f112' => 'reply',
294
+ 'f122' => 'reply-all',
295
+ 'f079' => 'retweet',
296
+ 'f018' => 'road',
297
+ 'f135' => 'rocket',
298
+ 'f09e' => 'rss',
299
+ 'f143' => 'rss-square',
300
+ 'f158' => 'rub',
301
+ 'f0c4' => 'scissors',
302
+ 'f002' => 'search',
303
+ 'f010' => 'search-minus',
304
+ 'f00e' => 'search-plus',
305
+ 'f064' => 'share',
306
+ 'f14d' => 'share-square',
307
+ 'f045' => 'share-square-o',
308
+ 'f132' => 'shield',
309
+ 'f07a' => 'shopping-cart',
310
+ 'f090' => 'sign-in',
311
+ 'f08b' => 'sign-out',
312
+ 'f012' => 'signal',
313
+ 'f0e8' => 'sitemap',
314
+ 'f17e' => 'skype',
315
+ 'f118' => 'smile-o',
316
+ 'f0dc' => 'sort',
317
+ 'f15d' => 'sort-alpha-asc',
318
+ 'f15e' => 'sort-alpha-desc',
319
+ 'f160' => 'sort-amount-asc',
320
+ 'f161' => 'sort-amount-desc',
321
+ 'f0dd' => 'sort-asc',
322
+ 'f0de' => 'sort-desc',
323
+ 'f162' => 'sort-numeric-asc',
324
+ 'f163' => 'sort-numeric-desc',
325
+ 'f110' => 'spinner',
326
+ 'f0c8' => 'square',
327
+ 'f096' => 'square-o',
328
+ 'f18d' => 'stack-exchange',
329
+ 'f16c' => 'stack-overflow',
330
+ 'f005' => 'star',
331
+ 'f089' => 'star-half',
332
+ 'f123' => 'star-half-o',
333
+ 'f006' => 'star-o',
334
+ 'f048' => 'step-backward',
335
+ 'f051' => 'step-forward',
336
+ 'f0f1' => 'stethoscope',
337
+ 'f04d' => 'stop',
338
+ 'f0cc' => 'strikethrough',
339
+ 'f12c' => 'subscript',
340
+ 'f0f2' => 'suitcase',
341
+ 'f185' => 'sun-o',
342
+ 'f12b' => 'superscript',
343
+ 'f0ce' => 'table',
344
+ 'f10a' => 'tablet',
345
+ 'f0e4' => 'tachometer',
346
+ 'f02b' => 'tag',
347
+ 'f02c' => 'tags',
348
+ 'f0ae' => 'tasks',
349
+ 'f120' => 'terminal',
350
+ 'f034' => 'text-height',
351
+ 'f035' => 'text-width',
352
+ 'f00a' => 'th',
353
+ 'f009' => 'th-large',
354
+ 'f00b' => 'th-list',
355
+ 'f08d' => 'thumb-tack',
356
+ 'f165' => 'thumbs-down',
357
+ 'f088' => 'thumbs-o-down',
358
+ 'f087' => 'thumbs-o-up',
359
+ 'f164' => 'thumbs-up',
360
+ 'f145' => 'ticket',
361
+ 'f00d' => 'times',
362
+ 'f057' => 'times-circle',
363
+ 'f05c' => 'times-circle-o',
364
+ 'f043' => 'tint',
365
+ 'f014' => 'trash-o',
366
+ 'f181' => 'trello',
367
+ 'f091' => 'trophy',
368
+ 'f0d1' => 'truck',
369
+ 'f195' => 'try',
370
+ 'f173' => 'tumblr',
371
+ 'f174' => 'tumblr-square',
372
+ 'f099' => 'twitter',
373
+ 'f081' => 'twitter-square',
374
+ 'f0e9' => 'umbrella',
375
+ 'f0cd' => 'underline',
376
+ 'f0e2' => 'undo',
377
+ 'f09c' => 'unlock',
378
+ 'f13e' => 'unlock-alt',
379
+ 'f093' => 'upload',
380
+ 'f155' => 'usd',
381
+ 'f007' => 'user',
382
+ 'f0f0' => 'user-md',
383
+ 'f0c0' => 'users',
384
+ 'f03d' => 'video-camera',
385
+ 'f194' => 'vimeo-square',
386
+ 'f189' => 'vk',
387
+ 'f027' => 'volume-down',
388
+ 'f026' => 'volume-off',
389
+ 'f028' => 'volume-up',
390
+ 'f18a' => 'weibo',
391
+ 'f193' => 'wheelchair',
392
+ 'f17a' => 'windows',
393
+ 'f0ad' => 'wrench',
394
+ 'f168' => 'xing',
395
+ 'f169' => 'xing-square',
396
+ 'f167' => 'youtube',
397
+ 'f16a' => 'youtube-play',
398
+ 'f166' => 'youtube-square'
399
+ ),
400
+ 'awesome_icons2' => array(
401
+ '\f042' => 'adjust',
402
+ '\f170' => 'adn',
403
+ '\f037' => 'align-center',
404
+ '\f039' => 'align-justify',
405
+ '\f036' => 'align-left',
406
+ '\f038' => 'align-right',
407
+ '\f0f9' => 'ambulance',
408
+ '\f13d' => 'anchor',
409
+ '\f17b' => 'android',
410
+ '\f209' => 'angellist',
411
+ '\f103' => 'angle-double-down',
412
+ '\f100' => 'angle-double-left',
413
+ '\f101' => 'angle-double-right',
414
+ '\f102' => 'angle-double-up',
415
+ '\f107' => 'angle-down',
416
+ '\f104' => 'angle-left',
417
+ '\f105' => 'angle-right',
418
+ '\f106' => 'angle-up',
419
+ '\f179' => 'apple',
420
+ '\f187' => 'archive',
421
+ '\f1fe' => 'area-chart',
422
+ '\f0ab' => 'arrow-circle-down',
423
+ '\f0a8' => 'arrow-circle-left',
424
+ '\f01a' => 'arrow-circle-o-down',
425
+ '\f190' => 'arrow-circle-o-left',
426
+ '\f18e' => 'arrow-circle-o-right',
427
+ '\f01b' => 'arrow-circle-o-up',
428
+ '\f0a9' => 'arrow-circle-right',
429
+ '\f0aa' => 'arrow-circle-up',
430
+ '\f063' => 'arrow-down',
431
+ '\f060' => 'arrow-left',
432
+ '\f061' => 'arrow-right',
433
+ '\f062' => 'arrow-up',
434
+ '\f047' => 'arrows',
435
+ '\f0b2' => 'arrows-alt',
436
+ '\f07e' => 'arrows-h',
437
+ '\f07d' => 'arrows-v',
438
+ '\f069' => 'asterisk',
439
+ '\f1fa' => 'at',
440
+ '\f1b9' => 'automobile',
441
+ '\f04a' => 'backward',
442
+ '\f05e' => 'ban',
443
+ '\f19c' => 'bank',
444
+ '\f080' => 'bar-chart',
445
+ '\f080' => 'bar-chart-o',
446
+ '\f02a' => 'barcode',
447
+ '\f0c9' => 'bars',
448
+ '\f236' => 'bed',
449
+ '\f0fc' => 'beer',
450
+ '\f1b4' => 'behance',
451
+ '\f1b5' => 'behance-square',
452
+ '\f0f3' => 'bell',
453
+ '\f0a2' => 'bell-o',
454
+ '\f1f6' => 'bell-slash',
455
+ '\f1f7' => 'bell-slash-o',
456
+ '\f206' => 'bicycle',
457
+ '\f1e5' => 'binoculars',
458
+ '\f1fd' => 'birthday-cake',
459
+ '\f171' => 'bitbucket',
460
+ '\f172' => 'bitbucket-square',
461
+ '\f15a' => 'bitcoin',
462
+ '\f032' => 'bold',
463
+ '\f0e7' => 'bolt',
464
+ '\f1e2' => 'bomb',
465
+ '\f02d' => 'book',
466
+ '\f02e' => 'bookmark',
467
+ '\f097' => 'bookmark-o',
468
+ '\f0b1' => 'briefcase',
469
+ '\f15a' => 'btc',
470
+ '\f188' => 'bug',
471
+ '\f1ad' => 'building',
472
+ '\f0f7' => 'building-o',
473
+ '\f0a1' => 'bullhorn',
474
+ '\f140' => 'bullseye',
475
+ '\f207' => 'bus',
476
+ '\f20d' => 'buysellads',
477
+ '\f1ba' => 'cab',
478
+ '\f1ec' => 'calculator',
479
+ '\f073' => 'calendar',
480
+ '\f133' => 'calendar-o',
481
+ '\f030' => 'camera',
482
+ '\f083' => 'camera-retro',
483
+ '\f1b9' => 'car',
484
+ '\f0d7' => 'caret-down',
485
+ '\f0d9' => 'caret-left',
486
+ '\f0da' => 'caret-right',
487
+ '\f150' => 'caret-square-o-down',
488
+ '\f191' => 'caret-square-o-left',
489
+ '\f152' => 'caret-square-o-right',
490
+ '\f151' => 'caret-square-o-up',
491
+ '\f0d8' => 'caret-up',
492
+ '\f218' => 'cart-arrow-down',
493
+ '\f217' => 'cart-plus',
494
+ '\f20a' => 'cc',
495
+ '\f1f3' => 'cc-amex',
496
+ '\f1f2' => 'cc-discover',
497
+ '\f1f1' => 'cc-mastercard',
498
+ '\f1f4' => 'cc-paypal',
499
+ '\f1f5' => 'cc-stripe',
500
+ '\f1f0' => 'cc-visa',
501
+ '\f0a3' => 'certificate',
502
+ '\f0c1' => 'chain',
503
+ '\f127' => 'chain-broken',
504
+ '\f00c' => 'check',
505
+ '\f058' => 'check-circle',
506
+ '\f05d' => 'check-circle-o',
507
+ '\f14a' => 'check-square',
508
+ '\f046' => 'check-square-o',
509
+ '\f13a' => 'chevron-circle-down',
510
+ '\f137' => 'chevron-circle-left',
511
+ '\f138' => 'chevron-circle-right',
512
+ '\f139' => 'chevron-circle-up',
513
+ '\f078' => 'chevron-down',
514
+ '\f053' => 'chevron-left',
515
+ '\f054' => 'chevron-right',
516
+ '\f077' => 'chevron-up',
517
+ '\f1ae' => 'child',
518
+ '\f111' => 'circle',
519
+ '\f10c' => 'circle-o',
520
+ '\f1ce' => 'circle-o-notch',
521
+ '\f1db' => 'circle-thin',
522
+ '\f0ea' => 'clipboard',
523
+ '\f017' => 'clock-o',
524
+ '\f00d' => 'close',
525
+ '\f0c2' => 'cloud',
526
+ '\f0ed' => 'cloud-download',
527
+ '\f0ee' => 'cloud-upload',
528
+ '\f157' => 'cny',
529
+ '\f121' => 'code',
530
+ '\f126' => 'code-fork',
531
+ '\f1cb' => 'codepen',
532
+ '\f0f4' => 'coffee',
533
+ '\f013' => 'cog',
534
+ '\f085' => 'cogs',
535
+ '\f0db' => 'columns',
536
+ '\f075' => 'comment',
537
+ '\f0e5' => 'comment-o',
538
+ '\f086' => 'comments',
539
+ '\f0e6' => 'comments-o',
540
+ '\f14e' => 'compass',
541
+ '\f066' => 'compress',
542
+ '\f20e' => 'connectdevelop',
543
+ '\f0c5' => 'copy',
544
+ '\f1f9' => 'copyright',
545
+ '\f09d' => 'credit-card',
546
+ '\f125' => 'crop',
547
+ '\f05b' => 'crosshairs',
548
+ '\f13c' => 'css3',
549
+ '\f1b2' => 'cube',
550
+ '\f1b3' => 'cubes',
551
+ '\f0c4' => 'cut',
552
+ '\f0f5' => 'cutlery',
553
+ '\f0e4' => 'dashboard',
554
+ '\f210' => 'dashcube',
555
+ '\f1c0' => 'database',
556
+ '\f03b' => 'dedent',
557
+ '\f1a5' => 'delicious',
558
+ '\f108' => 'desktop',
559
+ '\f1bd' => 'deviantart',
560
+ '\f219' => 'diamond',
561
+ '\f1a6' => 'digg',
562
+ '\f155' => 'dollar',
563
+ '\f192' => 'dot-circle-o',
564
+ '\f019' => 'download',
565
+ '\f17d' => 'dribbble',
566
+ '\f16b' => 'dropbox',
567
+ '\f1a9' => 'drupal',
568
+ '\f044' => 'edit',
569
+ '\f052' => 'eject',
570
+ '\f141' => 'ellipsis-h',
571
+ '\f142' => 'ellipsis-v',
572
+ '\f1d1' => 'empire',
573
+ '\f0e0' => 'envelope',
574
+ '\f003' => 'envelope-o',
575
+ '\f199' => 'envelope-square',
576
+ '\f12d' => 'eraser',
577
+ '\f153' => 'eur',
578
+ '\f153' => 'euro',
579
+ '\f0ec' => 'exchange',
580
+ '\f12a' => 'exclamation',
581
+ '\f06a' => 'exclamation-circle',
582
+ '\f071' => 'exclamation-triangle',
583
+ '\f065' => 'expand',
584
+ '\f08e' => 'external-link',
585
+ '\f14c' => 'external-link-square',
586
+ '\f06e' => 'eye',
587
+ '\f070' => 'eye-slash',
588
+ '\f1fb' => 'eyedropper',
589
+ '\f09a' => 'facebook',
590
+ '\f09a' => 'facebook-f',
591
+ '\f230' => 'facebook-official',
592
+ '\f082' => 'facebook-square',
593
+ '\f049' => 'fast-backward',
594
+ '\f050' => 'fast-forward',
595
+ '\f1ac' => 'fax',
596
+ '\f182' => 'female',
597
+ '\f0fb' => 'fighter-jet',
598
+ '\f15b' => 'file',
599
+ '\f1c6' => 'file-archive-o',
600
+ '\f1c7' => 'file-audio-o',
601
+ '\f1c9' => 'file-code-o',
602
+ '\f1c3' => 'file-excel-o',
603
+ '\f1c5' => 'file-image-o',
604
+ '\f1c8' => 'file-movie-o',
605
+ '\f016' => 'file-o',
606
+ '\f1c1' => 'file-pdf-o',
607
+ '\f1c5' => 'file-photo-o',
608
+ '\f1c5' => 'file-picture-o',
609
+ '\f1c4' => 'file-powerpoint-o',
610
+ '\f1c7' => 'file-sound-o',
611
+ '\f15c' => 'file-text',
612
+ '\f0f6' => 'file-text-o',
613
+ '\f1c8' => 'file-video-o',
614
+ '\f1c2' => 'file-word-o',
615
+ '\f1c6' => 'file-zip-o',
616
+ '\f0c5' => 'files-o',
617
+ '\f008' => 'film',
618
+ '\f0b0' => 'filter',
619
+ '\f06d' => 'fire',
620
+ '\f134' => 'fire-extinguisher',
621
+ '\f024' => 'flag',
622
+ '\f11e' => 'flag-checkered',
623
+ '\f11d' => 'flag-o',
624
+ '\f0e7' => 'flash',
625
+ '\f0c3' => 'flask',
626
+ '\f16e' => 'flickr',
627
+ '\f0c7' => 'floppy-o',
628
+ '\f07b' => 'folder',
629
+ '\f114' => 'folder-o',
630
+ '\f07c' => 'folder-open',
631
+ '\f115' => 'folder-open-o',
632
+ '\f031' => 'font',
633
+ '\f211' => 'forumbee',
634
+ '\f04e' => 'forward',
635
+ '\f180' => 'foursquare',
636
+ '\f119' => 'frown-o',
637
+ '\f1e3' => 'futbol-o',
638
+ '\f11b' => 'gamepad',
639
+ '\f0e3' => 'gavel',
640
+ '\f154' => 'gbp',
641
+ '\f1d1' => 'ge',
642
+ '\f013' => 'gear',
643
+ '\f085' => 'gears',
644
+ '\f1db' => 'genderless',
645
+ '\f06b' => 'gift',
646
+ '\f1d3' => 'git',
647
+ '\f1d2' => 'git-square',
648
+ '\f09b' => 'github',
649
+ '\f113' => 'github-alt',
650
+ '\f092' => 'github-square',
651
+ '\f184' => 'gittip',
652
+ '\f000' => 'glass',
653
+ '\f0ac' => 'globe',
654
+ '\f1a0' => 'google',
655
+ '\f0d5' => 'google-plus',
656
+ '\f0d4' => 'google-plus-square',
657
+ '\f1ee' => 'google-wallet',
658
+ '\f19d' => 'graduation-cap',
659
+ '\f184' => 'gratipay',
660
+ '\f0c0' => 'group',
661
+ '\f0fd' => 'h-square',
662
+ '\f1d4' => 'hacker-news',
663
+ '\f0a7' => 'hand-o-down',
664
+ '\f0a5' => 'hand-o-left',
665
+ '\f0a4' => 'hand-o-right',
666
+ '\f0a6' => 'hand-o-up',
667
+ '\f0a0' => 'hdd-o',
668
+ '\f1dc' => 'header',
669
+ '\f025' => 'headphones',
670
+ '\f004' => 'heart',
671
+ '\f08a' => 'heart-o',
672
+ '\f21e' => 'heartbeat',
673
+ '\f1da' => 'history',
674
+ '\f015' => 'home',
675
+ '\f0f8' => 'hospital-o',
676
+ '\f236' => 'hotel',
677
+ '\f13b' => 'html5',
678
+ '\f20b' => 'ils',
679
+ '\f03e' => 'image',
680
+ '\f01c' => 'inbox',
681
+ '\f03c' => 'indent',
682
+ '\f129' => 'info',
683
+ '\f05a' => 'info-circle',
684
+ '\f156' => 'inr',
685
+ '\f16d' => 'instagram',
686
+ '\f19c' => 'institution',
687
+ '\f208' => 'ioxhost',
688
+ '\f033' => 'italic',
689
+ '\f1aa' => 'joomla',
690
+ '\f157' => 'jpy',
691
+ '\f1cc' => 'jsfiddle',
692
+ '\f084' => 'key',
693
+ '\f11c' => 'keyboard-o',
694
+ '\f159' => 'krw',
695
+ '\f1ab' => 'language',
696
+ '\f109' => 'laptop',
697
+ '\f202' => 'lastfm',
698
+ '\f203' => 'lastfm-square',
699
+ '\f06c' => 'leaf',
700
+ '\f212' => 'leanpub',
701
+ '\f0e3' => 'legal',
702
+ '\f094' => 'lemon-o',
703
+ '\f149' => 'level-down',
704
+ '\f148' => 'level-up',
705
+ '\f1cd' => 'life-bouy',
706
+ '\f1cd' => 'life-buoy',
707
+ '\f1cd' => 'life-ring',
708
+ '\f1cd' => 'life-saver',
709
+ '\f0eb' => 'lightbulb-o',
710
+ '\f201' => 'line-chart',
711
+ '\f0c1' => 'link',
712
+ '\f0e1' => 'linkedin',
713
+ '\f08c' => 'linkedin-square',
714
+ '\f17c' => 'linux',
715
+ '\f03a' => 'list',
716
+ '\f022' => 'list-alt',
717
+ '\f0cb' => 'list-ol',
718
+ '\f0ca' => 'list-ul',
719
+ '\f124' => 'location-arrow',
720
+ '\f023' => 'lock',
721
+ '\f175' => 'long-arrow-down',
722
+ '\f177' => 'long-arrow-left',
723
+ '\f178' => 'long-arrow-right',
724
+ '\f176' => 'long-arrow-up',
725
+ '\f0d0' => 'magic',
726
+ '\f076' => 'magnet',
727
+ '\f064' => 'mail-forward',
728
+ '\f112' => 'mail-reply',
729
+ '\f122' => 'mail-reply-all',
730
+ '\f183' => 'male',
731
+ '\f041' => 'map-marker',
732
+ '\f222' => 'mars',
733
+ '\f227' => 'mars-double',
734
+ '\f229' => 'mars-stroke',
735
+ '\f22b' => 'mars-stroke-h',
736
+ '\f22a' => 'mars-stroke-v',
737
+ '\f136' => 'maxcdn',
738
+ '\f20c' => 'meanpath',
739
+ '\f23a' => 'medium',
740
+ '\f0fa' => 'medkit',
741
+ '\f11a' => 'meh-o',
742
+ '\f223' => 'mercury',
743
+ '\f130' => 'microphone',
744
+ '\f131' => 'microphone-slash',
745
+ '\f068' => 'minus',
746
+ '\f056' => 'minus-circle',
747
+ '\f146' => 'minus-square',
748
+ '\f147' => 'minus-square-o',
749
+ '\f10b' => 'mobile',
750
+ '\f10b' => 'mobile-phone',
751
+ '\f0d6' => 'money',
752
+ '\f186' => 'moon-o',
753
+ '\f19d' => 'mortar-board',
754
+ '\f21c' => 'motorcycle',
755
+ '\f001' => 'music',
756
+ '\f0c9' => 'navicon',
757
+ '\f22c' => 'neuter',
758
+ '\f1ea' => 'newspaper-o',
759
+ '\f19b' => 'openid',
760
+ '\f03b' => 'outdent',
761
+ '\f18c' => 'pagelines',
762
+ '\f1fc' => 'paint-brush',
763
+ '\f1d8' => 'paper-plane',
764
+ '\f1d9' => 'paper-plane-o',
765
+ '\f0c6' => 'paperclip',
766
+ '\f1dd' => 'paragraph',
767
+ '\f0ea' => 'paste',
768
+ '\f04c' => 'pause',
769
+ '\f1b0' => 'paw',
770
+ '\f1ed' => 'paypal',
771
+ '\f040' => 'pencil',
772
+ '\f14b' => 'pencil-square',
773
+ '\f044' => 'pencil-square-o',
774
+ '\f095' => 'phone',
775
+ '\f098' => 'phone-square',
776
+ '\f03e' => 'photo',
777
+ '\f03e' => 'picture-o',
778
+ '\f200' => 'pie-chart',
779
+ '\f1a7' => 'pied-piper',
780
+ '\f1a8' => 'pied-piper-alt',
781
+ '\f0d2' => 'pinterest',
782
+ '\f231' => 'pinterest-p',
783
+ '\f0d3' => 'pinterest-square',
784
+ '\f072' => 'plane',
785
+ '\f04b' => 'play',
786
+ '\f144' => 'play-circle',
787
+ '\f01d' => 'play-circle-o',
788
+ '\f1e6' => 'plug',
789
+ '\f067' => 'plus',
790
+ '\f055' => 'plus-circle',
791
+ '\f0fe' => 'plus-square',
792
+ '\f196' => 'plus-square-o',
793
+ '\f011' => 'power-off',
794
+ '\f02f' => 'print',
795
+ '\f12e' => 'puzzle-piece',
796
+ '\f1d6' => 'qq',
797
+ '\f029' => 'qrcode',
798
+ '\f128' => 'question',
799
+ '\f059' => 'question-circle',
800
+ '\f10d' => 'quote-left',
801
+ '\f10e' => 'quote-right',
802
+ '\f1d0' => 'ra',
803
+ '\f074' => 'random',
804
+ '\f1d0' => 'rebel',
805
+ '\f1b8' => 'recycle',
806
+ '\f1a1' => 'reddit',
807
+ '\f1a2' => 'reddit-square',
808
+ '\f021' => 'refresh',
809
+ '\f00d' => 'remove',
810
+ '\f18b' => 'renren',
811
+ '\f0c9' => 'reorder',
812
+ '\f01e' => 'repeat',
813
+ '\f112' => 'reply',
814
+ '\f122' => 'reply-all',
815
+ '\f079' => 'retweet',
816
+ '\f157' => 'rmb',
817
+ '\f018' => 'road',
818
+ '\f135' => 'rocket',
819
+ '\f0e2' => 'rotate-left',
820
+ '\f01e' => 'rotate-right',
821
+ '\f158' => 'rouble',
822
+ '\f09e' => 'rss',
823
+ '\f143' => 'rss-square',
824
+ '\f158' => 'rub',
825
+ '\f158' => 'ruble',
826
+ '\f156' => 'rupee',
827
+ '\f0c7' => 'save',
828
+ '\f0c4' => 'scissors',
829
+ '\f002' => 'search',
830
+ '\f010' => 'search-minus',
831
+ '\f00e' => 'search-plus',
832
+ '\f213' => 'sellsy',
833
+ '\f1d8' => 'send',
834
+ '\f1d9' => 'send-o',
835
+ '\f233' => 'server',
836
+ '\f064' => 'share',
837
+ '\f1e0' => 'share-alt',
838
+ '\f1e1' => 'share-alt-square',
839
+ '\f14d' => 'share-square',
840
+ '\f045' => 'share-square-o',
841
+ '\f20b' => 'shekel',
842
+ '\f20b' => 'sheqel',
843
+ '\f132' => 'shield',
844
+ '\f21a' => 'ship',
845
+ '\f214' => 'shirtsinbulk',
846
+ '\f07a' => 'shopping-cart',
847
+ '\f090' => 'sign-in',
848
+ '\f08b' => 'sign-out',
849
+ '\f012' => 'signal',
850
+ '\f215' => 'simplybuilt',
851
+ '\f0e8' => 'sitemap',
852
+ '\f216' => 'skyatlas',
853
+ '\f17e' => 'skype',
854
+ '\f198' => 'slack',
855
+ '\f1de' => 'sliders',
856
+ '\f1e7' => 'slideshare',
857
+ '\f118' => 'smile-o',
858
+ '\f1e3' => 'soccer-ball-o',
859
+ '\f0dc' => 'sort',
860
+ '\f15d' => 'sort-alpha-asc',
861
+ '\f15e' => 'sort-alpha-desc',
862
+ '\f160' => 'sort-amount-asc',
863
+ '\f161' => 'sort-amount-desc',
864
+ '\f0de' => 'sort-asc',
865
+ '\f0dd' => 'sort-desc',
866
+ '\f0dd' => 'sort-down',
867
+ '\f162' => 'sort-numeric-asc',
868
+ '\f163' => 'sort-numeric-desc',
869
+ '\f0de' => 'sort-up',
870
+ '\f1be' => 'soundcloud',
871
+ '\f197' => 'space-shuttle',
872
+ '\f110' => 'spinner',
873
+ '\f1b1' => 'spoon',
874
+ '\f1bc' => 'spotify',
875
+ '\f0c8' => 'square',
876
+ '\f096' => 'square-o',
877
+ '\f18d' => 'stack-exchange',
878
+ '\f16c' => 'stack-overflow',
879
+ '\f005' => 'star',
880
+ '\f089' => 'star-half',
881
+ '\f123' => 'star-half-empty',
882
+ '\f123' => 'star-half-full',
883
+ '\f123' => 'star-half-o',
884
+ '\f006' => 'star-o',
885
+ '\f1b6' => 'steam',
886
+ '\f1b7' => 'steam-square',
887
+ '\f048' => 'step-backward',
888
+ '\f051' => 'step-forward',
889
+ '\f0f1' => 'stethoscope',
890
+ '\f04d' => 'stop',
891
+ '\f21d' => 'street-view',
892
+ '\f0cc' => 'strikethrough',
893
+ '\f1a4' => 'stumbleupon',
894
+ '\f1a3' => 'stumbleupon-circle',
895
+ '\f12c' => 'subscript',
896
+ '\f239' => 'subway',
897
+ '\f0f2' => 'suitcase',
898
+ '\f185' => 'sun-o',
899
+ '\f12b' => 'superscript',
900
+ '\f1cd' => 'support',
901
+ '\f0ce' => 'table',
902
+ '\f10a' => 'tablet',
903
+ '\f0e4' => 'tachometer',
904
+ '\f02b' => 'tag',
905
+ '\f02c' => 'tags',
906
+ '\f0ae' => 'tasks',
907
+ '\f1ba' => 'taxi',
908
+ '\f1d5' => 'tencent-weibo',
909
+ '\f120' => 'terminal',
910
+ '\f034' => 'text-height',
911
+ '\f035' => 'text-width',
912
+ '\f00a' => 'th',
913
+ '\f009' => 'th-large',
914
+ '\f00b' => 'th-list',
915
+ '\f08d' => 'thumb-tack',
916
+ '\f165' => 'thumbs-down',
917
+ '\f088' => 'thumbs-o-down',
918
+ '\f087' => 'thumbs-o-up',
919
+ '\f164' => 'thumbs-up',
920
+ '\f145' => 'ticket',
921
+ '\f00d' => 'times',
922
+ '\f057' => 'times-circle',
923
+ '\f05c' => 'times-circle-o',
924
+ '\f043' => 'tint',
925
+ '\f150' => 'toggle-down',
926
+ '\f191' => 'toggle-left',
927
+ '\f204' => 'toggle-off',
928
+ '\f205' => 'toggle-on',
929
+ '\f152' => 'toggle-right',
930
+ '\f151' => 'toggle-up',
931
+ '\f238' => 'train',
932
+ '\f224' => 'transgender',
933
+ '\f225' => 'transgender-alt',
934
+ '\f1f8' => 'trash',
935
+ '\f014' => 'trash-o',
936
+ '\f1bb' => 'tree',
937
+ '\f181' => 'trello',
938
+ '\f091' => 'trophy',
939
+ '\f0d1' => 'truck',
940
+ '\f195' => 'try',
941
+ '\f1e4' => 'tty',
942
+ '\f173' => 'tumblr',
943
+ '\f174' => 'tumblr-square',
944
+ '\f195' => 'turkish-lira',
945
+ '\f1e8' => 'twitch',
946
+ '\f099' => 'twitter',
947
+ '\f081' => 'twitter-square',
948
+ '\f0e9' => 'umbrella',
949
+ '\f0cd' => 'underline',
950
+ '\f0e2' => 'undo',
951
+ '\f19c' => 'university',
952
+ '\f127' => 'unlink',
953
+ '\f09c' => 'unlock',
954
+ '\f13e' => 'unlock-alt',
955
+ '\f0dc' => 'unsorted',
956
+ '\f093' => 'upload',
957
+ '\f155' => 'usd',
958
+ '\f007' => 'user',
959
+ '\f0f0' => 'user-md',
960
+ '\f234' => 'user-plus',
961
+ '\f21b' => 'user-secret',
962
+ '\f235' => 'user-times',
963
+ '\f0c0' => 'users',
964
+ '\f221' => 'venus',
965
+ '\f226' => 'venus-double',
966
+ '\f228' => 'venus-mars',
967
+ '\f237' => 'viacoin',
968
+ '\f03d' => 'video-camera',
969
+ '\f194' => 'vimeo-square',
970
+ '\f1ca' => 'vine',
971
+ '\f189' => 'vk',
972
+ '\f027' => 'volume-down',
973
+ '\f026' => 'volume-off',
974
+ '\f028' => 'volume-up',
975
+ '\f071' => 'warning',
976
+ '\f1d7' => 'wechat',
977
+ '\f18a' => 'weibo',
978
+ '\f1d7' => 'weixin',
979
+ '\f232' => 'whatsapp',
980
+ '\f193' => 'wheelchair',
981
+ '\f1eb' => 'wifi',
982
+ '\f17a' => 'windows',
983
+ '\f159' => 'won',
984
+ '\f19a' => 'wordpress',
985
+ '\f0ad' => 'wrench',
986
+ '\f168' => 'xing',
987
+ '\f169' => 'xing-square',
988
+ '\f19e' => 'yahoo',
989
+ '\f1e9' => 'yelp',
990
+ '\f157' => 'yen',
991
+ '\f167' => 'youtube',
992
+ '\f16a' => 'youtube-play',
993
+ '\f166' => 'youtube-square',
994
+ ),
995
+
996
+ 'awesome_icons_socials' =>array(
997
+ 'f170' => 'adn',
998
+ 'f17b' => 'android',
999
+ 'f179' => 'apple',
1000
+ 'f171' => 'bitbucket',
1001
+ 'f171' => 'bitbucket-square',
1002
+ 'f02e' => 'bookmark',
1003
+ 'f097' => 'bookmark-o',
1004
+ 'f15a' => 'btc',
1005
+ 'f13c' => 'css3',
1006
+ 'f17d' => 'dribble',
1007
+ 'f16b' => 'dropbox',
1008
+ 'f09a' => 'facebook',
1009
+ 'f082' => 'facebook-square',
1010
+ 'f16e' => 'flickr',
1011
+ 'f180' => 'foursquare',
1012
+ 'f09b'=> 'github' ,
1013
+ 'f113'=> 'github-alt',
1014
+ 'f092' => 'github-square',
1015
+ 'f184' => 'gittip',
1016
+ 'f0d5' => 'google-plus',
1017
+ 'f0d4' => 'google-plus-square',
1018
+ 'f13b' => 'html5',
1019
+ 'f16d' => 'instagram',
1020
+ 'f0e1' => 'linkedin',
1021
+ 'f08c' => 'linkedin-square',
1022
+ 'f17c' => 'Linux',
1023
+ 'f136' => 'maxcdn',
1024
+ 'f18c' => 'pagelines',
1025
+ 'f0d2' => 'pinterest',
1026
+ 'f0d3' => 'pinterest-square',
1027
+ 'f18b' => 'renren',
1028
+ 'f09e' => 'rss',
1029
+ 'f17e' => 'skype',
1030
+ 'f18d' => 'stack-exchange',
1031
+ 'f16c' => 'stack-overflow',
1032
+ 'f181' => 'trello',
1033
+ 'f173' => 'tumblr',
1034
+ 'f174' => 'Tumblr Square',
1035
+ 'f099' => 'twitter',
1036
+ 'f081' => 'twitter-square',
1037
+ 'f194' => 'vimeo-square',
1038
+ 'f189' => 'vk',
1039
+ 'f18a' => 'weibo',
1040
+ 'f17a' => 'windows',
1041
+ 'f168' => 'xing',
1042
+ 'f169' => 'xing-square',
1043
+ 'f167' => 'youtube'
1044
+ ),
1045
+ 'header_backgrounds' => array(),
1046
+ 'body_backgrounds' => array(),
1047
+
1048
+ // tags used in theme options (e.g. %tag%) to have some common informations
1049
+ 'tag' => array( //'themeurl' => get_template_directory_uri()
1050
+ ),
1051
+
1052
+ 'cycle_fx' => array(
1053
+ 'blindX' => 'blindX', 'blindY' => 'blindY', 'blindZ' => 'blindZ', 'cover' => 'cover', 'curtainX' => 'curtainX',
1054
+ 'curtainY' => 'curtainY', 'fade' => 'fade', 'fadeZoom' => 'fadeZoom', 'growX' => 'growX', 'growY' => 'growY',
1055
+ 'scrollUp' => 'scrollUp', 'scrollDown' => 'scrollDown', 'scrollLeft' => 'scrollLeft', 'scrollRight' => 'scrollRight', 'scrollHorz' => 'scrollHorz',
1056
+ 'shuffle' => 'shuffle', 'slideX' => 'slideX', 'slideY' => 'slideY', 'toss' => 'toss', 'turnUp' => 'turnUp',
1057
+ 'turnLeft' => 'turnLeft', 'turnRight' => 'turnRight', 'uncover' => 'uncover', 'wipe' => 'wipe', 'zoom' => 'zoom',
1058
+ 'none' => 'none', 'turnDown' => 'turnDown', 'scrollVert' => 'scrollVert'
1059
+ ),
1060
+
1061
+ 'animate' => array(
1062
+ '' => "none",
1063
+ "bounce" => "bounce",
1064
+ "flash" =>"flash",
1065
+ "pulse" =>"pulse",
1066
+ //"rubberBand"=>"rubberBand",
1067
+ "shake" =>"shake",
1068
+ "swing"=>"swing",
1069
+ "tada" =>"tada",
1070
+ "wobble"=>"wobble",
1071
+ "bounceIn"=>"bounceIn",
1072
+ "bounceInDown"=>"bounceInDown",
1073
+ "bounceInLeft"=>"bounceInLeft",
1074
+ "bounceInRight"=>"bounceInRight",
1075
+ "bounceInUp"=>"bounceInUp",
1076
+ "fadeIn"=>"fadeIn",
1077
+ "fadeInDown"=>"fadeInDown",
1078
+ "fadeInDownBig"=>"fadeInDownBig",
1079
+ "fadeInLeft"=>"fadeInLeft",
1080
+ "fadeInLeftBig"=>"fadeInLeftBig",
1081
+ "fadeInRight"=>"fadeInRight",
1082
+ "fadeInRightBig"=>"fadeInRightBig",
1083
+ "fadeInUp"=>"fadeInUp",
1084
+ "fadeInUpBig"=>"fadeInUpBig",
1085
+ "flip"=>"flip",
1086
+ "flipInX"=>"flipInX",
1087
+ "flipInY"=>"flipInY",
1088
+ "lightSpeedIn"=>"lightSpeedIn",
1089
+ "rotateIn"=>"rotateIn",
1090
+ "rotateInDownLeft"=>"rotateInDownLeft",
1091
+ "rotateInDownRight"=>"rotateInDownRight",
1092
+ "rotateInUpLeft"=>"rotateInUpLeft",
1093
+ "rotateInUpRight"=>"rotateInUpRight",
1094
+ //"slideInDown"=>"slideInDown",
1095
+ //"slideInLeft"=>"slideInLeft",
1096
+ //"slideInRight"=>"slideInRight",
1097
+ "rollIn"=>"rollIn",
1098
+ ),
1099
+
1100
+ 'easings' => array(
1101
+ FALSE => 'none',
1102
+ 'easeInQuad' => 'easeInQuad',
1103
+ 'easeOutQuad' => 'easeOutQuad',
1104
+ 'easeInOutQuad' => 'easeInOutQuad',
1105
+ 'easeInCubic' => 'easeInCubic',
1106
+ 'easeOutCubic' => 'easeOutCubic',
1107
+ 'easeInOutCubic' => 'easeInOutCubic',
1108
+ 'easeInQuart' => 'easeInQuart',
1109
+ 'easeOutQuart' => 'easeOutQuart',
1110
+ 'easeInOutQuart' => 'easeInOutQuart',
1111
+ 'easeInQuint' => 'easeInQuint',
1112
+ 'easeOutQuint' => 'easeOutQuint',
1113
+ 'easeInOutQuint' => 'easeInOutQuint',
1114
+ 'easeInSine' => 'easeInSine',
1115
+ 'easeOutSine' => 'easeOutSine',
1116
+ 'easeInOutSine' => 'easeInOutSine',
1117
+ 'easeInExpo' => 'easeInExpo',
1118
+ 'easeOutExpo' => 'easeOutExpo',
1119
+ 'easeInOutExpo' => 'easeInOutExpo',
1120
+ 'easeInCirc' => 'easeInCirc',
1121
+ 'easeOutCirc' => 'easeOutCirc',
1122
+ 'easeInOutCirc' => 'easeInOutCirc',
1123
+ 'easeInElastic' => 'easeInElastic',
1124
+ 'easeOutElastic' => 'easeOutElastic',
1125
+ 'easeInOutElastic' => 'easeInOutElastic',
1126
+ 'easeInBack' => 'easeInBack',
1127
+ 'easeOutBack' => 'easeOutBack',
1128
+ 'easeInOutBack' => 'easeInOutBack',
1129
+ 'easeInBounce' => 'easeInBounce',
1130
+ 'easeOutBounce' => 'easeOutBounce',
1131
+ 'easeInOutBounce' => 'easeInOutBounce'
1132
+ )
1133
+ );
1134
+
1135
+ /**
1136
+ * Get configuration array
1137
+ *
1138
+ * @return array
1139
+ */
1140
+ public static function load() {
1141
+ self::_loadThemeInfo();
1142
+ //ksort( self::$_config['awesome_icons'] );
1143
+
1144
+ return self::$_config;
1145
+ }
1146
+
1147
+ /**
1148
+ * Return theme data
1149
+ *
1150
+ * First the method checks if the wp_get_theme() function exists (WP 3.4.0 at least).
1151
+ * If not, the method calls the deprecated function get_template_directory()
1152
+ *
1153
+ * @return array
1154
+ */
1155
+ protected static function _loadThemeInfo() {
1156
+ $theme = wp_get_theme();
1157
+
1158
+ self::$_config['theme'] = array(
1159
+ 'name' => $theme->Name,
1160
+ 'description' => $theme->Description,
1161
+ 'author' => $theme->Author,
1162
+ 'authoruri' => $theme->{'Author URI'},
1163
+ 'version' => $theme->Version,
1164
+ 'template' => $theme->Template,
1165
+ 'status' => $theme->Status,
1166
+ 'tags' => $theme->Tags
1167
+ );
1168
+ }
1169
+
1170
+
1171
+ public function init() {
1172
+ self::$_config['header_backgrounds'] = apply_filters( 'yit_header_backgrounds', self::$_config['header_backgrounds'] );
1173
+ self::$_config['body_backgrounds'] = apply_filters( 'yit_body_backgrounds', self::$_config['body_backgrounds'] );
1174
+ }
1175
+
1176
+ /**
1177
+ * Return the font awesome array icon
1178
+ *
1179
+ * @return string Array
1180
+ * @access public
1181
+ * @since 1.0.0
1182
+ */
1183
+ public static function get_awesome_icons() {
1184
+ return self::$_config['awesome_icons'];
1185
+ }
1186
+
1187
+ /**
1188
+ * Return the font awesome array socials icon
1189
+ *
1190
+ * @return string Array
1191
+ * @access public
1192
+ * @since 1.0.0
1193
+ */
1194
+ public static function get_awesome_icons_socials() {
1195
+ return self::$_config['awesome_icons_socials'];
1196
+ }
1197
+
1198
+
1199
+ /**
1200
+ * Return the list of icons
1201
+ *
1202
+ * @return string Array
1203
+ * @access public
1204
+ * @since 1.0.0
1205
+ */
1206
+ public static function get_icon_list() {
1207
+
1208
+ $standard_icon_list = array(
1209
+ 'FontAwesome' => self::$_config['awesome_icons2']
1210
+ );
1211
+
1212
+ return apply_filters( 'yit_icon_list', $standard_icon_list );
1213
+ }
1214
+
1215
+ /**
1216
+ * Return the data of icon
1217
+ *
1218
+ * @return string Array
1219
+ * @access public
1220
+ * @since 1.0.0
1221
+ */
1222
+ public static function get_icon( $icon ) {
1223
+
1224
+ $icon_list = self::get_icon_list();
1225
+ $icon_data = '';
1226
+ if ( $icon != '' ) {
1227
+ $ic = explode( ':', $icon );
1228
+ $icon_code = array_search( $ic[1], $icon_list[$ic[0]] );
1229
+
1230
+ if( $icon_code ){
1231
+ $icon_code = ( strpos( $icon_code, '\\' ) === 0 ) ? '&#x' . substr( $icon_code, 1 ) . ';' : $icon_code;
1232
+ }
1233
+
1234
+ $icon_data = 'data-font="' . $ic[0] . '" data-key="' . $ic[1] . '" data-icon="' . $icon_code . '"';
1235
+ }
1236
+
1237
+ return $icon_data;
1238
+ }
1239
+
1240
+
1241
+ /*
1242
+ * Return the code of the relative awesome class name
1243
+ *
1244
+ * @return string
1245
+ * @access public
1246
+ * @since 1.0.0
1247
+ */
1248
+ public static function get_awesome_icons_code_by_value($class){
1249
+ $awesome_icons=self::$_config['awesome_icons'];
1250
+ foreach($awesome_icons as $key => $value){
1251
+ if($class==$value) {
1252
+ return $key;
1253
+ }
1254
+ }
1255
+
1256
+ return "";
1257
+ }
1258
+ }
1259
+
1260
  endif;
plugin-fw/lib/yit-plugin-gradients.php CHANGED
@@ -1,536 +1,536 @@
1
- <?php
2
- /**
3
- * Your Inspiration Themes
4
- *
5
- * In this files there is a collection of a functions useful for the core
6
- * of the framework.
7
- *
8
- * @package WordPress
9
- * @subpackage Your Inspiration Themes
10
- * @author Your Inspiration Themes Team <info@yithemes.com>
11
- *
12
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
13
- * that is bundled with this package in the file LICENSE.txt.
14
- * It is also available through the world-wide-web at this URL:
15
- * http://www.gnu.org/licenses/gpl-3.0.txt
16
- */
17
-
18
- /**
19
- * Handles colors
20
- *
21
- * @since 1.0
22
- */
23
- /**
24
- * Generates CSS 3 gradients for all browsers.
25
- *
26
- * @since 1.0
27
- */
28
-
29
- if ( ! class_exists( 'YIT_Gradients' ) ) {
30
-
31
- class YIT_Gradients {
32
-
33
- /**
34
- * An array of colors to use for a gradient.
35
- *
36
- * @var array
37
- * @since 1.0
38
- */
39
- public $colors_gradient = array();
40
-
41
- /**
42
- * Set properties
43
- *
44
- * @param string $key
45
- * @param $value
46
- *
47
- * @internal param array $colors_gradient
48
- * @return void
49
- * @since 1.0
50
- */
51
- public function set( $key, $value ) {
52
- if ( property_exists( $this, $key ) ) {
53
- $this->{$key} = $value;
54
- }
55
- }
56
-
57
- /**
58
- * Get properties
59
- *
60
- * @param string $key
61
- *
62
- * @return mixed
63
- * @since 1.0
64
- */
65
- public function get( $key ) {
66
- if ( property_exists( $this, $key ) ) {
67
- return $this->{$key};
68
- }
69
- }
70
-
71
- /**
72
- * Add a color to use in a gradient.
73
- *
74
- * @param string $color
75
- * @param int $position
76
- *
77
- * @return void
78
- * @since 1.0
79
- */
80
- public function add_color_gradient( $color, $position ) {
81
- $the_color['color'] = $color;
82
- $the_color['position'] = $position;
83
-
84
- array_push( $this->colors_gradient, $the_color );
85
- }
86
-
87
- /**
88
- * Generate the CSS code for a gradient.
89
- *
90
- * @param string $role
91
- * @param string $direction
92
- *
93
- * @return string|bool
94
- * @since 1.0
95
- */
96
- public function gradient( $role, $direction ) {
97
- if ( ! empty( $this->colors_gradient ) ) {
98
-
99
- $css = array(
100
- 'old' => $this->_make_old_gradient( $this->colors_gradient[0]['color'] ), //old browser
101
- 'ff3' => $this->_make_modern_gradient( $this->colors_gradient, $direction, 'moz' ), //firefox 3.6+
102
- 'chr_saf4' => $this->_make_chr_saf4_gradient( $this->colors_gradient, $direction ), //chrome and safari4+
103
- 'chr10_saf5' => $this->_make_modern_gradient( $this->colors_gradient, $direction, 'webkit' ), //chrome10+ and safari5+
104
- 'opera' => $this->_make_modern_gradient( $this->colors_gradient, $direction, 'o' ), //opera11.10+
105
- 'ie10' => $this->_make_modern_gradient( $this->colors_gradient, $direction, 'ms' ), //internet explorer 10+
106
- 'w3c' => $this->_make_modern_gradient( $this->colors_gradient, $direction, 'w3c' ), //w3c
107
- 'ie6_9' => $this->_make_ie6_gradient( $this->colors_gradient, $direction ) //ie6-9
108
- );
109
-
110
- $css = $role . '{' . implode( ';', $css ) . '}';
111
-
112
- $this->colors_gradient = array();
113
-
114
- return $css;
115
- }
116
- }
117
-
118
- /**
119
- * Reverse a gradient. This method should be used only before calling ::make_gradient(). Otherwise it will not works.
120
- *
121
- * @return void
122
- * @since 1.0
123
- */
124
- public function reverse_gradient() {
125
- $colors_gradient = array_reverse( $this->get( 'colors_gradient' ) );
126
-
127
- for ( $i = 0; $i < count( $colors_gradient ); $i ++ ) {
128
- $colors_gradient[$i]['position'] = 100 - $colors_gradient[$i]['position'];
129
- }
130
-
131
- $this->set( 'colors_gradient', $colors_gradient );
132
- }
133
-
134
- /**
135
- * Generate the CSS code for a gradient.
136
- *
137
- * @param string $role
138
- * @param string $direction
139
- *
140
- * @return string|bool
141
- * @since 1.0
142
- */
143
- public function get_gradient( $role, $direction ) {
144
- return $this->gradient( $role, $direction );
145
- }
146
-
147
- /**
148
- * Generate the CSS code for a gradient.
149
- *
150
- * @param string $role
151
- * @param string $direction
152
- *
153
- * @return void
154
- * @since 1.0
155
- */
156
- public function the_gradient( $role, $direction ) {
157
- echo $this->get_gradient( $role, $direction );
158
- }
159
-
160
- /**
161
- * Generate the CSS code for a gradient.
162
- *
163
- * @param string $role
164
- * @param string $from
165
- * @param string $to
166
- * @param string $direction
167
- *
168
- * @return string|bool
169
- * @since 1.0
170
- */
171
- public function gradient_from_to( $role, $from, $to, $direction ) {
172
-
173
- $colors = array(
174
- array(
175
- 'color' => $from,
176
- 'position' => 0
177
- ),
178
- array(
179
- 'color' => $to,
180
- 'position' => 100
181
- ),
182
- );
183
-
184
- $this->set( 'colors_gradient', $colors );
185
- return $this->get_gradient( $role, $direction );
186
- }
187
-
188
- /**
189
- * Generate the CSS code for a gradient.
190
- *
191
- * @param string $role
192
- * @param string $color
193
- * @param string $direction
194
- * @param int|string $factor
195
- *
196
- * @return string|bool
197
- * @since 1.0
198
- */
199
- public function gradient_darker( $role, $color, $direction, $factor = 30 ) {
200
-
201
- $colors = array(
202
- array(
203
- 'color' => $color,
204
- 'position' => 0
205
- ),
206
- array(
207
- 'color' => $this->hex_darker( $color, $factor ),
208
- 'position' => 100
209
- ),
210
- );
211
-
212
- $this->set( 'colors_gradient', $colors );
213
- return $this->get_gradient( $role, $direction );
214
- }
215
-
216
- /**
217
- * Generate the CSS code for a gradient.
218
- *
219
- * @param string $role
220
- * @param string $color
221
- * @param string $direction
222
- * @param int|string $factor
223
- *
224
- * @return string|bool
225
- * @since 1.0
226
- */
227
- public function gradient_lighter( $role, $color, $direction, $factor = 30 ) {
228
-
229
- $colors = array(
230
- array(
231
- 'color' => $color,
232
- 'position' => 0
233
- ),
234
- array(
235
- 'color' => $this->hex_lighter( $color, $factor ),
236
- 'position' => 100
237
- ),
238
- );
239
-
240
- $this->set( 'colors_gradient', $colors );
241
- return $this->get_gradient( $role, $direction );
242
- }
243
-
244
- /**
245
- * Generate the CSS code for a gradient that not supports gradients (add only a background color).
246
- *
247
- * @param $color
248
- *
249
- * @internal param string $role
250
- * @return string|bool
251
- * @access private
252
- * @since 1.0
253
- */
254
- private function _make_old_gradient( $color ) {
255
- return 'background:' . $color;
256
- }
257
-
258
- /**
259
- * Generate the CSS code for a gradient in IE6-9.
260
- *
261
- * @param $colors
262
- * @param $direction
263
- *
264
- * @internal param string $role
265
- * @return string|bool
266
- * @access private
267
- * @since 1.0
268
- */
269
- private function _make_ie6_gradient( $colors, $direction ) {
270
- $css = 'filter:progid:DXImageTransform.Microsoft.gradient(';
271
- $css .= 'startColorstr=\'' . $colors[0]['color'] . '\',';
272
- $css .= 'endColorstr=\'' . $colors[count( $colors ) - 1]['color'] . '\',';
273
-
274
- if ( $direction == 'horizontal' ) {
275
- $css .= 'GradientType=1';
276
- }
277
- else {
278
- $css .= 'GradientType=0';
279
- } //vertical
280
-
281
- $css .= ')';
282
-
283
- return $css;
284
- }
285
-
286
- /**
287
- * Make the CSS 3 for a gradient in modern browsers( FF3.6+, Chrome, Safari5+, Opera11.10+, IE10+ )
288
- *
289
- * @param array $colors
290
- * @param string $direction
291
- * @param $browser
292
- *
293
- * @return string
294
- * @access private
295
- * @since 1.0
296
- */
297
- private function _make_modern_gradient( $colors, $direction, $browser ) {
298
- $css = 'background:';
299
-
300
- //Add the browser suffix
301
- if ( $browser != 'w3c' ) {
302
- $browser = '-' . $browser . '-';
303
- }
304
- else {
305
- $browser = '';
306
- }
307
-
308
- switch ( $direction ) {
309
- case 'vertical' :
310
- $css .= $browser . 'linear-gradient(top,';
311
- break;
312
- case 'horizontal' :
313
- $css .= $browser . 'linear-gradient(left,';
314
- break;
315
- case 'diagonal-bottom':
316
- $css .= $browser . 'linear-gradient(-45deg,';
317
- break;
318
- case 'diagonal-top' :
319
- $css .= $browser . 'linear-gradient(45deg,';
320
- break;
321
- case 'radial' :
322
- $css .= $browser . 'radial-gradient(center, ellipse cover,';
323
- break;
324
- }
325
-
326
- foreach ( $colors as $stop ) {
327
- $css .= $stop['color'] . ' ' . $stop['position'] . '%, ';
328
- }
329
-
330
- $css = rtrim( $css );
331
- $css = rtrim( $css, ',' );
332
- $css .= ')';
333
-
334
- return $css;
335
- }
336
-
337
- /**
338
- * Make the CSS 3 for a gradient in Chrome and Safari 4+
339
- *
340
- * @param array $colors
341
- * @param string $direction
342
- *
343
- * @return string
344
- * @access private
345
- * @since 1.0
346
- */
347
- private function _make_chr_saf4_gradient( $colors, $direction ) {
348
- $css = 'background:';
349
-
350
- switch ( $direction ) {
351
- case 'vertical' :
352
- $css .= '-webkit-gradient(linear,left top,left bottom,';
353
- break;
354
- case 'horizontal' :
355
- $css .= '-webkit-gradient(linear,left top,right top,';
356
- break;
357
- case 'diagonal-bottom':
358
- $css .= '-webkit-gradient(linear,left top,right bottom,';
359
- break;
360
- case 'diagonal-top' :
361
- $css .= '-webkit-gradient(linear,left bottom,right top,';
362
- break;
363
- case 'radial' :
364
- $css .= '-webkit-gradient(radial,center center, 0px, center center, 100%,';
365
- break;
366
- }
367
-
368
- foreach ( $colors as $stop ) {
369
- $css .= 'color-stop(' . $stop['position'] . '%, ' . $stop['color'] . '), ';
370
- }
371
-
372
- $css = rtrim( $css );
373
- $css = rtrim( $css, ',' );
374
- $css .= ')';
375
-
376
- return $css;
377
- }
378
-
379
-
380
- /**
381
- * Return an instance of the model called
382
- *
383
- * @param string $class The name of class that I want the instance
384
- *
385
- * @since 2.0.0
386
- * @author Simone D'Amico <simone.damico@yithemes.com>
387
- * @return mixed
388
- */
389
- public function getModel( $class ) {
390
- return YIT_Registry::get_instance()->$class;
391
- }
392
-
393
-
394
- /**
395
- * Return a color darker then $color.
396
- *
397
- * @param string $color
398
- * @param int $factor
399
- *
400
- * @return string
401
- * @since 1.0
402
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
403
- */
404
- public function hex_darker( $color, $factor = 30 ) {
405
- $color = str_replace( '#', '', $color );
406
-
407
- $base['R'] = hexdec( substr( $color, 0, 2 ) );
408
- $base['G'] = hexdec( substr( $color, 2, 2 ) );
409
- $base['B'] = hexdec( substr( $color, 4, 2 ) );
410
-
411
- $color = '#';
412
-
413
- foreach ( $base as $k => $v ) {
414
- $amount = $v / 100;
415
- $amount = round( $amount * $factor );
416
- $new_decimal = $v - $amount;
417
-
418
- $new_hex_component = dechex( $new_decimal );
419
-
420
- if ( strlen( $new_hex_component ) < 2 ) {
421
- $new_hex_component = "0" . $new_hex_component;
422
- }
423
-
424
- $color .= $new_hex_component;
425
- }
426
-
427
- return $color;
428
- }
429
-
430
- /**
431
- * Return a color lighter then $color.
432
- *
433
- * @param string $color
434
- * @param int $factor
435
- *
436
- * @return string
437
- * @since 1.0
438
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
439
- */
440
- public function hex_lighter( $color, $factor = 30 ) {
441
- $color = str_replace( '#', '', $color );
442
-
443
- $base['R'] = hexdec( $color{0} . $color{1} );
444
- $base['G'] = hexdec( $color{2} . $color{3} );
445
- $base['B'] = hexdec( $color{4} . $color{5} );
446
-
447
- $color = '#';
448
-
449
- foreach ( $base as $k => $v ) {
450
- $amount = 255 - $v;
451
- $amount = $amount / 100;
452
- $amount = round( $amount * $factor );
453
- $new_decimal = $v + $amount;
454
-
455
- $new_hex_component = dechex( $new_decimal );
456
-
457
- if ( strlen( $new_hex_component ) < 2 ) {
458
- $new_hex_component = "0" . $new_hex_component;
459
- }
460
-
461
- $color .= $new_hex_component;
462
- }
463
-
464
- return $color;
465
- }
466
-
467
- /**
468
- * Detect if we must use a color darker or lighter then the background.
469
- *
470
- * @param string $color
471
- * @param string $dark
472
- * @param string $light
473
- *
474
- * @return string
475
- * @since 1.0
476
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
477
- */
478
- public function light_or_dark( $color, $dark = '#000000', $light = '#FFFFFF' ) {
479
- $hex = str_replace( '#', '', $color );
480
-
481
- $c_r = hexdec( substr( $hex, 0, 2 ) );
482
- $c_g = hexdec( substr( $hex, 2, 2 ) );
483
- $c_b = hexdec( substr( $hex, 4, 2 ) );
484
- $brightness = ( ( $c_r * 299 ) + ( $c_g * 587 ) + ( $c_b * 114 ) ) / 1000;
485
-
486
- return ( $brightness > 155 ) ? $dark : $light;
487
- }
488
-
489
- /**
490
- * Detect if we must use a color darker or lighter then the background.
491
- *
492
- * @param $hex
493
- *
494
- * @internal param string $color
495
- * @return string
496
- * @since 1.0
497
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
498
- */
499
- public function hex2rgb( $hex ) {
500
- $hex = str_replace( "#", "", $hex );
501
-
502
- if ( strlen( $hex ) == 3 ) {
503
- $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) );
504
- $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) );
505
- $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) );
506
- }
507
- else {
508
- $r = hexdec( substr( $hex, 0, 2 ) );
509
- $g = hexdec( substr( $hex, 2, 2 ) );
510
- $b = hexdec( substr( $hex, 4, 2 ) );
511
- }
512
- $rgb = array( $r, $g, $b );
513
- //return implode(",", $rgb); // returns the rgb values separated by commas
514
- return $rgb; // returns an array with the rgb values
515
- }
516
-
517
- /**
518
- * Magic method for this class
519
- *
520
- * @param $name string The name of magic property
521
- *
522
- * @since 2.0.0
523
- * @author Simone D'Amico <simone.damico@yithemes.com>
524
- * @return mixed
525
- */
526
- public function __get( $name ) {
527
- if ( $name == 'request' ) {
528
- if ( ! $this->_request instanceof YIT_Request ) {
529
- $this->_request = YIT_Registry::get_instance()->request;
530
- }
531
-
532
- return $this->_request;
533
- }
534
- }
535
- }
536
  }
1
+ <?php
2
+ /**
3
+ * Your Inspiration Themes
4
+ *
5
+ * In this files there is a collection of a functions useful for the core
6
+ * of the framework.
7
+ *
8
+ * @package WordPress
9
+ * @subpackage Your Inspiration Themes
10
+ * @author Your Inspiration Themes Team <info@yithemes.com>
11
+ *
12
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
13
+ * that is bundled with this package in the file LICENSE.txt.
14
+ * It is also available through the world-wide-web at this URL:
15
+ * http://www.gnu.org/licenses/gpl-3.0.txt
16
+ */
17
+
18
+ /**
19
+ * Handles colors
20
+ *
21
+ * @since 1.0
22
+ */
23
+ /**
24
+ * Generates CSS 3 gradients for all browsers.
25
+ *
26
+ * @since 1.0
27
+ */
28
+
29
+ if ( ! class_exists( 'YIT_Gradients' ) ) {
30
+
31
+ class YIT_Gradients {
32
+
33
+ /**
34
+ * An array of colors to use for a gradient.
35
+ *
36
+ * @var array
37
+ * @since 1.0
38
+ */
39
+ public $colors_gradient = array();
40
+
41
+ /**
42
+ * Set properties
43
+ *
44
+ * @param string $key
45
+ * @param $value
46
+ *
47
+ * @internal param array $colors_gradient
48
+ * @return void
49
+ * @since 1.0
50
+ */
51
+ public function set( $key, $value ) {
52
+ if ( property_exists( $this, $key ) ) {
53
+ $this->{$key} = $value;
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Get properties
59
+ *
60
+ * @param string $key
61
+ *
62
+ * @return mixed
63
+ * @since 1.0
64
+ */
65
+ public function get( $key ) {
66
+ if ( property_exists( $this, $key ) ) {
67
+ return $this->{$key};
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Add a color to use in a gradient.
73
+ *
74
+ * @param string $color
75
+ * @param int $position
76
+ *
77
+ * @return void
78
+ * @since 1.0
79
+ */
80
+ public function add_color_gradient( $color, $position ) {
81
+ $the_color['color'] = $color;
82
+ $the_color['position'] = $position;
83
+
84
+ array_push( $this->colors_gradient, $the_color );
85
+ }
86
+
87
+ /**
88
+ * Generate the CSS code for a gradient.
89
+ *
90
+ * @param string $role
91
+ * @param string $direction
92
+ *
93
+ * @return string|bool
94
+ * @since 1.0
95
+ */
96
+ public function gradient( $role, $direction ) {
97
+ if ( ! empty( $this->colors_gradient ) ) {
98
+
99
+ $css = array(
100
+ 'old' => $this->_make_old_gradient( $this->colors_gradient[0]['color'] ), //old browser
101
+ 'ff3' => $this->_make_modern_gradient( $this->colors_gradient, $direction, 'moz' ), //firefox 3.6+
102
+ 'chr_saf4' => $this->_make_chr_saf4_gradient( $this->colors_gradient, $direction ), //chrome and safari4+
103
+ 'chr10_saf5' => $this->_make_modern_gradient( $this->colors_gradient, $direction, 'webkit' ), //chrome10+ and safari5+
104
+ 'opera' => $this->_make_modern_gradient( $this->colors_gradient, $direction, 'o' ), //opera11.10+
105
+ 'ie10' => $this->_make_modern_gradient( $this->colors_gradient, $direction, 'ms' ), //internet explorer 10+
106
+ 'w3c' => $this->_make_modern_gradient( $this->colors_gradient, $direction, 'w3c' ), //w3c
107
+ 'ie6_9' => $this->_make_ie6_gradient( $this->colors_gradient, $direction ) //ie6-9
108
+ );
109
+
110
+ $css = $role . '{' . implode( ';', $css ) . '}';
111
+
112
+ $this->colors_gradient = array();
113
+
114
+ return $css;
115
+ }
116
+ }
117
+
118
+ /**
119
+ * Reverse a gradient. This method should be used only before calling ::make_gradient(). Otherwise it will not works.
120
+ *
121
+ * @return void
122
+ * @since 1.0
123
+ */
124
+ public function reverse_gradient() {
125
+ $colors_gradient = array_reverse( $this->get( 'colors_gradient' ) );
126
+
127
+ for ( $i = 0; $i < count( $colors_gradient ); $i ++ ) {
128
+ $colors_gradient[$i]['position'] = 100 - $colors_gradient[$i]['position'];
129
+ }
130
+
131
+ $this->set( 'colors_gradient', $colors_gradient );
132
+ }
133
+
134
+ /**
135
+ * Generate the CSS code for a gradient.
136
+ *
137
+ * @param string $role
138
+ * @param string $direction
139
+ *
140
+ * @return string|bool
141
+ * @since 1.0
142
+ */
143
+ public function get_gradient( $role, $direction ) {
144
+ return $this->gradient( $role, $direction );
145
+ }
146
+
147
+ /**
148
+ * Generate the CSS code for a gradient.
149
+ *
150
+ * @param string $role
151
+ * @param string $direction
152
+ *
153
+ * @return void
154
+ * @since 1.0
155
+ */
156
+ public function the_gradient( $role, $direction ) {
157
+ echo $this->get_gradient( $role, $direction );
158
+ }
159
+
160
+ /**
161
+ * Generate the CSS code for a gradient.
162
+ *
163
+ * @param string $role
164
+ * @param string $from
165
+ * @param string $to
166
+ * @param string $direction
167
+ *
168
+ * @return string|bool
169
+ * @since 1.0
170
+ */
171
+ public function gradient_from_to( $role, $from, $to, $direction ) {
172
+
173
+ $colors = array(
174
+ array(
175
+ 'color' => $from,
176
+ 'position' => 0
177
+ ),
178
+ array(
179
+ 'color' => $to,
180
+ 'position' => 100
181
+ ),
182
+ );
183
+
184
+ $this->set( 'colors_gradient', $colors );
185
+ return $this->get_gradient( $role, $direction );
186
+ }
187
+
188
+ /**
189
+ * Generate the CSS code for a gradient.
190
+ *
191
+ * @param string $role
192
+ * @param string $color
193
+ * @param string $direction
194
+ * @param int|string $factor
195
+ *
196
+ * @return string|bool
197
+ * @since 1.0
198
+ */
199
+ public function gradient_darker( $role, $color, $direction, $factor = 30 ) {
200
+
201
+ $colors = array(
202
+ array(
203
+ 'color' => $color,
204
+ 'position' => 0
205
+ ),
206
+ array(
207
+ 'color' => $this->hex_darker( $color, $factor ),
208
+ 'position' => 100
209
+ ),
210
+ );
211
+
212
+ $this->set( 'colors_gradient', $colors );
213
+ return $this->get_gradient( $role, $direction );
214
+ }
215
+
216
+ /**
217
+ * Generate the CSS code for a gradient.
218
+ *
219
+ * @param string $role
220
+ * @param string $color
221
+ * @param string $direction
222
+ * @param int|string $factor
223
+ *
224
+ * @return string|bool
225
+ * @since 1.0
226
+ */
227
+ public function gradient_lighter( $role, $color, $direction, $factor = 30 ) {
228
+
229
+ $colors = array(
230
+ array(
231
+ 'color' => $color,
232
+ 'position' => 0
233
+ ),
234
+ array(
235
+ 'color' => $this->hex_lighter( $color, $factor ),
236
+ 'position' => 100
237
+ ),
238
+ );
239
+
240
+ $this->set( 'colors_gradient', $colors );
241
+ return $this->get_gradient( $role, $direction );
242
+ }
243
+
244
+ /**
245
+ * Generate the CSS code for a gradient that not supports gradients (add only a background color).
246
+ *
247
+ * @param $color
248
+ *
249
+ * @internal param string $role
250
+ * @return string|bool
251
+ * @access private
252
+ * @since 1.0
253
+ */
254
+ private function _make_old_gradient( $color ) {
255
+ return 'background:' . $color;
256
+ }
257
+
258
+ /**
259
+ * Generate the CSS code for a gradient in IE6-9.
260
+ *
261
+ * @param $colors
262
+ * @param $direction
263
+ *
264
+ * @internal param string $role
265
+ * @return string|bool
266
+ * @access private
267
+ * @since 1.0
268
+ */
269
+ private function _make_ie6_gradient( $colors, $direction ) {
270
+ $css = 'filter:progid:DXImageTransform.Microsoft.gradient(';
271
+ $css .= 'startColorstr=\'' . $colors[0]['color'] . '\',';
272
+ $css .= 'endColorstr=\'' . $colors[count( $colors ) - 1]['color'] . '\',';
273
+
274
+ if ( $direction == 'horizontal' ) {
275
+ $css .= 'GradientType=1';
276
+ }
277
+ else {
278
+ $css .= 'GradientType=0';
279
+ } //vertical
280
+
281
+ $css .= ')';
282
+
283
+ return $css;
284
+ }
285
+
286
+ /**
287
+ * Make the CSS 3 for a gradient in modern browsers( FF3.6+, Chrome, Safari5+, Opera11.10+, IE10+ )
288
+ *
289
+ * @param array $colors
290
+ * @param string $direction
291
+ * @param $browser
292
+ *
293
+ * @return string
294
+ * @access private
295
+ * @since 1.0
296
+ */
297
+ private function _make_modern_gradient( $colors, $direction, $browser ) {
298
+ $css = 'background:';
299
+
300
+ //Add the browser suffix
301
+ if ( $browser != 'w3c' ) {
302
+ $browser = '-' . $browser . '-';
303
+ }
304
+ else {
305
+ $browser = '';
306
+ }
307
+
308
+ switch ( $direction ) {
309
+ case 'vertical' :
310
+ $css .= $browser . 'linear-gradient(top,';
311
+ break;
312
+ case 'horizontal' :
313
+ $css .= $browser . 'linear-gradient(left,';
314
+ break;
315
+ case 'diagonal-bottom':
316
+ $css .= $browser . 'linear-gradient(-45deg,';
317
+ break;
318
+ case 'diagonal-top' :
319
+ $css .= $browser . 'linear-gradient(45deg,';
320
+ break;
321
+ case 'radial' :
322
+ $css .= $browser . 'radial-gradient(center, ellipse cover,';
323
+ break;
324
+ }
325
+
326
+ foreach ( $colors as $stop ) {
327
+ $css .= $stop['color'] . ' ' . $stop['position'] . '%, ';
328
+ }
329
+
330
+ $css = rtrim( $css );
331
+ $css = rtrim( $css, ',' );
332
+ $css .= ')';
333
+
334
+ return $css;
335
+ }
336
+
337
+ /**
338
+ * Make the CSS 3 for a gradient in Chrome and Safari 4+
339
+ *
340
+ * @param array $colors
341
+ * @param string $direction
342
+ *
343
+ * @return string
344
+ * @access private
345
+ * @since 1.0
346
+ */
347
+ private function _make_chr_saf4_gradient( $colors, $direction ) {
348
+ $css = 'background:';
349
+
350
+ switch ( $direction ) {
351
+ case 'vertical' :
352
+ $css .= '-webkit-gradient(linear,left top,left bottom,';
353
+ break;
354
+ case 'horizontal' :
355
+ $css .= '-webkit-gradient(linear,left top,right top,';
356
+ break;
357
+ case 'diagonal-bottom':
358
+ $css .= '-webkit-gradient(linear,left top,right bottom,';
359
+ break;
360
+ case 'diagonal-top' :
361
+ $css .= '-webkit-gradient(linear,left bottom,right top,';
362
+ break;
363
+ case 'radial' :
364
+ $css .= '-webkit-gradient(radial,center center, 0px, center center, 100%,';
365
+ break;
366
+ }
367
+
368
+ foreach ( $colors as $stop ) {
369
+ $css .= 'color-stop(' . $stop['position'] . '%, ' . $stop['color'] . '), ';
370
+ }
371
+
372
+ $css = rtrim( $css );
373
+ $css = rtrim( $css, ',' );
374
+ $css .= ')';
375
+
376
+ return $css;
377
+ }
378
+
379
+
380
+ /**
381
+ * Return an instance of the model called
382
+ *
383
+ * @param string $class The name of class that I want the instance
384
+ *
385
+ * @since 2.0.0
386
+ * @author Simone D'Amico <simone.damico@yithemes.com>
387
+ * @return mixed
388
+ */
389
+ public function getModel( $class ) {
390
+ return YIT_Registry::get_instance()->$class;
391
+ }
392
+
393
+
394
+ /**
395
+ * Return a color darker then $color.
396
+ *
397
+ * @param string $color
398
+ * @param int $factor
399
+ *
400
+ * @return string
401
+ * @since 1.0
402
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
403
+ */
404
+ public function hex_darker( $color, $factor = 30 ) {
405
+ $color = str_replace( '#', '', $color );
406
+
407
+ $base['R'] = hexdec( substr( $color, 0, 2 ) );
408
+ $base['G'] = hexdec( substr( $color, 2, 2 ) );
409
+ $base['B'] = hexdec( substr( $color, 4, 2 ) );
410
+
411
+ $color = '#';
412
+
413
+ foreach ( $base as $k => $v ) {
414
+ $amount = $v / 100;
415
+ $amount = round( $amount * $factor );
416
+ $new_decimal = $v - $amount;
417
+
418
+ $new_hex_component = dechex( $new_decimal );
419
+
420
+ if ( strlen( $new_hex_component ) < 2 ) {
421
+ $new_hex_component = "0" . $new_hex_component;
422
+ }
423
+
424
+ $color .= $new_hex_component;
425
+ }
426
+
427
+ return $color;
428
+ }
429
+
430
+ /**
431
+ * Return a color lighter then $color.
432
+ *
433
+ * @param string $color
434
+ * @param int $factor
435
+ *
436
+ * @return string
437
+ * @since 1.0
438
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
439
+ */
440
+ public function hex_lighter( $color, $factor = 30 ) {
441
+ $color = str_replace( '#', '', $color );
442
+
443
+ $base['R'] = hexdec( $color{0} . $color{1} );
444
+ $base['G'] = hexdec( $color{2} . $color{3} );
445
+ $base['B'] = hexdec( $color{4} . $color{5} );
446
+
447
+ $color = '#';
448
+
449
+ foreach ( $base as $k => $v ) {
450
+ $amount = 255 - $v;
451
+ $amount = $amount / 100;
452
+ $amount = round( $amount * $factor );
453
+ $new_decimal = $v + $amount;
454
+
455
+ $new_hex_component = dechex( $new_decimal );
456
+
457
+ if ( strlen( $new_hex_component ) < 2 ) {
458
+ $new_hex_component = "0" . $new_hex_component;
459
+ }
460
+
461
+ $color .= $new_hex_component;
462
+ }
463
+
464
+ return $color;
465
+ }
466
+
467
+ /**
468
+ * Detect if we must use a color darker or lighter then the background.
469
+ *
470
+ * @param string $color
471
+ * @param string $dark
472
+ * @param string $light
473
+ *
474
+ * @return string
475
+ * @since 1.0
476
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
477
+ */
478
+ public function light_or_dark( $color, $dark = '#000000', $light = '#FFFFFF' ) {
479
+ $hex = str_replace( '#', '', $color );
480
+
481
+ $c_r = hexdec( substr( $hex, 0, 2 ) );
482
+ $c_g = hexdec( substr( $hex, 2, 2 ) );
483
+ $c_b = hexdec( substr( $hex, 4, 2 ) );
484
+ $brightness = ( ( $c_r * 299 ) + ( $c_g * 587 ) + ( $c_b * 114 ) ) / 1000;
485
+
486
+ return ( $brightness > 155 ) ? $dark : $light;
487
+ }
488
+
489
+ /**
490
+ * Detect if we must use a color darker or lighter then the background.
491
+ *
492
+ * @param $hex
493
+ *
494
+ * @internal param string $color
495
+ * @return string
496
+ * @since 1.0
497
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
498
+ */
499
+ public function hex2rgb( $hex ) {
500
+ $hex = str_replace( "#", "", $hex );
501
+
502
+ if ( strlen( $hex ) == 3 ) {
503
+ $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) );
504
+ $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) );
505
+ $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) );
506
+ }
507
+ else {
508
+ $r = hexdec( substr( $hex, 0, 2 ) );
509
+ $g = hexdec( substr( $hex, 2, 2 ) );
510
+ $b = hexdec( substr( $hex, 4, 2 ) );
511
+ }
512
+ $rgb = array( $r, $g, $b );
513
+ //return implode(",", $rgb); // returns the rgb values separated by commas
514
+ return $rgb; // returns an array with the rgb values
515
+ }
516
+
517
+ /**
518
+ * Magic method for this class
519
+ *
520
+ * @param $name string The name of magic property
521
+ *
522
+ * @since 2.0.0
523
+ * @author Simone D'Amico <simone.damico@yithemes.com>
524
+ * @return mixed
525
+ */
526
+ public function __get( $name ) {
527
+ if ( $name == 'request' ) {
528
+ if ( ! $this->_request instanceof YIT_Request ) {
529
+ $this->_request = YIT_Registry::get_instance()->request;
530
+ }
531
+
532
+ return $this->_request;
533
+ }
534
+ }
535
+ }
536
  }
plugin-fw/lib/yit-plugin-panel-sidebar.php ADDED
@@ -0,0 +1,427 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( !class_exists( 'YIT_Plugin_Panel_Sidebar' ) ) {
16
+ /**
17
+ * YIT Plugin Panel Sidebar
18
+ *
19
+ * @class YIT_Plugin_Panel_Sidebar
20
+ * @package Yithemes
21
+ * @since 1.0
22
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
23
+ */
24
+ class YIT_Plugin_Panel_Sidebar {
25
+ /**
26
+ * @var string version of class
27
+ */
28
+ public $version = '1.0.1';
29
+
30
+
31
+ /**
32
+ * @var array array of widgets
33
+ */
34
+ public $widgets = array();
35
+
36
+ /**
37
+ * @type string
38
+ */
39
+ protected $_remote_widget_xml = 'http://bit.ly/1UJ83xN';
40
+
41
+ /**
42
+ * default priority for Remote Widgets
43
+ *
44
+ * @type int
45
+ */
46
+ public $default_remote_widget_priority = 40;
47
+
48
+ /**
49
+ * parent panel
50
+ *
51
+ * @var YIT_Plugin_Panel
52
+ */
53
+ public $panel;
54
+
55
+ private $_is_collapsed;
56
+
57
+ /**
58
+ * @type string
59
+ */
60
+ public static $transient_remote_widgets = 'yit_panel_sidebar_remote_widgets';
61
+
62
+ /**
63
+ * @type string
64
+ */
65
+ public static $transient_updated_remote_widgets = 'yit_panel_sidebar_remote_widgets_update';
66
+
67
+ /**
68
+ * @type string
69
+ */
70
+ public static $collapse_option = 'yith_plugin_panel_sidebar_collapse';
71
+
72
+ /**
73
+ * Constructor
74
+ *
75
+ * @param YIT_Plugin_Panel $panel the parent panel
76
+ *
77
+ * @since 1.0
78
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
79
+ */
80
+ private function __construct( $panel ) {
81
+ $this->panel = $panel;
82
+
83
+ /* load and sort default widgets and remote widgets */
84
+ $this->load_widgets();
85
+
86
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
87
+ add_filter( 'yit_admin_panel_content_class', array( $this, 'filter_admin_panel_content_class' ) );
88
+ }
89
+
90
+ /**
91
+ * get instance
92
+ *
93
+ * @static
94
+ * @return YIT_Plugin_Panel_Sidebar
95
+ *
96
+ * @since 1.0
97
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
98
+ */
99
+ public static function instance( $panel ) {
100
+ return new self( $panel );
101
+ }
102
+
103
+ /**
104
+ * return true if is collapsed by option
105
+ *
106
+ * @return bool
107
+ */
108
+ public function is_collapsed() {
109
+ if ( !isset( $this->_is_collapsed ) ) {
110
+ $this->_is_collapsed = get_option( self::$collapse_option, 'no' ) === 'yes';
111
+ }
112
+
113
+ return $this->_is_collapsed;
114
+ }
115
+
116
+ /**
117
+ * if is collapsed add a class to panel wrapper
118
+ *
119
+ * @param $class
120
+ *
121
+ * @return string
122
+ */
123
+ public function filter_admin_panel_content_class( $class ) {
124
+ if ( $this->is_collapsed() ) {
125
+ $class .= ' yit-admin-panel-content-wrap-full';
126
+ }
127
+
128
+ return $class;
129
+ }
130
+
131
+ /**
132
+ * Add one or more widgets to $this->widgets
133
+ *
134
+ * @param array $widgets
135
+ */
136
+ public function add_widgets( $widgets ) {
137
+ $this->widgets = array_merge( $this->widgets, $widgets );
138
+ }
139
+
140
+ /**
141
+ * delete transients
142
+ */
143
+ public static function delete_transients() {
144
+ delete_transient( self::$transient_remote_widgets );
145
+ delete_transient( self::$transient_updated_remote_widgets );
146
+ }
147
+
148
+ /**
149
+ * filter and sort widgets
150
+ */
151
+ private function _filter_and_sort_widgets() {
152
+ /* filter widgets */
153
+ $page_name = isset( $this->panel->settings[ 'page' ] ) ? $this->panel->settings[ 'page' ] : '';
154
+ $this->widgets = apply_filters( 'yit_plugin_panel_sidebar_widgets', $this->widgets, $page_name );
155
+
156
+ /*sort widgets*/
157
+ uasort( $this->widgets, array( $this, 'sort_widgets' ) );
158
+ }
159
+
160
+ /**
161
+ * get Remote Widget by XML from YIThemes
162
+ *
163
+ * @return array
164
+ *
165
+ * @since 1.0
166
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
167
+ */
168
+ public function get_remote_widgets() {
169
+ $remote_widgets = get_transient( self::$transient_remote_widgets );
170
+ $updated = get_transient( self::$transient_updated_remote_widgets );
171
+ $is_debug = defined( 'YIT_FW_REMOTE_WIDGETS_DEBUG' ) && YIT_FW_REMOTE_WIDGETS_DEBUG;
172
+
173
+ if ( $is_debug || $updated === false || $remote_widgets === false ) {
174
+ $remote_widgets = array();
175
+ } else {
176
+ return $remote_widgets;
177
+ }
178
+
179
+ $expiration = 1 * DAY_IN_SECONDS;
180
+ $updated_expiration = DAY_IN_SECONDS; // update frequency
181
+
182
+ $remote_xml = wp_remote_get( $this->_remote_widget_xml );
183
+ if ( !is_wp_error( $remote_xml ) && isset( $remote_xml[ 'response' ][ 'code' ] ) && '200' == $remote_xml[ 'response' ][ 'code' ] && class_exists( 'SimpleXmlElement' ) ) {
184
+ try {
185
+ // suppress all XML errors when loading the document
186
+ libxml_use_internal_errors( true );
187
+
188
+ $xml_data = new SimpleXmlElement( $remote_xml[ 'body' ] );
189
+ $xml_remote_widgets = isset( $xml_data->widget ) ? $xml_data->widget : array();
190
+
191
+ $enabled_args = array(
192
+ 'title',
193
+ 'icon',
194
+ 'content',
195
+ 'class',
196
+ 'title_class',
197
+ 'badge',
198
+ 'badge_text',
199
+ 'image',
200
+ 'image_class',
201
+ 'priority',
202
+ 'starting',
203
+ 'expiration',
204
+ );
205
+
206
+ $last_remote_priority = $this->default_remote_widget_priority;
207
+
208
+ foreach ( $xml_remote_widgets as $xml_widget ) {
209
+ if ( !isset( $xml_widget->id ) )
210
+ continue;
211
+
212
+ $widget_id = (string)$xml_widget->id;
213
+ $widget_array = array();
214
+ foreach ( $enabled_args as $key ) {
215
+ if ( isset( $xml_widget->$key ) ) {
216
+ $widget_array[ $key ] = (string)$xml_widget->$key;
217
+ } else {
218
+ if ( $key == 'priority' ) {
219
+ $widget_array[ $key ] = $last_remote_priority;
220
+ $last_remote_priority += 10;
221
+ }
222
+ }
223
+ }
224
+ $remote_widgets[ $widget_id ] = $widget_array;
225
+ }
226
+
227
+ $xml_expiration = isset( $xml_data->expiration ) ? (string)$xml_data->expiration : '';
228
+ if ( !empty( $xml_expiration ) ) {
229
+ $expiration = strtotime( $xml_expiration ) - strtotime( 'now' );
230
+ // if the XML is expired removes widgets
231
+ if ( $expiration < 1 )
232
+ $remote_widgets = array();
233
+
234
+ $is_urgent = isset( $xml_data->urgent ) ? !!$xml_data->urgent : false;
235
+ $is_urgent = true;
236
+ if ( !$is_urgent ) {
237
+ $four_days_random = mt_rand( 0, 4 * DAY_IN_SECONDS );
238
+ $expiration += $four_days_random;
239
+ } else {
240
+ /**
241
+ * - - - - - U R G E N T - - - - -
242
+ * it will be updated the exact day, BUT in different time! :)
243
+ * [to prevent too many request at the same time]
244
+ */
245
+ $one_day_random = mt_rand( 0, DAY_IN_SECONDS );
246
+ $expiration += $one_day_random;
247
+ }
248
+ }
249
+
250
+ $four_days_random = mt_rand( 0, 4 * DAY_IN_SECONDS );
251
+
252
+ /* to prevent multiple request if it's expired */
253
+ if ( $expiration < 1 ) {
254
+ $expiration = 1 * DAY_IN_SECONDS + $four_days_random;
255
+ }
256
+ }
257
+ catch ( Exception $e ) {
258
+
259
+ }
260
+
261
+ //$updated_expiration = 30 * DAY_IN_SECONDS + $four_days_random;
262
+ }
263
+
264
+ set_transient( self::$transient_remote_widgets, $remote_widgets, $expiration );
265
+ set_transient( self::$transient_updated_remote_widgets, true, $updated_expiration );
266
+
267
+ return $remote_widgets;
268
+ }
269
+
270
+ /**
271
+ * load and sort default widgets and remote widgets
272
+ *
273
+ * @since 1.0
274
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
275
+ */
276
+ public function load_widgets() {
277
+ /* get static widgets */
278
+ $this->widgets = include( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/sidebar/widgets/widgets.php' );
279
+
280
+ /* get remote widgets */
281
+ $remote_widgets = $this->get_remote_widgets();
282
+ $this->add_widgets( $remote_widgets );
283
+ }
284
+
285
+ /**
286
+ * Print the panel sidebar
287
+ *
288
+ * @return void
289
+ *
290
+ * @since 1.0
291
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
292
+ */
293
+ public function print_panel_sidebar() {
294
+ do_action( 'yit_panel_before_sidebar' );
295
+
296
+ include( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/sidebar/sidebar.php' );
297
+
298
+ do_action( 'yit_panel_after_sidebar' );
299
+ }
300
+
301
+ /**
302
+ * Print the panel sidebar widgets
303
+ *
304
+ * @return void
305
+ *
306
+ * @since 1.0
307
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
308
+ */
309
+ public function print_panel_sidebar_widgets() {
310
+ $basename = YIT_CORE_PLUGIN_PATH;
311
+ $path = '/panel/sidebar/widget.php';
312
+
313
+ $default_args = array(
314
+ 'id' => '',
315
+ 'title' => '',
316
+ 'icon' => '',
317
+ 'content' => '',
318
+ 'class' => '',
319
+ 'title_class' => '',
320
+ 'template' => '',
321
+ 'badge' => '',
322
+ 'badge_text' => '',
323
+ 'image' => '',
324
+ 'image_class' => '',
325
+ 'args' => array(),
326
+ 'hide_if_empty_args' => '',
327
+ 'priority' => 10,
328
+ 'starting' => '',
329
+ 'expiration' => '',
330
+ );
331
+
332
+ $this->_filter_and_sort_widgets();
333
+
334
+ foreach ( $this->widgets as $widget_id => $widget ) {
335
+ $args = array_merge( $widget, array( 'id' => $widget_id ) );
336
+ $args = wp_parse_args( $args, $default_args );
337
+
338
+ $is_started = empty( $args[ 'starting' ] ) || strtotime( $args[ 'starting' ] . ' midnight' ) <= strtotime( 'midnight' );
339
+ $is_expired = !empty( $args[ 'expiration' ] ) && strtotime( $args[ 'expiration' ] . ' midnight' ) < strtotime( 'midnight' );
340
+
341
+ if ( $is_expired || !$is_started )
342
+ continue;
343
+
344
+ if ( !empty( $args[ 'hide_if_empty_args' ] ) ) {
345
+ $hide_if_empty_args = $args[ 'hide_if_empty_args' ];
346
+ $continue = false;
347
+ foreach ( $hide_if_empty_args as $hide_if_empty_arg ) {
348
+ if ( empty( $args[ 'args' ][ $hide_if_empty_arg ] ) ) {
349
+ $continue = true;
350
+ break;
351
+ }
352
+ }
353
+ if ( $continue )
354
+ continue;
355
+ }
356
+
357
+ do_action( 'yit_panel_sidebar_before_widget', $widget_id, $widget );
358
+
359
+ yit_plugin_get_template( $basename, $path, $args );
360
+
361
+ do_action( 'yit_panel_sidebar_after_widget', $widget_id, $widget );
362
+ }
363
+ }
364
+
365
+ /**
366
+ * set transient for first activation
367
+ * to prevent too many calls to YIThemes
368
+ */
369
+ public static function set_transient_for_first_activation() {
370
+ $remote_widgets = get_transient( self::$transient_remote_widgets );
371
+ $updated = get_transient( self::$transient_updated_remote_widgets );
372
+
373
+ $first_activation = $updated === false && $remote_widgets === false;
374
+ if ( $first_activation ) {
375
+ $seven_days_random = mt_rand( 0, 7 * DAY_IN_SECONDS );
376
+ $expiration = 1 * DAY_IN_SECONDS + $seven_days_random;
377
+
378
+ set_transient( self::$transient_remote_widgets, array(), $expiration );
379
+ set_transient( self::$transient_updated_remote_widgets, true, $expiration );
380
+ }
381
+ }
382
+
383
+ /**
384
+ * Sort widgets by priority
385
+ *
386
+ * @param $a
387
+ * @param $b
388
+ *
389
+ * @return bool
390
+ *
391
+ * @since 1.0
392
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
393
+ */
394
+ public function sort_widgets( $a, $b ) {
395
+ $priority_a = isset( $a[ 'priority' ] ) ? intval( $a[ 'priority' ] ) : $this->default_remote_widget_priority;
396
+ $priority_b = isset( $b[ 'priority' ] ) ? intval( $b[ 'priority' ] ) : $this->default_remote_widget_priority;
397
+ if ( $priority_a == $priority_b ) {
398
+ return 0;
399
+ } elseif ( $priority_a > $priority_b ) {
400
+ return 1;
401
+ } else {
402
+ return -1;
403
+ }
404
+ }
405
+
406
+ /**
407
+ * Add Admin WC Style and Scripts
408
+ *
409
+ * @return void
410
+ *
411
+ * @since 1.0
412
+ * @author Leanza Francesco <leanzafrancesco@gmail.com
413
+ */
414
+ public function admin_enqueue_scripts() {
415
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
416
+
417
+ wp_enqueue_style( 'opensans-font', '//fonts.googleapis.com/css?family=Open+Sans:400,500,600,700,800,100,200,300,900' );
418
+ wp_enqueue_style( 'yit-plugin-sidebar-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel-sidebar.css', $this->version );
419
+ wp_enqueue_script( 'yit-plugin-sidebar-js', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel-sidebar' . $min . '.js', array( 'jquery' ), $this->version, true );
420
+ wp_localize_script( 'yit-plugin-sidebar-js', 'sidebar_labels', array(
421
+ 'hide_sidebar' => __( 'Hide sidebar', 'yith-plugin-fw' ),
422
+ 'show_sidebar' => __( 'Show sidebar', 'yith-plugin-fw' ),
423
+ 'wrapper_class' => 'yit-admin-panel-content-wrap',
424
+ ) );
425
+ }
426
+ }
427
+ }
plugin-fw/lib/yit-plugin-panel-wc.php CHANGED
@@ -1,423 +1,466 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
16
- /**
17
- * YIT Plugin Panel for WooCommerce
18
- *
19
- * Setting Page to Manage Plugins
20
- *
21
- * @class YIT_Plugin_Panel
22
- * @package Yithemes
23
- * @since 1.0
24
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
26
- */
27
-
28
- class YIT_Plugin_Panel_WooCommerce extends YIT_Plugin_Panel {
29
-
30
- /**
31
- * @var string version of class
32
- */
33
- public $version = '1.0.0';
34
-
35
- /**
36
- * @var array a setting list of parameters
37
- */
38
- public $settings = array();
39
-
40
- /**
41
- * @var array a setting list of parameters
42
- */
43
- public $wc_type = array();
44
-
45
- /**
46
- * @var array
47
- */
48
- protected $_tabs_path_files;
49
-
50
- /**
51
- * Constructor
52
- *
53
- * @since 1.0
54
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
55
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
56
- */
57
- public function __construct( $args = array() ) {
58
-
59
- $this->wc_type = array(
60
- 'checkbox',
61
- 'textarea',
62
- 'multiselect',
63
- 'multi_select_countries',
64
- 'image_width'
65
- );
66
-
67
- if ( ! empty( $args ) ) {
68
- $this->settings = $args;
69
- $this->_tabs_path_files = $this->get_tabs_path_files();
70
-
71
- if( isset( $this->settings['create_menu_page'] ) && $this->settings[ 'create_menu_page'] ){
72
- $this->add_menu_page();
73
- }
74
- add_action( 'admin_init', array( $this, 'set_default_options') );
75
- add_action( 'admin_menu', array( $this, 'add_setting_page' ) );
76
- add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 100 );
77
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
78
- add_action( 'admin_init', array( $this, 'woocommerce_update_options' ) );
79
- add_filter( 'woocommerce_screen_ids', array( $this, 'add_allowed_screen_id' ) );
80
- add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'maybe_unserialize_panel_data' ), 10, 3 );
81
-
82
- /* Add VideoBox and InfoBox */
83
- add_action( 'woocommerce_admin_field_boxinfo', array( $this, 'add_infobox' ), 10, 1 );
84
- add_action( 'woocommerce_admin_field_videobox', array( $this, 'add_videobox' ), 10, 1 );
85
-
86
- /* WooCommerce 2.4 Support */
87
- add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
88
- }
89
- }
90
-
91
-
92
- /**
93
- * Show a tabbed panel to setting page
94
- *
95
- * a callback function called by add_setting_page => add_submenu_page
96
- *
97
- * @return void
98
- * @since 1.0
99
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
100
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
101
- */
102
- public function yit_panel() {
103
- $additional_info = array(
104
- 'current_tab' => $this->get_current_tab(),
105
- 'available_tabs' => $this->settings['admin-tabs'],
106
- 'default_tab' => $this->get_available_tabs( true ), //get default tabs
107
- 'page' => $this->settings['page']
108
- );
109
-
110
- $additional_info = apply_filters( 'yith_admin_tab_params', $additional_info );
111
- $additional_info['additional_info'] = $additional_info;
112
-
113
- extract( $additional_info );
114
- require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-panel.php' );
115
- }
116
-
117
- /**
118
- * Show a input fields to upload images
119
- *
120
- *
121
- * @return void
122
- * @since 1.0
123
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
124
- */
125
-
126
- public function yit_upload_update( $option_value ) {
127
- return $option_value;
128
- }
129
-
130
- /**
131
- * Show a input fields to upload images
132
- *
133
- *
134
- * @return void
135
- * @since 1.0
136
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
137
- */
138
-
139
- public function yit_upload( $args = array() ) {
140
- if ( ! empty( $args ) ) {
141
- $args['value'] = ( get_option($args['id'])) ? get_option($args['id']) : $args['default'];
142
- extract( $args );
143
-
144
- include( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-upload.php' );
145
- }
146
- }
147
-
148
- /**
149
- * Add the plugin woocommerce page settings in the screen ids of woocommerce
150
- *
151
- * @param $screen_ids
152
- *
153
- * @return mixed
154
- * @since 1.0.0
155
- * @author Antonino Scarfì <antonino.scarfi@yithemes.com>
156
- */
157
- public function add_allowed_screen_id( $screen_ids ) {
158
- global $admin_page_hooks;
159
-
160
- if ( ! isset( $admin_page_hooks[ $this->settings['parent_page'] ] ) ) {
161
- return $screen_ids;
162
- }
163
-
164
- $screen_ids[] = $admin_page_hooks[ $this->settings['parent_page'] ] . '_page_' . $this->settings['page'];
165
-
166
- return $screen_ids;
167
- }
168
-
169
- /**
170
- * Returns current active tab slug
171
- *
172
- * @return string
173
- * @since 2.0.0
174
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
175
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
176
- */
177
- public function get_current_tab() {
178
- global $pagenow;
179
- $tabs = $this->get_available_tabs();
180
-
181
- if ( $pagenow == 'admin.php' && isset( $_REQUEST['tab'] ) && in_array( $_REQUEST['tab'], $tabs ) ) {
182
- return $_REQUEST['tab'];
183
- }
184
- else {
185
- return $tabs[0];
186
- }
187
- }
188
-
189
- /**
190
- * Return available tabs
191
- *
192
- * read all options and show sections and fields
193
- *
194
- * @param bool false for all tabs slug, true for current tab
195
- *
196
- * @return mixed Array tabs | String current tab
197
- * @since 1.0
198
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
199
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
200
- */
201
- public function get_available_tabs( $default = false ) {
202
- $tabs = array_keys( $this->settings['admin-tabs'] );
203
- return $default ? $tabs[0] : $tabs;
204
- }
205
-
206
-
207
- /**
208
- * Add sections and fields to setting panel
209
- *
210
- * read all options and show sections and fields
211
- *
212
- * @return void
213
- * @since 1.0
214
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
215
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
216
- */
217
- public function add_fields() {
218
- $yit_options = $this->get_main_array_options();
219
- $current_tab = $this->get_current_tab();
220
-
221
- if ( ! $current_tab ) {
222
- return;
223
- }
224
-
225
- woocommerce_admin_fields( $yit_options[$current_tab] );
226
- }
227
-
228
- /**
229
- * Print the panel content
230
- *
231
- * check if the tab is a wc options tab or custom tab and print the content
232
- *
233
- * @return void
234
- * @since 1.0
235
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
236
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
237
- */
238
- public function print_panel_content() {
239
- $yit_options = $this->get_main_array_options();
240
- $current_tab = $this->get_current_tab();
241
- $custom_tab_action = $this->is_custom_tab( $yit_options, $current_tab );
242
-
243
- if ( $custom_tab_action ) {
244
- $this->print_custom_tab( $custom_tab_action );
245
- return;
246
- }
247
- else {
248
- require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-form.php' );
249
- }
250
- }
251
-
252
- /**
253
- * Update options
254
- *
255
- * @return void
256
- * @since 1.0
257
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
258
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
259
- * @see woocommerce_update_options function
260
- * @internal fire two action (before and after update): yit_panel_wc_before_update and yit_panel_wc_after_update
261
- */
262
- public function woocommerce_update_options() {
263
-
264
- if ( isset( $_POST['yit_panel_wc_options_nonce'] ) && wp_verify_nonce( $_POST['yit_panel_wc_options_nonce'], 'yit_panel_wc_options_'.$this->settings['page'] ) ) {
265
-
266
- do_action( 'yit_panel_wc_before_update' );
267
-
268
- $yit_options = $this->get_main_array_options();
269
- $current_tab = $this->get_current_tab();
270
-
271
- if( version_compare( WC()->version, '2.4.0', '>=' ) ) {
272
- if ( ! empty( $yit_options[ $current_tab ] ) ) {
273
- foreach ( $yit_options[ $current_tab ] as $option ) {
274
- if ( isset( $option['id'] ) && isset( $_POST[ $option['id'] ] ) && isset( $option['type' ] ) && ! in_array( $option['type'], $this->wc_type ) ) {
275
- $_POST[ $option['id'] ] = maybe_serialize( $_POST[ $option['id'] ] );
276
- }
277
- }
278
- }
279
- }
280
-
281
- foreach($_POST as $name => $value) {
282
-
283
- // Check if current POST var which name ends with a specific needle
284
- $attachment_id_needle = "-yith-attachment-id";
285
- $is_hidden_input = (($temp = strlen($name) - strlen($attachment_id_needle)) >= 0 && strpos($name, $attachment_id_needle, $temp) !== FALSE);
286
- if ($is_hidden_input){
287
- // Is an input element of type "hidden" coupled with an input element for selecting an element from the media gallery
288
- $yit_options[ $current_tab ][$name] = array(
289
- "type" => "text",
290
- "id" => $name
291
- );
292
- }
293
- }
294
-
295
- woocommerce_update_options( $yit_options[ $current_tab ] );
296
-
297
- do_action( 'yit_panel_wc_after_update' );
298
-
299
- } elseif( isset( $_REQUEST['yit-action'] ) && $_REQUEST['yit-action'] == 'wc-options-reset'
300
- && isset( $_POST['yith_wc_reset_options_nonce'] ) && wp_verify_nonce( $_POST['yith_wc_reset_options_nonce'], 'yith_wc_reset_options_'.$this->settings['page'] )){
301
-
302
- $yit_options = $this->get_main_array_options();
303
- $current_tab = $this->get_current_tab();
304
-
305
- foreach( $yit_options[ $current_tab ] as $id => $option ){
306
- if( isset( $option['default'] ) ){
307
- update_option( $option['id'], $option['default'] );
308
- }
309
- }
310
- }
311
- }
312
-
313
- /**
314
- * Add Admin WC Style and Scripts
315
- *
316
- * @return void
317
- * @since 1.0
318
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
319
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
320
- */
321
- public function admin_enqueue_scripts() {
322
- global $woocommerce, $pagenow;
323
-
324
- wp_enqueue_style( 'raleway-font', '//fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,100,200,300,900' );
325
-
326
- wp_enqueue_media();
327
- wp_enqueue_style( 'woocommerce_admin_styles', $woocommerce->plugin_url() . '/assets/css/admin.css', array(), $woocommerce->version );
328
- wp_register_style( 'yit-plugin-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel.css', $woocommerce->version );
329
- wp_enqueue_style ( 'wp-jquery-ui-dialog' );
330
-
331
- wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
332
- wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
333
- wp_enqueue_script( 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/js/admin/settings.min.js', array( 'jquery', 'jquery-ui-datepicker','jquery-ui-dialog', 'jquery-ui-sortable', 'iris', 'chosen' ), $woocommerce->version, true );
334
- wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.min.js', array( 'jquery', 'jquery-chosen' ), $this->version, true );
335
- wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array(
336
- 'i18n_nav_warning' => __( 'The changes you have made will be lost if you leave this page.', 'yith-plugin-fw' )
337
- ) );
338
-
339
- if( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yit-plugins_page' ) !== false ){
340
- wp_enqueue_style( 'yit-plugin-style' );
341
- wp_enqueue_script( 'yit-plugin-panel' );
342
- }
343
- }
344
-
345
- /**
346
- * Default options
347
- *
348
- * Sets up the default options used on the settings page
349
- *
350
- * @access public
351
- * @return void
352
- * @since 1.0.0
353
- */
354
- public function set_default_options() {
355
-
356
- $default_options = $this->get_main_array_options();
357
-
358
- foreach ($default_options as $section) {
359
- foreach ( $section as $value ) {
360
- if ( ( isset( $value['std'] ) || isset( $value['default'] ) ) && isset( $value['id'] ) ) {
361
- $default_value = ( isset( $value['default'] ) ) ? $value['default'] : $value['std'];
362
-
363
- if ( $value['type'] == 'image_width' ) {
364
- add_option($value['id'].'_width', $default_value);
365
- add_option($value['id'].'_height', $default_value);
366
- } else {
367
- add_option($value['id'], $default_value);
368
- }
369
- }
370
-
371
- }
372
- }
373
-
374
- }
375
-
376
- /**
377
- * Add the woocommerce body class in plugin panel page
378
- *
379
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
380
- * @since 2.0
381
- * @param $classes The body classes
382
- *
383
- * @return array Filtered body classes
384
- */
385
- public function admin_body_class( $admin_body_classes ){
386
- global $pagenow;
387
- return 'admin.php' == $pagenow && substr_count( $admin_body_classes, 'woocommerce' ) == 0 ? $admin_body_classes .= ' woocommerce ' : $admin_body_classes;
388
- }
389
-
390
- /**
391
- * Maybe unserialize panel data
392
- *
393
- * @param $value mixed Option value
394
- * @param $option mixed Option settings array
395
- * @param $raw_value string Raw option value
396
- *
397
- * @return mixed Filtered return value
398
- * @author Antonio La Rocca <antonio.larocca@yithemes.com>
399
- * @since 2.0
400
- */
401
- public function maybe_unserialize_panel_data( $value, $option, $raw_value ) {
402
-
403
-
404
- if( ! version_compare( WC()->version, '2.4.0', '>=' ) || ! isset( $option['type' ] ) || in_array( $option['type'], $this->wc_type ) ) {
405
- return $value;
406
- }
407
-
408
- $yit_options = $this->get_main_array_options();
409
- $current_tab = $this->get_current_tab();
410
-
411
- if( ! empty( $yit_options[ $current_tab ] ) ){
412
- foreach( $yit_options[ $current_tab ] as $option_array ){
413
- if( isset( $option_array['id'] ) && isset( $option['id'] ) && $option_array['id'] == $option['id'] ){
414
- return maybe_unserialize( $value );
415
- }
416
- }
417
- }
418
-
419
- return $value;
420
- }
421
-
422
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
423
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
16
+ /**
17
+ * YIT Plugin Panel for WooCommerce
18
+ *
19
+ * Setting Page to Manage Plugins
20
+ *
21
+ * @class YIT_Plugin_Panel
22
+ * @package Yithemes
23
+ * @since 1.0
24
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
26
+ */
27
+
28
+ class YIT_Plugin_Panel_WooCommerce extends YIT_Plugin_Panel {
29
+
30
+ /**
31
+ * @var string version of class
32
+ */
33
+ public $version = '1.0.0';
34
+
35
+ /**
36
+ * @var array a setting list of parameters
37
+ */
38
+ public $settings = array();
39
+
40
+ /**
41
+ * @var array a setting list of parameters
42
+ */
43
+ public $wc_type = array();
44
+
45
+ /**
46
+ * @var array
47
+ */
48
+ protected $_tabs_path_files;
49
+
50
+ /**
51
+ * Constructor
52
+ *
53
+ * @since 1.0
54
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
55
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
56
+ */
57
+ public function __construct( $args = array() ) {
58
+
59
+ $this->wc_type = array(
60
+ 'checkbox',
61
+ 'textarea',
62
+ 'multiselect',
63
+ 'multi_select_countries',
64
+ 'image_width'
65
+ );
66
+
67
+ if ( ! empty( $args ) ) {
68
+ $this->settings = $args;
69
+ $this->_tabs_path_files = $this->get_tabs_path_files();
70
+
71
+ if( isset( $this->settings['create_menu_page'] ) && $this->settings[ 'create_menu_page'] ){
72
+ $this->add_menu_page();
73
+ }
74
+
75
+ if ( !empty( $this->settings[ 'links' ] ) ) {
76
+ $this->links = $this->settings[ 'links' ];
77
+ }
78
+
79
+ add_action( 'admin_init', array( $this, 'set_default_options') );
80
+ add_action( 'admin_menu', array( $this, 'add_setting_page' ) );
81
+ add_action( 'admin_menu', array( $this, 'add_premium_version_upgrade_to_menu' ), 100 );
82
+ add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 100 );
83
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
84
+ add_action( 'admin_init', array( $this, 'woocommerce_update_options' ) );
85
+ add_filter( 'woocommerce_screen_ids', array( $this, 'add_allowed_screen_id' ) );
86
+ add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'maybe_unserialize_panel_data' ), 10, 3 );
87
+
88
+ /* Add VideoBox and InfoBox */
89
+ add_action( 'woocommerce_admin_field_boxinfo', array( $this, 'add_infobox' ), 10, 1 );
90
+ add_action( 'woocommerce_admin_field_videobox', array( $this, 'add_videobox' ), 10, 1 );
91
+
92
+ /* WooCommerce 2.4 Support */
93
+ add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
94
+ }
95
+
96
+ /* add YIT Plugin sidebar */
97
+ $this->sidebar = YIT_Plugin_Panel_Sidebar::instance( $this );
98
+ }
99
+
100
+
101
+ /**
102
+ * Show a tabbed panel to setting page
103
+ *
104
+ * a callback function called by add_setting_page => add_submenu_page
105
+ *
106
+ * @return void
107
+ * @since 1.0
108
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
109
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
110
+ */
111
+ public function yit_panel() {
112
+ $additional_info = array(
113
+ 'current_tab' => $this->get_current_tab(),
114
+ 'available_tabs' => $this->settings['admin-tabs'],
115
+ 'default_tab' => $this->get_available_tabs( true ), //get default tabs
116
+ 'page' => $this->settings['page']
117
+ );
118
+
119
+ $additional_info = apply_filters( 'yith_admin_tab_params', $additional_info );
120
+ $additional_info['additional_info'] = $additional_info;
121
+
122
+ extract( $additional_info );
123
+ require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-panel.php' );
124
+ }
125
+
126
+ /**
127
+ * Show a input fields to upload images
128
+ *
129
+ *
130
+ * @return void
131
+ * @since 1.0
132
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
133
+ */
134
+
135
+ public function yit_upload_update( $option_value ) {
136
+ return $option_value;
137
+ }
138
+
139
+ /**
140
+ * Show a input fields to upload images
141
+ *
142
+ *
143
+ * @return void
144
+ * @since 1.0
145
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
146
+ */
147
+
148
+ public function yit_upload( $args = array() ) {
149
+ if ( ! empty( $args ) ) {
150
+ $args['value'] = ( get_option($args['id'])) ? get_option($args['id']) : $args['default'];
151
+ extract( $args );
152
+
153
+ include( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-upload.php' );
154
+ }
155
+ }
156
+
157
+ /**
158
+ * Add the plugin woocommerce page settings in the screen ids of woocommerce
159
+ *
160
+ * @param $screen_ids
161
+ *
162
+ * @return mixed
163
+ * @since 1.0.0
164
+ * @author Antonino Scarfì <antonino.scarfi@yithemes.com>
165
+ */
166
+ public function add_allowed_screen_id( $screen_ids ) {
167
+ global $admin_page_hooks;
168
+
169
+ if ( ! isset( $admin_page_hooks[ $this->settings['parent_page'] ] ) ) {
170
+ return $screen_ids;
171
+ }
172
+
173
+ $screen_ids[] = $admin_page_hooks[ $this->settings['parent_page'] ] . '_page_' . $this->settings['page'];
174
+
175
+ return $screen_ids;
176
+ }
177
+
178
+ /**
179
+ * Returns current active tab slug
180
+ *
181
+ * @return string
182
+ * @since 2.0.0
183
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
184
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
185
+ */
186
+ public function get_current_tab() {
187
+ global $pagenow;
188
+ $tabs = $this->get_available_tabs();
189
+
190
+ if ( $pagenow == 'admin.php' && isset( $_REQUEST['tab'] ) && in_array( $_REQUEST['tab'], $tabs ) ) {
191
+ return $_REQUEST['tab'];
192
+ }
193
+ else {
194
+ return $tabs[0];
195
+ }
196
+ }
197
+
198
+ /**
199
+ * Return available tabs
200
+ *
201
+ * read all options and show sections and fields
202
+ *
203
+ * @param bool false for all tabs slug, true for current tab
204
+ *
205
+ * @return mixed Array tabs | String current tab
206
+ * @since 1.0
207
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
208
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
209
+ */
210
+ public function get_available_tabs( $default = false ) {
211
+ $tabs = array_keys( $this->settings['admin-tabs'] );
212
+ return $default ? $tabs[0] : $tabs;
213
+ }
214
+
215
+
216
+ /**
217
+ * Add sections and fields to setting panel
218
+ *
219
+ * read all options and show sections and fields
220
+ *
221
+ * @return void
222
+ * @since 1.0
223
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
224
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
225
+ */
226
+ public function add_fields() {
227
+ $yit_options = $this->get_main_array_options();
228
+ $current_tab = $this->get_current_tab();
229
+
230
+ if ( ! $current_tab ) {
231
+ return;
232
+ }
233
+
234
+ woocommerce_admin_fields( $yit_options[$current_tab] );
235
+ }
236
+
237
+ /**
238
+ * Print the panel content
239
+ *
240
+ * check if the tab is a wc options tab or custom tab and print the content
241
+ *
242
+ * @return void
243
+ * @since 1.0
244
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
245
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
246
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
247
+ */
248
+ public function print_panel_content() {
249
+ $yit_options = $this->get_main_array_options();
250
+ $current_tab = $this->get_current_tab();
251
+ $custom_tab_action = $this->is_custom_tab( $yit_options, $current_tab );
252
+ $hide_sidebar = $this->hide_sidebar( $yit_options, $current_tab );
253
+
254
+ if ( $custom_tab_action ) {
255
+ $this->print_custom_tab( $custom_tab_action, $hide_sidebar );
256
+ return;
257
+ }
258
+ else {
259
+ require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-form.php' );
260
+ }
261
+ }
262
+
263
+ /**
264
+ * Update options
265
+ *
266
+ * @return void
267
+ * @since 1.0
268
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
269
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
270
+ * @see woocommerce_update_options function
271
+ * @internal fire two action (before and after update): yit_panel_wc_before_update and yit_panel_wc_after_update
272
+ */
273
+ public function woocommerce_update_options() {
274
+
275
+ if ( isset( $_POST['yit_panel_wc_options_nonce'] ) && wp_verify_nonce( $_POST['yit_panel_wc_options_nonce'], 'yit_panel_wc_options_'.$this->settings['page'] ) ) {
276
+
277
+ do_action( 'yit_panel_wc_before_update' );
278
+
279
+ $yit_options = $this->get_main_array_options();
280
+ $current_tab = $this->get_current_tab();
281
+
282
+ if( version_compare( WC()->version, '2.4.0', '>=' ) ) {
283
+ if ( ! empty( $yit_options[ $current_tab ] ) ) {
284
+ foreach ( $yit_options[ $current_tab ] as $option ) {
285
+ if ( isset( $option['id'] ) && isset( $_POST[ $option['id'] ] ) && isset( $option['type' ] ) && ! in_array( $option['type'], $this->wc_type ) ) {
286
+ $_POST[ $option['id'] ] = maybe_serialize( $_POST[ $option['id'] ] );
287
+ }
288
+ }
289
+ }
290
+ }
291
+
292
+ foreach($_POST as $name => $value) {
293
+
294
+ // Check if current POST var name ends with a specific needle and make some stuff here
295
+ $attachment_id_needle = "-yith-attachment-id";
296
+ $is_hidden_input = (($temp = strlen($name) - strlen($attachment_id_needle)) >= 0 && strpos($name, $attachment_id_needle, $temp) !== FALSE);
297
+ if ($is_hidden_input){
298
+ // Is an input element of type "hidden" coupled with an input element for selecting an element from the media gallery
299
+ $yit_options[ $current_tab ][$name] = array(
300
+ "type" => "text",
301
+ "id" => $name
302
+ );
303
+ }
304
+ }
305
+
306
+ woocommerce_update_options( $yit_options[ $current_tab ] );
307
+
308
+ do_action( 'yit_panel_wc_after_update' );
309
+
310
+ } elseif( isset( $_REQUEST['yit-action'] ) && $_REQUEST['yit-action'] == 'wc-options-reset'
311
+ && isset( $_POST['yith_wc_reset_options_nonce'] ) && wp_verify_nonce( $_POST['yith_wc_reset_options_nonce'], 'yith_wc_reset_options_'.$this->settings['page'] )){
312
+
313
+ do_action( 'yit_panel_wc_before_reset' );
314
+
315
+ $yit_options = $this->get_main_array_options();
316
+ $current_tab = $this->get_current_tab();
317
+
318
+ foreach( $yit_options[ $current_tab ] as $id => $option ){
319
+ if( isset( $option['default'] ) ){
320
+ update_option( $option['id'], $option['default'] );
321
+ }
322
+ }
323
+
324
+ do_action( 'yit_panel_wc_after_reset' );
325
+ }
326
+ }
327
+
328
+ /**
329
+ * Add Admin WC Style and Scripts
330
+ *
331
+ * @return void
332
+ * @since 1.0
333
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
334
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
335
+ */
336
+ public function admin_enqueue_scripts() {
337
+ global $woocommerce, $pagenow;
338
+
339
+ $woocommerce_version = function_exists( 'WC' ) ? WC()->version : $woocommerce->version;
340
+
341
+ wp_enqueue_style( 'raleway-font', '//fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,100,200,300,900' );
342
+
343
+ wp_enqueue_media();
344
+ wp_enqueue_style( 'woocommerce_admin_styles', $woocommerce->plugin_url() . '/assets/css/admin.css', array(), $woocommerce_version );
345
+ wp_register_style( 'yit-plugin-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel.css', $woocommerce_version );
346
+ wp_register_style( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/css/colorbox.css', array(), $woocommerce_version );
347
+ wp_register_style( 'yit-upgrade-to-pro', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrade-to-pro.css', array( 'colorbox' ), $woocommerce_version );
348
+
349
+ if ( 'customize.php' != $pagenow ){
350
+ wp_enqueue_style ( 'wp-jquery-ui-dialog' );
351
+ }
352
+
353
+ wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
354
+ wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
355
+
356
+ $woocommerce_settings_deps = array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris' );
357
+
358
+ if( version_compare( '2.5', $woocommerce_version, '<=' ) ){
359
+ // WooCommerce > 2.6
360
+ $woocommerce_settings_deps[] = 'select2';
361
+ }
362
+
363
+ else {
364
+ // WooCommerce < 2.6
365
+ $woocommerce_settings_deps[] = 'jquery-ui-dialog';
366
+ $woocommerce_settings_deps[] = 'chosen';
367
+ }
368
+
369
+ wp_enqueue_script( 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/js/admin/settings.min.js', $woocommerce_settings_deps, $woocommerce_version, true );
370
+
371
+ wp_register_script( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/js/jquery.colorbox.js', array( 'jquery' ), '1.6.3', true );
372
+ wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.min.js', array( 'jquery', 'jquery-chosen' ), $this->version, true );
373
+ wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array(
374
+ 'i18n_nav_warning' => __( 'The changes you have made will be lost if you leave this page.', 'yith-plugin-fw' )
375
+ ) );
376
+
377
+ if( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ){
378
+ wp_enqueue_style( 'yit-plugin-style' );
379
+ wp_enqueue_script( 'yit-plugin-panel' );
380
+ }
381
+
382
+ if( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith_upgrade_premium_version' ) !== false ){
383
+ wp_enqueue_style( 'yit-upgrade-to-pro' );
384
+ wp_enqueue_script( 'colorbox' );
385
+ }
386
+ }
387
+
388
+ /**
389
+ * Default options
390
+ *
391
+ * Sets up the default options used on the settings page
392
+ *
393
+ * @access public
394
+ * @return void
395
+ * @since 1.0.0
396
+ */
397
+ public function set_default_options() {
398
+
399
+ $default_options = $this->get_main_array_options();
400
+
401
+ foreach ($default_options as $section) {
402
+ foreach ( $section as $value ) {
403
+ if ( ( isset( $value['std'] ) || isset( $value['default'] ) ) && isset( $value['id'] ) ) {
404
+ $default_value = ( isset( $value['default'] ) ) ? $value['default'] : $value['std'];
405
+
406
+ if ( $value['type'] == 'image_width' ) {
407
+ add_option($value['id'].'_width', $default_value);
408
+ add_option($value['id'].'_height', $default_value);
409
+ } else {
410
+ add_option($value['id'], $default_value);
411
+ }
412
+ }
413
+
414
+ }
415
+ }
416
+
417
+ }
418
+
419
+ /**
420
+ * Add the woocommerce body class in plugin panel page
421
+ *
422
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
423
+ * @since 2.0
424
+ * @param $classes The body classes
425
+ *
426
+ * @return array Filtered body classes
427
+ */
428
+ public function admin_body_class( $admin_body_classes ){
429
+ global $pagenow;
430
+ return 'admin.php' == $pagenow && substr_count( $admin_body_classes, 'woocommerce' ) == 0 ? $admin_body_classes .= ' woocommerce ' : $admin_body_classes;
431
+ }
432
+
433
+ /**
434
+ * Maybe unserialize panel data
435
+ *
436
+ * @param $value mixed Option value
437
+ * @param $option mixed Option settings array
438
+ * @param $raw_value string Raw option value
439
+ *
440
+ * @return mixed Filtered return value
441
+ * @author Antonio La Rocca <antonio.larocca@yithemes.com>
442
+ * @since 2.0
443
+ */
444
+ public function maybe_unserialize_panel_data( $value, $option, $raw_value ) {
445
+
446
+
447
+ if( ! version_compare( WC()->version, '2.4.0', '>=' ) || ! isset( $option['type' ] ) || in_array( $option['type'], $this->wc_type ) ) {
448
+ return $value;
449
+ }
450
+
451
+ $yit_options = $this->get_main_array_options();
452
+ $current_tab = $this->get_current_tab();
453
+
454
+ if( ! empty( $yit_options[ $current_tab ] ) ){
455
+ foreach( $yit_options[ $current_tab ] as $option_array ){
456
+ if( isset( $option_array['id'] ) && isset( $option['id'] ) && $option_array['id'] == $option['id'] ){
457
+ return maybe_unserialize( $value );
458
+ }
459
+ }
460
+ }
461
+
462
+ return $value;
463
+ }
464
+
465
+ }
466
  }
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -1,803 +1,917 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
16
- /**
17
- * YIT Plugin Panel
18
- *
19
- * Setting Page to Manage Plugins
20
- *
21
- * @class YIT_Plugin_Panel
22
- * @package Yithemes
23
- * @since 1.0
24
- * @author Your Inspiration Themes
25
- */
26
-
27
- class YIT_Plugin_Panel {
28
-
29
- /**
30
- * @var string version of class
31
- */
32
- public $version = '1.0.0';
33
-
34
- /**
35
- * @var array a setting list of parameters
36
- */
37
- public $settings = array();
38
-
39
- /**
40
- * @var array
41
- */
42
- protected $_tabs_path_files;
43
-
44
- /**
45
- * @var array
46
- */
47
- private $_main_array_options = array();
48
-
49
- /**
50
- * Constructor
51
- *
52
- * @since 1.0
53
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
54
- *
55
- * @param array $args
56
- */
57
- public function __construct( $args = array() ) {
58
-
59
- if ( ! empty( $args ) ) {
60
-
61
- $default_args = array(
62
- 'parent_slug' => 'edit.php?',
63
- 'page_title' => __( 'Plugin Settings', 'yith-plugin-fw' ),
64
- 'menu_title' => __( 'Settings', 'yith-plugin-fw' ),
65
- 'capability' => 'manage_options',
66
- 'icon_url' => '',
67
- 'position' => null
68
- );
69
-
70
- $this->settings = wp_parse_args( $args, $default_args );
71
- $this->_tabs_path_files = $this->get_tabs_path_files();
72
-
73
- if ( isset( $this->settings['create_menu_page'] ) && $this->settings['create_menu_page'] ) {
74
- $this->add_menu_page();
75
- }
76
-
77
- add_action( 'admin_init', array( $this, 'register_settings' ) );
78
- add_action( 'admin_menu', array( $this, 'add_setting_page' ), 20 );
79
- add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 100 );
80
- add_action( 'admin_init', array( $this, 'add_fields' ) );
81
-
82
- }
83
-
84
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
85
- }
86
-
87
- /**
88
- * Add Menu page link
89
- *
90
- * @return void
91
- * @since 1.0
92
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
93
- */
94
- public function add_menu_page() {
95
- global $admin_page_hooks;
96
-
97
- if( ! isset( $admin_page_hooks['yit_plugin_panel'] ) ){
98
- $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
99
- add_menu_page( 'yit_plugin_panel', __( 'YIT Plugins', 'yith-plugin-fw' ), 'manage_options', 'yit_plugin_panel', NULL, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
100
- }
101
- }
102
-
103
- /**
104
- * Remove duplicate submenu
105
- *
106
- * Submenu page hack: Remove the duplicate YIT Plugin link on subpages
107
- *
108
- * @return void
109
- * @since 1.0
110
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
111
- */
112
- public function remove_duplicate_submenu_page() {
113
- /* === Duplicate Items Hack === */
114
- remove_submenu_page( 'yit_plugin_panel', 'yit_plugin_panel' );
115
- }
116
-
117
- /**
118
- * Enqueue script and styles in admin side
119
- *
120
- * Add style and scripts to administrator
121
- *
122
- * @return void
123
- * @since 1.0
124
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
125
- */
126
- public function admin_enqueue_scripts() {
127
-
128
- global $wp_scripts, $pagenow;
129
-
130
- //scripts
131
- wp_enqueue_media();
132
- wp_enqueue_script( 'jquery-ui' );
133
- wp_enqueue_script( 'jquery-ui-core' );
134
- wp_enqueue_script( 'jquery-ui-slider' );
135
- wp_enqueue_script( 'jquery-ui-dialog' );
136
- wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
137
- wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.js', array( 'jquery', 'jquery-chosen' ), $this->version, true );
138
- wp_register_script( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/codemirror.js', array( 'jquery' ), $this->version, true );
139
- wp_register_script( 'codemirror-javascript', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/javascript.js', array( 'jquery', 'codemirror' ), $this->version, true );
140
-
141
- //styles
142
- $jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
143
- wp_register_style( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/css/codemirror/codemirror.css' );
144
- wp_enqueue_style( 'jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all' );
145
- wp_register_style( 'yit-plugin-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel.css', $this->version );
146
- wp_enqueue_style( 'raleway-font', '//fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,100,200,300,900' );
147
- wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
148
- wp_enqueue_style( 'yit-jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
149
-
150
- if( 'admin.php' == $pagenow && strpos('yit-plugins_page',get_current_screen()->id ) !== false ){
151
- wp_enqueue_style( 'yit-plugin-style' );
152
- wp_enqueue_script( 'yit-plugin-panel' );
153
- }
154
- }
155
-
156
- /**
157
- * Register Settings
158
- *
159
- * Generate wp-admin settings pages by registering your settings and using a few callbacks to control the output
160
- *
161
- * @return void
162
- * @since 1.0
163
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
164
- */
165
- public function register_settings() {
166
- register_setting( 'yit_' . $this->settings['parent'] . '_options', 'yit_' . $this->settings['parent'] . '_options', array( $this, 'options_validate' ) );
167
- }
168
-
169
- /**
170
- * Options Validate
171
- *
172
- * a callback function called by Register Settings function
173
- *
174
- * @param $input
175
- *
176
- * @return array validate input fields
177
- * @since 1.0
178
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
179
- */
180
- public function options_validate( $input ) {
181
-
182
- $current_tab = ! empty( $input['current_tab'] ) ? $input['current_tab'] : 'general';
183
-
184
- $yit_options = $this->get_main_array_options();
185
-
186
- // default
187
- $valid_input = $this->get_options();
188
-
189
- $submit = ( ! empty( $input['submit-general'] ) ? true : false );
190
- $reset = ( ! empty( $input['reset-general'] ) ? true : false );
191
-
192
- foreach ( $yit_options[$current_tab] as $section => $data ) {
193
- foreach ( $data as $option ) {
194
- if ( isset( $option['sanitize_call'] ) && isset( $option['id'] ) ) { //yiw_debug($option, false);
195
- if ( is_array( $option['sanitize_call'] ) ) :
196
- foreach ( $option['sanitize_call'] as $callback ) {
197
- if ( is_array( $input[$option['id']] ) ) {
198
- $valid_input[$option['id']] = array_map( $callback, $input[$option['id']] );
199
- }
200
- else {
201
- $valid_input[$option['id']] = call_user_func( $callback, $input[$option['id']] );
202
- }
203
- }
204
- else :
205
- if ( is_array( $input[$option['id']] ) ) {
206
- $valid_input[$option['id']] = array_map( $option['sanitize_call'], $input[$option['id']] );
207
- }
208
- else {
209
- $valid_input[$option['id']] = call_user_func( $option['sanitize_call'], $input[$option['id']] );
210
- }
211
- endif;
212
- }
213
- else {
214
- if ( isset( $option['id'] ) ) {
215
- if ( isset( $input[$option['id']] ) ) {
216
- $valid_input[$option['id']] = $input[$option['id']];
217
- }
218
- else {
219
- $valid_input[$option['id']] = 'no';
220
- }
221
-
222
- }
223
- }
224
-
225
- }
226
- }
227
-
228
- return $valid_input;
229
- }
230
-
231
- /**
232
- * Add Setting SubPage
233
- *
234
- * add Setting SubPage to wordpress administrator
235
- *
236
- * @return array validate input fields
237
- * @since 1.0
238
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
239
- */
240
- public function add_setting_page() {
241
- $this->settings['icon_url'] = isset( $this->settings['icon_url'] ) ? $this->settings['icon_url'] : '';
242
- $this->settings['position'] = isset( $this->settings['position'] ) ? $this->settings['position'] : null;
243
- $parent = $this->settings['parent_slug'] . $this->settings['parent_page'];
244
-
245
- if ( ! empty( $parent ) ) {
246
- add_submenu_page( $parent, $this->settings['page_title'], $this->settings['menu_title'], $this->settings['capability'], $this->settings['page'], array( $this, 'yit_panel' ) );
247
- } else {
248
- add_menu_page( $this->settings['page_title'], $this->settings['menu_title'], $this->settings['capability'], $this->settings['page'], array( $this, 'yit_panel' ), $this->settings['icon_url'], $this->settings['position'] );
249
- }
250
- /* === Duplicate Items Hack === */
251
- $this->remove_duplicate_submenu_page();
252
- do_action( 'yit_after_add_settings_page' );
253
- }
254
-
255
- /**
256
- * Show a tabbed panel to setting page
257
- *
258
- * a callback function called by add_setting_page => add_submenu_page
259
- *
260
- * @return void
261
- * @since 1.0
262
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
263
- */
264
- public function yit_panel() {
265
-
266
- $tabs = '';
267
- $current_tab = $this->get_current_tab();
268
- $yit_options = $this->get_main_array_options();
269
-
270
- // tabs
271
- foreach ( $this->settings['admin-tabs'] as $tab => $tab_value ) {
272
- $active_class = ( $current_tab == $tab ) ? ' nav-tab-active' : '';
273
- $tabs .= '<a class="nav-tab' . $active_class . '" href="?' . $this->settings['parent_page'] . '&page=' . $this->settings['page'] . '&tab=' . $tab . '">' . $tab_value . '</a>';
274
- }
275
- ?>
276
- <div id="icon-themes" class="icon32"><br /></div>
277
- <h2 class="nav-tab-wrapper">
278
- <?php echo $tabs ?>
279
- </h2>
280
- <?php
281
- $custom_tab_action = $this->is_custom_tab( $yit_options, $current_tab );
282
- if ( $custom_tab_action ) {
283
- $this->print_custom_tab( $custom_tab_action );
284
- return;
285
- }
286
- ?>
287
- <?php $this->print_video_box(); ?>
288
- <div id="wrap" class="plugin-option">
289
- <?php $this->message(); ?>
290
- <h2><?php echo $this->get_tab_title() ?></h2>
291
- <?php if ( $this->is_show_form() ) : ?>
292
- <form method="post" action="options.php">
293
- <?php do_settings_sections( 'yit' ); ?>
294
- <p>&nbsp;</p>
295
- <?php settings_fields( 'yit_' . $this->settings['parent'] . '_options' ); ?>
296
- <input type="hidden" name="<?php echo $this->get_name_field( 'current_tab' ) ?>" value="<?php echo esc_attr( $current_tab ) ?>" />
297
- <input type="submit" class="button-primary" value="<?php _e( 'Save Changes', 'yith-plugin-fw' ) ?>" style="float:left;margin-right:10px;" />
298
- </form>
299
- <form method="post">
300
- <?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
301
- <input type="hidden" name="yit-action" value="reset" />
302
- <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' ) ?>');" />
303
- </form>
304
- <p>&nbsp;</p>
305
- <?php endif ?>
306
- </div>
307
- <?php
308
- }
309
-
310
- public function is_custom_tab( $options, $current_tab ) {
311
- foreach ( $options[$current_tab] as $section => $option ) {
312
- if ( isset( $option['type'] ) && isset( $option['action'] ) && 'custom_tab' == $option['type'] && ! empty( $option['action'] ) ) {
313
- return $option['action'];
314
- }
315
- else {
316
- return false;
317
- }
318
- }
319
- }
320
-
321
- /**
322
- * Fire the action to print the custom tab
323
- *
324
- *
325
- * @param $action Action to fire
326
- *
327
- * @return void
328
- * @since 1.0
329
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
330
- */
331
- public function print_custom_tab( $action ) {
332
- do_action( $action );
333
- }
334
-
335
- /**
336
- * Add sections and fields to setting panel
337
- *
338
- * read all options and show sections and fields
339
- *
340
- * @return void
341
- * @since 1.0
342
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
343
- */
344
- public function add_fields() {
345
- $yit_options = $this->get_main_array_options();
346
- $current_tab = $this->get_current_tab();
347
-
348
- if ( ! $current_tab ) {
349
- return;
350
- }
351
- foreach ( $yit_options[$current_tab] as $section => $data ) {
352
- add_settings_section( "yit_settings_{$current_tab}_{$section}", $this->get_section_title( $section ), $this->get_section_description( $section ), 'yit' );
353
- foreach ( $data as $option ) {
354
- if ( isset( $option['id'] ) && isset( $option['type'] ) && isset( $option['name'] ) ) {
355
- add_settings_field( "yit_setting_" . $option['id'], $option['name'], array( $this, 'render_field' ), 'yit', "yit_settings_{$current_tab}_{$section}", array( 'option' => $option, 'label_for' => $this->get_id_field( $option['id'] ) ) );
356
- }
357
- }
358
- }
359
- }
360
-
361
-
362
- /**
363
- * Add the tabs to admin bar menu
364
- *
365
- * set all tabs of settings page on wp admin bar
366
- *
367
- * @return void|array return void when capability is false
368
- * @since 1.0
369
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
370
- */
371
- public function add_admin_bar_menu() {
372
-
373
- global $wp_admin_bar;
374
-
375
- if ( ! current_user_can( 'manage_options' ) ) {
376
- return;
377
- }
378
-
379
- if ( ! empty( $this->settings['admin_tabs'] ) ) {
380
- foreach ( $this->settings['admin-tabs'] as $item => $title ) {
381
-
382
- $wp_admin_bar->add_menu( array(
383
- 'parent' => $this->settings['parent'],
384
- 'title' => $title,
385
- 'id' => $this->settings['parent'] . '-' . $item,
386
- 'href' => admin_url( 'themes.php' ) . '?page=' . $this->settings['parent_page'] . '&tab=' . $item
387
- ) );
388
- }
389
- }
390
- }
391
-
392
-
393
- /**
394
- * Get current tab
395
- *
396
- * get the id of tab showed, return general is the current tab is not defined
397
- *
398
- * @return string
399
- * @since 1.0
400
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
401
- */
402
- function get_current_tab() {
403
- $admin_tabs = array_keys( $this->settings['admin-tabs'] );
404
-
405
- if ( ! isset( $_GET['page'] ) || $_GET['page'] != $this->settings['page'] ) {
406
- return false;
407
- }
408
- if ( isset( $_REQUEST['yit_tab_options'] ) ) {
409
- return $_REQUEST['yit_tab_options'];
410
- }
411
- elseif ( isset( $_GET['tab'] ) && isset( $this->_tabs_path_files[$_GET['tab']] ) ) {
412
- return $_GET['tab'];
413
- }
414
- elseif ( isset( $admin_tabs[0] ) ) {
415
- return $admin_tabs[0];
416
- }
417
- else {
418
- return 'general';
419
- }
420
- }
421
-
422
-
423
- /**
424
- * Message
425
- *
426
- * define an array of message and show the content od message if
427
- * is find in the query string
428
- *
429
- * @return void
430
- * @since 1.0
431
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
432
- */
433
- public function message() {
434
-
435
- $message = array(
436
- 'element_exists' => $this->get_message( '<strong>' . __( 'The element you have entered already exists. Please, enter another name.', 'yith-plugin-fw' ) . '</strong>', 'error', false ),
437
- 'saved' => $this->get_message( '<strong>' . __( 'Settings saved', 'yith-plugin-fw' ) . '.</strong>', 'updated', false ),
438
- 'reset' => $this->get_message( '<strong>' . __( 'Settings reset', 'yith-plugin-fw' ) . '.</strong>', 'updated', false ),
439
- 'delete' => $this->get_message( '<strong>' . __( 'Element deleted correctly.', 'yith-plugin-fw' ) . '</strong>', 'updated', false ),
440
- 'updated' => $this->get_message( '<strong>' . __( 'Element updated correctly.', 'yith-plugin-fw' ) . '</strong>', 'updated', false ),
441
- 'settings-updated' => $this->get_message( '<strong>' . __( 'Element updated correctly.', 'yith-plugin-fw' ) . '</strong>', 'updated', false ),
442
- 'imported' => $this->get_message( '<strong>' . __( 'Database imported correctly.', 'yith-plugin-fw' ) . '</strong>', 'updated', false ),
443
- 'no-imported' => $this->get_message( '<strong>' . __( 'An error has occurred during import. Please try again.', 'yith-plugin-fw' ) . '</strong>', 'error', false ),
444
- 'file-not-valid' => $this->get_message( '<strong>' . __( 'The added file is not valid.', 'yith-plugin-fw' ) . '</strong>', 'error', false ),
445
- 'cant-import' => $this->get_message( '<strong>' . __( 'Sorry, import is disabled.', 'yith-plugin-fw' ) . '</strong>', 'error', false ),
446
- 'ord' => $this->get_message( '<strong>' . __( 'Sorting successful.', 'yith-plugin-fw' ) . '</strong>', 'updated', false )
447
- );
448
-
449
- foreach ( $message as $key => $value ) {
450
- if ( isset( $_GET[$key] ) ) {
451
- echo $message[$key];
452
- }
453
- }
454
-
455
- }
456
-
457
- /**
458
- * Get Message
459
- *
460
- * return html code of message
461
- *
462
- * @param $message
463
- * @param string $type can be 'error' or 'updated'
464
- * @param bool $echo
465
- *
466
- * @return void|string
467
- * @since 1.0
468
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
469
- */
470
- public function get_message( $message, $type = 'error', $echo = true ) {
471
- $message = '<div id="message" class="' . $type . ' fade"><p>' . $message . '</p></div>';
472
- if ( $echo ) {
473
- echo $message;
474
- }
475
- return $message;
476
- }
477
-
478
-
479
- /**
480
- * Get Tab Path Files
481
- *
482
- * return an array with filenames of tabs
483
- *
484
- * @return array
485
- * @since 1.0
486
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
487
- */
488
- function get_tabs_path_files() {
489
-
490
- $option_files_path = $this->settings['options-path'] . '/';
491
-
492
- $tabs = array();
493
-
494
- foreach ( ( array ) glob( $option_files_path . '*.php' ) as $filename ) {
495
- preg_match( '/(.*)-options\.(.*)/', basename( $filename ), $filename_parts );
496
-
497
- if ( ! isset( $filename_parts[1] ) ) {
498
- continue;
499
- }
500
-
501
- $tab = $filename_parts[1];
502
-
503
- $tabs[$tab] = $filename;
504
- }
505
-
506
- return $tabs;
507
- }
508
-
509
- /**
510
- * Get main array options
511
- *
512
- * return an array with all options defined on options-files
513
- *
514
- * @return array
515
- * @since 1.0
516
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
517
- */
518
- function get_main_array_options() {
519
- if ( ! empty( $this->_main_array_options ) ) {
520
- return $this->_main_array_options;
521
- }
522
-
523
- foreach ( $this->settings['admin-tabs'] as $item => $v ) {
524
- $path = $this->settings['options-path'] . '/' . $item . '-options.php';
525
- if ( file_exists( $path ) ) {
526
- $this->_main_array_options = array_merge( $this->_main_array_options, include $path );
527
- }
528
- }
529
-
530
- return $this->_main_array_options;
531
- }
532
-
533
-
534
- /**
535
- * Set an array with all default options
536
- *
537
- * put default options in an array
538
- *
539
- * @return array
540
- * @since 1.0
541
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
542
- */
543
- public function get_default_options() {
544
- $yit_options = $this->get_main_array_options();
545
- $default_options = array();
546
-
547
- foreach ( $yit_options as $tab => $sections ) {
548
- foreach ( $sections as $section ) {
549
- foreach ( $section as $id => $value ) {
550
- if ( isset( $value['std'] ) && isset( $value['id'] ) ) {
551
- $default_options[$value['id']] = $value['std'];
552
- }
553
- }
554
- }
555
- }
556
-
557
- unset( $yit_options );
558
- return $default_options;
559
- }
560
-
561
-
562
- /**
563
- * Get the title of the tab
564
- *
565
- * return the title of tab
566
- *
567
- * @return string
568
- * @since 1.0
569
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
570
- */
571
- function get_tab_title() {
572
- $yit_options = $this->get_main_array_options();
573
- $current_tab = $this->get_current_tab();
574
-
575
- foreach ( $yit_options[$current_tab] as $sections => $data ) {
576
- foreach ( $data as $option ) {
577
- if ( isset( $option['type'] ) && $option['type'] == 'title' ) {
578
- return $option['name'];
579
- }
580
- }
581
- }
582
- }
583
-
584
- /**
585
- * Get the title of the section
586
- *
587
- * return the title of section
588
- *
589
- * @param $section
590
- *
591
- * @return string
592
- * @since 1.0
593
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
594
- */
595
- function get_section_title( $section ) {
596
- $yit_options = $this->get_main_array_options();
597
- $current_tab = $this->get_current_tab();
598
-
599
- foreach ( $yit_options[$current_tab][$section] as $option ) {
600
- if ( isset( $option['type'] ) && $option['type'] == 'section' ) {
601
- return $option['name'];
602
- }
603
- }
604
- }
605
-
606
- /**
607
- * Get the description of the section
608
- *
609
- * return the description of section if is set
610
- *
611
- * @param $section
612
- *
613
- * @return string
614
- * @since 1.0
615
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
616
- */
617
- function get_section_description( $section ) {
618
- $yit_options = $this->get_main_array_options();
619
- $current_tab = $this->get_current_tab();
620
-
621
- foreach ( $yit_options[$current_tab][$section] as $option ) {
622
- if ( isset( $option['type'] ) && $option['type'] == 'section' && isset( $option['desc'] ) ) {
623
- return '<p>' . $option['desc'] . '</p>';
624
- }
625
- }
626
- }
627
-
628
-
629
- /**
630
- * Show form when necessary
631
- *
632
- * return true if 'showform' is not defined
633
- *
634
- * @return bool
635
- * @since 1.0
636
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
637
- */
638
- function is_show_form() {
639
- $yit_options = $this->get_main_array_options();
640
- $current_tab = $this->get_current_tab();
641
-
642
- foreach ( $yit_options[$current_tab] as $sections => $data ) {
643
- foreach ( $data as $option ) {
644
- if ( ! isset( $option['type'] ) || $option['type'] != 'title' ) {
645
- continue;
646
- }
647
- if ( isset( $option['showform'] ) ) {
648
- return $option['showform'];
649
- }
650
- else {
651
- return true;
652
- }
653
- }
654
- }
655
- }
656
-
657
- /**
658
- * Get name field
659
- *
660
- * return a string with the name of the input field
661
- *
662
- * @param string $name
663
- *
664
- * @return string
665
- * @since 1.0
666
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
667
- */
668
- function get_name_field( $name = '' ) {
669
- return 'yit_' . $this->settings['parent'] . '_options[' . $name . ']';
670
- }
671
-
672
- /**
673
- * Get id field
674
- *
675
- * return a string with the id of the input field
676
- *
677
- * @param string $id
678
- *
679
- * @return string
680
- * @since 1.0
681
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
682
- */
683
- function get_id_field( $id ) {
684
- return 'yit_' . $this->settings['parent'] . '_options_' . $id;
685
- }
686
-
687
-
688
- /**
689
- * Render the field showed in the setting page
690
- *
691
- * include the file of the option type, if file do not exists
692
- * return a text area
693
- *
694
- * @param array $param
695
- *
696
- * @return void
697
- * @since 1.0
698
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
699
- */
700
- function render_field( $param ) {
701
-
702
- if ( ! empty( $param ) && isset( $param ['option'] ) ) {
703
- $option = $param ['option'];
704
- $db_options = $this->get_options();
705
-
706
- $custom_attributes = array();
707
-
708
- if ( ! empty( $option['custom_attributes'] ) && is_array( $option['custom_attributes'] ) ) {
709
- foreach ( $option['custom_attributes'] as $attribute => $attribute_value ) {
710
- $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
711
- }
712
- }
713
-
714
- $custom_attributes = implode( ' ', $custom_attributes );
715
- $std = isset( $option['std'] ) ? $option['std'] : '';
716
- $db_value = ( isset( $db_options[$option['id']] ) ) ? $db_options[$option['id']] : $std;
717
-
718
- if ( isset( $option['deps'] ) ) {
719
- $deps = $option['deps'];
720
- }
721
- $type = YIT_CORE_PLUGIN_PATH . '/templates/panel/types/' . $option['type'] . '.php';
722
- if ( file_exists( $type ) ) {
723
- include $type;
724
- }
725
- else {
726
- do_action( "yit_panel_{$option['type']}", $option, $db_value, $custom_attributes );
727
- }
728
- }
729
- }
730
-
731
- /**
732
- * Get options from db
733
- *
734
- * return the options from db, if the options aren't defined in the db,
735
- * get the default options ad add the options in the db
736
- *
737
- * @return array
738
- * @since 1.0
739
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
740
- */
741
- public function get_options() {
742
- $options = get_option( 'yit_' . $this->settings['parent'] . '_options' );
743
- if ( $options === false || ( isset( $_REQUEST['yit-action'] ) && $_REQUEST['yit-action'] == 'reset' ) ) {
744
- $options = $this->get_default_options();
745
- }
746
- return $options;
747
- }
748
-
749
- /**
750
- * Show a box panel with specific content in two columns as a new woocommerce type
751
- *
752
- *
753
- * @param array $args
754
- *
755
- * @return void
756
- * @since 1.0
757
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
758
- */
759
- public function add_infobox( $args = array() ) {
760
- if ( ! empty( $args ) ) {
761
- extract( $args );
762
- require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/boxinfo.php' );
763
- }
764
- }
765
-
766
- /**
767
- * Show a box panel with specific content in two columns as a new woocommerce type
768
- *
769
- * @param array $args
770
- *
771
- * @return void
772
- * @since 1.0
773
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
774
- */
775
- public function add_videobox( $args = array() ) {
776
- if ( ! empty( $args ) ) {
777
- extract( $args );
778
- require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/videobox.php' );
779
- }
780
- }
781
-
782
- /**
783
- * Fire the action to print the custom tab
784
- *
785
- * @return void
786
- * @since 1.0
787
- * @author Antonino Scarfì <antonino.scarfi@yithemes.com>
788
- */
789
- public function print_video_box() {
790
- $file = $this->settings['options-path'] . '/video-box.php';
791
-
792
- if ( ! file_exists( $file ) ) {
793
- return;
794
- }
795
-
796
- $args = include_once( $file );
797
-
798
- $this->add_videobox( $args );
799
- }
800
-
801
- }
802
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
803
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
16
+ /**
17
+ * YIT Plugin Panel
18
+ *
19
+ * Setting Page to Manage Plugins
20
+ *
21
+ * @class YIT_Plugin_Panel
22
+ * @package Yithemes
23
+ * @since 1.0
24
+ * @author Your Inspiration Themes
25
+ */
26
+
27
+ class YIT_Plugin_Panel {
28
+
29
+ /**
30
+ * @var string version of class
31
+ */
32
+ public $version = '1.0.0';
33
+
34
+ /**
35
+ * @var array a setting list of parameters
36
+ */
37
+ public $settings = array();
38
+
39
+ /**
40
+ * @var array
41
+ */
42
+ protected $_tabs_path_files;
43
+
44
+ /**
45
+ * @var array
46
+ */
47
+ private $_main_array_options = array();
48
+
49
+ /**
50
+ * @var YIT_Plugin_Panel_Sidebar
51
+ */
52
+ public $sidebar;
53
+
54
+ /**
55
+ * @var array
56
+ */
57
+ public $links;
58
+
59
+ /**
60
+ * Constructor
61
+ *
62
+ * @since 1.0
63
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
64
+ *
65
+ * @param array $args
66
+ */
67
+ public function __construct( $args = array() ) {
68
+
69
+ if ( ! empty( $args ) ) {
70
+
71
+ $default_args = array(
72
+ 'parent_slug' => 'edit.php?',
73
+ 'page_title' => __( 'Plugin Settings', 'yith-plugin-fw' ),
74
+ 'menu_title' => __( 'Settings', 'yith-plugin-fw' ),
75
+ 'capability' => 'manage_options',
76
+ 'icon_url' => '',
77
+ 'position' => null
78
+ );
79
+
80
+ $this->settings = wp_parse_args( $args, $default_args );
81
+ $this->_tabs_path_files = $this->get_tabs_path_files();
82
+
83
+ if ( isset( $this->settings['create_menu_page'] ) && $this->settings['create_menu_page'] ) {
84
+ $this->add_menu_page();
85
+ }
86
+
87
+ if ( !empty( $this->settings[ 'links' ] ) ) {
88
+ $this->links = $this->settings[ 'links' ];
89
+ }
90
+
91
+ add_action( 'admin_init', array( $this, 'register_settings' ) );
92
+ add_action( 'admin_menu', array( $this, 'add_setting_page' ), 20 );
93
+ add_action( 'admin_menu', array( $this, 'add_premium_version_upgrade_to_menu' ), 100 );
94
+ add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 100 );
95
+ add_action( 'admin_init', array( $this, 'add_fields' ) );
96
+ }
97
+
98
+ /* add YIT Plugin sidebar */
99
+ $this->sidebar = YIT_Plugin_Panel_Sidebar::instance( $this );
100
+
101
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
102
+ }
103
+
104
+ /**
105
+ * Add Menu page link
106
+ *
107
+ * @return void
108
+ * @since 1.0
109
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
110
+ */
111
+ public function add_menu_page() {
112
+ global $admin_page_hooks;
113
+
114
+ if( ! isset( $admin_page_hooks['yit_plugin_panel'] ) ){
115
+ $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
116
+ add_menu_page( 'yit_plugin_panel', __( 'YITH Plugins', 'yith-plugin-fw' ), 'manage_options', 'yit_plugin_panel', NULL, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Remove duplicate submenu
122
+ *
123
+ * Submenu page hack: Remove the duplicate YIT Plugin link on subpages
124
+ *
125
+ * @return void
126
+ * @since 1.0
127
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
128
+ */
129
+ public function remove_duplicate_submenu_page() {
130
+ /* === Duplicate Items Hack === */
131
+ remove_submenu_page( 'yit_plugin_panel', 'yit_plugin_panel' );
132
+ }
133
+
134
+ /**
135
+ * Enqueue script and styles in admin side
136
+ *
137
+ * Add style and scripts to administrator
138
+ *
139
+ * @return void
140
+ * @since 1.0
141
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
142
+ */
143
+ public function admin_enqueue_scripts() {
144
+
145
+ global $wp_scripts, $pagenow;
146
+
147
+ //scripts
148
+ wp_enqueue_media();
149
+ wp_enqueue_script( 'jquery-ui' );
150
+ wp_enqueue_script( 'jquery-ui-core' );
151
+ wp_enqueue_script( 'jquery-ui-slider' );
152
+ wp_enqueue_script( 'jquery-ui-dialog' );
153
+ wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
154
+ wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.js', array( 'jquery', 'jquery-chosen' ), $this->version, true );
155
+ wp_register_script( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/codemirror.js', array( 'jquery' ), $this->version, true );
156
+ wp_register_script( 'codemirror-javascript', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/javascript.js', array( 'jquery', 'codemirror' ), $this->version, true );
157
+ wp_register_script( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/js/jquery.colorbox.js', array( 'jquery' ), '1.6.3', true );
158
+ wp_enqueue_script( 'yith_how_to', YIT_CORE_PLUGIN_URL . '/assets/js/how-to.js', array('jquery'), $this->version, true );
159
+
160
+ //styles
161
+ $jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
162
+ wp_register_style( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/css/codemirror/codemirror.css' );
163
+ wp_enqueue_style( 'jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-custom/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all' );
164
+ wp_register_style( 'yit-plugin-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel.css', array(), $this->version );
165
+ wp_enqueue_style( 'raleway-font', '//fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,100,200,300,900' );
166
+ wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
167
+ wp_enqueue_style( 'yit-jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
168
+ wp_register_style( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/css/colorbox.css', array(), $this->version );
169
+ wp_register_style( 'yit-upgrade-to-pro', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrade-to-pro.css', array( 'colorbox' ), $this->version );
170
+
171
+ if( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) || apply_filters( 'yit_plugin_panel_asset_loading', false ) ){
172
+ wp_enqueue_style( 'yit-plugin-style' );
173
+ wp_enqueue_script( 'yit-plugin-panel' );
174
+ }
175
+
176
+ if( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith_upgrade_premium_version' ) !== false ){
177
+ wp_enqueue_style( 'yit-upgrade-to-pro' );
178
+ wp_enqueue_script( 'colorbox' );
179
+ }
180
+
181
+ }
182
+
183
+ /**
184
+ * Register Settings
185
+ *
186
+ * Generate wp-admin settings pages by registering your settings and using a few callbacks to control the output
187
+ *
188
+ * @return void
189
+ * @since 1.0
190
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
191
+ */
192
+ public function register_settings() {
193
+ register_setting( 'yit_' . $this->settings['parent'] . '_options', 'yit_' . $this->settings['parent'] . '_options', array( $this, 'options_validate' ) );
194
+ }
195
+
196
+ /**
197
+ * Options Validate
198
+ *
199
+ * a callback function called by Register Settings function
200
+ *
201
+ * @param $input
202
+ *
203
+ * @return array validate input fields
204
+ * @since 1.0
205
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
206
+ */
207
+ public function options_validate( $input ) {
208
+
209
+ $current_tab = ! empty( $input['current_tab'] ) ? $input['current_tab'] : 'general';
210
+
211
+ $yit_options = $this->get_main_array_options();
212
+
213
+ // default
214
+ $valid_input = $this->get_options();
215
+
216
+ $submit = ( ! empty( $input['submit-general'] ) ? true : false );
217
+ $reset = ( ! empty( $input['reset-general'] ) ? true : false );
218
+
219
+ foreach ( $yit_options[$current_tab] as $section => $data ) {
220
+ foreach ( $data as $option ) {
221
+ if ( isset( $option['sanitize_call'] ) && isset( $option['id'] ) ) { //yiw_debug($option, false);
222
+ if ( is_array( $option['sanitize_call'] ) ) :
223
+ foreach ( $option['sanitize_call'] as $callback ) {
224
+ if ( is_array( $input[$option['id']] ) ) {
225
+ $valid_input[$option['id']] = array_map( $callback, $input[$option['id']] );
226
+ }
227
+ else {
228
+ $valid_input[$option['id']] = call_user_func( $callback, $input[$option['id']] );
229
+ }
230
+ }
231
+ else :
232
+ if ( is_array( $input[$option['id']] ) ) {
233
+ $valid_input[$option['id']] = array_map( $option['sanitize_call'], $input[$option['id']] );
234
+ }
235
+ else {
236
+ $valid_input[$option['id']] = call_user_func( $option['sanitize_call'], $input[$option['id']] );
237
+ }
238
+ endif;
239
+ }
240
+ else {
241
+ if ( isset( $option['id'] ) ) {
242
+ if ( isset( $input[$option['id']] ) ) {
243
+ $valid_input[$option['id']] = $input[$option['id']];
244
+ }
245
+ else {
246
+ $valid_input[$option['id']] = 'no';
247
+ }
248
+
249
+ }
250
+ }
251
+
252
+ }
253
+ }
254
+
255
+ return $valid_input;
256
+ }
257
+
258
+ /**
259
+ * Add Setting SubPage
260
+ *
261
+ * add Setting SubPage to wordpress administrator
262
+ *
263
+ * @return array validate input fields
264
+ * @since 1.0
265
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
266
+ */
267
+ public function add_setting_page() {
268
+ $this->settings['icon_url'] = isset( $this->settings['icon_url'] ) ? $this->settings['icon_url'] : '';
269
+ $this->settings['position'] = isset( $this->settings['position'] ) ? $this->settings['position'] : null;
270
+ $parent = $this->settings['parent_slug'] . $this->settings['parent_page'];
271
+
272
+ if ( ! empty( $parent ) ) {
273
+ add_submenu_page( $parent, $this->settings['page_title'], $this->settings['menu_title'], $this->settings['capability'], $this->settings['page'], array( $this, 'yit_panel' ) );
274
+ } else {
275
+ add_menu_page( $this->settings['page_title'], $this->settings['menu_title'], $this->settings['capability'], $this->settings['page'], array( $this, 'yit_panel' ), $this->settings['icon_url'], $this->settings['position'] );
276
+ }
277
+ /* === Duplicate Items Hack === */
278
+ $this->remove_duplicate_submenu_page();
279
+ do_action( 'yit_after_add_settings_page' );
280
+
281
+
282
+ }
283
+
284
+ /**
285
+ * Add Premium Version upgrade menu item
286
+ *
287
+ * @return void
288
+ * @since 2.9.13
289
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
290
+ */
291
+ public function add_premium_version_upgrade_to_menu(){
292
+ global $submenu;
293
+
294
+ if( apply_filters( 'yit_show_upgrade_to_premium_version', ! isset( $submenu['yit_plugin_panel']['how_to'] ) ) ){
295
+ $submenu['yit_plugin_panel']['how_to'] = array(
296
+ sprintf( '%s%s%s', '<span id="yith-how-to-premium">', __( 'How to install premium version', 'yith-plugin-fw' ), '</span>' ),
297
+ 'install_plugins',
298
+ '//support.yithemes.com/hc/en-us/articles/217840988',
299
+ __( 'How to install premium version', 'yith-plugin-fw' ),
300
+ );
301
+ }
302
+ }
303
+
304
+ /**
305
+ * Show a tabbed panel to setting page
306
+ *
307
+ * a callback function called by add_setting_page => add_submenu_page
308
+ *
309
+ * @return void
310
+ * @since 1.0
311
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
312
+ */
313
+ public function yit_panel() {
314
+
315
+ $tabs = '';
316
+ $current_tab = $this->get_current_tab();
317
+ $yit_options = $this->get_main_array_options();
318
+
319
+ // tabs
320
+ foreach ( $this->settings['admin-tabs'] as $tab => $tab_value ) {
321
+ $active_class = ( $current_tab == $tab ) ? ' nav-tab-active' : '';
322
+ $tabs .= '<a class="nav-tab' . $active_class . '" href="?' . $this->settings['parent_page'] . '&page=' . $this->settings['page'] . '&tab=' . $tab . '">' . $tab_value . '</a>';
323
+ }
324
+ ?>
325
+ <div id="icon-themes" class="icon32"><br /></div>
326
+ <h2 class="nav-tab-wrapper">
327
+ <?php echo $tabs ?>
328
+ </h2>
329
+ <?php
330
+ $custom_tab_action = $this->is_custom_tab( $yit_options, $current_tab );
331
+ $hide_sidebar = $this->hide_sidebar();
332
+ if ( $custom_tab_action ) {
333
+ $this->print_custom_tab( $custom_tab_action, $hide_sidebar );
334
+ return;
335
+ }
336
+ ?>
337
+ <?php $this->print_video_box(); ?>
338
+ <?php
339
+ $panel_content_class = !$hide_sidebar ? apply_filters( 'yit_admin_panel_content_class', 'yit-admin-panel-content-wrap' ) : 'yit-admin-panel-content-wrap-no-sidebar';
340
+ ?>
341
+ <div id="wrap" class="plugin-option yit-admin-panel-container">
342
+ <?php $this->message(); ?>
343
+ <div class="<?php echo $panel_content_class; ?>">
344
+ <h2><?php echo $this->get_tab_title() ?></h2>
345
+ <?php if ( $this->is_show_form() ) : ?>
346
+ <form method="post" action="options.php">
347
+ <?php do_settings_sections( 'yit' ); ?>
348
+ <p>&nbsp;</p>
349
+ <?php settings_fields( 'yit_' . $this->settings['parent'] . '_options' ); ?>
350
+ <input type="hidden" name="<?php echo $this->get_name_field( 'current_tab' ) ?>" value="<?php echo esc_attr( $current_tab ) ?>" />
351
+ <input type="submit" class="button-primary" value="<?php _e( 'Save Changes', 'yith-plugin-fw' ) ?>" style="float:left;margin-right:10px;" />
352
+ </form>
353
+ <form method="post">
354
+ <?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
355
+ <input type="hidden" name="yit-action" value="reset" />
356
+ <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' ) ?>');" />
357
+ </form>
358
+ <p>&nbsp;</p>
359
+ <?php endif ?>
360
+ </div>
361
+ <?php
362
+ /**
363
+ * Add panel Sidebar
364
+ */
365
+ if ( !$hide_sidebar )
366
+ $this->print_panel_sidebar();
367
+ ?>
368
+ </div>
369
+ <?php
370
+ }
371
+
372
+ public function is_custom_tab( $options, $current_tab ) {
373
+ foreach ( $options[$current_tab] as $section => $option ) {
374
+ if ( isset( $option['type'] ) && isset( $option['action'] ) && 'custom_tab' == $option['type'] && ! empty( $option['action'] ) ) {
375
+ return $option['action'];
376
+ }
377
+ else {
378
+ return false;
379
+ }
380
+ }
381
+ return false;
382
+ }
383
+
384
+ /**
385
+ * Print the panel sidebar
386
+ *
387
+ * @return void
388
+ * @since 1.0
389
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
390
+ */
391
+ public function print_panel_sidebar() {
392
+ $this->sidebar->print_panel_sidebar();
393
+ }
394
+
395
+ /**
396
+ * @param $options
397
+ * @param $current_tab
398
+ *
399
+ * @return bool
400
+ *
401
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
402
+ */
403
+ public function hide_sidebar( $options = '', $current_tab = '' ) {
404
+ if ( $options === '' )
405
+ $options = $this->get_main_array_options();
406
+ if ( $current_tab === '' )
407
+ $current_tab = $this->get_current_tab();
408
+
409
+ $hide = false;
410
+
411
+ foreach ( $options[ $current_tab ] as $section => $option ) {
412
+ if ( isset( $option[ 'hide_sidebar' ] ) ) {
413
+ $hide = !!$option[ 'hide_sidebar' ];
414
+ }
415
+ break;
416
+ }
417
+
418
+ $page = isset( $this->settings[ 'page' ] ) ? $this->settings[ 'page' ] : '';
419
+
420
+ return apply_filters( 'yit_panel_hide_sidebar', $hide, $page );
421
+ }
422
+
423
+ /**
424
+ * Fire the action to print the custom tab
425
+ *
426
+ *
427
+ * @param string $action Action to fire
428
+ * @param bool $hide_sidebar
429
+ *
430
+ * @return void
431
+ * @since 1.0
432
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
433
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
434
+ */
435
+ public function print_custom_tab( $action, $hide_sidebar = false ) {
436
+ if ( !$hide_sidebar ) {
437
+ $panel_content_class = apply_filters( 'yit_admin_panel_content_class', 'yit-admin-panel-content-wrap' ) ;
438
+ echo "<div class='yit-admin-panel-container'>";
439
+ echo "<div class='$panel_content_class'>";
440
+
441
+ do_action( $action );
442
+
443
+ echo "</div>";
444
+ $this->print_panel_sidebar();
445
+ echo "</div>";
446
+ } else {
447
+ do_action( $action );
448
+ }
449
+ }
450
+
451
+ /**
452
+ * Add sections and fields to setting panel
453
+ *
454
+ * read all options and show sections and fields
455
+ *
456
+ * @return void
457
+ * @since 1.0
458
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
459
+ */
460
+ public function add_fields() {
461
+ $yit_options = $this->get_main_array_options();
462
+ $current_tab = $this->get_current_tab();
463
+
464
+ if ( ! $current_tab ) {
465
+ return;
466
+ }
467
+ foreach ( $yit_options[$current_tab] as $section => $data ) {
468
+ add_settings_section( "yit_settings_{$current_tab}_{$section}", $this->get_section_title( $section ), $this->get_section_description( $section ), 'yit' );
469
+ foreach ( $data as $option ) {
470
+ if ( isset( $option['id'] ) && isset( $option['type'] ) && isset( $option['name'] ) ) {
471
+ add_settings_field( "yit_setting_" . $option['id'], $option['name'], array( $this, 'render_field' ), 'yit', "yit_settings_{$current_tab}_{$section}", array( 'option' => $option, 'label_for' => $this->get_id_field( $option['id'] ) ) );
472
+ }
473
+ }
474
+ }
475
+ }
476
+
477
+
478
+ /**
479
+ * Add the tabs to admin bar menu
480
+ *
481
+ * set all tabs of settings page on wp admin bar
482
+ *
483
+ * @return void|array return void when capability is false
484
+ * @since 1.0
485
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
486
+ */
487
+ public function add_admin_bar_menu() {
488
+
489
+ global $wp_admin_bar;
490
+
491
+ if ( ! current_user_can( 'manage_options' ) ) {
492
+ return;
493
+ }
494
+
495
+ if ( ! empty( $this->settings['admin_tabs'] ) ) {
496
+ foreach ( $this->settings['admin-tabs'] as $item => $title ) {
497
+
498
+ $wp_admin_bar->add_menu( array(
499
+ 'parent' => $this->settings['parent'],
500
+ 'title' => $title,
501
+ 'id' => $this->settings['parent'] . '-' . $item,
502
+ 'href' => admin_url( 'themes.php' ) . '?page=' . $this->settings['parent_page'] . '&tab=' . $item
503
+ ) );
504
+ }
505
+ }
506
+ }
507
+
508
+
509
+ /**
510
+ * Get current tab
511
+ *
512
+ * get the id of tab showed, return general is the current tab is not defined
513
+ *
514
+ * @return string
515
+ * @since 1.0
516
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
517
+ */
518
+ function get_current_tab() {
519
+ $admin_tabs = array_keys( $this->settings['admin-tabs'] );
520
+
521
+ if ( ! isset( $_GET['page'] ) || $_GET['page'] != $this->settings['page'] ) {
522
+ return false;
523
+ }
524
+ if ( isset( $_REQUEST['yit_tab_options'] ) ) {
525
+ return $_REQUEST['yit_tab_options'];
526
+ }
527
+ elseif ( isset( $_GET['tab'] ) && isset( $this->_tabs_path_files[$_GET['tab']] ) ) {
528
+ return $_GET['tab'];
529
+ }
530
+ elseif ( isset( $admin_tabs[0] ) ) {
531
+ return $admin_tabs[0];
532
+ }
533
+ else {
534
+ return 'general';
535
+ }
536
+ }
537
+
538
+
539
+ /**
540
+ * Message
541
+ *
542
+ * define an array of message and show the content od message if
543
+ * is find in the query string
544
+ *
545
+ * @return void
546
+ * @since 1.0
547
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
548
+ */
549
+ public function message() {
550
+
551
+ $message = array(
552
+ 'element_exists' => $this->get_message( '<strong>' . __( 'The element you have entered already exists. Please, enter another name.', 'yith-plugin-fw' ) . '</strong>', 'error', false ),
553
+ 'saved' => $this->get_message( '<strong>' . __( 'Settings saved', 'yith-plugin-fw' ) . '.</strong>', 'updated', false ),
554
+ 'reset' => $this->get_message( '<strong>' . __( 'Settings reset', 'yith-plugin-fw' ) . '.</strong>', 'updated', false ),
555
+ 'delete' => $this->get_message( '<strong>' . __( 'Element deleted correctly.', 'yith-plugin-fw' ) . '</strong>', 'updated', false ),
556
+ 'updated' => $this->get_message( '<strong>' . __( 'Element updated correctly.', 'yith-plugin-fw' ) . '</strong>', 'updated', false ),
557
+ 'settings-updated' => $this->get_message( '<strong>' . __( 'Element updated correctly.', 'yith-plugin-fw' ) . '</strong>', 'updated', false ),
558
+ 'imported' => $this->get_message( '<strong>' . __( 'Database imported correctly.', 'yith-plugin-fw' ) . '</strong>', 'updated', false ),
559
+ 'no-imported' => $this->get_message( '<strong>' . __( 'An error has occurred during import. Please try again.', 'yith-plugin-fw' ) . '</strong>', 'error', false ),
560
+ 'file-not-valid' => $this->get_message( '<strong>' . __( 'The added file is not valid.', 'yith-plugin-fw' ) . '</strong>', 'error', false ),
561
+ 'cant-import' => $this->get_message( '<strong>' . __( 'Sorry, import is disabled.', 'yith-plugin-fw' ) . '</strong>', 'error', false ),
562
+ 'ord' => $this->get_message( '<strong>' . __( 'Sorting successful.', 'yith-plugin-fw' ) . '</strong>', 'updated', false )
563
+ );
564
+
565
+ foreach ( $message as $key => $value ) {
566
+ if ( isset( $_GET[$key] ) ) {
567
+ echo $message[$key];
568
+ }
569
+ }
570
+
571
+ }
572
+
573
+ /**
574
+ * Get Message
575
+ *
576
+ * return html code of message
577
+ *
578
+ * @param $message
579
+ * @param string $type can be 'error' or 'updated'
580
+ * @param bool $echo
581
+ *
582
+ * @return void|string
583
+ * @since 1.0
584
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
585
+ */
586
+ public function get_message( $message, $type = 'error', $echo = true ) {
587
+ $message = '<div id="message" class="' . $type . ' fade"><p>' . $message . '</p></div>';
588
+ if ( $echo ) {
589
+ echo $message;
590
+ }
591
+ return $message;
592
+ }
593
+
594
+
595
+ /**
596
+ * Get Tab Path Files
597
+ *
598
+ * return an array with filenames of tabs
599
+ *
600
+ * @return array
601
+ * @since 1.0
602
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
603
+ */
604
+ function get_tabs_path_files() {
605
+
606
+ $option_files_path = $this->settings['options-path'] . '/';
607
+
608
+ $tabs = array();
609
+
610
+ foreach ( ( array ) glob( $option_files_path . '*.php' ) as $filename ) {
611
+ preg_match( '/(.*)-options\.(.*)/', basename( $filename ), $filename_parts );
612
+
613
+ if ( ! isset( $filename_parts[1] ) ) {
614
+ continue;
615
+ }
616
+
617
+ $tab = $filename_parts[1];
618
+
619
+ $tabs[$tab] = $filename;
620
+ }
621
+
622
+ return $tabs;
623
+ }
624
+
625
+ /**
626
+ * Get main array options
627
+ *
628
+ * return an array with all options defined on options-files
629
+ *
630
+ * @return array
631
+ * @since 1.0
632
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
633
+ */
634
+ function get_main_array_options() {
635
+ if ( ! empty( $this->_main_array_options ) ) {
636
+ return $this->_main_array_options;
637
+ }
638
+
639
+ foreach ( $this->settings['admin-tabs'] as $item => $v ) {
640
+ $path = $this->settings['options-path'] . '/' . $item . '-options.php';
641
+ if ( file_exists( $path ) ) {
642
+ $this->_main_array_options = array_merge( $this->_main_array_options, include $path );
643
+ }
644
+ }
645
+
646
+ return $this->_main_array_options;
647
+ }
648
+
649
+
650
+ /**
651
+ * Set an array with all default options
652
+ *
653
+ * put default options in an array
654
+ *
655
+ * @return array
656
+ * @since 1.0
657
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
658
+ */
659
+ public function get_default_options() {
660
+ $yit_options = $this->get_main_array_options();
661
+ $default_options = array();
662
+
663
+ foreach ( $yit_options as $tab => $sections ) {
664
+ foreach ( $sections as $section ) {
665
+ foreach ( $section as $id => $value ) {
666
+ if ( isset( $value['std'] ) && isset( $value['id'] ) ) {
667
+ $default_options[$value['id']] = $value['std'];
668
+ }
669
+ }
670
+ }
671
+ }
672
+
673
+ unset( $yit_options );
674
+ return $default_options;
675
+ }
676
+
677
+
678
+ /**
679
+ * Get the title of the tab
680
+ *
681
+ * return the title of tab
682
+ *
683
+ * @return string
684
+ * @since 1.0
685
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
686
+ */
687
+ function get_tab_title() {
688
+ $yit_options = $this->get_main_array_options();
689
+ $current_tab = $this->get_current_tab();
690
+
691
+ foreach ( $yit_options[$current_tab] as $sections => $data ) {
692
+ foreach ( $data as $option ) {
693
+ if ( isset( $option['type'] ) && $option['type'] == 'title' ) {
694
+ return $option['name'];
695
+ }
696
+ }
697
+ }
698
+ }
699
+
700
+ /**
701
+ * Get the title of the section
702
+ *
703
+ * return the title of section
704
+ *
705
+ * @param $section
706
+ *
707
+ * @return string
708
+ * @since 1.0
709
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
710
+ */
711
+ function get_section_title( $section ) {
712
+ $yit_options = $this->get_main_array_options();
713
+ $current_tab = $this->get_current_tab();
714
+
715
+ foreach ( $yit_options[$current_tab][$section] as $option ) {
716
+ if ( isset( $option['type'] ) && $option['type'] == 'section' ) {
717
+ return $option['name'];
718
+ }
719
+ }
720
+ }
721
+
722
+ /**
723
+ * Get the description of the section
724
+ *
725
+ * return the description of section if is set
726
+ *
727
+ * @param $section
728
+ *
729
+ * @return string
730
+ * @since 1.0
731
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
732
+ */
733
+ function get_section_description( $section ) {
734
+ $yit_options = $this->get_main_array_options();
735
+ $current_tab = $this->get_current_tab();
736
+
737
+ foreach ( $yit_options[$current_tab][$section] as $option ) {
738
+ if ( isset( $option['type'] ) && $option['type'] == 'section' && isset( $option['desc'] ) ) {
739
+ return '<p>' . $option['desc'] . '</p>';
740
+ }
741
+ }
742
+ }
743
+
744
+
745
+ /**
746
+ * Show form when necessary
747
+ *
748
+ * return true if 'showform' is not defined
749
+ *
750
+ * @return bool
751
+ * @since 1.0
752
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
753
+ */
754
+ function is_show_form() {
755
+ $yit_options = $this->get_main_array_options();
756
+ $current_tab = $this->get_current_tab();
757
+
758
+ foreach ( $yit_options[$current_tab] as $sections => $data ) {
759
+ foreach ( $data as $option ) {
760
+ if ( ! isset( $option['type'] ) || $option['type'] != 'title' ) {
761
+ continue;
762
+ }
763
+ if ( isset( $option['showform'] ) ) {
764
+ return $option['showform'];
765
+ }
766
+ else {
767
+ return true;
768
+ }
769
+ }
770
+ }
771
+ }
772
+
773
+ /**
774
+ * Get name field
775
+ *
776
+ * return a string with the name of the input field
777
+ *
778
+ * @param string $name
779
+ *
780
+ * @return string
781
+ * @since 1.0
782
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
783
+ */
784
+ function get_name_field( $name = '' ) {
785
+ return 'yit_' . $this->settings['parent'] . '_options[' . $name . ']';
786
+ }
787
+
788
+ /**
789
+ * Get id field
790
+ *
791
+ * return a string with the id of the input field
792
+ *
793
+ * @param string $id
794
+ *
795
+ * @return string
796
+ * @since 1.0
797
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
798
+ */
799
+ function get_id_field( $id ) {
800
+ return 'yit_' . $this->settings['parent'] . '_options_' . $id;
801
+ }
802
+
803
+
804
+ /**
805
+ * Render the field showed in the setting page
806
+ *
807
+ * include the file of the option type, if file do not exists
808
+ * return a text area
809
+ *
810
+ * @param array $param
811
+ *
812
+ * @return void
813
+ * @since 1.0
814
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
815
+ */
816
+ function render_field( $param ) {
817
+
818
+ if ( ! empty( $param ) && isset( $param ['option'] ) ) {
819
+ $option = $param ['option'];
820
+ $db_options = $this->get_options();
821
+
822
+ $custom_attributes = array();
823
+
824
+ if ( ! empty( $option['custom_attributes'] ) && is_array( $option['custom_attributes'] ) ) {
825
+ foreach ( $option['custom_attributes'] as $attribute => $attribute_value ) {
826
+ $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
827
+ }
828
+ }
829
+
830
+ $custom_attributes = implode( ' ', $custom_attributes );
831
+ $std = isset( $option['std'] ) ? $option['std'] : '';
832
+ $db_value = ( isset( $db_options[$option['id']] ) ) ? $db_options[$option['id']] : $std;
833
+
834
+ if ( isset( $option['deps'] ) ) {
835
+ $deps = $option['deps'];
836
+ }
837
+ $type = YIT_CORE_PLUGIN_PATH . '/templates/panel/types/' . $option['type'] . '.php';
838
+ if ( file_exists( $type ) ) {
839
+ include $type;
840
+ }
841
+ else {
842
+ do_action( "yit_panel_{$option['type']}", $option, $db_value, $custom_attributes );
843
+ }
844
+ }
845
+ }
846
+
847
+ /**
848
+ * Get options from db
849
+ *
850
+ * return the options from db, if the options aren't defined in the db,
851
+ * get the default options ad add the options in the db
852
+ *
853
+ * @return array
854
+ * @since 1.0
855
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
856
+ */
857
+ public function get_options() {
858
+ $options = get_option( 'yit_' . $this->settings['parent'] . '_options' );
859
+ if ( $options === false || ( isset( $_REQUEST['yit-action'] ) && $_REQUEST['yit-action'] == 'reset' ) ) {
860
+ $options = $this->get_default_options();
861
+ }
862
+ return $options;
863
+ }
864
+
865
+ /**
866
+ * Show a box panel with specific content in two columns as a new woocommerce type
867
+ *
868
+ *
869
+ * @param array $args
870
+ *
871
+ * @return void
872
+ * @since 1.0
873
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
874
+ */
875
+ public function add_infobox( $args = array() ) {
876
+ if ( ! empty( $args ) ) {
877
+ extract( $args );
878
+ require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/boxinfo.php' );
879
+ }
880
+ }
881
+
882
+ /**
883
+ * Show a box panel with specific content in two columns as a new woocommerce type
884
+ *
885
+ * @param array $args
886
+ *
887
+ * @return void
888
+ * @since 1.0
889
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
890
+ */
891
+ public function add_videobox( $args = array() ) {
892
+ if ( ! empty( $args ) ) {
893
+ extract( $args );
894
+ require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/videobox.php' );
895
+ }
896
+ }
897
+
898
+ /**
899
+ * Fire the action to print the custom tab
900
+ *
901
+ * @return void
902
+ * @since 1.0
903
+ * @author Antonino Scarfì <antonino.scarfi@yithemes.com>
904
+ */
905
+ public function print_video_box() {
906
+ $file = $this->settings['options-path'] . '/video-box.php';
907
+
908
+ if ( ! file_exists( $file ) ) {
909
+ return;
910
+ }
911
+
912
+ $args = include_once( $file );
913
+
914
+ $this->add_videobox( $args );
915
+ }
916
+ }
917
  }
plugin-fw/lib/yit-plugin-subpanel.php CHANGED
@@ -1,164 +1,164 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
16
- /**
17
- * YIT Plugin Panel
18
- *
19
- * Setting Page to Manage Plugins
20
- *
21
- * @class YIT_Plugin_Panel
22
- * @package Yithemes
23
- * @since 1.0
24
- * @author Your Inspiration Themes
25
- */
26
-
27
- class YIT_Plugin_SubPanel extends YIT_Plugin_Panel {
28
-
29
- /**
30
- * @var string version of class
31
- */
32
- public $version = '1.0.0';
33
-
34
- /**
35
- * @var array a setting list of parameters
36
- */
37
- public $settings = array();
38
-
39
-
40
- /**
41
- * @var array
42
- */
43
- private $_main_array_options = array();
44
-
45
- /**
46
- * Constructor
47
- *
48
- * @since 1.0
49
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
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' ) );
60
- add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_menu' ), 100 );
61
- add_action( 'admin_init', array( &$this, 'add_fields' ) );
62
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
63
- }
64
- }
65
-
66
-
67
- /**
68
- * Register Settings
69
- *
70
- * Generate wp-admin settings pages by registering your settings and using a few callbacks to control the output
71
- *
72
- * @return void
73
- * @since 1.0
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
- *
85
- * add Setting SubPage to wordpress administrator
86
- *
87
- * @return array validate input fields
88
- * @since 1.0
89
- * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
90
- */
91
- public function add_setting_page() {
92
- global $admin_page_hooks;
93
- $logo = YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png';
94
-
95
- $admin_logo = function_exists( 'yit_get_option' ) ? yit_get_option( 'admin-logo-menu' ) : '';
96
-
97
- if ( isset( $admin_logo ) && !empty( $admin_logo ) && $admin_logo != '' && $admin_logo ) {
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', __( 'YIT Plugins', 'yith-plugin-fw' ), '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
- }
110
-
111
- /**
112
- * Show a tabbed panel to setting page
113
- *
114
- * a callback function called by add_setting_page => add_submenu_page
115
- *
116
- * @return void
117
- * @since 1.0
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
- }
164
-
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
16
+ /**
17
+ * YIT Plugin Panel
18
+ *
19
+ * Setting Page to Manage Plugins
20
+ *
21
+ * @class YIT_Plugin_Panel
22
+ * @package Yithemes
23
+ * @since 1.0
24
+ * @author Your Inspiration Themes
25
+ */
26
+
27
+ class YIT_Plugin_SubPanel extends YIT_Plugin_Panel {
28
+
29
+ /**
30
+ * @var string version of class
31
+ */
32
+ public $version = '1.0.0';
33
+
34
+ /**
35
+ * @var array a setting list of parameters
36
+ */
37
+ public $settings = array();
38
+
39
+
40
+ /**
41
+ * @var array
42
+ */
43
+ private $_main_array_options = array();
44
+
45
+ /**
46
+ * Constructor
47
+ *
48
+ * @since 1.0
49
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
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' ) );
60
+ add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_menu' ), 100 );
61
+ add_action( 'admin_init', array( &$this, 'add_fields' ) );
62
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
63
+ }
64
+ }
65
+
66
+
67
+ /**
68
+ * Register Settings
69
+ *
70
+ * Generate wp-admin settings pages by registering your settings and using a few callbacks to control the output
71
+ *
72
+ * @return void
73
+ * @since 1.0
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
+ *
85
+ * add Setting SubPage to wordpress administrator
86
+ *
87
+ * @return array validate input fields
88
+ * @since 1.0
89
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
90
+ */
91
+ public function add_setting_page() {
92
+ global $admin_page_hooks;
93
+ $logo = YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png';
94
+
95
+ $admin_logo = function_exists( 'yit_get_option' ) ? yit_get_option( 'admin-logo-menu' ) : '';
96
+
97
+ if ( isset( $admin_logo ) && !empty( $admin_logo ) && $admin_logo != '' && $admin_logo ) {
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
+ }
110
+
111
+ /**
112
+ * Show a tabbed panel to setting page
113
+ *
114
+ * a callback function called by add_setting_page => add_submenu_page
115
+ *
116
+ * @return void
117
+ * @since 1.0
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
+ }
164
+
plugin-fw/lib/yit-pointers.php CHANGED
@@ -1,390 +1,390 @@
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
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- /**
15
- *
16
- *
17
- * @class yit-pointers
18
- * @package Yithemes
19
- * @since Version 2.0.0
20
- * @author Your Inspiration Themes
21
- *
22
- */
23
- if ( ! class_exists( 'YIT_Pointers' ) ) {
24
- /**
25
- * YIT Pointers
26
- *
27
- * Initializes the new feature pointers.
28
- *
29
- * @class YIT_Pointers
30
- * @package Yithemes
31
- * @since 1.0
32
- * @author Your Inspiration Themes
33
- * @see WP_Internal_Pointers
34
- */
35
- class YIT_Pointers {
36
-
37
- /**
38
- * @var YIT_Upgrade The main instance
39
- */
40
- protected static $_instance;
41
-
42
- /**
43
- * @var screen id where to show pointer
44
- */
45
- public $screen_ids = array();
46
-
47
- public $pointers = array();
48
-
49
- public $special_screen = array();
50
-
51
- protected $_plugins_registered = array();
52
-
53
- protected $_default_pointer = array();
54
-
55
- protected $_default_position = array( 'edge' => 'left', 'align' => 'center' );
56
-
57
- /**
58
- * Construct
59
- *
60
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
61
- * @since 1.0
62
- */
63
- public function __construct() {
64
-
65
- $this->_default_pointer['plugins'] = array(
66
- 'screen_id' => 'plugins',
67
- 'options' => array(
68
- 'content' => sprintf( '<h3> %s </h3> <p> %s </p> <p> %s <a href="http://yithemes.com/product-category/plugins/" target="_blank">Yithemes.com</a> %s
69
- <a href="https://profiles.wordpress.org/yithemes/" target="_blank">Wordpress.org</a></p>',
70
- __( 'Plugins Activated', 'yith-plugin-fw' ),
71
- __( 'From now on, you can find all plugin options in YIT Plugin menu.
72
- For each plugin installed, customization settings will be available as a new entry in YIT Plugin menu.', 'yith-plugin-fw' ),
73
- __( 'Discover all our plugins available on:', 'yith-plugin-fw' ),
74
- __( 'and', 'yith-plugin-fw' )
75
- ),
76
- ),
77
- );
78
-
79
- $this->_default_pointer['update'] = array(
80
- 'screen_id' => 'update',
81
- 'options' => array(
82
- 'content' => sprintf( '<h3> %s </h3> <p> %s </p> <p> %s <a href="http://yithemes.com/product-category/plugins/" target="_blank">Yithemes.com</a> %s
83
- <a href="https://profiles.wordpress.org/yithemes/" target="_blank">Wordpress.org</a></p>',
84
- __( 'Plugins Upgraded', 'yith-plugin-fw' ),
85
- __( 'From now on, you can find all options of your plugins in YIT Plugin menu.
86
- Any time one of our plugins is updated, a new entry will be added to this menu.
87
- For example, after the update, plugin options (such as for YITH WooCommerce Wishlist, YITH WooCommerce Ajax Search, etc.)
88
- will be moved from previous location to YIT Plugin tab.', 'yith-plugin-fw' ),
89
- __( 'Discover all our plugins available on:', 'yith-plugin-fw' ),
90
- __( 'and', 'yith-plugin-fw' )
91
- ),
92
- ),
93
- );
94
-
95
- $this->_default_pointer = $this->parse_args( $this->_default_pointer );
96
-
97
- /**
98
- * Screens that require a particular action
99
- */
100
- $this->special_screen = apply_filters( 'yit-pointer-special-screen', array( 'plugins', 'update' ) );
101
-
102
- add_action( 'admin_enqueue_scripts', array( $this, 'pointer_load' ) );
103
- add_action( 'admin_init', array( $this, 'add_pointers' ), 100 );
104
- }
105
-
106
- public function parse_args( $args ) {
107
- $default = array(
108
- 'pointer_id' => 'yith_default_pointer',
109
- 'target' => '#toplevel_page_yit_plugin_panel',
110
- 'init' => null
111
- );
112
-
113
- foreach ( $args as $id => $pointer ) {
114
- $args[ $id ] = wp_parse_args( $pointer, $default );
115
- $args[ $id ]['options']['position'] = $this->_default_position;
116
- }
117
-
118
- return $args;
119
- }
120
-
121
- public function add_pointers(){
122
- if( ! empty( $this->screen_ids ) ){
123
- foreach( $this->screen_ids as $screen_id ){
124
- add_filter( "yit_pointers-{$screen_id}", array( $this, 'pointers' ) );
125
- }
126
- }
127
- }
128
-
129
- /**
130
- * Main plugin Instance
131
- *
132
- * @static
133
- * @return object Main instance
134
- *
135
- * @since 1.0
136
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
137
- */
138
- public static function instance() {
139
- if ( is_null( self::$_instance ) ) {
140
- self::$_instance = new self();
141
- }
142
-
143
- return self::$_instance;
144
- }
145
-
146
- public function register( $args ) {
147
-
148
- foreach ( $args as $id => $pointer ) {
149
-
150
- extract( $pointer );
151
-
152
- if ( ! isset( $screen_id ) && ! empty( $screen_id ) && ! isset( $init ) && ! empty( $init ) ) {
153
- return;
154
- }
155
-
156
- if ( ! in_array( $screen_id, $this->screen_ids ) ) {
157
- $this->screen_ids[] = $screen_id;
158
- }
159
-
160
- $this->pointers[$screen_id][$pointer_id] = array(
161
- 'target' => $target,
162
- 'options' => array(
163
- 'content' => $content,
164
- 'position' => $position,
165
- ),
166
- 'init' => isset( $init ) ? $init : false
167
- );
168
- }
169
- }
170
-
171
- public function get_plugins_init( $screen_id ) {
172
-
173
- $registered = array();
174
-
175
- foreach( $this->pointers[ $screen_id ] as $pointer_id => $pointer ){
176
- $registered[ $pointer['init'] ] = $pointer_id;
177
- }
178
-
179
- return $registered;
180
- }
181
-
182
- public function pointer_load( $hook_suffix ) {
183
-
184
- /**
185
- * Get pointers for this screen
186
- */
187
- $screen = get_current_screen();
188
- $pointers = apply_filters( "yit_pointers-{$screen->id}", array() );
189
-
190
- if ( ! $pointers || ! is_array( $pointers ) ) {
191
- return;
192
- }
193
-
194
- /**
195
- * Get dismissed pointers
196
- */
197
- $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
198
- $valid_pointers = array();
199
- //$point_id = null;
200
-
201
- /**
202
- * show pointers only on plugin activate action
203
- */
204
- if( in_array( $screen->id, $this->special_screen ) ){
205
-
206
- $show = false;
207
- $registered = $this->get_plugins_init( $screen->id );
208
- $recently_activate = get_option( 'yit_recently_activated', array() );
209
-
210
- /**
211
- * For "plugins" screen
212
- */
213
- $is_single_activate = ( isset( $_GET['activate'] ) && 'true' == $_GET['activate'] ) ? true : false;
214
- $is_multi_activate = ( isset( $_GET['activate-multi'] ) && 'true' == $_GET['activate-multi'] ) ? true : false;
215
-
216
- /**
217
- * For "update" screen
218
- *
219
- * Single plugin update use GET method
220
- *
221
- * Multi update plugins with bulk action send two post args called "action" and "action2"
222
- * action refer to first bulk action button (at the top of plugins table)
223
- * action2 refer to last bulk action button (at the bottom of plugins table)
224
- *
225
- */
226
- $is_single_upgrade = ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) ? true : false;
227
- $is_multi_upgrade = ( isset( $_POST['action'] ) && 'update-selected' == $_POST['action'] ) || ( isset( $_POST['action2'] ) && 'update-selected' == $_POST['action2'] ) ? true: false;
228
-
229
- if( $is_single_activate || $is_single_upgrade ){
230
-
231
- $point_id = '';
232
-
233
- /**
234
- * Single activation plugin
235
- * Single update plugin
236
- */
237
- foreach( $registered as $init => $p_id ){
238
- if ( in_array( $init, $recently_activate ) ) {
239
- $point_id = $p_id;
240
- $pointer = $pointers[ $point_id ];
241
-
242
- /**
243
- * Sanity check
244
- */
245
- if ( ! ( in_array( $point_id, $dismissed ) || empty( $pointer ) || empty( $point_id ) || empty( $pointer['target'] ) || empty( $pointer['options'] ) ) ) {
246
- /**
247
- * Add the pointer to $valid_pointers array
248
- */
249
- $pointer['pointer_id'] = $point_id;
250
- $valid_pointers['pointers'][] = $pointer;
251
- $show = true;
252
- }
253
- break;
254
- }
255
- }
256
- } else if( $is_multi_activate || $is_multi_upgrade ){
257
-
258
- /**
259
- * Bulk Action: multi plugins activation
260
- * Bulk Action: multi plugins update
261
- */
262
- $point_id = array();
263
- $screen_id = $screen->id;
264
-
265
- if( $is_multi_upgrade && isset( $_POST['checked'] ) && ( count( $_POST['checked'] ) > 0 ) ){
266
- $recently_activate = $_POST['checked'];
267
- $screen_id = 'update';
268
- $pointers = apply_filters( "yit_pointers-{$screen_id}", array() );
269
- }
270
-
271
- foreach ( $registered as $init => $p_id ) {
272
- if ( in_array( $init, $recently_activate ) ) {
273
- $point_id[] = $p_id;
274
- }
275
- }
276
-
277
- /**
278
- * Bulk Action: Activate Plugins
279
- *
280
- * count( $point_id ) is the number of YITH plugins that have registered specific pointers
281
- * case 0 -> No pointers -> Exit
282
- * case 1 -> Only one pointers to show -> Use the specific plugin pointer
283
- * defautl -> Two or more plugins need to show a pointer -> use a generic pointers
284
- *
285
- */
286
- switch ( count( $point_id ) ) {
287
- case 0:
288
- $show = false;
289
- break;
290
-
291
- case 1:
292
- $point_id = array_pop( $point_id );
293
- $pointer = $pointers[$point_id];
294
- /**
295
- * Sanity check
296
- */
297
- if ( ! ( in_array( $point_id, $dismissed ) || empty( $pointer ) || empty( $point_id ) || empty( $pointer['target'] ) || empty( $pointer['options'] ) ) ) {
298
- /**
299
- * Add the pointer to $valid_pointers array
300
- */
301
- $pointer['pointer_id'] = $point_id;
302
- $valid_pointers['pointers'][] = $pointer;
303
- $show = true;
304
- }
305
- break;
306
-
307
- default:
308
- $valid_pointers['pointers'][] = $this->_default_pointer[ $screen_id ];
309
- $show = true;
310
- break;
311
- }
312
- }
313
-
314
- update_option( 'yit_recently_activated', array() );
315
-
316
- if( ! $show ){
317
- return;
318
- }
319
-
320
- } else {
321
- /**
322
- * Check pointers and remove dismissed ones.
323
- */
324
- foreach ( $pointers as $pointer_id => $pointer ) {
325
-
326
- /**
327
- * Sanity check
328
- */
329
- if ( in_array( $pointer_id, $dismissed ) || empty( $pointer ) || empty( $pointer_id ) || empty( $pointer['target'] ) || empty( $pointer['options'] ) ) {
330
- continue;
331
- }
332
-
333
- $pointer['pointer_id'] = $pointer_id;
334
-
335
- /**
336
- * Add the pointer to $valid_pointers array
337
- */
338
- $valid_pointers['pointers'][] = $pointer;
339
- }
340
- }
341
-
342
- /**
343
- * No valid pointers? Stop here.
344
- */
345
- if ( empty( $valid_pointers ) ) {
346
- return;
347
- }
348
-
349
- $script_file = function_exists( 'yit_load_js_file' ) ? yit_load_js_file( 'yit-wp-pointer.js' ) : 'yit-wp-pointer.min.js';
350
-
351
- /**
352
- * Enqueue wp-pointer script and style
353
- */
354
- wp_enqueue_style( 'wp-pointer' );
355
- wp_enqueue_script( 'wp-pointer' );
356
-
357
- wp_enqueue_script( 'yit-wp-pointer', YIT_CORE_PLUGIN_URL . '/assets/js/' . $script_file, array( 'wp-pointer' ), false, true );
358
- wp_localize_script( 'yit-wp-pointer', 'custom_pointer', $valid_pointers );
359
- }
360
-
361
- public function pointers( $pointers ){
362
- $screen_id = str_replace( 'yit_pointers-', '', current_filter() );
363
- $pointers_to_add = $this->get_pointers( $screen_id );
364
-
365
- return ! empty( $pointers_to_add ) ? array_merge( $pointers, $pointers_to_add ) : $pointers;
366
- }
367
-
368
- public function get_pointers( $screen_id ){
369
- return isset( $this->pointers[ $screen_id ] ) ? $this->pointers[ $screen_id ] : array();
370
- }
371
- }
372
- }
373
-
374
- if ( ! function_exists( 'YIT_Pointers' ) ) {
375
- /**
376
- * Main instance of plugin
377
- *
378
- * @return object YIT_Pointers
379
- * @since 1.0
380
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
381
- */
382
- function YIT_Pointers() {
383
- return YIT_Pointers::instance();
384
- }
385
- }
386
-
387
- /**
388
- * Instance a YIT_Pointers object
389
- */
390
  YIT_Pointers();
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
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ /**
15
+ *
16
+ *
17
+ * @class yit-pointers
18
+ * @package Yithemes
19
+ * @since Version 2.0.0
20
+ * @author Your Inspiration Themes
21
+ *
22
+ */
23
+ if ( ! class_exists( 'YIT_Pointers' ) ) {
24
+ /**
25
+ * YIT Pointers
26
+ *
27
+ * Initializes the new feature pointers.
28
+ *
29
+ * @class YIT_Pointers
30
+ * @package Yithemes
31
+ * @since 1.0
32
+ * @author Your Inspiration Themes
33
+ * @see WP_Internal_Pointers
34
+ */
35
+ class YIT_Pointers {
36
+
37
+ /**
38
+ * @var YIT_Upgrade The main instance
39
+ */
40
+ protected static $_instance;
41
+
42
+ /**
43
+ * @var screen id where to show pointer
44
+ */
45
+ public $screen_ids = array();
46
+
47
+ public $pointers = array();
48
+
49
+ public $special_screen = array();
50
+
51
+ protected $_plugins_registered = array();
52
+
53
+ protected $_default_pointer = array();
54
+
55
+ protected $_default_position = array( 'edge' => 'left', 'align' => 'center' );
56
+
57
+ /**
58
+ * Construct
59
+ *
60
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
61
+ * @since 1.0
62
+ */
63
+ public function __construct() {
64
+
65
+ $this->_default_pointer['plugins'] = array(
66
+ 'screen_id' => 'plugins',
67
+ 'options' => array(
68
+ 'content' => sprintf( '<h3> %s </h3> <p> %s </p> <p> %s <a href="http://yithemes.com/product-category/plugins/" target="_blank">Yithemes.com</a> %s
69
+ <a href="https://profiles.wordpress.org/yithemes/" target="_blank">Wordpress.org</a></p>',
70
+ __( 'Plugins Activated', 'yith-plugin-fw' ),
71
+ __( 'From now on, you can find all plugin options in YIT Plugin menu.
72
+ For each plugin installed, customization settings will be available as a new entry in YIT Plugin menu.', 'yith-plugin-fw' ),
73
+ __( 'Discover all our plugins available on:', 'yith-plugin-fw' ),
74
+ __( 'and', 'yith-plugin-fw' )
75
+ ),
76
+ ),
77
+ );
78
+
79
+ $this->_default_pointer['update'] = array(
80
+ 'screen_id' => 'update',
81
+ 'options' => array(
82
+ 'content' => sprintf( '<h3> %s </h3> <p> %s </p> <p> %s <a href="http://yithemes.com/product-category/plugins/" target="_blank">Yithemes.com</a> %s
83
+ <a href="https://profiles.wordpress.org/yithemes/" target="_blank">Wordpress.org</a></p>',
84
+ __( 'Plugins Upgraded', 'yith-plugin-fw' ),
85
+ __( 'From now on, you can find all options of your plugins in YIT Plugin menu.
86
+ Any time one of our plugins is updated, a new entry will be added to this menu.
87
+ For example, after the update, plugin options (such as for YITH WooCommerce Wishlist, YITH WooCommerce Ajax Search, etc.)
88
+ will be moved from previous location to YIT Plugin tab.', 'yith-plugin-fw' ),
89
+ __( 'Discover all our plugins available on:', 'yith-plugin-fw' ),
90
+ __( 'and', 'yith-plugin-fw' )
91
+ ),
92
+ ),
93
+ );
94
+
95
+ $this->_default_pointer = $this->parse_args( $this->_default_pointer );
96
+
97
+ /**
98
+ * Screens that require a particular action
99
+ */
100
+ $this->special_screen = apply_filters( 'yit-pointer-special-screen', array( 'plugins', 'update' ) );
101
+
102
+ add_action( 'admin_enqueue_scripts', array( $this, 'pointer_load' ) );
103
+ add_action( 'admin_init', array( $this, 'add_pointers' ), 100 );
104
+ }
105
+
106
+ public function parse_args( $args ) {
107
+ $default = array(
108
+ 'pointer_id' => 'yith_default_pointer',
109
+ 'target' => '#toplevel_page_yit_plugin_panel',
110
+ 'init' => null
111
+ );
112
+
113
+ foreach ( $args as $id => $pointer ) {
114
+ $args[ $id ] = wp_parse_args( $pointer, $default );
115
+ $args[ $id ]['options']['position'] = $this->_default_position;
116
+ }
117
+
118
+ return $args;
119
+ }
120
+
121
+ public function add_pointers(){
122
+ if( ! empty( $this->screen_ids ) ){
123
+ foreach( $this->screen_ids as $screen_id ){
124
+ add_filter( "yit_pointers-{$screen_id}", array( $this, 'pointers' ) );
125
+ }
126
+ }
127
+ }
128
+
129
+ /**
130
+ * Main plugin Instance
131
+ *
132
+ * @static
133
+ * @return object Main instance
134
+ *
135
+ * @since 1.0
136
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
137
+ */
138
+ public static function instance() {
139
+ if ( is_null( self::$_instance ) ) {
140
+ self::$_instance = new self();
141
+ }
142
+
143
+ return self::$_instance;
144
+ }
145
+
146
+ public function register( $args ) {
147
+
148
+ foreach ( $args as $id => $pointer ) {
149
+
150
+ extract( $pointer );
151
+
152
+ if ( ! isset( $screen_id ) && ! empty( $screen_id ) && ! isset( $init ) && ! empty( $init ) ) {
153
+ return;
154
+ }
155
+
156
+ if ( ! in_array( $screen_id, $this->screen_ids ) ) {
157
+ $this->screen_ids[] = $screen_id;
158
+ }
159
+
160
+ $this->pointers[$screen_id][$pointer_id] = array(
161
+ 'target' => $target,
162
+ 'options' => array(
163
+ 'content' => $content,
164
+ 'position' => $position,
165
+ ),
166
+ 'init' => isset( $init ) ? $init : false
167
+ );
168
+ }
169
+ }
170
+
171
+ public function get_plugins_init( $screen_id ) {
172
+
173
+ $registered = array();
174
+
175
+ foreach( $this->pointers[ $screen_id ] as $pointer_id => $pointer ){
176
+ $registered[ $pointer['init'] ] = $pointer_id;
177
+ }
178
+
179
+ return $registered;
180
+ }
181
+
182
+ public function pointer_load( $hook_suffix ) {
183
+
184
+ /**
185
+ * Get pointers for this screen
186
+ */
187
+ $screen = get_current_screen();
188
+ $pointers = apply_filters( "yit_pointers-{$screen->id}", array() );
189
+
190
+ if ( ! $pointers || ! is_array( $pointers ) ) {
191
+ return;
192
+ }
193
+
194
+ /**
195
+ * Get dismissed pointers
196
+ */
197
+ $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
198
+ $valid_pointers = array();
199
+ //$point_id = null;
200
+
201
+ /**
202
+ * show pointers only on plugin activate action
203
+ */
204
+ if( in_array( $screen->id, $this->special_screen ) ){
205
+
206
+ $show = false;
207
+ $registered = $this->get_plugins_init( $screen->id );
208
+ $recently_activate = get_option( 'yit_recently_activated', array() );
209
+
210
+ /**
211
+ * For "plugins" screen
212
+ */
213
+ $is_single_activate = ( isset( $_GET['activate'] ) && 'true' == $_GET['activate'] ) ? true : false;
214
+ $is_multi_activate = ( isset( $_GET['activate-multi'] ) && 'true' == $_GET['activate-multi'] ) ? true : false;
215
+
216
+ /**
217
+ * For "update" screen
218
+ *
219
+ * Single plugin update use GET method
220
+ *
221
+ * Multi update plugins with bulk action send two post args called "action" and "action2"
222
+ * action refer to first bulk action button (at the top of plugins table)
223
+ * action2 refer to last bulk action button (at the bottom of plugins table)
224
+ *
225
+ */
226
+ $is_single_upgrade = ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) ? true : false;
227
+ $is_multi_upgrade = ( isset( $_POST['action'] ) && 'update-selected' == $_POST['action'] ) || ( isset( $_POST['action2'] ) && 'update-selected' == $_POST['action2'] ) ? true: false;
228
+
229
+ if( $is_single_activate || $is_single_upgrade ){
230
+
231
+ $point_id = '';
232
+
233
+ /**
234
+ * Single activation plugin
235
+ * Single update plugin
236
+ */
237
+ foreach( $registered as $init => $p_id ){
238
+ if ( in_array( $init, $recently_activate ) ) {
239
+ $point_id = $p_id;
240
+ $pointer = $pointers[ $point_id ];
241
+
242
+ /**
243
+ * Sanity check
244
+ */
245
+ if ( ! ( in_array( $point_id, $dismissed ) || empty( $pointer ) || empty( $point_id ) || empty( $pointer['target'] ) || empty( $pointer['options'] ) ) ) {
246
+ /**
247
+ * Add the pointer to $valid_pointers array
248
+ */
249
+ $pointer['pointer_id'] = $point_id;
250
+ $valid_pointers['pointers'][] = $pointer;
251
+ $show = true;
252
+ }
253
+ break;
254
+ }
255
+ }
256
+ } else if( $is_multi_activate || $is_multi_upgrade ){
257
+
258
+ /**
259
+ * Bulk Action: multi plugins activation
260
+ * Bulk Action: multi plugins update
261
+ */
262
+ $point_id = array();
263
+ $screen_id = $screen->id;
264
+
265
+ if( $is_multi_upgrade && isset( $_POST['checked'] ) && ( count( $_POST['checked'] ) > 0 ) ){
266
+ $recently_activate = $_POST['checked'];
267
+ $screen_id = 'update';
268
+ $pointers = apply_filters( "yit_pointers-{$screen_id}", array() );
269
+ }
270
+
271
+ foreach ( $registered as $init => $p_id ) {
272
+ if ( in_array( $init, $recently_activate ) ) {
273
+ $point_id[] = $p_id;
274
+ }
275
+ }
276
+
277
+ /**
278
+ * Bulk Action: Activate Plugins
279
+ *
280
+ * count( $point_id ) is the number of YITH plugins that have registered specific pointers
281
+ * case 0 -> No pointers -> Exit
282
+ * case 1 -> Only one pointers to show -> Use the specific plugin pointer
283
+ * defautl -> Two or more plugins need to show a pointer -> use a generic pointers
284
+ *
285
+ */
286
+ switch ( count( $point_id ) ) {
287
+ case 0:
288
+ $show = false;
289
+ break;
290
+
291
+ case 1:
292
+ $point_id = array_pop( $point_id );
293
+ $pointer = $pointers[$point_id];
294
+ /**
295
+ * Sanity check
296
+ */
297
+ if ( ! ( in_array( $point_id, $dismissed ) || empty( $pointer ) || empty( $point_id ) || empty( $pointer['target'] ) || empty( $pointer['options'] ) ) ) {
298
+ /**
299
+ * Add the pointer to $valid_pointers array
300
+ */
301
+ $pointer['pointer_id'] = $point_id;
302
+ $valid_pointers['pointers'][] = $pointer;
303
+ $show = true;
304
+ }
305
+ break;
306
+
307
+ default:
308
+ $valid_pointers['pointers'][] = $this->_default_pointer[ $screen_id ];
309
+ $show = true;
310
+ break;
311
+ }
312
+ }
313
+
314
+ update_option( 'yit_recently_activated', array() );
315
+
316
+ if( ! $show ){
317
+ return;
318
+ }
319
+
320
+ } else {
321
+ /**
322
+ * Check pointers and remove dismissed ones.
323
+ */
324
+ foreach ( $pointers as $pointer_id => $pointer ) {
325
+
326
+ /**
327
+ * Sanity check
328
+ */
329
+ if ( in_array( $pointer_id, $dismissed ) || empty( $pointer ) || empty( $pointer_id ) || empty( $pointer['target'] ) || empty( $pointer['options'] ) ) {
330
+ continue;
331
+ }
332
+
333
+ $pointer['pointer_id'] = $pointer_id;
334
+
335
+ /**
336
+ * Add the pointer to $valid_pointers array
337
+ */
338
+ $valid_pointers['pointers'][] = $pointer;
339
+ }
340
+ }
341
+
342
+ /**
343
+ * No valid pointers? Stop here.
344
+ */
345
+ if ( empty( $valid_pointers ) ) {
346
+ return;
347
+ }
348
+
349
+ $script_file = function_exists( 'yit_load_js_file' ) ? yit_load_js_file( 'yit-wp-pointer.js' ) : 'yit-wp-pointer.min.js';
350
+
351
+ /**
352
+ * Enqueue wp-pointer script and style
353
+ */
354
+ wp_enqueue_style( 'wp-pointer' );
355
+ wp_enqueue_script( 'wp-pointer' );
356
+
357
+ wp_enqueue_script( 'yit-wp-pointer', YIT_CORE_PLUGIN_URL . '/assets/js/' . $script_file, array( 'wp-pointer' ), false, true );
358
+ wp_localize_script( 'yit-wp-pointer', 'custom_pointer', $valid_pointers );
359
+ }
360
+
361
+ public function pointers( $pointers ){
362
+ $screen_id = str_replace( 'yit_pointers-', '', current_filter() );
363
+ $pointers_to_add = $this->get_pointers( $screen_id );
364
+
365
+ return ! empty( $pointers_to_add ) ? array_merge( $pointers, $pointers_to_add ) : $pointers;
366
+ }
367
+
368
+ public function get_pointers( $screen_id ){
369
+ return isset( $this->pointers[ $screen_id ] ) ? $this->pointers[ $screen_id ] : array();
370
+ }
371
+ }
372
+ }
373
+
374
+ if ( ! function_exists( 'YIT_Pointers' ) ) {
375
+ /**
376
+ * Main instance of plugin
377
+ *
378
+ * @return object YIT_Pointers
379
+ * @since 1.0
380
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
381
+ */
382
+ function YIT_Pointers() {
383
+ return YIT_Pointers::instance();
384
+ }
385
+ }
386
+
387
+ /**
388
+ * Instance a YIT_Pointers object
389
+ */
390
  YIT_Pointers();
plugin-fw/lib/yit-upgrade.php CHANGED
@@ -1,547 +1,562 @@
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
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YIT_Upgrade' ) ) {
15
- /**
16
- * YIT Upgrade
17
- *
18
- * Notify and Update plugin
19
- *
20
- * @class YIT_Upgrade
21
- * @package Yithemes
22
- * @since 1.0
23
- * @author Your Inspiration Themes
24
- * @see WP_Updater Class
25
- */
26
-
27
- class YIT_Upgrade {
28
-
29
- /**
30
- * @var string XML notifier update
31
- */
32
- protected $_xml = 'http://update.yithemes.com/plugins/%plugin_slug%.xml';
33
-
34
- /**
35
- * @var string api server url
36
- */
37
- protected $_package_url = 'http://www.yithemes.com';
38
-
39
- /**
40
- * @var array The registered plugins
41
- */
42
- protected $_plugins = array();
43
-
44
- /**
45
- * @var YIT_Upgrade The main instance
46
- */
47
- protected static $_instance;
48
-
49
- /**
50
- * Construct
51
- *
52
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
53
- * @since 1.0
54
- */
55
- public function __construct() {
56
- add_filter( 'upgrader_pre_download', array( $this, 'upgrader_pre_download') , 10, 3 );
57
- add_action( 'update-custom_upgrade-plugin-multisite', array( $this, 'upgrade_plugin_multisite' ) );
58
-
59
- if( is_network_admin() ){
60
- add_action( 'admin_enqueue_scripts', array( $this, 'network_admin_enqueue_scripts' ) );
61
- }
62
-
63
- $is_debug_enabled = defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG;
64
- if ( $is_debug_enabled ) {
65
- $this->_package_url = defined( 'YIT_LICENCE_DEBUG_LOCALHOST' ) ? YIT_LICENCE_DEBUG_LOCALHOST : 'http://dev.yithemes.com';
66
- add_filter( 'block_local_requests', '__return_false' );
67
- }
68
- }
69
-
70
- /**
71
- * Main plugin Instance
72
- *
73
- * @param $plugin_slug | string The plugin slug
74
- * @param $plugin_init | string The plugin init file
75
- *
76
- * @return void
77
- *
78
- * @since 1.0
79
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
80
- */
81
- public function register( $plugin_slug, $plugin_init ) {
82
-
83
- if( ! function_exists( 'get_plugins' ) ){
84
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
85
- }
86
-
87
- $plugins = get_plugins();
88
- $plugin_info = $plugins[ $plugin_init ];
89
-
90
- $this->_plugins[ $plugin_init ] = array(
91
- 'info' => $plugin_info,
92
- 'slug' => $plugin_slug,
93
- );
94
-
95
- /* === HOOKS === */
96
- if( ! is_multisite() || is_plugin_active_for_network( $plugin_init ) ){
97
- add_action( 'admin_init', array( $this, 'remove_wp_plugin_update_row' ), 15 );
98
- add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
99
- } else if( is_multisite() && current_user_can( 'update_plugins' ) ) {
100
- $xml = str_replace( '%plugin_slug%', $plugin_slug, $this->_xml );
101
- $remote_xml = wp_remote_get( $xml );
102
-
103
- if( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
104
- $plugin_remote_info = new SimpleXmlElement( $remote_xml['body'] );
105
- $this->_plugins[ $plugin_init ]['info']['Latest'] = (string) $plugin_remote_info->latest;
106
- $this->_plugins[ $plugin_init ]['info']['changelog'] = (string) $plugin_remote_info->changelog;
107
- add_action( 'admin_enqueue_scripts', array( $this, 'multisite_updater_script' ) );
108
- }
109
- }
110
- }
111
-
112
- /**
113
- * Add the multisite updater scripts
114
- *
115
- * @return void
116
- *
117
- * @since 1.0
118
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
119
- */
120
- public function multisite_updater_script(){
121
-
122
- $update_url = array();
123
- $changelogs = array();
124
- $strings = array(
125
- 'new_version' => __( 'There is a new version of %plugin_name% available.', 'yith-plugin-fw' ),
126
- 'latest' => __( 'View version %latest% details.', 'yith-plugin-fw' ),
127
- 'unavailable' => __( 'Automatic update is unavailable for this plugin,', 'yith-plugin-fw' ),
128
- 'activate' => __( 'please <a href="%activate_link%">activate</a> your copy of %plugin_name%.', 'yith-plugin-fw' ),
129
- 'update_now' => __( 'Update now.', 'yith-plugin-fw' )
130
-
131
- );
132
-
133
- foreach( $this->_plugins as $init => $info ){
134
- YIT_Plugin_Licence()->check( $init, false );
135
-
136
- $update_url[ $init ] = wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin-multisite&plugin=') . $init, 'upgrade-plugin-multisite_' . $init );
137
- $changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
138
- $details_url[ $init ] = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ) , '' ) );
139
- $plugin_changelog = isset( $this->_plugins[ $init ]['info']['changelog'] ) ? $this->_plugins[ $init ]['info']['changelog'] : '';
140
- $changelogs[ $init ] = $this->in_theme_update_message( $this->_plugins[ $init ], $plugin_changelog, $changelog_id, false );
141
- }
142
-
143
- $localize_script_args = array(
144
- 'registered' => $this->_plugins,
145
- 'activated' => YIT_Plugin_Licence()->get_activated_products(),
146
- 'licence_activation_url' => YIT_Plugin_Licence()->get_licence_activation_page_url(),
147
- 'update_url' => $update_url,
148
- 'details_url' => $details_url,
149
- 'strings' => $strings,
150
- 'changelogs' => $changelogs
151
- );
152
-
153
- yit_enqueue_script( 'yit-multisite-updater', YIT_CORE_PLUGIN_URL . '/assets/js/multisite-updater.min.js', array( 'jquery' ), false, true );
154
-
155
- wp_localize_script( 'yit-multisite-updater', 'plugins', $localize_script_args );
156
- }
157
-
158
- public function network_admin_enqueue_scripts(){
159
- yit_enqueue_style( 'yit-upgrader', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrader.css' );
160
- }
161
-
162
- /**
163
- * Retrive the zip package file
164
- *
165
- * @param bool $reply Whether to bail without returning the package. Default false.
166
- * @param string $package The package file name.
167
- * @param \WP_Upgrader $upgrader WP_Upgrader instance.
168
- *
169
- * @return string | The download file
170
- *
171
- * @since 1.0
172
- * @see wp-admin/includes/class-wp-upgrader.php
173
- * @access public
174
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
175
- */
176
- public function upgrader_pre_download( $reply, $package, $upgrader ) {
177
- $plugin = false;
178
- $is_bulk = $upgrader->skin instanceof Bulk_Plugin_Upgrader_Skin;
179
-
180
- if( ! $is_bulk ){
181
- $plugin = isset( $upgrader->skin->plugin ) ? $upgrader->skin->plugin : false;
182
- }
183
-
184
- else {
185
- //Bulk action upgrade
186
- $action_url = parse_url( $upgrader->skin->options['url'] );
187
- parse_str( rawurldecode( htmlspecialchars_decode( $action_url['query'] ) ) );
188
- $plugins = explode( ',', $plugins );
189
- foreach( $plugins as $plugin_init ){
190
- $to_upgrade = get_plugin_data( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $plugin_init );
191
- if( $to_upgrade['Name'] == $upgrader->skin->plugin_info['Name'] ){
192
- $plugin = $plugin_init;
193
- }
194
- }
195
- }
196
-
197
- /**
198
- * It isn't YITH Premium plugins, please wordpress update it for me!
199
- */
200
- if( ! $plugin ) {
201
- return $reply;
202
- }
203
-
204
- $plugin_info = YIT_Plugin_Licence()->get_product( $plugin );
205
-
206
- /**
207
- * False ? It isn't YITH Premium plugins, please wordpress update it for me!
208
- */
209
- if( false === $plugin_info ) {
210
- return $reply;
211
- }
212
-
213
- $licence = YIT_Plugin_Licence()->get_licence();
214
- $product_id = $plugin_info['product_id'];
215
- $args = array(
216
- 'email' => $licence[ $product_id ]['email'],
217
- 'licence_key' => $licence[$product_id]['licence_key'],
218
- 'product_id' => $plugin_info['product_id'],
219
- 'secret_key' => $plugin_info['secret_key'],
220
- 'instance' => YIT_Plugin_Licence()->get_home_url(),
221
- 'wc-api' => 'download-api',
222
- 'request' => 'download'
223
- );
224
-
225
- if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) {
226
- //Local file or remote?
227
- return $package;
228
- }
229
-
230
- if ( empty( $package ) ) {
231
- return new WP_Error( 'no_package', $upgrader->strings['no_package'] );
232
- }
233
-
234
- $upgrader->skin->feedback( 'downloading_package', __( 'YIThemes Repository', 'yith-plugin-fw' ) );
235
-
236
- $download_file = $this->_download_url( $package, $args );
237
-
238
- /**
239
- * Regenerate update_plugins transient
240
- */
241
- $this->force_regenerate_update_transient();
242
-
243
- if ( is_wp_error( $download_file ) ) {
244
- return new WP_Error( 'download_failed', $upgrader->strings['download_failed'], $download_file->get_error_message() );
245
- }
246
-
247
- return $download_file;
248
- }
249
-
250
- /**
251
- * Retrive the temp filename
252
- *
253
- * @param string $url The package url
254
- * @param string $body The post data fields
255
- * @param int $timeout Execution timeout (default: 300)
256
- *
257
- * @return string | The temp filename
258
- *
259
- * @since 1.0
260
- * @see wp-admin/includes/class-wp-upgrader.php
261
- * @access protected
262
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
263
- */
264
- protected function _download_url( $url, $body, $timeout = 300 ) {
265
-
266
- //WARNING: The file is not automatically deleted, The script must unlink() the file.
267
- if ( ! $url ) {
268
- return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.', 'yit' ) );
269
- }
270
-
271
- $tmpfname = wp_tempnam( $url );
272
-
273
- $args = array(
274
- 'timeout' => $timeout,
275
- 'stream' => true,
276
- 'filename' => $tmpfname,
277
- 'body' => $body
278
- );
279
-
280
- if ( ! $tmpfname ) {
281
- return new WP_Error( 'http_no_file', __( 'Could not create Temporary file.', 'yit' ) );
282
- }
283
-
284
- $response = wp_safe_remote_post( $url, $args );
285
-
286
- if ( is_wp_error( $response ) ) {
287
- unlink( $tmpfname );
288
- return $response;
289
- }
290
-
291
- if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
292
- unlink( $tmpfname );
293
- return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ) );
294
- }
295
-
296
- $content_md5 = wp_remote_retrieve_header( $response, 'content-md5' );
297
-
298
- if ( $content_md5 ) {
299
- $md5_check = verify_file_md5( $tmpfname, $content_md5 );
300
- if ( is_wp_error( $md5_check ) ) {
301
- unlink( $tmpfname );
302
- return $md5_check;
303
- }
304
- }
305
-
306
- return $tmpfname;
307
- }
308
-
309
- /**
310
- * Main plugin Instance
311
- *
312
- * @static
313
- * @return object Main instance
314
- *
315
- * @since 1.0
316
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
317
- */
318
- public static function instance() {
319
- if ( is_null( self::$_instance ) ) {
320
- self::$_instance = new self();
321
- }
322
-
323
- return self::$_instance;
324
- }
325
-
326
- /**
327
- * Delete the update plugins transient
328
- *
329
- * @return void
330
- *
331
- * @since 1.0
332
- * @see update_plugins transient and pre_set_site_transient_update_plugins hooks
333
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
334
- */
335
- public function force_regenerate_update_transient(){
336
- delete_site_transient( 'update_plugins' );
337
- }
338
-
339
- /**
340
- * Check for plugins update
341
- *
342
- * If a new plugin version is available set it in the pre_set_site_transient_update_plugins hooks
343
- *
344
- * @param mixed $transient | update_plugins transient value
345
- * @param bool $save | Default: false. Set true to regenerate the update_transient plugins
346
- *
347
- * @return mixed $transient | The new update_plugins transient value
348
- *
349
- * @since 1.0
350
- * @see update_plugins transient and pre_set_site_transient_update_plugins hooks
351
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
352
- */
353
- public function check_update( $transient, $save = false ) {
354
-
355
- foreach ($this->_plugins as $init => $plugin) {
356
- $xml = str_replace('%plugin_slug%', $this->_plugins[$init]['slug'], $this->_xml);
357
- $remote_xml = wp_remote_get($xml);
358
-
359
- if (!is_wp_error($remote_xml) && isset($remote_xml['response']['code']) && '200' == $remote_xml['response']['code']) {
360
-
361
-
362
- $plugin_remote_info = new SimpleXmlElement($remote_xml['body']);
363
-
364
- if (version_compare($plugin_remote_info->latest, $plugin['info']['Version'], '>') && !isset($transient->response[$init])) {
365
-
366
- $package = YIT_Plugin_Licence()->check($init) ? $this->_package_url : null;
367
-
368
- $obj = new stdClass();
369
- $obj->slug = (string)$init;
370
- $obj->new_version = (string)$plugin_remote_info->latest;
371
- $obj->changelog = (string)$plugin_remote_info->changelog;
372
- $obj->package = $package;
373
- $obj->plugin = $init;
374
- $transient->response[$init] = $obj;
375
- }
376
-
377
- }
378
- }
379
-
380
- if( $save ) {
381
- set_site_transient( 'update_plugins', $transient );
382
- }
383
-
384
- return $transient;
385
- }
386
-
387
- /**
388
- * Add the plugin update row in plugin page
389
- *
390
- * @return void
391
- * @fire "in_theme_update_message-{$init}" action
392
- *
393
- * @since 1.0
394
- * @see after_plugin_row_{$init} action
395
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
396
- */
397
- public function plugin_update_row() {
398
-
399
- $current = get_site_transient( 'update_plugins' );
400
- $init = str_replace( 'after_plugin_row_', '', current_filter() );
401
-
402
- if ( ! isset( $current->response[ $init ] ) ) {
403
- return false;
404
- }
405
-
406
- /**
407
- * stdClass Object
408
- */
409
- $r = $current->response[ $init ];
410
-
411
- $changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
412
- $details_url = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ) , '' ) );
413
-
414
- /**
415
- * @see wp_plugin_update_rows() in wp-single\wp-admin\includes\update.php
416
- */
417
- $wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );
418
-
419
- if( is_network_admin() || ! is_multisite() || true ) {
420
- echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
421
-
422
- if( ! current_user_can( 'update_plugins' ) ){
423
- printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button" title="%3$s">View version %4$s details</a>.', 'yith-plugin-fw'), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version );
424
- }elseif( is_plugin_active_for_network( $init ) ){
425
- printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button" title="%3$s">View version %4$s details</a>. <em>You have to activate the plugin on a single site of the network to benefit from automatic updates.</em>', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version );
426
- }elseif ( empty( $r->package ) ) {
427
- printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin, please <a href="%5$s" title="License activation">activate</a> your copy of %6s.</em>', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version, YIT_Plugin_Licence()->get_licence_activation_page_url(), $this->_plugins[ $init ]['info']['Name'] );
428
- } else {
429
- printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.', 'yith-plugin-fw'), $this->_plugins[ $init ]['info']['Name'], esc_url($details_url), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&plugin=') . $init, 'upgrade-plugin_' . $init ) );
430
- }
431
-
432
- /**
433
- * Fires at the end of the update message container in each
434
- * row of the themes list table.
435
- *
436
- * The dynamic portion of the hook name, `$theme_key`, refers to
437
- * the theme slug as found in the WordPress.org themes repository.
438
- *
439
- * @since Wordpress 3.1.0
440
- * }
441
- */
442
- do_action( "in_theme_update_message-{$init}", $this->_plugins[ $init ], $r->changelog, $changelog_id );
443
-
444
- echo '</div></td></tr>';
445
- }
446
- }
447
-
448
- /**
449
- * Remove the standard plugin_update_row
450
- *
451
- * Remove the standard plugin_update_row and Add a custom plugin update row in plugin page.
452
- *
453
- * @return void
454
- * @fire "in_theme_update_message-{$init}" action
455
- *
456
- * @since 1.0
457
- * @see after_plugin_row_{$init} action
458
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
459
- */
460
- public function remove_wp_plugin_update_row() {
461
- foreach( $this->_plugins as $init => $plugin ){
462
- remove_action( "after_plugin_row_{$init}", 'wp_plugin_update_row', 10, 2 );
463
- add_action( "after_plugin_row_{$init}", array( $this, 'plugin_update_row' ) );
464
- add_action( "in_theme_update_message-{$init}", array( $this, 'in_theme_update_message' ), 10, 3 );
465
- }
466
- }
467
-
468
- public function in_theme_update_message( $plugin, $changelog, $changelog_id, $echo = true ){
469
-
470
- $res = "<div id='{$changelog_id}' class='yit-plugin-changelog-wrapper'>
471
- <div class='yit-plugin-changelog'>
472
- <h2 class='yit-plugin-changelog-title'>{$plugin['info']['Name']} - Changelog</h2>
473
- <p>{$changelog}</p>
474
- </div>
475
- </div>";
476
-
477
- if( $echo ){
478
- echo $res;
479
- }
480
- else{
481
- return $res;
482
- }
483
- }
484
-
485
- /**
486
- * Auto-Update Plugin in multisite
487
- *
488
- * Manage the non standard upgrade-plugin-multisite action
489
- *
490
- * @return void
491
- *
492
- * @since 1.0
493
- * @see upgrade-plugin action
494
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
495
- */
496
- public function upgrade_plugin_multisite(){
497
-
498
- $plugin = isset($_REQUEST['plugin']) ? trim($_REQUEST['plugin']) : '';
499
- $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
500
-
501
- if( 'upgrade-plugin-multisite' != $action ){
502
- wp_die( __( 'You can\'t update the plugins for this site.', 'yith-plugin-fw' ) );
503
- }
504
-
505
- if ( ! current_user_can( 'update_plugins' ) ) {
506
- wp_die( __( 'You do not have sufficient permissions to update the plugins for this site.', 'yith-plugin-fw' ) );
507
- }
508
-
509
- $this->check_update( get_site_transient( 'update_plugins') , true );
510
-
511
- check_admin_referer( 'upgrade-plugin-multisite_' . $plugin );
512
-
513
- $title = __( 'Update Plugin', 'yith-plugin-fw' );
514
- $parent_file = 'plugins.php';
515
- $submenu_file = 'plugins.php';
516
-
517
- wp_enqueue_script( 'updates' );
518
- require_once( ABSPATH . 'wp-admin/admin-header.php' );
519
-
520
- $nonce = 'upgrade-plugin-multisite_' . $plugin;
521
- $url = 'update.php?action=upgrade-plugin-multisite&plugin=' . urlencode( $plugin );
522
-
523
- $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'plugin' ) ) );
524
- $upgrader->upgrade( $plugin );
525
-
526
- include( ABSPATH . 'wp-admin/admin-footer.php' );
527
- }
528
- }
529
- }
530
-
531
- if ( ! function_exists( 'YIT_Upgrade' ) ) {
532
- /**
533
- * Main instance of plugin
534
- *
535
- * @return object
536
- * @since 1.0
537
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
538
- */
539
- function YIT_Upgrade() {
540
- return YIT_Upgrade::instance();
541
- }
542
- }
543
-
544
- /**
545
- * Instance a YIT_Upgrade object
546
- */
547
- YIT_Upgrade();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YIT_Upgrade' ) ) {
15
+ /**
16
+ * YIT Upgrade
17
+ *
18
+ * Notify and Update plugin
19
+ *
20
+ * @class YIT_Upgrade
21
+ * @package Yithemes
22
+ * @since 1.0
23
+ * @author Your Inspiration Themes
24
+ * @see WP_Updater Class
25
+ */
26
+ class YIT_Upgrade {
27
+
28
+ /**
29
+ * @var string XML notifier update
30
+ */
31
+ protected $_xml = 'http://update.yithemes.com/plugins/%plugin_slug%.xml';
32
+
33
+ /**
34
+ * @var string api server url
35
+ */
36
+ protected $_package_url = 'http://www.yithemes.com';
37
+
38
+ /**
39
+ * @var array The registered plugins
40
+ */
41
+ protected $_plugins = array();
42
+
43
+ /**
44
+ * @var YIT_Upgrade The main instance
45
+ */
46
+ protected static $_instance;
47
+
48
+ /**
49
+ * Construct
50
+ *
51
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
52
+ * @since 1.0
53
+ */
54
+ public function __construct() {
55
+ add_filter( 'upgrader_pre_download', array( $this, 'upgrader_pre_download' ), 10, 3 );
56
+ add_action( 'update-custom_upgrade-plugin-multisite', array( $this, 'upgrade_plugin_multisite' ) );
57
+
58
+ if ( is_network_admin() ) {
59
+ add_action( 'admin_enqueue_scripts', array( $this, 'network_admin_enqueue_scripts' ) );
60
+ }
61
+
62
+ $is_debug_enabled = defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG;
63
+ if ( $is_debug_enabled ) {
64
+ $this->_package_url = defined( 'YIT_LICENCE_DEBUG_LOCALHOST' ) ? YIT_LICENCE_DEBUG_LOCALHOST : 'http://dev.yithemes.com';
65
+ add_filter( 'block_local_requests', '__return_false' );
66
+ }
67
+ }
68
+
69
+ /**
70
+ * Main plugin Instance
71
+ *
72
+ * @param $plugin_slug | string The plugin slug
73
+ * @param $plugin_init | string The plugin init file
74
+ *
75
+ * @return void
76
+ *
77
+ * @since 1.0
78
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
79
+ */
80
+ public function register( $plugin_slug, $plugin_init ) {
81
+
82
+ if ( ! function_exists( 'get_plugins' ) ) {
83
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
84
+ }
85
+
86
+ $plugins = get_plugins();
87
+ $plugin_info = $plugins[ $plugin_init ];
88
+
89
+ $this->_plugins[ $plugin_init ] = array(
90
+ 'info' => $plugin_info,
91
+ 'slug' => $plugin_slug,
92
+ );
93
+
94
+ /* === HOOKS === */
95
+ if ( ! is_multisite() || is_plugin_active_for_network( $plugin_init ) ) {
96
+ add_action( 'admin_init', array( $this, 'remove_wp_plugin_update_row' ), 15 );
97
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
98
+ } else if ( is_multisite() && current_user_can( 'update_plugins' ) ) {
99
+ $transient = 'yith_register_' . md5( $plugin_slug );
100
+ if ( apply_filters( 'yith_register_delete_transient', false ) ) {
101
+ delete_transient( $transient );
102
+ }
103
+ $info = get_transient( $transient );
104
+ if ( false === $info || apply_filters( 'yith_register_delete_transient', false ) ) {
105
+ $xml = str_replace( '%plugin_slug%', $plugin_slug, $this->_xml );
106
+ $remote_xml = wp_remote_get( $xml );
107
+
108
+ if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
109
+ $plugin_remote_info = new SimpleXmlElement( $remote_xml['body'] );
110
+ $info['Latest'] = (string) $plugin_remote_info->latest;
111
+ $info['changelog'] = (string) $plugin_remote_info->changelog;
112
+ YIT_Plugin_Licence()->check( $plugin_slug, false );
113
+ set_transient( $transient, $info, DAY_IN_SECONDS );
114
+ }
115
+ }
116
+
117
+ $this->_plugins[ $plugin_init ]['info']['Latest'] = $info['Latest'];
118
+ $this->_plugins[ $plugin_init ]['info']['changelog'] = $info['changelog'];
119
+ add_action( 'admin_enqueue_scripts', array( $this, 'multisite_updater_script' ) );
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Add the multisite updater scripts
125
+ *
126
+ * @return void
127
+ *
128
+ * @since 1.0
129
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
130
+ */
131
+ public function multisite_updater_script() {
132
+
133
+ $update_url = $changelogs = $details_url = array();
134
+ $strings = array(
135
+ 'new_version' => __( 'There is a new version of %plugin_name% available.', 'yith-plugin-fw' ),
136
+ 'latest' => __( 'View version %latest% details.', 'yith-plugin-fw' ),
137
+ 'unavailable' => __( 'Automatic update is unavailable for this plugin,', 'yith-plugin-fw' ),
138
+ 'activate' => __( 'please <a href="%activate_link%">activate</a> your copy of %plugin_name%.', 'yith-plugin-fw' ),
139
+ 'update_now' => __( 'Update now.', 'yith-plugin-fw' )
140
+
141
+ );
142
+
143
+ foreach ( $this->_plugins as $init => $info ) {
144
+ $update_url[ $init ] = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin-multisite&plugin=' ) . $init, 'upgrade-plugin-multisite_' . $init );
145
+ $changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
146
+ $details_url[ $init ] = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ), '' ) );
147
+ $plugin_changelog = isset( $this->_plugins[ $init ]['info']['changelog'] ) ? $this->_plugins[ $init ]['info']['changelog'] : '';
148
+ $changelogs[ $init ] = $this->in_theme_update_message( $this->_plugins[ $init ], $plugin_changelog, $changelog_id, false );
149
+ }
150
+
151
+ $localize_script_args = array(
152
+ 'registered' => $this->_plugins,
153
+ 'activated' => YIT_Plugin_Licence()->get_activated_products(),
154
+ 'licence_activation_url' => YIT_Plugin_Licence()->get_licence_activation_page_url(),
155
+ 'update_url' => $update_url,
156
+ 'details_url' => $details_url,
157
+ 'strings' => $strings,
158
+ 'changelogs' => $changelogs
159
+ );
160
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
161
+ yit_enqueue_script( 'yit-multisite-updater', YIT_CORE_PLUGIN_URL . '/assets/js/multisite-updater' . $suffix . '.js', array( 'jquery' ), false, true );
162
+
163
+ wp_localize_script( 'yit-multisite-updater', 'plugins', $localize_script_args );
164
+ }
165
+
166
+ public function network_admin_enqueue_scripts() {
167
+ yit_enqueue_style( 'yit-upgrader', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrader.css' );
168
+ }
169
+
170
+ /**
171
+ * Retrive the zip package file
172
+ *
173
+ * @param bool $reply Whether to bail without returning the package. Default false.
174
+ * @param string $package The package file name.
175
+ * @param \WP_Upgrader $upgrader WP_Upgrader instance.
176
+ *
177
+ * @return string | The download file
178
+ *
179
+ * @since 1.0
180
+ * @see wp-admin/includes/class-wp-upgrader.php
181
+ * @access public
182
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
183
+ */
184
+ public function upgrader_pre_download( $reply, $package, $upgrader ) {
185
+ $plugin = false;
186
+ $is_bulk = $upgrader->skin instanceof Bulk_Plugin_Upgrader_Skin;
187
+
188
+ if ( ! $is_bulk ) {
189
+ $plugin = isset( $upgrader->skin->plugin ) ? $upgrader->skin->plugin : false;
190
+ } else {
191
+ //Bulk action upgrade
192
+ $action_url = parse_url( $upgrader->skin->options['url'] );
193
+ parse_str( rawurldecode( htmlspecialchars_decode( $action_url['query'] ) ) );
194
+ $plugins = explode( ',', $plugins );
195
+ foreach ( $plugins as $plugin_init ) {
196
+ $to_upgrade = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_init );
197
+ if ( $to_upgrade['Name'] == $upgrader->skin->plugin_info['Name'] ) {
198
+ $plugin = $plugin_init;
199
+ }
200
+ }
201
+ }
202
+
203
+ /**
204
+ * It isn't YITH Premium plugins, please wordpress update it for me!
205
+ */
206
+ if ( ! $plugin ) {
207
+ return $reply;
208
+ }
209
+
210
+ $plugin_info = YIT_Plugin_Licence()->get_product( $plugin );
211
+
212
+ /**
213
+ * False ? It isn't YITH Premium plugins, please wordpress update it for me!
214
+ */
215
+ if ( false === $plugin_info ) {
216
+ return $reply;
217
+ }
218
+
219
+ $licence = YIT_Plugin_Licence()->get_licence();
220
+ $product_id = $plugin_info['product_id'];
221
+ $args = array(
222
+ 'email' => $licence[ $product_id ]['email'],
223
+ 'licence_key' => $licence[ $product_id ]['licence_key'],
224
+ 'product_id' => $plugin_info['product_id'],
225
+ 'secret_key' => $plugin_info['secret_key'],
226
+ 'instance' => YIT_Plugin_Licence()->get_home_url(),
227
+ 'wc-api' => 'download-api',
228
+ 'request' => 'download'
229
+ );
230
+
231
+ if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) {
232
+ //Local file or remote?
233
+ return $package;
234
+ }
235
+
236
+ if ( empty( $package ) ) {
237
+ return new WP_Error( 'no_package', $upgrader->strings['no_package'] );
238
+ }
239
+
240
+ $upgrader->skin->feedback( 'downloading_package', __( 'YIThemes Repository', 'yith-plugin-fw' ) );
241
+
242
+ $download_file = $this->_download_url( $package, $args );
243
+
244
+ /**
245
+ * Regenerate update_plugins transient
246
+ */
247
+ $this->force_regenerate_update_transient();
248
+
249
+ if ( is_wp_error( $download_file ) ) {
250
+ return new WP_Error( 'download_failed', $upgrader->strings['download_failed'], $download_file->get_error_message() );
251
+ }
252
+
253
+ return $download_file;
254
+ }
255
+
256
+ /**
257
+ * Retrive the temp filename
258
+ *
259
+ * @param string $url The package url
260
+ * @param string $body The post data fields
261
+ * @param int $timeout Execution timeout (default: 300)
262
+ *
263
+ * @return string | The temp filename
264
+ *
265
+ * @since 1.0
266
+ * @see wp-admin/includes/class-wp-upgrader.php
267
+ * @access protected
268
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
269
+ */
270
+ protected function _download_url( $url, $body, $timeout = 300 ) {
271
+
272
+ //WARNING: The file is not automatically deleted, The script must unlink() the file.
273
+ if ( ! $url ) {
274
+ return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.', 'yit' ) );
275
+ }
276
+
277
+ $tmpfname = wp_tempnam( $url );
278
+
279
+ $args = array(
280
+ 'timeout' => $timeout,
281
+ 'stream' => true,
282
+ 'filename' => $tmpfname,
283
+ 'body' => $body
284
+ );
285
+
286
+ if ( ! $tmpfname ) {
287
+ return new WP_Error( 'http_no_file', __( 'Could not create Temporary file.', 'yit' ) );
288
+ }
289
+
290
+ $response = wp_safe_remote_post( $url, $args );
291
+
292
+ if ( is_wp_error( $response ) ) {
293
+ unlink( $tmpfname );
294
+
295
+ return $response;
296
+ }
297
+
298
+ if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
299
+ unlink( $tmpfname );
300
+
301
+ return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ) );
302
+ }
303
+
304
+ $content_md5 = wp_remote_retrieve_header( $response, 'content-md5' );
305
+
306
+ if ( $content_md5 ) {
307
+ $md5_check = verify_file_md5( $tmpfname, $content_md5 );
308
+ if ( is_wp_error( $md5_check ) ) {
309
+ unlink( $tmpfname );
310
+
311
+ return $md5_check;
312
+ }
313
+ }
314
+
315
+ return $tmpfname;
316
+ }
317
+
318
+ /**
319
+ * Main plugin Instance
320
+ *
321
+ * @static
322
+ * @return object Main instance
323
+ *
324
+ * @since 1.0
325
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
326
+ */
327
+ public static function instance() {
328
+ if ( is_null( self::$_instance ) ) {
329
+ self::$_instance = new self();
330
+ }
331
+
332
+ return self::$_instance;
333
+ }
334
+
335
+ /**
336
+ * Delete the update plugins transient
337
+ *
338
+ * @return void
339
+ *
340
+ * @since 1.0
341
+ * @see update_plugins transient and pre_set_site_transient_update_plugins hooks
342
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
343
+ */
344
+ public function force_regenerate_update_transient() {
345
+ delete_site_transient( 'update_plugins' );
346
+ }
347
+
348
+ /**
349
+ * Check for plugins update
350
+ *
351
+ * If a new plugin version is available set it in the pre_set_site_transient_update_plugins hooks
352
+ *
353
+ * @param mixed $transient | update_plugins transient value
354
+ * @param bool $save | Default: false. Set true to regenerate the update_transient plugins
355
+ *
356
+ * @return mixed $transient | The new update_plugins transient value
357
+ *
358
+ * @since 1.0
359
+ * @see update_plugins transient and pre_set_site_transient_update_plugins hooks
360
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
361
+ */
362
+ public function check_update( $transient, $save = false ) {
363
+
364
+ foreach ( $this->_plugins as $init => $plugin ) {
365
+ $xml = str_replace( '%plugin_slug%', $this->_plugins[ $init ]['slug'], $this->_xml );
366
+ $remote_xml = wp_remote_get( $xml );
367
+
368
+ if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
369
+
370
+ try {
371
+
372
+ $plugin_remote_info = new SimpleXmlElement( $remote_xml['body'] );
373
+
374
+ if ( version_compare( $plugin_remote_info->latest, $plugin['info']['Version'], '>' ) && ! isset( $transient->response[ $init ] ) ) {
375
+
376
+ $package = YIT_Plugin_Licence()->check( $init ) ? $this->_package_url : null;
377
+
378
+ $obj = new stdClass();
379
+ $obj->slug = (string) $init;
380
+ $obj->new_version = (string) $plugin_remote_info->latest;
381
+ $obj->changelog = (string) $plugin_remote_info->changelog;
382
+ $obj->package = $package;
383
+ $obj->plugin = $init;
384
+ $transient->response[ $init ] = $obj;
385
+ }
386
+
387
+ } catch ( Exception $e ) {
388
+
389
+ return $transient;
390
+
391
+ }
392
+
393
+ }
394
+ }
395
+
396
+ if ( $save ) {
397
+ set_site_transient( 'update_plugins', $transient );
398
+ }
399
+
400
+ return $transient;
401
+ }
402
+
403
+ /**
404
+ * Add the plugin update row in plugin page
405
+ *
406
+ * @return void
407
+ * @fire "in_theme_update_message-{$init}" action
408
+ *
409
+ * @since 1.0
410
+ * @see after_plugin_row_{$init} action
411
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
412
+ */
413
+ public function plugin_update_row() {
414
+
415
+ $current = get_site_transient( 'update_plugins' );
416
+ $init = str_replace( 'after_plugin_row_', '', current_filter() );
417
+
418
+ if ( ! isset( $current->response[ $init ] ) ) {
419
+ return false;
420
+ }
421
+
422
+ /**
423
+ * stdClass Object
424
+ */
425
+ $r = $current->response[ $init ];
426
+
427
+ $changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
428
+ $details_url = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ), '' ) );
429
+
430
+ /**
431
+ * @see wp_plugin_update_rows() in wp-single\wp-admin\includes\update.php
432
+ */
433
+ $wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );
434
+
435
+ if ( is_network_admin() || ! is_multisite() || true ) {
436
+ echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
437
+
438
+ if ( ! current_user_can( 'update_plugins' ) ) {
439
+ printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button" title="%3$s">View version %4$s details</a>.', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version );
440
+ } elseif ( is_plugin_active_for_network( $init ) ) {
441
+ printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button" title="%3$s">View version %4$s details</a>. <em>You have to activate the plugin on a single site of the network to benefit from automatic updates.</em>', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version );
442
+ } elseif ( empty( $r->package ) ) {
443
+ printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin, please <a href="%5$s" title="License activation">activate</a> your copy of %6s.</em>', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version, YIT_Plugin_Licence()->get_licence_activation_page_url(), $this->_plugins[ $init ]['info']['Name'] );
444
+ } else {
445
+ printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox yit-changelog-button" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.', 'yith-plugin-fw' ), $this->_plugins[ $init ]['info']['Name'], esc_url( $details_url ), esc_attr( $this->_plugins[ $init ]['info']['Name'] ), $r->new_version, wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $init, 'upgrade-plugin_' . $init ) );
446
+ }
447
+
448
+ /**
449
+ * Fires at the end of the update message container in each
450
+ * row of the themes list table.
451
+ *
452
+ * The dynamic portion of the hook name, `$theme_key`, refers to
453
+ * the theme slug as found in the WordPress.org themes repository.
454
+ *
455
+ * @since Wordpress 3.1.0
456
+ * }
457
+ */
458
+ do_action( "in_theme_update_message-{$init}", $this->_plugins[ $init ], $r->changelog, $changelog_id );
459
+
460
+ echo '</div></td></tr>';
461
+ }
462
+ }
463
+
464
+ /**
465
+ * Remove the standard plugin_update_row
466
+ *
467
+ * Remove the standard plugin_update_row and Add a custom plugin update row in plugin page.
468
+ *
469
+ * @return void
470
+ * @fire "in_theme_update_message-{$init}" action
471
+ *
472
+ * @since 1.0
473
+ * @see after_plugin_row_{$init} action
474
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
475
+ */
476
+ public function remove_wp_plugin_update_row() {
477
+ foreach ( $this->_plugins as $init => $plugin ) {
478
+ remove_action( "after_plugin_row_{$init}", 'wp_plugin_update_row', 10, 2 );
479
+ add_action( "after_plugin_row_{$init}", array( $this, 'plugin_update_row' ) );
480
+ add_action( "in_theme_update_message-{$init}", array( $this, 'in_theme_update_message' ), 10, 3 );
481
+ }
482
+ }
483
+
484
+ public function in_theme_update_message( $plugin, $changelog, $changelog_id, $echo = true ) {
485
+
486
+ $res = "<div id='{$changelog_id}' class='yit-plugin-changelog-wrapper'>
487
+ <div class='yit-plugin-changelog'>
488
+ <h2 class='yit-plugin-changelog-title'>{$plugin['info']['Name']} - Changelog</h2>
489
+ <p>{$changelog}</p>
490
+ </div>
491
+ </div>";
492
+
493
+ if ( $echo ) {
494
+ echo $res;
495
+ } else {
496
+ return $res;
497
+ }
498
+ }
499
+
500
+ /**
501
+ * Auto-Update Plugin in multisite
502
+ *
503
+ * Manage the non standard upgrade-plugin-multisite action
504
+ *
505
+ * @return void
506
+ *
507
+ * @since 1.0
508
+ * @see upgrade-plugin action
509
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
510
+ */
511
+ public function upgrade_plugin_multisite() {
512
+
513
+ $plugin = isset( $_REQUEST['plugin'] ) ? trim( $_REQUEST['plugin'] ) : '';
514
+ $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
515
+
516
+ if ( 'upgrade-plugin-multisite' != $action ) {
517
+ wp_die( __( 'You can\'t update the plugins for this site.', 'yith-plugin-fw' ) );
518
+ }
519
+
520
+ if ( ! current_user_can( 'update_plugins' ) ) {
521
+ wp_die( __( 'You do not have sufficient permissions to update the plugins for this site.', 'yith-plugin-fw' ) );
522
+ }
523
+
524
+ $this->check_update( get_site_transient( 'update_plugins' ), true );
525
+
526
+ check_admin_referer( 'upgrade-plugin-multisite_' . $plugin );
527
+
528
+ $title = __( 'Update Plugin', 'yith-plugin-fw' );
529
+ $parent_file = 'plugins.php';
530
+ $submenu_file = 'plugins.php';
531
+
532
+ wp_enqueue_script( 'updates' );
533
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
534
+
535
+ $nonce = 'upgrade-plugin-multisite_' . $plugin;
536
+ $url = 'update.php?action=upgrade-plugin-multisite&plugin=' . urlencode( $plugin );
537
+
538
+ $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'plugin' ) ) );
539
+ $upgrader->upgrade( $plugin );
540
+
541
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
542
+ }
543
+ }
544
+ }
545
+
546
+ if ( ! function_exists( 'YIT_Upgrade' ) ) {
547
+ /**
548
+ * Main instance of plugin
549
+ *
550
+ * @return YIT_Upgrade
551
+ * @since 1.0
552
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
553
+ */
554
+ function YIT_Upgrade() {
555
+ return YIT_Upgrade::instance();
556
+ }
557
+ }
558
+
559
+ /**
560
+ * Instance a YIT_Upgrade object
561
+ */
562
+ YIT_Upgrade();
plugin-fw/lib/yit-video.php CHANGED
@@ -1,200 +1,204 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
-
12
- if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
- } // Exit if accessed directly
15
-
16
- if ( ! class_exists( 'YIT_Video' ) ) {
17
- /**
18
- * YIT Video
19
- *
20
- * Class to manage the video from youtube and vimeo or other services
21
- *
22
- * @class YIT_Video
23
- * @package Yithemes
24
- * @since 1.0.0
25
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
26
- *
27
- */
28
-
29
- class YIT_Video {
30
-
31
- /**
32
- * Generate the HTML for a youtube video
33
- *
34
- * @static
35
- *
36
- * @param array $args Array of arguments to configure the video to generate
37
- *
38
- * @return string
39
- * @since 1.0
40
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
41
- */
42
- public static function youtube( $args = array() ) {
43
- $defaults = array(
44
- 'id' => '',
45
- 'url' => '',
46
- 'width' => 425,
47
- 'height' => 356,
48
- 'echo' => false
49
- );
50
- $args = wp_parse_args( $args, $defaults );
51
- extract( $args );
52
-
53
- // get video ID if you have only URL
54
- if ( empty( $id ) && ! empty( $url ) ) {
55
- $id = self::video_id_by_url( $url );
56
- } elseif ( empty( $id ) && empty( $url ) ) {
57
- return;
58
- }
59
-
60
- ob_start();
61
-
62
- $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id );
63
- $id = preg_replace( '/(youtube|vimeo):/', '', $id ); ?>
64
-
65
- <div class="post_video youtube">
66
- <iframe wmode="transparent" width="<?php echo $width; ?>" height="<?php echo $height; ?>" src="https://www.youtube.com/embed/<?php echo $id; ?>?wmode=transparent" frameborder="0" allowfullscreen></iframe>
67
- </div>
68
-
69
- <?php
70
- $html = apply_filters( 'yit_video_youtube', ob_get_clean() );
71
-
72
- if( $echo ) echo $html;
73
-
74
- return $html;
75
- }
76
-
77
- /**
78
- * Generate the HTML for a vimeo video
79
- *
80
- * @static
81
- *
82
- * @param array $args Array of arguments to configure the video to generate
83
- *
84
- * @return string
85
- * @since 1.0
86
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
87
- */
88
- public static function vimeo( $args = array() ) {
89
- $defaults = array(
90
- 'id' => '',
91
- 'url' => '',
92
- 'width' => 425,
93
- 'height' => 356,
94
- 'echo' => false
95
- );
96
- $args = wp_parse_args( $args, $defaults );
97
- extract( $args );
98
-
99
- // get video ID if you have only URL
100
- if ( empty( $id ) && ! empty( $url ) ) {
101
- $id = self::video_id_by_url( $url );
102
- }
103
-
104
- ob_start();
105
-
106
- $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id );
107
- $id = preg_replace( '/(youtube|vimeo):/', '', $id ); ?>
108
-
109
- <div class="post_video vimeo">
110
- <iframe wmode="transparent" src="http://player.vimeo.com/video/<?php echo $id; ?>?title=0&amp;byline=0&amp;portrait=0" width="<?php echo $width; ?>" height="<?php echo $height; ?>" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
111
- </div>
112
-
113
- <?php
114
- $html = apply_filters( 'yit_video_vimeo', ob_get_clean() );
115
-
116
- if( $echo ) echo $html;
117
-
118
- return $html;
119
- }
120
-
121
- /**
122
- * Retrieve video ID from URL
123
- *
124
- * @static
125
- *
126
- * @param array $url The URL of video
127
- *
128
- * @return bool|string
129
- * @since 1.0
130
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
131
- */
132
- public static function video_id_by_url( $url ) {
133
- $parsed = parse_url( esc_url( $url ) );
134
- if ( ! isset( $parsed['host'] ) ) {
135
- return false;
136
- }
137
-
138
-
139
- switch ( $parsed['host'] ) {
140
- case 'youtube.com' :
141
- case 'www.youtube.com' :
142
- case 'youtu.be' :
143
- case 'www.youtu.be' :
144
- $id = self::youtube_id_by_url( $url );
145
- return "youtube:$id";
146
-
147
- case 'www.vimeo.com' :
148
- case 'vimeo.com' :
149
- preg_match( '/http(s)?:\/\/(\w+.)?vimeo\.com\/(.*)?(\/[0-9]+)/', $url, $matches );
150
- $id = trim( $matches[4], '/' );
151
- return "vimeo:$id";
152
-
153
- default :
154
- return false;
155
-
156
- }
157
- }
158
-
159
- /**
160
- * Retrieve video ID from URL
161
- *
162
- * @static
163
- *
164
- * @param array $url The URL of video
165
- *
166
- * @return bool|string
167
- * @since 1.0
168
- * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
169
- */
170
- protected static function youtube_id_by_url( $url ) {
171
- if ( preg_match( '/http(s)?:\/\/youtu.be/', $url, $matches) ) {
172
- $url = parse_url($url, PHP_URL_PATH);
173
- $url = str_replace( '/', '', $url);
174
- return $url;
175
-
176
- } elseif ( preg_match( '/watch/', $url, $matches) ) {
177
- $arr = parse_url($url);
178
- $url = str_replace( 'v=', '', $arr['query'] );
179
- return $url;
180
-
181
- } elseif ( preg_match( '/http(s)?:\/\/(\w+.)?youtube.com\/v/', $url, $matches) ) {
182
- $arr = parse_url($url);
183
- $url = str_replace( '/v/', '', $arr['path'] );
184
- return $url;
185
-
186
- } elseif ( preg_match( '/http(s)?:\/\/(\w+.)?youtube.com\/embed/', $url, $matches) ) {
187
- $arr = parse_url($url);
188
- $url = str_replace( '/embed/', '', $arr['path'] );
189
- return $url;
190
-
191
- } elseif ( preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=[0-9]/)[^&\n]+|(?<=v=)[^&\n]+#", $url, $matches) ) {
192
- return $matches[0];
193
-
194
- } else {
195
- return false;
196
- }
197
- }
198
-
199
- }
 
 
 
 
200
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ } // Exit if accessed directly
15
+
16
+ if ( ! class_exists( 'YIT_Video' ) ) {
17
+ /**
18
+ * YIT Video
19
+ *
20
+ * Class to manage the video from youtube and vimeo or other services
21
+ *
22
+ * @class YIT_Video
23
+ * @package Yithemes
24
+ * @since 1.0.0
25
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
26
+ *
27
+ */
28
+
29
+ class YIT_Video {
30
+
31
+ /**
32
+ * Generate the HTML for a youtube video
33
+ *
34
+ * @static
35
+ *
36
+ * @param array $args Array of arguments to configure the video to generate
37
+ *
38
+ * @return string
39
+ * @since 1.0
40
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
41
+ */
42
+ public static function youtube( $args = array() ) {
43
+ $defaults = array(
44
+ 'id' => '',
45
+ 'url' => '',
46
+ 'width' => 425,
47
+ 'height' => 356,
48
+ 'echo' => false
49
+ );
50
+ $args = wp_parse_args( $args, $defaults );
51
+ extract( $args );
52
+
53
+ // get video ID if you have only URL
54
+ if ( empty( $id ) && ! empty( $url ) ) {
55
+ $id = self::video_id_by_url( $url );
56
+ } elseif ( empty( $id ) && empty( $url ) ) {
57
+ return;
58
+ }
59
+
60
+ ob_start();
61
+
62
+ $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id );
63
+ $id = preg_replace( '/(youtube|vimeo):/', '', $id ); ?>
64
+
65
+ <div class="post_video youtube">
66
+ <iframe wmode="transparent" width="<?php echo $width; ?>" height="<?php echo $height; ?>" src="https://www.youtube.com/embed/<?php echo $id; ?>?wmode=transparent" frameborder="0" allowfullscreen></iframe>
67
+ </div>
68
+
69
+ <?php
70
+ $html = apply_filters( 'yit_video_youtube', ob_get_clean() );
71
+
72
+ if( $echo ) echo $html;
73
+
74
+ return $html;
75
+ }
76
+
77
+ /**
78
+ * Generate the HTML for a vimeo video
79
+ *
80
+ * @static
81
+ *
82
+ * @param array $args Array of arguments to configure the video to generate
83
+ *
84
+ * @return string
85
+ * @since 1.0
86
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
87
+ */
88
+ public static function vimeo( $args = array() ) {
89
+ $defaults = array(
90
+ 'id' => '',
91
+ 'url' => '',
92
+ 'width' => 425,
93
+ 'height' => 356,
94
+ 'echo' => false
95
+ );
96
+ $args = wp_parse_args( $args, $defaults );
97
+ extract( $args );
98
+
99
+ // get video ID if you have only URL
100
+ if ( empty( $id ) && ! empty( $url ) ) {
101
+ $id = self::video_id_by_url( $url );
102
+ }
103
+
104
+ ob_start();
105
+
106
+ $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id );
107
+ $id = preg_replace( '/(youtube|vimeo):/', '', $id );
108
+ $http = is_ssl()? 'https' : 'http';
109
+ ?>
110
+
111
+
112
+ <div class="post_video vimeo">
113
+ <iframe wmode="transparent" src="<?php echo $http;?>://player.vimeo.com/video/<?php echo $id; ?>?title=0&amp;byline=0&amp;portrait=0" width="<?php echo $width; ?>" height="<?php echo $height; ?>" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
114
+ </div>
115
+
116
+ <?php
117
+ $html = apply_filters( 'yit_video_vimeo', ob_get_clean() );
118
+
119
+ if( $echo ) echo $html;
120
+
121
+ return $html;
122
+ }
123
+
124
+ /**
125
+ * Retrieve video ID from URL
126
+ *
127
+ * @static
128
+ *
129
+ * @param array $url The URL of video
130
+ *
131
+ * @return bool|string
132
+ * @since 1.0
133
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
134
+ */
135
+ public static function video_id_by_url( $url ) {
136
+ $parsed = parse_url( esc_url( $url ) );
137
+
138
+ if ( ! isset( $parsed['host'] ) ) {
139
+ return false;
140
+ }
141
+
142
+
143
+ switch ( $parsed['host'] ) {
144
+ case 'youtube.com' :
145
+ case 'www.youtube.com' :
146
+ case 'youtu.be' :
147
+ case 'www.youtu.be' :
148
+ $id = self::youtube_id_by_url( $url );
149
+ return "youtube:$id";
150
+
151
+ case 'www.vimeo.com' :
152
+ case 'vimeo.com' :
153
+ preg_match( '/http(s)?:\/\/(\w+.)?vimeo\.com\/(.*)?(\/[0-9]+)/', $url, $matches );
154
+ $id = trim( $matches[4], '/' );
155
+ return "vimeo:$id";
156
+
157
+ default :
158
+ return false;
159
+
160
+ }
161
+ }
162
+
163
+ /**
164
+ * Retrieve video ID from URL
165
+ *
166
+ * @static
167
+ *
168
+ * @param array $url The URL of video
169
+ *
170
+ * @return bool|string
171
+ * @since 1.0
172
+ * @author Antonino Scarfi' <antonino.scarfi@yithemes.com>
173
+ */
174
+ protected static function youtube_id_by_url( $url ) {
175
+ if ( preg_match( '/http(s)?:\/\/youtu.be/', $url, $matches) ) {
176
+ $url = parse_url($url, PHP_URL_PATH);
177
+ $url = str_replace( '/', '', $url);
178
+ return $url;
179
+
180
+ } elseif ( preg_match( '/watch/', $url, $matches) ) {
181
+ $arr = parse_url($url);
182
+ $url = str_replace( 'v=', '', $arr['query'] );
183
+ return $url;
184
+
185
+ } elseif ( preg_match( '/http(s)?:\/\/(\w+.)?youtube.com\/v/', $url, $matches) ) {
186
+ $arr = parse_url($url);
187
+ $url = str_replace( '/v/', '', $arr['path'] );
188
+ return $url;
189
+
190
+ } elseif ( preg_match( '/http(s)?:\/\/(\w+.)?youtube.com\/embed/', $url, $matches) ) {
191
+ $arr = parse_url($url);
192
+ $url = str_replace( '/embed/', '', $arr['path'] );
193
+ return $url;
194
+
195
+ } elseif ( preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=[0-9]/)[^&\n]+|(?<=v=)[^&\n]+#", $url, $matches) ) {
196
+ return $matches[0];
197
+
198
+ } else {
199
+ return false;
200
+ }
201
+ }
202
+
203
+ }
204
  }
plugin-fw/licence/assets/css/yit-licence.css CHANGED
@@ -1,439 +1,439 @@
1
- /* === Plugins Upgrader === */
2
-
3
- .yit-plugin-changelog-wrapper {
4
- display: none;
5
- }
6
-
7
- .yit-plugin-changelog-title {
8
- text-transform: uppercase;
9
- }
10
-
11
- .yit-plugin-changelog {
12
- background: #fcfcfc;
13
- height: 97%;
14
- z-index: 999;
15
- overflow: auto;
16
- }
17
-
18
- /* === Plugins Licence Activation === */
19
-
20
- .yit-container.product-licence-activation {
21
- font-family: 'Raleway', sans-serif;
22
- }
23
-
24
- .yit-container.product-licence-activation .to-active-wrapper {
25
- margin-bottom: 60px;
26
- max-width: 900px;
27
- }
28
-
29
- .yit-container.product-licence-activation .to-active-wrapper form.to-active-form {
30
- position: relative;
31
- border-color: #e1e1e1;
32
- border-style: solid;
33
- border-width: 0;
34
- }
35
-
36
- .yit-container.product-licence-activation .to-active-wrapper form.to-active-form:first-child {
37
- border-top-width: 1px;
38
- }
39
-
40
- .yit-container.product-licence-activation .to-active-wrapper form.to-active-form:last-child {
41
- border-bottom-width: 1px;
42
- }
43
-
44
- .yit-container.product-licence-activation .to-active-wrapper table.to-active-table {
45
- border-width: 0;
46
- border-spacing: 0;
47
- width: 100%;
48
- }
49
-
50
- .yit-container.product-licence-activation .message {
51
- display: none;
52
- line-height: normal;
53
- background: #ffffff url(../images/licence-error.png) 15px center no-repeat;
54
- padding-left: 65px;
55
- padding-right: 15px;
56
- width: 150px;
57
- }
58
-
59
- .yit-container.product-licence-activation .message-wrapper {
60
- height: 75px;
61
- display: none;
62
- position: absolute;
63
- top: 0;
64
- right: -250px;
65
- border: 1px solid #ff3838;
66
- }
67
-
68
- .yit-container.product-licence-activation .message-wrapper.visible {
69
- display: table;
70
- }
71
-
72
- .yit-container.product-licence-activation .message {
73
- display: table-cell;
74
- vertical-align: middle;
75
- }
76
-
77
- .yit-container.product-licence-activation .arrow-left:after,
78
- .yit-container.product-licence-activation .arrow-left:before {
79
- content: "";
80
- display: block;
81
- width: 0;
82
- height: 0;
83
- position: absolute;
84
- }
85
-
86
- .yit-container.product-licence-activation .arrow-left:before {
87
- border-top: 9px solid transparent;
88
- border-bottom: 9px solid transparent;
89
- border-right: 9px solid #ff3838;
90
- top: 26px;
91
- left: -9px;
92
- }
93
-
94
- .yit-container.product-licence-activation .arrow-left:after {
95
- border-top: 8px solid transparent;
96
- border-bottom: 8px solid transparent;
97
- border-right: 8px solid #fff;
98
- left: -8px;
99
- top: 27px;
100
- }
101
-
102
- .yit-container.product-licence-activation h2,
103
- .yit-container.product-licence-activation h3 {
104
- text-transform: uppercase;
105
- font-weight: 800;
106
- margin-bottom: 30px;
107
- }
108
-
109
- .yit-container.product-licence-activation h2 {
110
- color: #808a97;
111
- font-size: 25px;
112
- }
113
- .yit-container.product-licence-activation h3 {
114
- color: #313131;
115
- font-size: 15px;
116
- height: 20px;
117
- }
118
-
119
- .yit-container.product-licence-activation h3.to-active {
120
- height: 20px;
121
- position: relative;
122
- vertical-align: top;
123
- }
124
-
125
- .yit-container.product-licence-activation .spinner{
126
- vertical-align: -5px;
127
- float: none;
128
- }
129
-
130
- .yit-container.product-licence-activation .spinner.show{
131
- visibility: visible;
132
- }
133
-
134
- .yit-container.product-licence-activation .licence-check-section{
135
- margin-bottom: 60px;
136
- }
137
-
138
- .yit-container.product-licence-activation span.licence-label {
139
- font-weight: 500;
140
- color: #606060;
141
- margin-bottom: 30px;
142
- }
143
-
144
- .yit-container.product-licence-activation .button-licence {
145
- border: 0;
146
- font-size: 13px;
147
- text-transform: uppercase;
148
- background-color: #808a97;
149
- color: #fff;
150
- font-weight: 700;
151
- border-radius: 3px;
152
- cursor: pointer;
153
- text-decoration: none;
154
- padding: 5px 7px;
155
- -webkit-transition: background-color 0.3s ease;
156
- -moz-transition: background-color 0.3s ease;
157
- -ms-transition: background-color 0.3s ease;
158
- -o-transition: background-color 0.3s ease;
159
- transition: background-color 0.3s ease;
160
- }
161
-
162
- .yit-container.product-licence-activation .button-licence:hover {
163
- background-color: #4d5c6f;
164
- }
165
-
166
- .yit-container.product-licence-activation .button-licence.clicked {
167
- cursor: not-allowed;
168
- background-color: #e2e2e2 !important;
169
- }
170
-
171
- .yit-container.product-licence-activation .button-licence.licence-check {
172
- font-weight: 400;
173
- padding: 12px 19px;
174
- }
175
-
176
- .yit-container.product-licence-activation .button-licence.licence-deactive,
177
- .yit-container.product-licence-activation .button-licence.licence-renew {
178
- text-decoration: none;
179
- padding: 7px 12px;
180
- font-size: 9px;
181
- }
182
-
183
- .yit-container.product-licence-activation table:not(.expired-table) .button-licence.licence-renew {
184
- margin-left: 10px;
185
- }
186
-
187
- .yit-container.product-licence-activation .button-licence.licence-deactive:focus,
188
- .yit-container.product-licence-activation .button-licence.licence-renew:focus {
189
- box-shadow: none;
190
- }
191
-
192
- .yit-container.product-licence-activation table:not(.to-active-table) {
193
- width: auto;
194
- border: 1px solid #dcdcdc;
195
- border-spacing: 0;
196
- border-radius: 5px;
197
- border-collapse: separate;
198
- overflow: hidden;
199
- }
200
-
201
- .yit-container.product-licence-activation table:not(.to-active-table) th {
202
- border-bottom: 1px solid #dcdcdc;
203
- padding: 0 10px;
204
- }
205
-
206
- .yit-container.product-licence-activation table tbody tr td.product-licence-key {
207
- text-transform: lowercase;
208
- }
209
-
210
- .yit-container.product-licence-activation table:not(.to-active-table) td,
211
- .yit-container.product-licence-activation table:not(.to-active-table) th {
212
- border-right: 1px solid #dcdcdc;
213
- }
214
-
215
- .yit-container.product-licence-activation table td:last-child,
216
- .yit-container.product-licence-activation table th:last-child {
217
- border-right: 0;
218
- }
219
-
220
- .yit-container.product-licence-activation table thead tr {
221
- background-color: #f6f4f4;
222
- }
223
-
224
- .yit-container.product-licence-activation table tbody tr {
225
- background-color: #ffffff;
226
- }
227
-
228
- .yit-container.product-licence-activation table tbody tr:nth-child(2n) {
229
- background-color: #f4f4f4;
230
- }
231
-
232
- .yit-container.product-licence-activation table thead tr th {
233
- font-size: 11px;
234
- color: #313131;
235
- text-transform: uppercase;
236
- font-weight: bold;
237
- }
238
-
239
- .yit-container.product-licence-activation table thead tr,
240
- .yit-container.product-licence-activation table tbody tr {
241
- line-height: 60px;
242
- }
243
-
244
- .yit-container.product-licence-activation table tbody tr td.product-licence-membership .dashicons-no-alt {
245
- color: #b20015;
246
- }
247
-
248
- .yit-container.product-licence-activation table tbody tr td.product-licence-membership .dashicons-yes {
249
- color: #1ca800;
250
- }
251
-
252
- .yit-container.product-licence-activation table tbody tr td{
253
- text-align: center;
254
- line-height: 20px;
255
- padding: 10px 5px;
256
- }
257
-
258
- .yit-container.product-licence-activation .button-licence.licence-activation {
259
- padding: 12px 18px;
260
- }
261
-
262
- .yit-container.product-licence-activation .to-active-table tr {
263
- line-height: 75px;
264
- }
265
-
266
- .yit-container.product-licence-activation .to-active-table tr.product-row {
267
- background-color: transparent;
268
- -webkit-transition: all 0.3s ease;
269
- -moz-transition: all 0.3s ease;
270
- -ms-transition: all 0.3s ease;
271
- -o-transition: all 0.3s ease;
272
- transition: all 0.3s ease;
273
- }
274
-
275
- .yit-container.product-licence-activation .to-active-table tr.product-row.error {
276
- background-color: #ffdcdc;
277
- }
278
-
279
- .yit-container.product-licence-activation .to-active-table td {
280
- padding-right: 12px;
281
- width: 33%;
282
- }
283
-
284
- .yit-container.product-licence-activation td.product-name {
285
- color: #808a97;
286
- font-size: 12px;
287
- text-transform: uppercase;
288
- font-weight: bold;
289
- line-height: 20px;
290
- padding: 10px 20px;
291
- }
292
-
293
- .yit-container.product-licence-activation .to-active-table td.product-name {
294
- width: 20%;
295
- }
296
-
297
- .yit-container.product-licence-activation .to-active-table td.activate-button {
298
- width: 15%;
299
- position: relative;
300
- }
301
-
302
- .yit-container.product-licence-activation input[type=text],
303
- .yit-container.product-licence-activation input[type=email]{
304
- -webkit-transition: all 0.3s ease;
305
- -moz-transition: all 0.3s ease;
306
- -ms-transition: all 0.3s ease;
307
- -o-transition: all 0.3s ease;
308
- transition: all 0.3s ease;
309
-
310
- border: 1px solid #dcdcdc;
311
- padding: 0 15px;
312
- border-radius: 3px;
313
- height: 41px;
314
- width: 100%;
315
- }
316
-
317
- .yit-container.product-licence-activation input[type=text].require,
318
- .yit-container.product-licence-activation input[type=email].require {
319
- border: 1px solid #ff3838;
320
- }
321
-
322
- .yit-container.product-licence-activation input[type=text]:focus,
323
- .yit-container.product-licence-activation input[type=email]:focus{
324
- webkit-box-shadow: 0 0 1px rgba(30,140,190,.8);
325
- box-shadow: 0 0 1px rgba(30,140,190,.8);
326
- }
327
-
328
- .yit-container.product-licence-activation input[type=text],
329
- .yit-container.product-licence-activation input[type=email]{
330
- text-transform: uppercase;
331
- text-align: center;
332
- }
333
-
334
- .yit-container.product-licence-activation input[type=submit]:focus{
335
- outline: 0;
336
- }
337
-
338
- /* Licence FAQ */
339
- .yit-container.product-licence-activation .activation-faq {
340
- background: #ffffff;
341
- margin-bottom: 20px;
342
- border: 1px solid #dcdcdc;
343
- padding: 0 15px;
344
- border-radius: 3px;
345
- }
346
-
347
- .yit-container.product-licence-activation .activation-faq h3{
348
- color: #808a97;
349
- }
350
-
351
- #yith-licence-notice {
352
- margin-left: 0;
353
- visibility: hidden;
354
- min-height: 38px;
355
- }
356
-
357
- #yith-licence-notice.visible {
358
- visibility: visible;
359
- }
360
-
361
- /* === Responsive === */
362
-
363
- @media (max-width: 767px) {
364
- .yit-container.product-licence-activation .activation-faq {
365
- margin-right: 5px;
366
- }
367
- }
368
-
369
- @media (max-width: 480px) {
370
- .yit-container.product-licence-activation .activation-faq {
371
- margin-right: 5px;
372
- }
373
- }
374
-
375
- @media (min-width: 768px) and (max-width: 992px) {
376
- .yit-container.product-licence-activation .button-licence.licence-deactive,
377
- .yit-container.product-licence-activation .button-licence.licence-renew {
378
- margin-bottom: 10px;
379
- display: block;
380
- margin-left: 0;
381
- padding: 5px 7px;
382
- }
383
-
384
- .yit-container.product-licence-activation .button-licence.licence-deactive {
385
- margin-bottom: 10px;
386
- }
387
-
388
- .yit-container.product-licence-activation table:not(.to-active-table) th {
389
- line-height: 20px;
390
- }
391
-
392
- .yit-container.product-licence-activation table tbody tr td {
393
- padding: 5px;
394
- }
395
-
396
- .yit-container.product-licence-activation .activation-faq {
397
- margin-right: 20px;
398
- }
399
- }
400
-
401
- @media (min-width: 980px) and (max-width: 1199px) {
402
- .yit-container.product-licence-activation .button-licence.licence-deactive,
403
- .yit-container.product-licence-activation .button-licence.licence-renew {
404
- display: block;
405
- margin-left: 0;
406
- padding: 5px 7px;
407
- }
408
-
409
- .yit-container.product-licence-activation .button-licence.licence-renew {
410
- margin-top: 10px;
411
- }
412
-
413
- .yit-container.product-licence-activation table:not(.to-active-table) th {
414
- line-height: 20px;
415
- }
416
-
417
- .yit-container.product-licence-activation table tbody tr td {
418
- padding: 5px;
419
- }
420
-
421
- .yit-container.product-licence-activation .activation-faq {
422
- width: 75%;
423
- }
424
- }
425
-
426
- @media (min-width: 1200px) {
427
- .yit-container.product-licence-activation{
428
- width: auto;
429
- }
430
-
431
- .yit-container.product-licence-activation .activation-faq {
432
- width: 50%;
433
- }
434
- }
435
-
436
- @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
437
- only screen and (-o-min-device-pixel-ratio: 3/2),
438
- only screen and (min--moz-device-pixel-ratio: 1.5),
439
- only screen and (min-device-pixel-ratio: 1.5) {}
1
+ /* === Plugins Upgrader === */
2
+
3
+ .yit-plugin-changelog-wrapper {
4
+ display: none;
5
+ }
6
+
7
+ .yit-plugin-changelog-title {
8
+ text-transform: uppercase;
9
+ }
10
+
11
+ .yit-plugin-changelog {
12
+ background: #fcfcfc;
13
+ height: 97%;
14
+ z-index: 999;
15
+ overflow: auto;
16
+ }
17
+
18
+ /* === Plugins Licence Activation === */
19
+
20
+ .yit-container.product-licence-activation {
21
+ font-family: 'Raleway', sans-serif;
22
+ }
23
+
24
+ .yit-container.product-licence-activation .to-active-wrapper {
25
+ margin-bottom: 60px;
26
+ max-width: 900px;
27
+ }
28
+
29
+ .yit-container.product-licence-activation .to-active-wrapper form.to-active-form {
30
+ position: relative;
31
+ border-color: #e1e1e1;
32
+ border-style: solid;
33
+ border-width: 0;
34
+ }
35
+
36
+ .yit-container.product-licence-activation .to-active-wrapper form.to-active-form:first-child {
37
+ border-top-width: 1px;
38
+ }
39
+
40
+ .yit-container.product-licence-activation .to-active-wrapper form.to-active-form:last-child {
41
+ border-bottom-width: 1px;
42
+ }
43
+
44
+ .yit-container.product-licence-activation .to-active-wrapper table.to-active-table {
45
+ border-width: 0;
46
+ border-spacing: 0;
47
+ width: 100%;
48
+ }
49
+
50
+ .yit-container.product-licence-activation .message {
51
+ display: none;
52
+ line-height: normal;
53
+ background: #ffffff url(../images/licence-error.png) 15px center no-repeat;
54
+ padding-left: 65px;
55
+ padding-right: 15px;
56
+ width: 150px;
57
+ }
58
+
59
+ .yit-container.product-licence-activation .message-wrapper {
60
+ height: 75px;
61
+ display: none;
62
+ position: absolute;
63
+ top: 0;
64
+ right: -250px;
65
+ border: 1px solid #ff3838;
66
+ }
67
+
68
+ .yit-container.product-licence-activation .message-wrapper.visible {
69
+ display: table;
70
+ }
71
+
72
+ .yit-container.product-licence-activation .message {
73
+ display: table-cell;
74
+ vertical-align: middle;
75
+ }
76
+
77
+ .yit-container.product-licence-activation .arrow-left:after,
78
+ .yit-container.product-licence-activation .arrow-left:before {
79
+ content: "";
80
+ display: block;
81
+ width: 0;
82
+ height: 0;
83
+ position: absolute;
84
+ }
85
+
86
+ .yit-container.product-licence-activation .arrow-left:before {
87
+ border-top: 9px solid transparent;
88
+ border-bottom: 9px solid transparent;
89
+ border-right: 9px solid #ff3838;
90
+ top: 26px;
91
+ left: -9px;
92
+ }
93
+
94
+ .yit-container.product-licence-activation .arrow-left:after {
95
+ border-top: 8px solid transparent;
96
+ border-bottom: 8px solid transparent;
97
+ border-right: 8px solid #fff;
98
+ left: -8px;
99
+ top: 27px;
100
+ }
101
+
102
+ .yit-container.product-licence-activation h2,
103
+ .yit-container.product-licence-activation h3 {
104
+ text-transform: uppercase;
105
+ font-weight: 800;
106
+ margin-bottom: 30px;
107
+ }
108
+
109
+ .yit-container.product-licence-activation h2 {
110
+ color: #808a97;
111
+ font-size: 25px;
112
+ }
113
+ .yit-container.product-licence-activation h3 {
114
+ color: #313131;
115
+ font-size: 15px;
116
+ height: 20px;
117
+ }
118
+
119
+ .yit-container.product-licence-activation h3.to-active {
120
+ height: 20px;
121
+ position: relative;
122
+ vertical-align: top;
123
+ }
124
+
125
+ .yit-container.product-licence-activation .spinner{
126
+ vertical-align: -5px;
127
+ float: none;
128
+ }
129
+
130
+ .yit-container.product-licence-activation .spinner.show{
131
+ visibility: visible;
132
+ }
133
+
134
+ .yit-container.product-licence-activation .licence-check-section{
135
+ margin-bottom: 60px;
136
+ }
137
+
138
+ .yit-container.product-licence-activation span.licence-label {
139
+ font-weight: 500;
140
+ color: #606060;
141
+ margin-bottom: 30px;
142
+ }
143
+
144
+ .yit-container.product-licence-activation .button-licence {
145
+ border: 0;
146
+ font-size: 13px;
147
+ text-transform: uppercase;
148
+ background-color: #808a97;
149
+ color: #fff;
150
+ font-weight: 700;
151
+ border-radius: 3px;
152
+ cursor: pointer;
153
+ text-decoration: none;
154
+ padding: 5px 7px;
155
+ -webkit-transition: background-color 0.3s ease;
156
+ -moz-transition: background-color 0.3s ease;
157
+ -ms-transition: background-color 0.3s ease;
158
+ -o-transition: background-color 0.3s ease;
159
+ transition: background-color 0.3s ease;
160
+ }
161
+
162
+ .yit-container.product-licence-activation .button-licence:hover {
163
+ background-color: #4d5c6f;
164
+ }
165
+
166
+ .yit-container.product-licence-activation .button-licence.clicked {
167
+ cursor: not-allowed;
168
+ background-color: #e2e2e2 !important;
169
+ }
170
+
171
+ .yit-container.product-licence-activation .button-licence.licence-check {
172
+ font-weight: 400;
173
+ padding: 12px 19px;
174
+ }
175
+
176
+ .yit-container.product-licence-activation .button-licence.licence-deactive,
177
+ .yit-container.product-licence-activation .button-licence.licence-renew {
178
+ text-decoration: none;
179
+ padding: 7px 12px;
180
+ font-size: 9px;
181
+ }
182
+
183
+ .yit-container.product-licence-activation table:not(.expired-table) .button-licence.licence-renew {
184
+ margin-left: 10px;
185
+ }
186
+
187
+ .yit-container.product-licence-activation .button-licence.licence-deactive:focus,
188
+ .yit-container.product-licence-activation .button-licence.licence-renew:focus {
189
+ box-shadow: none;
190
+ }
191
+
192
+ .yit-container.product-licence-activation table:not(.to-active-table) {
193
+ width: auto;
194
+ border: 1px solid #dcdcdc;
195
+ border-spacing: 0;
196
+ border-radius: 5px;
197
+ border-collapse: separate;
198
+ overflow: hidden;
199
+ }
200
+
201
+ .yit-container.product-licence-activation table:not(.to-active-table) th {
202
+ border-bottom: 1px solid #dcdcdc;
203
+ padding: 0 10px;
204
+ }
205
+
206
+ .yit-container.product-licence-activation table tbody tr td.product-licence-key {
207
+ text-transform: lowercase;
208
+ }
209
+
210
+ .yit-container.product-licence-activation table:not(.to-active-table) td,
211
+ .yit-container.product-licence-activation table:not(.to-active-table) th {
212
+ border-right: 1px solid #dcdcdc;
213
+ }
214
+
215
+ .yit-container.product-licence-activation table td:last-child,
216
+ .yit-container.product-licence-activation table th:last-child {
217
+ border-right: 0;
218
+ }
219
+
220
+ .yit-container.product-licence-activation table thead tr {
221
+ background-color: #f6f4f4;
222
+ }
223
+
224
+ .yit-container.product-licence-activation table tbody tr {
225
+ background-color: #ffffff;
226
+ }
227
+
228
+ .yit-container.product-licence-activation table tbody tr:nth-child(2n) {
229
+ background-color: #f4f4f4;
230
+ }
231
+
232
+ .yit-container.product-licence-activation table thead tr th {
233
+ font-size: 11px;
234
+ color: #313131;
235
+ text-transform: uppercase;
236
+ font-weight: bold;
237
+ }
238
+
239
+ .yit-container.product-licence-activation table thead tr,
240
+ .yit-container.product-licence-activation table tbody tr {
241
+ line-height: 60px;
242
+ }
243
+
244
+ .yit-container.product-licence-activation table tbody tr td.product-licence-membership .dashicons-no-alt {
245
+ color: #b20015;
246
+ }
247
+
248
+ .yit-container.product-licence-activation table tbody tr td.product-licence-membership .dashicons-yes {
249
+ color: #1ca800;
250
+ }
251
+
252
+ .yit-container.product-licence-activation table tbody tr td{
253
+ text-align: center;
254
+ line-height: 20px;
255
+ padding: 10px 5px;
256
+ }
257
+
258
+ .yit-container.product-licence-activation .button-licence.licence-activation {
259
+ padding: 12px 18px;
260
+ }
261
+
262
+ .yit-container.product-licence-activation .to-active-table tr {
263
+ line-height: 75px;
264
+ }
265
+
266
+ .yit-container.product-licence-activation .to-active-table tr.product-row {
267
+ background-color: transparent;
268
+ -webkit-transition: all 0.3s ease;
269
+ -moz-transition: all 0.3s ease;
270
+ -ms-transition: all 0.3s ease;
271
+ -o-transition: all 0.3s ease;
272
+ transition: all 0.3s ease;
273
+ }
274
+
275
+ .yit-container.product-licence-activation .to-active-table tr.product-row.error {
276
+ background-color: #ffdcdc;
277
+ }
278
+
279
+ .yit-container.product-licence-activation .to-active-table td {
280
+ padding-right: 12px;
281
+ width: 33%;
282
+ }
283
+
284
+ .yit-container.product-licence-activation td.product-name {
285
+ color: #808a97;
286
+ font-size: 12px;
287
+ text-transform: uppercase;
288
+ font-weight: bold;
289
+ line-height: 20px;
290
+ padding: 10px 20px;
291
+ }
292
+
293
+ .yit-container.product-licence-activation .to-active-table td.product-name {
294
+ width: 20%;
295
+ }
296
+
297
+ .yit-container.product-licence-activation .to-active-table td.activate-button {
298
+ width: 15%;
299
+ position: relative;
300
+ }
301
+
302
+ .yit-container.product-licence-activation input[type=text],
303
+ .yit-container.product-licence-activation input[type=email]{
304
+ -webkit-transition: all 0.3s ease;
305
+ -moz-transition: all 0.3s ease;
306
+ -ms-transition: all 0.3s ease;
307
+ -o-transition: all 0.3s ease;
308
+ transition: all 0.3s ease;
309
+
310
+ border: 1px solid #dcdcdc;
311
+ padding: 0 15px;
312
+ border-radius: 3px;
313
+ height: 41px;
314
+ width: 100%;
315
+ }
316
+
317
+ .yit-container.product-licence-activation input[type=text].require,
318
+ .yit-container.product-licence-activation input[type=email].require {
319
+ border: 1px solid #ff3838;
320
+ }
321
+
322
+ .yit-container.product-licence-activation input[type=text]:focus,
323
+ .yit-container.product-licence-activation input[type=email]:focus{
324
+ webkit-box-shadow: 0 0 1px rgba(30,140,190,.8);
325
+ box-shadow: 0 0 1px rgba(30,140,190,.8);
326
+ }
327
+
328
+ .yit-container.product-licence-activation input[type=text],
329
+ .yit-container.product-licence-activation input[type=email]{
330
+ text-transform: uppercase;
331
+ text-align: center;
332
+ }
333
+
334
+ .yit-container.product-licence-activation input[type=submit]:focus{
335
+ outline: 0;
336
+ }
337
+
338
+ /* Licence FAQ */
339
+ .yit-container.product-licence-activation .activation-faq {
340
+ background: #ffffff;
341
+ margin-bottom: 20px;
342
+ border: 1px solid #dcdcdc;
343
+ padding: 0 15px;
344
+ border-radius: 3px;
345
+ }
346
+
347
+ .yit-container.product-licence-activation .activation-faq h3{
348
+ color: #808a97;
349
+ }
350
+
351
+ #yith-licence-notice {
352
+ margin-left: 0;
353
+ visibility: hidden;
354
+ min-height: 38px;
355
+ }
356
+
357
+ #yith-licence-notice.visible {
358
+ visibility: visible;
359
+ }
360
+
361
+ /* === Responsive === */
362
+
363
+ @media (max-width: 767px) {
364
+ .yit-container.product-licence-activation .activation-faq {
365
+ margin-right: 5px;
366
+ }
367
+ }
368
+
369
+ @media (max-width: 480px) {
370
+ .yit-container.product-licence-activation .activation-faq {
371
+ margin-right: 5px;
372
+ }
373
+ }
374
+
375
+ @media (min-width: 768px) and (max-width: 992px) {
376
+ .yit-container.product-licence-activation .button-licence.licence-deactive,
377
+ .yit-container.product-licence-activation .button-licence.licence-renew {
378
+ margin-bottom: 10px;
379
+ display: block;
380
+ margin-left: 0;
381
+ padding: 5px 7px;
382
+ }
383
+
384
+ .yit-container.product-licence-activation .button-licence.licence-deactive {
385
+ margin-bottom: 10px;
386
+ }
387
+
388
+ .yit-container.product-licence-activation table:not(.to-active-table) th {
389
+ line-height: 20px;
390
+ }
391
+
392
+ .yit-container.product-licence-activation table tbody tr td {
393
+ padding: 5px;
394
+ }
395
+
396
+ .yit-container.product-licence-activation .activation-faq {
397
+ margin-right: 20px;
398
+ }
399
+ }
400
+
401
+ @media (min-width: 980px) and (max-width: 1199px) {
402
+ .yit-container.product-licence-activation .button-licence.licence-deactive,
403
+ .yit-container.product-licence-activation .button-licence.licence-renew {
404
+ display: block;
405
+ margin-left: 0;
406
+ padding: 5px 7px;
407
+ }
408
+
409
+ .yit-container.product-licence-activation .button-licence.licence-renew {
410
+ margin-top: 10px;
411
+ }
412
+
413
+ .yit-container.product-licence-activation table:not(.to-active-table) th {
414
+ line-height: 20px;
415
+ }
416
+
417
+ .yit-container.product-licence-activation table tbody tr td {
418
+ padding: 5px;
419
+ }
420
+
421
+ .yit-container.product-licence-activation .activation-faq {
422
+ width: 75%;
423
+ }
424
+ }
425
+
426
+ @media (min-width: 1200px) {
427
+ .yit-container.product-licence-activation{
428
+ width: auto;
429
+ }
430
+
431
+ .yit-container.product-licence-activation .activation-faq {
432
+ width: 50%;
433
+ }
434
+ }
435
+
436
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
437
+ only screen and (-o-min-device-pixel-ratio: 3/2),
438
+ only screen and (min--moz-device-pixel-ratio: 1.5),
439
+ only screen and (min-device-pixel-ratio: 1.5) {}
plugin-fw/licence/assets/js/yit-licence.js CHANGED
@@ -1,196 +1,196 @@
1
- /**
2
- * This file belongs to the YIT Plugin Framework.
3
- *
4
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
- * that is bundled with this package in the file LICENSE.txt.
6
- * It is also available through the world-wide-web at this URL:
7
- * http://www.gnu.org/licenses/gpl-3.0.txt
8
- */
9
-
10
-
11
- (function ($) {
12
-
13
- /* === Licence API === */
14
-
15
- var licence_activation = function (button) {
16
- button.on('click', function (e, button) {
17
- e.preventDefault();
18
-
19
- var t = $(this),
20
- form_id = t.data('formid'),
21
- form = $('#' + form_id),
22
- data = form.serialize(),
23
- message = $(form).find('.message'),
24
- message_wrapper = $(form).find('.message-wrapper'),
25
- email = form.find('.user-email'),
26
- licence_key = form.find('.licence-key'),
27
- email_val = form.find('.user-email').val(),
28
- licence_key_val = form.find('.licence-key').val(),
29
- error = false,
30
- error_fields = new Array(),
31
- product_row = form.find('.product-row'),
32
- licence_activation = $('.licence-activation'),
33
- spinner = $('#products-to-active').find('.spinner');
34
-
35
- /* Init Input Fields */
36
- message.empty();
37
- message_wrapper.removeClass('visible')
38
- email.removeClass('require');
39
- licence_key.removeClass('require');
40
- product_row.removeClass('error');
41
- spinner.addClass('show');
42
- t.add(licence_activation).prop("disabled", true).addClass('clicked');
43
-
44
- if ('' == email_val) {
45
- error = true;
46
- error_fields[ error_fields.length ] = licence_message.email;
47
- email.addClass('require');
48
- }
49
-
50
- if ('' == licence_key_val) {
51
- error = true;
52
- error_fields[ error_fields.length ] = licence_message.license_key;
53
- licence_key.addClass('require');
54
- }
55
-
56
- if (false == error) {
57
- jQuery.ajax({
58
- type : 'POST',
59
- url : ajaxurl,
60
- data : data,
61
- success: function (response) {
62
-
63
- spinner.removeClass('show');
64
- t.add(licence_activation).prop("disabled", false).removeClass('clicked');
65
-
66
- if (true == response.activated) {
67
- $('.product-licence-activation').empty().replaceWith(response.template);
68
- licence_api();
69
- } else if (false != response) {
70
- message.text(response.error);
71
- message_wrapper.addClass('visible');
72
- product_row.addClass('error');
73
- } else {
74
- message.text(licence_message.server);
75
- message_wrapper.addClass('visible');
76
- product_row.addClass('error');
77
- }
78
- }
79
- });
80
- } else {
81
- if (error_fields.length == 1) {
82
- message.text(licence_message.error.replace('%field%', error_fields[0]));
83
- message_wrapper.addClass('visible');
84
- product_row.addClass('error');
85
- } else {
86
- var message_text = licence_message.errors;
87
- for (var i = 0; i < error_fields.length; i++) {
88
- message_text = message_text.replace('%field_' + ( i + 1) + '%', error_fields[i]);
89
- message_wrapper.addClass('visible');
90
- }
91
- message.text(message_text);
92
- message_wrapper.addClass('visible');
93
- product_row.addClass('error');
94
- }
95
-
96
- spinner.removeClass('show');
97
- t.add(licence_activation).prop("disabled", false).removeClass('clicked');
98
- }
99
- });
100
- };
101
-
102
- var licence_update = function (button) {
103
- button.on('click', function (e) {
104
- e.preventDefault();
105
-
106
- var t = $(this),
107
- form = $('#licence-check-update'),
108
- data = form.serialize();
109
-
110
- t.prop("disabled", true).addClass('clicked');
111
- form.find('div.spinner').addClass('show');
112
-
113
- jQuery.ajax({
114
- type : 'POST',
115
- url : ajaxurl,
116
- data : data,
117
- success: function (response) {
118
- $('.product-licence-activation').empty().replaceWith(response.template);
119
- licence_api();
120
- }
121
- });
122
- });
123
- };
124
-
125
- var licence_deactivate = function (button) {
126
- button.on('click', function (e) {
127
- e.preventDefault();
128
-
129
- var check = script_info.is_debug == true ? true : confirm( licence_message.are_you_sure );
130
-
131
- if( check == true ){
132
- var t = $(this),
133
- licence_key = t.data('licence-key'),
134
- licence_email = t.data('licence-email'),
135
- product_init = t.data('product-init'),
136
- action = t.data('action'),
137
- renew = $('.licence-renew'),
138
- deactive = $('.licence-deactive'),
139
- message = $('#yith-licence-notice'),
140
- activated_table = $('.activated-table');
141
-
142
- t.add(renew).add(deactive).prop("disabled", true).addClass('clicked');
143
- $('#activated-products').find('.spinner').addClass('show');
144
-
145
- jQuery.ajax({
146
- type : 'POST',
147
- url : ajaxurl,
148
- data : {
149
- action: action,
150
- licence_key: licence_key,
151
- email: licence_email,
152
- product_init: product_init
153
- },
154
- success: function (response) {
155
- message.css( 'maxWidth', activated_table.width() );
156
- if (false == response.activated && typeof response.error == 'undefined') {
157
- $('.product-licence-activation').empty().replaceWith(response.template);
158
- licence_api();
159
- }
160
-
161
- if (false == response.activated && typeof response.error != 'undefined') {
162
- message.find('p.yith-licence-notice-message').html(response.error);
163
- message.removeClass('notice-success').addClass('notice-error visible');
164
- t.add(renew).add(deactive).add(renew).prop("disabled", false).removeClass('clicked');
165
- $('#activated-products').find('.spinner').removeClass('show');
166
- }
167
-
168
- else if (false == response) {
169
- message.find('p.yith-licence-notice-message').html(licence_message.server);
170
- message.removeClass('notice-success').addClass('notice-error visible');
171
- t.add(renew).add(deactive).add(renew).prop("disabled", false).removeClass('clicked');
172
- $('#activated-products').find('.spinner').removeClass('show');
173
- }
174
- }
175
- });
176
- }
177
- });
178
- };
179
-
180
- var licence_api = function () {
181
- var button = $('.licence-activation'),
182
- check = $('.licence-check'),
183
- deactivated = $('.licence-deactive');
184
-
185
- licence_activation(button);
186
- licence_update(check);
187
- licence_deactivate(deactivated);
188
- };
189
-
190
- licence_api();
191
-
192
- $('body').on('click', '.yit-changelog-button', function (e) {
193
- $('#TB_window').remove();
194
- });
195
-
196
  })(jQuery);
1
+ /**
2
+ * This file belongs to the YIT Plugin Framework.
3
+ *
4
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
+ * that is bundled with this package in the file LICENSE.txt.
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.gnu.org/licenses/gpl-3.0.txt
8
+ */
9
+
10
+
11
+ (function ($) {
12
+
13
+ /* === Licence API === */
14
+
15
+ var licence_activation = function (button) {
16
+ button.on('click', function (e, button) {
17
+ e.preventDefault();
18
+
19
+ var t = $(this),
20
+ form_id = t.data('formid'),
21
+ form = $('#' + form_id),
22
+ data = form.serialize(),
23
+ message = $(form).find('.message'),
24
+ message_wrapper = $(form).find('.message-wrapper'),
25
+ email = form.find('.user-email'),
26
+ licence_key = form.find('.licence-key'),
27
+ email_val = form.find('.user-email').val(),
28
+ licence_key_val = form.find('.licence-key').val(),
29
+ error = false,
30
+ error_fields = new Array(),
31
+ product_row = form.find('.product-row'),
32
+ licence_activation = $('.licence-activation'),
33
+ spinner = $('#products-to-active').find('.spinner');
34
+
35
+ /* Init Input Fields */
36
+ message.empty();
37
+ message_wrapper.removeClass('visible')
38
+ email.removeClass('require');
39
+ licence_key.removeClass('require');
40
+ product_row.removeClass('error');
41
+ spinner.addClass('show');
42
+ t.add(licence_activation).prop("disabled", true).addClass('clicked');
43
+
44
+ if ('' == email_val) {
45
+ error = true;
46
+ error_fields[ error_fields.length ] = licence_message.email;
47
+ email.addClass('require');
48
+ }
49
+
50
+ if ('' == licence_key_val) {
51
+ error = true;
52
+ error_fields[ error_fields.length ] = licence_message.license_key;
53
+ licence_key.addClass('require');
54
+ }
55
+
56
+ if (false == error) {
57
+ jQuery.ajax({
58
+ type : 'POST',
59
+ url : ajaxurl,
60
+ data : data,
61
+ success: function (response) {
62
+
63
+ spinner.removeClass('show');
64
+ t.add(licence_activation).prop("disabled", false).removeClass('clicked');
65
+
66
+ if (true == response.activated) {
67
+ $('.product-licence-activation').empty().replaceWith(response.template);
68
+ licence_api();
69
+ } else if (false != response) {
70
+ message.text(response.error);
71
+ message_wrapper.addClass('visible');
72
+ product_row.addClass('error');
73
+ } else {
74
+ message.text(licence_message.server);
75
+ message_wrapper.addClass('visible');
76
+ product_row.addClass('error');
77
+ }
78
+ }
79
+ });
80
+ } else {
81
+ if (error_fields.length == 1) {
82
+ message.text(licence_message.error.replace('%field%', error_fields[0]));
83
+ message_wrapper.addClass('visible');
84
+ product_row.addClass('error');
85
+ } else {
86
+ var message_text = licence_message.errors;
87
+ for (var i = 0; i < error_fields.length; i++) {
88
+ message_text = message_text.replace('%field_' + ( i + 1) + '%', error_fields[i]);
89
+ message_wrapper.addClass('visible');
90
+ }
91
+ message.text(message_text);
92
+ message_wrapper.addClass('visible');
93
+ product_row.addClass('error');
94
+ }
95
+
96
+ spinner.removeClass('show');
97
+ t.add(licence_activation).prop("disabled", false).removeClass('clicked');
98
+ }
99
+ });
100
+ };
101
+
102
+ var licence_update = function (button) {
103
+ button.on('click', function (e) {
104
+ e.preventDefault();
105
+
106
+ var t = $(this),
107
+ form = $('#licence-check-update'),
108
+ data = form.serialize();
109
+
110
+ t.prop("disabled", true).addClass('clicked');
111
+ form.find('div.spinner').addClass('show');
112
+
113
+ jQuery.ajax({
114
+ type : 'POST',
115
+ url : ajaxurl,
116
+ data : data,
117
+ success: function (response) {
118
+ $('.product-licence-activation').empty().replaceWith(response.template);
119
+ licence_api();
120
+ }
121
+ });
122
+ });
123
+ };
124
+
125
+ var licence_deactivate = function (button) {
126
+ button.on('click', function (e) {
127
+ e.preventDefault();
128
+
129
+ var check = script_info.is_debug == true ? true : confirm( licence_message.are_you_sure );
130
+
131
+ if( check == true ){
132
+ var t = $(this),
133
+ licence_key = t.data('licence-key'),
134
+ licence_email = t.data('licence-email'),
135
+ product_init = t.data('product-init'),
136
+ action = t.data('action'),
137
+ renew = $('.licence-renew'),
138
+ deactive = $('.licence-deactive'),
139
+ message = $('#yith-licence-notice'),
140
+ activated_table = $('.activated-table');
141
+
142
+ t.add(renew).add(deactive).prop("disabled", true).addClass('clicked');
143
+ $('#activated-products').find('.spinner').addClass('show');
144
+
145
+ jQuery.ajax({
146
+ type : 'POST',
147
+ url : ajaxurl,
148
+ data : {
149
+ action: action,
150
+ licence_key: licence_key,
151
+ email: licence_email,
152
+ product_init: product_init
153
+ },
154
+ success: function (response) {
155
+ message.css( 'maxWidth', activated_table.width() );
156
+ if (false == response.activated && typeof response.error == 'undefined') {
157
+ $('.product-licence-activation').empty().replaceWith(response.template);
158
+ licence_api();
159
+ }
160
+
161
+ if (false == response.activated && typeof response.error != 'undefined') {
162
+ message.find('p.yith-licence-notice-message').html(response.error);
163
+ message.removeClass('notice-success').addClass('notice-error visible');
164
+ t.add(renew).add(deactive).add(renew).prop("disabled", false).removeClass('clicked');
165
+ $('#activated-products').find('.spinner').removeClass('show');
166
+ }
167
+
168
+ else if (false == response) {
169
+ message.find('p.yith-licence-notice-message').html(licence_message.server);
170
+ message.removeClass('notice-success').addClass('notice-error visible');
171
+ t.add(renew).add(deactive).add(renew).prop("disabled", false).removeClass('clicked');
172
+ $('#activated-products').find('.spinner').removeClass('show');
173
+ }
174
+ }
175
+ });
176
+ }
177
+ });
178
+ };
179
+
180
+ var licence_api = function () {
181
+ var button = $('.licence-activation'),
182
+ check = $('.licence-check'),
183
+ deactivated = $('.licence-deactive');
184
+
185
+ licence_activation(button);
186
+ licence_update(check);
187
+ licence_deactivate(deactivated);
188
+ };
189
+
190
+ licence_api();
191
+
192
+ $('body').on('click', '.yit-changelog-button', function (e) {
193
+ $('#TB_window').remove();
194
+ });
195
+
196
  })(jQuery);
plugin-fw/licence/assets/js/yit-licence.min.js CHANGED
@@ -1,7 +1,7 @@
1
  (function(b){var k=function(a){a.on("click",function(v,e){v.preventDefault();var a=b(this),c=a.data("formid"),d=b("#"+c),f=d.serialize(),h=b(d).find(".message"),g=b(d).find(".message-wrapper"),m=d.find(".user-email"),u=d.find(".licence-key"),k=d.find(".user-email").val(),t=d.find(".licence-key").val(),n=!1,c=[],p=d.find(".product-row"),q=b(".licence-activation"),r=b("#products-to-active").find(".spinner");h.empty();g.removeClass("visible");m.removeClass("require");u.removeClass("require");p.removeClass("error");
2
- r.addClass("show");a.add(q).prop("disabled",!0).addClass("clicked");""==k&&(n=!0,c[c.length]=licence_message.email,m.addClass("require"));""==t&&(n=!0,c[c.length]=licence_message.license_key,u.addClass("require"));if(0==n)jQuery.ajax({type:"POST",url:ajaxurl,data:f,success:function(c){r.removeClass("show");a.add(q).prop("disabled",!1).removeClass("clicked");1==c.activated?(b(".product-licence-activation").empty().replaceWith(c.template),l()):(0!=c?h.text(c.error):h.text(licence_message.server),g.addClass("visible"),
3
- p.addClass("error"))}});else{if(1==c.length)h.text(licence_message.error.replace("%field%",c[0]));else{d=licence_message.errors;for(f=0;f<c.length;f++)d=d.replace("%field_"+(f+1)+"%",c[f]),g.addClass("visible");h.text(d)}g.addClass("visible");p.addClass("error");r.removeClass("show");a.add(q).prop("disabled",!1).removeClass("clicked")}})},t=function(a){a.on("click",function(a){a.preventDefault();a=b(this);var e=b("#licence-check-update"),k=e.serialize();a.prop("disabled",!0).addClass("clicked");e.find("div.spinner").addClass("show");
4
- jQuery.ajax({type:"POST",url:ajaxurl,data:k,success:function(c){b(".product-licence-activation").empty().replaceWith(c.template);l()}})})},w=function(a){a.on("click",function(a){a.preventDefault();if(1==(1==script_info.is_debug?!0:confirm(licence_message.are_you_sure))){var e=b(this);a=e.data("licence-key");var k=e.data("licence-email"),c=e.data("product-init"),d=e.data("action"),f=b(".licence-renew"),h=b(".licence-deactive"),g=b("#yith-licence-notice"),m=b(".activated-table");e.add(f).add(h).prop("disabled",
5
- !0).addClass("clicked");b("#activated-products").find(".spinner").addClass("show");jQuery.ajax({type:"POST",url:ajaxurl,data:{action:d,licence_key:a,email:k,product_init:c},success:function(a){g.css("maxWidth",m.width());0==a.activated&&"undefined"==typeof a.error&&(b(".product-licence-activation").empty().replaceWith(a.template),l());0==a.activated&&"undefined"!=typeof a.error?(g.find("p.yith-licence-notice-message").html(a.error),g.removeClass("notice-success").addClass("notice-error visible"),
6
- e.add(f).add(h).add(f).prop("disabled",!1).removeClass("clicked"),b("#activated-products").find(".spinner").removeClass("show")):0==a&&(g.find("p.yith-licence-notice-message").html(licence_message.server),g.removeClass("notice-success").addClass("notice-error visible"),e.add(f).add(h).add(f).prop("disabled",!1).removeClass("clicked"),b("#activated-products").find(".spinner").removeClass("show"))}})}})},l=function(){var a=b(".licence-activation"),l=b(".licence-check"),e=b(".licence-deactive");k(a);
7
- t(l);w(e)};l();b("body").on("click",".yit-changelog-button",function(a){b("#TB_window").remove()})})(jQuery);
1
  (function(b){var k=function(a){a.on("click",function(v,e){v.preventDefault();var a=b(this),c=a.data("formid"),d=b("#"+c),f=d.serialize(),h=b(d).find(".message"),g=b(d).find(".message-wrapper"),m=d.find(".user-email"),u=d.find(".licence-key"),k=d.find(".user-email").val(),t=d.find(".licence-key").val(),n=!1,c=[],p=d.find(".product-row"),q=b(".licence-activation"),r=b("#products-to-active").find(".spinner");h.empty();g.removeClass("visible");m.removeClass("require");u.removeClass("require");p.removeClass("error");
2
+ r.addClass("show");a.add(q).prop("disabled",!0).addClass("clicked");""==k&&(n=!0,c[c.length]=licence_message.email,m.addClass("require"));""==t&&(n=!0,c[c.length]=licence_message.license_key,u.addClass("require"));if(0==n)jQuery.ajax({type:"POST",url:ajaxurl,data:f,success:function(c){r.removeClass("show");a.add(q).prop("disabled",!1).removeClass("clicked");1==c.activated?(b(".product-licence-activation").empty().replaceWith(c.template),l()):(0!=c?h.text(c.error):h.text(licence_message.server),g.addClass("visible"),
3
+ p.addClass("error"))}});else{if(1==c.length)h.text(licence_message.error.replace("%field%",c[0]));else{d=licence_message.errors;for(f=0;f<c.length;f++)d=d.replace("%field_"+(f+1)+"%",c[f]),g.addClass("visible");h.text(d)}g.addClass("visible");p.addClass("error");r.removeClass("show");a.add(q).prop("disabled",!1).removeClass("clicked")}})},t=function(a){a.on("click",function(a){a.preventDefault();a=b(this);var e=b("#licence-check-update"),k=e.serialize();a.prop("disabled",!0).addClass("clicked");e.find("div.spinner").addClass("show");
4
+ jQuery.ajax({type:"POST",url:ajaxurl,data:k,success:function(c){b(".product-licence-activation").empty().replaceWith(c.template);l()}})})},w=function(a){a.on("click",function(a){a.preventDefault();if(1==(1==script_info.is_debug?!0:confirm(licence_message.are_you_sure))){var e=b(this);a=e.data("licence-key");var k=e.data("licence-email"),c=e.data("product-init"),d=e.data("action"),f=b(".licence-renew"),h=b(".licence-deactive"),g=b("#yith-licence-notice"),m=b(".activated-table");e.add(f).add(h).prop("disabled",
5
+ !0).addClass("clicked");b("#activated-products").find(".spinner").addClass("show");jQuery.ajax({type:"POST",url:ajaxurl,data:{action:d,licence_key:a,email:k,product_init:c},success:function(a){g.css("maxWidth",m.width());0==a.activated&&"undefined"==typeof a.error&&(b(".product-licence-activation").empty().replaceWith(a.template),l());0==a.activated&&"undefined"!=typeof a.error?(g.find("p.yith-licence-notice-message").html(a.error),g.removeClass("notice-success").addClass("notice-error visible"),
6
+ e.add(f).add(h).add(f).prop("disabled",!1).removeClass("clicked"),b("#activated-products").find(".spinner").removeClass("show")):0==a&&(g.find("p.yith-licence-notice-message").html(licence_message.server),g.removeClass("notice-success").addClass("notice-error visible"),e.add(f).add(h).add(f).prop("disabled",!1).removeClass("clicked"),b("#activated-products").find(".spinner").removeClass("show"))}})}})},l=function(){var a=b(".licence-activation"),l=b(".licence-check"),e=b(".licence-deactive");k(a);
7
+ t(l);w(e)};l();b("body").on("click",".yit-changelog-button",function(a){b("#TB_window").remove()})})(jQuery);
plugin-fw/licence/lib/yit-licence.php CHANGED
@@ -1,709 +1,709 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( ! class_exists( 'YIT_Licence' ) ) {
16
- /**
17
- * YIT Licence Panel
18
- *
19
- * Setting Page to Manage Products
20
- *
21
- * @class YIT_Licence
22
- * @package Yithemes
23
- * @since 1.0
24
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
- */
26
-
27
- abstract class YIT_Licence {
28
-
29
- /**
30
- * @var mixed array The registered products info
31
- * @since 1.0
32
- */
33
- protected $_products = array();
34
-
35
- /**
36
- * @var array The settings require to add the submenu page "Activation"
37
- * @since 1.0
38
- */
39
- protected $_settings = array();
40
-
41
- /**
42
- * @var string Option name
43
- * @since 1.0
44
- */
45
- protected $_licence_option = 'yit_products_licence_activation';
46
-
47
- /**
48
- * @var string The yithemes api uri
49
- * @since 1.0
50
- */
51
- protected $_api_uri = 'http://yithemes.com';
52
-
53
- /**
54
- * @var string The yithemes api uri query args
55
- * @since 1.0
56
- */
57
- protected $_api_uri_query_args = '?wc-api=software-api&request=%request%';
58
-
59
-
60
- /**
61
- * @var string check for show extra info
62
- * @since 1.0
63
- */
64
- public $show_extra_info = false;
65
-
66
- /**
67
- * @var string check for show extra info
68
- * @since 1.0
69
- */
70
- public $show_renew_button = true;
71
-
72
- /**
73
- * Constructor
74
- *
75
- * @since 1.0
76
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
77
- */
78
- public function __construct() {
79
- $is_debug_enabled = defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG;
80
- if ( $is_debug_enabled ) {
81
- $this->_api_uri = defined( 'YIT_LICENCE_DEBUG_LOCALHOST' ) ? YIT_LICENCE_DEBUG_LOCALHOST : 'http://dev.yithemes.com';
82
- add_filter( 'block_local_requests', '__return_false' );
83
- }
84
-
85
- /* Style adn Script */
86
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
87
- if( $is_debug_enabled ) {
88
- //show extra info and renew button in debug mode
89
- $this->show_extra_info = $this->show_renew_button = true;
90
- }
91
-
92
- else {
93
- $this->show_extra_info = defined( 'YIT_SHOW_EXTRA_LICENCE_INFO' ) && YIT_SHOW_EXTRA_LICENCE_INFO;
94
- $this->show_renew_button = ! ( defined( 'YIT_HIDE_LICENCE_RENEW_BUTTON' ) && YIT_HIDE_LICENCE_RENEW_BUTTON );
95
- }
96
-
97
- /* Update Licence Information */
98
- add_action( 'core_upgrade_preamble', array( $this, 'check_all' ) );
99
- add_action( 'wp_maybe_auto_update', array( $this, 'check_all' ) );
100
-
101
- }
102
-
103
- /**
104
- * Premium products registration
105
- *
106
- * @param $init string | The products identifier
107
- * @param $secret_key string | The secret key
108
- * @param $product_id string | The product id
109
- *
110
- * @return void
111
- *
112
- * @since 1.0
113
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
114
- */
115
- abstract public function register( $init, $secret_key, $product_id );
116
-
117
- /**
118
- * Get protected array products
119
- *
120
- * @return mixed array
121
- *
122
- * @since 1.0
123
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
124
- */
125
- public function get_products() {
126
- return $this->_products;
127
- }
128
-
129
- /**
130
- * Get The home url without protocol
131
- *
132
- * @return string | The home url
133
- *
134
- * @since 1.0
135
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
136
- */
137
- public function get_home_url() {
138
- $home_url = home_url();
139
- $schemes = apply_filters( 'yit_licence_url_schemes', array( 'https://', 'http://' ) );
140
-
141
- foreach( $schemes as $scheme ){
142
- $home_url = str_replace( $scheme, '', $home_url );
143
- }
144
-
145
- return $home_url;
146
- }
147
-
148
- /**
149
- * Check if the request is ajax
150
- *
151
- * @return bool true if the request is ajax, false otherwise
152
- *
153
- * @since 1.0
154
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
155
- */
156
- public function is_ajax() {
157
- return defined( 'DOING_AJAX' ) && DOING_AJAX ? true : false;
158
- }
159
-
160
- /**
161
- * Admin Enqueue Scripts
162
- *
163
- * @return void
164
- *
165
- * @since 1.0
166
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
167
- */
168
- public function admin_enqueue_scripts(){
169
-
170
- /**
171
- * Support to YIT Framework < 2.0
172
- */
173
- $filename = function_exists( 'yit_load_js_file' ) ? yit_load_js_file( 'yit-licence.js' ) : 'yit-licence.js';
174
- $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
175
- $style_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
176
-
177
- wp_enqueue_script( 'yit-licence', $script_path . '/licence/assets/js/' . $filename, array( 'jquery' ), '1.0.0', true );
178
- wp_enqueue_style( 'yit-theme-licence', $style_path . '/licence/assets/css/yit-licence.css' );
179
-
180
- /* Localize Scripts */
181
- wp_localize_script( 'yit-licence', 'licence_message', array(
182
- 'error' => sprintf( _x( '%s field cannot be empty', '%s = field name', 'yith-plugin-fw' ), '%field%' ), // sprintf must be used to avoid errors with '%field%' string in translation in .po file
183
- 'errors' => sprintf( __( '%s and %s fields cannot be empty', 'yith-plugin-fw' ), '%field_1%', '%field_2%' ),
184
- 'server' => __( 'Unable to contact the remote server, please try again later. Thanks!', 'yith-plugin-fw' ),
185
- 'email' => __( 'Email', 'yith-plugin-fw' ),
186
- 'license_key' => __( 'License Key', 'yith-plugin-fw' ),
187
- 'are_you_sure' => __( 'Are you sure you want to deactivate the license for current site?', 'yith-plugin-fw' )
188
- )
189
- );
190
-
191
- wp_localize_script( 'yit-licence', 'script_info', array(
192
- 'is_debug' => defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG
193
- )
194
- );
195
- }
196
-
197
- /**
198
- * Activate Plugins
199
- *
200
- * Send a request to API server to activate plugins
201
- *
202
- * @return void
203
- * @use wp_send_json
204
- *
205
- * @since 1.0
206
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
207
- */
208
- public function activate() {
209
- $product_init = $_REQUEST['product_init'];
210
- $product = $this->get_product( $product_init );
211
-
212
- $args = array(
213
- 'email' => urlencode( sanitize_email( $_REQUEST['email'] ) ),
214
- 'licence_key' => sanitize_text_field( $_REQUEST['licence_key'] ),
215
- 'product_id' => sanitize_text_field( $product['product_id'] ),
216
- 'secret_key' => sanitize_text_field( $product['secret_key'] ),
217
- 'instance' => $this->get_home_url()
218
- );
219
-
220
- $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'activation' ) ) );
221
- $response = wp_remote_get( $api_uri, array( 'timeout' => 30 ) );
222
-
223
- if ( is_wp_error( $response ) ) {
224
- $body = false;
225
- }
226
- else {
227
- $body = json_decode( $response['body'] );
228
- $body = is_object( $body ) ? get_object_vars( $body ) : false;
229
- }
230
-
231
- if ( $body && is_array( $body ) && isset( $body['activated'] ) && $body['activated'] ) {
232
-
233
- $option[$product['product_id']] = array(
234
- 'email' => urldecode( $args['email'] ),
235
- 'licence_key' => $args['licence_key'],
236
- 'licence_expires' => $body['licence_expires'],
237
- 'message' => $body['message'],
238
- 'activated' => true,
239
- 'activation_limit' => $body['activation_limit'],
240
- 'activation_remaining' => $body['activation_remaining'],
241
- 'is_membership' => isset( $body['is_membership'] ) ? $body['is_membership'] : false,
242
- );
243
-
244
- /* === Check for other plugins activation === */
245
- $options = $this->get_licence();
246
- $options[$product['product_id']] = $option[$product['product_id']];
247
-
248
- update_option( $this->_licence_option, $options );
249
-
250
- /* === Update Plugin Licence Information === */
251
- YIT_Upgrade()->force_regenerate_update_transient();
252
-
253
- /* === Licence Activation Template === */
254
- $body['template'] = $this->show_activation_panel( $this->get_response_code_message( 200 ) );
255
- }
256
-
257
- wp_send_json( $body );
258
- }
259
-
260
- /**
261
- * Deactivate Plugins
262
- *
263
- * Send a request to API server to activate plugins
264
- *
265
- * @return void
266
- * @use wp_send_json
267
- *
268
- * @since 1.0
269
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
270
- */
271
- public function deactivate() {
272
- $product_init = $_REQUEST['product_init'];
273
- $product = $this->get_product( $product_init );
274
-
275
- $args = array(
276
- 'email' => urlencode( sanitize_email( $_REQUEST['email'] ) ),
277
- 'licence_key' => sanitize_text_field( $_REQUEST['licence_key'] ),
278
- 'product_id' => sanitize_text_field( $product['product_id'] ),
279
- 'secret_key' => sanitize_text_field( $product['secret_key'] ),
280
- 'instance' => $this->get_home_url()
281
- );
282
-
283
- $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'deactivation' ) ) );
284
- $response = wp_remote_get( $api_uri, array( 'timeout' => 30 ) );
285
-
286
- if ( is_wp_error( $response ) ) {
287
- $body = false;
288
- }
289
- else {
290
- $body = json_decode( $response['body'] );
291
- $body = is_object( $body ) ? get_object_vars( $body ) : false;
292
- }
293
-
294
- if ( $body && is_array( $body ) && isset( $body['activated'] ) && ! $body['activated'] && ! isset( $body['error'] ) ) {
295
-
296
- $option[$product['product_id']] = array(
297
- 'activated' => false,
298
- 'email' => urldecode( $args['email'] ),
299
- 'licence_key' => $args['licence_key'],
300
- 'licence_expires' => $body['licence_expires'],
301
- 'message' => $body['message'],
302
- 'activation_limit' => $body['activation_limit'],
303
- 'activation_remaining' => $body['activation_remaining'],
304
- 'is_membership' => isset( $body['is_membership'] ) ? $body['is_membership'] : false,
305
- );
306
-
307
- /* === Check for other plugins activation === */
308
- $options = $this->get_licence();
309
- $options[$product['product_id']] = $option[$product['product_id']];
310
-
311
- update_option( $this->_licence_option, $options );
312
-
313
- /* === Update Plugin Licence Information === */
314
- YIT_Upgrade()->force_regenerate_update_transient();
315
-
316
- /* === Licence Activation Template === */
317
- $body['template'] = $this->show_activation_panel( $this->get_response_code_message( 'deactivated', array( 'instance' => $body['instance'] ) ) );
318
- }
319
-
320
- else {
321
- $body['error'] = $this->get_response_code_message( $body['code'] );
322
- }
323
-
324
- wp_send_json( $body );
325
- }
326
-
327
- /**
328
- * Check Plugins Licence
329
- *
330
- * Send a request to API server to check if plugins is activated
331
- *
332
- * @param string|The plugin init slug $plugin_init
333
- *
334
- * @return bool | true if activated, false otherwise
335
- *
336
- * @since 1.0
337
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
338
- */
339
- public function check( $product_init, $regenerate_transient = true ) {
340
-
341
- $status = false;
342
- $body = false;
343
- $product = $this->get_product( $product_init );
344
- $licence = $this->get_licence();
345
- $product_id = $product['product_id'];
346
-
347
- if( ! isset( $licence[ $product_id ] ) ) {
348
- return false;
349
- }
350
-
351
- $args = array(
352
- 'email' => urlencode( $licence[$product_id]['email'] ),
353
- 'licence_key' => $licence[$product_id]['licence_key'],
354
- 'product_id' => $product_id,
355
- 'secret_key' => $product['secret_key'],
356
- 'instance' => $this->get_home_url()
357
- );
358
-
359
- $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'check' ) ) );
360
- $response = wp_remote_get( $api_uri, array( 'timeout' => 30 ) );
361
-
362
- if ( ! is_wp_error( $response ) ) {
363
- $body = json_decode( $response['body'] );
364
- $body = is_object( $body ) ? get_object_vars( $body ) : false;
365
- }
366
-
367
- if ( $body && is_array( $body ) && isset( $body['success'] ) ) {
368
- if ( $body['success'] ) {
369
-
370
- /**
371
- * Code 200 -> Licence key is valid
372
- */
373
- $licence[ $product_id ]['status_code'] = '200';
374
- $licence[ $product_id ]['activated'] = $body['activated'];
375
- $licence[ $product_id ]['licence_expires'] = $body['licence_expires'];
376
- $licence[ $product_id ]['activation_remaining'] = $body['activation_remaining'];
377
- $licence[ $product_id ]['activation_limit'] = $body['activation_limit'];
378
- $licence[ $product_id ]['is_membership'] = isset( $body['is_membership'] ) ? $body['is_membership'] : false;
379
- $status = (bool) $body['activated'];
380
- }
381
- elseif ( isset( $body['code'] ) ) {
382
-
383
- switch ( $body['code'] ) {
384
-
385
- /**
386
- * Error Code List:
387
- *
388
- * 100 -> Invalid Request
389
- * 101 -> Invalid licence key
390
- * 102 -> Software has been deactivate
391
- * 103 -> Exceeded maximum number of activations
392
- * 104 -> Invalid instance ID
393
- * 105 -> Invalid security key
394
- * 106 -> Licence key has expired
395
- * 107 -> Licence key has be banned
396
- *
397
- * Only code 101, 106 and 107 have effect on DB during activation
398
- * All error code have effect on DB during deactivation
399
- *
400
- */
401
-
402
- case '101':
403
- case '102':
404
- unset( $licence[ $product_id ] );
405
- break;
406
-
407
- case '106':
408
- $licence[ $product_id ]['activated'] = false;
409
- $licence[ $product_id ]['message'] = $body['error'];
410
- $licence[ $product_id ]['status_code'] = $body['code'];
411
- $licence[ $product_id ]['licence_expires'] = $body['licence_expires'];
412
- //$licence[ $product_id ]['is_membership'] = isset( $body['is_membership'] ) ? $body['is_membership'] : false;
413
- break;
414
-
415
- case '107':
416
- $licence[ $product_id ]['activated'] = false;
417
- $licence[ $product_id ]['message'] = $body['error'];
418
- $licence[ $product_id ]['status_code'] = $body['code'];
419
- //$licence[ $product_id ]['is_membership'] = isset( $body['is_membership'] ) ? $body['is_membership'] : false;
420
- break;
421
- }
422
- }
423
-
424
- /* === Update Plugin Licence Information === */
425
- update_option( $this->_licence_option, $licence );
426
-
427
- /* === Update Plugin Licence Information === */
428
- if( $regenerate_transient ) {
429
- YIT_Upgrade()->force_regenerate_update_transient();
430
- }
431
- }
432
- return $status;
433
- }
434
-
435
- /**
436
- * Check for licence update
437
- *
438
- * @return void
439
- * @since 2.5
440
- *
441
- * @use YIT_Theme_Licence->check()
442
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
443
- */
444
- public function check_all(){
445
- foreach ( $this->_products as $init => $info ) {
446
- $this->check( $init );
447
- }
448
- }
449
-
450
- /**
451
- * Update Plugins Information
452
- *
453
- * Send a request to API server to check activate plugins and update the informations
454
- *
455
- * @return void
456
- * @use YIT_Theme_Licence->check()
457
- *
458
- * @since 1.0
459
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
460
- */
461
- public function update_licence_information() {
462
- /* Check licence information for alla products */
463
- $this->check_all();
464
-
465
- /* === Regenerate Update Plugins Transient === */
466
- YIT_Upgrade()->force_regenerate_update_transient();
467
-
468
- do_action( 'yit_licence_after_check' );
469
-
470
- if( $this->is_ajax() ) {
471
- $response['template'] = $this->show_activation_panel();
472
- wp_send_json( $response );
473
- }
474
- }
475
-
476
- /**
477
- * Include activation page template
478
- *
479
- * @return mixed void | string the contents of the output buffer and end output buffering.
480
- *
481
- * @since 1.0
482
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
483
- */
484
- public function show_activation_panel( $notice = '' ) {
485
-
486
- $path = defined( 'YIT_CORE_PLUGIN_PATH' ) ? YIT_CORE_PLUGIN_PATH : get_template_directory() . '/core/plugin-fw/';
487
-
488
- if ( $this->is_ajax() ) {
489
- ob_start();
490
- require_once( $path . '/licence/templates/panel/activation/activation-panel.php' );
491
- return ob_get_clean();
492
- }
493
- else {
494
- require_once( $path . '/licence/templates/panel/activation/activation-panel.php' );
495
- }
496
- }
497
-
498
- /**
499
- * Get activated products
500
- *
501
- * @return array
502
- *
503
- * @since 1.0
504
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
505
- */
506
- public function get_activated_products() {
507
- $activated_products = array();
508
- $licence = $this->get_licence();
509
-
510
- if ( is_array( $licence ) ) {
511
- foreach ( $this->_products as $init => $info ) {
512
- if ( in_array( $info['product_id'], array_keys( $licence ) ) && isset( $licence[$info['product_id']]['activated'] ) && $licence[$info['product_id']]['activated'] ) {
513
- $product[$init] = $this->_products[$init];
514
- $product[$init]['licence'] = $licence[$info['product_id']];
515
- $activated_products[$init] = $product[$init];
516
- }
517
- }
518
- }
519
-
520
- return $activated_products;
521
- }
522
-
523
- /**
524
- * Get to active products
525
- *
526
- * @return array
527
- *
528
- * @since 1.0
529
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
530
- */
531
- public function get_to_active_products() {
532
- return array_diff_key( $this->get_products(), $this->get_activated_products() );
533
- }
534
-
535
- /**
536
- * Get no active products
537
- *
538
- * @return array
539
- *
540
- * @since 1.0
541
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
542
- */
543
- public function get_no_active_licence_key() {
544
- $unactive_products = $this->get_to_active_products();
545
- $licence = $this->get_licence();
546
- $licence_key = array();
547
-
548
- /**
549
- * Remove banned licence key
550
- */
551
- foreach ( $unactive_products as $init => $info ) {
552
- $product_id = $unactive_products[$init]['product_id'];
553
- if ( isset( $licence[$product_id]['activated'] ) && ! $licence[$product_id]['activated'] && isset( $licence[$product_id]['status_code'] ) ) {
554
- $status_code = $licence[$product_id]['status_code'];
555
-
556
- switch ( $status_code ) {
557
- case '106':
558
- $licence_key[$status_code][$init] = $unactive_products[$init];
559
- $licence_key[$status_code][$init]['licence'] = $licence[$product_id];
560
- break;
561
-
562
- case '107':
563
- $licence_key[$status_code][$init] = $unactive_products[$init];
564
- $licence_key[$status_code][$init]['licence'] = $licence[$product_id];
565
- break;
566
- }
567
- }
568
- }
569
- return $licence_key;
570
- }
571
-
572
- /**
573
- * Get a specific product information
574
- *
575
- * @param $product_init | product init file
576
- *
577
- * @return mixed array
578
- *
579
- * @since 1.0
580
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
581
- */
582
- public function get_product( $init ) {
583
- return isset( $this->_products[$init] ) ? $this->_products[$init] : false;
584
- }
585
-
586
- /**
587
- * Get product product id information
588
- *
589
- * @param $product_init | product init file
590
- *
591
- * @return mixed array
592
- *
593
- * @since 1.0
594
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
595
- */
596
- public function get_product_id( $init ) {
597
- return isset( $this->_products[$init]['product_id'] ) ? $this->_products[$init]['product_id'] : false;
598
- }
599
-
600
- /**
601
- * Get Renewing uri
602
- *
603
- * @param $licence_key The licence key to renew
604
- *
605
- * @return mixed The renewing uri if licence_key exists, false otherwise
606
- *
607
- * @since 1.0
608
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
609
- */
610
- public function get_renewing_uri( $licence_key ) {
611
- return ! empty( $licence_key ) ? str_replace( 'www.', '', $this->_api_uri ) . '?renewing_key=' . $licence_key : false;
612
- }
613
-
614
- /**
615
- * Get protected yithemes api uri
616
- *
617
- * @param $request
618
- *
619
- * @return mixed array
620
- *
621
- * @since 1.0
622
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
623
- */
624
- public function get_api_uri( $request ) {
625
- return str_replace( '%request%', $request, $this->_api_uri . $this->_api_uri_query_args );
626
- }
627
-
628
- /**
629
- * Get the activation page url
630
- *
631
- * @return String | Activation page url
632
- *
633
- * @since 1.0
634
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
635
- */
636
- public function get_licence_activation_page_url() {
637
- return esc_url( add_query_arg( array( 'page' => $this->_settings['page'] ), admin_url( 'admin.php' ) ) );
638
- }
639
-
640
-
641
- /**
642
- * Get the licence information
643
- *
644
- * @return array | licence array
645
- *
646
- * @since 1.0
647
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
648
- */
649
- public function get_licence() {
650
- return get_option( $this->_licence_option );
651
- }
652
-
653
- /**
654
- * Get the licence information
655
- *
656
- * @param $code string The error code
657
- *
658
- * @return string | Error code message
659
- *
660
- * @since 1.0
661
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
662
- */
663
- public function get_response_code_message( $code, $args = array() ) {
664
- extract( $args );
665
-
666
- $messages = array(
667
- '100' => __( 'Invalid Request', 'yith-plugin-fw' ),
668
- '101' => __( 'Invalid license key', 'yith-plugin-fw' ),
669
- '102' => __( 'Software has been deactivated', 'yith-plugin-fw' ),
670
- '103' => __( 'Maximum number of activations exceeded', 'yith-plugin-fw' ),
671
- '104' => __( 'Invalid instance ID', 'yith-plugin-fw' ),
672
- '105' => __( 'Invalid security key', 'yith-plugin-fw' ),
673
- '106' => __( 'License key has expired', 'yith-plugin-fw' ),
674
- '107' => __( 'License key has been banned', 'yith-plugin-fw' ),
675
- '108' => __( 'Current product is not included with your membership key', 'woocommerce-software-add-on' ),
676
- '200' => sprintf( '<strong>%s</strong>! %s',__( 'Great', 'yith-plugin-fw' ), __( 'License successfully activated', 'yith-plugin-fw' ) ),
677
- 'deactivated' => sprintf( '%s <strong>%s</strong>', __( 'License key deactivated for website', 'woocommerce-software-add-on' ), isset( $instance ) ? $instance : '' )
678
- );
679
-
680
- return isset( $messages[$code] ) ? $messages[$code] : false;
681
- }
682
-
683
- /**
684
- * Get the product name to display
685
- *
686
- * @param $product_name
687
- *
688
- * @return string the product name
689
- *
690
- * @since 2.2
691
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
692
- */
693
- public function display_product_name( $product_name ){
694
- return str_replace( array( 'YITH', 'WooCommerce', 'Premium', 'Theme' ), '', $product_name );
695
- }
696
-
697
- public function get_number_of_membership_products(){
698
- $activated_products = $this->get_activated_products();
699
- $num_members_products_activate = 0;
700
- foreach( $activated_products as $activated_product ){
701
- if( isset( $activated_product['licence']['is_membership'] ) && $activated_product['licence']['is_membership'] ){
702
- $num_members_products_activate++;
703
- }
704
- }
705
- return $num_members_products_activate;
706
- }
707
-
708
- }
709
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( ! class_exists( 'YIT_Licence' ) ) {
16
+ /**
17
+ * YIT Licence Panel
18
+ *
19
+ * Setting Page to Manage Products
20
+ *
21
+ * @class YIT_Licence
22
+ * @package Yithemes
23
+ * @since 1.0
24
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
+ */
26
+
27
+ abstract class YIT_Licence {
28
+
29
+ /**
30
+ * @var mixed array The registered products info
31
+ * @since 1.0
32
+ */
33
+ protected $_products = array();
34
+
35
+ /**
36
+ * @var array The settings require to add the submenu page "Activation"
37
+ * @since 1.0
38
+ */
39
+ protected $_settings = array();
40
+
41
+ /**
42
+ * @var string Option name
43
+ * @since 1.0
44
+ */
45
+ protected $_licence_option = 'yit_products_licence_activation';
46
+
47
+ /**
48
+ * @var string The yithemes api uri
49
+ * @since 1.0
50
+ */
51
+ protected $_api_uri = 'http://yithemes.com';
52
+
53
+ /**
54
+ * @var string The yithemes api uri query args
55
+ * @since 1.0
56
+ */
57
+ protected $_api_uri_query_args = '?wc-api=software-api&request=%request%';
58
+
59
+
60
+ /**
61
+ * @var string check for show extra info
62
+ * @since 1.0
63
+ */
64
+ public $show_extra_info = false;
65
+
66
+ /**
67
+ * @var string check for show extra info
68
+ * @since 1.0
69
+ */
70
+ public $show_renew_button = true;
71
+
72
+ /**
73
+ * Constructor
74
+ *
75
+ * @since 1.0
76
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
77
+ */
78
+ public function __construct() {
79
+ $is_debug_enabled = defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG;
80
+ if ( $is_debug_enabled ) {
81
+ $this->_api_uri = defined( 'YIT_LICENCE_DEBUG_LOCALHOST' ) ? YIT_LICENCE_DEBUG_LOCALHOST : 'http://dev.yithemes.com';
82
+ add_filter( 'block_local_requests', '__return_false' );
83
+ }
84
+
85
+ /* Style adn Script */
86
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
87
+ if( $is_debug_enabled ) {
88
+ //show extra info and renew button in debug mode
89
+ $this->show_extra_info = $this->show_renew_button = true;
90
+ }
91
+
92
+ else {
93
+ $this->show_extra_info = defined( 'YIT_SHOW_EXTRA_LICENCE_INFO' ) && YIT_SHOW_EXTRA_LICENCE_INFO;
94
+ $this->show_renew_button = ! ( defined( 'YIT_HIDE_LICENCE_RENEW_BUTTON' ) && YIT_HIDE_LICENCE_RENEW_BUTTON );
95
+ }
96
+
97
+ /* Update Licence Information */
98
+ add_action( 'core_upgrade_preamble', array( $this, 'check_all' ) );
99
+ add_action( 'wp_maybe_auto_update', array( $this, 'check_all' ) );
100
+
101
+ }
102
+
103
+ /**
104
+ * Premium products registration
105
+ *
106
+ * @param $init string | The products identifier
107
+ * @param $secret_key string | The secret key
108
+ * @param $product_id string | The product id
109
+ *
110
+ * @return void
111
+ *
112
+ * @since 1.0
113
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
114
+ */
115
+ abstract public function register( $init, $secret_key, $product_id );
116
+
117
+ /**
118
+ * Get protected array products
119
+ *
120
+ * @return mixed array
121
+ *
122
+ * @since 1.0
123
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
124
+ */
125
+ public function get_products() {
126
+ return $this->_products;
127
+ }
128
+
129
+ /**
130
+ * Get The home url without protocol
131
+ *
132
+ * @return string | The home url
133
+ *
134
+ * @since 1.0
135
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
136
+ */
137
+ public function get_home_url() {
138
+ $home_url = home_url();
139
+ $schemes = apply_filters( 'yit_licence_url_schemes', array( 'https://', 'http://' ) );
140
+
141
+ foreach( $schemes as $scheme ){
142
+ $home_url = str_replace( $scheme, '', $home_url );
143
+ }
144
+
145
+ return $home_url;
146
+ }
147
+
148
+ /**
149
+ * Check if the request is ajax
150
+ *
151
+ * @return bool true if the request is ajax, false otherwise
152
+ *
153
+ * @since 1.0
154
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
155
+ */
156
+ public function is_ajax() {
157
+ return defined( 'DOING_AJAX' ) && DOING_AJAX ? true : false;
158
+ }
159
+
160
+ /**
161
+ * Admin Enqueue Scripts
162
+ *
163
+ * @return void
164
+ *
165
+ * @since 1.0
166
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
167
+ */
168
+ public function admin_enqueue_scripts(){
169
+
170
+ /**
171
+ * Support to YIT Framework < 2.0
172
+ */
173
+ $filename = function_exists( 'yit_load_js_file' ) ? yit_load_js_file( 'yit-licence.js' ) : 'yit-licence.js';
174
+ $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
175
+ $style_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
176
+
177
+ wp_enqueue_script( 'yit-licence', $script_path . '/licence/assets/js/' . $filename, array( 'jquery' ), '1.0.0', true );
178
+ wp_enqueue_style( 'yit-theme-licence', $style_path . '/licence/assets/css/yit-licence.css' );
179
+
180
+ /* Localize Scripts */
181
+ wp_localize_script( 'yit-licence', 'licence_message', array(
182
+ 'error' => sprintf( _x( '%s field cannot be empty', '%s = field name', 'yith-plugin-fw' ), '%field%' ), // sprintf must be used to avoid errors with '%field%' string in translation in .po file
183
+ 'errors' => sprintf( __( '%s and %s fields cannot be empty', 'yith-plugin-fw' ), '%field_1%', '%field_2%' ),
184
+ 'server' => __( 'Unable to contact the remote server, please try again later. Thanks!', 'yith-plugin-fw' ),
185
+ 'email' => __( 'Email', 'yith-plugin-fw' ),
186
+ 'license_key' => __( 'License Key', 'yith-plugin-fw' ),
187
+ 'are_you_sure' => __( 'Are you sure you want to deactivate the license for current site?', 'yith-plugin-fw' )
188
+ )
189
+ );
190
+
191
+ wp_localize_script( 'yit-licence', 'script_info', array(
192
+ 'is_debug' => defined( 'YIT_LICENCE_DEBUG' ) && YIT_LICENCE_DEBUG
193
+ )
194
+ );
195
+ }
196
+
197
+ /**
198
+ * Activate Plugins
199
+ *
200
+ * Send a request to API server to activate plugins
201
+ *
202
+ * @return void
203
+ * @use wp_send_json
204
+ *
205
+ * @since 1.0
206
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
207
+ */
208
+ public function activate() {
209
+ $product_init = $_REQUEST['product_init'];
210
+ $product = $this->get_product( $product_init );
211
+
212
+ $args = array(
213
+ 'email' => urlencode( sanitize_email( $_REQUEST['email'] ) ),
214
+ 'licence_key' => sanitize_text_field( $_REQUEST['licence_key'] ),
215
+ 'product_id' => sanitize_text_field( $product['product_id'] ),
216
+ 'secret_key' => sanitize_text_field( $product['secret_key'] ),
217
+ 'instance' => $this->get_home_url()
218
+ );
219
+
220
+ $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'activation' ) ) );
221
+ $response = wp_remote_get( $api_uri, array( 'timeout' => 30 ) );
222
+
223
+ if ( is_wp_error( $response ) ) {
224
+ $body = false;
225
+ }
226
+ else {
227
+ $body = json_decode( $response['body'] );
228
+ $body = is_object( $body ) ? get_object_vars( $body ) : false;
229
+ }
230
+
231
+ if ( $body && is_array( $body ) && isset( $body['activated'] ) && $body['activated'] ) {
232
+
233
+ $option[$product['product_id']] = array(
234
+ 'email' => urldecode( $args['email'] ),
235
+ 'licence_key' => $args['licence_key'],
236
+ 'licence_expires' => $body['licence_expires'],
237
+ 'message' => $body['message'],
238
+ 'activated' => true,
239
+ 'activation_limit' => $body['activation_limit'],
240
+ 'activation_remaining' => $body['activation_remaining'],
241
+ 'is_membership' => isset( $body['is_membership'] ) ? $body['is_membership'] : false,
242
+ );
243
+
244
+ /* === Check for other plugins activation === */
245
+ $options = $this->get_licence();
246
+ $options[$product['product_id']] = $option[$product['product_id']];
247
+
248
+ update_option( $this->_licence_option, $options );
249
+
250
+ /* === Update Plugin Licence Information === */
251
+ YIT_Upgrade()->force_regenerate_update_transient();
252
+
253
+ /* === Licence Activation Template === */
254
+ $body['template'] = $this->show_activation_panel( $this->get_response_code_message( 200 ) );
255
+ }
256
+
257
+ wp_send_json( $body );
258
+ }
259
+
260
+ /**
261
+ * Deactivate Plugins
262
+ *
263
+ * Send a request to API server to activate plugins
264
+ *
265
+ * @return void
266
+ * @use wp_send_json
267
+ *
268
+ * @since 1.0
269
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
270
+ */
271
+ public function deactivate() {
272
+ $product_init = $_REQUEST['product_init'];
273
+ $product = $this->get_product( $product_init );
274
+
275
+ $args = array(
276
+ 'email' => urlencode( sanitize_email( $_REQUEST['email'] ) ),
277
+ 'licence_key' => sanitize_text_field( $_REQUEST['licence_key'] ),
278
+ 'product_id' => sanitize_text_field( $product['product_id'] ),
279
+ 'secret_key' => sanitize_text_field( $product['secret_key'] ),
280
+ 'instance' => $this->get_home_url()
281
+ );
282
+
283
+ $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'deactivation' ) ) );
284
+ $response = wp_remote_get( $api_uri, array( 'timeout' => 30 ) );
285
+
286
+ if ( is_wp_error( $response ) ) {
287
+ $body = false;
288
+ }
289
+ else {
290
+ $body = json_decode( $response['body'] );
291
+ $body = is_object( $body ) ? get_object_vars( $body ) : false;
292
+ }
293
+
294
+ if ( $body && is_array( $body ) && isset( $body['activated'] ) && ! $body['activated'] && ! isset( $body['error'] ) ) {
295
+
296
+ $option[$product['product_id']] = array(
297
+ 'activated' => false,
298
+ 'email' => urldecode( $args['email'] ),
299
+ 'licence_key' => $args['licence_key'],
300
+ 'licence_expires' => $body['licence_expires'],
301
+ 'message' => $body['message'],
302
+ 'activation_limit' => $body['activation_limit'],
303
+ 'activation_remaining' => $body['activation_remaining'],
304
+ 'is_membership' => isset( $body['is_membership'] ) ? $body['is_membership'] : false,
305
+ );
306
+
307
+ /* === Check for other plugins activation === */
308
+ $options = $this->get_licence();
309
+ $options[$product['product_id']] = $option[$product['product_id']];
310
+
311
+ update_option( $this->_licence_option, $options );
312
+
313
+ /* === Update Plugin Licence Information === */
314
+ YIT_Upgrade()->force_regenerate_update_transient();
315
+
316
+ /* === Licence Activation Template === */
317
+ $body['template'] = $this->show_activation_panel( $this->get_response_code_message( 'deactivated', array( 'instance' => $body['instance'] ) ) );
318
+ }
319
+
320
+ else {
321
+ $body['error'] = $this->get_response_code_message( $body['code'] );
322
+ }
323
+
324
+ wp_send_json( $body );
325
+ }
326
+
327
+ /**
328
+ * Check Plugins Licence
329
+ *
330
+ * Send a request to API server to check if plugins is activated
331
+ *
332
+ * @param string|The plugin init slug $plugin_init
333
+ *
334
+ * @return bool | true if activated, false otherwise
335
+ *
336
+ * @since 1.0
337
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
338
+ */
339
+ public function check( $product_init, $regenerate_transient = true ) {
340
+
341
+ $status = false;
342
+ $body = false;
343
+ $product = $this->get_product( $product_init );
344
+ $licence = $this->get_licence();
345
+ $product_id = $product['product_id'];
346
+
347
+ if( ! isset( $licence[ $product_id ] ) ) {
348
+ return false;
349
+ }
350
+
351
+ $args = array(
352
+ 'email' => urlencode( $licence[$product_id]['email'] ),
353
+ 'licence_key' => $licence[$product_id]['licence_key'],
354
+ 'product_id' => $product_id,
355
+ 'secret_key' => $product['secret_key'],
356
+ 'instance' => $this->get_home_url()
357
+ );
358
+
359
+ $api_uri = esc_url_raw( add_query_arg( $args, $this->get_api_uri( 'check' ) ) );
360
+ $response = wp_remote_get( $api_uri, array( 'timeout' => 30 ) );
361
+
362
+ if ( ! is_wp_error( $response ) ) {
363
+ $body = json_decode( $response['body'] );
364
+ $body = is_object( $body ) ? get_object_vars( $body ) : false;
365
+ }
366
+
367
+ if ( $body && is_array( $body ) && isset( $body['success'] ) ) {
368
+ if ( $body['success'] ) {
369
+
370
+ /**
371
+ * Code 200 -> Licence key is valid
372
+ */
373
+ $licence[ $product_id ]['status_code'] = '200';
374
+ $licence[ $product_id ]['activated'] = $body['activated'];
375
+ $licence[ $product_id ]['licence_expires'] = $body['licence_expires'];
376
+ $licence[ $product_id ]['activation_remaining'] = $body['activation_remaining'];
377
+ $licence[ $product_id ]['activation_limit'] = $body['activation_limit'];
378
+ $licence[ $product_id ]['is_membership'] = isset( $body['is_membership'] ) ? $body['is_membership'] : false;
379
+ $status = (bool) $body['activated'];
380
+ }
381
+ elseif ( isset( $body['code'] ) ) {
382
+
383
+ switch ( $body['code'] ) {
384
+
385
+ /**
386
+ * Error Code List:
387
+ *
388
+ * 100 -> Invalid Request
389
+ * 101 -> Invalid licence key
390
+ * 102 -> Software has been deactivate
391
+ * 103 -> Exceeded maximum number of activations
392
+ * 104 -> Invalid instance ID
393
+ * 105 -> Invalid security key
394
+ * 106 -> Licence key has expired
395
+ * 107 -> Licence key has be banned
396
+ *
397
+ * Only code 101, 106 and 107 have effect on DB during activation
398
+ * All error code have effect on DB during deactivation
399
+ *
400
+ */
401
+
402
+ case '101':
403
+ case '102':
404
+ unset( $licence[ $product_id ] );
405
+ break;
406
+
407
+ case '106':
408
+ $licence[ $product_id ]['activated'] = false;
409
+ $licence[ $product_id ]['message'] = $body['error'];
410
+ $licence[ $product_id ]['status_code'] = $body['code'];
411
+ $licence[ $product_id ]['licence_expires'] = $body['licence_expires'];
412
+ //$licence[ $product_id ]['is_membership'] = isset( $body['is_membership'] ) ? $body['is_membership'] : false;
413
+ break;
414
+
415
+ case '107':
416
+ $licence[ $product_id ]['activated'] = false;
417
+ $licence[ $product_id ]['message'] = $body['error'];
418
+ $licence[ $product_id ]['status_code'] = $body['code'];
419
+ //$licence[ $product_id ]['is_membership'] = isset( $body['is_membership'] ) ? $body['is_membership'] : false;
420
+ break;
421
+ }
422
+ }
423
+
424
+ /* === Update Plugin Licence Information === */
425
+ update_option( $this->_licence_option, $licence );
426
+
427
+ /* === Update Plugin Licence Information === */
428
+ if( $regenerate_transient ) {
429
+ YIT_Upgrade()->force_regenerate_update_transient();
430
+ }
431
+ }
432
+ return $status;
433
+ }
434
+
435
+ /**
436
+ * Check for licence update
437
+ *
438
+ * @return void
439
+ * @since 2.5
440
+ *
441
+ * @use YIT_Theme_Licence->check()
442
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
443
+ */
444
+ public function check_all(){
445
+ foreach ( $this->_products as $init => $info ) {
446
+ $this->check( $init );
447
+ }
448
+ }
449
+
450
+ /**
451
+ * Update Plugins Information
452
+ *
453
+ * Send a request to API server to check activate plugins and update the informations
454
+ *
455
+ * @return void
456
+ * @use YIT_Theme_Licence->check()
457
+ *
458
+ * @since 1.0
459
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
460
+ */
461
+ public function update_licence_information() {
462
+ /* Check licence information for alla products */
463
+ $this->check_all();
464
+
465
+ /* === Regenerate Update Plugins Transient === */
466
+ YIT_Upgrade()->force_regenerate_update_transient();
467
+
468
+ do_action( 'yit_licence_after_check' );
469
+
470
+ if( $this->is_ajax() ) {
471
+ $response['template'] = $this->show_activation_panel();
472
+ wp_send_json( $response );
473
+ }
474
+ }
475
+
476
+ /**
477
+ * Include activation page template
478
+ *
479
+ * @return mixed void | string the contents of the output buffer and end output buffering.
480
+ *
481
+ * @since 1.0
482
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
483
+ */
484
+ public function show_activation_panel( $notice = '' ) {
485
+
486
+ $path = defined( 'YIT_CORE_PLUGIN_PATH' ) ? YIT_CORE_PLUGIN_PATH : get_template_directory() . '/core/plugin-fw/';
487
+
488
+ if ( $this->is_ajax() ) {
489
+ ob_start();
490
+ require_once( $path . '/licence/templates/panel/activation/activation-panel.php' );
491
+ return ob_get_clean();
492
+ }
493
+ else {
494
+ require_once( $path . '/licence/templates/panel/activation/activation-panel.php' );
495
+ }
496
+ }
497
+
498
+ /**
499
+ * Get activated products
500
+ *
501
+ * @return array
502
+ *
503
+ * @since 1.0
504
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
505
+ */
506
+ public function get_activated_products() {
507
+ $activated_products = array();
508
+ $licence = $this->get_licence();
509
+
510
+ if ( is_array( $licence ) ) {
511
+ foreach ( $this->_products as $init => $info ) {
512
+ if ( in_array( $info['product_id'], array_keys( $licence ) ) && isset( $licence[$info['product_id']]['activated'] ) && $licence[$info['product_id']]['activated'] ) {
513
+ $product[$init] = $this->_products[$init];
514
+ $product[$init]['licence'] = $licence[$info['product_id']];
515
+ $activated_products[$init] = $product[$init];
516
+ }
517
+ }
518
+ }
519
+
520
+ return $activated_products;
521
+ }
522
+
523
+ /**
524
+ * Get to active products
525
+ *
526
+ * @return array
527
+ *
528
+ * @since 1.0
529
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
530
+ */
531
+ public function get_to_active_products() {
532
+ return array_diff_key( $this->get_products(), $this->get_activated_products() );
533
+ }
534
+
535
+ /**
536
+ * Get no active products
537
+ *
538
+ * @return array
539
+ *
540
+ * @since 1.0
541
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
542
+ */
543
+ public function get_no_active_licence_key() {
544
+ $unactive_products = $this->get_to_active_products();
545
+ $licence = $this->get_licence();
546
+ $licence_key = array();
547
+
548
+ /**
549
+ * Remove banned licence key
550
+ */
551
+ foreach ( $unactive_products as $init => $info ) {
552
+ $product_id = $unactive_products[$init]['product_id'];
553
+ if ( isset( $licence[$product_id]['activated'] ) && ! $licence[$product_id]['activated'] && isset( $licence[$product_id]['status_code'] ) ) {
554
+ $status_code = $licence[$product_id]['status_code'];
555
+
556
+ switch ( $status_code ) {
557
+ case '106':
558
+ $licence_key[$status_code][$init] = $unactive_products[$init];
559
+ $licence_key[$status_code][$init]['licence'] = $licence[$product_id];
560
+ break;
561
+
562
+ case '107':
563
+ $licence_key[$status_code][$init] = $unactive_products[$init];
564
+ $licence_key[$status_code][$init]['licence'] = $licence[$product_id];
565
+ break;
566
+ }
567
+ }
568
+ }
569
+ return $licence_key;
570
+ }
571
+
572
+ /**
573
+ * Get a specific product information
574
+ *
575
+ * @param $product_init | product init file
576
+ *
577
+ * @return mixed array
578
+ *
579
+ * @since 1.0
580
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
581
+ */
582
+ public function get_product( $init ) {
583
+ return isset( $this->_products[$init] ) ? $this->_products[$init] : false;
584
+ }
585
+
586
+ /**
587
+ * Get product product id information
588
+ *
589
+ * @param $product_init | product init file
590
+ *
591
+ * @return mixed array
592
+ *
593
+ * @since 1.0
594
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
595
+ */
596
+ public function get_product_id( $init ) {
597
+ return isset( $this->_products[$init]['product_id'] ) ? $this->_products[$init]['product_id'] : false;
598
+ }
599
+
600
+ /**
601
+ * Get Renewing uri
602
+ *
603
+ * @param $licence_key The licence key to renew
604
+ *
605
+ * @return mixed The renewing uri if licence_key exists, false otherwise
606
+ *
607
+ * @since 1.0
608
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
609
+ */
610
+ public function get_renewing_uri( $licence_key ) {
611
+ return ! empty( $licence_key ) ? str_replace( 'www.', '', $this->_api_uri ) . '?renewing_key=' . $licence_key : false;
612
+ }
613
+
614
+ /**
615
+ * Get protected yithemes api uri
616
+ *
617
+ * @param $request
618
+ *
619
+ * @return mixed array
620
+ *
621
+ * @since 1.0
622
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
623
+ */
624
+ public function get_api_uri( $request ) {
625
+ return str_replace( '%request%', $request, $this->_api_uri . $this->_api_uri_query_args );
626
+ }
627
+
628
+ /**
629
+ * Get the activation page url
630
+ *
631
+ * @return String | Activation page url
632
+ *
633
+ * @since 1.0
634
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
635
+ */
636
+ public function get_licence_activation_page_url() {
637
+ return esc_url( add_query_arg( array( 'page' => $this->_settings['page'] ), admin_url( 'admin.php' ) ) );
638
+ }
639
+
640
+
641
+ /**
642
+ * Get the licence information
643
+ *
644
+ * @return array | licence array
645
+ *
646
+ * @since 1.0
647
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
648
+ */
649
+ public function get_licence() {
650
+ return get_option( $this->_licence_option );
651
+ }
652
+
653
+ /**
654
+ * Get the licence information
655
+ *
656
+ * @param $code string The error code
657
+ *
658
+ * @return string | Error code message
659
+ *
660
+ * @since 1.0
661
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
662
+ */
663
+ public function get_response_code_message( $code, $args = array() ) {
664
+ extract( $args );
665
+
666
+ $messages = array(
667
+ '100' => __( 'Invalid Request', 'yith-plugin-fw' ),
668
+ '101' => __( 'Invalid license key', 'yith-plugin-fw' ),
669
+ '102' => __( 'Software has been deactivated', 'yith-plugin-fw' ),
670
+ '103' => __( 'Maximum number of activations exceeded', 'yith-plugin-fw' ),
671
+ '104' => __( 'Invalid instance ID', 'yith-plugin-fw' ),
672
+ '105' => __( 'Invalid security key', 'yith-plugin-fw' ),
673
+ '106' => __( 'License key has expired', 'yith-plugin-fw' ),
674
+ '107' => __( 'License key has been banned', 'yith-plugin-fw' ),
675
+ '108' => __( 'Current product is not included with your membership key', 'woocommerce-software-add-on' ),
676
+ '200' => sprintf( '<strong>%s</strong>! %s',__( 'Great', 'yith-plugin-fw' ), __( 'License successfully activated', 'yith-plugin-fw' ) ),
677
+ 'deactivated' => sprintf( '%s <strong>%s</strong>', __( 'License key deactivated for website', 'woocommerce-software-add-on' ), isset( $instance ) ? $instance : '' )
678
+ );
679
+
680
+ return isset( $messages[$code] ) ? $messages[$code] : false;
681
+ }
682
+
683
+ /**
684
+ * Get the product name to display
685
+ *
686
+ * @param $product_name
687
+ *
688
+ * @return string the product name
689
+ *
690
+ * @since 2.2
691
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
692
+ */
693
+ public function display_product_name( $product_name ){
694
+ return str_replace( array( 'YITH', 'WooCommerce', 'Premium', 'Theme' ), '', $product_name );
695
+ }
696
+
697
+ public function get_number_of_membership_products(){
698
+ $activated_products = $this->get_activated_products();
699
+ $num_members_products_activate = 0;
700
+ foreach( $activated_products as $activated_product ){
701
+ if( isset( $activated_product['licence']['is_membership'] ) && $activated_product['licence']['is_membership'] ){
702
+ $num_members_products_activate++;
703
+ }
704
+ }
705
+ return $num_members_products_activate;
706
+ }
707
+
708
+ }
709
  }
plugin-fw/licence/lib/yit-plugin-licence.php CHANGED
@@ -1,161 +1,161 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
16
- /**
17
- * YIT Plugin Licence Panel
18
- *
19
- * Setting Page to Manage Plugins
20
- *
21
- * @class YIT_Plugin_Licence
22
- * @package Yithemes
23
- * @since 1.0
24
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
- */
26
- class YIT_Plugin_Licence extends YIT_Licence {
27
-
28
- /**
29
- * @var array The settings require to add the submenu page "Activation"
30
- * @since 1.0
31
- */
32
- protected $_settings = array();
33
-
34
- /**
35
- * @var object The single instance of the class
36
- * @since 1.0
37
- */
38
- protected static $_instance = null;
39
-
40
- /**
41
- * @var string Option name
42
- * @since 1.0
43
- */
44
- protected $_licence_option = 'yit_plugin_licence_activation';
45
-
46
- /**
47
- * @var string product type
48
- * @since 1.0
49
- */
50
- protected $_product_type = 'plugin';
51
-
52
- /**
53
- * Constructor
54
- *
55
- * @since 1.0
56
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
57
- */
58
- public function __construct() {
59
- parent::__construct();
60
-
61
- if ( !is_admin() ) {
62
- return;
63
- }
64
-
65
- $this->_settings = array(
66
- 'parent_page' => 'yit_plugin_panel',
67
- 'page_title' => __( 'License Activation', 'yith-plugin-fw' ),
68
- 'menu_title' => __( 'License Activation', 'yith-plugin-fw' ),
69
- 'capability' => 'manage_options',
70
- 'page' => 'yith_plugins_activation',
71
- );
72
-
73
- add_action( 'admin_menu', array( $this, 'add_submenu_page' ), 99 );
74
- add_action( "wp_ajax_activate-{$this->_product_type}", array( $this, 'activate' ) );
75
- add_action( "wp_ajax_deactivate-{$this->_product_type}", array( $this, 'deactivate' ) );
76
- add_action( "wp_ajax_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
77
- add_action( 'yit_licence_after_check', array( $this, 'licence_after_check' ) );
78
- }
79
-
80
-
81
- public function licence_after_check() {
82
- /* === Regenerate Update Plugins Transient === */
83
- YIT_Upgrade()->force_regenerate_update_transient();
84
- }
85
-
86
- /**
87
- * Main plugin Instance
88
- *
89
- * @static
90
- * @return object Main instance
91
- *
92
- * @since 1.0
93
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
94
- */
95
- public static function instance() {
96
- if ( is_null( self::$_instance ) ) {
97
- self::$_instance = new self();
98
- }
99
-
100
- return self::$_instance;
101
- }
102
-
103
- /**
104
- * Add "Activation" submenu page under YIT Plugins
105
- *
106
- * @return void
107
- * @since 1.0
108
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
109
- */
110
- public function add_submenu_page() {
111
- add_submenu_page(
112
- $this->_settings['parent_page'],
113
- $this->_settings['page_title'],
114
- $this->_settings['menu_title'],
115
- $this->_settings['capability'],
116
- $this->_settings['page'],
117
- array( $this, 'show_activation_panel' )
118
- );
119
- }
120
-
121
- /**
122
- * Premium plugin registration
123
- *
124
- * @param $plugin_init | string | The plugin init file
125
- * @param $secret_key | string | The product secret key
126
- * @param $product_id | string | The plugin slug (product_id)
127
- *
128
- * @return void
129
- *
130
- * @since 1.0
131
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
132
- */
133
- public function register( $plugin_init, $secret_key, $product_id ) {
134
- if ( !function_exists( 'get_plugins' ) ) {
135
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
- }
137
-
138
- $plugins = get_plugins();
139
- $plugins[$plugin_init]['secret_key'] = $secret_key;
140
- $plugins[$plugin_init]['product_id'] = $product_id;
141
- $this->_products[$plugin_init] = $plugins[$plugin_init];
142
- }
143
-
144
- public function get_product_type() {
145
- return $this->_product_type;
146
- }
147
- }
148
- }
149
-
150
- /**
151
- * Main instance of plugin
152
- *
153
- * @return object
154
- * @since 1.0
155
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
156
- */
157
- if ( !function_exists( 'YIT_Plugin_Licence' ) ) {
158
- function YIT_Plugin_Licence() {
159
- return YIT_Plugin_Licence::instance();
160
- }
161
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( !class_exists( 'YIT_Plugin_Licence' ) ) {
16
+ /**
17
+ * YIT Plugin Licence Panel
18
+ *
19
+ * Setting Page to Manage Plugins
20
+ *
21
+ * @class YIT_Plugin_Licence
22
+ * @package Yithemes
23
+ * @since 1.0
24
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
+ */
26
+ class YIT_Plugin_Licence extends YIT_Licence {
27
+
28
+ /**
29
+ * @var array The settings require to add the submenu page "Activation"
30
+ * @since 1.0
31
+ */
32
+ protected $_settings = array();
33
+
34
+ /**
35
+ * @var object The single instance of the class
36
+ * @since 1.0
37
+ */
38
+ protected static $_instance = null;
39
+
40
+ /**
41
+ * @var string Option name
42
+ * @since 1.0
43
+ */
44
+ protected $_licence_option = 'yit_plugin_licence_activation';
45
+
46
+ /**
47
+ * @var string product type
48
+ * @since 1.0
49
+ */
50
+ protected $_product_type = 'plugin';
51
+
52
+ /**
53
+ * Constructor
54
+ *
55
+ * @since 1.0
56
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
57
+ */
58
+ public function __construct() {
59
+ parent::__construct();
60
+
61
+ if ( !is_admin() ) {
62
+ return;
63
+ }
64
+
65
+ $this->_settings = array(
66
+ 'parent_page' => 'yit_plugin_panel',
67
+ 'page_title' => __( 'License Activation', 'yith-plugin-fw' ),
68
+ 'menu_title' => __( 'License Activation', 'yith-plugin-fw' ),
69
+ 'capability' => 'manage_options',
70
+ 'page' => 'yith_plugins_activation',
71
+ );
72
+
73
+ add_action( 'admin_menu', array( $this, 'add_submenu_page' ), 99 );
74
+ add_action( "wp_ajax_activate-{$this->_product_type}", array( $this, 'activate' ) );
75
+ add_action( "wp_ajax_deactivate-{$this->_product_type}", array( $this, 'deactivate' ) );
76
+ add_action( "wp_ajax_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
77
+ add_action( 'yit_licence_after_check', array( $this, 'licence_after_check' ) );
78
+ }
79
+
80
+
81
+ public function licence_after_check() {
82
+ /* === Regenerate Update Plugins Transient === */
83
+ YIT_Upgrade()->force_regenerate_update_transient();
84
+ }
85
+
86
+ /**
87
+ * Main plugin Instance
88
+ *
89
+ * @static
90
+ * @return object Main instance
91
+ *
92
+ * @since 1.0
93
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
94
+ */
95
+ public static function instance() {
96
+ if ( is_null( self::$_instance ) ) {
97
+ self::$_instance = new self();
98
+ }
99
+
100
+ return self::$_instance;
101
+ }
102
+
103
+ /**
104
+ * Add "Activation" submenu page under YITH Plugins
105
+ *
106
+ * @return void
107
+ * @since 1.0
108
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
109
+ */
110
+ public function add_submenu_page() {
111
+ add_submenu_page(
112
+ $this->_settings['parent_page'],
113
+ $this->_settings['page_title'],
114
+ $this->_settings['menu_title'],
115
+ $this->_settings['capability'],
116
+ $this->_settings['page'],
117
+ array( $this, 'show_activation_panel' )
118
+ );
119
+ }
120
+
121
+ /**
122
+ * Premium plugin registration
123
+ *
124
+ * @param $plugin_init | string | The plugin init file
125
+ * @param $secret_key | string | The product secret key
126
+ * @param $product_id | string | The plugin slug (product_id)
127
+ *
128
+ * @return void
129
+ *
130
+ * @since 1.0
131
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
132
+ */
133
+ public function register( $plugin_init, $secret_key, $product_id ) {
134
+ if ( !function_exists( 'get_plugins' ) ) {
135
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
+ }
137
+
138
+ $plugins = get_plugins();
139
+ $plugins[$plugin_init]['secret_key'] = $secret_key;
140
+ $plugins[$plugin_init]['product_id'] = $product_id;
141
+ $this->_products[$plugin_init] = $plugins[$plugin_init];
142
+ }
143
+
144
+ public function get_product_type() {
145
+ return $this->_product_type;
146
+ }
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Main instance of plugin
152
+ *
153
+ * @return object
154
+ * @since 1.0
155
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
156
+ */
157
+ if ( !function_exists( 'YIT_Plugin_Licence' ) ) {
158
+ function YIT_Plugin_Licence() {
159
+ return YIT_Plugin_Licence::instance();
160
+ }
161
  }
plugin-fw/licence/lib/yit-theme-licence.php CHANGED
@@ -1,191 +1,191 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( !class_exists( 'YIT_Theme_Licence' ) ) {
16
- /**
17
- * YIT Plugin Licence Panel
18
- *
19
- * Setting Page to Manage Plugins
20
- *
21
- * @class YIT_Theme_Licence
22
- * @package Yithemes
23
- * @since 1.0
24
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
- */
26
- class YIT_Theme_Licence extends YIT_Licence {
27
-
28
- /**
29
- * @var array The settings require to add the submenu page "Activation"
30
- * @since 1.0
31
- */
32
- protected $_settings = array();
33
-
34
- /**
35
- * @var object The single instance of the class
36
- * @since 1.0
37
- */
38
- protected static $_instance = null;
39
-
40
- /**
41
- * @var string Option name
42
- * @since 1.0
43
- */
44
- protected $_licence_option = 'yit_theme_licence_activation';
45
-
46
- /**
47
- * @var string product type
48
- * @since 1.0
49
- */
50
- protected $_product_type = 'theme';
51
-
52
- /**
53
- * @var string Old theme licence works until 28 January 2016
54
- * @since 1.0
55
- */
56
- protected $_old_licence_expires = 1453939200; //28 January 2016
57
-
58
- /**
59
- * Constructor
60
- *
61
- * @since 1.0
62
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
63
- */
64
- public function __construct() {
65
- parent::__construct();
66
-
67
- $this->_settings = array(
68
- 'parent_page' => 'yit_product_panel',
69
- 'page_title' => __( 'License Activation', 'yith-plugin-fw' ),
70
- 'menu_title' => __( 'License Activation', 'yith-plugin-fw' ),
71
- 'capability' => 'manage_options',
72
- 'page' => 'yith_plugins_activation',
73
- );
74
-
75
- add_action( 'admin_menu', array( $this, 'add_submenu_page' ), 99 );
76
- add_action( "wp_ajax_activate-{$this->_product_type}", array( $this, 'activate' ) );
77
- add_action( "wp_ajax_deactivate-{$this->_product_type}", array( $this, 'deactivate' ) );
78
- add_action( "wp_ajax_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
79
- }
80
-
81
- /**
82
- * Main plugin Instance
83
- *
84
- * @static
85
- * @return object Main instance
86
- *
87
- * @since 1.0
88
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
89
- */
90
- public static function instance() {
91
- if ( is_null( self::$_instance ) ) {
92
- self::$_instance = new self();
93
- }
94
-
95
- return self::$_instance;
96
- }
97
-
98
- /**
99
- * Add "Activation" submenu page under YIT Plugins
100
- *
101
- * @return void
102
- * @since 1.0
103
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
104
- */
105
- public function add_submenu_page() {
106
-
107
- $admin_tree = array(
108
- 'parent_slug' => apply_filters( 'yit_licence_parent_slug', 'yit_panel' ),
109
- 'page_title' => __( 'License Activation', 'yith-plugin-fw' ),
110
- 'menu_title' => __( 'License Activation', 'yith-plugin-fw' ),
111
- 'capability' => 'manage_options',
112
- 'menu_slug' => 'yit_panel_license',
113
- 'function' => 'show_activation_panel'
114
- );
115
-
116
- add_submenu_page( $admin_tree['parent_slug'],
117
- sprintf( __( '%s', 'yith-plugin-fw' ), $admin_tree['page_title'] ),
118
- sprintf( __( '%s', 'yith-plugin-fw' ), $admin_tree['menu_title'] ),
119
- $admin_tree['capability'],
120
- $admin_tree['menu_slug'],
121
- array( $this, $admin_tree['function'] )
122
- );
123
- }
124
-
125
- /**
126
- * Premium product registration
127
- *
128
- * @param $product_init | string | The product init file
129
- * @param $secret_key | string | The product secret key
130
- * @param $product_id | string | The product slug (product_id)
131
- *
132
- * @return void
133
- *
134
- * @since 1.0
135
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
136
- */
137
- public function register( $product_init, $secret_key, $product_id ) {
138
- $theme = wp_get_theme();
139
- $products[$product_init]['Name'] = $theme->Name;
140
- $products[$product_init]['secret_key'] = $secret_key;
141
- $products[$product_init]['product_id'] = $product_id;
142
- $this->_products[$product_init] = $products[$product_init];
143
- }
144
-
145
- /**
146
- * Check for old licence
147
- *
148
- * @return bool True for old licence period, false otherwise
149
- * @since 2.2
150
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
151
- */
152
- public function show_old_licence_message() {
153
- return time() < $this->_old_licence_expires;
154
- }
155
-
156
- public function get_old_licence_message() {
157
- ob_start(); ?>
158
- <div class="activation-faq">
159
- <h3><?php _e( 'I cannot find the license key for activating the theme I have bought some time ago. Where can I find it?', 'yith-plugin-fw' ) ?></h3>
160
-
161
- <p>
162
- <?php
163
- _e( 'If you have purchased one of our products before 27 January 2015, you can benefit from support and updates (the services offered with the license)
164
- until 27 January 2016 and you do not have to purchase it again to get a new license key, because, before this date, your license used to be activated automatically by our system.
165
- After 27 January 2016, instead, if you want to benefit from support and updates you have to buy a new license and activate it through the license key you will be
166
- provided with and that you can find in your YIThemes account, in section "My licenses".', 'yith-plugin-fw' )
167
- ?>
168
- </p>
169
- </div>
170
- <?php
171
- echo ob_get_clean();
172
- }
173
-
174
- public function get_product_type() {
175
- return $this->_product_type;
176
- }
177
- }
178
- }
179
-
180
- /**
181
- * Main instance
182
- *
183
- * @return object
184
- * @since 1.0
185
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
186
- */
187
- if ( !function_exists( 'YIT_Theme_Licence' ) ) {
188
- function YIT_Theme_Licence() {
189
- return YIT_Theme_Licence::instance();
190
- }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( !class_exists( 'YIT_Theme_Licence' ) ) {
16
+ /**
17
+ * YIT Plugin Licence Panel
18
+ *
19
+ * Setting Page to Manage Plugins
20
+ *
21
+ * @class YIT_Theme_Licence
22
+ * @package Yithemes
23
+ * @since 1.0
24
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
25
+ */
26
+ class YIT_Theme_Licence extends YIT_Licence {
27
+
28
+ /**
29
+ * @var array The settings require to add the submenu page "Activation"
30
+ * @since 1.0
31
+ */
32
+ protected $_settings = array();
33
+
34
+ /**
35
+ * @var object The single instance of the class
36
+ * @since 1.0
37
+ */
38
+ protected static $_instance = null;
39
+
40
+ /**
41
+ * @var string Option name
42
+ * @since 1.0
43
+ */
44
+ protected $_licence_option = 'yit_theme_licence_activation';
45
+
46
+ /**
47
+ * @var string product type
48
+ * @since 1.0
49
+ */
50
+ protected $_product_type = 'theme';
51
+
52
+ /**
53
+ * @var string Old theme licence works until 28 January 2016
54
+ * @since 1.0
55
+ */
56
+ protected $_old_licence_expires = 1453939200; //28 January 2016
57
+
58
+ /**
59
+ * Constructor
60
+ *
61
+ * @since 1.0
62
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
63
+ */
64
+ public function __construct() {
65
+ parent::__construct();
66
+
67
+ $this->_settings = array(
68
+ 'parent_page' => 'yit_product_panel',
69
+ 'page_title' => __( 'License Activation', 'yith-plugin-fw' ),
70
+ 'menu_title' => __( 'License Activation', 'yith-plugin-fw' ),
71
+ 'capability' => 'manage_options',
72
+ 'page' => 'yith_plugins_activation',
73
+ );
74
+
75
+ add_action( 'admin_menu', array( $this, 'add_submenu_page' ), 99 );
76
+ add_action( "wp_ajax_activate-{$this->_product_type}", array( $this, 'activate' ) );
77
+ add_action( "wp_ajax_deactivate-{$this->_product_type}", array( $this, 'deactivate' ) );
78
+ add_action( "wp_ajax_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
79
+ }
80
+
81
+ /**
82
+ * Main plugin Instance
83
+ *
84
+ * @static
85
+ * @return object Main instance
86
+ *
87
+ * @since 1.0
88
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
89
+ */
90
+ public static function instance() {
91
+ if ( is_null( self::$_instance ) ) {
92
+ self::$_instance = new self();
93
+ }
94
+
95
+ return self::$_instance;
96
+ }
97
+
98
+ /**
99
+ * Add "Activation" submenu page under YITH Plugins
100
+ *
101
+ * @return void
102
+ * @since 1.0
103
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
104
+ */
105
+ public function add_submenu_page() {
106
+
107
+ $admin_tree = array(
108
+ 'parent_slug' => apply_filters( 'yit_licence_parent_slug', 'yit_panel' ),
109
+ 'page_title' => __( 'License Activation', 'yith-plugin-fw' ),
110
+ 'menu_title' => __( 'License Activation', 'yith-plugin-fw' ),
111
+ 'capability' => 'manage_options',
112
+ 'menu_slug' => 'yit_panel_license',
113
+ 'function' => 'show_activation_panel'
114
+ );
115
+
116
+ add_submenu_page( $admin_tree['parent_slug'],
117
+ sprintf( __( '%s', 'yith-plugin-fw' ), $admin_tree['page_title'] ),
118
+ sprintf( __( '%s', 'yith-plugin-fw' ), $admin_tree['menu_title'] ),
119
+ $admin_tree['capability'],
120
+ $admin_tree['menu_slug'],
121
+ array( $this, $admin_tree['function'] )
122
+ );
123
+ }
124
+
125
+ /**
126
+ * Premium product registration
127
+ *
128
+ * @param $product_init | string | The product init file
129
+ * @param $secret_key | string | The product secret key
130
+ * @param $product_id | string | The product slug (product_id)
131
+ *
132
+ * @return void
133
+ *
134
+ * @since 1.0
135
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
136
+