WooCommerce Wishlist Plugin - Version 1.1.2

Version Description

Release Date - 23 November 2016

  • Added minified versions of public CSS
  • Fixed issue with sharing buttons for non-logged users
  • Fixed issue with pagination URLs for guests
  • Removed Genericicons fonts
Download this release

Release Info

Developer templateinvaders
Plugin Icon 128x128 WooCommerce Wishlist Plugin
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.1.2

Files changed (100) hide show
  1. admin/base.helper.php +115 -115
  2. admin/basesection.helper.php +209 -209
  3. admin/basestyle.helper.php +268 -268
  4. admin/index.php +3 -3
  5. admin/settings/general.class.php +443 -443
  6. admin/settings/index.php +2 -2
  7. admin/settings/style.class.php +636 -636
  8. admin/settings/upgrade.class.php +40 -40
  9. admin/tinvwl.class.php +162 -162
  10. asset/css/admin-form.css +410 -410
  11. asset/css/admin-form.min.css +1 -1
  12. asset/css/admin-setup.css +347 -347
  13. asset/css/admin.css +3281 -3281
  14. asset/css/admin.min.css +1 -1
  15. asset/css/bootstrap.css +6760 -6760
  16. asset/css/bootstrap.min.css +5 -5
  17. asset/css/font-awesome.css +2086 -2086
  18. asset/css/font-awesome.min.css +3 -3
  19. asset/css/genericons.css +0 -263
  20. asset/css/public.css +1973 -1973
  21. asset/css/public.min.css +1 -1
  22. asset/css/theme.css +924 -924
  23. asset/css/theme.min.css +1 -0
  24. asset/fonts/fontawesome-webfont.svg +654 -654
  25. asset/fonts/genericons/COPYING.txt +0 -9
  26. asset/fonts/genericons/Genericons.eot +0 -0
  27. asset/fonts/genericons/Genericons.svg +0 -537
  28. asset/fonts/genericons/Genericons.ttf +0 -0
  29. asset/fonts/genericons/Genericons.woff +0 -0
  30. asset/fonts/genericons/LICENSE.txt +0 -339
  31. asset/fonts/genericons/README.md +0 -218
  32. asset/js/admin.js +328 -328
  33. asset/js/admin.min.js +1 -1
  34. asset/js/bootstrap.js +2363 -2363
  35. asset/js/public.js +404 -404
  36. asset/js/public.min.js +1 -1
  37. includes/activator.class.php +750 -750
  38. includes/form.helper.php +1198 -1198
  39. includes/index.php +2 -2
  40. includes/pluginextend.helper.php +567 -567
  41. includes/product.helper.php +475 -475
  42. includes/product/index.php +2 -2
  43. includes/product/local.class.php +476 -476
  44. includes/tinvwl.class.php +113 -113
  45. includes/update.helper.php +110 -110
  46. includes/view.helper.php +378 -378
  47. includes/viewsection.helper.php +538 -538
  48. includes/wishlist.class.php +373 -373
  49. includes/wizard.class.php +511 -511
  50. includes/wizardsetup.helper.php +86 -86
  51. index.php +2 -2
  52. languages/ti-woocommerce-wishlist.pot +1101 -1101
  53. public/addtowishlist.class.php +432 -432
  54. public/cart.class.php +228 -228
  55. public/index.php +2 -2
  56. public/tinvwl.class.php +423 -424
  57. public/wishlist/buttons.class.php +397 -397
  58. public/wishlist/index.php +2 -2
  59. public/wishlist/social.class.php +165 -165
  60. public/wishlist/view.class.php +427 -427
  61. readme.txt +10 -1
  62. templates/index.php +2 -2
  63. templates/ti-addedtowishlist-dialogbox.php +31 -31
  64. templates/ti-addtowishlist.php +22 -22
  65. templates/ti-wishlist-empty.php +30 -30
  66. templates/ti-wishlist-header.php +17 -17
  67. templates/ti-wishlist-item-data.php +20 -20
  68. templates/ti-wishlist-null.php +22 -22
  69. templates/ti-wishlist-social.php +24 -24
  70. templates/ti-wishlist-user.php +128 -128
  71. templates/ti-wishlist.php +144 -144
  72. ti-woocommerce-wishlist.php +121 -121
  73. tinv-wishlists-function.php +693 -693
  74. views/admin/index.php +2 -2
  75. views/admin/premium-features.php +64 -64
  76. views/admin/upgrade.php +22 -22
  77. views/general.php +18 -18
  78. views/header.php +44 -44
  79. views/index.php +2 -2
  80. views/message.php +14 -14
  81. views/null.php +21 -21
  82. views/section-field-html.php +23 -23
  83. views/section-field-style.php +17 -17
  84. views/section-field.php +38 -38
  85. views/section-general.php +43 -43
  86. views/section-group-style-e.php +41 -41
  87. views/section-group-style.php +36 -36
  88. views/section-group.php +36 -36
  89. views/section-infoblock.php +26 -26
  90. views/wizard/finish.php +27 -27
  91. views/wizard/footer.php +20 -20
  92. views/wizard/header.php +44 -44
  93. views/wizard/index.php +2 -2
  94. views/wizard/intro.php +27 -27
  95. views/wizard/step-button.php +56 -56
  96. views/wizard/step-page-field.php +45 -45
  97. views/wizard/step-page.php +57 -57
  98. views/wizard/step-processing.php +39 -39
  99. views/wizard/step-social.php +79 -79
  100. wpml-config.xml +15 -15
admin/base.helper.php CHANGED
@@ -1,115 +1,115 @@
1
- <?php
2
- /**
3
- * Basic admin helper class
4
- *
5
- * @since 1.0.0
6
- * @package TInvWishlist\Admin\Helper
7
- */
8
-
9
- // If this file is called directly, abort.
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- die;
12
- }
13
-
14
- /**
15
- * Basic admin helper class
16
- */
17
- abstract class TInvWL_Admin_Base {
18
-
19
- /**
20
- * Plugin name
21
- *
22
- * @var string
23
- */
24
- public $_n;
25
- /**
26
- * Plugin version
27
- *
28
- * @var string
29
- */
30
- public $_v;
31
-
32
- /**
33
- * Constructor
34
- *
35
- * @param string $plugin_name Plugin name.
36
- * @param string $version Plugin version.
37
- */
38
- function __construct( $plugin_name, $version ) {
39
- $this->_n = $plugin_name;
40
- $this->_v = $version;
41
- $this->load_function();
42
- }
43
-
44
- /**
45
- * Load function
46
- */
47
- function load_function() {
48
-
49
- }
50
-
51
- /**
52
- * Formated admin url
53
- *
54
- * @param string $page Page title.
55
- * @param string $cat Category title.
56
- * @param array $arg Arguments array.
57
- * @return string
58
- */
59
- public function admin_url( $page, $cat = '', $arg = array() ) {
60
- $protocol = is_ssl() ? 'https' : 'http';
61
- $glue = '-';
62
- $params = array(
63
- 'page' => implode( $glue, array_filter( array( $this->_n, $page ) ) ),
64
- 'cat' => $cat,
65
- );
66
- if ( is_array( $arg ) ) {
67
- $params = array_merge( $params, $arg );
68
- }
69
- $params = array_filter( $params );
70
- $params = http_build_query( $params );
71
- if ( is_string( $arg ) ) {
72
- $params = $params . '&' . $arg;
73
- }
74
-
75
- return admin_url( sprintf( 'admin.php?%s', $params ), $protocol );
76
- }
77
-
78
- /**
79
- * Basic print admin page. By attributes page and cat, determined sub function for print
80
- *
81
- * @return boolean
82
- */
83
- public function _print_() {
84
- $default = 'general';
85
- $params = filter_input_array( INPUT_GET, array(
86
- 'page' => FILTER_SANITIZE_STRING,
87
- 'cat' => FILTER_SANITIZE_STRING,
88
- 'id' => FILTER_VALIDATE_INT,
89
- ) );
90
- extract( $params ); // @codingStandardsIgnoreLine WordPress.VIP.RestrictedFunctions.extract
91
-
92
- $glue = '-';
93
- $page = explode( $glue, $page );
94
- $page_last = array_shift( $page );
95
- if ( $this->_n != $page_last ) { // WPCS: loose comparison ok.
96
- return false;
97
- }
98
-
99
- $cat = empty( $cat ) ? $default : $cat;
100
- $glue = '_';
101
- array_push( $page, $cat );
102
- $cat = implode( $glue, $page );
103
- $function_name = __FUNCTION__ . $cat;
104
-
105
- if ( method_exists( $this, $function_name ) && __FUNCTION__ != $function_name ) { // WPCS: loose comparison ok.
106
- return $this->$function_name( $id );
107
- } else {
108
- $function_name = __FUNCTION__ . $default;
109
- if ( method_exists( $this, $function_name ) ) {
110
- return $this->$function_name( $id, $cat );
111
- }
112
- }
113
- return false;
114
- }
115
- }
1
+ <?php
2
+ /**
3
+ * Basic admin helper class
4
+ *
5
+ * @since 1.0.0
6
+ * @package TInvWishlist\Admin\Helper
7
+ */
8
+
9
+ // If this file is called directly, abort.
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ die;
12
+ }
13
+
14
+ /**
15
+ * Basic admin helper class
16
+ */
17
+ abstract class TInvWL_Admin_Base {
18
+
19
+ /**
20
+ * Plugin name
21
+ *
22
+ * @var string
23
+ */
24
+ public $_n;
25
+ /**
26
+ * Plugin version
27
+ *
28
+ * @var string
29
+ */
30
+ public $_v;
31
+
32
+ /**
33
+ * Constructor
34
+ *
35
+ * @param string $plugin_name Plugin name.
36
+ * @param string $version Plugin version.
37
+ */
38
+ function __construct( $plugin_name, $version ) {
39
+ $this->_n = $plugin_name;
40
+ $this->_v = $version;
41
+ $this->load_function();
42
+ }
43
+
44
+ /**
45
+ * Load function
46
+ */
47
+ function load_function() {
48
+
49
+ }
50
+
51
+ /**
52
+ * Formated admin url
53
+ *
54
+ * @param string $page Page title.
55
+ * @param string $cat Category title.
56
+ * @param array $arg Arguments array.
57
+ * @return string
58
+ */
59
+ public function admin_url( $page, $cat = '', $arg = array() ) {
60
+ $protocol = is_ssl() ? 'https' : 'http';
61
+ $glue = '-';
62
+ $params = array(
63
+ 'page' => implode( $glue, array_filter( array( $this->_n, $page ) ) ),
64
+ 'cat' => $cat,
65
+ );
66
+ if ( is_array( $arg ) ) {
67
+ $params = array_merge( $params, $arg );
68
+ }
69
+ $params = array_filter( $params );
70
+ $params = http_build_query( $params );
71
+ if ( is_string( $arg ) ) {
72
+ $params = $params . '&' . $arg;
73
+ }
74
+
75
+ return admin_url( sprintf( 'admin.php?%s', $params ), $protocol );
76
+ }
77
+
78
+ /**
79
+ * Basic print admin page. By attributes page and cat, determined sub function for print
80
+ *
81
+ * @return boolean
82
+ */
83
+ public function _print_() {
84
+ $default = 'general';
85
+ $params = filter_input_array( INPUT_GET, array(
86
+ 'page' => FILTER_SANITIZE_STRING,
87
+ 'cat' => FILTER_SANITIZE_STRING,
88
+ 'id' => FILTER_VALIDATE_INT,
89
+ ) );
90
+ extract( $params ); // @codingStandardsIgnoreLine WordPress.VIP.RestrictedFunctions.extract
91
+
92
+ $glue = '-';
93
+ $page = explode( $glue, $page );
94
+ $page_last = array_shift( $page );
95
+ if ( $this->_n != $page_last ) { // WPCS: loose comparison ok.
96
+ return false;
97
+ }
98
+
99
+ $cat = empty( $cat ) ? $default : $cat;
100
+ $glue = '_';
101
+ array_push( $page, $cat );
102
+ $cat = implode( $glue, $page );
103
+ $function_name = __FUNCTION__ . $cat;
104
+
105
+ if ( method_exists( $this, $function_name ) && __FUNCTION__ != $function_name ) { // WPCS: loose comparison ok.
106
+ return $this->$function_name( $id );
107
+ } else {
108
+ $function_name = __FUNCTION__ . $default;
109
+ if ( method_exists( $this, $function_name ) ) {
110
+ return $this->$function_name( $id, $cat );
111
+ }
112
+ }
113
+ return false;
114
+ }
115
+ }
admin/basesection.helper.php CHANGED
@@ -1,209 +1,209 @@
1
- <?php
2
- /**
3
- * Basic admin sectin helper class
4
- *
5
- * @since 1.0.0
6
- * @package TInvWishlist\Admin\Helper
7
- */
8
-
9
- // If this file is called directly, abort.
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- die;
12
- }
13
-
14
- /**
15
- * Basic admin sectin helper class
16
- */
17
- abstract class TInvWL_Admin_BaseSection extends TInvWL_Admin_Base {
18
-
19
- /**
20
- * Priority for admin menu
21
- *
22
- * @var integer
23
- */
24
- public $priority = 10;
25
-
26
- /**
27
- * Constructor
28
- *
29
- * @param string $plugin_name Plugin name.
30
- * @param string $version Plugin version.
31
- */
32
- function __construct( $plugin_name, $version ) {
33
- $this->_n = $plugin_name;
34
- $this->_v = $version;
35
- $menu = $this->menu();
36
- if ( ! empty( $menu ) ) {
37
- add_action( $this->_n . '_admin_menu', array( $this, 'adminmenu' ), $this->priority );
38
- }
39
- $this->load_function();
40
- }
41
-
42
- /**
43
- * Add item to admin menu
44
- *
45
- * @param array $data Menu.
46
- * @return array
47
- */
48
- function adminmenu( $data ) {
49
- $data[] = $this->menu();
50
- return $data;
51
- }
52
-
53
- /**
54
- * Menu array
55
- */
56
- function menu() {
57
-
58
- }
59
-
60
- /**
61
- * Load function. Default load form for sections
62
- */
63
- function load_function() {
64
- $this->form();
65
- }
66
-
67
- /**
68
- * General print
69
- *
70
- * @param integer $id Id parameter.
71
- * @param string $cat Category parameter.
72
- */
73
- function _print_general( $id = 0, $cat = '' ) {
74
- $title = $this->menu();
75
- $slug = $title['slug'];
76
- $title = isset( $title['page_title'] ) ? $title['page_title'] : $title['title'];
77
- $data = array(
78
- '_header' => $title,
79
- );
80
- $method = $cat . '_data';
81
- if ( ! method_exists( $this, $method ) ) {
82
- $method = 'constructor_data';
83
- }
84
-
85
- $data = apply_filters( "{$this->_n}_{$cat}_data", $data );
86
- if ( method_exists( $this, $method ) ) {
87
- $sections = apply_filters( 'tinwl_prepare_admsections_' . $method, $this->$method() );
88
- $sections = apply_filters( 'tinwl_prepare_admsections', $sections );
89
- $view = new TInvWL_ViewSection( $this->_n, $this->_v );
90
- $view->load_data( $sections );
91
- $method = $cat . '_save';
92
- if ( ! method_exists( $this, $method ) ) {
93
- $method = 'constructor_save';
94
- }
95
- if ( method_exists( $this, $method ) ) {
96
- $this->$method( apply_filters( 'tinwl_prepare_admsections_' . $method, $view->post_form() ) );
97
- }
98
- $method = $cat . '_load';
99
- if ( ! method_exists( $this, $method ) ) {
100
- $method = 'constructor_load';
101
- }
102
- if ( method_exists( $this, $method ) ) {
103
- $view->load_value( apply_filters( 'tinwl_prepare_admsections_' . $method, $this->$method( $sections ) ) );
104
- }
105
- TInvWL_View::render( $view, $view->form_data( $data ) );
106
- } else {
107
- TInvWL_View::render( $slug, $data );
108
- }
109
- }
110
-
111
- /**
112
- * Method for default settings array
113
- *
114
- * @param array $sections Sections array.
115
- * @return array
116
- */
117
- function get_defaults( $sections ) {
118
- $defaults = array();
119
- if ( ! is_array( $sections ) ) {
120
- return $defaults;
121
- }
122
- $sections = apply_filters( 'tinwl_prepare_admsections', $sections );
123
- foreach ( $sections as $section ) {
124
- if ( array_key_exists( 'noform', $section ) && $section['noform'] ) {
125
- continue;
126
- }
127
- $fields = array();
128
- if ( array_key_exists( 'fields', $section ) ) {
129
- $fields = $section['fields'];
130
- } else {
131
- continue;
132
- }
133
- $id = array_key_exists( 'id', $section ) ? $section['id'] : '';
134
- if ( ! array_key_exists( $id, $defaults ) ) {
135
- $defaults[ $id ] = array();
136
- }
137
- foreach ( $fields as $field ) {
138
- $name = array_key_exists( 'name', $field ) ? $field['name'] : '';
139
- $std = array_key_exists( 'std', $field ) ? $field['std'] : '';
140
-
141
- $defaults[ $id ][ $name ] = $std;
142
- }
143
- if ( array_key_exists( '', $defaults[ $id ] ) ) {
144
- unset( $defaults[ $id ][''] );
145
- }
146
- }
147
- return $defaults;
148
- }
149
-
150
- /**
151
- * Form for section
152
- */
153
- function form() {
154
- add_filter( $this->_n . '_section_before', array( $this, 'start_form' ) );
155
- add_filter( $this->_n . '_section_after', array( $this, 'end_form' ) );
156
- }
157
-
158
- /**
159
- * Form start for section
160
- *
161
- * @param string $content Sections content.
162
- * @return string
163
- */
164
- function start_form( $content ) {
165
- $content .= '<form method="POST" autocomplete="off">';
166
- return $content;
167
- }
168
-
169
- /**
170
- * Form end for section
171
- *
172
- * @param string $content Sections content.
173
- * @return string
174
- */
175
- function end_form( $content ) {
176
- $content .= '</form>';
177
- return $content;
178
- }
179
-
180
- /**
181
- * Load value from database
182
- *
183
- * @param array $sections Sections array.
184
- * @return array
185
- */
186
- function constructor_load( $sections ) {
187
- $sections = $this->get_defaults( $sections );
188
- $sections = array_keys( $sections );
189
- $data = array();
190
- foreach ( $sections as $section ) {
191
- $data[ $section ] = tinv_get_option( $section );
192
- }
193
- return $data;
194
- }
195
-
196
- /**
197
- * Save value to database
198
- *
199
- * @param array $data Post section data.
200
- */
201
- function constructor_save( $data ) {
202
- if ( empty( $data ) || ! is_array( $data ) ) {
203
- return false;
204
- }
205
- foreach ( $data as $key => $value ) {
206
- tinv_update_option( $key, '', $value );
207
- }
208
- }
209
- }
1
+ <?php
2
+ /**
3
+ * Basic admin sectin helper class
4
+ *
5
+ * @since 1.0.0
6
+ * @package TInvWishlist\Admin\Helper
7
+ */
8
+
9
+ // If this file is called directly, abort.
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ die;
12
+ }
13
+
14
+ /**
15
+ * Basic admin sectin helper class
16
+ */
17
+ abstract class TInvWL_Admin_BaseSection extends TInvWL_Admin_Base {
18
+
19
+ /**
20
+ * Priority for admin menu
21
+ *
22
+ * @var integer
23
+ */
24
+ public $priority = 10;
25
+
26
+ /**
27
+ * Constructor
28
+ *
29
+ * @param string $plugin_name Plugin name.
30
+ * @param string $version Plugin version.
31
+ */
32
+ function __construct( $plugin_name, $version ) {
33
+ $this->_n = $plugin_name;
34
+ $this->_v = $version;
35
+ $menu = $this->menu();
36
+ if ( ! empty( $menu ) ) {
37
+ add_action( $this->_n . '_admin_menu', array( $this, 'adminmenu' ), $this->priority );
38
+ }
39
+ $this->load_function();
40
+ }
41
+
42
+ /**
43
+ * Add item to admin menu
44
+ *
45
+ * @param array $data Menu.
46
+ * @return array
47
+ */
48
+ function adminmenu( $data ) {
49
+ $data[] = $this->menu();
50
+ return $data;
51
+ }
52
+
53
+ /**
54
+ * Menu array
55
+ */
56
+ function menu() {
57
+
58
+ }
59
+
60
+ /**
61
+ * Load function. Default load form for sections
62
+ */
63
+ function load_function() {
64
+ $this->form();
65
+ }
66
+
67
+ /**
68
+ * General print
69
+ *
70
+ * @param integer $id Id parameter.
71
+ * @param string $cat Category parameter.
72
+ */
73
+ function _print_general( $id = 0, $cat = '' ) {
74
+ $title = $this->menu();
75
+ $slug = $title['slug'];
76
+ $title = isset( $title['page_title'] ) ? $title['page_title'] : $title['title'];
77
+ $data = array(
78
+ '_header' => $title,
79
+ );
80
+ $method = $cat . '_data';
81
+ if ( ! method_exists( $this, $method ) ) {
82
+ $method = 'constructor_data';
83
+ }
84
+
85
+ $data = apply_filters( "{$this->_n}_{$cat}_data", $data );
86
+ if ( method_exists( $this, $method ) ) {
87
+ $sections = apply_filters( 'tinwl_prepare_admsections_' . $method, $this->$method() );
88
+ $sections = apply_filters( 'tinwl_prepare_admsections', $sections );
89
+ $view = new TInvWL_ViewSection( $this->_n, $this->_v );
90
+ $view->load_data( $sections );
91
+ $method = $cat . '_save';
92
+ if ( ! method_exists( $this, $method ) ) {
93
+ $method = 'constructor_save';
94
+ }
95
+ if ( method_exists( $this, $method ) ) {
96
+ $this->$method( apply_filters( 'tinwl_prepare_admsections_' . $method, $view->post_form() ) );
97
+ }
98
+ $method = $cat . '_load';
99
+ if ( ! method_exists( $this, $method ) ) {
100
+ $method = 'constructor_load';
101
+ }
102
+ if ( method_exists( $this, $method ) ) {
103
+ $view->load_value( apply_filters( 'tinwl_prepare_admsections_' . $method, $this->$method( $sections ) ) );
104
+ }
105
+ TInvWL_View::render( $view, $view->form_data( $data ) );
106
+ } else {
107
+ TInvWL_View::render( $slug, $data );
108
+ }
109
+ }
110
+
111
+ /**
112
+ * Method for default settings array
113
+ *
114
+ * @param array $sections Sections array.
115
+ * @return array
116
+ */
117
+ function get_defaults( $sections ) {
118
+ $defaults = array();
119
+ if ( ! is_array( $sections ) ) {
120
+ return $defaults;
121
+ }
122
+ $sections = apply_filters( 'tinwl_prepare_admsections', $sections );
123
+ foreach ( $sections as $section ) {
124
+ if ( array_key_exists( 'noform', $section ) && $section['noform'] ) {
125
+ continue;
126
+ }
127
+ $fields = array();
128
+ if ( array_key_exists( 'fields', $section ) ) {
129
+ $fields = $section['fields'];
130
+ } else {
131
+ continue;
132
+ }
133
+ $id = array_key_exists( 'id', $section ) ? $section['id'] : '';
134
+ if ( ! array_key_exists( $id, $defaults ) ) {
135
+ $defaults[ $id ] = array();
136
+ }
137
+ foreach ( $fields as $field ) {
138
+ $name = array_key_exists( 'name', $field ) ? $field['name'] : '';
139
+ $std = array_key_exists( 'std', $field ) ? $field['std'] : '';
140
+
141
+ $defaults[ $id ][ $name ] = $std;
142
+ }
143
+ if ( array_key_exists( '', $defaults[ $id ] ) ) {
144
+ unset( $defaults[ $id ][''] );
145
+ }
146
+ }
147
+ return $defaults;
148
+ }
149
+
150
+ /**
151
+ * Form for section
152
+ */
153
+ function form() {
154
+ add_filter( $this->_n . '_section_before', array( $this, 'start_form' ) );
155
+ add_filter( $this->_n . '_section_after', array( $this, 'end_form' ) );
156
+ }
157
+
158
+ /**
159
+ * Form start for section
160
+ *
161
+ * @param string $content Sections content.
162
+ * @return string
163
+ */
164
+ function start_form( $content ) {
165
+ $content .= '<form method="POST" autocomplete="off">';
166
+ return $content;
167
+ }
168
+
169
+ /**
170
+ * Form end for section
171
+ *
172
+ * @param string $content Sections content.
173
+ * @return string
174
+ */
175
+ function end_form( $content ) {
176
+ $content .= '</form>';
177
+ return $content;
178
+ }
179
+
180
+ /**
181
+ * Load value from database
182
+ *
183
+ * @param array $sections Sections array.
184
+ * @return array
185
+ */
186
+ function constructor_load( $sections ) {
187
+ $sections = $this->get_defaults( $sections );
188
+ $sections = array_keys( $sections );
189
+ $data = array();
190
+ foreach ( $sections as $section ) {
191
+ $data[ $section ] = tinv_get_option( $section );
192
+ }
193
+ return $data;
194
+ }
195
+
196
+ /**
197
+ * Save value to database
198
+ *
199
+ * @param array $data Post section data.
200
+ */
201
+ function constructor_save( $data ) {
202
+ if ( empty( $data ) || ! is_array( $data ) ) {
203
+ return false;
204
+ }
205
+ foreach ( $data as $key => $value ) {
206
+ tinv_update_option( $key, '', $value );
207
+ }
208
+ }
209
+ }
admin/basestyle.helper.php CHANGED
@@ -1,268 +1,268 @@
1
- <?php
2
- /**
3
- * Basic admin style helper class
4
- *
5
- * @since 1.0.0
6
- * @package TInvWishlist\Admin\Helper
7
- */
8
-
9
- // If this file is called directly, abort.
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- die;
12
- }
13
-
14
- /**
15
- * Basic admin style helper class
16
- */
17
- abstract class TInvWL_Admin_BaseStyle extends TInvWL_Admin_BaseSection {
18
-
19
- /**
20
- * Prepare sections for template attributes
21
- *
22
- * @return array
23
- */
24
- function prepare_sections() {
25
- $fields_data = array();
26
- $fields = $this->default_style_settings();
27
- $theme_file = TINVWL_PATH . implode( DIRECTORY_SEPARATOR, array( 'asset', 'css', 'theme.css' ) );
28
- if ( file_exists( $theme_file ) ) {
29
- $fields_data = $this->break_css( file_get_contents( $theme_file ) ); // @codingStandardsIgnoreLine WordPress.VIP.RestrictedFunctions.file_get_contents
30
- }
31
- $_fields = $this->prepare_fields( $fields, $fields_data );
32
- foreach ( $_fields as &$_field ) {
33
- if ( ! array_key_exists( 'skin', $_field ) ) {
34
- switch ( $_field['type'] ) {
35
- case 'group':
36
- case 'groupHTML':
37
- $_field['skin'] = 'section-group-style';
38
- break;
39
- default:
40
- $_field['skin'] = 'section-field-style';
41
- break;
42
- }
43
- }
44
- }
45
- return $_fields;
46
- }
47
-
48
- /**
49
- * Create Scetions for this settings
50
- *
51
- * @return array
52
- */
53
- function constructor_data() {
54
- return array(
55
- array(
56
- 'id' => 'style',
57
- 'title' => __( 'Templates', 'ti-woocommerce-wishlist' ),
58
- 'desc' => '',
59
- 'show_names' => false,
60
- 'fields' => array(
61
- array(
62
- 'type' => 'checkboxonoff',
63
- 'name' => 'customstyle',
64
- 'text' => __( 'Use Theme style', 'ti-woocommerce-wishlist' ),
65
- 'std' => true,
66
- 'extra' => array( 'tiwl-hide' => '.tinvwl-style-options' ),
67
- 'class' => 'tinvwl-header-row',
68
- ),
69
- ),
70
- ),
71
- array(
72
- 'id' => 'style_options',
73
- 'title' => __( 'Template Options', 'ti-woocommerce-wishlist' ),
74
- 'show_names' => true,
75
- 'class' => 'tinvwl-style-options',
76
- 'fields' => $this->prepare_sections(),
77
- 'skin' => 'section-general',
78
- ),
79
- array(
80
- 'id' => 'style_plain',
81
- 'title' => __( 'Template Custom CSS', 'ti-woocommerce-wishlist' ),
82
- 'desc' => '',
83
- 'show_names' => false,
84
- 'fields' => array(
85
- array(
86
- 'type' => 'checkboxonoff',
87
- 'name' => 'allow',
88
- 'text' => __( 'Template Custom CSS', 'ti-woocommerce-wishlist' ),
89
- 'std' => true,
90
- 'extra' => array( 'tiwl-show' => '.tiwl-style-custom-allow' ),
91
- 'class' => 'tinvwl-header-row',
92
- ),
93
- array(
94
- 'type' => 'group',
95
- 'id' => 'custom',
96
- 'class' => 'tiwl-style-custom-allow',
97
- ),
98
- array(
99
- 'type' => 'textarea',
100
- 'name' => 'css',
101
- 'text' => '',
102
- 'std' => '',
103
- ),
104
- ),
105
- ),
106
- array(
107
- 'id' => 'save_buttons',
108
- 'class' => 'only-button',
109
- 'noform' => true,
110
- 'fields' => array(
111
- array(
112
- 'type' => 'button_submit',
113
- 'name' => 'setting_save',
114
- 'std' => '<span><i class="fa fa-check"></i></span>' . __( 'Save Settings', 'ti-woocommerce-wishlist' ),
115
- 'extra' => array( 'class' => 'tinvwl-btn split status-btn-ok' ),
116
- ),
117
- array(
118
- 'type' => 'button_submit_quick',
119
- 'name' => 'setting_save_quick',
120
- 'std' => '<span><i class="fa fa-floppy-o"></i></span>' . __( 'Save', 'ti-woocommerce-wishlist' ),
121
- ),
122
- ),
123
- ),
124
- );
125
- }
126
-
127
- /**
128
- * Basic function for default theme fields
129
- *
130
- * @return array
131
- */
132
- function default_style_settings() {
133
- return array();
134
- }
135
-
136
- /**
137
- * Prepare style fields for sections fields
138
- *
139
- * @param array $fields Array of fields list.
140
- * @param array $data Array of default values for fields.
141
- * @return array
142
- */
143
- function prepare_fields( $fields = array(), $data = array() ) {
144
- foreach ( $fields as &$field ) {
145
- if ( ! array_key_exists( 'selector', $field ) || ! array_key_exists( 'element', $field ) ) {
146
- continue;
147
- }
148
- $field['name'] = $this->create_selectorkey( $field['selector'], $field['element'] );
149
- if ( ! array_key_exists( 'std', $field ) ) {
150
- $field['std'] = '';
151
- }
152
- if ( isset( $data[ $field['selector'] ][ $field['element'] ] ) ) {
153
- $value = $data[ $field['selector'] ][ $field['element'] ];
154
- if ( array_key_exists( 'format', (array) $field ) ) {
155
- $pregx = preg_replace( '/(\[|\]|\\|\/|\^|\$|\%|\.|\||\?|\*|\+|\(|\)|\{|\})/', '\\\${1}', $field['format'] );
156
- $pregx = str_replace( '\{0\}', '(.*?)', $pregx );
157
- $pregx = '/^' . $pregx . '#x2F;i';
158
- if ( preg_match( $pregx, $value, $matches ) ) {
159
- if ( isset( $matches[1] ) ) {
160
- $field['std'] = trim( $matches[1] );
161
- $field['std'] = preg_replace( '/^\.\.\//', TINVWL_URL . 'asset/', $field['std'] );
162
- }
163
- }
164
- } else {
165
- $field['std'] = $value;
166
- }
167
- }
168
- unset( $field['selector'], $field['element'], $field['format'] );
169
- }
170
- return $fields;
171
- }
172
-
173
- /**
174
- * Save value to database
175
- *
176
- * @param array $data Post section data.
177
- * @return boolean
178
- */
179
- function constructor_save( $data ) {
180
- if ( empty( $data ) || ! is_array( $data ) ) {
181
- return false;
182
- }
183
- if ( array_key_exists( 'style', (array) $data ) && array_key_exists( 'style_options', (array) $data ) ) {
184
- if ( false === $data['style']['customstyle'] ) {
185
- $data['style_options']['css'] = $this->convert_styles( $data['style_options'] );
186
- } else {
187
- $data['style_options'] = array();
188
- }
189
- delete_transient( $this->_n . '_dynamic_' );
190
- }
191
- if ( array_key_exists( 'style_plain', (array) $data ) ) {
192
- if ( ! $data['style_plain']['allow'] ) {
193
- $data['style_plain']['css'] = '';
194
- }
195
- if ( empty( $data['style_plain']['css'] ) ) {
196
- $data['style_plain']['allow'] = false;
197
- }
198
- }
199
- parent::constructor_save( $data );
200
- }
201
-
202
- /**
203
- * Generate fields name for form
204
- *
205
- * @param string $selector Selector for fields.
206
- * @param string $element Attribute name.
207
- * @return string
208
- */
209
- function create_selectorkey( $selector, $element ) {
210
- return md5( $selector . '||' . $element );
211
- }
212
-
213
- /**
214
- * Create array of css attributes
215
- *
216
- * @param string $css CSS content.
217
- * @return array
218
- */
219
- function break_css( $css ) {
220
- $results = array();
221
- $css = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css );
222
- $css = preg_replace( '/(\r|\n|\t| {2,})/', '', $css );
223
- $css = str_replace( array( '{', '}' ), array( ' { ', ' } ' ), $css );
224
- preg_match_all( '/(.+?)\s*?\{\s*?(.+?)\s*?\}/', $css, $matches );
225
- foreach ( $matches[0] as $i => $original ) {
226
- foreach ( explode( ';', $matches[2][ $i ] ) as $attr ) {
227
- if ( strlen( trim( $attr ) ) > 0 ) {
228
- list($name, $value) = explode( ':', $attr );
229
- $results[ trim( $matches[1][ $i ] ) ][ trim( $name ) ] = trim( $value );
230
- }
231
- }
232
- }
233
- return $results;
234
- }
235
-
236
- /**
237
- * Convert settings to css
238
- *
239
- * @param array $style Array of style attributes.
240
- * @return string
241
- */
242
- function convert_styles( $style = array() ) {
243
- $fields = $this->default_style_settings();
244
- $styles = array();
245
- foreach ( $fields as $field ) {
246
- if ( ! array_key_exists( 'selector', $field ) || ! array_key_exists( 'element', $field ) ) {
247
- continue;
248
- }
249
- $key = $this->create_selectorkey( $field['selector'], $field['element'] );
250
- if ( array_key_exists( $key, (array) $style ) ) {
251
- $value = $style[ $key ];
252
- if ( array_key_exists( 'format', $field ) ) {
253
- $value = str_replace( '{0}', $value, $field['format'] );
254
- }
255
- $styles[ $field['selector'] ][ $field['element'] ] = $value;
256
- }
257
- }
258
- foreach ( $styles as $selector => &$elements ) {
259
- foreach ( $elements as $key => &$element ) {
260
- $element = sprintf( '%s:%s;', $key, $element );
261
- }
262
- $elements = implode( '', $elements );
263
- $elements = sprintf( '%s {%s}', $selector, $elements );
264
- }
265
- $styles = implode( ' ', $styles );
266
- return $styles;
267
- }
268
- }
1
+ <?php
2
+ /**
3
+ * Basic admin style helper class
4
+ *
5
+ * @since 1.0.0
6
+ * @package TInvWishlist\Admin\Helper
7
+ */
8
+
9
+ // If this file is called directly, abort.
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ die;
12
+ }
13
+
14
+ /**
15
+ * Basic admin style helper class
16
+ */
17
+ abstract class TInvWL_Admin_BaseStyle extends TInvWL_Admin_BaseSection {
18
+
19
+ /**
20
+ * Prepare sections for template attributes
21
+ *
22
+ * @return array
23
+ */
24
+ function prepare_sections() {
25
+ $fields_data = array();
26
+ $fields = $this->default_style_settings();
27
+ $theme_file = TINVWL_PATH . implode( DIRECTORY_SEPARATOR, array( 'asset', 'css', 'theme.css' ) );
28
+ if ( file_exists( $theme_file ) ) {
29
+ $fields_data = $this->break_css( file_get_contents( $theme_file ) ); // @codingStandardsIgnoreLine WordPress.VIP.RestrictedFunctions.file_get_contents
30
+ }
31
+ $_fields = $this->prepare_fields( $fields, $fields_data );
32
+ foreach ( $_fields as &$_field ) {
33
+ if ( ! array_key_exists( 'skin', $_field ) ) {
34
+ switch ( $_field['type'] ) {
35
+ case 'group':
36
+ case 'groupHTML':
37
+ $_field['skin'] = 'section-group-style';
38
+ break;
39
+ default:
40
+ $_field['skin'] = 'section-field-style';
41
+ break;
42
+ }
43
+ }
44
+ }
45
+ return $_fields;
46
+ }
47
+
48
+ /**
49
+ * Create Scetions for this settings
50
+ *
51
+ * @return array
52
+ */
53
+ function constructor_data() {
54
+ return array(
55
+ array(
56
+ 'id' => 'style',
57
+ 'title' => __( 'Templates', 'ti-woocommerce-wishlist' ),
58
+ 'desc' => '',
59
+ 'show_names' => false,
60
+ 'fields' => array(
61
+ array(
62
+ 'type' => 'checkboxonoff',
63
+ 'name' => 'customstyle',
64
+ 'text' => __( 'Use Theme style', 'ti-woocommerce-wishlist' ),
65
+ 'std' => true,
66
+ 'extra' => array( 'tiwl-hide' => '.tinvwl-style-options' ),
67
+ 'class' => 'tinvwl-header-row',
68
+ ),
69
+ ),
70
+ ),
71
+ array(
72
+ 'id' => 'style_options',
73
+ 'title' => __( 'Template Options', 'ti-woocommerce-wishlist' ),
74
+ 'show_names' => true,
75
+ 'class' => 'tinvwl-style-options',
76
+ 'fields' => $this->prepare_sections(),
77
+ 'skin' => 'section-general',
78
+ ),
79
+ array(
80
+ 'id' => 'style_plain',
81
+ 'title' => __( 'Template Custom CSS', 'ti-woocommerce-wishlist' ),
82
+ 'desc' => '',
83
+ 'show_names' => false,
84
+ 'fields' => array(
85
+ array(
86
+ 'type' => 'checkboxonoff',
87
+ 'name' => 'allow',
88
+ 'text' => __( 'Template Custom CSS', 'ti-woocommerce-wishlist' ),
89
+ 'std' => true,
90
+ 'extra' => array( 'tiwl-show' => '.tiwl-style-custom-allow' ),
91
+ 'class' => 'tinvwl-header-row',
92
+ ),
93
+ array(
94
+ 'type' => 'group',
95
+ 'id' => 'custom',
96
+ 'class' => 'tiwl-style-custom-allow',
97
+ ),
98
+ array(
99
+ 'type' => 'textarea',
100
+ 'name' => 'css',
101
+ 'text' => '',
102
+ 'std' => '',
103
+ ),
104
+ ),
105
+ ),
106
+ array(
107
+ 'id' => 'save_buttons',
108
+ 'class' => 'only-button',
109
+ 'noform' => true,
110
+ 'fields' => array(
111
+ array(
112
+ 'type' => 'button_submit',
113
+ 'name' => 'setting_save',
114
+ 'std' => '<span><i class="fa fa-check"></i></span>' . __( 'Save Settings', 'ti-woocommerce-wishlist' ),
115
+ 'extra' => array( 'class' => 'tinvwl-btn split status-btn-ok' ),
116
+ ),
117
+ array(
118
+ 'type' => 'button_submit_quick',
119
+ 'name' => 'setting_save_quick',
120
+ 'std' => '<span><i class="fa fa-floppy-o"></i></span>' . __( 'Save', 'ti-woocommerce-wishlist' ),
121
+ ),
122
+ ),
123
+ ),
124
+ );
125
+ }
126
+
127
+ /**
128
+ * Basic function for default theme fields
129
+ *
130
+ * @return array
131
+ */
132
+ function default_style_settings() {
133
+ return array();
134
+ }
135
+
136
+ /**
137
+ * Prepare style fields for sections fields
138
+ *
139
+ * @param array $fields Array of fields list.
140
+ * @param array $data Array of default values for fields.
141
+ * @return array
142
+ */
143
+ function prepare_fields( $fields = array(), $data = array() ) {
144
+ foreach ( $fields as &$field ) {
145
+ if ( ! array_key_exists( 'selector', $field ) || ! array_key_exists( 'element', $field ) ) {
146
+ continue;
147
+ }
148
+ $field['name'] = $this->create_selectorkey( $field['selector'], $field['element'] );
149
+ if ( ! array_key_exists( 'std', $field ) ) {
150
+ $field['std'] = '';
151
+ }
152
+ if ( isset( $data[ $field['selector'] ][ $field['element'] ] ) ) {
153
+ $value = $data[ $field['selector'] ][ $field['element'] ];
154
+ if ( array_key_exists( 'format', (array) $field ) ) {
155
+ $pregx = preg_replace( '/(\[|\]|\\|\/|\^|\$|\%|\.|\||\?|\*|\+|\(|\)|\{|\})/', '\\\${1}', $field['format'] );
156
+ $pregx = str_replace( '\{0\}', '(.*?)', $pregx );
157
+ $pregx = '/^' . $pregx . '#x2F;i';
158
+ if ( preg_match( $pregx, $value, $matches ) ) {
159
+ if ( isset( $matches[1] ) ) {
160
+ $field['std'] = trim( $matches[1] );
161
+ $field['std'] = preg_replace( '/^\.\.\//', TINVWL_URL . 'asset/', $field['std'] );
162
+ }
163
+ }
164
+ } else {
165
+ $field['std'] = $value;
166
+ }
167
+ }
168
+ unset( $field['selector'], $field['element'], $field['format'] );
169
+ }
170
+ return $fields;
171
+ }
172
+
173
+ /**
174
+ * Save value to database
175
+ *
176
+ * @param array $data Post section data.
177
+ * @return boolean
178
+ */
179
+ function constructor_save( $data ) {
180
+ if ( empty( $data ) || ! is_array( $data ) ) {
181
+ return false;
182
+ }
183
+ if ( array_key_exists( 'style', (array) $data ) && array_key_exists( 'style_options', (array) $data ) ) {
184
+ if ( false === $data['style']['customstyle'] ) {
185
+ $data['style_options']['css'] = $this->convert_styles( $data['style_options'] );
186
+ } else {
187
+ $data['style_options'] = array();
188
+ }
189
+ delete_transient( $this->_n . '_dynamic_' );
190
+ }
191
+ if ( array_key_exists( 'style_plain', (array) $data ) ) {
192
+ if ( ! $data['style_plain']['allow'] ) {
193
+ $data['style_plain']['css'] = '';
194
+ }
195
+ if ( empty( $data['style_plain']['css'] ) ) {
196
+ $data['style_plain']['allow'] = false;
197
+ }
198
+ }
199
+ parent::constructor_save( $data );
200
+ }
201
+
202
+ /**
203
+ * Generate fields name for form
204
+ *
205
+ * @param string $selector Selector for fields.
206
+ * @param string $element Attribute name.
207
+ * @return string
208
+ */
209
+ function create_selectorkey( $selector, $element ) {
210
+ return md5( $selector . '||' . $element );
211
+ }
212
+
213
+ /**
214
+ * Create array of css attributes
215
+ *
216
+ * @param string $css CSS content.
217
+ * @return array
218
+ */
219
+ function break_css( $css ) {
220
+ $results = array();
221
+ $css = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css );
222
+ $css = preg_replace( '/(\r|\n|\t| {2,})/', '', $css );
223
+ $css = str_replace( array( '{', '}' ), array( ' { ', ' } ' ), $css );
224
+ preg_match_all( '/(.+?)\s*?\{\s*?(.+?)\s*?\}/', $css, $matches );
225
+ foreach ( $matches[0] as $i => $original ) {
226
+ foreach ( explode( ';', $matches[2][ $i ] ) as $attr ) {
227
+ if ( strlen( trim( $attr ) ) > 0 ) {
228
+ list($name, $value) = explode( ':', $attr );
229
+ $results[ trim( $matches[1][ $i ] ) ][ trim( $name ) ] = trim( $value );
230
+ }
231
+ }
232
+ }
233
+ return $results;
234
+ }
235
+
236
+ /**
237
+ * Convert settings to css
238
+ *
239
+ * @param array $style Array of style attributes.
240
+ * @return string
241
+ */
242
+ function convert_styles( $style = array() ) {
243
+ $fields = $this->default_style_settings();
244
+ $styles = array();
245
+ foreach ( $fields as $field ) {
246
+ if ( ! array_key_exists( 'selector', $field ) || ! array_key_exists( 'element', $field ) ) {
247
+ continue;
248
+ }
249
+ $key = $this->create_selectorkey( $field['selector'], $field['element'] );
250
+ if ( array_key_exists( $key, (array) $style ) ) {
251
+ $value = $style[ $key ];
252
+ if ( array_key_exists( 'format', $field ) ) {
253
+ $value = str_replace( '{0}', $value, $field['format'] );
254
+ }
255
+ $styles[ $field['selector'] ][ $field['element'] ] = $value;
256
+ }
257
+ }
258
+ foreach ( $styles as $selector => &$elements ) {
259
+ foreach ( $elements as $key => &$element ) {
260
+ $element = sprintf( '%s:%s;', $key, $element );
261
+ }
262
+ $elements = implode( '', $elements );
263
+ $elements = sprintf( '%s {%s}', $selector, $elements );
264
+ }
265
+ $styles = implode( ' ', $styles );
266
+ return $styles;
267
+ }
268
+ }
admin/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // @codingStandardsIgnoreFile
3
- // Silence is golden.
1
+ <?php
2
+ // @codingStandardsIgnoreFile
3
+ // Silence is golden.
admin/settings/general.class.php CHANGED
@@ -1,443 +1,443 @@
1
- <?php
2
- /**
3
- * Admin settings class
4
- *
5
- * @since 1.0.0
6
- * @package TInvWishlist\Admin
7
- * @subpackage Settings
8
- */
9
-
10
- // If this file is called directly, abort.
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- die;
13
- }
14
-
15
- /**
16
- * Admin settings class
17
- */
18
- class TInvWL_Admin_Settings_General extends TInvWL_Admin_BaseSection {
19
-
20
- /**
21
- * Priority for admin menu
22
- *
23
- * @var integer
24
- */
25
- public $priority = 20;
26
-
27
- /**
28
- * Menu array
29
- *
30
- * @return array
31
- */
32
- function menu() {
33
- return array(
34
- 'title' => __( 'General Settings', 'ti-woocommerce-wishlist' ),
35
- 'method' => array( $this, '_print_' ),
36
- 'slug' => '',
37
- );
38
- }
39
-
40
- /**
41
- * Create Scetions for this settings
42
- *
43
- * @return array
44
- */
45
- function constructor_data() {
46
- add_action( $this->_n . '_section_general_before', array( $this, 'premium_features' ) );
47
- $lists = get_pages( array( 'number' => 999999 ) ); // @codingStandardsIgnoreLine WordPress.VIP.RestrictedFunctions.get_pages
48
- $page_list = array( '' => '' );
49
- foreach ( $lists as $list ) {
50
- $page_list[ $list->ID ] = $list->post_title;
51
- }
52
- return array(
53
- array(
54
- 'id' => 'general',
55
- 'title' => __( 'General Settings', 'ti-woocommerce-wishlist' ),
56
- 'desc' => __( 'Wishlist page need to be selected so the plugin knows where it is. This page should have been created upon installation of the plugin, if not you will need to create it manually.', 'ti-woocommerce-wishlist' ),
57
- 'show_names' => true,
58
- 'fields' => array(
59
- array(
60
- 'type' => 'text',
61
- 'name' => 'default_title',
62
- 'text' => __( 'Default Wishlist Name', 'ti-woocommerce-wishlist' ),
63
- 'std' => 'Default wishlist',
64
- ),
65
- array(
66
- 'type' => 'select',
67
- 'name' => 'page_wishlist',
68
- 'text' => __( 'Wishlist Page', 'ti-woocommerce-wishlist' ),
69
- 'std' => '',
70
- 'options' => $page_list,
71
- 'validate' => FILTER_VALIDATE_INT,
72
- ),
73
- array(
74
- 'type' => 'checkboxonoff',
75
- 'name' => 'link_in_myaccount',
76
- 'text' => __( 'Show Link to Wishlist in my account', 'ti-woocommerce-wishlist-premium' ),
77
- 'std' => true,
78
- ),
79
- array(
80
- 'type' => 'checkboxonoff',
81
- 'name' => 'processing_autoremove',
82
- 'text' => __( 'Remove Product from Wishlist if added to cart', 'ti-woocommerce-wishlist' ),
83
- 'std' => true,
84
- ),
85
- ),
86
- ),
87
- array(
88
- 'id' => 'page',
89
- 'title' => __( 'Wishlist Page Options', 'ti-woocommerce-wishlist' ),
90
- 'desc' => __( 'Coming soon', 'ti-woocommerce-wishlist' ),
91
- 'show_names' => true,
92
- 'style' => 'display:none;',
93
- 'fields' => array(
94
- array(
95
- 'type' => 'select',
96
- 'name' => 'wishlist',
97
- 'text' => __( 'My Wishlist', 'ti-woocommerce-wishlist' ),
98
- 'std' => '',
99
- 'options' => $page_list,
100
- 'validate' => FILTER_VALIDATE_INT,
101
- ),
102
- ),
103
- ),
104
- array(
105
- 'id' => 'processing',
106
- 'title' => __( 'Wishlist Processing Options', 'ti-woocommerce-wishlist' ),
107
- 'desc' => __( 'Coming soon', 'ti-woocommerce-wishlist' ),
108
- 'style' => 'display:none;',
109
- 'show_names' => true,
110
- 'fields' => array(
111
- array(
112
- 'type' => 'checkboxonoff',
113
- 'name' => 'autoremove',
114
- 'text' => __( 'Automatic removal', 'ti-woocommerce-wishlist' ),
115
- 'std' => true,
116
- 'extra' => array( 'tiwl-show' => '.tiwl-processing-autoremove' ),
117
- ),
118
- array(
119
- 'type' => 'select',
120
- 'name' => 'autoremove_status',
121
- 'text' => __( 'Remove condition', 'ti-woocommerce-wishlist' ),
122
- 'std' => 'tinvwl-addcart',
123
- 'options' => array(
124
- 'tinvwl-addcart' => __( 'Add to Card', 'ti-woocommerce-wishlist' ),
125
- ),
126
- 'class' => 'tiwl-processing-autoremove',
127
- ),
128
- ),
129
- ),
130
- array(
131
- 'id' => 'add_to_wishlist',
132
- 'title' => __( 'Product page "Add to Wishlist" Button Settings', 'ti-woocommerce-wishlist' ),
133
- 'show_names' => true,
134
- 'fields' => array(
135
- array(
136
- 'type' => 'select',
137
- 'name' => 'position',
138
- 'text' => __( 'Button position', 'ti-woocommerce-wishlist' ),
139
- 'desc' => __( 'Add this shortcode <code>[ti_wishlists_addtowishlist]</code> anywhere on product page, if you have chosen custom position for product button. You will have to do this for each product.', 'ti-woocommerce-wishlist' ),
140
- 'std' => 'after',
141
- 'options' => array(
142
- 'after' => __( 'After "Add to Cart" button', 'ti-woocommerce-wishlist' ),
143
- 'before' => __( 'Before "Add to Cart" button', 'ti-woocommerce-wishlist' ),
144
- 'shortcode' => __( 'Custom position with code', 'ti-woocommerce-wishlist' ),
145
- ),
146
- ),
147
- array(
148
- 'type' => 'select',
149
- 'name' => 'type',
150
- 'text' => __( 'Button type', 'ti-woocommerce-wishlist' ),
151
- 'std' => 'link',
152
- 'options' => array(
153
- 'link' => __( 'Link', 'ti-woocommerce-wishlist' ),
154
- 'button' => __( 'Button', 'ti-woocommerce-wishlist' ),
155
- ),
156
- ),
157
- array(
158
- 'type' => 'select',
159
- 'name' => 'icon',
160
- 'text' => __( '"Add to Wishlist" Icon', 'ti-woocommerce-wishlist' ),
161
- 'desc' => __( 'You can choose from our predefined icons or upload your custom icon. Custom icon size is limited to 16x16 px.', 'ti-woocommerce-wishlist' ),
162
- 'std' => '',
163
- 'options' => array(
164
- '' => __( 'None', 'ti-woocommerce-wishlist' ),
165
- 'heart' => __( 'Heart', 'ti-woocommerce-wishlist' ),
166
- 'heart-plus' => __( 'Heart+', 'ti-woocommerce-wishlist' ),
167
- 'custom' => __( 'Custom', 'ti-woocommerce-wishlist' ),
168
- ),
169
- 'extra' => array(
170
- 'class' => 'tiwl-button-icon',
171
- 'tiwl-show' => '.tiwl-button-icon-custom',
172
- 'tiwl-hide' => '.tiwl-button-icon-style',
173
- 'tiwl-value' => 'custom',
174
- ),
175
- ),
176
- array(
177
- 'type' => 'uploadfile',
178
- 'name' => 'icon_upload',
179
- 'std' => '',
180
- 'text' => ' ',
181
- 'class' => 'tiwl-button-icon-custom',
182
- 'extra' => array(
183
- 'button' => array(
184
- 'value' => __( 'Upload', 'ti-woocommerce-wishlist' ),
185
- ),
186
- 'type' => array( 'image' ),
187
- ),
188
- ),
189
- array(
190
- 'type' => 'select',
191
- 'name' => 'icon_style',
192
- 'std' => 'black',
193
- 'text' => __( '"Add to Wishlist" Icon Color', 'ti-woocommerce-wishlist' ),
194
- 'options' => array(
195
- 'black' => __( 'Black', 'ti-woocommerce-wishlist' ),
196
- 'white' => __( 'White', 'ti-woocommerce-wishlist' ),
197
- ),
198
- 'class' => 'tiwl-button-icon-style',
199
- ),
200
- array(
201
- 'type' => 'text',
202
- 'name' => 'text',
203
- 'text' => __( '"Add to Wishlist" button Text', 'ti-woocommerce-wishlist' ),
204
- 'std' => 'Add to Wishlist',
205
- ),
206
- array(
207
- 'type' => 'text',
208
- 'name' => 'text_browse',
209
- 'text' => __( '"View Wishlist" button Text', 'ti-woocommerce-wishlist' ),
210
- 'std' => 'View Wishlist',
211
- ),
212
- array(
213
- 'type' => 'checkboxonoff',
214
- 'name' => 'redirect',
215
- 'text' => __( 'Redirect to Wishlist', 'ti-woocommerce-wishlist' ),
216
- 'desc' => __( 'If enabled, user will be redirected to wishlist page after 5 sec from adding product to wishlist.', 'ti-woocommerce-wishlist' ),
217
- 'std' => true,
218
- ),
219
- array(
220
- 'type' => 'text',
221
- 'name' => 'text_already_in',
222
- 'text' => __( '"Product already in Wishlist" Text', 'ti-woocommerce-wishlist' ),
223
- 'desc' => __( 'This notification will be shown if user will try to add product that already in wishlist when quantity on wishlist page is disabled.', 'ti-woocommerce-wishlist' ),
224
- 'std' => 'Product already in Wishlist',
225
- ),
226
- array(
227
- 'type' => 'text',
228
- 'name' => 'text_added_to',
229
- 'text' => __( '"Product added to Wishlist" Text', 'ti-woocommerce-wishlist' ),
230
- 'std' => 'Product added to Wishlist',
231
- ),
232
- ),
233
- ),
234
- array(
235
- 'id' => 'product_table',
236
- 'title' => __( 'Wishlist Product Settings', 'ti-woocommerce-wishlist' ),
237
- 'desc' => __( 'Following options allows you to choose what information/functionality to show/enable in wishlist table on wishlist page.', 'ti-woocommerce-wishlist' ),
238
- 'show_names' => true,
239
- 'fields' => array(
240
- array(
241
- 'type' => 'checkboxonoff',
242
- 'name' => 'add_to_card',
243
- 'text' => __( 'Show "Add to Cart" button', 'ti-woocommerce-wishlist' ),
244
- 'std' => true,
245
- 'extra' => array( 'tiwl-show' => '.tiwl-table-action-addcart' ),
246
- ),
247
- array(
248
- 'type' => 'text',
249
- 'name' => 'text_add_to_card',
250
- 'text' => __( '"Add to Cart" Text', 'ti-woocommerce-wishlist' ),
251
- 'std' => 'Add to Cart',
252
- 'class' => 'tiwl-table-action-addcart',
253
- ),
254
- array(
255
- 'type' => 'checkboxonoff',
256
- 'name' => 'colm_price',
257
- 'text' => __( 'Show Unit price', 'ti-woocommerce-wishlist' ),
258
- 'std' => true,
259
- ),
260
- array(
261
- 'type' => 'checkboxonoff',
262
- 'name' => 'colm_stock',
263
- 'text' => __( 'Show Stock status', 'ti-woocommerce-wishlist' ),
264
- 'std' => true,
265
- ),
266
- array(
267
- 'type' => 'checkboxonoff',
268
- 'name' => 'colm_date',
269
- 'text' => __( 'Show Date of addition', 'ti-woocommerce-wishlist' ),
270
- 'std' => true,
271
- ),
272
- ),
273
- ),
274
- array(
275
- 'id' => 'table',
276
- 'title' => __( 'Wishlist Table Settings', 'ti-woocommerce-wishlist' ),
277
- 'desc' => __( 'Following options will help user to manage and add products to cart from wishlist table in bulk.', 'ti-woocommerce-wishlist' ),
278
- 'show_names' => true,
279
- 'fields' => array(
280
- array(
281
- 'type' => 'checkboxonoff',
282
- 'name' => 'colm_checkbox',
283
- 'text' => __( 'Show Checkboxes', 'ti-woocommerce-wishlist' ),
284
- 'std' => true,
285
- 'extra' => array( 'tiwl-show' => '.tiwl-table-cb-button' ),
286
- ),
287
- array(
288
- 'type' => 'group',
289
- 'id' => 'cb_button',
290
- 'class' => 'tiwl-table-cb-button',
291
- ),
292
- array(
293
- 'type' => 'checkboxonoff',
294
- 'name' => 'colm_actions',
295
- 'text' => __( 'Show Actions button', 'ti-woocommerce-wishlist' ),
296
- 'desc' => __( 'Bulk actions drop down at the bottom of wishlist table', 'ti-woocommerce-wishlist' ),
297
- 'std' => true,
298
- ),
299
- array(
300
- 'type' => 'checkboxonoff',
301
- 'name' => 'add_select_to_card',
302
- 'text' => __( 'Show "Add Selected to Cart" button', 'ti-woocommerce-wishlist' ),
303
- 'std' => true,
304
- 'extra' => array( 'tiwl-show' => '.tiwl-table-addcart-sel' ),
305
- ),
306
- array(
307
- 'type' => 'text',
308
- 'name' => 'text_add_select_to_card',
309
- 'text' => __( '"Add Selected to Cart" Button Text', 'ti-woocommerce-wishlist' ),
310
- 'std' => 'Add Selected to Cart',
311
- 'class' => 'tiwl-table-addcart-sel',
312
- ),
313
- array(
314
- 'type' => 'group',
315
- 'id' => '_button',
316
- ),
317
- array(
318
- 'type' => 'checkboxonoff',
319
- 'name' => 'add_all_to_card',
320
- 'text' => __( 'Show "Add All to Cart" button', 'ti-woocommerce-wishlist' ),
321
- 'std' => true,
322
- 'extra' => array( 'tiwl-show' => '.tiwl-table-addcart-all' ),
323
- ),
324
- array(
325
- 'type' => 'text',
326
- 'name' => 'text_add_all_to_card',
327
- 'text' => __( '"Add All to Cart" Button Text', 'ti-woocommerce-wishlist' ),
328
- 'std' => 'Add All to Cart',
329
- 'class' => 'tiwl-table-addcart-all',
330
- ),
331
- ),
332
- ),
333
- array(
334
- 'id' => 'social',
335
- 'show_names' => true,
336
- 'fields' => array(
337
- array(
338
- 'type' => 'group',
339
- 'id' => 'social',
340
- 'desc' => __( 'Following options enable/disable Social share icons below wishlist table on wishlist page. Wishlist owner can easily share their wishlists using this button on social networks. Wishlist privacy should be set to public or shared status, private wishlists can\'t be shared.', 'ti-woocommerce-wishlist' ),
341
- 'class' => 'tinvwl-info-top',
342
- ),
343
- array(
344
- 'type' => 'html',
345
- 'name' => 'social',
346
- 'text' => __( 'Social Networks Sharing Options', 'ti-woocommerce-wishlist' ),
347
- 'class' => 'tinvwl-header-row tinvwl-line-border',
348
- ),
349
- array(
350
- 'type' => 'checkboxonoff',
351
- 'name' => 'facebook',
352
- 'text' => __( 'Show "Share on Facebook" Button', 'ti-woocommerce-wishlist' ),
353
- 'std' => true,
354
- ),
355
- array(
356
- 'type' => 'checkboxonoff',
357
- 'name' => 'twitter',
358
- 'text' => __( 'Show "Tweet on Twitter" Button', 'ti-woocommerce-wishlist' ),
359
- 'std' => true,
360
- ),
361
- array(
362
- 'type' => 'checkboxonoff',
363
- 'name' => 'pinterest',
364
- 'text' => __( 'Show "Pin on Pinterest" Button', 'ti-woocommerce-wishlist' ),
365
- 'std' => true,
366
- ),
367
- array(
368
- 'type' => 'checkboxonoff',
369
- 'name' => 'google',
370
- 'text' => __( 'Show "Share on Google+" Button', 'ti-woocommerce-wishlist' ),
371
- 'std' => true,
372
- ),
373
- array(
374
- 'type' => 'checkboxonoff',
375
- 'name' => 'email',
376
- 'text' => __( 'Show "Share on Email" Button', 'ti-woocommerce-wishlist' ),
377
- 'std' => true,
378
- ),
379
- array(
380
- 'type' => 'text',
381
- 'name' => 'share_on',
382
- 'text' => __( '"Share on" Text', 'ti-woocommerce-wishlist' ),
383
- 'std' => 'Share on',
384
- ),
385
- ),
386
- ),
387
- array(
388
- 'id' => 'save_buttons',
389
- 'class' => 'only-button',
390
- 'noform' => true,
391
- 'fields' => array(
392
- array(
393
- 'type' => 'button_submit',
394
- 'name' => 'setting_save',
395
- 'std' => '<span><i class="fa fa-check"></i></span>' . __( 'Save Settings', 'ti-woocommerce-wishlist' ),
396
- 'extra' => array( 'class' => 'tinvwl-btn split status-btn-ok' ),
397
- ),
398
- array(
399
- 'type' => 'button_submit_quick',
400
- 'name' => 'setting_save_quick',
401
- 'std' => '<span><i class="fa fa-floppy-o"></i></span>' . __( 'Save', 'ti-woocommerce-wishlist' ),
402
- ),
403
- ),
404
- ),
405
- );
406
- }
407
-
408
- /**
409
- * Load value from database
410
- *
411
- * @param array $sections Sections array.
412
- * @return array
413
- */
414
- function constructor_load( $sections ) {
415
- $data = parent::constructor_load( $sections );
416
- $data['general']['page_wishlist'] = $data['page']['wishlist'];
417
- $data['general']['processing_autoremove'] = $data['processing']['autoremove'];
418
- return $data;
419
- }
420
-
421
- /**
422
- * Save value to database and flush rewrite.
423
- *
424
- * @param array $data Post section data.
425
- */
426
- function constructor_save( $data ) {
427
- parent::constructor_save( $data );
428
- if ( empty( $data ) || ! is_array( $data ) ) {
429
- return false;
430
- }
431
- tinv_update_option( 'page', 'wishlist', $data['general']['page_wishlist'] );
432
- tinv_update_option( 'processing', 'autoremove', $data['general']['processing_autoremove'] );
433
- tinv_update_option( 'processing', 'autoremove_status', 'tinvwl-addcart' );
434
- TInvWL_Public_TInvWL::update_rewrite_rules();
435
- }
436
-
437
- /**
438
- * Show Premium Features sections
439
- */
440
- function premium_features() {
441
- TInvWL_View::view( 'premium-features' );
442
- }
443
- }
1
+ <?php
2
+ /**
3
+ * Admin settings class
4
+ *
5
+ * @since 1.0.0
6
+ * @package TInvWishlist\Admin
7
+ * @subpackage Settings
8
+ */
9
+
10
+ // If this file is called directly, abort.
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ die;
13
+ }
14
+
15
+ /**
16
+ * Admin settings class
17
+ */
18
+ class TInvWL_Admin_Settings_General extends TInvWL_Admin_BaseSection {
19
+
20
+ /**
21
+ * Priority for admin menu
22
+ *
23
+ * @var integer
24
+ */
25
+ public $priority = 20;
26
+
27
+ /**
28
+ * Menu array
29
+ *
30
+ * @return array
31
+ */
32
+ function menu() {
33
+ return array(
34
+ 'title' => __( 'General Settings', 'ti-woocommerce-wishlist' ),
35
+ 'method' => array( $this, '_print_' ),
36
+ 'slug' => '',
37
+ );
38
+ }
39
+
40
+ /**
41
+ * Create Scetions for this settings
42
+ *
43
+ * @return array
44
+ */
45
+ function constructor_data() {
46
+ add_action( $this->_n . '_section_general_before', array( $this, 'premium_features' ) );
47
+ $lists = get_pages( array( 'number' => 999999 ) ); // @codingStandardsIgnoreLine WordPress.VIP.RestrictedFunctions.get_pages
48
+ $page_list = array( '' => '' );
49
+ foreach ( $lists as $list ) {
50
+ $page_list[ $list->ID ] = $list->post_title;
51
+ }
52
+ return array(
53
+ array(
54
+ 'id' => 'general',
55
+ 'title' => __( 'General Settings', 'ti-woocommerce-wishlist' ),
56
+ 'desc' => __( 'Wishlist page need to be selected so the plugin knows where it is. This page should have been created upon installation of the plugin, if not you will need to create it manually.', 'ti-woocommerce-wishlist' ),
57
+ 'show_names' => true,
58
+ 'fields' => array(
59
+ array(
60
+ 'type' => 'text',
61
+ 'name' => 'default_title',
62
+ 'text' => __( 'Default Wishlist Name', 'ti-woocommerce-wishlist' ),
63
+ 'std' => 'Default wishlist',
64
+ ),
65
+ array(
66
+ 'type' => 'select',
67
+ 'name' => 'page_wishlist',
68
+ 'text' => __( 'Wishlist Page', 'ti-woocommerce-wishlist' ),
69
+ 'std' => '',
70
+ 'options' => $page_list,
71
+ 'validate' => FILTER_VALIDATE_INT,
72
+ ),
73
+ array(
74
+ 'type' => 'checkboxonoff',
75
+ 'name' => 'link_in_myaccount',
76
+ 'text' => __( 'Show Link to Wishlist in my account', 'ti-woocommerce-wishlist-premium' ),
77
+ 'std' => true,
78
+ ),
79
+ array(
80
+ 'type' => 'checkboxonoff',
81
+ 'name' => 'processing_autoremove',
82
+ 'text' => __( 'Remove Product from Wishlist if added to cart', 'ti-woocommerce-wishlist' ),
83
+ 'std' => true,
84
+ ),
85
+ ),
86
+ ),
87
+ array(
88
+ 'id' => 'page',
89
+ 'title' => __( 'Wishlist Page Options', 'ti-woocommerce-wishlist' ),
90
+ 'desc' => __( 'Coming soon', 'ti-woocommerce-wishlist' ),
91
+ 'show_names' => true,
92
+ 'style' => 'display:none;',
93
+ 'fields' => array(
94
+ array(
95
+ 'type' => 'select',
96
+ 'name' => 'wishlist',
97
+ 'text' => __( 'My Wishlist', 'ti-woocommerce-wishlist' ),
98
+ 'std' => '',
99
+ 'options' => $page_list,
100
+ 'validate' => FILTER_VALIDATE_INT,
101
+ ),
102
+ ),
103
+ ),
104
+ array(
105
+ 'id' => 'processing',
106
+ 'title' => __( 'Wishlist Processing Options', 'ti-woocommerce-wishlist' ),
107
+ 'desc' => __( 'Coming soon', 'ti-woocommerce-wishlist' ),
108
+ 'style' => 'display:none;',
109
+ 'show_names' => true,
110
+ 'fields' => array(
111
+ array(
112
+ 'type' => 'checkboxonoff',
113
+ 'name' => 'autoremove',
114
+ 'text' => __( 'Automatic removal', 'ti-woocommerce-wishlist' ),
115
+ 'std' => true,
116
+ 'extra' => array( 'tiwl-show' => '.tiwl-processing-autoremove' ),
117
+ ),
118
+ array(
119
+ 'type' => 'select',
120
+ 'name' => 'autoremove_status',
121
+ 'text' => __( 'Remove condition', 'ti-woocommerce-wishlist' ),
122
+ 'std' => 'tinvwl-addcart',
123
+ 'options' => array(
124
+ 'tinvwl-addcart' => __( 'Add to Card', 'ti-woocommerce-wishlist' ),
125
+ ),
126
+ 'class' => 'tiwl-processing-autoremove',
127
+ ),
128
+ ),
129
+ ),
130
+ array(
131
+ 'id' => 'add_to_wishlist',
132
+ 'title' => __( 'Product page "Add to Wishlist" Button Settings', 'ti-woocommerce-wishlist' ),
133
+ 'show_names' => true,
134
+ 'fields' => array(
135
+ array(
136
+ 'type' => 'select',
137
+ 'name' => 'position',
138
+ 'text' => __( 'Button position', 'ti-woocommerce-wishlist' ),
139
+ 'desc' => __( 'Add this shortcode <code>[ti_wishlists_addtowishlist]</code> anywhere on product page, if you have chosen custom position for product button. You will have to do this for each product.', 'ti-woocommerce-wishlist' ),
140
+ 'std' => 'after',
141
+ 'options' => array(
142
+ 'after' => __( 'After "Add to Cart" button', 'ti-woocommerce-wishlist' ),
143
+ 'before' => __( 'Before "Add to Cart" button', 'ti-woocommerce-wishlist' ),
144
+ 'shortcode' => __( 'Custom position with code', 'ti-woocommerce-wishlist' ),
145
+ ),
146
+ ),
147
+ array(
148
+ 'type' => 'select',
149
+ 'name' => 'type',
150
+ 'text' => __( 'Button type', 'ti-woocommerce-wishlist' ),
151
+ 'std' => 'link',
152
+ 'options' => array(
153
+ 'link' => __( 'Link', 'ti-woocommerce-wishlist' ),
154
+ 'button' => __( 'Button', 'ti-woocommerce-wishlist' ),
155
+ ),
156
+ ),
157
+ array(
158
+ 'type' => 'select',
159
+ 'name' => 'icon',
160
+ 'text' => __( '"Add to Wishlist" Icon', 'ti-woocommerce-wishlist' ),
161
+ 'desc' => __( 'You can choose from our predefined icons or upload your custom icon. Custom icon size is limited to 16x16 px.', 'ti-woocommerce-wishlist' ),
162
+ 'std' => '',
163
+ 'options' => array(
164
+ '' => __( 'None', 'ti-woocommerce-wishlist' ),
165
+ 'heart' => __( 'Heart', 'ti-woocommerce-wishlist' ),
166
+ 'heart-plus' => __( 'Heart+', 'ti-woocommerce-wishlist' ),
167
+ 'custom' => __( 'Custom', 'ti-woocommerce-wishlist' ),
168
+ ),
169
+ 'extra' => array(
170
+ 'class' => 'tiwl-button-icon',
171
+ 'tiwl-show' => '.tiwl-button-icon-custom',
172
+ 'tiwl-hide' => '.tiwl-button-icon-style',
173
+ 'tiwl-value' => 'custom',
174
+ ),
175
+ ),
176
+ array(
177
+ 'type' => 'uploadfile',
178
+ 'name' => 'icon_upload',
179
+ 'std' => '',
180
+ 'text' => ' ',
181
+ 'class' => 'tiwl-button-icon-custom',
182
+ 'extra' => array(
183
+ 'button' => array(
184
+ 'value' => __( 'Upload', 'ti-woocommerce-wishlist' ),
185
+ ),
186
+ 'type' => array( 'image' ),
187
+ ),
188
+ ),
189
+ array(
190
+ 'type' => 'select',
191
+ 'name' => 'icon_style',
192
+ 'std' => 'black',
193
+ 'text' => __( '"Add to Wishlist" Icon Color', 'ti-woocommerce-wishlist' ),
194
+ 'options' => array(
195
+ 'black' => __( 'Black', 'ti-woocommerce-wishlist' ),
196
+ 'white' => __( 'White', 'ti-woocommerce-wishlist' ),
197
+ ),
198
+ 'class' => 'tiwl-button-icon-style',
199
+ ),
200
+ array(
201
+ 'type' => 'text',
202
+ 'name' => 'text',
203
+ 'text' => __( '"Add to Wishlist" button Text', 'ti-woocommerce-wishlist' ),
204
+ 'std' => 'Add to Wishlist',
205
+ ),
206
+ array(
207
+ 'type' => 'text',
208
+ 'name' => 'text_browse',
209
+ 'text' => __( '"View Wishlist" button Text', 'ti-woocommerce-wishlist' ),
210
+ 'std' => 'View Wishlist',
211
+ ),
212
+ array(
213
+ 'type' => 'checkboxonoff',
214
+ 'name' => 'redirect',
215
+ 'text' => __( 'Redirect to Wishlist', 'ti-woocommerce-wishlist' ),
216
+ 'desc' => __( 'If enabled, user will be redirected to wishlist page after 5 sec from adding product to wishlist.', 'ti-woocommerce-wishlist' ),
217
+ 'std' => true,
218
+ ),
219
+ array(
220
+ 'type' => 'text',
221
+ 'name' => 'text_already_in',
222
+ 'text' => __( '"Product already in Wishlist" Text', 'ti-woocommerce-wishlist' ),
223
+ 'desc' => __( 'This notification will be shown if user will try to add product that already in wishlist when quantity on wishlist page is disabled.', 'ti-woocommerce-wishlist' ),
224
+ 'std' => 'Product already in Wishlist',
225
+ ),
226
+ array(
227
+ 'type' => 'text',
228
+ 'name' => 'text_added_to',
229
+ 'text' => __( '"Product added to Wishlist" Text', 'ti-woocommerce-wishlist' ),
230
+ 'std' => 'Product added to Wishlist',
231
+ ),
232
+ ),
233
+ ),
234
+ array(
235
+ 'id' => 'product_table',
236
+ 'title' => __( 'Wishlist Product Settings', 'ti-woocommerce-wishlist' ),
237
+ 'desc' => __( 'Following options allows you to choose what information/functionality to show/enable in wishlist table on wishlist page.', 'ti-woocommerce-wishlist' ),
238
+ 'show_names' => true,
239
+ 'fields' => array(
240
+ array(
241
+ 'type' => 'checkboxonoff',
242
+ 'name' => 'add_to_card',
243
+ 'text' => __( 'Show "Add to Cart" button', 'ti-woocommerce-wishlist' ),
244
+ 'std' => true,
245
+ 'extra' => array( 'tiwl-show' => '.tiwl-table-action-addcart' ),
246
+ ),
247
+ array(
248
+ 'type' => 'text',
249
+ 'name' => 'text_add_to_card',
250
+ 'text' => __( '"Add to Cart" Text', 'ti-woocommerce-wishlist' ),
251
+ 'std' => 'Add to Cart',
252
+ 'class' => 'tiwl-table-action-addcart',
253
+ ),
254
+ array(
255
+ 'type' => 'checkboxonoff',
256
+ 'name' => 'colm_price',
257
+ 'text' => __( 'Show Unit price', 'ti-woocommerce-wishlist' ),
258
+ 'std' => true,
259
+ ),
260
+ array(
261
+ 'type' => 'checkboxonoff',
262
+ 'name' => 'colm_stock',
263
+ 'text' => __( 'Show Stock status', 'ti-woocommerce-wishlist' ),
264
+ 'std' => true,
265
+ ),
266
+ array(
267
+ 'type' => 'checkboxonoff',
268
+ 'name' => 'colm_date',
269
+ 'text' => __( 'Show Date of addition', 'ti-woocommerce-wishlist' ),
270
+ 'std' => true,
271
+ ),
272
+ ),
273
+ ),
274
+ array(
275
+ 'id' => 'table',
276
+ 'title' => __( 'Wishlist Table Settings', 'ti-woocommerce-wishlist' ),
277
+ 'desc' => __( 'Following options will help user to manage and add products to cart from wishlist table in bulk.', 'ti-woocommerce-wishlist' ),
278
+ 'show_names' => true,
279
+ 'fields' => array(
280
+ array(
281
+ 'type' => 'checkboxonoff',
282
+ 'name' => 'colm_checkbox',
283
+ 'text' => __( 'Show Checkboxes', 'ti-woocommerce-wishlist' ),
284
+ 'std' => true,
285
+ 'extra' => array( 'tiwl-show' => '.tiwl-table-cb-button' ),
286
+ ),
287
+ array(
288
+ 'type' => 'group',
289
+ 'id' => 'cb_button',
290
+ 'class' => 'tiwl-table-cb-button',
291
+ ),
292
+ array(
293
+ 'type' => 'checkboxonoff',
294
+ 'name' => 'colm_actions',
295
+ 'text' => __( 'Show Actions button', 'ti-woocommerce-wishlist' ),
296
+ 'desc' => __( 'Bulk actions drop down at the bottom of wishlist table', 'ti-woocommerce-wishlist' ),
297
+ 'std' => true,
298
+ ),
299
+ array(
300
+ 'type' => 'checkboxonoff',
301
+ 'name' => 'add_select_to_card',
302
+ 'text' => __( 'Show "Add Selected to Cart" button', 'ti-woocommerce-wishlist' ),
303
+ 'std' => true,
304
+ 'extra' => array( 'tiwl-show' => '.tiwl-table-addcart-sel' ),
305
+ ),
306
+ array(
307
+ 'type' => 'text',
308
+ 'name' => 'text_add_select_to_card',
309
+ 'text' => __( '"Add Selected to Cart" Button Text', 'ti-woocommerce-wishlist' ),
310
+ 'std' => 'Add Selected to Cart',
311
+ 'class' => 'tiwl-table-addcart-sel',
312
+ ),
313
+ array(
314
+ 'type' => 'group',
315
+ 'id' => '_button',
316
+ ),
317
+ array(
318
+ 'type' => 'checkboxonoff',
319
+ 'name' => 'add_all_to_card',
320
+ 'text' => __( 'Show "Add All to Cart" button', 'ti-woocommerce-wishlist' ),
321
+ 'std' => true,
322
+ 'extra' => array( 'tiwl-show' => '.tiwl-table-addcart-all' ),
323
+ ),
324
+ array(
325
+ 'type' => 'text',
326
+ 'name' => 'text_add_all_to_card',
327
+ 'text' => __( '"Add All to Cart" Button Text', 'ti-woocommerce-wishlist' ),
328
+ 'std' => 'Add All to Cart',
329
+ 'class' => 'tiwl-table-addcart-all',
330
+ ),
331
+ ),
332
+ ),
333
+ array(
334
+ 'id' => 'social',
335
+ 'show_names' => true,
336
+ 'fields' => array(
337
+ array(
338
+ 'type' => 'group',
339
+ 'id' => 'social',
340
+ 'desc' => __( 'Following options enable/disable Social share icons below wishlist table on wishlist page. Wishlist owner can easily share their wishlists using this button on social networks. Wishlist privacy should be set to public or shared status, private wishlists can\'t be shared.', 'ti-woocommerce-wishlist' ),
341
+ 'class' => 'tinvwl-info-top',
342
+ ),
343
+ array(
344
+ 'type' => 'html',
345
+ 'name' => 'social',
346
+ 'text' => __( 'Social Networks Sharing Options', 'ti-woocommerce-wishlist' ),
347
+ 'class' => 'tinvwl-header-row tinvwl-line-border',
348
+ ),
349
+ array(
350
+ 'type' => 'checkboxonoff',
351
+ 'name' => 'facebook',
352
+ 'text' => __( 'Show "Share on Facebook" Button', 'ti-woocommerce-wishlist' ),
353
+ 'std' => true,
354
+ ),
355
+ array(
356
+ 'type' => 'checkboxonoff',
357
+ 'name' => 'twitter',
358
+ 'text' => __( 'Show "Tweet on Twitter" Button', 'ti-woocommerce-wishlist' ),
359
+ 'std' => true,
360
+ ),
361
+ array(
362
+ 'type' => 'checkboxonoff',
363
+ 'name' => 'pinterest',
364
+ 'text' => __( 'Show "Pin on Pinterest" Button', 'ti-woocommerce-wishlist' ),
365
+ 'std' => true,
366
+ ),
367
+ array(
368
+ 'type' => 'checkboxonoff',
369
+ 'name' => 'google',
370
+ 'text' => __( 'Show "Share on Google+" Button', 'ti-woocommerce-wishlist' ),
371
+ 'std' => true,
372
+ ),
373
+ array(
374
+ 'type' => 'checkboxonoff',
375
+ 'name' => 'email',
376
+ 'text' => __( 'Show "Share on Email" Button', 'ti-woocommerce-wishlist' ),
377
+ 'std' => true,
378
+ ),
379
+ array(
380
+ 'type' => 'text',
381
+ 'name' => 'share_on',
382
+ 'text' => __( '"Share on" Text', 'ti-woocommerce-wishlist' ),
383
+ 'std' => 'Share on',
384
+ ),
385
+ ),
386
+ ),
387
+ array(
388
+ 'id' => 'save_buttons',
389
+ 'class' => 'only-button',
390
+ 'noform' => true,
391
+ 'fields' => array(
392
+ array(
393
+ 'type' => 'button_submit',
394
+ 'name' => 'setting_save',
395
+ 'std' => '<span><i class="fa fa-check"></i></span>' . __( 'Save Settings', 'ti-woocommerce-wishlist' ),
396
+ 'extra' => array( 'class' => 'tinvwl-btn split status-btn-ok' ),
397
+ ),
398
+ array(
399
+ 'type' => 'button_submit_quick',
400
+ 'name' => 'setting_save_quick',
401
+ 'std' => '<span><i class="fa fa-floppy-o"></i></span>' . __( 'Save', 'ti-woocommerce-wishlist' ),
402
+ ),
403
+ ),
404
+ ),
405
+ );
406
+ }
407
+
408
+ /**
409
+ * Load value from database
410
+ *
411
+ * @param array $sections Sections array.
412
+ * @return array
413
+ */
414
+ function constructor_load( $sections ) {
415
+ $data = parent::constructor_load( $sections );
416
+ $data['general']['page_wishlist'] = $data['page']['wishlist'];
417
+ $data['general']['processing_autoremove'] = $data['processing']['autoremove'];
418
+ return $data;
419
+ }
420
+
421
+ /**
422
+ * Save value to database and flush rewrite.
423
+ *
424
+ * @param array $data Post section data.
425
+ */
426
+ function constructor_save( $data ) {
427
+ parent::constructor_save( $data );
428
+ if ( empty( $data ) || ! is_array( $data ) ) {
429
+ return false;
430
+ }
431
+ tinv_update_option( 'page', 'wishlist', $data['general']['page_wishlist'] );
432
+ tinv_update_option( 'processing', 'autoremove', $data['general']['processing_autoremove'] );
433
+ tinv_update_option( 'processing', 'autoremove_status', 'tinvwl-addcart' );
434
+ TInvWL_Public_TInvWL::update_rewrite_rules();
435
+ }
436
+
437
+ /**
438
+ * Show Premium Features sections
439
+ */
440
+ function premium_features() {
441
+ TInvWL_View::view( 'premium-features' );
442
+ }
443
+ }
admin/settings/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // @codingStandardsIgnoreFile
3
// Silence is golden.
1
+ <?php
2
+ // @codingStandardsIgnoreFile
3
// Silence is golden.
admin/settings/style.class.php CHANGED
@@ -1,636 +1,636 @@
1
- <?php
2
- /**
3
- * Admin settings class
4
- *
5
- * @since 1.0.0
6
- * @package TInvWishlist\Admin
7
- * @subpackage Settings
8
- */
9
-
10
- // If this file is called directly, abort.
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- die;
13
- }
14
-
15
- /**
16
- * Admin settings class
17
- */
18
- class TInvWL_Admin_Settings_Style extends TInvWL_Admin_BaseStyle {
19
-
20
- /**
21
- * Priority for admin menu
22
- *
23
- * @var integer
24
- */
25
- public $priority = 100;
26
-
27
- /**
28
- * Menu array
29
- *
30
- * @return array
31
- */
32
- function menu() {
33
- return array(
34
- 'title' => __( 'Style Options', 'ti-woocommerce-wishlist' ),
35
- 'page_title' => __( 'Wishlist Style Options', 'ti-woocommerce-wishlist' ),
36
- 'method' => array( $this, '_print_' ),
37
- 'slug' => 'style-settings',
38
- );
39
- }
40
-
41
- /**
42
- * The modifiable attributes for the Default theme
43
- *
44
- * @return array
45
- */
46
- function default_style_settings() {
47
- $font_family = apply_filters( 'tinwl_prepare_fonts', array(
48
- 'inherit' => __( 'Use Default Font', 'ti-woocommerce-wishlist' ),
49
- 'Georgia, serif' => __( 'Georgia', 'ti-woocommerce-wishlist' ),
50
- "'Times New Roman', Times, serif" => __( 'Times New Roman, Times', 'ti-woocommerce-wishlist' ),
51
- 'Arial, Helvetica, sans-serif' => __( 'Arial, Helvetica', 'ti-woocommerce-wishlist' ),
52
- "'Courier New', Courier, monospace" => __( 'Courier New, Courier', 'ti-woocommerce-wishlist' ),
53
- "Georgia, 'Times New Roman', Times, serif" => __( 'Georgia, Times New Roman, Times', 'ti-woocommerce-wishlist' ),
54
- 'Verdana, Arial, Helvetica, sans-serif' => __( 'Verdana, Arial, Helvetica', 'ti-woocommerce-wishlist' ),
55
- 'Geneva, Arial, Helvetica, sans-serif' => __( 'Geneva, Arial, Helvetica', 'ti-woocommerce-wishlist' ),
56
- "'Source Sans Pro', 'Open Sans', sans-serif" => __( 'Source Sans Pro, Open Sans', 'ti-woocommerce-wishlist' ),
57
- "'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif" => __( 'Helvetica Neue, Helvetica, Roboto, Arial', 'ti-woocommerce-wishlist' ),
58
- 'Arial, sans-serif' => __( 'Arial', 'ti-woocommerce-wishlist' ),
59
- "'Lucida Grande', Verdana, Arial, 'Bitstream Vera Sans', sans-serif" => __( 'Lucida Grande, Verdana, Arial, Bitstream Vera Sans', 'ti-woocommerce-wishlist' ),
60
- ) );
61
- return array(
62
- array(
63
- 'type' => 'group',
64
- 'title' => __( 'text', 'ti-woocommerce-wishlist' ),
65
- 'show_names' => true,
66
- ),
67
- array(
68
- 'type' => 'color',
69
- 'selector' => '.tinv-wishlist .tinv-header h2',
70
- 'element' => 'color',
71
- 'text' => __( 'Title Color', 'ti-woocommerce-wishlist' ),
72
- ),
73
- array(
74
- 'type' => 'text',
75
- 'selector' => '.tinv-wishlist .tinv-header h2',
76
- 'element' => 'font-size',
77
- 'text' => __( 'Title Font Size', 'ti-woocommerce-wishlist' ),
78
- ),
79
- array(
80
- 'type' => 'color',
81
- 'selector' => '.tinv-wishlist',
82
- 'element' => 'color',
83
- 'text' => __( 'Content Text Color', 'ti-woocommerce-wishlist' ),
84
- ),
85
- array(
86
- 'type' => 'select',
87
- 'selector' => '.tinv-wishlist,.tinv-wishlist button,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]',
88
- 'element' => 'font-family',
89
- 'text' => __( 'Font', 'tinvwl' ),
90
- 'options' => $font_family,
91
- ),
92
-
93
- array(
94
- 'type' => 'group',
95
- 'title' => __( 'links', 'ti-woocommerce-wishlist' ),
96
- 'show_names' => true,
97
- ),
98
- array(
99
- 'type' => 'color',
100
- 'selector' => '.tinv-wishlist a:not(.button)',
101
- 'element' => 'color',
102
- 'text' => __( 'Color', 'ti-woocommerce-wishlist' ),
103
- ),
104
- array(
105
- 'type' => 'color',
106
- 'selector' => '.tinv-wishlist a:not(.button):hover,.tinv-wishlist a:not(.button):active,.tinv-wishlist a:not(.button):focus',
107
- 'element' => 'color',
108
- 'text' => __( 'Hover Color', 'ti-woocommerce-wishlist' ),
109
- ),
110
- array(
111
- 'type' => 'select',
112
- 'selector' => '.tinv-wishlist a:not(.button)',
113
- 'element' => 'text-decoration',
114
- 'text' => __( 'Underline', 'ti-woocommerce-wishlist' ),
115
- 'options' => array(
116
- 'underline' => __( 'Yes', 'ti-woocommerce-wishlist' ),
117
- 'none !important' => __( 'No', 'ti-woocommerce-wishlist' ),
118
- ),
119
- ),
120
- array(
121
- 'type' => 'select',
122
- 'selector' => '.tinv-wishlist a:not(.button)',
123
- 'element' => 'font-family',
124
- 'text' => __( 'Font', 'tinvwl' ),
125
- 'options' => $font_family,
126
- ),
127
-
128
- array(
129
- 'type' => 'group',
130
- 'title' => __( 'fields', 'ti-woocommerce-wishlist' ),
131
- 'show_names' => true,
132
- ),
133
- array(
134
- 'type' => 'color',
135
- 'selector' => '.tinv-wishlist input[type="text"],.tinv-wishlist input[type="email"],.tinv-wishlist input[type="url"],.tinv-wishlist input[type="password"],.tinv-wishlist input[type="search"],.tinv-wishlist input[type="tel"],.tinv-wishlist input[type="number"],.tinv-wishlist textarea,.tinv-wishlist select,.tinv-wishlist .product-quantity input[type="text"].qty',
136
- 'element' => 'background-color',
137
- 'text' => __( 'Background Color', 'ti-woocommerce-wishlist' ),
138
- ),
139
- array(
140
- 'type' => 'color',
141
- 'selector' => '.tinv-wishlist input[type="text"],.tinv-wishlist input[type="email"],.tinv-wishlist input[type="url"],.tinv-wishlist input[type="password"],.tinv-wishlist input[type="search"],.tinv-wishlist input[type="tel"],.tinv-wishlist input[type="number"],.tinv-wishlist textarea,.tinv-wishlist select,.tinv-wishlist .product-quantity input[type="text"].qty',
142
- 'element' => 'border-color',
143
- 'text' => __( 'Border Color', 'ti-woocommerce-wishlist' ),
144
- ),
145
- array(
146
- 'type' => 'text',
147
- 'selector' => '.tinv-wishlist input[type="text"],.tinv-wishlist input[type="email"],.tinv-wishlist input[type="url"],.tinv-wishlist input[type="password"],.tinv-wishlist input[type="search"],.tinv-wishlist input[type="tel"],.tinv-wishlist input[type="number"],.tinv-wishlist textarea,.tinv-wishlist select,.tinv-wishlist .product-quantity input[type="text"].qty',
148
- 'element' => 'border-radius',
149
- 'text' => __( 'Border Radius', 'ti-woocommerce-wishlist' ),
150
- ),
151
- array(
152
- 'type' => 'color',
153
- 'selector' => '.tinv-wishlist input[type="text"],.tinv-wishlist input[type="email"],.tinv-wishlist input[type="url"],.tinv-wishlist input[type="password"],.tinv-wishlist input[type="search"],.tinv-wishlist input[type="tel"],.tinv-wishlist input[type="number"],.tinv-wishlist textarea,.tinv-wishlist select,.tinv-wishlist .product-quantity input[type="text"].qty',
154
- 'element' => 'color',
155
- 'text' => __( 'Text Color', 'ti-woocommerce-wishlist' ),
156
- ),
157
- array(
158
- 'type' => 'select',
159
- 'selector' => '.tinv-wishlist input[type="text"],.tinv-wishlist input[type="email"],.tinv-wishlist input[type="url"],.tinv-wishlist input[type="password"],.tinv-wishlist input[type="search"],.tinv-wishlist input[type="tel"],.tinv-wishlist input[type="number"],.tinv-wishlist textarea,.tinv-wishlist select,.tinv-wishlist .product-quantity input[type="text"].qty',
160
- 'element' => 'font-family',
161
- 'text' => __( 'Font', 'tinvwl' ),
162
- 'options' => $font_family,
163
- ),
164
- array(
165
- 'type' => 'text',
166
- 'selector' => '.tinv-wishlist input[type="text"],.tinv-wishlist input[type="email"],.tinv-wishlist input[type="url"],.tinv-wishlist input[type="password"],.tinv-wishlist input[type="search"],.tinv-wishlist input[type="tel"],.tinv-wishlist input[type="number"],.tinv-wishlist textarea,.tinv-wishlist .product-quantity input[type="text"].qty',
167
- 'element' => 'font-size',
168
- 'text' => __( 'Font Size', 'ti-woocommerce-wishlist' ),
169
- ),
170
- array(
171
- 'type' => 'text',
172
- 'selector' => '.tinv-wishlist select',
173
- 'element' => 'font-size',
174
- 'text' => __( 'Select Font Size', 'ti-woocommerce-wishlist' ),
175
- ),
176
-
177
- array(
178
- 'type' => 'group',
179
- 'title' => __( 'add to wishlist product page button', 'ti-woocommerce-wishlist' ),
180
- 'show_names' => true,
181
- ),
182
- array(
183
- 'type' => 'color',
184
- 'selector' => '.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button.button',
185
- 'element' => 'background-color',
186
- 'text' => __( 'Background Color', 'ti-woocommerce-wishlist' ),
187
- ),
188
- array(
189
- 'type' => 'color',
190
- 'selector' => '.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button.button:hover,.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button.button:active,.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button.button:focus',
191
- 'element' => 'background-color',
192
- 'text' => __( 'Background Hover Color', 'ti-woocommerce-wishlist' ),
193
- ),
194
- array(
195
- 'type' => 'color',
196
- 'selector' => '.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button',
197
- 'element' => 'color',
198
- 'text' => __( 'Text Color', 'ti-woocommerce-wishlist' ),
199
- ),
200
- array(
201
- 'type' => 'color',
202
- 'selector' => '.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button.button',
203
- 'element' => 'color',
204
- 'text' => __( 'Button Text Color', 'ti-woocommerce-wishlist' ),
205
- ),
206
- array(
207
- 'type' => 'color',
208
- 'selector' => '.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button:hover,.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button:active,.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button:focus',
209
- 'element' => 'color',
210
- 'text' => __( 'Text Hover Color', 'ti-woocommerce-wishlist' ),
211
- ),
212
- array(
213
- 'type' => 'color',
214
- 'selector' => '.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button.button:hover,.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button.button:active,.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button.button:focus',
215
- 'element' => 'color',
216
- 'text' => __( 'Button Text Hover Color', 'ti-woocommerce-wishlist' ),
217
- ),
218
- array(
219
- 'type' => 'select',
220
- 'selector' => '.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button',
221
- 'element' => 'font-family',
222
- 'text' => __( 'Font', 'tinvwl' ),
223
- 'options' => $font_family,
224
- ),
225
- array(
226
- 'type' => 'text',
227
- 'selector' => '.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button',
228
- 'element' => 'font-size',
229
- 'text' => __( 'Font Size', 'ti-woocommerce-wishlist' ),
230
- ),
231
- array(
232
- 'type' => 'text',
233
- 'selector' => '.woocommerce div.product form.cart .tinvwl_add_to_wishlist_button.button',
234
- 'element' => 'border-radius',
235
- 'text' => __( 'Border Radius', 'ti-woocommerce-wishlist' ),
236
- ),
237
-
238
- array(
239
- 'type' => 'group',
240
- 'title' => __( 'accent buttons style', 'ti-woocommerce-wishlist' ),
241
- 'show_names' => true,
242
- ),
243
- array(
244
- 'type' => 'color',
245
- 'selector' => '.tinv-wishlist button',
246
- 'element' => 'background-color',
247
- 'text' => __( 'Background Color', 'ti-woocommerce-wishlist' ),
248
- ),
249
- array(
250
- 'type' => 'color',
251
- 'selector' => '.tinv-wishlist button:hover,.tinv-wishlist button:focus,.tinv-wishlist input[type="button"]:hover,.tinv-wishlist input[type="button"]:focus,.tinv-wishlist input[type="reset"]:hover,.tinv-wishlist input[type="reset"]:focus,.tinv-wishlist input[type="submit"]:hover,.tinv-wishlist input[type="submit"]:focus',
252
- 'element' => 'background-color',
253
- 'text' => __( 'Background Hover Color', 'ti-woocommerce-wishlist' ),
254
- ),
255
- array(
256
- 'type' => 'color',
257
- 'selector' => '.tinv-wishlist button',
258
- 'element' => 'color',
259
- 'text' => __( 'Text Color', 'ti-woocommerce-wishlist' ),
260
- ),
261
- array(
262
- 'type' => 'color',
263
- 'selector' => '.tinv-wishlist button:hover,.tinv-wishlist button:focus,.tinv-wishlist input[type="button"]:hover,.tinv-wishlist input[type="button"]:focus,.tinv-wishlist input[type="reset"]:hover,.tinv-wishlist input[type="reset"]:focus,.tinv-wishlist input[type="submit"]:hover,.tinv-wishlist input[type="submit"]:focus',
264
- 'element' => 'color',
265
- 'text' => __( 'Text Hover Color', 'ti-woocommerce-wishlist' ),
266
- ),
267
- array(
268
- 'type' => 'select',
269
- 'selector' => '.tinv-wishlist button',
270
- 'element' => 'font-family',
271
- 'text' => __( 'Font', 'tinvwl' ),
272
- 'options' => $font_family,
273
- ),
274
- array(
275
- 'type' => 'text',
276
- 'selector' => '.tinv-wishlist button',
277
- 'element' => 'font-size',
278
- 'text' => __( 'Font Size', 'ti-woocommerce-wishlist' ),
279
- ),
280
- array(
281
- 'type' => 'text',
282
- 'selector' => '.widget .tinvwl-search-submit:before',
283
- 'element' => 'font-size',
284
- 'text' => __( 'Search Widget Font Size', 'tinvwl' ),
285
- ),
286
- array(
287
- 'type' => 'text',
288
- 'selector' => '.tinv-wishlist button',
289
- 'element' => 'border-radius',
290
- 'text' => __( 'Border Radius', 'ti-woocommerce-wishlist' ),
291
- ),
292
-
293
- array(
294
- 'type' => 'group',
295
- 'title' => __( 'normal buttons style', 'ti-woocommerce-wishlist' ),
296
- 'show_names' => true,
297
- ),
298
- array(
299
- 'type' => 'color',
300
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit,.woocommerce.tinv-wishlist a.button,.woocommerce.tinv-wishlist button.button,.woocommerce.tinv-wishlist input.button',
301
- 'element' => 'background-color',
302
- 'text' => __( 'Background Color', 'ti-woocommerce-wishlist' ),
303
- ),
304
- array(
305
- 'type' => 'color',
306
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit:hover,.woocommerce.tinv-wishlist a.button:hover,.woocommerce.tinv-wishlist button.button:hover,.woocommerce.tinv-wishlist input.button:hover',
307
- 'element' => 'background-color',
308
- 'text' => __( 'Background Hover Color', 'ti-woocommerce-wishlist' ),
309
- ),
310
- array(
311
- 'type' => 'color',
312
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit,.woocommerce.tinv-wishlist a.button,.woocommerce.tinv-wishlist button.button,.woocommerce.tinv-wishlist input.button',
313
- 'element' => 'color',
314
- 'text' => __( 'Text Color', 'ti-woocommerce-wishlist' ),
315
- ),
316
- array(
317
- 'type' => 'color',
318
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit:hover,.woocommerce.tinv-wishlist a.button:hover,.woocommerce.tinv-wishlist button.button:hover,.woocommerce.tinv-wishlist input.button:hover',
319
- 'element' => 'color',
320
- 'text' => __( 'Text Hover Color', 'ti-woocommerce-wishlist' ),
321
- ),
322
- array(
323
- 'type' => 'select',
324
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit,.woocommerce.tinv-wishlist a.button,.woocommerce.tinv-wishlist button.button,.woocommerce.tinv-wishlist input.button',
325
- 'element' => 'font-family',
326
- 'text' => __( 'Font', 'tinvwl' ),
327
- 'options' => $font_family,
328
- ),
329
- array(
330
- 'type' => 'text',
331
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit,.woocommerce.tinv-wishlist a.button,.woocommerce.tinv-wishlist button.button,.woocommerce.tinv-wishlist input.button',
332
- 'element' => 'font-size',
333
- 'text' => __( 'Font Size', 'ti-woocommerce-wishlist' ),
334
- ),
335
- array(
336
- 'type' => 'text',
337
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit,.woocommerce.tinv-wishlist a.button,.woocommerce.tinv-wishlist button.button,.woocommerce.tinv-wishlist input.button',
338
- 'element' => 'border-radius',
339
- 'text' => __( 'Border Radius', 'ti-woocommerce-wishlist' ),
340
- ),
341
-
342
- array(
343
- 'type' => 'group',
344
- 'title' => __( 'add to cart button', 'ti-woocommerce-wishlist' ),
345
- 'show_names' => true,
346
- ),
347
- array(
348
- 'type' => 'color',
349
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit.alt,.woocommerce.tinv-wishlist a.button.alt,.woocommerce.tinv-wishlist button.button.alt,.woocommerce.tinv-wishlist input.button.alt',
350
- 'element' => 'background-color',
351
- 'text' => __( 'Background Color', 'ti-woocommerce-wishlist' ),
352
- ),
353
- array(
354
- 'type' => 'color',
355
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit.alt:hover,.woocommerce.tinv-wishlist a.button.alt:hover,.woocommerce.tinv-wishlist button.button.alt:hover,.woocommerce.tinv-wishlist input.button.alt:hover',
356
- 'element' => 'background-color',
357
- 'text' => __( 'Background Hover Color', 'ti-woocommerce-wishlist' ),
358
- ),
359
- array(
360
- 'type' => 'color',
361
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit.alt,.woocommerce.tinv-wishlist a.button.alt,.woocommerce.tinv-wishlist button.button.alt,.woocommerce.tinv-wishlist input.button.alt',
362
- 'element' => 'color',
363
- 'text' => __( 'Text Color', 'ti-woocommerce-wishlist' ),
364
- ),
365
- array(
366
- 'type' => 'color',
367
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit.alt:hover,.woocommerce.tinv-wishlist a.button.alt:hover,.woocommerce.tinv-wishlist button.button.alt:hover,.woocommerce.tinv-wishlist input.button.alt:hover',
368
- 'element' => 'color',
369
- 'text' => __( 'Text Hover Color', 'ti-woocommerce-wishlist' ),
370
- ),
371
- array(
372
- 'type' => 'select',
373
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit.alt,.woocommerce.tinv-wishlist a.button.alt,.woocommerce.tinv-wishlist button.button.alt,.woocommerce.tinv-wishlist input.button.alt',
374
- 'element' => 'font-family',
375
- 'text' => __( 'Font', 'tinvwl' ),
376
- 'options' => $font_family,
377
- ),
378
- array(
379
- 'type' => 'text',
380
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit.alt,.woocommerce.tinv-wishlist a.button.alt,.woocommerce.tinv-wishlist button.button.alt,.woocommerce.tinv-wishlist input.button.alt',
381
- 'element' => 'font-size',
382
- 'text' => __( 'Font Size', 'ti-woocommerce-wishlist' ),
383
- ),
384
- array(
385
- 'type' => 'text',
386
- 'selector' => '.woocommerce.tinv-wishlist #respond input#submit.alt,.woocommerce.tinv-wishlist a.button.alt,.woocommerce.tinv-wishlist button.button.alt,.woocommerce.tinv-wishlist input.button.alt',
387
- 'element' => 'border-radius',
388
- 'text' => __( 'Border Radius', 'ti-woocommerce-wishlist' ),
389
- ),
390
-
391
- array(
392
- 'type' => 'group',
393
- 'title' => __( 'table', 'ti-woocommerce-wishlist' ),
394
- 'show_names' => true,
395
- ),
396
- array(
397
- 'type' => 'color',
398
- 'selector' => '.tinv-wishlist table,.tinv-wishlist table td',
399
- 'element' => 'background-color',
400
- 'text' => __( 'Background Color', 'ti-woocommerce-wishlist' ),
401
- ),
402
- array(
403
- 'type' => 'color',
404
- 'selector' => '.tinv-wishlist table,.tinv-wishlist table th,.tinv-wishlist table td',
405
- 'element' => 'border-color',
406
- 'text' => __( 'Border Color', 'ti-woocommerce-wishlist' ),
407
- ),
408
- array(
409
- 'type' => 'color',
410
- 'selector' => '.tinv-wishlist table th',
411
- 'element' => 'background-color',
412
- 'text' => __( 'Table Head Background Color', 'ti-woocommerce-wishlist' ),
413
- ),
414
- array(
415
- 'type' => 'color',
416
- 'selector' => '.tinv-wishlist table th',
417
- 'element' => 'color',
418
- 'text' => __( 'Table Head Text Color', 'ti-woocommerce-wishlist' ),
419
- ),
420
- array(
421
- 'type' => 'select',
422
- 'selector' => '.tinv-wishlist table th',
423
- 'element' => 'font-family',
424
- 'text' => __( 'Table Head Font', 'tinvwl' ),
425
- 'options' => $font_family,
426
- ),
427
- array(
428
- 'type' => 'text',
429
- 'selector' => '.tinv-wishlist table th',
430
- 'element' => 'font-size',
431
- 'text' => __( 'Table Head Font Size', 'ti-woocommerce-wishlist' ),
432
- ),
433
- array(
434
- 'type' => 'color',
435
- 'selector' => '.tinv-wishlist table td',
436
- 'element' => 'color',
437
- 'text' => __( 'Content Text Color', 'ti-woocommerce-wishlist' ),
438
- ),
439
- array(
440
- 'type' => 'select',
441
- 'selector' => '.tinv-wishlist table td',
442
- 'element' => 'font-family',
443
- 'text' => __( 'Content Text Font', 'tinvwl' ),
444
- 'options' => $font_family,
445
- ),
446
- array(
447
- 'type' => 'text',
448
- 'selector' => '.tinv-wishlist table td',
449
- 'element' => 'font-size',
450
- 'text' => __( 'Content Text Font Size', 'ti-woocommerce-wishlist' ),
451
- ),
452
- array(
453
- 'type' => 'color',
454
- 'selector' => '.tinv-wishlist td.product-price',
455
- 'element' => 'color',
456
- 'text' => __( 'Price Color', 'ti-woocommerce-wishlist' ),
457
- ),
458
- array(
459
- 'type' => 'select',
460
- 'selector' => '.tinv-wishlist td.product-price',
461
- 'element' => 'font-family',
462
- 'text' => __( 'Price Font', 'tinvwl' ),
463
- 'options' => $font_family,
464
- ),
465
- array(
466
- 'type' => 'text',
467
- 'selector' => '.tinv-wishlist td.product-price',
468
- 'element' => 'font-size',
469
- 'text' => __( 'Price Font Size', 'ti-woocommerce-wishlist' ),
470
- ),
471
- array(
472
- 'type' => 'color',
473
- 'selector' => '.tinv-wishlist td.product-price ins span.amount',
474
- 'element' => 'color',
475
- 'text' => __( 'Special Price Color', 'ti-woocommerce-wishlist' ),
476
- ),
477
- array(
478
- 'type' => 'color',
479
- 'selector' => '.tinv-wishlist td.product-price ins span.amount',
480
- 'element' => 'background-color',
481
- 'text' => __( 'Special Price Background Color', 'ti-woocommerce-wishlist' ),
482
- ),
483
- array(
484
- 'type' => 'color',
485
- 'selector' => '.tinv-wishlist .social-buttons li a',
486
- 'element' => 'background-color',
487
- 'text' => __( 'Social Icons Background Color', 'ti-woocommerce-wishlist' ),
488
- ),
489
- array(
490
- 'type' => 'color',
491
- 'selector' => '.tinv-wishlist .social-buttons li a:hover',
492
- 'element' => 'background-color',
493
- 'text' => __( 'Social Icons Background Hover Color', 'ti-woocommerce-wishlist' ),
494
- ),
495
- array(
496
- 'type' => 'select',
497
- 'selector' => '.tinv-wishlist .social-buttons li a',
498
- 'element' => '-ti-background',
499
- 'text' => __( 'Social Icons Color', 'ti-woocommerce-wishlist' ),
500
- 'options' => array(
501
- 'dark' => __( 'Dark', 'ti-woocommerce-wishlist' ),
502
- 'white' => __( 'White', 'ti-woocommerce-wishlist' ),
503
- ),
504
- 'validate' => FILTER_DEFAULT,
505
- ),
506
-
507
- array(
508
- 'type' => 'group',
509
- 'title' => __( 'popups', 'ti-woocommerce-wishlist' ),
510
- 'show_names' => true,
511
- ),
512
- array(
513
- 'type' => 'color',
514
- 'selector' => '.tinv-wishlist .tinv-modal .tinv-modal-inner',
515
- 'element' => 'background-color',
516
- 'text' => __( 'Background Color', 'ti-woocommerce-wishlist' ),
517
- ),
518
- array(
519
- 'type' => 'color',
520
- 'selector' => '.tinv-wishlist .tinv-modal h2',
521
- 'element' => 'color',
522
- 'text' => __( 'Title Color', 'ti-woocommerce-wishlist' ),
523
- ),
524
- array(
525
- 'type' => 'select',
526
- 'selector' => '.tinv-wishlist .tinv-modal h2',
527
- 'element' => 'font-family',
528
- 'text' => __( 'Title Font', 'tinvwl' ),
529
- 'options' => $font_family,
530
- ),
531
- array(
532
- 'type' => 'text',
533
- 'selector' => '.tinv-wishlist .tinv-modal h2',
534
- 'element' => 'font-size',
535
- 'text' => __( 'Title Font Size', 'ti-woocommerce-wishlist' ),
536
- ),
537
- array(
538
- 'type' => 'color',
539
- 'selector' => '.tinv-wishlist .tinv-modal .tinv-modal-inner',
540
- 'element' => 'color',
541
- 'text' => __( 'Content Text Color', 'ti-woocommerce-wishlist' ),
542
- ),
543
- array(
544
- 'type' => 'select',
545
- 'selector' => '.tinv-wishlist .tinv-modal .tinv-modal-inner,.tinv-wishlist .tinv-modal .tinv-modal-inner select',
546
- 'element' => 'font-family',
547
- 'text' => __( 'Content Text Font', 'tinvwl' ),
548
- 'options' => $font_family,
549
- ),
550
- array(
551
- 'type' => 'text',
552
- 'selector' => '.tinv-wishlist .tinv-modal .tinv-modal-inner,.tinv-wishlist .tinv-modal .tinv-modal-inner select',
553
- 'element' => 'font-size',
554
- 'text' => __( 'Content Text Font Size', 'ti-woocommerce-wishlist' ),
555
- ),
556
- array(
557
- 'type' => 'color',
558
- 'selector' => '.tinv-wishlist .tinv-modal .tinv-modal-inner input,.tinv-wishlist .tinv-modal .tinv-modal-inner select,.tinv-wishlist .tinv-modal .tinv-modal-inner textarea',
559
- 'element' => 'background-color',
560
- 'text' => __( 'Fields Background Color', 'ti-woocommerce-wishlist' ),
561
- ),
562
- array(
563
- 'type' => 'color',
564
- 'selector' => '.tinv-wishlist .tinv-modal .tinv-modal-inner input,.tinv-wishlist .tinv-modal .tinv-modal-inner select,.tinv-wishlist .tinv-modal .tinv-modal-inner textarea',
565
- 'element' => 'border-color',
566
- 'text' => __( 'Fields Border Color', 'ti-woocommerce-wishlist' ),
567
- ),
568
- array(
569
- 'type' => 'text',
570
- 'selector' => '.tinv-wishlist .tinv-modal .tinv-modal-inner input,.tinv-wishlist .tinv-modal .tinv-modal-inner select',
571
- 'element' => 'border-radius',
572
- 'text' => __( 'Fields Border Radius', 'ti-woocommerce-wishlist' ),
573
- ),
574
- array(
575
- 'type' => 'color',
576
- 'selector' => '.tinv-wishlist .tinv-modal .tinv-modal-inner input,.tinv-wishlist .tinv-modal .tinv-modal-inner select,.tinv-wishlist .tinv-modal .tinv-modal-inner textarea',
577
- 'element' => 'color',
578
- 'text' => __( 'Fields Text Color', 'ti-woocommerce-wishlist' ),
579
- ),
580
- array(
581
- 'type' => 'color',
582
- 'selector' => '.tinv-wishlist .tinv-modal .tinv-modal-inner input::-webkit-input-placeholder',
583
- 'element' => 'color',
584
- 'text' => __( 'Fields Placeholder Text Color', 'ti-woocommerce-wishlist' ),
585
- ),
586
- array(
587
- 'type' => 'color',
588
- 'selector' => '.tinv-wishlist .tinv-modal button.button,.tinv-wishlist .tinv-modal .tinv-close-modal',
589
- 'element' => 'background-color',
590
- 'text' => __( 'Normal Buttons Background Color', 'ti-woocommerce-wishlist' ),
591
- ),
592
- array(
593
- 'type' => 'color',
594
- 'selector' => '.tinv-wishlist .tinv-modal button.button:hover,.tinv-wishlist .tinv-modal .tinv-close-modal:hover',
595
- 'element' => 'background-color',
596
- 'text' => __( 'Normal Buttons Background Hover Color', 'ti-woocommerce-wishlist' ),
597
- ),
598
- array(
599
- 'type' => 'color',
600
- 'selector' => '.tinv-wishlist .tinv-modal button.button,.tinv-wishlist .tinv-modal .tinv-close-modal',
601
- 'element' => 'color',
602
- 'text' => __( 'Normal Buttons Text Color', 'ti-woocommerce-wishlist' ),
603
- ),
604
- array(
605
- 'type' => 'color',
606
- 'selector' => '.tinv-wishlist .tinv-modal button.button:hover,.tinv-wishlist .tinv-modal .tinv-close-modal:hover',
607
- 'element' => 'color',
608
- 'text' => __( 'Normal Buttons Text Hover Color', 'ti-woocommerce-wishlist' ),
609
- ),
610
- array(
611
- 'type' => 'color',
612
- 'selector' => '.tinv-wishlist .tinv-modal button:not(.button)',
613
- 'element' => 'background-color',
614
- 'text' => __( 'Accent Buttons Background Color', 'ti-woocommerce-wishlist' ),
615
- ),
616
- array(
617
- 'type' => 'color',
618
- 'selector' => '.tinv-wishlist .tinv-modal button:not(.button):hover,.tinv-wishlist .tinv-modal button:not(.button):active,.tinv-wishlist .tinv-modal button:not(.button):focus',
619
- 'element' => 'background-color',
620
- 'text' => __( 'Accent Buttons Background Hover Color', 'ti-woocommerce-wishlist' ),
621
- ),
622
- array(
623
- 'type' => 'color',
624
- 'selector' => '.tinv-wishlist .tinv-modal button:not(.button)',
625
- 'element' => 'color',
626
- 'text' => __( 'Accent Buttons Text Color', 'ti-woocommerce-wishlist' ),
627
- ),
628
- array(
629
- 'type' => 'color',
630
- 'selector' => '.tinv-wishlist .tinv-modal button:not(.button):hover,.tinv-wishlist .tinv-modal button:not(.button):active,.tinv-wishlist .tinv-modal button:not(.button):focus',
631
- 'element' => 'color',
632
- 'text' => __( 'Accent Buttons Text Hover Color', 'ti-woocommerce-wishlist' ),
633
- ),
634
- );
635
- }
636
- }
1
+ <?php
2
+ /**
3
+ * Admin settings class
4
+ *
5
+ * @since 1.0.0
6
+ * @package TInvWishlist\Admin
7
+ * @subpackage Settings
8
+ */
9
+
10
+ // If this file is called directly, abort.
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ die;
13
+ }
14
+
15
+ /**
16
+ * Admin settings class
17
+ */
18
+ class TInvWL_Admin_Settings_Style extends TInvWL_Admin_BaseStyle {
19
+
20
+ /**
21
+ * Priority for admin menu
22
+ *
23
+ * @var integer
24
+ */
25
+ public $priority = 100;
26
+
27
+ /**
28
+ * Menu array
29
+ *
30
+ * @return array
31
+ */
32
+ function menu() {
33
+ return array(
34
+ 'title' => __( 'Style Options', 'ti-woocommerce-wishlist' ),
35
+ 'page_title' => __( 'Wishlist Style Options', 'ti-woocommerce-wishlist' ),
36
+ 'method' => array( $this, '_print_' ),
37
+ 'slug' => 'style-settings',
38
+ );
39
+ }
40
+
41
+ /**
42
+ * The modifiable attributes for the Default theme
43
+ *
44
+ * @return array
45
+ */
46
+ function default_style_settings() {
47
+ $font_family = apply_filters( 'tinwl_prepare_fonts', array(
48
+ 'inherit' => __( 'Use Default Font', 'ti-woocommerce-wishlist' ),
49
+ 'Georgia, serif' => __( 'Georgia', 'ti-woocommerce-wishlist' ),
50
+ "'Times New Roman', Times, serif" => __( 'Times New Roman, Times', 'ti-woocommerce-wishlist' ),
51
+ 'Arial, Helvetica, sans-serif' => __( 'Arial, Helvetica', 'ti-woocommerce-wishlist' ),
52
+ "'Courier New', Courier, monospace" => __( 'Courier New, Courier', 'ti-woocommerce-wishlist' ),
53
+ "Georgia, 'Times New Roman', Times, serif" => __( 'Georgia, Times New Roman, Times', 'ti-woocommerce-wishlist' ),
54
+ 'Verdana, Arial, Helvetica, sans-serif' => __( 'Verdana, Arial, Helvetica', 'ti-woocommerce-wishlist' ),
55
+ 'Geneva, Arial, Helvetica, sans-serif' => __( 'Geneva, Arial, Helvetica', 'ti-woocommerce-wishlist' ),
56
+ "'Source Sans Pro', 'Open Sans', sans-serif" => __( 'Source Sans Pro, Open Sans', 'ti-woocommerce-wishlist' ),
57
+ "'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif" => __( 'Helvetica Neue, Helvetica, Roboto, Arial', 'ti-woocommerce-wishlist' ),
58
+ 'Arial, sans-serif' => __( 'Arial', 'ti-woocommerce-wishlist' ),
59
+ "'Lucida Grande', Verdana, Arial, 'Bitstream Vera Sans', sans-serif" => __( 'Lucida Grande, Verdana, Arial, Bitstream Vera Sans', 'ti-woocommerce-wishlist' ),
60
+ ) );
61
+ return array(
62
+ array(
63
+ 'type' => 'group',
64
+ 'title' => __( 'text', 'ti-woocommerce-wishlist' ),
65
+ 'show_names' => true,
66
+ ),
67
+ array(
68
+ 'type' => 'color',
69
+ 'selector' => '.tinv-wishlist .tinv-header h2',
70
+ 'element' => 'color',
71
+ 'text' => __( 'Title Color', 'ti-woocommerce-wishlist' ),
72
+ ),
73
+ array(
74
+ 'type' => 'text',
75
+ 'selector' => '.tinv-wishlist .tinv-header h2',
76
+ 'element' => 'font-size',
77
+ 'text' => __( 'Title Font Size', 'ti-woocommerce-wishlist' ),
78
+ ),
79
+ array(
80