Contact Form 7 Style - Version 2.0

Version Description

  • New UI Admin settings options
  • Use custom post type for individual style set up
  • Multiple cf7 forms can have their own style
  • Style can be activated only for certain cf7 forms
  • All google fonts available for use
  • Styling improvement for theme twentyfifteen, twentyfourteen
  • New settings available
  • Possibility to change certain settings for the "custom style" styles
  • Style filtering by categories for easier use
  • Possibility to save your settings and import / export the generated "custom style"
  • Donate option for support the plugin's continued development and better user support

=

Download this release

Release Info

Developer mlehelsz
Plugin Icon 128x128 Contact Form 7 Style
Version 2.0
Comparing to
See all releases

Code changes from version 1.1.1 to 2.0

admin/css/admin.css CHANGED
@@ -1,372 +1,61 @@
1
- /*
2
- Contact Form 7 - Xmas
3
- Admin styles
4
- */
5
- .cf7_style_section .cf7_style_options h4 {
6
- margin: 20px 20px 10px 20px;
7
- }
8
- .cf7_style_section .update-message {
9
- margin: 20px 20px 0 20px;
10
- padding: 10px 20px;
11
- background-color: #FCF3EF;
12
- color: #E14D43;
13
- border-left: 4px solid #D54E21;
14
  }
15
- .cf7_style_section .update-message a {
16
- text-decoration: none;
17
- }
18
-
19
-
20
- .cf7_style_admin #icon-themes {
21
- background: url( '../images/screen-icon.png' ) no-repeat;
22
- }
23
-
24
- .cf7_style_admin,
25
- .cf7_style_custom {
26
- width: 700px;
27
- float:left;
28
- }
29
-
30
- .cf7_style_admin .submit,
31
- .cf7_style_custom .submit {
32
  float: left;
 
 
33
  }
34
 
35
- .cf7_style_admin .reset,
36
- .cf7_style_custom .reset {
37
- float: right;
38
- margin: 5px 0;
39
- padding: 1.5em 0;
40
  }
41
-
42
- .cf7_style_templates {
43
- text-align: center;
44
  }
45
-
46
- .cf7_style_admin .cf7_style_select:first-child {
47
- display: none;
48
  }
49
-
50
- .cf7_style_templates li {
51
- display: inline-block;
52
- margin: 0 10px;
53
  }
54
-
55
- .cf7_style_templates span {
56
  display: block;
57
- font-weight: 600;
58
- color: #777;
59
- }
60
-
61
- .cf7_style_templates img {
62
- width: 200px;
63
- border: solid 1px #eee;
64
- -webkit-border-radius: 7px;
65
- -moz-border-radius: 7px;
66
- border-radius: 7px;
67
- opacity: 0.35;
68
- cursor: pointer;
69
- }
70
-
71
- .cf7_style_templates li.selected img {
72
- opacity: 1;
73
- border: solid 1px #D8D8D8;
74
- }
75
-
76
- .cf7_style_templates li.selected span {
77
- color: #D24C4C;
78
- }
79
-
80
- .cf7_style_section{
81
- border: 1px solid #ddd;
82
- border-bottom: 0;
83
- background: #fbfbfb;
84
- -webkit-border-radius: 7px;
85
- -moz-border-radius: 7px;
86
- border-radius: 7px;
87
- overflow: hidden;
88
- }
89
-
90
- .cf7_style_opts label{
91
- font-size: 12px;
92
- font-weight: 700;
93
- width: 200px;
94
- display: block;
95
- float: left;
96
- }
97
-
98
- .cf7_style_input {
99
- padding: 30px 10px;
100
- border-bottom: 1px solid #ddd;
101
- border-top: 1px solid #fff;
102
- clear:both;
103
- }
104
-
105
- .cf7_style_opts small{
106
- display: block;
107
- width: 200px;
108
- color: #999;
109
- }
110
-
111
- .cf7_style_opts input[type="text"],
112
- .cf7_style_opts select{
113
- width: 280px;
114
- font-size: 12px;
115
- padding: 4px;
116
- color: #333;
117
- line-height: 1em;
118
- background: #fff;
119
- }
120
-
121
- .cf7_style_input input:focus,
122
- .cf7_style_input textarea:focus{
123
- background: #fff;
124
- }
125
-
126
- .cf7_style_input textarea{
127
- width: 280px;
128
- height: 175px;
129
- font-size: 12px;
130
- padding: 4px;
131
- color: #333;
132
- line-height: 1.5em;
133
- background: #f3f3f3;
134
- }
135
-
136
- .cf7_style_title h3 {
137
- font-size: 1em;
138
- text-transform: uppercase;
139
- margin: 0;
140
- font-weight: bold;
141
- color: #232323;
142
- float: left;
143
- padding: 14px 4px 14px 10px;
144
- }
145
-
146
- .cf7_style_title{
147
- border-bottom: 1px solid #ddd;
148
- background: #f2f2f2;
149
- padding: 0;
150
- -webkit-border-radius: 5px 5px 0 0;
151
- -moz-border-radius: 5px 5px 0 0;
152
- border-radius: 5px 5px 0 0;
153
- }
154
-
155
- .cf7_style_title span.submit{
156
- display: block;
157
- margin: 0;
158
- padding: 0;
159
- width: 15%;
160
- padding: 14px 0;
161
- }
162
-
163
- .clearfix{
164
- clear: both;
165
- }
166
-
167
- .cf7_style_table th, .cf7_style_table td{
168
- border: 1px solid #bbb;
169
- padding: 10px;
170
- text-align: center;
171
- }
172
-
173
- .cf7_style_table th,
174
- .cf7_style_table td.feature{
175
- border-color: #888;
176
- }
177
-
178
- .cf7_style_section .button-primary {
179
- margin-left: 5px;
180
- }
181
-
182
- .cf7_style_opts input[type="text"].wp-color-picker {
183
- width: 70px;
184
- }
185
-
186
-
187
-
188
- /*Css by Mircea*/
189
-
190
- #about-section {
191
- position:relative;
192
- display:block;
193
- max-width:30%;
194
- min-width:30%;
195
- width:30%;
196
- float:left;
197
- margin-top: 100px;
198
- border: 1px solid #ddd;
199
- border-bottom: 0;
200
- background: #fbfbfb;
201
- -webkit-border-radius: 7px;
202
- -moz-border-radius: 7px;
203
- border-radius: 7px;
204
- overflow: hidden;
205
- }
206
-
207
- .cf7_style_options {
208
- clear:both;
209
- float:left;
210
- width:100%;
211
- }
212
-
213
- #cf7-feedbox h3 {
214
- min-width:100%;
215
- background-color:#f2f2f2;
216
- }
217
-
218
- .cf7_style_options p {
219
- padding-left:20px;
220
- padding-right:20px;
221
- }
222
-
223
- .cf7_style_options .cf7_style_select:first-child {
224
- display: none;
225
  }
226
-
227
- #font-viewer {
228
- margin-top:0px;
229
- width:90%;
230
- height:100px;
231
- background-color:white;
232
- position:relative;
233
- display:block;
234
- margin-left:auto;
235
- margin-right:auto;
236
- border:1px solid #C0C0C0;
237
- overflow:hidden;
238
- }
239
-
240
- #font-viewer p {
241
- padding-left:10px;
242
- padding-right:10px;
243
- padding-top:10px;
244
- padding-bottom:10px;
245
- font-size:15px;
246
- }
247
-
248
- #font-viewer .loading p{
249
- text-align:center;
250
-
251
- }
252
-
253
- small.preview {
254
- text-align:center;
255
- float:none;
256
- width:auto;
257
- margin-bottom:0px;
258
- }
259
-
260
- #font-viewer2 {
261
- margin-top:0px;
262
- width:90%;
263
- height:100px;
264
- background-color:white;
265
- position:relative;
266
- display:block;
267
- margin-left:auto;
268
- margin-right:auto;
269
- border:1px solid #C0C0C0;
270
- overflow:hidden;
271
- }
272
-
273
- #font-viewer2 p {
274
- padding-left:10px;
275
- padding-right:10px;
276
- padding-top:10px;
277
- padding-bottom:10px;
278
- font-size:15px;
279
- }
280
-
281
- #font-viewer2 .loading p{
282
- text-align:center;
283
-
284
- }
285
-
286
- #border-viewer {
287
- margin-top:0px;
288
- width:90%;
289
- height:100px;
290
- background-color:white;
291
- position:relative;
292
- display:block;
293
- margin-left:auto;
294
- margin-right:auto;
295
- border:1px solid #C0C0C0;
296
- overflow:hidden;
297
- }
298
-
299
- #border-viewer p {
300
- padding-left:10px;
301
- padding-right:10px;
302
- padding-top:10px;
303
- padding-bottom:10px;
304
- margin-left:20px;
305
- margin-right:20px;
306
- margin-top:20px;
307
- font-size:15px;
308
- border:1px solid green;
309
- }
310
-
311
- #border-viewer .loading p {
312
- text-align:center;
313
-
314
  }
315
-
316
- .border-select {
317
- margin-bottom: 50px;
318
- }
319
-
320
- @font-face {
321
- font-family: 'Joti One';
322
- font-style: normal;
323
- font-weight: 400;
324
- src: local('Joti One'), local('JotiOne-Regular'), url(http://themes.googleusercontent.com/static/fonts/jotione/v1/jivCpCi5Y7-IAGZU7bq-pvesZW2xOQ-xsNqO47m55DA.woff) format('woff');
325
- }
326
-
327
- @font-face {
328
- font-family: 'Henny Penny';
329
- font-style: normal;
330
- font-weight: 400;
331
- src: local('Henny Penny'), local('HennyPenny-Regular'), url(http://themes.googleusercontent.com/static/fonts/hennypenny/v1/5KmZ_gfx8tPgQLMk4S-PvobN6UDyHWBl620a-IRfuBk.woff) format('woff');
332
- }
333
-
334
- @font-face {
335
- font-family: 'Emilys Candy';
336
- font-style: normal;
337
- font-weight: 400;
338
- src: local('Emilys Candy'), local('EmilysCandy-Regular'), url(http://themes.googleusercontent.com/static/fonts/emilyscandy/v1/PofLVm6v1SwZGOzC8s-I3Ra1RVmPjeKy21_GQJaLlJI.woff) format('woff');
339
- }
340
-
341
- @font-face {
342
- font-family: 'Pirata One';
343
- font-style: normal;
344
- font-weight: 400;
345
- src: local('Pirata One'), local('PirataOne-Regular'), url(http://themes.googleusercontent.com/static/fonts/pirataone/v1/AFeg8ejJtTM5d0wUfgcmXhsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
346
- }
347
-
348
- .panel {
349
- width:100%;
350
- cursor:pointer;
351
- border-bottom: 1px solid #DDD;
352
- background: none repeat scroll 0% 0% #F2F2F2;
353
- padding: 0px;
354
- font-size: 1em;
355
- text-transform: uppercase;
356
- margin: 0px;
357
- font-weight: bold;
358
- color: #232323;
359
- float: left;
360
- padding: 14px 4px 14px 10px;
361
- }
362
-
363
- .submitbuttonset,
364
- .generalssetpanel {
365
- clear:both;
366
- }
367
-
368
- .generals,
369
- .labelsandinputsset,
370
- .submitbuttonset {
371
- display:none;
372
  }
1
+ /* After update admin css */
2
+ .wp-admin .widefat .different-style input {
3
+ margin: 0 10px 0 0;
4
+ height: 21px;
 
 
 
 
 
 
 
 
 
5
  }
6
+ .general-settings {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  float: left;
8
+ width: 32%;
9
+ margin-right: 2%;
10
  }
11
 
12
+ .general-settings:nth-of-type(3n) {
13
+ margin-right: 0;
 
 
 
14
  }
15
+ .general-settings h3 {
16
+ text-align: center;
17
+ text-transform: uppercase;
18
  }
19
+ .general-settings:after {
20
+ clear: both;
 
21
  }
22
+ .general-settings label {
23
+ line-height: 26px;
 
 
24
  }
25
+ .general-settings label strong {
 
26
  display: block;
27
+ margin-right: 10px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
29
+ .general-settings label input {
30
+ margin-right: 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  }
32
+ .general-settings small {
33
+ display: block;
34
+ color: #999;
35
+ margin-top: 5px;
36
+ line-height: 12px;
37
+ }
38
+ .general-settings .element {
39
+ width: 100%;
40
+ border: 1px solid #ddd;
41
+ padding: 10px 10px;
42
+ box-sizing: border-box;
43
+ margin-bottom: 10px;
44
+ }
45
+ .general-settings .element table {
46
+ width: 100%;
47
+ }
48
+ .general-settings .element td {
49
+ width: 50%;
50
+ }
51
+ @media screen and ( max-width: 1332px ){
52
+ .general-settings {
53
+ width: 47%;
54
+ }
55
+ }
56
+ @media screen and ( max-width: 1100px ){
57
+ .general-settings {
58
+ width: 100%;
59
+ margin-right: 0;
60
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
admin/js/admin.js CHANGED
@@ -30,5 +30,11 @@ jQuery(document).ready( function( $ ) {
30
  $('.submitbuttonsetpanel').click(function() {
31
  $('.submitbuttonset').slideToggle();
32
  });
 
 
 
 
 
 
33
  });
34
 
30
  $('.submitbuttonsetpanel').click(function() {
31
  $('.submitbuttonset').slideToggle();
32
  });
33
+
34
+ /*new update*/
35
+ $('.cf7-style-color-field').wpColorPicker();
36
+ $("#select_all").on("click", function(){
37
+ $(".cf7style_body_select_all input").prop('checked', ( $(this).is(":checked") ) ? true : false );
38
+ });
39
  });
40
 
assets/icon-128x128.jpg ADDED
Binary file
assets/icon-256x256.jpg ADDED
Binary file
cf7-style-feed-box.php DELETED
@@ -1,19 +0,0 @@
1
- <div class="cf7_style_title">
2
- <h3>Latest news</h3>
3
- <div class="clearfix"></div>
4
- </div>
5
- <div class="cf7_style_options">
6
- <?php cf7_style_update(); ?>
7
-
8
- <h4>Valentine's Day Templates</h4>
9
-
10
- <p>Our latest update released features 4 new templates for Valentine's Day and
11
- a Custom style area.</p>
12
-
13
- <h4>Xmas Templates</h4>
14
-
15
- <p>As a first release, we developed only the basic settings and only 3 simple and nice designs.</p>
16
- <p>For the next updates we are preparing new options, new designs and new cool features for your forms.</p>
17
- <p>This plugin will not be just for Christmas, but for every day usage, and with some neat features and designs for holidays
18
- like Easter, Christmas, Halloween, etc. :-) In the near future maybe even a Premium version.</p>
19
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cf7-style-functions.php DELETED
@@ -1,590 +0,0 @@
1
- <?php
2
- /**
3
- * Admin notices
4
- */
5
- function cf7_style_admin_notices() {
6
- global $cf7_style_name;
7
-
8
- if ( isset( $_GET['saved'] ) ) echo '<div id="message" class="updated fade"><p><strong>' . $cf7_style_name . ' settings saved.</strong></p></div>';
9
- if ( isset( $_GET['reset'] ) ) echo '<div id="message" class="updated fade"><p><strong>' . $cf7_style_name . ' settings reset.</strong></p></div>';
10
- }
11
-
12
-
13
-
14
- /**
15
- * Output css style for frontend
16
- */
17
- function cf7_style_frontend_output() {
18
- ?>
19
- <style type="text/css">
20
- <?php
21
- /**
22
- * Declare input font-family for frontend
23
- */
24
- $cf7_style_google_font = get_option( 'cf7_style_google_fonts' );
25
- $google_font_family = explode( ':', $cf7_style_google_font );
26
- if( !empty( $google_font_family[0] ) && $google_font_family[0] != 'Default' ) {
27
- ?>
28
- .wpcf7 input,
29
- .wpcf7 textarea,
30
- .wpcf7 form {
31
- font-family: "<?php echo $google_font_family[0]; ?>";
32
- }
33
- <?php
34
- }
35
-
36
- $cf7_style_font_label = get_option( 'cf7_style_google_fonts' );
37
- $cf7_style_font_input = get_option( 'cf7_style_google_fonts_for_input_text' );
38
-
39
- // Google Fonts Array for label and input
40
- $google_font_label = explode( ':', $cf7_style_font_label );
41
- $google_font_input = explode( ':', $cf7_style_font_input );
42
- if( !empty( $google_font_label[0] ) && $google_font_label[0] != 'Default' && !empty( $google_font_input[0] ) && $google_font_input[0] != 'Default' ) {
43
- ?>
44
- .wpcf7,
45
- .wpcf7 form,
46
- .wpcf7 form {
47
- font-family: "<?php echo $google_font_label[0]; ?>";
48
- }
49
- .wpcf7 input,
50
- .wpcf7 textarea {
51
- font-family: "<?php echo $google_font_input[0]; ?>";
52
- }
53
- <?php
54
- }
55
-
56
-
57
- /**
58
- * Change the form background color
59
- */
60
- $cf7_style_form_background = get_option( 'cf7_style_form_bg' );
61
- $cf7_style_form_background = explode( ':', $cf7_style_form_background );
62
- if( !empty( $cf7_style_form_background[0] ) ) {
63
- ?>
64
- .wpcf7 {
65
- background-color: <?php echo $cf7_style_form_background[0]; ?>;
66
- }
67
- <?php
68
- }
69
-
70
- /**
71
- * Change the form width
72
- */
73
- $cf7_style_form_width = get_option( 'cf7_style_form_width' );
74
- $cf7_style_form_width = explode( ':', $cf7_style_form_width );
75
- if( !empty( $cf7_style_form_width[0] ) ) {
76
- ?>
77
- .wpcf7 {
78
- width: <?php echo $cf7_style_form_width[0]; ?>px;
79
- }
80
- <?php
81
- }
82
-
83
-
84
- /**
85
- * Change the form border-size, type and color
86
- */
87
- $cf7_style_form_border_size = get_option( 'cf7_style_form_border_size' );
88
- $cf7_style_form_border_size = explode( ':', $cf7_style_form_border_size );
89
- $cf7_style_form_border_type = get_option( 'cf7_style_form_border_type' );
90
- $cf7_style_form_border_type = explode( ':', $cf7_style_form_border_type );
91
- $cf7_style_form_border_color = get_option( 'cf7_style_form_border_color' );
92
- $cf7_style_form_border_color = explode( ':', $cf7_style_form_border_color );
93
- if( !empty( $cf7_style_form_border_size[0] ) && !empty( $cf7_style_form_border_type[0] ) && !empty( $cf7_style_form_border_color[0] ) ) {
94
- ?>
95
- .wpcf7 {
96
- border: <?php echo $cf7_style_form_border_size[0]; ?>px <?php echo $cf7_style_form_border_type[0]; ?> <?php echo $cf7_style_form_border_color[0]; ?>;
97
- }
98
- <?php
99
- }
100
-
101
- /**
102
- * Change the form border radius
103
- */
104
- $cf7_style_form_border_radius = get_option( 'cf7_style_form_border_radius' );
105
- $cf7_style_form_border_radius = explode( ':', $cf7_style_form_border_radius );
106
- if( !empty( $cf7_style_form_border_radius[0] ) ) {
107
- ?>
108
- .wpcf7 {
109
- -webkit-border-radius: <?php echo $cf7_style_form_border_radius[0]; ?>px;
110
- -moz-border-radius: <?php echo $cf7_style_form_border_radius[0]; ?>px;
111
- border-radius: <?php echo $cf7_style_form_border_radius[0]; ?>px;
112
- }
113
- <?php
114
- }
115
-
116
-
117
- /**
118
- * Change the background color for input and textarea
119
- */
120
- $cf7_style_input_background = get_option( 'cf7_style_input_bg' );
121
- $cf7_style_input_background = explode( ':', $cf7_style_input_background );
122
- if( !empty( $cf7_style_input_background[0] ) ) {
123
- ?>
124
- .wpcf7 input,
125
- .wpcf7 textarea{
126
- background-color: <?php echo $cf7_style_input_background[0]; ?>;
127
- }
128
- <?php
129
- }
130
-
131
- /**
132
- * Change the label color
133
- */
134
- $cf7_style_label_color = get_option( 'cf7_style_label_color' );
135
- $cf7_style_label_color = explode( ':', $cf7_style_label_color );
136
- if( !empty( $cf7_style_label_color[0] ) ) {
137
- ?>
138
- .wpcf7 .wpcf7-form p{
139
- color: <?php echo $cf7_style_label_color[0]; ?>;
140
- }
141
- <?php
142
- }
143
-
144
- /**
145
- * Change the text color for input and textarea
146
- */
147
- $cf7_style_input_text_color = get_option( 'cf7_style_input_text_color' );
148
- $cf7_style_input_text_color = explode( ':', $cf7_style_input_text_color );
149
- if( !empty( $cf7_style_input_text_color[0] ) ) {
150
- ?>
151
- .wpcf7 .wpcf7-form input,
152
- .wpcf7 .wpcf7-form textarea{
153
- color: <?php echo $cf7_style_input_text_color[0]; ?>;
154
- }
155
- <?php
156
- }
157
-
158
- /**
159
- * Change the form font-size
160
- */
161
- $cf7_style_font_size = get_option( 'cf7_style_font_size' );
162
- $cf7_style_font_size = explode( ':', $cf7_style_font_size );
163
- if( !empty( $cf7_style_font_size[0] ) ) {
164
- ?>
165
- .wpcf7 p {
166
- font-size: <?php echo $cf7_style_font_size[0]; ?>px;
167
- }
168
- <?php
169
- }
170
-
171
- /**
172
- * Change the form input font-size
173
- */
174
- $cf7_style_input_font_size = get_option( 'cf7_style_input_font_size' );
175
- $cf7_style_input_font_size = explode( ':', $cf7_style_input_font_size );
176
- if( !empty( $cf7_style_input_font_size[0] ) ) {
177
- ?>
178
- .wpcf7 input {
179
- font-size: <?php echo $cf7_style_input_font_size[0]; ?>px;
180
- }
181
- <?php
182
- }
183
-
184
- /**
185
- * Change the form input border-size, type and color
186
- */
187
- $cf7_style_input_border_size = get_option( 'cf7_style_input_border_size' );
188
- $cf7_style_input_border_size = explode( ':', $cf7_style_input_border_size );
189
- $cf7_style_input_border_type = get_option( 'cf7_style_input_border_type' );
190
- $cf7_style_input_border_type = explode( ':', $cf7_style_input_border_type );
191
- $cf7_style_input_border_color = get_option( 'cf7_style_input_border_color' );
192
- $cf7_style_input_border_color = explode( ':', $cf7_style_input_border_color );
193
- if( !empty( $cf7_style_input_border_size[0] ) && !empty( $cf7_style_input_border_type[0] ) && !empty( $cf7_style_input_border_color[0] ) ) {
194
- ?>
195
- .wpcf7 input,
196
- .wpcf7 textarea{
197
- border: <?php echo $cf7_style_input_border_size[0]; ?>px <?php echo $cf7_style_input_border_type[0]; ?> <?php echo $cf7_style_input_border_color[0]; ?>;
198
- }
199
- <?php
200
- }
201
-
202
- /**
203
- * Change the form input border radius
204
- */
205
- $cf7_style_input_border_radius = get_option( 'cf7_style_input_border_radius' );
206
- $cf7_style_input_border_radius = explode( ':', $cf7_style_input_border_radius );
207
- if( !empty( $cf7_style_input_border_radius[0] ) ) {
208
- ?>
209
- .wpcf7 input,
210
- .wpcf7 textarea{
211
- -webkit-border-radius: <?php echo $cf7_style_input_border_radius[0]; ?>px;
212
- -moz-border-radius: <?php echo $cf7_style_input_border_radius[0]; ?>px;
213
- border-radius: <?php echo $cf7_style_input_border_radius[0]; ?>px;
214
- }
215
- <?php
216
- }
217
-
218
- /**
219
- * Change the form label font style
220
- */
221
- $cf7_style_label_font_style = get_option( 'cf7_style_label_font_style' );
222
- $cf7_style_label_font_style = explode( ':', $cf7_style_label_font_style );
223
- if( !empty( $cf7_style_label_font_style[0] ) ) {
224
- if ($cf7_style_label_font_style[0] === 'Bold') {
225
- $fontstyle = 'font-weight';
226
-
227
- }
228
-
229
- elseif ($cf7_style_label_font_style[0] === 'Underline') {
230
- $fontstyle = 'text-decoration';
231
- }
232
-
233
- elseif ($cf7_style_label_font_style[0] === 'Italic') {
234
- $fontstyle = 'font-style';
235
- }
236
-
237
- ?>
238
- .wpcf7 p {
239
- <?php echo $fontstyle; ?>: <?php echo $cf7_style_label_font_style[0]; ?>;
240
- }
241
- <?php
242
- }
243
-
244
- /**
245
- * Change the form input font style
246
- */
247
- $cf7_style_input_font_style = get_option( 'cf7_style_input_font_style' );
248
- $cf7_style_input_font_style = explode( ':', $cf7_style_input_font_style );
249
- if( !empty( $cf7_style_input_font_style[0] ) ) {
250
- $fontstyle = '';
251
- if ($cf7_style_input_font_style[0] === 'Bold') {
252
- $fontstyle = 'font-weight';
253
- }
254
-
255
- elseif ($cf7_style_input_font_style[0] === 'Underline') {
256
- $fontstyle = 'text-decoration';
257
- }
258
-
259
- elseif ($cf7_style_input_font_style[0] === 'Italic') {
260
- $fontstyle = 'font-style';
261
- }
262
-
263
- ?>
264
- .wpcf7 input,
265
- .wpcf7 textarea{
266
- <?php echo $fontstyle;?>: <?php echo $cf7_style_input_font_style[0]; ?>;
267
- }
268
- <?php
269
- }
270
-
271
- /**
272
- * Change the form input width
273
- */
274
- $cf7_style_input_width = get_option( 'cf7_style_input_width' );
275
- $cf7_style_input_width = explode( ':', $cf7_style_input_width );
276
- if( !empty( $cf7_style_input_width[0] ) ) {
277
- ?>
278
- .wpcf7 input,
279
- .wpcf7 textarea {
280
- width: <?php echo $cf7_style_input_width[0]; ?>px;
281
- }
282
- <?php
283
- }
284
-
285
- /**
286
- * Change the form input height
287
- */
288
- $cf7_style_input_height = get_option( 'cf7_style_input_height' );
289
- $cf7_style_input_height = explode( ':', $cf7_style_input_height );
290
- if( !empty( $cf7_style_input_height[0] ) ) {
291
- ?>
292
- .wpcf7 input {
293
- height: <?php echo $cf7_style_input_height[0]; ?>px;
294
- }
295
- <?php
296
- }
297
-
298
- /**
299
- * Change the form textarea height
300
- */
301
- $cf7_style_textarea_height = get_option( 'cf7_style_textarea_height' );
302
- $cf7_style_textarea_height = explode( ':', $cf7_style_textarea_height );
303
- if( !empty( $cf7_style_textarea_height[0] ) ) {
304
- ?>
305
- .wpcf7 textarea {
306
- height: <?php echo $cf7_style_textarea_height[0]; ?>px;
307
- }
308
- <?php
309
- }
310
-
311
- /**
312
- * Change the form input padding
313
- */
314
- $cf7_style_input_padding = get_option( 'cf7_style_input_padding' );
315
- $cf7_style_input_padding = explode( ':', $cf7_style_input_padding );
316
- if( !empty( $cf7_style_input_padding[0] ) ) {
317
- ?>
318
- .wpcf7 input
319
- .wpcf7 textarea {
320
- padding: <?php echo $cf7_style_input_padding[0]; ?>;
321
- }
322
- <?php
323
- }
324
-
325
- /**
326
- * Change the form input margin
327
- */
328
- $cf7_style_input_margin = get_option( 'cf7_style_input_margin' );
329
- $cf7_style_input_margin = explode( ':', $cf7_style_input_margin );
330
- if( !empty( $cf7_style_input_margin[0] ) ) {
331
- ?>
332
- .wpcf7 input,
333
- .wpcf7 textarea{
334
- margin: <?php echo $cf7_style_input_margin[0]; ?>;
335
- }
336
- <?php
337
- }
338
-
339
- /**
340
- * Change the submit button width
341
- */
342
- $cf7_style_submit_button_width = get_option( 'cf7_style_submit_button_width' );
343
- $cf7_style_submit_button_width = explode( ':', $cf7_style_submit_button_width );
344
- if( !empty( $cf7_style_submit_button_width[0] ) ) {
345
- ?>
346
- .wpcf7-submit {
347
- width: <?php echo $cf7_style_submit_button_width[0]; ?>px !important;
348
- }
349
- <?php
350
- }
351
-
352
- /**
353
- * Change the submit button height
354
- */
355
- $cf7_style_submit_button_height = get_option( 'cf7_style_submit_button_height' );
356
- $cf7_style_submit_button_height = explode( ':', $cf7_style_submit_button_height );
357
- if( !empty( $cf7_style_submit_button_height[0] ) ) {
358
- ?>
359
- .wpcf7-submit {
360
- height: <?php echo $cf7_style_submit_button_height[0]; ?>px !important;
361
- }
362
- <?php
363
- }
364
-
365
- /**
366
- * Change the submit button border-radius
367
- */
368
- $cf7_style_submit_border_radius = get_option( 'cf7_style_submit_border_radius' );
369
- $cf7_style_submit_border_radius = explode( ':', $cf7_style_submit_border_radius );
370
- if( !empty( $cf7_style_submit_border_radius[0] ) ) {
371
- ?>
372
- .wpcf7-submit {
373
- -webkit-border-radius: <?php echo $cf7_style_submit_border_radius[0]; ?>px !important;
374
- -moz-border-radius: <?php echo $cf7_style_submit_border_radius[0]; ?>px !important;
375
- border-radius: <?php echo $cf7_style_submit_border_radius[0]; ?>px !important;
376
- }
377
- <?php
378
- }
379
-
380
- /**
381
- * Change the submit button font size
382
- */
383
- $cf7_style_submit_font_size = get_option( 'cf7_style_submit_font_size' );
384
- $cf7_style_submit_font_size = explode( ':', $cf7_style_submit_font_size );
385
- if( !empty( $cf7_style_submit_font_size[0] ) ) {
386
- ?>
387
- .wpcf7-submit {
388
- font-size: <?php echo $cf7_style_submit_font_size[0]; ?>px !important;
389
- text-decoration:none !Important;
390
- }
391
- <?php
392
- }
393
-
394
- /**
395
- * Change the submit button font size
396
- */
397
- $cf7_style_submit_background_color = get_option( 'cf7_style_submit_background_color' );
398
- $cf7_style_submit_background_color = explode( ':', $cf7_style_submit_background_color );
399
- if( !empty( $cf7_style_submit_background_color[0] ) ) {
400
- ?>
401
- .wpcf7-submit {
402
- background-color: <?php echo $cf7_style_submit_background_color[0]; ?> !Important;
403
- background-image:none !important;
404
- }
405
- <?php
406
- }
407
-
408
- /**
409
- * Change the form submit border-size, type and color
410
- */
411
- $cf7_style_submit_border_size = get_option( 'cf7_style_submit_border_size' );
412
- $cf7_style_submit_border_size = explode( ':', $cf7_style_submit_border_size );
413
- $cf7_style_submit_border_type = get_option( 'cf7_style_submit_border_type' );
414
- $cf7_style_submit_border_type = explode( ':', $cf7_style_submit_border_type );
415
- $cf7_style_submit_border_color = get_option( 'cf7_style_submit_border_color' );
416
- $cf7_style_submit_border_color = explode( ':', $cf7_style_submit_border_color );
417
- if( !empty( $cf7_style_submit_border_size[0] ) && !empty( $cf7_style_submit_border_type[0] ) && !empty( $cf7_style_submit_border_color[0] ) ) {
418
- ?>
419
- .wpcf7-submit {
420
- border: <?php echo $cf7_style_submit_border_size[0]; ?>px <?php echo $cf7_style_submit_border_type[0]; ?> <?php echo $cf7_style_submit_border_color[0]; ?> !important;
421
- }
422
- <?php
423
- }
424
-
425
- ?>
426
- </style>
427
- <?php
428
- }
429
- add_action( 'wp_head', 'cf7_style_frontend_output' );
430
-
431
-
432
-
433
- /**
434
- * Enqueue admin scrips and style
435
- */
436
- function cf7_style_add_init() {
437
-
438
- // Add the color picker
439
- wp_enqueue_style( 'wp-color-picker' );
440
- wp_enqueue_script( 'wp-color-picker-script', plugins_url('/admin/js/color.picker.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
441
-
442
- wp_enqueue_style( "cf7_style_admin_css", plugin_dir_url( __FILE__ ) . "/admin/css/admin.css", false, "1.0", "all");
443
- wp_enqueue_script( "cf7_style_admin_js", plugin_dir_url( __FILE__ ) . "/admin/js/admin.js", false, "1.0");
444
- wp_enqueue_script( "cf7_style_admin_ajax_js", plugin_dir_url( __FILE__ ) . "/admin/js/ajax.preview.tool.js", false, "1.0");
445
- }
446
- add_action('admin_init', 'cf7_style_add_init');
447
-
448
-
449
- /**
450
- * Embed Google Fonts
451
- */
452
- function cf7_style_fonts() {
453
- $cf7_style_google_font = get_option( 'cf7_style_google_fonts' );
454
- if( empty( $cf7_style_google_font ) || $cf7_style_google_font == 'Default' ) {
455
- $cf7_style_google_font = "Bitter";
456
- }
457
-
458
- $query_args = array(
459
- 'family' => urlencode( $cf7_style_google_font ),
460
- 'subset' => urlencode( 'latin,latin-ext' ),
461
- );
462
- $google_font_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );
463
-
464
- return $google_font_url;
465
- }
466
-
467
- /**
468
- * Embed Google Fonts for input
469
- */
470
- function cf7_style_fonts_for_inputs() {
471
- $cf7_style_google_font = get_option( 'cf7_style_google_fonts_for_input_text' );
472
- if( empty( $cf7_style_google_font ) || $cf7_style_google_font == 'Default') {
473
- $cf7_style_google_font = "Open Sans";
474
- }
475
-
476
- $query_args = array(
477
- 'family' => urlencode( $cf7_style_google_font ),
478
- 'subset' => urlencode( 'latin,latin-ext' ),
479
- );
480
- $google_font_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );
481
-
482
- return $google_font_url;
483
-
484
- }
485
-
486
-
487
- /**
488
- * Enqueues scripts and styles for front end
489
- */
490
- function cf7_style_scripts_styles() {
491
-
492
- wp_enqueue_script( 'jquery' );
493
-
494
- // Embed Google Fonts
495
- wp_enqueue_style( 'cf7-xmas-fonts', cf7_style_fonts(), array(), null );
496
-
497
- // Embed Google Fonts for input
498
- wp_enqueue_style( 'cf7-xmas-fonts-inputs', cf7_style_fonts_for_inputs(), array(), null );
499
-
500
- // Loads our main script.
501
- wp_enqueue_script( "cf7_style_frontend_js", plugin_dir_url( __FILE__ ) . "/js/frontend.js", false, "1.0");
502
-
503
- // Loads our main stylesheet
504
- wp_enqueue_style( "cf7_style_frontend_css", plugin_dir_url( __FILE__ ) . "/css/frontend.css", false, "1.0", "all");
505
-
506
- }
507
- add_action( 'wp_enqueue_scripts', 'cf7_style_scripts_styles' );
508
-
509
-
510
- /**
511
- * Declare selected Google Font for admin area
512
- */
513
- function cf7_style_admin_font() {
514
- ?>
515
- <style type="text/css">
516
- <?php
517
- $cf7_style_font_label = get_option( 'cf7_style_google_fonts' );
518
- $cf7_style_font_input = get_option( 'cf7_style_google_fonts_for_input_text' );
519
-
520
- // Google Fonts Array for label and input
521
- $google_font_label = explode( ':', $cf7_style_font_label );
522
- $google_font_input = explode( ':', $cf7_style_font_input );
523
- if( !empty( $google_font_label[0] ) && $google_font_label[0] != 'Default' ) {
524
- ?>
525
- .cf7_style_opts .font-viewer,
526
- .cf7_style_opts .font-viewer3 {
527
- font-family: "<?php echo $google_font_label[0]; ?>";
528
- }
529
- <?php
530
- }
531
- if( !empty( $google_font_input[0] ) && $google_font_input[0] != 'Default' ) {
532
- ?>
533
- .cf7_style_opts .font-viewer2 {
534
- font-family: "<?php echo $google_font_input[0]; ?>";
535
- }
536
- <?php
537
- }
538
- ?>
539
- </style>
540
- <?php
541
- }
542
- add_action( 'admin_head', 'cf7_style_admin_font' );
543
-
544
-
545
- /**
546
- * Body class
547
- *
548
- * Adds a body class to the $classes array
549
- * from the selected Contact Style template
550
- *
551
- * @param string $cf7_style_templates Contact style template
552
- * @return $classes
553
- */
554
- function cf7_style_body_class( $classes ) {
555
-
556
- // Get the selected template
557
- $cf7_style_templates = get_option( 'cf7_style_templates' );
558
-
559
- // add the template class to the $classes array
560
- $classes[] = $cf7_style_templates;
561
-
562
- return $classes;
563
- }
564
- add_filter( 'body_class', 'cf7_style_body_class' );
565
-
566
-
567
- /**
568
- * Check for updates
569
- *
570
- * Display an update notice in the news box
571
- */
572
- function cf7_style_update() {
573
- $svn_readme = file_get_contents("http://plugins.svn.wordpress.org/contact-form-7-style/trunk/readme.txt");
574
- $svn_pos = strrpos( $svn_readme, '=' );
575
- $svn_version = substr( $svn_readme, $svn_pos-6, 5 );
576
-
577
- $local_readme = file_get_contents( plugins_url() . "/contact-form-7-style/readme.txt");
578
- $local_pos = strrpos( $local_readme, '=' );
579
- $local_version = substr( $local_readme, $local_pos-6, 5 );
580
-
581
- $local_version = str_replace( '.', '', $local_version );
582
- $svn_version = str_replace( '.', '', $svn_version );
583
-
584
- if( $local_version !== $svn_version ) {
585
- $html = "<div class='update-message'>There is a new version of ";
586
- $html .= "<a href='http://wordpress.org/plugins/contact-form-7-style/'>Contact Form 7 Style.</a> ";
587
- $html .= "Please <a href='" . get_bloginfo('url') . "/wp-admin/plugins.php?plugin_status=upgrade'>update now</a>.</div>";
588
- echo $html;
589
- }
590
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cf7-style-meta-box.php ADDED
@@ -0,0 +1,625 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function cf7_style_general_settings_array(){
3
+ return array(
4
+
5
+ "general_settings" => array(
6
+ /*!!! labels have to be unique*/
7
+ array(
8
+ "type" => "color-selector",
9
+ "label" => "Form background",
10
+ "description" => "Choose the background color of the form"
11
+ ),array(
12
+ "type" => "number",
13
+ "label" => "Form width",
14
+ "description" => "Form width in pixels"
15
+ ),array(
16
+ "type" => "number",
17
+ "label" => "Form border width",
18
+ "description" => "Form border width in pixels"
19
+ ),array(
20
+ "type" => "selectbox",
21
+ "label" => "Form border style",
22
+ "value" => array( "none", "solid", "dotted","double", "groove", "ridge", "inset", "outset" ), // ???
23
+ "description" => "Style of the Border of the Form"
24
+ ),array(
25
+ "type" => "text",
26
+ "label" => "Form padding",
27
+ "description" => "hover here for example",
28
+ "title" => "Ex 1: 25px 50px 75px 100px; top padding is 25px right padding is 50px bottom padding is 75px left padding is 100px Ex 2: 25px 50px 75px; top padding is 25px right and left paddings are 50px bottom padding is 75px Ex 3: 25px 50px; top and bottom paddings are 25px right and left paddings are 50px Ex 4: 25px; all four paddings are 25px "
29
+ ),array(
30
+ "type" => "text",
31
+ "label" => "Form margin",
32
+ "description" => "hover here for example",
33
+ "title" => "Ex 1: 25px 50px 75px 100px; top margin is 25px right margin is 50px bottom margin is 75px left margin is 100px Ex 2: 25px 50px 75px; top margin is 25px right and left margin are 50px bottom margin is 75px Ex 3: 25px 50px; top and bottom margin are 25px right and left margin are 50px Ex 4: 25px; all four margin are 25px"
34
+ ),array(
35
+ "type" => "color-selector",
36
+ "label" => "Form border color",
37
+ "description" => "Choose the form's border color"
38
+ ),array(
39
+ "type" => "number",
40
+ "label" => "Form border radius",
41
+ "description" => "Choose the form's border radius in pixels"
42
+ )
43
+ ),
44
+ "inputs_and_labels_settings" => array(
45
+ array(
46
+ "type" => "color-selector",
47
+ "label" => "Input Background",
48
+ "description" => "Choose the background color of the input"
49
+ ),array(
50
+ "type" => "color-selector",
51
+ "label" => "Input Color",
52
+ "description" => "Choose the color for the input text"
53
+ ),array(
54
+ "type" => "color-selector",
55
+ "label" => "Input Border Color",
56
+ "description" => "Choose a color for the input border"
57
+ )/*,array(
58
+ "type" => "selectbox",
59
+ "label" => "Input Fonts",
60
+ "value" => array( "none", "solid", "dotted","double", "groove", "ridge", "inset", "outset" ), // ???
61
+ "description" => "Choose from the following Google Fonts"
62
+ )*/,array(
63
+ "type" => "number",
64
+ "label" => "Input font size",
65
+ "description" => "Size of the input fonts in pixels"
66
+ ),array(
67
+ "type" => "number",
68
+ "label" => "Input border width",
69
+ "description" => "Size of the input border in pixels"
70
+ ),array(
71
+ "type" => "selectbox",
72
+ "label" => "Input border style",
73
+ "value" => array( "none", "solid", "dotted","double", "groove", "ridge", "inset", "outset" ), // ???
74
+ "description" => "style of the input border"
75
+ ),array(
76
+ "type" => "number",
77
+ "label" => "Input border radius",
78
+ "description" => "Border radius in px"
79
+ ),array(
80
+ "type" => "selectbox",
81
+ "label" => "Input font style",
82
+ "value" => array( "normal", "italic", "oblique" ), // ???
83
+ "description" => "Choose from the following font styles"
84
+ ),array(
85
+ "type" => "selectbox",
86
+ "label" => "Input font weight",
87
+ "value" => array( "normal", "bold", "bolder", "lighter", "initial", "inherit" ), // ???
88
+ "description" => "Choose from the following font weights"
89
+ ),array(
90
+ "type" => "number",
91
+ "label" => "Input width",
92
+ "description" => "Input width in pixels"
93
+ ),array(
94
+ "type" => "number",
95
+ "label" => "Input height",
96
+ "description" => "Input height in pixels"
97
+ ),array(
98
+ "type" => "text",
99
+ "label" => "Input padding",
100
+ "description" => "hover here for example",
101
+ "title" => "Ex 1: 25px 50px 75px 100px; top padding is 25px right padding is 50px bottom padding is 75px left padding is 100px Ex 2: 25px 50px 75px; top padding is 25px right and left paddings are 50px bottom padding is 75px Ex 3: 25px 50px; top and bottom paddings are 25px right and left paddings are 50px Ex 4: 25px; all four paddings are 25px "
102
+ ),array(
103
+ "type" => "text",
104
+ "label" => "Input margin",
105
+ "description" => "hover here for example",
106
+ "title" => "Ex 1: 25px 50px 75px 100px; top margin is 25px right margin is 50px bottom margin is 75px left margin is 100px Ex 2: 25px 50px 75px; top margin is 25px right and left margin are 50px bottom margin is 75px Ex 3: 25px 50px; top and bottom margin are 25px right and left margin are 50px Ex 4: 25px; all four margin are 25px"
107
+ ),array(
108
+ "type" => "number",
109
+ "label" => "Textarea height",
110
+ "description" => "Textarea height in pixels"
111
+ ),array(
112
+ "type" => "selectbox",
113
+ "label" => "Label font style",
114
+ "value" => array( "normal", "italic", "oblique" ),
115
+ "description" => "Choose from the following font styles"
116
+ ),array(
117
+ "type" => "selectbox",
118
+ "label" => "Label font weight",
119
+ "value" => array( "normal", "bold", "bolder", "lighter", "initial", "inherit" ), // ???
120
+ "description" => "Choose from the following label font weights"
121
+ ),array(
122
+ "type" => "number",
123
+ "label" => "Label font size",
124
+ "description" => "Size of the label fonts in pixels"
125
+ ),array(
126
+ "type" => "color-selector",
127
+ "label" => "Label Color",
128
+ "description" => "Choose the color for the label text"
129
+ )/*,array(
130
+ "type" => "selectbox",
131
+ "label" => "Label Fonts",
132
+ "value" => array( "none", "solid", "dotted","double", "groove", "ridge", "inset", "outset" ), // ???
133
+ "description" => "Choose from the following Google fonts"
134
+ )*/
135
+ ),
136
+ "submit_button_settings" => array(
137
+ array(
138
+ "type" => "number",
139
+ "label" => "Submit button width",
140
+ "description" => "Submit button width in px"
141
+ ),array(
142
+ "type" => "number",
143
+ "label" => "Submit button height",
144
+ "description" => "Submit button height in px"
145
+ ),array(
146
+ "type" => "number",
147
+ "label" => "Submit button border radius",
148
+ "description" => "Border radius in px"
149
+ ),array(
150
+ "type" => "number",
151
+ "label" => "Submit button font size",
152
+ "description" => "Border radius in px"
153
+ ),array(
154
+ "type" => "number",
155
+ "label" => "Submit button border width",
156
+ "description" => "Size of the submit button border in pixels"
157
+ ),array(
158
+ "type" => "selectbox",
159
+ "label" => "Submit button border style",
160
+ "value" => array( "none", "solid", "dotted","double", "groove", "ridge", "inset", "outset" ), // ???
161
+ "description" => "Type of the submit button border"
162
+ ),array(
163
+ "type" => "color-selector",
164
+ "label" => "Submit button border color",
165
+ "description" => "Choose a color for the submit border"
166
+ ),array(
167
+ "type" => "color-selector",
168
+ "label" => "Submit button background color",
169
+ "description" => "Choose a color for the submit background"
170
+ ),
171
+ ));
172
+ }
173
+ /**
174
+ * renders the custom meta box's inputs
175
+ */
176
+ function cf7_style_render_settings( $type, $label, $options, $value, $description, $title ){
177
+
178
+ $cf7s_id = strtolower( str_replace( " ", "-", $label ) );
179
+ ?>
180
+ <div class="element">
181
+ <label for="cf7s-<?php echo $cf7s_id; ?>">
182
+ <table>
183
+ <tr>
184
+ <td>
185
+ <strong>
186
+ <?php echo __( $label, "cf7style_text_domain"); ?>
187
+ </strong>
188
+ </td>
189
+ <td>
190
+ <?php $class = ( "color-selector" == $type ) ? "cf7-style-color-field" : "";
191
+ if( "selectbox" == $type ){ ?>
192
+ <select id="cf7s-<?php echo $cf7s_id; ?>" name="cf7stylecustom[<?php echo $cf7s_id; ?>]">
193
+ <option>Default</option>
194
+ <?php foreach( $options as $option ) {?>
195
+ <option value="<?php echo $option; ?>"<?php if($option == $value) echo " selected='selected'";?>><?php echo $option; ?></option>
196
+ <?php }//foreach end ?>
197
+ </select>
198
+ <?php } else { ?>
199
+ <input type="<?php echo ( $type == 'color-selector' ) ? 'text' : $type; ?>" id="cf7s-<?php echo $cf7s_id; ?>" name="cf7stylecustom[<?php echo $cf7s_id; ?>]" value="<?php echo $value; ?>" <?php if( $class != "" ) echo 'class="'.$class.'"';?>/>
200
+ <?php }//else end ?>
201
+ <small <?php echo ( isset( $title ) ? "title='".$title."'" : "" ); ?>><?php echo __( $description, "cf7style_text_domain"); ?></small>
202
+ </td>
203
+ </tr>
204
+ </table>
205
+ </label>
206
+ </div><!-- /.element -->
207
+ <?php
208
+ }
209
+ /**
210
+ * Calls the class the meta box. Used for selecting forms for each style.
211
+ */
212
+ function cf7_style_meta_form_init() {
213
+ new cf7_style_meta_boxes();
214
+ }
215
+
216
+ if ( is_admin() ) {
217
+ add_action( 'load-post.php', 'cf7_style_meta_form_init' );
218
+ add_action( 'load-post-new.php', 'cf7_style_meta_form_init' );
219
+ }
220
+
221
+ /**
222
+ * The Class for creating all of the meta boxes
223
+ */
224
+ class cf7_style_meta_boxes {
225
+
226
+ /**
227
+ * Hook into the appropriate actions when the class is constructed.
228
+ */
229
+ public function __construct() {
230
+ //selector init
231
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_box_style_selector' ) );
232
+ add_action( 'save_post', array( $this, 'save_style_selector' ) );
233
+ //fonts
234
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_box_font_selector' ) );
235
+ add_action( 'save_post', array( $this, 'save_font_id' ) );
236
+ //image meta box init
237
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_box_style_image' ) );
238
+ //add paypal button
239
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_box_style_paypal' ) );
240
+ //custom style meta box1
241
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_box_style_customizer' ), 10, 2 );
242
+ add_action( 'save_post', array( $this, 'save_style_customizer' ) );
243
+ }
244
+
245
+ /**************************************************
246
+ * Adds the meta box container for style selector.
247
+ * STYLE SELECTOR STARTS HERE
248
+ */
249
+ public function add_meta_box_style_selector( $post_type ) {
250
+ $post_types = array('cf7_style'); //limit meta box to certain post types
251
+ if ( in_array( $post_type, $post_types )) {
252
+ add_meta_box(
253
+ 'cf7_style_meta_box_form_selector'
254
+ ,__( 'Select forms for current style', 'myplugin_textdomain' )
255
+ ,array( $this, 'render_meta_box_selector' )
256
+ ,$post_type
257
+ ,'advanced'
258
+ ,'high'
259
+ );
260
+ }
261
+ }
262
+ public function add_meta_box_style_customizer( $post_type, $post ) {
263
+
264
+ $post_types = array('cf7_style'); //limit meta box to certain post types
265
+ $custom_cat = get_the_terms( $post->ID, "style_category" );
266
+ $custom_name = ( empty( $custom_cat ) ) ? "custom style" : $custom_cat[0]->name;
267
+ if ( in_array( $post_type, $post_types ) && ( $custom_name == "custom style" ) ) {
268
+ add_meta_box(
269
+ 'cf7_style_meta_box_style_customizer'
270
+ ,__( 'Custom style settings', 'myplugin_textdomain' )
271
+ ,array( $this, 'render_meta_box_style_customizer' )
272
+ ,$post_type
273
+ ,'advanced'
274
+ ,'high'
275
+ );
276
+ }
277
+ }
278
+ public function render_meta_box_style_customizer( $post ) {
279
+ wp_nonce_field( 'cf_7_style_style_customizer_inner_custom_box', 'cf_7_style_customizer_custom_box_nonce' );
280
+ $setting_array = unserialize( get_post_meta( $post->ID, 'cf7_style_custom_styles', true ));
281
+ foreach( cf7_style_general_settings_array() as $key=>$settings) { ?>
282
+ <div class="general-settings">
283
+ <h3><?php echo __( str_replace( "_", " ", $key ).' for this custom style.', "cf7style_text_domain" ); ?></h3>
284
+ <?php
285
+ foreach( $settings as $setting ){
286
+ $current_val = ( !empty( $setting_array ) ) ? $setting_array[ strtolower( str_replace( " ", "-", $setting["label"] ) ) ] : "";
287
+ $current_option = ( $setting["type"] == "selectbox" ) ? $setting["value"] : "";
288
+ $current_title = ( isset( $setting["title"] ) ) ? $setting["title"] : "";
289
+ cf7_style_render_settings( $setting["type"], $setting["label"], $current_option, $current_val, $setting["description"], $current_title );
290
+ } ?>
291
+ </div><!-- /.general-settings -->
292
+ <?php } ?>
293
+ <div class="clear"></div>
294
+ <?php
295
+ }
296
+ public function save_style_customizer( $post_id ) {
297
+
298
+ if ( ! isset( $_POST['cf_7_style_customizer_custom_box_nonce'] ) )
299
+ return $post_id;
300
+
301
+ $nonce = $_POST['cf_7_style_customizer_custom_box_nonce'];
302
+
303
+
304
+ // Verify that the nonce is valid.
305
+ if ( ! wp_verify_nonce( $nonce, 'cf_7_style_style_customizer_inner_custom_box' ) ) {
306
+ return $post_id;
307
+ }
308
+
309
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
310
+ return $post_id;
311
+ }
312
+
313
+ if ( 'page' == $_POST['post_type'] ) {
314
+ if ( ! current_user_can( 'edit_page', $post_id ) ) {
315
+ return $post_id;
316
+ }
317
+ } else {
318
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
319
+ return $post_id;
320
+ }
321
+
322
+ }
323
+ $posted_data = $_POST['cf7stylecustom'];
324
+ if ( is_array( $posted_data ) && isset( $posted_data ) ) {
325
+ $serialized_result = serialize( $posted_data );
326
+ update_post_meta( $post_id, 'cf7_style_custom_styles', $serialized_result, "");
327
+ }
328
+
329
+ }
330
+
331
+ /**
332
+ * Save the style selector when the post is saved.
333
+ */
334
+ public function save_style_selector( $post_id ) {
335
+ if ( ! isset( $_POST['cf_7_style_selector_custom_box_nonce'] ) )
336
+ return $post_id;
337
+
338
+ $nonce = $_POST['cf_7_style_selector_custom_box_nonce'];
339
+
340
+ // Verify that the nonce is valid.
341
+ if ( ! wp_verify_nonce( $nonce, 'cf_7_style_selector_inner_custom_box' ) ) {
342
+ return $post_id;
343
+ }
344
+
345
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
346
+ return $post_id;
347
+ }
348
+
349
+ if ( 'page' == $_POST['post_type'] ) {
350
+ if ( ! current_user_can( 'edit_page', $post_id ) ) {
351
+ return $post_id;
352
+ }
353
+ } else {
354
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
355
+ return $post_id;
356
+ }
357
+
358
+ }
359
+
360
+ //getting all the cf7 forms
361
+ $cf7formsargs = array(
362
+ 'post_type' => 'wpcf7_contact_form',
363
+ 'posts_per_page' => -1
364
+ );
365
+ $cf7forms = get_posts( $cf7formsargs );
366
+
367
+ //for each checked form, saving the style id
368
+ foreach ( $cf7forms as $cf7form ) {
369
+ if ( isset( $_POST[$cf7form->post_name] ) ) {
370
+ //if ( !empty( $_POST[$cf7form->post_name] ) ) {
371
+ update_post_meta( $cf7form->ID, 'cf7_style_id', $post_id);
372
+ //}
373
+ } else {
374
+ $getthisstyle = get_post_meta( $cf7form->ID, 'cf7_style_id', $post_id );
375
+
376
+ if ( !empty( $getthisstyle ) && $post_id == $getthisstyle ) {
377
+ update_post_meta( $cf7form->ID, 'cf7_style_id', '' );
378
+ }
379
+
380
+ if ( !empty( $getthisstyle ) ) {
381
+ //update_post_meta( $cf7form->ID, 'cf7_style_id', $getthisstyle );
382
+ }
383
+ }
384
+ }
385
+ }
386
+
387
+ /**
388
+ * Render Meta Box content.
389
+ */
390
+ public function render_meta_box_selector( $post ) {
391
+ wp_nonce_field( 'cf_7_style_selector_inner_custom_box', 'cf_7_style_selector_custom_box_nonce' );
392
+
393
+ // Display the form, using the current value.
394
+ $args = array(
395
+ 'post_type' => 'wpcf7_contact_form',
396
+ 'posts_per_page' => -1
397
+ );
398
+ $currentpostid = get_the_ID();
399
+
400
+ //wp_die( 'aaaa' );
401
+ $query = new WP_Query( $args );
402
+ echo '<table class="wp-list-table fixed pages widefat">';
403
+ echo '<thead>';
404
+ echo '<tr>';
405
+ echo '<th class="manage-column">' . __('Contact form 7 forms') . '</th>';
406
+ echo '<th class="manage-column different-style"><input type="checkbox" id="select_all"/><label for="select_all">' . __('Select all') . '</label></th>';
407
+ echo '</tr>';
408
+ echo '</thead>';
409
+ echo '<tbody class="cf7style_body_select_all">';
410
+ if ( $query->have_posts() ) {
411
+ while ( $query->have_posts() ) : $query->the_post();
412
+ $cf7stylehas = get_post_meta( get_the_ID(), 'cf7_style_id', true );
413
+ ?>
414
+ <tr>
415
+ <td>
416
+ <label for="<?php echo cf7_style_the_slug(); ?>"><?php the_title(); ?></label>
417
+ </td>
418
+ <td>
419
+ <input type="checkbox" id="<?php echo cf7_style_the_slug(); ?>" name="<?php echo cf7_style_the_slug(); ?>" value="<?php echo get_the_ID(); ?>" <?php if ( $currentpostid == $cf7stylehas ) { echo 'checked'; } ?> />
420
+ <?php if ( $currentpostid != $cf7stylehas && !empty( $cf7stylehas ) ) {
421
+ echo '<p class="description">' . __('Notice: This form allready has a selected style. Checking this one will overwrite the ') . '<a href="' . get_admin_url() . '/post.php?post_type=cf7_style&post=' . $cf7stylehas . '&action=edit">' . __('other one.') . '</a></p>';
422
+ } ?>
423
+ </td>
424
+ </tr>
425
+ <?php endwhile; wp_reset_postdata();
426
+ echo '</tbody>';
427
+ echo '</table>';
428
+ } else {
429
+ echo '<tr><td><p class="description">' . __( 'Please create a form. You can do it by clicking') . '<a href="' . admin_url() . 'admin.php?page=wpcf7-new" target="_blank">' . __(' here') . '</a></p></td></tr></table>';
430
+ }
431
+ }
432
+ /**
433
+ *STYLE SELECTOR ENDS HERE
434
+ *****************************
435
+ */
436
+
437
+ /*************************************************
438
+ * Adds the meta box container for IMAGE PREVIEW
439
+ * IMAGE META BOX STARTS HERE
440
+ */
441
+ public function add_meta_box_style_image( $post_type ) {
442
+ $post_types = array('cf7_style'); //limit meta box to certain post types
443
+ if ( in_array( $post_type, $post_types )) {
444
+ add_meta_box(
445
+ 'cf7_style_meta_box_image'
446
+ ,__( 'Preview', 'myplugin_textdomain' )
447
+ ,array( $this, 'render_meta_box_image' )
448
+ ,$post_type
449
+ ,'side'
450
+ ,'high'
451
+ );
452
+ }
453
+ }
454
+ /*
455
+ * renders the image
456
+ */
457
+ public function render_meta_box_image( $post ) {
458
+ $image = get_post_meta( $post->ID, 'cf7_style_image_preview', true );
459
+ if ( !empty( $image ) ) {
460
+ echo '<img src="' . plugins_url() . '/contact-form-7-style/' . $image . '" alt="' . $post->title . '" />';
461
+ } else {
462
+ //here will be the placeholder in case the image is not available
463
+ $image = 'default_form.jpg';
464
+ echo '<img src="' . plugins_url() . '/contact-form-7-style/images/' . $image . '" alt="' . $post->title . '" />';
465
+ }
466
+ }
467
+
468
+ /**
469
+ *IMAGE META BOX ENDS HERE
470
+ ***************************
471
+ */
472
+ /*
473
+ * Meta box for font selector
474
+ */
475
+ public function add_meta_box_font_selector( $post_type ) {
476
+ $post_types = array('cf7_style'); //limit meta box to certain post types
477
+ if ( in_array( $post_type, $post_types )) {
478
+ add_meta_box(
479
+ 'cf7_style_meta_box_font_selector'
480
+ ,__( 'Select a Google Font', 'myplugin_textdomain' )
481
+ ,array( $this, 'render_font_selector' )
482
+ ,$post_type
483
+ ,'advanced'
484
+ ,'high'
485
+ );
486
+ }
487
+ }
488
+ /*
489
+ * show za metabox with only 5 google fonts for now. later we will make a search box for this.
490
+ * Emilys Candy - 196
491
+ * Henny Penny - 275
492
+ * Joti One - 309
493
+ * Open Sans - 458
494
+ * Pirata One - 496
495
+ */
496
+ public function render_font_selector( $post ) {
497
+ wp_nonce_field( 'cf_7_style_font_inner_custom_box', 'cf_7_style_font_custom_box_nonce' );
498
+ //getting all google fonts
499
+ $google_list = file_get_contents( 'https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyBAympIKDNKmfxhI3udY-U_9vDWSdfHrEo' );
500
+ $font_obj = json_decode( $google_list );
501
+ $cf7_style_font = get_post_meta( $post->ID, 'cf7_style_font', true );
502
+ $selected = '';
503
+ echo '<select name="cf7_style_font_selector">';
504
+ echo '<option>None</option>';
505
+ foreach ($font_obj->items as $font) {
506
+ echo '<option value="' . $font->family . '"' . ( $cf7_style_font == $font->family ? 'selected="selected"' : '' ) . '>' . $font->family . '</option>';
507
+ }
508
+ echo '</select>';
509
+ }
510
+
511
+ /**
512
+ * Save the font id
513
+ */
514
+ public function save_font_id( $post_id ) {
515
+ if ( ! isset( $_POST['cf_7_style_font_custom_box_nonce'] ) )
516
+ return $post_id;
517
+
518
+ $nonce = $_POST['cf_7_style_font_custom_box_nonce'];
519
+
520
+ if ( ! wp_verify_nonce( $nonce, 'cf_7_style_font_inner_custom_box' ) ) {
521
+ return $post_id;
522
+ }
523
+
524
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
525
+ return $post_id;
526
+ }
527
+
528
+ if ( 'page' == $_POST['post_type'] ) {
529
+ if ( ! current_user_can( 'edit_page', $post_id ) ) {
530
+ return $post_id;
531
+ }
532
+ } else {
533
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
534
+ return $post_id;
535
+ }
536
+
537
+ }
538
+
539
+ if ( isset ( $_POST['cf7_style_font_selector'] ) ) {
540
+ update_post_meta( $post_id, 'cf7_style_font', $_POST['cf7_style_font_selector'] );
541
+ }
542
+ }
543
+ /*************************************************
544
+ * Adds the meta box container for IMAGE PREVIEW
545
+ * IMAGE META BOX STARTS HERE
546
+ */
547
+ public function add_meta_box_style_paypal( $post_type ) {
548
+ $post_types = array('cf7_style'); //limit meta box to certain post types
549
+ if ( in_array( $post_type, $post_types )) {
550
+ add_meta_box(
551
+ 'cf7_style_meta_box_paypal'
552
+ ,__( 'Donate', 'myplugin_textdomain' )
553
+ ,array( $this, 'render_meta_paypal' )
554
+ ,$post_type
555
+ ,'side'
556
+ ,'high'
557
+ );
558
+ }
559
+ }
560
+ /*
561
+ * renders the image
562
+ */
563
+ public function render_meta_paypal( $post ) { ?>
564
+ <p>Your donation will motivate us to work more and improve this plugin.</p>
565
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=ionut.iclanzan.reea@gmail.com&item_name=Donation+for+Contact+Form+Style" target="_blank">
566
+ <img src="https://www.paypalobjects.com/webstatic/i/logo/rebrand/ppcom.svg">
567
+ </a>
568
+ <?php }
569
+ }
570
+
571
+ //gets the slug of a post
572
+ function cf7_style_the_slug() {
573
+ global $post;
574
+ $post_data = get_post($post->ID, ARRAY_A);
575
+ $slug = $post_data['post_name'];
576
+ return $slug;
577
+ }
578
+ //enques the font
579
+ function enque_selected_font() {
580
+ if ( is_page() || is_single() || is_home() ) {
581
+ global $post;
582
+ $cf7s_id = get_cf7style_slug_or_id( $post, "yes" );
583
+ if ( $cf7s_id ) {
584
+ $fontid = get_post_meta( $cf7s_id, 'cf7_style_font', true );
585
+ $googlefont = preg_replace("/ /","+",$fontid);
586
+ wp_register_style('googlefont-cf7style', 'http://fonts.googleapis.com/css?family=' . $googlefont . ':100,200,300,400,500,600,700,800,900&subset=latin,latin-ext,cyrillic,cyrillic-ext,greek-ext,greek,vietnamese', array(), false, 'all');
587
+ wp_enqueue_style('googlefont-cf7style');
588
+
589
+ }
590
+ }
591
+ }
592
+ add_action( 'wp_enqueue_scripts', 'enque_selected_font' );
593
+
594
+ /*
595
+ * returns the name of the font on the current page/post
596
+ */
597
+ function return_font_name( $postid ) {
598
+ $getpost = get_post( $postid );
599
+ $cf7s_id = get_cf7style_slug_or_id( $getpost, "yes" );
600
+ if ( $cf7s_id ) {
601
+ $fontname = get_post_meta( $cf7s_id, 'cf7_style_font', true );
602
+ return ( $fontname );
603
+ }
604
+ return false;
605
+ }
606
+
607
+ /*
608
+ * hides change permalink and view buttons on editing screen
609
+ */
610
+ add_action('admin_head', 'hide_edit_permalinks_on_style_customizer');
611
+ function hide_edit_permalinks_on_style_customizer() {
612
+ $currentScreen = get_current_screen();
613
+ if ( $currentScreen->post_type == 'cf7_style' ) { ?>
614
+ <style type="text/css">
615
+ <!--
616
+ #titlediv {
617
+ margin-bottom: 10px;
618
+ }
619
+ #edit-slug-box, .editinline, .view{
620
+ display: none;
621
+ }
622
+ -->
623
+ </style>
624
+ <?php }
625
+ }
cf7-style-options.php DELETED
@@ -1,485 +0,0 @@
1
- <?php
2
- /**
3
- * Options
4
- *
5
- * Generate fields for admin area
6
- */
7
- $cf7_style_name = "Contact Style";
8
- $cf7_style = "cf7_style";
9
-
10
-
11
- /**
12
- * Valentine's Day Templates
13
- */
14
- $valentines = array (
15
- array( "name" => $cf7_style_name." Options",
16
- "type" => "title"),
17
-
18
-
19
- array( "name" => "Valentines Day Templates",
20
- "type" => "section"),
21
- array( "type" => "open"),
22
-
23
- array( "name" => "Valentines day templates",
24
- "desc" => "Choose one of the templates",
25
- "id" => $cf7_style."_templates",
26
- "type" => "select",
27
- "options" => array(
28
- 'vday-classic',
29
- 'vday-roses',
30
- 'vday-birds',
31
- 'vday-blue-birds'
32
- ),
33
- "std" => "vday-blue-birds"
34
- ),
35
-
36
- array( "name" => "Label Fonts",
37
- "desc" => "Choose from the following Google fonts",
38
- "id" => $cf7_style."_google_fonts",
39
- "type" => "select",
40
- "options" => array(
41
- 'Emilys Candy',
42
- 'Henny Penny',
43
- 'Joti One',
44
- 'Open Sans:400,300,600,700',
45
- 'Pirata One'
46
- ),
47
- "std" => "Emilys Candy"
48
- ),
49
-
50
- array( "type" => "close")
51
- );
52
-
53
-
54
-
55
- /**
56
- * Xmas Templates
57
- */
58
- $templates = array (
59
-
60
- array( "name" => $cf7_style_name." Options",
61
- "type" => "title"),
62
-
63
-
64
- array( "name" => "General",
65
- "type" => "section"),
66
- array( "type" => "open"),
67
-
68
- array( "name" => "Xmas templates",
69
- "desc" => "Choose one of the templates",
70
- "id" => $cf7_style."_templates",
71
- "type" => "select",
72
- "options" => array(
73
- 'xmas-classic',
74
- 'xmas-red',
75
- 'xmas-simple'
76
- ),
77
- "std" => "xmas-classic"
78
- ),
79
-
80
- array( "name" => "Label Fonts",
81
- "desc" => "Choose from the following Google fonts",
82
- "id" => $cf7_style."_google_fonts",
83
- "type" => "select",
84
- "options" => array(
85
- 'Emilys Candy',
86
- 'Henny Penny',
87
- 'Joti One',
88
- 'Open Sans:400,300,600,700',
89
- 'Pirata One'
90
- ),
91
- "std" => "Open Sans:400,300,600,700"
92
- ),
93
-
94
- array( "type" => "close")
95
-
96
- );
97
-
98
-
99
-
100
- /**
101
- * Custom Style
102
- */
103
- $custom = array (
104
-
105
- array( "name" => $cf7_style_name." Options",
106
- "type" => "title"),
107
-
108
- array( "name" => "Settings",
109
- "type" => "section"),
110
- array( "type" => "open"),
111
-
112
- array(
113
- "type" => 'generalssetpanel'
114
- ),
115
-
116
- array(
117
- "type" => 'openinggeneraldiv'
118
- ),
119
-
120
- array( "name" => "Form Background",
121
- "desc" => "Choose the background color of the form",
122
- "id" => $cf7_style."_form_bg",
123
- "type" => "color-picker",
124
- "std" => "#fff"
125
- ),
126
-
127
- array( "name" => "Form width",
128
- "desc" => "Form width in pixels",
129
- "id" => $cf7_style."_form_width",
130
- "type" => "number",
131
- "std" => "600"
132
- ),
133
-
134
- array( "name" => "Form border size",
135
- "desc" => "Form border size in pixels",
136
- "id" => $cf7_style."_form_border_size",
137
- "type" => "number",
138
- "std" => "1"
139
- ),
140
-
141
- array( "name" => "Form border type",
142
- "desc" => "Type of the Form border",
143
- "id" => $cf7_style."_form_border_type",
144
- "type" => "simple_select",
145
- "options" => array (
146
- 'none',
147
- 'solid',
148
- 'dotted',
149
- 'double',
150
- 'groove',
151
- 'ridge',
152
- 'inset',
153
- 'outset'
154
- ),
155
- "std" => "solid"
156
- ),
157
-
158
- array( "name" => "Form border color",
159
- "desc" => "Choose the form border color",
160
- "id" => $cf7_style."_form_border_color",
161
- "type" => "color-picker",
162
- "std" => "#ffffff"
163
- ),
164
-
165
- array( "name" => "Form border radius",
166
- "desc" => "Form border radius in pixels",
167
- "id" => $cf7_style."_form_border_radius",
168
- "type" => "number",
169
- "std" => "1"
170
- ),
171
-
172
- array (
173
- "type" => 'closingdiv'
174
- ),
175
-
176
- array(
177
- "type" => 'inputsandlabelspanel'
178
- ),
179
-
180
- array(
181
- "type" => 'openinglabelsandinputsdiv'
182
- ),
183
-
184
- array( "name" => "Input Background",
185
- "desc" => "Choose the background color of the input",
186
- "id" => $cf7_style."_input_bg",
187
- "type" => "color-picker",
188
- "std" => "#f2f2f2"
189
- ),
190
-
191
-
192
-
193
- array( "name" => "Input Text Color",
194
- "desc" => "Choose the color for the input text",
195
- "id" => $cf7_style."_input_text_color",
196
- "type" => "color-picker",
197
- "std" => "#000000"
198
- ),
199
-
200
- array( "name" => "Input Border Color",
201
- "desc" => "Choose a color for the input border",
202
- "id" => $cf7_style."_input_border_color",
203
- "type" => "color-picker",
204
- "std" => "#ffffff"
205
- ),
206
-
207
- array( "name" => "Input Fonts",
208
- "desc" => "Choose from the following Google Fonts",
209
- "id" => $cf7_style."_google_fonts_for_input_text",
210
- "type" => "select_input_font",
211
- "options" => array(
212
- 'Emilys Candy',
213
- 'Henny Penny',
214
- 'Joti One',
215
- 'Open Sans:400,300,600,700',
216
- 'Pirata One'
217
- ),
218
- "std" => "Open Sans:400,300,600,700"
219
-
220
- ),
221
-
222
- array( "name" => "Input font size",
223
- "desc" => "Size of the input fonts in pixels",
224
- "id" => $cf7_style."_input_font_size",
225
- "type" => "number",
226
- "std" => "16"
227
- ),
228
-
229
- array( "name" => "Input border size",
230
- "desc" => "Size of the input border in pixels",
231
- "id" => $cf7_style."_input_border_size",
232
- "type" => "number",
233
- "std" => "1"
234
- ),
235
-
236
- array( "name" => "Input border type",
237
- "desc" => "Type of the input border",
238
- "id" => $cf7_style."_input_border_type",
239
- "type" => "simple_select",
240
- "options" => array (
241
- 'none',
242
- 'solid',
243
- 'dotted',
244
- 'double',
245
- 'groove',
246
- 'ridge',
247
- 'inset',
248
- 'outset'
249
- ),
250
- "std" => "solid"
251
- ),
252
-
253
- array( "name" => "Input border radius",
254
- "desc" => "Border radius in px",
255
- "id" => $cf7_style."_input_border_radius",
256
- "type" => "number",
257
- "std" => "1"
258
- ),
259
-
260
-
261
-
262
- array( "name" => "Input font-style",
263
- "desc" => "Choose from the following font styles",
264
- "id" => $cf7_style."_input_font_style",
265
- "type" => "simple_select",
266
- "options" => array(
267
- 'Bold',
268
- 'Italic',
269
- 'Underline',
270
- 'Normal'
271
- ),
272
- "std" => "Normal"
273
- ),
274
-
275
- array( "name" => "Input width",
276
- "desc" => "Input width in pixels",
277
- "id" => $cf7_style."_input_width",
278
- "type" => "number",
279
- "std" => "100"
280
- ),
281
-
282
- array( "name" => "Input height",
283
- "desc" => "Input height in pixels",
284
- "id" => $cf7_style."_input_height",
285
- "type" => "number",
286
- "std" => "100"
287
- ),
288
-
289
- array( "name" => "Textarea height",
290
- "desc" => "Textarea height in pixels",
291
- "id" => $cf7_style."_textarea_height",
292
- "type" => "number",
293
- "std" => "200"
294
- ),
295
-
296
- array( "name" => "Input padding",
297
- "desc" => "<span class='paddingex' title='Ex 1: 25px 50px 75px 100px;
298
-
299
- top padding is 25px
300
- right padding is 50px
301
- bottom padding is 75px
302
- left padding is 100px
303
-
304
-
305
- Ex 2: 25px 50px 75px;
306
-
307
- top padding is 25px
308
- right and left paddings are 50px
309
- bottom padding is 75px
310
-
311
-
312
- Ex 3: 25px 50px;
313
-
314
- top and bottom paddings are 25px
315
- right and left paddings are 50px
316
-
317
-
318
- Ex 4: 25px;
319
-
320
- all four paddings are 25px
321
-
322
- '>hover here for example</span>",
323
- "id" => $cf7_style."_input_padding",
324
- "type" => "numbernopxneeded",
325
- "std" => "0"
326
- ),
327
-
328
- array( "name" => "Input margin",
329
- "desc" => "<span class='paddingex' title='Ex 1: 25px 50px 75px 100px;
330
-
331
- top margin is 25px
332
- right margin is 50px
333
- bottom margin is 75px
334
- left margin is 100px
335
-
336
-
337
- Ex 2: 25px 50px 75px;
338
-
339
- top margin is 25px
340
- right and left margin are 50px
341
- bottom margin is 75px
342
-
343
-
344
- Ex 3: 25px 50px;
345
-
346
- top and bottom margin are 25px
347
- right and left margin are 50px
348
-
349
-
350
- Ex 4: 25px;
351
-
352
- all four margin are 25px
353
-
354
- '>hover here for example</span>",
355
- "id" => $cf7_style."_input_margin",
356
- "type" => "numbernopxneeded",
357
- "std" => "0"
358
- ),
359
-
360
- array( "name" => "Label font-style",
361
- "desc" => "Choose from the following font styles",
362
- "id" => $cf7_style."_label_font_style",
363
- "type" => "simple_select",
364
- "options" => array(
365
- 'Bold',
366
- 'Italic',
367
- 'Underline',
368
- 'Normal'
369
- ),
370
- "std" => "Normal"
371
- ),
372
-
373
- array( "name" => "Label font size",
374
- "desc" => "Size of the label fonts in pixels",
375
- "id" => $cf7_style."_font_size",
376
- "type" => "number",
377
- "std" => "16"
378
- ),
379
-
380
- array( "name" => "Label Color",
381
- "desc" => "Choose the color for the label text",
382
- "id" => $cf7_style."_label_color",
383
- "type" => "color-picker",
384
- "std" => "#000000"
385
- ),
386
-
387
- array( "name" => "Label Fonts",
388
- "desc" => "Choose from the following Google fonts",
389
- "id" => $cf7_style."_google_fonts",
390
- "type" => "select",
391
- "options" => array(
392
- 'Emilys Candy',
393
- 'Henny Penny',
394
- 'Joti One',
395
- 'Open Sans:400,300,600,700',
396
- 'Pirata One'
397
- ),
398
- "std" => "Open Sans:400,300,600,700"
399
- ),
400
-
401
- array (
402
- "type" => 'closingdiv'
403
- ),
404
-
405
- array (
406
- "type" => 'openingsubmitbuttondivpanel'
407
- ),
408
-
409
- array (
410
- "type" => 'openingsubmitbuttondiv'
411
- ),
412
-
413
- array( "name" => "Submit button width",
414
- "desc" => "Submit button width in px",
415
- "id" => $cf7_style."_submit_button_width",
416
- "type" => "number",
417
- "std" => "100"
418
- ),
419
-
420
- array( "name" => "Submit button height",
421
- "desc" => "Submit button height in px",
422
- "id" => $cf7_style."_submit_button_height",
423
- "type" => "number",
424
- "std" => "100"
425
- ),
426
-
427
- array( "name" => "Submit button border radius",
428
- "desc" => "Border radius in px",
429
- "id" => $cf7_style."_submit_border_radius",
430
- "type" => "number",
431
- "std" => "1"
432
- ),
433
-
434
- array( "name" => "Submit button font size",
435
- "desc" => "The size of the submit button font in px",
436
- "id" => $cf7_style."_submit_font_size",
437
- "type" => "number",
438
- "std" => "16"
439
- ),
440
-
441
- array( "name" => "Submit button border size",
442
- "desc" => "Size of the submit button border in pixels",
443
- "id" => $cf7_style."_submit_border_size",
444
- "type" => "number",
445
- "std" => "1"
446
- ),
447
-
448
- array( "name" => "Submit button border type",
449
- "desc" => "Type of the submit button border",
450
- "id" => $cf7_style."_submit_border_type",
451
- "type" => "simple_select",
452
- "options" => array (
453
- 'none',
454
- 'solid',
455
- 'dotted',
456
- 'double',
457
- 'groove',
458
- 'ridge',
459
- 'inset',
460
- 'outset'
461
- ),
462
- "std" => "solid"
463
- ),
464
-
465
- array( "name" => "Submit button border color",
466
- "desc" => "Choose a color for the submit border",
467
- "id" => $cf7_style."_submit_border_color",
468
- "type" => "color-picker",
469
- "std" => "#ffffff"
470
- ),
471
-
472
- array( "name" => "Submit button background color",
473
- "desc" => "Choose a color for the submit background",
474
- "id" => $cf7_style."_submit_background_color",
475
- "type" => "color-picker",
476
- "std" => "#ffffff"
477
- ),
478
-
479
- array (
480
- "type" => 'closingdiv'
481
- ),
482
-
483
- array( "type" => "close")
484
-
485
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cf7-style-settings.php DELETED
@@ -1,594 +0,0 @@
1
- <?php
2
- /**
3
- * Contact Form 7 Style
4
- *
5
- * Settings
6
- */
7
- include_once( 'cf7-style-options.php' );
8
- include_once( 'cf7-style-functions.php' );
9
-
10
-
11
- /**
12
- * Contact Style
13
- *
14
- * Displays the settings pages in the admin area
15
- * and saves the options
16
- */
17
- function cf7_style_add_admin() {
18
-
19
- global $cf7_style_name, $cf7_style, $templates, $valentines, $custom;
20
-
21
- /**
22
- * Save Settings
23
- *
24
- * Update or delete options for
25
- * Valentine's Day, Xmas Style and Custom Style
26
- */
27
- function cf7_style_save_settings( $action, $name, $file ) {
28
-
29
- global $cf7_style_name, $cf7_style, $templates, $valentines, $custom;
30
-
31
- if( $file === true ) {
32
- $path = basename(__FILE__);
33
- }else {
34
- $path = "cf7-style-" . $name . ".php";
35
- }
36
-
37
- if ( isset( $_GET['page'] ) && $_GET['page'] == $path ) {
38
-
39
- if ( isset( $_POST[$action] ) && 'save' == $_POST[$action] ) {
40
- header( "Location: admin.php?page=cf7-style-". $name .".php&saved=true" );
41
- foreach ( ${$action} as $value ) {
42
- if( isset( $_POST[ $value['id'] ] ) ) { update_option( $value['id'], $_POST[ $value['id'] ] ); } else { delete_option( $value['id'] ); }
43
- }
44
- exit;
45
- }
46
- else if( isset( $_POST[$action] ) && 'reset' == $_POST[$action] ) {
47
- header( "Location: admin.php?page=cf7-style-". $name .".php&reset=true" );
48
- foreach ( ${$action} as $value ) {
49
- delete_option( $value['id'] );
50
- }
51
- exit;
52
- }
53
- }
54
- }
55
-
56
- /**
57
- * Add submenu page
58
- *
59
- * Display submenu pages for
60
- * Xmas Style and Custom Style
61
- */
62
- function cf7_style_add_submenu_page( $name, $template ) {
63
- add_submenu_page(
64
- basename(__FILE__),
65
- $name,
66
- $name,
67
- 'administrator',
68
- 'cf7-style-'. $template .'.php',
69
- 'cf7_style_'. $template
70
- );
71
- }
72
-
73
- cf7_style_save_settings( 'valentines', 'settings', true );
74
- cf7_style_save_settings( 'templates', 'menu', false );
75
- cf7_style_save_settings( 'custom', 'custom', false );
76
-
77
- add_menu_page(
78
- basename(__FILE__),
79
- 'Valentine\'s Day',
80
- 'administrator',
81
- 'cf7-style-settings.php',
82
- 'cf7_style_valentines',
83
- '',
84
- '28.555'
85
- );
86
-
87
- // Add "Xmas Style" and "Custom Style" submenu pages
88
- cf7_style_add_submenu_page( 'Xmas Style', 'menu' );
89
- cf7_style_add_submenu_page( 'Custom Style', 'custom' );
90
- }
91
-
92
- /**
93
- * Xmas Style
94
- *
95
- * Displays fields for the Xmas Style area of the admin area
96
- */
97
- function cf7_style_menu() {
98
-
99
- global $cf7_style_name, $cf7_style, $templates;
100
- $i=0;
101
-
102
- cf7_style_admin_notices();
103
- ?>
104
- <div class="wrap cf7_style_admin">
105
- <div id="icon-themes" class="icon32"></div>
106
- <h2>Xmas Style</h2>
107
-
108
- <div class="cf7_style_opts">
109
- <form method="post">
110
-
111
- <?php foreach ( $templates as $value ) {
112
- switch ( $value['type'] ) {
113
-
114
- case "open":
115
-
116
- break;
117
- case "close":
118
- ?>
119
-
120
- </div>
121
- </div>
122
- <?php
123
- break;
124
- case "title":
125
- ?>
126
-
127
- <p>To easily set up <?php echo $cf7_style_name; ?> addon, you can use the menu below.</p>
128
-
129
- <?php
130
- break;
131
- case "text":
132
- ?>
133
-
134
- <div class="cf7_style_input cf7_style_text">
135
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
136
- <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?>" />
137
- <small><?php echo $value['desc']; ?></small>
138
- <div class="clearfix"></div>
139
- </div>
140
-
141
- <?php
142
- break;
143
- case "textarea":
144
- ?>
145
-
146
- <div class="cf7_style_input cf7_style_textarea">
147
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
148
- <textarea name="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?></textarea>
149
- <small><?php echo $value['desc']; ?></small>
150
- <div class="clearfix"></div>
151
- </div>
152
-
153
- <?php
154
- break;
155
- case "select":
156
- ?>
157
-
158
- <div class="cf7_style_input cf7_style_select">
159
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
160
- <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
161
- <?php foreach ( $value['options'] as $option ) { ?>
162
- <option class="font-load" <?php if (get_option( $value['id'] ) == $option) { echo 'selected="selected"'; } ?> value="<?php echo $option; ?>"><?php echo $option; ?></option><?php } ?>
163
- </select>
164
-
165
- <small><?php echo $value['desc']; ?></small>
166
- <div class="clearfix"></div>
167
-
168
- <small class="preview">Preview</small>
169
- <div id="font-viewer" class="font-viewer3">
170
- <div class="style-select"></div>
171
- <p class="wpcf7">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
172
- </div>
173
- </div>
174
-
175
- <?php
176
- break;
177
- case "section":
178
-
179
- $i++;
180
- ?>
181
-
182
- <div class="cf7_style_section">
183
- <div class="cf7_style_title">
184
- <h3><?php echo $value['name']; ?></h3>
185
- <div class="clearfix"></div>
186
- </div>
187
- <div class="cf7_style_options">
188
- <ul class="cf7_style_templates">
189
- <li class="selected">
190
- <img src="<?php echo plugin_dir_url( __FILE__ ) . 'admin/images/cf7_xmas_classic.jpg'; ?>" />
191
- <span>Xmas Classic</span>
192
- </li>
193
- <li>
194
- <img src="<?php echo plugin_dir_url( __FILE__ ) . 'admin/images/cf7_xmas_red.jpg'; ?>" />
195
- <span>Xmas Red</span>
196
- </li>
197
- <li>
198
- <img src="<?php echo plugin_dir_url( __FILE__ ) . 'admin/images/cf7_xmas_simple.jpg'; ?>" />
199
- <span>Xmas Simple</span>
200
- </li>
201
- </ul>
202
-
203
- <?php
204
- break;
205
- }
206
- }
207
- ?>
208
- <p class="submit">
209
- <input name="save<?php echo $i; ?>" type="submit" value="Save changes" class="button-primary" />
210
- <input type="hidden" name="templates" value="save" />
211
- </p>
212
- </form>
213
-
214
- <form method="post">
215
- <p class="reset">
216
- <input name="reset" type="submit" value="Reset to default" class="button-secondary" />
217
- <input type="hidden" name="templates" value="reset" />
218
- </p>
219
- </form>
220
-
221
- </div>
222
- </div>
223
- <div id="about-section" class="cf7_style_section">
224
- <?php include_once( 'cf7-style-feed-box.php' );?>
225
- </div>
226
- <?php
227
- }
228
-
229
-
230
- /**
231
- * Valentine's Day Style
232
- *
233
- * Displays fields for the Valentines Style area of the admin area
234
- */
235
- function cf7_style_valentines() {
236
-
237
- global $cf7_style_name, $cf7_style, $valentines;
238
- $i=0;
239
-
240
- cf7_style_admin_notices();
241
- ?>
242
- <div class="wrap cf7_style_admin">
243
- <div id="icon-themes" class="icon32"></div>
244
- <h2>Valentine's Day Style</h2>
245
-
246
- <div class="cf7_style_opts">
247
- <form method="post">
248
-
249
- <?php foreach ( $valentines as $value ) {
250
- switch ( $value['type'] ) {
251
-
252
- case "open":
253
-
254
- break;
255
- case "close":
256
- ?>
257
-
258
- </div>
259
- </div>
260
- <?php
261
- break;
262
- case "title":
263
- ?>
264
-
265
- <p>To easily set up <?php echo $cf7_style_name; ?> addon, you can use the menu below.</p>
266
-
267
- <?php
268
- break;
269
- case "text":
270
- ?>
271
-
272
- <div class="cf7_style_input cf7_style_text">
273
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
274
- <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?>" />
275
- <small><?php echo $value['desc']; ?></small>
276
- <div class="clearfix"></div>
277
- </div>
278
-
279
- <?php
280
- break;
281
- case "textarea":
282
- ?>
283
-
284
- <div class="cf7_style_input cf7_style_textarea">
285
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
286
- <textarea name="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?></textarea>
287
- <small><?php echo $value['desc']; ?></small>
288
- <div class="clearfix"></div>
289
- </div>
290
-
291
- <?php
292
- break;
293
- case "select":
294
- ?>
295
-
296
- <div class="cf7_style_input cf7_style_select">
297
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
298
- <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
299
- <?php foreach ( $value['options'] as $option ) { ?>
300
- <option class="font-load" <?php if (get_option( $value['id'] ) == $option) { echo 'selected="selected"'; } ?> value="<?php echo $option; ?>"><?php echo $option; ?></option><?php } ?>
301
- </select>
302
-
303
- <small><?php echo $value['desc']; ?></small>
304
- <div class="clearfix"></div>
305
-
306
- <small class="preview">Preview</small>
307
- <div id="font-viewer" class="font-viewer3">
308
- <div class="style-select"></div>
309
- <p class="wpcf7">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
310
- </div>
311
- </div>
312
-
313
- <?php
314
- break;
315
- case "section":
316
-
317
- $i++;
318
- ?>
319
-
320
- <div class="cf7_style_section">
321
- <div class="cf7_style_title">
322
- <h3><?php echo $value['name']; ?></h3>
323
- <div class="clearfix"></div>
324
- </div>
325
- <div class="cf7_style_options">
326
- <ul class="cf7_style_templates">
327
- <li class="selected">
328
- <img src="<?php echo plugin_dir_url( __FILE__ ) . 'admin/images/cf7_vday_classic.jpg'; ?>" />
329
- <span>Valentine's Day Classic</span>
330
- </li>
331
- <li>
332
- <img src="<?php echo plugin_dir_url( __FILE__ ) . 'admin/images/cf7_vday_roses.jpg'; ?>" />
333
- <span>Valentine's Day Roses</span>
334
- </li>
335
- <li>
336
- <img src="<?php echo plugin_dir_url( __FILE__ ) . 'admin/images/cf7_vday_birds.jpg'; ?>" />
337
- <span>Valentine's Day Birds</span>
338
- </li>
339
- <li>
340
- <img src="<?php echo plugin_dir_url( __FILE__ ) . 'admin/images/cf7_vday_blue_birds.jpg'; ?>" />
341
- <span>Valentine's Day Blue Birds</span>
342
- </li>
343
- </ul>
344
-
345
- <?php
346
- break;
347
- }
348
- }
349
- ?>
350
- <p class="submit">
351
- <input name="save<?php echo $i; ?>" type="submit" value="Save changes" class="button-primary" />
352
- <input type="hidden" name="valentines" value="save" />
353
- </p>
354
- </form>
355
-
356
- <form method="post">
357
- <p class="reset">
358
- <input name="reset" type="submit" value="Reset to default" class="button-secondary" />
359
- <input type="hidden" name="valentines" value="reset" />
360
- </p>
361
- </form>
362
-
363
- </div>
364
- </div>
365
- <div id="about-section" class="cf7_style_section">
366
- <?php include_once( 'cf7-style-feed-box.php' );?>
367
- </div>
368
- <?php
369
- }
370
-
371
-
372
-
373
-
374
-
375
- /**
376
- * Custom Style
377
- *
378
- * Displays fields for the Custom Style area of the admin area
379
- */
380
- function cf7_style_custom() {
381
- global $cf7_style_name, $cf7_style, $custom;
382
- $i=0;
383
-
384
- cf7_style_admin_notices();
385
- ?>
386
- <div class="wrap cf7_style_custom">
387
- <div class="icon32" id="icon-options-general"></div>
388
- <h2>Custom Style</h2>
389
-
390
- <div class="cf7_style_opts">
391
- <form method="post">
392
- <?php foreach ( $custom as $value ) {
393
- switch ( $value['type'] ) {
394
-
395
- case "open":
396
-
397
- break;
398
- case "close":
399
- ?>
400
- </div>
401
- </div>
402
- <?php
403
- break;
404
- case "title":
405
- ?>
406
- <p>Here you can customize the template selected in the "Xmas Style" area.</p>
407
- <?php
408
- break;
409
- case "color-picker":
410
- ?>
411
-
412
- <div class="cf7_style_input cf7_style_text">
413
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
414
- <input type="text" name="<?php echo $value['id']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes( get_option( $value['id'] ) ); } else { echo $value['std']; } ?>" class="wp-color-picker-field" />
415
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
416
- </div>
417
-
418
- <?php
419
- break;
420
- case "text":
421
- ?>
422
-
423
- <div class="cf7_style_input cf7_style_text">
424
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
425
- <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes( get_option( $value['id'] ) ); } else { echo $value['std']; } ?>" />
426
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
427
- </div>
428
-
429
- <?php
430
- break;
431
- case "number":
432
- ?>
433
-
434
- <div class="cf7_style_input cf7_style_text">
435
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
436
- <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes( get_option( $value['id'] ) ); } else { echo $value['std']; } ?>" /> px
437
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
438
- </div>
439
-
440
- <?php
441
- break;
442
- case "numbernopxneeded":
443
- ?>
444
-
445
- <div class="cf7_style_input cf7_style_text">
446
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
447
- <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="number" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes( get_option( $value['id'] ) ); } else { echo $value['std']; } ?>" />
448
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
449
- </div>
450
-
451
- <?php
452
- break;
453
- case "select":
454
- ?>
455
-
456
- <div class="cf7_style_input cf7_style_select">
457
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
458
- <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
459
- <option>Default</option>
460
- <?php foreach ( $value['options'] as $option ) { ?>
461
- <option class="font-load" <?php if (get_option( $value['id'] ) == $option) { echo 'selected="selected"'; } ?> value="<?php echo $option; ?>"><?php echo $option; ?></option><?php } ?>
462
- </select>
463
- <small><?php echo $value['desc']; ?></small>
464
- <small class="preview">Preview</small>
465
- <div id="font-viewer" class="font-viewer">
466
- <div class="style-select"></div>
467
- <p class="wpcf7">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
468
- </div>
469
- </div>
470
-
471
- <?php
472
- break;
473
- case "simple_select":
474
- ?>
475
-
476
- <div class="cf7_style_input cf7_style_select">
477
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
478
- <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
479
- <option>Default</option>
480
- <?php foreach ( $value['options'] as $option ) { ?>
481
- <option <?php if (get_option( $value['id'] ) == $option) { echo 'selected="selected"'; } ?> value="<?php echo $option; ?>"><?php echo $option; ?></option><?php } ?>
482
- </select>
483
- <small><?php echo $value['desc']; ?></small>
484
- </div>
485
-
486
- <?php
487
- break;
488
- case "select_input_font":
489
- ?>
490
-
491
- <div class="cf7_style_input cf7_style_select">
492
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
493
- <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
494
- <option>Default</option>
495
- <?php foreach ( $value['options'] as $option ) { ?>
496
- <option class="font-load2" <?php if ( get_option( $value['id'] ) == $option ) { echo 'selected="selected"'; } ?> value="<?php echo $option; ?>"><?php echo $option; ?></option><?php } ?>
497
- </select>
498
- <small><?php echo $value['desc']; ?></small>
499
- <small class="preview">Preview</small>
500
- <div id="font-viewer2" class="font-viewer2">
501
- <div class="style-select2"></div>
502
- <p class="wpcf7-2">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
503
- </div>
504
- </div>
505
-
506
- <?php
507
- break;
508
- case "closingdiv": //only for styling the setting page - START
509
- ?>
510
- </div>
511
- <?php
512
- break;
513
- case "openinginputdiv":
514
- ?>
515
- <div class="inputsection">
516
- <?php
517
- break;
518
- case "openinggeneraldiv":
519
- ?>
520
- <div class="generals">
521
- <?php
522
- break;
523
- case "generalssetpanel":
524
- ?>
525
- <div class="generalssetpanel panel">Generals settings</div>
526
- <?php
527
- break;
528
- case "openingsubmitbuttondivpanel":
529
- ?>
530
- <div class="submitbuttonsetpanel panel">Submit button settings</div>
531
- <?php
532
- break;
533
- case "inputsandlabelspanel":
534
- ?>
535
- <div class="inputsandlabelspanel panel">Inputs and labels settings</div>
536
- <?php
537
- break;
538
- case "openingsubmitbuttondiv":
539
- ?>
540
- <div class="submitbuttonset">
541
- <?php
542
- break;
543
- case "openinglabelsandinputsdiv":
544
- ?>
545
- <div class="labelsandinputsset">
546
- <?php
547
- break;//only for styling the setting page - END//only for styling the setting page - END
548
- case "section":
549
-
550
- $i++;
551
- ?>
552
-
553
- <div class="cf7_style_section">
554
- <div class="cf7_style_title">
555
- <h3><?php echo $value['name']; ?></h3>
556
-
557
- <div class="clearfix"></div>
558
- </div>
559
- <div class="cf7_style_options">
560
- </div>
561
-
562
- <?php
563
- break;
564
- }
565
- }
566
- ?>
567
- <p class="submit">
568
- <input name="save<?php echo $i; ?>" type="submit" value="Save changes" class="button-primary" />
569
- <input type="hidden" name="custom" value="save" />
570
- </p>
571
- </form>
572
-
573
- <form method="post">
574
- <p class="reset">
575
- <input name="reset" type="submit" value="Reset to default" class="button-secondary" />
576
- <input type="hidden" name="custom" value="reset" />
577
- </p>
578
- </form>
579
-
580
- </div>
581
- <?php
582
- }
583
- add_action('admin_menu', 'cf7_style_add_admin');
584
-
585
-
586
- /**
587
- * Change the menu label to Contact Style
588
- */
589
- function cf7_style_change_menu_label() {
590
- global $menu;
591
-
592
- $menu['28.555'][0] = 'Contact Style';
593
- }
594
- add_action( 'admin_menu', 'cf7_style_change_menu_label' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cf7-style.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Contact Form 7 Style
4
  Plugin URI: http://wordpress.reea.net/contact-form-7-style/
5
  Description: Contact form 7 Style
6
- Version: 1.1.1
7
  Author: REEA
8
  Author URI: http://www.reea.net/
9
  License: GPL2
@@ -12,8 +12,149 @@ License: GPL2
12
  /**
13
  * Include the plugin options
14
  */
15
- include_once( 'cf7-style-settings.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Check if Contact Form 7 is activated
19
  */
@@ -32,24 +173,19 @@ function contact_form_7_check() {
32
  $html .= '<p>';
33
  $html .= 'Contact form 7 - Style is an addon. Please install <a href="http://wordpress.org/plugins/contact-form-7/" target="_blank">Contact form 7</a>.';
34
  $html .= '</p>';
35
- $html .= '</div><!-- /.updated -->';
36
-
37
  echo $html;
38
-
39
- }else {
40
  // Get the cf7_style_cookie
41
  $cf7_style_cookie = get_option( 'cf7_style_cookie' );
42
-
43
  if( $cf7_style_cookie != true ) {
44
 
45
  $html = '<div class="updated">';
46
  $html .= '<p>';
47
- $html .= 'Contact Form 7 - Style addon is now activated. Navigate to <a href="' . get_bloginfo( "url" ) . '/wp-admin/admin.php?page=cf7-style-settings.php">Contact Style</a> to get started.';
48
  $html .= '</p>';
49
  $html .= '</div><!-- /.updated -->';
50
-
51
  echo $html;
52
-
53
  update_option( 'cf7_style_cookie', true );
54
  } // end if !$cf7_style_cookie
55
  }
@@ -57,11 +193,192 @@ function contact_form_7_check() {
57
  }
58
  add_action( 'admin_notices', 'contact_form_7_check' );
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
 
61
  /**
62
  * Reset the cf7_style_cookie option
63
  */
64
  function cf7_style_deactivate() {
65
  update_option( 'cf7_style_cookie', false );
 
66
  }
67
  register_deactivation_hook( __FILE__, 'cf7_style_deactivate' );
3
  Plugin Name: Contact Form 7 Style
4
  Plugin URI: http://wordpress.reea.net/contact-form-7-style/
5
  Description: Contact form 7 Style
6
+ Version: 2.0
7
  Author: REEA
8
  Author URI: http://www.reea.net/
9
  License: GPL2
12
  /**
13
  * Include the plugin options
14
  */
15
+ function get_predefined_cf7_style_template_data() {
16
+ return array (
17
+ array (
18
+ 'title' => 'Christmas Classic',
19
+ 'category' => 'christmas style',
20
+ 'image' => '/admin/images/cf7_xmas_classic.jpg'
21
+ ),
22
+ array (
23
+ 'title' => 'Christmas Red',
24
+ 'category' => 'christmas style',
25
+ 'image' => '/admin/images/cf7_xmas_red.jpg',
26
+ ),
27
+ array (
28
+ 'title' => 'Christmas Simple',
29
+ 'category' => 'christmas style',
30
+ 'image' => '/admin/images/cf7_xmas_simple.jpg'
31
+ ),
32
+ array (
33
+ 'title' => "Valentine's Day Classic",
34
+ 'category' => "valentine's day style",
35
+ 'image' => '/admin/images/cf7_vday_classic.jpg'
36
+ ),
37
+ array (
38
+ 'title' => "Valentine's Day Roses",
39
+ 'category' => "valentine's day style",
40
+ 'image' => '/admin/images/cf7_vday_roses.jpg'
41
+ ),
42
+ array (
43
+ 'title' => "Valentine's Day Birds",
44
+ 'category' => "valentine's day style",
45
+ 'image' => '/admin/images/cf7_vday_birds.jpg'
46
+ ),
47
+ array (
48
+ 'title' => "Valentine's Day Blue Birds",
49
+ 'category' => "valentine's day style",
50
+ 'image' => '/admin/images/cf7_vday_blue_birds.jpg'
51
+ )
52
+ );
53
+ }// end of get_predefined_cf7_style_template_data
54
+ function get_cf7style_slug_or_id( $post, $id ) {
55
+ $post_content = ( !empty( $post ) ) ? $post->post_content : "";
56
+ if ( has_shortcode( $post_content, 'contact-form-7' ) ) {
57
+ preg_match('/\[contact-form-7.*id=.(.*).\]/', $post->post_content, $cf7_id );
58
+ $cf7_id = explode( '"', $cf7_id[1] );
59
+ $cf7_style_id = get_post_meta( $cf7_id[0], 'cf7_style_id' );
60
+ if ( isset( $cf7_style_id[0]) ) {
61
+ $cf7_style_data = get_post( $cf7_style_id[0], ARRAY_A );
62
+ return ( $id == "yes" ) ? $cf7_style_id[0] : $cf7_style_data['post_name'];
63
+ }
64
+ } else {
65
+ return false;
66
+ }
67
+ }// end of get_cf7style_slug_or_id
68
+ function count_element_settings( $elements, $checks ){
69
+ $inner = 0;
70
+ $arr = array();
71
+ foreach ( $checks as $index => $check ) {
72
+ $inner = 0;
73
+ foreach ( $elements as $key => $element ) {
74
+ if ( strpos( $key, $check ) === 0 ) {
75
+ $arr[ $index ] = $inner++;
76
+ }
77
+ }
78
+ }
79
+ return $arr;
80
+ }
81
+ function cf7_style_custom_css_generator(){
82
+ global $post;
83
+ $style = "<style class='cf7-style' media='screen' type='text/css'>\n";
84
+ $cf7s_id = get_cf7style_slug_or_id( $post, "yes" );
85
+ $cf7s_slug = get_cf7style_slug_or_id( $post, "no" );
86
+ $custom_cat = get_the_terms( $cf7s_id, "style_category" );
87
+ $custom_cat_name = ( !empty( $custom_cat ) ) ? $custom_cat[ 0 ]->name : "";
88
+ if ( $custom_cat_name == "custom style" ) {
89
+ $cf7s_custom_settings = unserialize( get_post_meta( $cf7s_id, 'cf7_style_custom_styles', true ) );
90
+ $temp = 0;
91
+ $temp_1 = 0;
92
+ $temp_2 = 0;
93
+ $temp_3 = 0;
94
+ $temp_4 = 0;
95
+ $form_set_nr = count_element_settings( $cf7s_custom_settings, array( "form", "input", "label", "submit", "textarea" ) );
96
+ foreach( $cf7s_custom_settings as $setting_key => $setting ){
97
+ $setting_key_part = explode( "-", $setting_key );
98
+ $second_part = ( $setting_key_part[0] != "submit" ) ? $setting_key_part[1] : "";
99
+ $third_part = ( !empty( $setting_key_part[2] ) ) ? ( ( $setting_key_part[0] != "submit" ) ? "-" : "" ) . $setting_key_part[2] : "";
100
+ $fourth_part = ( !empty( $setting_key_part[3] ) && $setting_key_part[0] == "submit" ) ? "-" . $setting_key_part[3] : "";
101
+ $classelem = "cf7-style." . $cf7s_slug;
102
+ switch ( $setting_key_part[ 0 ]) {
103
+ case 'form':
104
+ $startelem = $temp;
105
+ $allelem = $form_set_nr[ 0 ];
106
+ $temp++;
107
+ break;
108
+ case 'input':
109
+ $startelem = $temp_1;
110
+ $allelem = $form_set_nr[ 1 ];
111
+ $classelem .= " input";
112
+ $temp_1++;
113
+ break;
114
+ case 'label':
115
+ $startelem = $temp_2;
116
+ $allelem = $form_set_nr[ 2 ];
117
+ $classelem .= " label,\n.".$classelem." > p";
118
+ $temp_2++;
119
+ break;
120
+ case 'submit':
121
+ $startelem = $temp_3;
122
+ $allelem = $form_set_nr[ 3 ];
123
+ $classelem .= " .wpcf7-submit";
124
+ $temp_3++;
125
+ break;
126
+ case 'textarea':
127
+ $startelem = $temp_4;
128
+ $allelem = 1;
129
+ $classelem .= " textarea";
130
+ $temp_4++;
131
+ break;
132
+ default:
133
+ # code...
134
+ break;
135
+ }
136
+ $style .= ( $startelem == 0 ) ? "." . $classelem . " {\n" : "";
137
+ $style .= ( !empty( $setting ) && $setting != "Default" ) ? "\t" . $second_part . $third_part . $fourth_part . ": ". ( ( !is_numeric( $setting ) ) ? $setting : $setting . "px" ) . ";\n" : "";
138
+ $style .= ( $startelem == $allelem || $allelem == 1 ) ? "}\n" : "";
139
+ }
140
+ }
141
+ $style .= '.cf7-style.' . $cf7s_slug . "{\n\t font-family: '" . return_font_name( $post->ID ) . "',sans-serif;\n} ";
142
+ //$style = $cf7s_custom_settings;
143
+ $style .= "</style>";
144
+ echo $style;
145
+ }// end of cf7_style_custom_css_generator
146
 
147
+ //include_once( 'cf7-style-settings.php' );
148
+ function cf7_style_admin_scripts(){
149
+ wp_enqueue_style( 'wp-color-picker' );
150
+ wp_enqueue_style( "cf7-style-admin-style", plugin_dir_url( __FILE__ ) . "admin/css/admin.css", false, "1.0", "all");
151
+ wp_enqueue_script( "cf7_style_admin_js", plugin_dir_url( __FILE__ ) . "admin/js/admin.js", array( 'wp-color-picker' ), false, true );
152
+ }
153
+ function cf7_style_add_class( $class ){
154
+ global $post;
155
+ $class .= " cf7-style ".get_cf7style_slug_or_id( $post, "no" );
156
+ return $class;
157
+ }// end of cf7_style_add_class
158
  /**
159
  * Check if Contact Form 7 is activated
160
  */
173
  $html .= '<p>';
174
  $html .= 'Contact form 7 - Style is an addon. Please install <a href="http://wordpress.org/plugins/contact-form-7/" target="_blank">Contact form 7</a>.';
175
  $html .= '</p>';
176
+ $html .= '</div><!-- /.updated -->';
 
177
  echo $html;
178
+ } else {
 
179
  // Get the cf7_style_cookie
180
  $cf7_style_cookie = get_option( 'cf7_style_cookie' );
 
181
  if( $cf7_style_cookie != true ) {
182
 
183
  $html = '<div class="updated">';
184
  $html .= '<p>';
185
+ $html .= 'Contact Form 7 - Style addon is now activated. Navigate to <a href="' . get_bloginfo( "url" ) . '/wp-admin/edit.php?post_type=cf7_style">Contact Style</a> to get started.';
186
  $html .= '</p>';
187
  $html .= '</div><!-- /.updated -->';
 
188
  echo $html;
 
189
  update_option( 'cf7_style_cookie', true );
190
  } // end if !$cf7_style_cookie
191
  }
193
  }
194
  add_action( 'admin_notices', 'contact_form_7_check' );
195
 
196
+ function cf7_style_create_post( $slug, $title, $image) {
197
+ // Initialize the page ID to -1. This indicates no action has been taken.
198
+ $post_id = -1;
199
+ // If the page doesn't already exist, then create it
200
+ if( null == get_page_by_title( $title, "OBJECT", "cf7_style" ) ) {
201
+ // Set the post ID so that we know the post was created successfully
202
+ $post_id = wp_insert_post(
203
+ array(
204
+ 'comment_status' => 'closed',
205
+ 'ping_status' => 'closed',
206
+ 'post_name' => $slug,
207
+ 'post_title' => $title,
208
+ 'post_status' => 'publish',
209
+ 'post_type' => 'cf7_style'
210
+ )
211
+ );
212
+ //if is_wp_error doesn't trigger, then we add the image
213
+ if ( is_wp_error( $post_id ) ) {
214
+ $errors = $post_id->get_error_messages();
215
+ foreach ($errors as $error) {
216
+ echo $error . '<br>';
217
+ }
218
+ } else {
219
+ //wp_set_object_terms( $post_id, $category, 'style_category', false );
220
+ update_post_meta( $post_id, 'cf7_style_image_preview', $image );
221
+ }
222
+ // Otherwise, we'll stop
223
+ } else {
224
+ // Arbitrarily use -2 to indicate that the page with the title already exists
225
+ $post_id = -2;
226
+ } // end if
227
+ } // end cf7_style_create_post
228
+ function cf7_style_add_taxonomy_filters() {
229
+ global $typenow;
230
+ // an array of all the taxonomyies you want to display. Use the taxonomy name or slug
231
+ $taxonomies = array( 'style_category' );
232
+ // must set this to the post type you want the filter(s) displayed on
233
+ if( $typenow == 'cf7_style' ){
234
+ foreach ( $taxonomies as $tax_slug ) {
235
+ $tax_obj = get_taxonomy( $tax_slug );
236
+
237
+ $tax_name = $tax_obj->labels->name;
238
+ $terms = get_terms( $tax_slug );
239
+ if( count( $terms ) > 0 ) {
240
+ echo "<select name='$tax_slug' id='$tax_slug' class='postform'>";
241
+ echo "<option value=''>Show All $tax_name</option>";
242
+ foreach ( $terms as $term ) {
243
+ $resultA = "<option value='".$term->slug."' selected='selected'>".$term->name .' (' . $term->count .')'."</option>";
244
+ $resultB = "<option value='".$term->slug."'>".$term->name .' (' . $term->count .')'."</option>";
245
+ echo ( isset( $_GET[$tax_slug] ) ) ? ( ( $_GET[$tax_slug] == $term->slug ) ? $resultA : $resultB ) : $resultB;
246
+ }
247
+ echo "</select>";
248
+ }
249
+ }
250
+ }
251
+ }// end cf7_style_add_taxonomy_filters
252
+ function cf7_style_set_style_category_on_publish( $ID, $post ) {
253
+ $temporizator = 0;
254
+ foreach ( get_predefined_cf7_style_template_data() as $predefined_post_titles ) {
255
+ if( $post->post_title == $predefined_post_titles[ "title" ] ){
256
+ $temporizator++;
257
+ }
258
+ }
259
+ if( 0 == $temporizator ) {
260
+ wp_set_object_terms( $ID, 'custom style', 'style_category' );
261
+ }
262
+ } // end cf7_style_set_style_category_on_publish
263
+ function cf7_style_create_posts(){
264
+
265
+ foreach ( get_predefined_cf7_style_template_data() as $style ) {
266
+ cf7_style_create_post( strtolower( str_replace( " ", "-", $style['title'] ) ), $style['title'], $style['image'] );
267
+ }
268
+ }
269
+ // Hook into the 'cf7_style_create_posts' action
270
+ register_activation_hook( __FILE__, 'cf7_style_create_posts' );
271
+
272
+ function cf7style_load_elements(){
273
+
274
+ $labels = array(
275
+ 'name' => _x( 'Contact Styles', 'Post Type General Name', 'cf7_style' ),
276
+ 'singular_name' => _x( 'Contact Style', 'Post Type Singular Name', 'cf7_style' ),
277
+ 'menu_name' => __( 'Contact Style', 'cf7_style' ),
278
+ 'parent_item_colon' => __( 'Parent Style:', 'cf7_style' ),
279
+ 'all_items' => __( 'All Styles', 'cf7_style' ),
280
+ 'view_item' => __( 'View Style', 'cf7_style' ),
281
+ 'add_new_item' => __( 'Add New Style', 'cf7_style' ),
282
+ 'add_new' => __( 'Add New', 'cf7_style' ),
283
+ 'edit_item' => __( 'Edit Style', 'cf7_style' ),
284
+ 'update_item' => __( 'Update Style', 'cf7_style' ),
285
+ 'search_items' => __( 'Search Style', 'cf7_style' ),
286
+ 'not_found' => __( 'Not found', 'cf7_style' ),
287
+ 'not_found_in_trash' => __( 'Not found in Trash', 'cf7_style' )
288
+ );
289
+ $args = array(
290
+ 'label' => __( 'cf7_style', 'cf7_style' ),
291
+ 'description' => __( 'Add/remove contact style', 'cf7_style' ),
292
+ 'labels' => $labels,
293
+ 'supports' => array( 'title' ),
294
+ 'hierarchical' => false,
295
+ 'taxonomies' => array('style_category'),
296
+ 'public' => true,
297
+ 'show_ui' => true,
298
+ 'show_in_menu' => true,
299
+ 'show_in_nav_menus' => true,
300
+ 'show_in_admin_bar' => true,
301
+ 'menu_icon' => "dashicons-twitter",
302
+ 'menu_position' => 28.555555,
303
+ 'can_export' => true,
304
+ 'has_archive' => false,
305
+ 'exclude_from_search' => true,
306
+ 'publicly_queryable' => false,
307
+ 'capability_type' => 'page'
308
+ );
309
+ /*register custom post type CF7_STYLE*/
310
+ register_post_type( 'cf7_style', $args );
311
+
312
+ $labels = array(
313
+ 'name' => _x( 'Categories', 'Taxonomy General Name', 'cf7_style' ),
314
+ 'singular_name' => _x( 'Categories', 'Taxonomy Singular Name', 'cf7_style' ),
315
+ 'menu_name' => __( 'Categories', 'cf7_style' ),
316
+ 'all_items' => __( 'All Categories', 'cf7_style' ),
317
+ 'parent_item' => __( 'Parent Categories', 'cf7_style' ),
318
+ 'parent_item_colon' => __( 'Parent Categories:', 'cf7_style' ),
319
+ 'new_item_name' => __( 'New Categories Name', 'cf7_style' ),
320
+ 'add_new_item' => __( 'Add New Categories', 'cf7_style' ),
321
+ 'edit_item' => __( 'Edit Categories', 'cf7_style' ),
322
+ 'update_item' => __( 'Update Categories', 'cf7_style' ),
323
+ 'separate_items_with_commas' => __( 'Separate Categories with commas', 'cf7_style' ),
324
+ 'search_items' => __( 'Search Categories', 'cf7_style' ),
325
+ 'add_or_remove_items' => __( 'Add or remove Categories', 'cf7_style' ),
326
+ 'choose_from_most_used' => __( 'Choose from the most used Categories', 'cf7_style' ),
327
+ 'not_found' => __( 'Not Found', 'cf7_style' ),
328
+ );
329
+ $args = array(
330
+ 'labels' => $labels,
331
+ 'hierarchical' => true,
332
+ 'public' => true,
333
+ 'show_ui' => false,
334
+ 'show_admin_column' => true,
335
+ 'show_in_nav_menus' => true,
336
+ 'show_tagcloud' => true,
337
+ );
338
+ //register tax
339
+ register_taxonomy( 'style_category', array( 'cf7_style' ), $args );
340
+
341
+ if( get_option( 'cf7_style_add_categories', 0 ) == 0 ){
342
+ $cf7_style_args = array(
343
+ 'post_type' => 'cf7_style'
344
+ );
345
+ $cf7_style_query = new WP_Query( $cf7_style_args );
346
+ if ( $cf7_style_query->have_posts() ) {
347
+ while ( $cf7_style_query->have_posts() ) {
348
+ $cf7_style_query->the_post();
349
+ $temp_title = get_the_title();
350
+ $temp_ID = get_the_ID();
351
+
352
+ foreach ( get_predefined_cf7_style_template_data() as $style ) {
353
+ if( $temp_title == wptexturize( $style[ 'title' ] ) ) {
354
+ wp_set_object_terms( $temp_ID, $style[ 'category' ], 'style_category' );
355
+ }
356
+ }
357
+ }
358
+ update_option( 'cf7_style_add_categories', 1 );
359
+ }
360
+ }
361
+ require_once( 'cf7-style-meta-box.php' );
362
+ if ( ! is_admin() ) {
363
+ wp_enqueue_script('jquery');
364
+ wp_enqueue_style( "cf7-style-frontend-style", plugin_dir_url( __FILE__ ) . "css/frontend.css", false, "1.0", "all");
365
+ wp_enqueue_script( "cf7-style-frontend-script", plugin_dir_url( __FILE__ ) . "js/frontend.js", false, "1.0");
366
+ add_action('wp_head', 'cf7_style_custom_css_generator');
367
+ }
368
+ }
369
+
370
+ add_action( 'admin_init', 'cf7_style_admin_scripts' );
371
+ add_action( 'init', 'cf7style_load_elements' );
372
+ add_action( 'restrict_manage_posts', 'cf7_style_add_taxonomy_filters' );
373
+ add_action( 'publish_cf7_style', 'cf7_style_set_style_category_on_publish', 10, 2 );
374
+ add_filter( 'wpcf7_form_class_attr', 'cf7_style_add_class' );
375
 
376
+
377
  /**
378
  * Reset the cf7_style_cookie option
379
  */
380
  function cf7_style_deactivate() {
381
  update_option( 'cf7_style_cookie', false );
382
+ update_option( 'cf7_style_add_categories', 0 );
383
  }
384
  register_deactivation_hook( __FILE__, 'cf7_style_deactivate' );
css/frontend.css CHANGED
@@ -1,6 +1,7 @@
1
  /**
2
  * Table of Contents:
3
  *
 
4
  * 1.0 - Valentine's Day
5
  * 1.1 - Classic
6
  * 1.2 - Roses
@@ -14,18 +15,44 @@
14
  */
15
 
16
 
17
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  /**
19
  * Valentine's Day
20
  *
21
  * 1.1 - Classic
22
  * -----------------------------------------------------------------------------
23
  */
24
- .vday-classic .wpcf7 {
25
  background: url('../images/vday-classic/hearted-bg.png') -45px 0 repeat;
26
  position: relative;
27
  }
28
- .vday-classic .wpcf7 .heart {
29
  position: absolute;
30
  right:0;
31
  background: url('../images/vday-classic/big-heart.png') 0 0 no-repeat;
@@ -33,12 +60,12 @@
33
  height: 135px;
34
  top:-90px;
35
  }
36
- .vday-classic .wpcf7 p {
37
  margin-bottom: 10px;
38
  text-shadow: 1px 1px #FFF;
39
  }
40
- .vday-classic .wpcf7 input,
41
- .vday-classic .wpcf7 textarea {
42
  background: rgba(255,255,255,0.7);
43
  border: none;
44
  border-left: 1px solid #AAA;
@@ -51,7 +78,13 @@
51
  box-shadow: 5px 6px 10px -5px #999999;
52
  margin-top: 3px;
53
  }
54
- .vday-classic .wpcf7 .wpcf7-submit {
 
 
 
 
 
 
55
  -webkit-box-shadow: none;
56
  -moz-box-shadow: none;
57
  box-shadow: none;
@@ -75,10 +108,10 @@
75
  float: right;
76
  text-shadow: 1px 1px #555;
77
  }
78
- .vday-classic .wpcf7 .wpcf7-submit:hover {
79
  background-color: transparent;
80
  }
81
- .vday-classic .wpcf7 .wpcf7-validation-errors {
82
  border: 1px solid #FF0000;
83
  background: rgba(255,255,255,0.7);
84
  }
@@ -91,42 +124,50 @@
91
  * 1.2 - Roses
92
  * -----------------------------------------------------------------------------
93
  */
94
- .vday-roses .wpcf7 {
95
  background: url(../images/vday-rose/rose-bg-50percent.png) 0 0 no-repeat;
96
  position: relative;
97
  min-height:380px;
98
  width: 270px;
99
- padding: 17px 0 0 200px;
 
 
 
100
  }
101
- .vday-roses .wpcf7 form {
102
  clear: both;
103
  }
104
- .vday-roses .wpcf7 input,
105
- .vday-roses .wpcf7 textarea {
106
  background: none;
107
  border: none;
 
108
  }
109
- .vday-roses .wpcf7 input {
110
- border-bottom: 1px solid #490706;
111
  padding-bottom: 2px;
112
  }
113
- .vday-roses .wpcf7 textarea {
 
 
 
 
 
114
  width: 215px;
115
  height: 140px;
116
  resize: none;
117
  padding-top: 0;
118
- line-height: 33px;
119
  }
120
- .vday-roses .wpcf7 p {
121
  margin-bottom: 10px;
122
  }
123
- .vday-roses .wpcf7 .letter-box {
124
  background:#826e50 url(../images/vday-rose/contact-bg.png) 0 0 no-repeat;
125
  width: 285px;
126
- margin: 72px 0 0 -50px;
127
- padding:35px 15px 45px;
128
  }
129
- .vday-roses .wpcf7 .wpcf7-submit {
130
  position: absolute;
131
  bottom: 5px;
132
  right: 20px;
@@ -135,22 +176,23 @@
135
  color: #fff;
136
  box-shadow: none;
137
  }
138
- .vday-roses .wpcf7 .wpcf7-submit:hover {
 
139
  background: #490706;
140
  }
141
- .vday-roses .wpcf7 .wpcf7-validation-errors,
142
- .vday-roses .wpcf7 .wpcf7-mail-sent-ok {
143
  background: none repeat scroll 0 0 rgba(255, 255, 255, 0.6);
144
  border: none;
145
- left: 156px;
146
  position: absolute;
147
- top: 205px;
148
- width: 220px;
149
  }
150
- .vday-roses .wpcf7 .wpcf7-validation-errors {
151
  color: #ff0000;
152
  }
153
- .vday-roses .wpcf7 .wpcf7-mail-sent-ok {
154
  color: green;
155
  }
156
 
@@ -161,60 +203,79 @@
161
  * 1.3 - Birds
162
  * -----------------------------------------------------------------------------
163
  */
164
- .vday-birds .wpcf7 {
165
  position: relative;
166
- width: 486px;
 
167
  }
168
- .vday-birds .wpcf7 form {
169
  background: url('../images/vday-birds/bg-middle.png') 63px 0 repeat-y;
170
- width: 324px;
171
- padding-left: 125px;
172
  }
173
- .vday-birds .wpcf7 .bg-header,
174
- .vday-birds .wpcf7 .bg-bottom {
175
  width: 486px;
176
  }
177
- .vday-birds .wpcf7 .bg-header {
178
  background: url('../images/vday-birds/bg-top.png') 25px 0 no-repeat;
179
  height: 234px;
 
 
 
180
  }
181
- .vday-birds .wpcf7 .bg-bottom {
182
  background: url('../images/vday-birds/bg-bottom.png') 0 0 no-repeat;
 
183
  height: 301px;
 
 
184
  }
185
- .vday-birds .wpcf7 p {
186
  margin: 0;
187
  }
188
- .vday-birds .wpcf7 input,
189
- .vday-birds .wpcf7 textarea {
190
  background: none;
191
- width: 235px;
192
  border: 2px dashed #000;
193
  resize:vertical;
194
  }
195
- .vday-birds .wpcf7 input {
 
 
 
 
 
 
 
 
 
196
  margin-bottom: 5px;
197
  }
198
- .vday-birds .wpcf7 input[type="submit"] {
199
  font-size: 30px;
200
  color: #444;
201
  text-transform: capitalize;
202
  border: none;
203
  box-shadow: none;
 
 
 
204
  }
205
- .vday-birds .wpcf7 input[type="submit"]:hover {
 
206
  background: none;
207
  color: #000;
208
  }
209
- .vday-birds div.wpcf7-response-output {
210
  width: 265px;
211
  margin: 0 0 0 -36px;
212
  border: none;
213
  }
214
- .vday-birds .wpcf7-validation-errors {
215
  color: #ff0000;
216
  }
217
- .vday-birds .wpcf7-mail-sent-ok {
218
  color: green;
219
  }
220
 
@@ -226,24 +287,28 @@
226
  * 1.4 - Blue Birds
227
  * -----------------------------------------------------------------------------
228
  */
229
- .vday-blue-birds .wpcf7 {
230
  position: relative;
231
  background: url("../images/vday-blue-birds/pattern.jpg") repeat;
232
  color: #100804;
233
  }
234
- .vday-blue-birds .header {
235
  background: url("../images/vday-blue-birds/header.png") no-repeat top center;
236
  height: 260px;
237
  width: 100%;
238
  }
239
- .vday-blue-birds .wpcf7 form input,
240
- .vday-blue-birds .wpcf7 form textarea {
241
  width: 290px;
242
  display: inline-block;
243
  background-color: #dad3c2;
244
  border: none;
245
  }
246
- .vday-blue-birds .wpcf7 .wpcf7-submit {
 
 
 
 
247
  background: url("../images/vday-blue-birds/submit.png") no-repeat top right;
248
  height: 50px;
249
  line-height: 50px;
@@ -257,26 +322,26 @@
257
  color: #100804;
258
  box-shadow: none;
259
  }
260
- .vday-blue-birds span.wpcf7-not-valid-tip,
261
- .vday-blue-birds .wpcf7 .wpcf7-submit:hover {
262
  color: #7f2a3a;
263
  }
264
 
265
- .vday-blue-birds .wpcf7 form textarea {
266
  height: 75px;
267
  }
268
- .vday-blue-birds .wpcf7 p {
269
  width: 290px;
270
  margin: 7px auto;
271
  position: relative;
272
  }
273
- .vday-blue-birds .footer {
274
  background: url("../images/vday-blue-birds/footer.png") no-repeat bottom center;
275
  height: 145px;
276
  width: 100%;
277
  }
278
- .vday-blue-birds div.wpcf7-mail-sent-ok,
279
- .vday-blue-birds div.wpcf7-validation-errors {
280
  border: none;
281
  background: rgba( 127, 42, 58, .9 );
282
  position: absolute;
@@ -286,7 +351,7 @@
286
  padding: 10px 20px;
287
  right: 0;
288
  }
289
- .vday-blue-birds div.wpcf7-mail-sent-ok {
290
  background: rgba( 9, 94, 0, .9 );
291
  }
292
 
@@ -298,81 +363,89 @@
298
  * 2.1 - Classic
299
  * -----------------------------------------------------------------------------
300
  */
301
- .xmas-classic .wpcf7 {
302
  position: relative;
303
  }
304
- .xmas-classic .wpcf7 form {
305
  background: url("../images/xmas-classic/bg-repeat.png") repeat-y scroll 1px 1px rgba(0, 0, 0, 0);
306
  display: block;
307
  margin: auto;
308
- overflow: hidden;
309
  text-align: center;
310
- width: 100%;
311
  }
312
- .xmas-classic .header {
313
  background: url("../images/xmas-classic/top_border.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
314
  height: 23px;
315
  width: 100%;
316
  }
317
- .xmas-classic .left {
318
  background: url("../images/xmas-classic/left_part_bg.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
319
- bottom: 255px;
320
  height: 129px;
321
  left: -73px;
322
  position: absolute;
323
  width: 99px;
324
  }
325
- .xmas-classic .wpcf7 p {
326
  color: #482C09;
327
  margin-bottom: 20px;
328
  margin-left: 27px;
329
  width: 350px;
330
  }
331
- .xmas-classic .wpcf7 span {
332
  display: block;
333
  }
334
- .xmas-classic .footer {
335
  background: url("../images/xmas-classic/bottombg.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
336
  bottom: 0;
337
  height: 255px;
338
  margin-left: -70px;
339
- width: 100%;
 
 
340
  }
341
- .xmas-classic .wpcf7 form input,
342
- .xmas-classic .wpcf7 form textarea {
343
  display: inline-block;
344
- *display: inline;
345
- *zoom: 1;
346
  -moz-border-radius:4px;
347
  -webkit-border-radius:4px;
348
  border-radius: 4px;
349
  background-color: #f3eadf;
350
  border: 1px dotted #b2a28e;
351
  }
352
- .xmas-classic .wpcf7 form input {
353
  height: 28px;
354
  padding: 3px 5px;
355
  line-height: 28px;
356
  }
357
- .xmas-classic .wpcf7 .wpcf7-form-control-wrap input,
358
- .xmas-classic .wpcf7 .wpcf7-form-control-wrap textarea {
 
 
 
 
 
359
  display: block;
360
  width: 100%;
361
  }
362
- .xmas-classic .wpcf7 form textarea {
363
  resize: vertical;
364
  margin-bottom: 10px;
365
  }
366
 
367
- .xmas-classic .wpcf7 .wpcf7-submit {
368
  background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
369
  border: medium none;
370
- bottom: 20px;
371
- height: 54px;
372
- left: 30px;
373
  position: absolute;
374
  text-indent: -9999px;
375
  width: 78px;
 
376
  }
377
 
378
 
@@ -383,45 +456,52 @@
383
  * 2.2 - Red
384
  * -----------------------------------------------------------------------------
385
  */
386
- .xmas-red .wpcf7 {
387
- width: 600px;
388
  color: #fff;
389
  font-size: 25px;
390
- }
391
- .xmas-red .wpcf7 form {
392
  width: 600px;
393
  margin: 0 auto;
394
- background: url(../images/xmas-red/middle.png) repeat-y top center;
395
  position: relative;
396
  }
397
- .xmas-red .wpcf7 .header {
 
 
 
398
  display: block;
399
- background: url(../images/xmas-red/header.png) no-repeat 32px top;
400
  width: 600px;
401
  height: 94px;
 
 
402
  }
403
- .xmas-red .wpcf7 .footer {
404
  display: block;
405
- background: url(../images/xmas-red/footer.png) no-repeat top center;
406
  width: 600px;
407
  height: 94px;
408
- margin-top: -10px;
 
409
  }
410
- .xmas-red .wpcf7 p {
411
  width: 370px;
412
  margin: 0 auto;
413
  }
414
- .xmas-red .wpcf7 input,
415
- .xmas-red .wpcf7 textarea {
416
  color: #222;
417
  width: 100%;
418
  font-size: 16px;
419
  }
420
- .xmas-red .wpcf7 textarea {
 
 
 
 
421
  height: 120px;
422
  resize: vertical;
423
  }
424
- .xmas-red .wpcf7 .wpcf7-submit {
425
  display: block;
426
  width: 232px;
427
  height: 126px;
@@ -431,14 +511,15 @@
431
  right: 0;
432
  text-indent: -9999px;
433
  border: none;
 
434
  -webkit-box-shadow: none;
435
  -moz-box-shadow: none;
436
  box-shadow: none;
437
  }
438
- .xmas-red .wpcf7-validation-errors,
439
- .xmas-red .wpcf7-mail-sent-ok,
440
- .xmas-classic .wpcf7-validation-errors,
441
- .xmas-classic .wpcf7-mail-sent-ok{
442
  border: none;
443
  width: 350px;
444
  font-size: 22px;
@@ -446,12 +527,12 @@
446
  margin-left: 25px;
447
  padding: 0;
448
  }
449
- .xmas-red .wpcf7-mail-sent-ok,
450
- .xmas-classic .wpcf7-mail-sent-ok {
451
  color: #73C94E;
452
  }
453
- .xmas-red span.wpcf7-not-valid-tip,
454
- .xmas-classic span.wpcf7-not-valid-tip {
455
  left: 0;
456
  top: 0;
457
  padding: 5px 10px;
@@ -464,21 +545,21 @@
464
  -moz-border-radius: 5px;
465
  border-radius: 5px;
466
  }
467
- .xmas-red span.wpcf7-list-item {
468
  display: inline-block;
469
  height: 32px;
470
  }
471
- .xmas-red .wpcf7-radio .wpcf7-list-item {
472
  background: url(../images/xmas-red/radio.png) no-repeat 0 6px;
473
  }
474
- .xmas-red .wpcf7-radio .wpcf7-list-item.active {
475
  background-position: 0 -27px;
476
  }
477
- .xmas-red .wpcf7-radio .wpcf7-list-item-label {
478
  display: inline-block;
479
  vertical-align: top;
480
  }
481
- .xmas-red span.wpcf7-list-item input[type="radio"] {
482
  width: 30px;
483
  height: 30px;
484
  cursor: pointer;
@@ -508,7 +589,7 @@
508
  border:0;*/
509
 
510
  }
511
- .xmas-red .wpcf7 .wpcf7-response-output {
512
  position: relative;
513
  margin: 0 auto;
514
  }
@@ -518,80 +599,107 @@
518
  /**
519
  * Xmas
520
  *
521
- * 2.3 - Red
522
  * -----------------------------------------------------------------------------
523
  */
524
- .xmas-simple .wpcf7 {
525
- width: 570px;
526
  padding: 50px 20px 15px 20px;
527
  margin-bottom: 20px;
528
  color: #1b0a00;
529
  position: relative;
 
530
 
531
  }
532
- .xmas-simple .wpcf7 form {
533
  width: 425px;
534
  margin: 0 auto;
535
- padding: 20px;
536
  border-left: dashed 2px #542c0e;
537
  border-right: dashed 2px #542c0e;
538
  background: url(../images/xmas-simple/middle.png) repeat-y center top;
539
  }
540
- .xmas-simple .wpcf7 p {
541
- width: 250px;
542
  margin: 15px auto;
543
  }
544
- .xmas-simple .wpcf7 p input[type="text"], .xmas-simple .wpcf7 p input[type="email"], .xmas-simple .wpcf7 p input[type="tel"], .xmas-simple .wpcf7 p textarea {
 
 
 
 
 
 
 
 
 
 
 
545
  width: 100%;
546
  background: transparent;
547
  border: dashed 2px #7d5f48;
548
  }
549
- .xmas-simple .wpcf7 textarea {
550
  height: 110px;
551
  resize: vertical;
552
  }
553
- .xmas-simple .wpcf7 .header,
554
- .xmas-simple .wpcf7 .footer {
555
  width: 425px;
556
- height: 17px;
557
  margin: 0 auto;
558
- padding: 20px 20px 0 20px;
559
  background: url( '../images/xmas-simple/header.png' ) no-repeat center bottom;
560
  border: dashed 2px #542c0e;
561
  border-bottom: none;
 
 
562
  }
563
- .xmas-simple .wpcf7 .footer {
564
- border-top: none;
565
- border-bottom: dashed 2px #542c0e;
566
- background: url( '../images/xmas-simple/footer.png' ) no-repeat center top;
567
- padding-bottom: 10px;
 
568
  }
569
- .xmas-simple .wpcf7 .ribbon {
 
 
 
 
 
 
 
 
 
570
  width: 182px;
571
  height: 202px;
572
  position: absolute;
573
  background: url( '../images/xmas-simple/ribbon.png' ) no-repeat;
574
- top: 0;
575
- right: 0;
576
  }
577
- .xmas-simple div.wpcf7-response-output {
578
- width: 250px;
579
  margin: 0 auto;
580
  border: none;
581
  color: #ee0000;
582
  }
583
- .xmas-simple .wpcf7-submit {
584
  background: #e7e3d0;
585
- color: #1b0a00;
586
  border-top: solid 1px #fff;
587
  font-size: 14px;
588
  padding: 9px 15px;
589
  height: 40px;
590
  -webkit-border-radius: 15px 18px 7px 9px;
591
  -moz-border-radius: 15px 18px 7px 9px;
592
- border-radius: 15px 18px 7px 9px;
593
- -webkit-box-shadow: -3px 3px 9px 1px #999;
594
- box-shadow: -3px 3px 9px 1px #999;
 
 
 
 
 
595
  }
596
 
597
 
@@ -599,19 +707,19 @@
599
  /**
600
  * Fix Error tooltips position
601
  */
602
- .xmas-simple span.wpcf7-not-valid-tip {
603
  top: -4px;
604
  left: 2px;
605
  height: 30px;
606
  line-height: 30px;
607
  padding-left: 9px;
608
- width: 245px;
609
  color: #ee0000;
610
  background: #fff;
611
  border: none;
612
  }
613
  /*Christmas clasic - unique*/
614
- .xmas-classic .wpcf7-not-valid-tip{
615
  width: 100%;
616
  background: transparent;
617
  }
1
  /**
2
  * Table of Contents:
3
  *
4
+ * 0.0 Reset
5
  * 1.0 - Valentine's Day
6
  * 1.1 - Classic
7
  * 1.2 - Roses
15
  */
16
 
17
 
18
+ /**
19
+ * Reset
20
+ *
21
+ * 0.0 - Reset
22
+ * -----------------------------------------------------------------------------
23
+ */
24
+ .cf7-style * {
25
+ -moz-box-sizing: initial;
26
+ -webkit-box-sizing: initial;
27
+ box-sizing: initial;
28
+ }
29
+ .cf7-style input[type="text"],
30
+ .cf7-style input[type="email"],
31
+ .cf7-style input[type="url"],
32
+ .cf7-style input[type="password"],
33
+ .cf7-style input[type="search"],
34
+ .cf7-style textarea {
35
+ padding: 0;
36
+ width: 100%;
37
+ }
38
+ .cf7-style input:focus,
39
+ .cf7-style textarea:focus,
40
+ .cf7-style input[ type="submit" ]:hover,
41
+ .cf7-style textarea {
42
+ background-color: inherit;
43
+ }
44
+
45
  /**
46
  * Valentine's Day
47
  *
48
  * 1.1 - Classic
49
  * -----------------------------------------------------------------------------
50
  */
51
+ .valentines-day-classic {
52
  background: url('../images/vday-classic/hearted-bg.png') -45px 0 repeat;
53
  position: relative;
54
  }
55
+ .valentines-day-classic .heart {
56
  position: absolute;
57
  right:0;
58
  background: url('../images/vday-classic/big-heart.png') 0 0 no-repeat;
60
  height: 135px;
61
  top:-90px;
62
  }
63
+ .valentines-day-classic p {
64
  margin-bottom: 10px;
65
  text-shadow: 1px 1px #FFF;
66
  }
67
+ .valentines-day-classic input,
68
+ .valentines-day-classic textarea {
69
  background: rgba(255,255,255,0.7);
70
  border: none;
71
  border-left: 1px solid #AAA;
78
  box-shadow: 5px 6px 10px -5px #999999;
79
  margin-top: 3px;
80
  }
81
+ .valentines-day-classic input:focus,
82
+ .valentines-day-classic textarea:focus {
83
+ background: rgba(255,255,255,0.7);
84
+ border-left: 1px solid #AAA;
85
+ border-bottom: 1px solid #AAA;
86
+ }
87
+ .valentines-day-classic .wpcf7-submit {
88
  -webkit-box-shadow: none;
89
  -moz-box-shadow: none;
90
  box-shadow: none;
108
  float: right;
109
  text-shadow: 1px 1px #555;
110
  }
111
+ .valentines-day-classic .wpcf7-submit:hover {
112
  background-color: transparent;
113
  }
114
+ .valentines-day-classic .wpcf7-validation-errors {
115
  border: 1px solid #FF0000;
116
  background: rgba(255,255,255,0.7);
117
  }
124
  * 1.2 - Roses
125
  * -----------------------------------------------------------------------------
126
  */
127
+ .valentines-day-roses {
128
  background: url(../images/vday-rose/rose-bg-50percent.png) 0 0 no-repeat;
129
  position: relative;
130
  min-height:380px;
131
  width: 270px;
132
+ padding: 12px 0 0 200px;
133
+ -wekit-box-sizing: initial;
134
+ -moz-box-sizing: initial;
135
+ box-sizing: initial;
136
  }
137
+ .valentines-day-roses {
138
  clear: both;
139
  }
140
+ .valentines-day-roses input,
141
+ .valentines-day-roses textarea {
142
  background: none;
143
  border: none;
144
+
145
  }
146
+ .valentines-day-roses input {
 
147
  padding-bottom: 2px;
148
  }
149
+ .valentines-day-roses input,
150
+ .valentines-day-roses input:hover,
151
+ .valentines-day-roses input:focus {
152
+ border-bottom: 1px solid #490706;
153
+ }
154
+ .valentines-day-roses textarea {
155
  width: 215px;
156
  height: 140px;
157
  resize: none;
158
  padding-top: 0;
159
+ line-height: 32px;
160
  }
161
+ .valentines-day-roses p {
162
  margin-bottom: 10px;
163
  }
164
+ .valentines-day-roses .letter-box {
165
  background:#826e50 url(../images/vday-rose/contact-bg.png) 0 0 no-repeat;
166
  width: 285px;
167
+ margin: 62px 0 0 -50px;
168
+ padding: 35px 15px 45px;
169
  }
170
+ .valentines-day-roses .wpcf7-submit {
171
  position: absolute;
172
  bottom: 5px;
173
  right: 20px;
176
  color: #fff;
177
  box-shadow: none;
178
  }
179
+ .valentines-day-roses input[type="submit"]:hover,
180
+ .valentines-day-roses input[type="submit"]:focus {
181
  background: #490706;
182
  }
183
+ .valentines-day-roses .wpcf7-validation-errors,
184
+ .valentines-day-roses .wpcf7-mail-sent-ok {
185
  background: none repeat scroll 0 0 rgba(255, 255, 255, 0.6);
186
  border: none;
187
+ left: 115px;
188
  position: absolute;
189
+ top: 145px;
190
+ width: 295px;
191
  }
192
+ .valentines-day-roses .wpcf7-validation-errors {
193
  color: #ff0000;
194
  }
195
+ .valentines-day-roses .wpcf7-mail-sent-ok {
196
  color: green;
197
  }
198
 
203
  * 1.3 - Birds
204
  * -----------------------------------------------------------------------------
205
  */
206
+ .valentines-day-birds {
207
  position: relative;
208
+ width: 280px;
209
+ margin: 234px 0 301px 97px;
210
  }
211
+ .valentines-day-birds-container {
212
  background: url('../images/vday-birds/bg-middle.png') 63px 0 repeat-y;
213
+ width: 486px;
214
+ margin: 0 auto;
215
  }
216
+ .valentines-day-birds .bg-header,
217
+ .valentines-day-birds .bg-bottom {
218
  width: 486px;
219
  }
220
+ .valentines-day-birds .bg-header {
221
  background: url('../images/vday-birds/bg-top.png') 25px 0 no-repeat;
222
  height: 234px;
223
+ left: -97px;
224
+ position: absolute;
225
+ top: -234px;
226
  }
227
+ .valentines-day-birds .bg-bottom {
228
  background: url('../images/vday-birds/bg-bottom.png') 0 0 no-repeat;
229
+ bottom: -301px;
230
  height: 301px;
231
+ left: -97px;
232
+ position: absolute;
233
  }
234
+ .valentines-day-birds p {
235
  margin: 0;
236
  }
237
+ .valentines-day-birds input,
238
+ .valentines-day-birds textarea {
239
  background: none;
 
240
  border: 2px dashed #000;
241
  resize:vertical;
242
  }
243
+ .valentines-day-birds textarea {
244
+ height: 120px;
245
+ }
246
+ .valentines-day-birds input:hover,
247
+ .valentines-day-birds textarea:hover,
248
+ .valentines-day-birds input:focus,
249
+ .valentines-day-birds textarea:focus {
250
+ border: 2px dashed #000;
251
+ }
252
+ .valentines-day-birds input {
253
  margin-bottom: 5px;
254
  }
255
+ .valentines-day-birds input[type="submit"] {
256
  font-size: 30px;
257
  color: #444;
258
  text-transform: capitalize;
259
  border: none;
260
  box-shadow: none;
261
+ background: transparent;
262
+ display: block;
263
+ margin: 0 auto;
264
  }
265
+ .valentines-day-birds input[type="submit"]:hover,
266
+ .valentines-day-birds input[type="submit"]:focus {
267
  background: none;
268
  color: #000;
269
  }
270
+ .valentines-day-birds div.wpcf7-response-output {
271
  width: 265px;
272
  margin: 0 0 0 -36px;
273
  border: none;
274
  }
275
+ .valentines-day-birds .wpcf7-validation-errors {
276
  color: #ff0000;
277
  }
278
+ .valentines-day-birds .wpcf7-mail-sent-ok {
279
  color: green;
280
  }
281
 
287
  * 1.4 - Blue Birds
288
  * -----------------------------------------------------------------------------
289
  */
290
+ .valentines-day-blue-birds {
291
  position: relative;
292
  background: url("../images/vday-blue-birds/pattern.jpg") repeat;
293
  color: #100804;
294
  }
295
+ .valentines-day-blue-birds .header {
296
  background: url("../images/vday-blue-birds/header.png") no-repeat top center;
297
  height: 260px;
298
  width: 100%;
299
  }
300
+ .valentines-day-blue-birds input,
301
+ .valentines-day-blue-birds textarea {
302
  width: 290px;
303
  display: inline-block;
304
  background-color: #dad3c2;
305
  border: none;
306
  }
307
+ .valentines-day-blue-birds input:focus,
308
+ .valentines-day-blue-birds textarea:focus {
309
+ background-color: #dad3c2;
310
+ }
311
+ .valentines-day-blue-birds .wpcf7-submit {
312
  background: url("../images/vday-blue-birds/submit.png") no-repeat top right;
313
  height: 50px;
314
  line-height: 50px;
322
  color: #100804;
323
  box-shadow: none;
324
  }
325
+ .valentines-day-blue-birds span.wpcf7-not-valid-tip,
326
+ .valentines-day-blue-birds .wpcf7-submit:hover {
327
  color: #7f2a3a;
328
  }
329
 
330
+ .valentines-day-blue-birds textarea {
331
  height: 75px;
332
  }
333
+ .valentines-day-blue-birds p {
334
  width: 290px;
335
  margin: 7px auto;
336
  position: relative;
337
  }
338
+ .valentines-day-blue-birds .footer {
339
  background: url("../images/vday-blue-birds/footer.png") no-repeat bottom center;
340
  height: 145px;
341
  width: 100%;
342
  }
343
+ .valentines-day-blue-birds div.wpcf7-mail-sent-ok,
344
+ .valentines-day-blue-birds div.wpcf7-validation-errors {
345
  border: none;
346
  background: rgba( 127, 42, 58, .9 );
347
  position: absolute;
351
  padding: 10px 20px;
352
  right: 0;
353
  }
354
+ .valentines-day-blue-birds div.wpcf7-mail-sent-ok {
355
  background: rgba( 9, 94, 0, .9 );
356
  }
357
 
363
  * 2.1 - Classic
364
  * -----------------------------------------------------------------------------
365
  */
366
+ .christmas-classic {
367
  position: relative;
368
  }
369
+ .christmas-classic-container {
370
  background: url("../images/xmas-classic/bg-repeat.png") repeat-y scroll 1px 1px rgba(0, 0, 0, 0);
371
  display: block;
372
  margin: auto;
373
+ margin-bottom: 260px;
374
  text-align: center;
375
+ width: 403px;
376
  }
377
+ .christmas-classic .header {
378
  background: url("../images/xmas-classic/top_border.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
379
  height: 23px;
380
  width: 100%;
381
  }
382
+ .christmas-classic .left {
383
  background: url("../images/xmas-classic/left_part_bg.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
384
+ bottom: 0;
385
  height: 129px;
386
  left: -73px;
387
  position: absolute;
388
  width: 99px;
389
  }
390
+ .christmas-classic p {
391
  color: #482C09;
392
  margin-bottom: 20px;
393
  margin-left: 27px;
394
  width: 350px;
395
  }
396
+ .christmas-classic span {
397
  display: block;
398
  }
399
+ .christmas-classic .footer {
400
  background: url("../images/xmas-classic/bottombg.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
401
  bottom: 0;
402
  height: 255px;
403
  margin-left: -70px;
404
+ width: 474px;
405
+ position: absolute;
406
+ bottom: -255px;
407
  }
408
+ .christmas-classic input,
409
+ .christmas-classic textarea {
410
  display: inline-block;
411
+ *display: inline;
412
+ *zoom: 1;
413
  -moz-border-radius:4px;
414
  -webkit-border-radius:4px;
415
  border-radius: 4px;
416
  background-color: #f3eadf;
417
  border: 1px dotted #b2a28e;
418
  }
419
+ .christmas-classic input {
420
  height: 28px;
421
  padding: 3px 5px;
422
  line-height: 28px;
423
  }
424
+ .christmas-classic input:focus,
425
+ .christmas-classic textarea:focus {
426
+ background-color: #f3eadf;
427
+ border: 1px dotted #b2a28e;
428
+ }
429
+ .christmas-classic .wpcf7-form-control-wrap input,
430
+ .christmas-classic .wpcf7-form-control-wrap textarea {
431
  display: block;
432
  width: 100%;
433
  }
434
+ .christmas-classic form textarea {
435
  resize: vertical;
436
  margin-bottom: 10px;
437
  }
438
 
439
+ .christmas-classic .wpcf7-submit {
440
  background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
441
  border: medium none;
442
+ bottom: -252px;
443
+ height: 70px;
444
+ left: 2px;
445
  position: absolute;
446
  text-indent: -9999px;
447
  width: 78px;
448
+ z-index: 10;
449
  }
450
 
451
 
456
  * 2.2 - Red
457
  * -----------------------------------------------------------------------------
458
  */
459
+ .christmas-red-container {
 
460
  color: #fff;
461
  font-size: 25px;
 
 
462
  width: 600px;
463
  margin: 0 auto;
464
+ background: url( ../images/xmas-red/middle.png ) repeat-y top center;
465
  position: relative;
466
  }
467
+ .christmas-red {
468
+ margin: 94px 0 125px;
469
+ }
470
+ .christmas-red .header {
471
  display: block;
472
+ background: url( ../images/xmas-red/header.png ) no-repeat 32px top;
473
  width: 600px;
474
  height: 94px;
475
+ position: absolute;
476
+ top: -94px;
477
  }
478
+ .christmas-red .footer {
479
  display: block;
480
+ background: url( ../images/xmas-red/footer.png ) no-repeat top center;
481
  width: 600px;
482
  height: 94px;
483
+ bottom: -94px;
484
+ position: absolute;
485
  }
486
+ .christmas-red p {
487
  width: 370px;
488
  margin: 0 auto;
489
  }
490
+ .christmas-red input,
491
+ .christmas-red textarea {
492
  color: #222;
493
  width: 100%;
494
  font-size: 16px;
495
  }
496
+ .christmas-red input:focus,
497
+ .christmas-red textarea:focus {
498
+ background-color: #fff;
499
+ }
500
+ .christmas-red textarea {
501
  height: 120px;
502
  resize: vertical;
503
  }
504
+ .christmas-red .wpcf7-submit {
505
  display: block;
506
  width: 232px;
507
  height: 126px;
511
  right: 0;
512
  text-indent: -9999px;
513
  border: none;
514
+ z-index: 10;
515
  -webkit-box-shadow: none;
516
  -moz-box-shadow: none;
517
  box-shadow: none;
518
  }
519
+ .christmas-red .wpcf7-validation-errors,
520
+ .christmas-red .wpcf7-mail-sent-ok,
521
+ .christmas-classic-validation-errors,
522
+ .christmas-classic-mail-sent-ok{
523
  border: none;
524
  width: 350px;
525
  font-size: 22px;
527
  margin-left: 25px;
528
  padding: 0;
529
  }
530
+ .christmas-red .wpcf7-mail-sent-ok,
531
+ .christmas-classic-mail-sent-ok {
532
  color: #73C94E;
533
  }
534
+ .christmas-red span.wpcf7-not-valid-tip,
535
+ .christmas-classic span.wpcf7-not-valid-tip {
536
  left: 0;
537
  top: 0;
538
  padding: 5px 10px;
545
  -moz-border-radius: 5px;
546
  border-radius: 5px;
547
  }
548
+ .christmas-red span.wpcf7-list-item {
549
  display: inline-block;
550
  height: 32px;
551
  }
552
+ .christmas-red .wpcf7-radio .wpcf7-list-item {
553
  background: url(../images/xmas-red/radio.png) no-repeat 0 6px;
554
  }
555
+ .christmas-red .wpcf7-radio .wpcf7-list-item.active {
556
  background-position: 0 -27px;
557
  }
558
+ .christmas-red .wpcf7-radio .wpcf7-list-item-label {
559
  display: inline-block;
560
  vertical-align: top;
561
  }
562
+ .christmas-red span.wpcf7-list-item input[type="radio"] {
563
  width: 30px;
564
  height: 30px;
565
  cursor: pointer;
589
  border:0;*/
590
 
591
  }
592
+ .christmas-red .wpcf7-response-output {
593
  position: relative;
594
  margin: 0 auto;
595
  }
599
  /**
600
  * Xmas
601
  *
602
+ * 2.3 - Simple
603
  * -----------------------------------------------------------------------------
604
  */
605
+ .christmas-simple {
606
+ width: 410px;
607
  padding: 50px 20px 15px 20px;
608
  margin-bottom: 20px;
609
  color: #1b0a00;
610
  position: relative;
611
+ margin: 35px 0;
612
 
613
  }
614
+ .christmas-simple-container {
615
  width: 425px;
616
  margin: 0 auto;
 
617
  border-left: dashed 2px #542c0e;
618
  border-right: dashed 2px #542c0e;
619
  background: url(../images/xmas-simple/middle.png) repeat-y center top;
620
  }
621
+ .christmas-simple p {
622
+ width: 325px;
623
  margin: 15px auto;
624
  }
625
+ .christmas-simple p input[type="text"],
626
+ .christmas-simple p input[type="email"],
627
+ .christmas-simple p input[type="tel"],
628
+ .christmas-simple p textarea,
629
+ .christmas-simple p input[type="text"]:hover,
630
+ .christmas-simple p input[type="email"]:hover,
631
+ .christmas-simple p input[type="tel"]:hover,
632
+ .christmas-simple p textarea:hover,
633
+ .christmas-simple p input[type="text"]:focus,
634
+ .christmas-simple p input[type="email"]:focus,
635
+ .christmas-simple p input[type="tel"]:focus,
636
+ .christmas-simple p textarea:focus {
637
  width: 100%;
638
  background: transparent;
639
  border: dashed 2px #7d5f48;
640
  }
641
+ .christmas-simple textarea {
642
  height: 110px;
643
  resize: vertical;
644
  }
645
+ .christmas-simple .header,
646
+ .christmas-simple .footer {
647
  width: 425px;
648
+ height: 35px;
649
  margin: 0 auto;
 
650
  background: url( '../images/xmas-simple/header.png' ) no-repeat center bottom;
651
  border: dashed 2px #542c0e;
652
  border-bottom: none;
653
+ position: absolute;
654
+ left: -2px;
655
  }
656
+ .christmas-simple .header {
657
+ background-position: 1px 1px;
658
+ border-radius: 12px 12px 0 0;
659
+ left: -2px;
660
+ top: -35px;
661
+ width: 421px;
662
  }
663
+ .christmas-simple .footer {
664
+ background: url( '../images/xmas-simple/footer.png' ) no-repeat center top;
665
+ border-bottom: 2px dashed #542c0e;
666
+ border-radius: 0 0 20px 20px;
667
+ border-top: medium none;
668
+ bottom: -40px;
669
+ padding-bottom: 3px;
670
+ width: 421px;
671
+ }
672
+ .christmas-simple .ribbon {
673
  width: 182px;
674
  height: 202px;
675
  position: absolute;
676
  background: url( '../images/xmas-simple/ribbon.png' ) no-repeat;
677
+ right: -118px;
678
+ top: -85px;
679
  }
680
+ .christmas-simple div.wpcf7-response-output {
681
+ width: 360px;
682
  margin: 0 auto;
683
  border: none;
684
  color: #ee0000;
685
  }
686
+ .christmas-simple .wpcf7-submit {
687
  background: #e7e3d0;
688
+ color: #555;
689
  border-top: solid 1px #fff;
690
  font-size: 14px;
691
  padding: 9px 15px;
692
  height: 40px;
693
  -webkit-border-radius: 15px 18px 7px 9px;
694
  -moz-border-radius: 15px 18px 7px 9px;
695
+ border-radius: 15px 18px 7px 9px;
696
+ -webkit-box-shadow: -3px 3px 9px 1px #999;
697
+ box-shadow: -3px 3px 9px 1px #999;
698
+ }
699
+ .christmas-simple input[type='submit']:hover {
700
+ border-top: solid 1px #fff;
701
+ background: #e7e3d0;
702
+ color: #000;
703
  }
704
 
705
 
707
  /**
708
  * Fix Error tooltips position
709
  */
710
+ .christmas-simple span.wpcf7-not-valid-tip {
711
  top: -4px;
712
  left: 2px;
713
  height: 30px;
714
  line-height: 30px;
715
  padding-left: 9px;
716
+ width: 335px;
717
  color: #ee0000;
718
  background: #fff;
719
  border: none;
720
  }
721
  /*Christmas clasic - unique*/
722
+ .christmas-classic .wpcf7-not-valid-tip{
723
  width: 100%;
724
  background: transparent;
725
  }
images/default_form.jpg ADDED
Binary file
js/frontend.js CHANGED
@@ -2,36 +2,43 @@
2
  jQuery functions for the Front end area
3
  */
4
  jQuery(document).ready( function( $ ) {
5
-
6
  // Valentine's Day Classic
7
- $(".vday-classic .wpcf7").prepend("<div class='heart'></div>");
8
 
9
  //valentine's Day Rose
10
- $(".vday-roses .wpcf7 form").append("<div class='letter-box'></div>").find("input[type='text'], input[type='password'], input[type='email']").parent().parent().appendTo($(".letter-box"));
 
 
 
11
 
12
  //valentine's Day Birds
13
- $('.vday-birds .wpcf7').prepend("<div class='bg-header'></div>").append("<div class='bg-bottom'></div>");
 
14
 
15
  // Valentine's Day Blue Birds
16
- $('.vday-blue-birds .wpcf7').prepend('<div class="header"></div>').append('<div class="footer"></div>');
17
 
18
 
19
  // Xmas Classic
20
- $('.xmas-classic .wpcf7').prepend('<div class="header"></div><div class="left"></div>').append('<div class="footer"></div>');
 
21
 
22
  // Xmas Red
23
- $('.xmas-red .wpcf7').prepend('<div class="header"></div><div class="left"></div>').append('<div class="footer"></div>');
24
- $('.xmas-red .wpcf7-radio .wpcf7-list-item').first().addClass('active');
25
- $('.xmas-red .wpcf7-radio .wpcf7-list-item input').on( 'click', function() {
26
- $('.xmas-red .wpcf7-radio .wpcf7-list-item').removeClass('active');
 
27
  $(this).parent().addClass('active');
28
  });
29
 
30
- $('.xmas-red .wpcf7-checkbox .wpcf7-list-item input').on( 'click', function() {
31
  $(this).parent().toggleClass('active');
32
  });
33
 
34
  // Xmas Simple
35
- $('.xmas-simple .wpcf7').prepend( '<div class="header"></div><div class="middle"></div><div class="ribbon"></div>' ).append('<div class="footer"></div>');
 
36
 
37
  });
2
  jQuery functions for the Front end area
3
  */
4
  jQuery(document).ready( function( $ ) {
5
+ var vdayRoses = 0;
6
  // Valentine's Day Classic
7
+ $(".valentines-day-classic").prepend("<div class='heart'></div>");
8
 
9
  //valentine's Day Rose
10
+ if( $(".valentines-day-roses").length > 0 ){
11
+ $(".valentines-day-roses").append("<div class='letter-box'></div>").find("input[type='text'], input[type='password'], input[type='email']").parent().parent().appendTo($(".letter-box"));
12
+ }
13
+
14
 
15
  //valentine's Day Birds
16
+ $('.valentines-day-birds').wrap("<div class='valentines-day-birds-container'></div>");
17
+ $('.valentines-day-birds').prepend("<div class='bg-header'></div>").append("<div class='bg-bottom'></div>");
18
 
19
  // Valentine's Day Blue Birds
20
+ $('.valentines-day-blue-birds').prepend('<div class="header"></div>').append('<div class="footer"></div>');
21
 
22
 
23
  // Xmas Classic
24
+ $('.christmas-classic').wrap("<div class='christmas-classic-container'></div>");
25
+ $('.christmas-classic').prepend('<div class="header"></div><div class="left"></div>').append('<div class="footer"></div>');
26
 
27
  // Xmas Red
28
+ $('.christmas-red').wrap("<div class='christmas-red-container'></div>");
29
+ $('.christmas-red').prepend('<div class="header"></div><div class="left"></div>').append('<div class="footer"></div>');
30
+ $('.christmas-red .wpcf7-radio .wpcf7-list-item').first().addClass('active');
31
+ $('.christmas-red .wpcf7-radio .wpcf7-list-item input').on( 'click', function() {
32
+ $('.christmas-red .wpcf7-radio .wpcf7-list-item').removeClass('active');
33
  $(this).parent().addClass('active');
34
  });
35
 
36
+ $('.christmas-red .wpcf7-checkbox .wpcf7-list-item input').on( 'click', function() {
37
  $(this).parent().toggleClass('active');
38
  });
39
 
40
  // Xmas Simple
41
+ $('.christmas-simple').wrap("<div class='christmas-simple-container'></div>");
42
+ $('.christmas-simple').prepend( '<div class="header"></div><div class="middle"></div><div class="ribbon"></div>' ).append('<div class="footer"></div>');
43
 
44
  });
readme.txt CHANGED
@@ -1,27 +1,27 @@
1
  === Contact Form 7 Style ===
2
- Contributors: dorumarginean, ionut.iclanzan, mircear, mlehelsz
3
- Tags: contact form 7, contact form css, contact form style, contact form styling, addon, customize, templates, xmas, Christmas, contact form 7 styling, valentine's day, custom form styling, hearts, rose, birds
 
4
  Requires at least: 3.0.1
5
- Tested up to: 3.8.1
6
  Stable tag: 4.3.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- Simple contact form 7 style addon that has templates that can be customized.
11
 
12
  == Description ==
13
 
14
- This plugin is an addon and requires [Contact Form 7](http://wordpress.org/plugins/contact-form-7/) to be installed on your wordpress blog.
15
- Supports 4 Valentine's Day templates and 3 Christmas templates for now. These templates can be customized:
16
- - custom fonts ( google fonts ),
17
- - color styling,
18
- - background-color,
19
- - border-color,
20
- - fields, text and background color
21
- - form styling
22
- - valentine's day styling
23
- - christmas styling
24
- - custom form styling
25
 
26
 
27
  == Installation ==
@@ -34,9 +34,9 @@ You will find 'Contact Style' menu in your WordPress admin panel.
34
 
35
  == Screenshots ==
36
 
37
- 1. screenshot-1.jpg
38
- 2. screenshot-2.jpg
39
- 3. screenshot-3.jpg
40
 
41
  == Changelog ==
42
 
@@ -52,4 +52,32 @@ You will find 'Contact Style' menu in your WordPress admin panel.
52
  * Added Custom Style submenu for styling the templates
53
 
54
  = 1.1.1 =
55
- * Added plugin update notification in plugin template selection panel
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  === Contact Form 7 Style ===
2
+ Contributors: mlehelsz, dorumarginean, ionut.iclanzan, mircear
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=ionut.iclanzan.reea@gmail.com&item_name=Donation+for+Contact+Form+Style
4
+ Tags: multiple form styling, contact form 7, contact form css, contact form style, contact form styling, addon, customize, templates, xmas, Christmas, contact form 7 styling, valentine's day, custom form styling, hearts, rose, birds
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.1
7
  Stable tag: 4.3.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Simple contact form 7 style addon that has predefined templates or the style can be customized.
12
 
13
  == Description ==
14
 
15
+ This plugin is an addon for [Contact Form 7](http://wordpress.org/plugins/contact-form-7/) which needs to be installed on your wordpress blog.
16
+ Supports 4 Valentine's Day templates and 3 Christmas templates for now.
17
+ Our addon also suports custom styling, where you can easily change the following styling: <BR>
18
+ - custom fonts ( google fonts ), <BR>
19
+ - color styling, <BR>
20
+ - background-color, <BR>
21
+ - border-color, <BR>
22
+ - fields, text and background color, <BR>
23
+ - form styling, <BR>
24
+ - customized style can be imported / exported <BR>
 
25
 
26
 
27
  == Installation ==
34
 
35
  == Screenshots ==
36
 
37
+ 1. The Contact Style main settings page.
38
+ 2. Predefined Contact Style Template Settings page.
39
+ 3. Custom Style Settings page.
40
 
41
  == Changelog ==
42
 
52
  * Added Custom Style submenu for styling the templates
53
 
54
  = 1.1.1 =
55
+ * Added plugin update notification in plugin template selection panel
56
+
57
+ = 2.0 =
58
+ * New UI Admin settings options
59
+ * Use custom post type for individual style set up
60
+ * Multiple cf7 forms can have their own style
61
+ * Style can be activated only for certain cf7 forms
62
+ * All google fonts available for use
63
+ * Styling improvement for theme twentyfifteen, twentyfourteen
64
+ * New settings available
65
+ * Possibility to change certain settings for the "custom style" styles
66
+ * Style filtering by categories for easier use
67
+ * Possibility to save your settings and import / export the generated "custom style"
68
+ * Donate option for support the plugin's continued development and better user support
69
+
70
+ == Upgrade Notice ==
71
+ = Contact Form 7 Style Version 2.0 =
72
+ * New UI Admin settings options
73
+ * Use custom post type for individual style set up
74
+ * Multiple cf7 forms can have their own style
75
+ * Style can be activated only for certain cf7 forms
76
+ * All google fonts available for use
77
+ * Styling improvement for theme twentyfifteen, twentyfourteen
78
+ * New settings available
79
+ * Possibility to change certain settings for the "custom style" styles
80
+ * Style filtering by categories for easier use
81
+ * Possibility to save your settings and import / export the generated "custom style"
82
+ * Donate option for support the plugin's continued development and better user support
83
+
screenshot-1.jpg CHANGED
Binary file
screenshot-2.jpg CHANGED
Binary file
screenshot-3.jpg CHANGED
Binary file