Contact Form 7 Style - Version 1.0.1

Version Description

  • Fixed x-mas classic display on 2014 wordpress theme.
Download this release

Release Info

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

Version 1.0.1

admin/css/admin.css ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Contact Form 7 - Xmas
3
+ Admin styles
4
+ */
5
+
6
+ .cf7_style_admin #icon-themes {
7
+ background: url( '../images/screen-icon.png' ) no-repeat;
8
+ }
9
+
10
+ .cf7_style_admin,
11
+ .cf7_style_custom {
12
+ width: 700px;
13
+ float:left;
14
+ }
15
+
16
+ .cf7_style_admin .submit,
17
+ .cf7_style_custom .submit {
18
+ float: left;
19
+ }
20
+
21
+ .cf7_style_admin .reset,
22
+ .cf7_style_custom .reset {
23
+ float: right;
24
+ margin: 5px 0;
25
+ padding: 1.5em 0;
26
+ }
27
+
28
+ .cf7_style_templates {
29
+ text-align: center;
30
+ }
31
+
32
+ .cf7_style_admin .cf7_style_select:first-child {
33
+ display: none;
34
+ }
35
+
36
+ .cf7_style_templates li {
37
+ display: inline-block;
38
+ margin: 0 10px;
39
+ }
40
+
41
+ .cf7_style_templates span {
42
+ display: block;
43
+ font-weight: 600;
44
+ color: #777;
45
+ }
46
+
47
+ .cf7_style_templates img {
48
+ width: 200px;
49
+ border: solid 1px #eee;
50
+ -webkit-border-radius: 7px;
51
+ -moz-border-radius: 7px;
52
+ border-radius: 7px;
53
+ opacity: 0.35;
54
+ cursor: pointer;
55
+ }
56
+
57
+ .cf7_style_templates li.selected img {
58
+ opacity: 1;
59
+ border: solid 1px #D8D8D8;
60
+ }
61
+
62
+ .cf7_style_templates li.selected span {
63
+ color: #D24C4C;
64
+ }
65
+
66
+ .cf7_style_section{
67
+ border: 1px solid #ddd;
68
+ border-bottom: 0;
69
+ background: #fbfbfb;
70
+ -webkit-border-radius: 7px;
71
+ -moz-border-radius: 7px;
72
+ border-radius: 7px;
73
+ overflow: hidden;
74
+ }
75
+
76
+ .cf7_style_opts label{
77
+ font-size: 12px;
78
+ font-weight: 700;
79
+ width: 200px;
80
+ display: block;
81
+ float: left;
82
+ }
83
+
84
+ .cf7_style_input {
85
+ padding: 30px 10px;
86
+ border-bottom: 1px solid #ddd;
87
+ border-top: 1px solid #fff;
88
+ }
89
+
90
+ .cf7_style_opts small{
91
+ display: block;
92
+ width: 200px;
93
+ color: #999;
94
+ }
95
+
96
+ .cf7_style_opts input[type="text"],
97
+ .cf7_style_opts select{
98
+ width: 280px;
99
+ font-size: 12px;
100
+ padding: 4px;
101
+ color: #333;
102
+ line-height: 1em;
103
+ background: #fff;
104
+ }
105
+
106
+ .cf7_style_input input:focus,
107
+ .cf7_style_input textarea:focus{
108
+ background: #fff;
109
+ }
110
+
111
+ .cf7_style_input textarea{
112
+ width: 280px;
113
+ height: 175px;
114
+ font-size: 12px;
115
+ padding: 4px;
116
+ color: #333;
117
+ line-height: 1.5em;
118
+ background: #f3f3f3;
119
+ }
120
+
121
+ .cf7_style_title h3 {
122
+ font-size: 1em;
123
+ text-transform: uppercase;
124
+ margin: 0;
125
+ font-weight: bold;
126
+ color: #232323;
127
+ float: left;
128
+ padding: 14px 4px 14px 10px;
129
+ }
130
+
131
+ .cf7_style_title{
132
+ border-bottom: 1px solid #ddd;
133
+ background: #f2f2f2;
134
+ padding: 0;
135
+ -webkit-border-radius: 5px 5px 0 0;
136
+ -moz-border-radius: 5px 5px 0 0;
137
+ border-radius: 5px 5px 0 0;
138
+ }
139
+
140
+ .cf7_style_title span.submit{
141
+ display: block;
142
+ margin: 0;
143
+ padding: 0;
144
+ width: 15%;
145
+ padding: 14px 0;
146
+ }
147
+
148
+ .clearfix{
149
+ clear: both;
150
+ }
151
+
152
+ .cf7_style_table th, .cf7_style_table td{
153
+ border: 1px solid #bbb;
154
+ padding: 10px;
155
+ text-align: center;
156
+ }
157
+
158
+ .cf7_style_table th,
159
+ .cf7_style_table td.feature{
160
+ border-color: #888;
161
+ }
162
+
163
+ .cf7_style_section .button-primary {
164
+ margin-left: 5px;
165
+ }
166
+
167
+ .cf7_style_opts input[type="text"].wp-color-picker {
168
+ width: 70px;
169
+ }
170
+
171
+
172
+
173
+ /*Css by Mircea*/
174
+
175
+ #about-section {
176
+ position:relative;
177
+ display:block;
178
+ max-width:30%;
179
+ min-width:30%;
180
+ width:30%;
181
+ float:left;
182
+ margin-top:87px;
183
+ border: 1px solid #ddd;
184
+ border-bottom: 0;
185
+ background: #fbfbfb;
186
+ -webkit-border-radius: 7px;
187
+ -moz-border-radius: 7px;
188
+ border-radius: 7px;
189
+ overflow: hidden;
190
+ }
191
+
192
+ .cf7_style_options {
193
+ clear:both;
194
+ float:left;
195
+ width:100%;
196
+ }
197
+
198
+ #cf7-feedbox h3 {
199
+ min-width:100%;
200
+ background-color:#f2f2f2;
201
+ }
202
+
203
+ .cf7_style_options p {
204
+ padding-left:20px;
205
+ padding-right:20px;
206
+ }
207
+
208
+ .cf7_style_options .cf7_style_select:first-child {
209
+ display: none;
210
+ }
211
+
212
+ #font-viewer {
213
+ margin-top:0px;
214
+ width:90%;
215
+ height:100px;
216
+ background-color:white;
217
+ position:relative;
218
+ display:block;
219
+ margin-left:auto;
220
+ margin-right:auto;
221
+ border:1px solid #C0C0C0;
222
+ overflow:hidden;
223
+ }
224
+
225
+ #font-viewer p {
226
+ padding-left:10px;
227
+ padding-right:10px;
228
+ padding-top:10px;
229
+ padding-bottom:10px;
230
+ font-size:15px;
231
+ }
232
+
233
+ #font-viewer .loading p{
234
+ text-align:center;
235
+
236
+ }
237
+
238
+ small.preview {
239
+ text-align:center;
240
+ float:none;
241
+ width:auto;
242
+ margin-bottom:0px;
243
+ }
244
+
245
+ #font-viewer2 {
246
+ margin-top:0px;
247
+ width:90%;
248
+ height:100px;
249
+ background-color:white;
250
+ position:relative;
251
+ display:block;
252
+ margin-left:auto;
253
+ margin-right:auto;
254
+ border:1px solid #C0C0C0;
255
+ overflow:hidden;
256
+ }
257
+
258
+ #font-viewer2 p {
259
+ padding-left:10px;
260
+ padding-right:10px;
261
+ padding-top:10px;
262
+ padding-bottom:10px;
263
+ font-size:15px;
264
+ }
265
+
266
+ #font-viewer2 .loading p{
267
+ text-align:center;
268
+
269
+ }
270
+
271
+ #border-viewer {
272
+ margin-top:0px;
273
+ width:90%;
274
+ height:100px;
275
+ background-color:white;
276
+ position:relative;
277
+ display:block;
278
+ margin-left:auto;
279
+ margin-right:auto;
280
+ border:1px solid #C0C0C0;
281
+ overflow:hidden;
282
+ }
283
+
284
+ #border-viewer p {
285
+ padding-left:10px;
286
+ padding-right:10px;
287
+ padding-top:10px;
288
+ padding-bottom:10px;
289
+ margin-left:20px;
290
+ margin-right:20px;
291
+ margin-top:20px;
292
+ font-size:15px;
293
+ border:1px solid green;
294
+ }
295
+
296
+ #border-viewer .loading p {
297
+ text-align:center;
298
+
299
+ }
300
+
301
+ .border-select {
302
+ margin-bottom: 50px;
303
+ }
304
+
305
+ @font-face {
306
+ font-family: 'Joti One';
307
+ font-style: normal;
308
+ font-weight: 400;
309
+ src: local('Joti One'), local('JotiOne-Regular'), url(http://themes.googleusercontent.com/static/fonts/jotione/v1/jivCpCi5Y7-IAGZU7bq-pvesZW2xOQ-xsNqO47m55DA.woff) format('woff');
310
+ }
311
+
312
+ @font-face {
313
+ font-family: 'Henny Penny';
314
+ font-style: normal;
315
+ font-weight: 400;
316
+ src: local('Henny Penny'), local('HennyPenny-Regular'), url(http://themes.googleusercontent.com/static/fonts/hennypenny/v1/5KmZ_gfx8tPgQLMk4S-PvobN6UDyHWBl620a-IRfuBk.woff) format('woff');
317
+ }
318
+
319
+ @font-face {
320
+ font-family: 'Emilys Candy';
321
+ font-style: normal;
322
+ font-weight: 400;
323
+ src: local('Emilys Candy'), local('EmilysCandy-Regular'), url(http://themes.googleusercontent.com/static/fonts/emilyscandy/v1/PofLVm6v1SwZGOzC8s-I3Ra1RVmPjeKy21_GQJaLlJI.woff) format('woff');
324
+ }
325
+
326
+ @font-face {
327
+ font-family: 'Pirata One';
328
+ font-style: normal;
329
+ font-weight: 400;
330
+ src: local('Pirata One'), local('PirataOne-Regular'), url(http://themes.googleusercontent.com/static/fonts/pirataone/v1/AFeg8ejJtTM5d0wUfgcmXhsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
331
+ }
admin/images/cf7_xmas_classic.jpg ADDED
Binary file
admin/images/cf7_xmas_red.jpg ADDED
Binary file
admin/images/cf7_xmas_simple.jpg ADDED
Binary file
admin/images/menu-icon.png ADDED
Binary file
admin/images/screen-icon.png ADDED
Binary file
admin/js/admin.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ jQuery functions for the Admin area
3
+ */
4
+ jQuery(document).ready( function( $ ) {
5
+
6
+ // Select a Contact style
7
+ $(".cf7_style_templates li").on( "click", function() {
8
+
9
+ var eq = $(this).index();
10
+
11
+ $('.cf7_style_templates li').removeClass( 'selected' );
12
+ $(this).addClass( 'selected' );
13
+
14
+ $('.cf7_style_select select > option:eq('+ eq +')').attr( 'selected', true );
15
+
16
+ });
17
+
18
+ var xmasIndex = $('#cf7_style_templates option:selected').index();
19
+ $('.cf7_style_templates li').removeClass( 'selected' ).eq( xmasIndex ).addClass( 'selected' );
20
+
21
+ $('.cf7_style_admin .cf7_style_select').first().hide();
22
+ });
23
+
admin/js/ajax.preview.tool.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready( function( $ ) {
2
+
3
+ // Google Font preview for admin area
4
+ function cf7_style_font_preview( select, area ) {
5
+ $.ajaxSetup( { cache: false } );
6
+
7
+ $("."+select).on( "click", function() {
8
+ var opt = $(this).attr( "value" ).split( ":" );
9
+
10
+ $("."+area).css( "font-family", opt[0] );
11
+ return false;
12
+ });
13
+ }
14
+
15
+ cf7_style_font_preview( "font-load", "font-viewer" );
16
+ cf7_style_font_preview( "font-load2", "font-viewer2" );
17
+ cf7_style_font_preview( "font-load", "font-viewer3" );
18
+ });
admin/js/color.picker.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ jQuery(document).ready( function( $ ) {
2
+
3
+ // Define color picker
4
+ $('.wp-color-picker-field').wpColorPicker();
5
+ });
cf7-style-feed-box.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
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
+ <p>As a first release, we developed only the basic settings and only 3 simple and nice designs. For the next updates we are preparing new options, new designs and new cool features for your forms. This plugin will not be just for Christmas, but for every day usage, and with some neat features and designs for holidays like Easter, Christmas, Halloween, etc. :-) In the near future maybe even a Premium version.</p>
7
+ </div>
cf7-style-options.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ // Templates
11
+ $templates = array (
12
+
13
+ array( "name" => $cf7_style_name." Options",
14
+ "type" => "title"),
15
+
16
+
17
+ array( "name" => "General",
18
+ "type" => "section"),
19
+ array( "type" => "open"),
20
+
21
+ array( "name" => "Xmas templates",
22
+ "desc" => "Choose one of the templates",
23
+ "id" => $cf7_style."_templates",
24
+ "type" => "select",
25
+ "options" => array(
26
+ 'xmas-classic',
27
+ 'xmas-red',
28
+ 'xmas-simple'
29
+ ),
30
+ "std" => "xmas-classic"
31
+ ),
32
+
33
+ array( "name" => "Label Fonts",
34
+ "desc" => "Choose from the following Google fonts",
35
+ "id" => $cf7_style."_google_fonts",
36
+ "type" => "select",
37
+ "options" => array(
38
+ 'Emilys Candy',
39
+ 'Henny Penny',
40
+ 'Joti One',
41
+ 'Open Sans:400,300,600,700',
42
+ 'Pirata One'
43
+ ),
44
+ "std" => "Open Sans:400,300,600,700"
45
+ ),
46
+
47
+ array( "type" => "close")
48
+
49
+ );
50
+
51
+ // Custom
52
+ $custom = array (
53
+
54
+ array( "name" => $cf7_style_name." Options",
55
+ "type" => "title"),
56
+
57
+ array( "name" => "Settings",
58
+ "type" => "section"),
59
+ array( "type" => "open"),
60
+
61
+ array( "name" => "Form Background",
62
+ "desc" => "Choose the background color of the form",
63
+ "id" => $cf7_style."_form_bg",
64
+ "type" => "color-picker",
65
+ "std" => "#fff"
66
+ ),
67
+
68
+ array( "name" => "Input Background",
69
+ "desc" => "Choose the background color of the input",
70
+ "id" => $cf7_style."_input_bg",
71
+ "type" => "color-picker",
72
+ "std" => "#f2f2f2"
73
+ ),
74
+
75
+ array( "name" => "Label Color",
76
+ "desc" => "Choose the color for the label text",
77
+ "id" => $cf7_style."_label_color",
78
+ "type" => "color-picker",
79
+ "std" => "#000000"
80
+ ),
81
+
82
+ array( "name" => "Input Text Color",
83
+ "desc" => "Choose the color for the input text",
84
+ "id" => $cf7_style."_input_text_color",
85
+ "type" => "color-picker",
86
+ "std" => "#000000"
87
+ ),
88
+
89
+ array( "name" => "Input Border Color",
90
+ "desc" => "Choose a color for the input border",
91
+ "id" => $cf7_style."_input_border_color",
92
+ "type" => "color-picker",
93
+ "std" => "#ffffff"
94
+ ),
95
+
96
+ array( "name" => "Label Fonts",
97
+ "desc" => "Choose from the following Google fonts",
98
+ "id" => $cf7_style."_google_fonts",
99
+ "type" => "select",
100
+ "options" => array(
101
+ 'Emilys Candy',
102
+ 'Henny Penny',
103
+ 'Joti One',
104
+ 'Open Sans:400,300,600,700',
105
+ 'Pirata One'
106
+ ),
107
+ "std" => "Open Sans:400,300,600,700"
108
+ ),
109
+
110
+ array( "name" => "Input Fonts",
111
+ "desc" => "Choose from the following Google Fonts",
112
+ "id" => $cf7_style."_google_fonts_for_input_text",
113
+ "type" => "select_input_font",
114
+ "options" => array(
115
+ 'Emilys Candy',
116
+ 'Henny Penny',
117
+ 'Joti One',
118
+ 'Open Sans:400,300,600,700',
119
+ 'Pirata One'
120
+ ),
121
+ "std" => "Open Sans:400,300,600,700"
122
+
123
+ ),
124
+
125
+ array( "type" => "close")
126
+
127
+ );
cf7-style-settings.php ADDED
@@ -0,0 +1,608 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contact Form 7 Style
4
+ *
5
+ * Settings
6
+ */
7
+ include_once( 'cf7-style-options.php' );
8
+
9
+ /**
10
+ * Contact Style
11
+ *
12
+ * Displays the settings pages in the admin area
13
+ * and saves the options
14
+ */
15
+ function cf7_style_add_admin() {
16
+
17
+ global $cf7_style_name, $cf7_style, $templates, $custom;
18
+
19
+ if ( isset( $_GET['page'] ) && $_GET['page'] == basename(__FILE__) ) {
20
+
21
+ if ( isset( $_POST['action'] ) && 'save' == $_POST['action'] ) {
22
+ header( "Location: admin.php?page=cf7-style-settings.php&saved=true" );
23
+ foreach ( $templates as $value ) {
24
+ if( isset( $_POST[ $value['id'] ] ) ) { update_option( $value['id'], $_POST[ $value['id'] ] ); } else { delete_option( $value['id'] ); }
25
+ }
26
+ exit;
27
+ }
28
+ else if( isset( $_POST['action'] ) && 'reset' == $_POST['action'] ) {
29
+ header( "Location: admin.php?page=cf7-style-settings.php&reset=true" );
30
+ foreach ( $templates as $value ) {
31
+ delete_option( $value['id'] );
32
+ }
33
+ exit;
34
+ }
35
+ }
36
+
37
+ if ( isset( $_GET['page'] ) && $_GET['page'] == 'cf7-style-custom.php' ) {
38
+
39
+ if ( isset( $_POST['custom'] ) && 'save' == $_POST['custom'] ) {
40
+ header( "Location: admin.php?page=cf7-style-custom.php&saved=true" );
41
+ foreach ( $custom 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['custom'] ) && 'reset' == $_POST['custom'] ) {
47
+ header( "Location: admin.php?page=cf7-style-custom.php&reset=true" );
48
+ foreach ( $custom as $value ) {
49
+ delete_option( $value['id'] );
50
+ }
51
+ exit;
52
+ }
53
+ }
54
+
55
+ add_menu_page(
56
+ $cf7_style_name,
57
+ 'Xmas Style',
58
+ 'administrator',
59
+ basename(__FILE__),
60
+ 'cf7_style_menu',
61
+ '',
62
+ 28.666
63
+ );
64
+
65
+ add_submenu_page(
66
+ basename(__FILE__),
67
+ 'Custom Style',
68
+ 'Custom Style',
69
+ 'administrator',
70
+ 'cf7-style-custom.php',
71
+ 'cf7_style_custom'
72
+ );
73
+ }
74
+
75
+ /**
76
+ * Xmas Style
77
+ *
78
+ * Displays fields for the Xmas Style area of the admin area
79
+ */
80
+ function cf7_style_menu() {
81
+
82
+ global $cf7_style_name, $cf7_style, $templates;
83
+ $i=0;
84
+
85
+ if ( isset( $_GET['saved'] ) ) echo '<div id="message" class="updated fade"><p><strong>' . $cf7_style_name . ' settings saved.</strong></p></div>';
86
+ if ( isset( $_GET['reset'] ) ) echo '<div id="message" class="updated fade"><p><strong>' . $cf7_style_name . ' settings reset.</strong></p></div>';
87
+ ?>
88
+ <div class="wrap cf7_style_admin">
89
+ <div id="icon-themes" class="icon32"></div>
90
+ <h2>Xmas Style</h2>
91
+
92
+ <div class="cf7_style_opts">
93
+ <form method="post">
94
+
95
+ <?php foreach ( $templates as $value ) {
96
+ switch ( $value['type'] ) {
97
+
98
+ case "open":
99
+
100
+ break;
101
+ case "close":
102
+ ?>
103
+
104
+ </div>
105
+ </div>
106
+ <?php
107
+ break;
108
+ case "title":
109
+ ?>
110
+
111
+ <p>To easily set up <?php echo $cf7_style_name; ?> addon, you can use the menu below.</p>
112
+
113
+ <?php
114
+ break;
115
+ case "text":
116
+ ?>
117
+
118
+ <div class="cf7_style_input cf7_style_text">
119
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
120
+ <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']; } ?>" />
121
+ <small><?php echo $value['desc']; ?></small>
122
+ <div class="clearfix"></div>
123
+ </div>
124
+
125
+ <?php
126
+ break;
127
+ case "textarea":
128
+ ?>
129
+
130
+ <div class="cf7_style_input cf7_style_textarea">
131
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
132
+ <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>
133
+ <small><?php echo $value['desc']; ?></small>
134
+ <div class="clearfix"></div>
135
+ </div>
136
+
137
+ <?php
138
+ break;
139
+ case "select":
140
+ ?>
141
+
142
+ <div class="cf7_style_input cf7_style_select">
143
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
144
+ <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
145
+ <?php foreach ( $value['options'] as $option ) { ?>
146
+ <option class="font-load" <?php if (get_option( $value['id'] ) == $option) { echo 'selected="selected"'; } ?> value="<?php echo $option; ?>"><?php echo $option; ?></option><?php } ?>
147
+ </select>
148
+
149
+ <small><?php echo $value['desc']; ?></small>
150
+ <div class="clearfix"></div>
151
+
152
+ <small class="preview">Preview</small>
153
+ <div id="font-viewer" class="font-viewer3">
154
+ <div class="style-select"></div>
155
+ <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>
156
+ </div>
157
+ </div>
158
+
159
+ <?php
160
+ break;
161
+ case "section":
162
+
163
+ $i++;
164
+ ?>
165
+
166
+ <div class="cf7_style_section">
167
+ <div class="cf7_style_title">
168
+ <h3><?php echo $value['name']; ?></h3>
169
+ <div class="clearfix"></div>
170
+ </div>
171
+ <div class="cf7_style_options">
172
+ <ul class="cf7_style_templates">
173
+ <li class="selected">
174
+ <img src="<?php echo plugin_dir_url( __FILE__ ) . '/admin/images/cf7_xmas_classic.jpg'; ?>" />
175
+ <span>Xmas Classic</span>
176
+ </li>
177
+ <li>
178
+ <img src="<?php echo plugin_dir_url( __FILE__ ) . '/admin/images/cf7_xmas_red.jpg'; ?>" />
179
+ <span>Xmas Red</span>
180
+ </li>
181
+ <li>
182
+ <img src="<?php echo plugin_dir_url( __FILE__ ) . '/admin/images/cf7_xmas_simple.jpg'; ?>" />
183
+ <span>Xmas Simple</span>
184
+ </li>
185
+ </ul>
186
+
187
+ <?php
188
+ break;
189
+ }
190
+ }
191
+ ?>
192
+ <p class="submit">
193
+ <input name="save<?php echo $i; ?>" type="submit" value="Save changes" class="button-primary" />
194
+ <input type="hidden" name="action" value="save" />
195
+ </p>
196
+ </form>
197
+
198
+ <form method="post">
199
+ <p class="reset">
200
+ <input name="reset" type="submit" value="Reset to default" class="button-secondary" />
201
+ <input type="hidden" name="action" value="reset" />
202
+ </p>
203
+ </form>
204
+
205
+ </div>
206
+ </div>
207
+ <div id="about-section" class="cf7_style_section">
208
+ <?php include_once( 'cf7-style-feed-box.php' );?>
209
+ </div>
210
+ <?php
211
+ }
212
+
213
+
214
+ /**
215
+ * Custom Style
216
+ *
217
+ * Displays fields for the Custom Style area of the admin area
218
+ */
219
+ function cf7_style_custom() {
220
+ global $cf7_style_name, $cf7_style, $custom;
221
+ $i=0;
222
+
223
+ if ( isset( $_GET['saved'] ) ) echo '<div id="message" class="updated fade"><p><strong>' . $cf7_style_name . ' custom settings saved.</strong></p></div>';
224
+ if ( isset( $_GET['reset'] ) ) echo '<div id="message" class="updated fade"><p><strong>' . $cf7_style_name . ' custom settings reset.</strong></p></div>';
225
+ ?>
226
+ <div class="wrap cf7_style_custom">
227
+ <div class="icon32" id="icon-options-general"></div>
228
+ <h2>Custom Style</h2>
229
+
230
+ <div class="cf7_style_opts">
231
+ <form method="post">
232
+ <?php foreach ( $custom as $value ) {
233
+ switch ( $value['type'] ) {
234
+
235
+ case "open":
236
+
237
+ break;
238
+ case "close":
239
+ ?>
240
+ </div>
241
+ </div>
242
+ <?php
243
+ break;
244
+ case "title":
245
+ ?>
246
+ <p>Here you can customize the template selected in the "Xmas Style" area.</p>
247
+ <?php
248
+ break;
249
+ case "color-picker":
250
+ ?>
251
+
252
+ <div class="cf7_style_input cf7_style_text">
253
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
254
+ <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" />
255
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
256
+ </div>
257
+
258
+ <?php
259
+ break;
260
+ case "text":
261
+ ?>
262
+
263
+ <div class="cf7_style_input cf7_style_text">
264
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
265
+ <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']; } ?>" />
266
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
267
+ </div>
268
+
269
+ <?php
270
+ break;
271
+ case "select":
272
+ ?>
273
+
274
+ <div class="cf7_style_input cf7_style_select">
275
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
276
+ <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
277
+ <option>Default</option>
278
+ <?php foreach ( $value['options'] as $option ) { ?>
279
+ <option class="font-load" <?php if (get_option( $value['id'] ) == $option) { echo 'selected="selected"'; } ?> value="<?php echo $option; ?>"><?php echo $option; ?></option><?php } ?>
280
+ </select>
281
+ <small><?php echo $value['desc']; ?></small>
282
+ <small class="preview">Preview</small>
283
+ <div id="font-viewer" class="font-viewer">
284
+ <div class="style-select"></div>
285
+ <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>
286
+ </div>
287
+ </div>
288
+
289
+ <?php
290
+ break;
291
+ case "select_input_font":
292
+ ?>
293
+
294
+ <div class="cf7_style_input cf7_style_select">
295
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
296
+ <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
297
+ <option>Default</option>
298
+ <?php foreach ( $value['options'] as $option ) { ?>
299
+ <option class="font-load2" <?php if ( get_option( $value['id'] ) == $option ) { echo 'selected="selected"'; } ?> value="<?php echo $option; ?>"><?php echo $option; ?></option><?php } ?>
300
+ </select>
301
+ <small><?php echo $value['desc']; ?></small>
302
+ <small class="preview">Preview</small>
303
+ <div id="font-viewer2" class="font-viewer2">
304
+ <div class="style-select2"></div>
305
+ <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>
306
+ </div>
307
+ </div>
308
+
309
+ <?php
310
+ break;
311
+ case "section":
312
+
313
+ $i++;
314
+ ?>
315
+
316
+ <div class="cf7_style_section">
317
+ <div class="cf7_style_title">
318
+ <h3><?php echo $value['name']; ?></h3>
319
+
320
+ <div class="clearfix"></div>
321
+ </div>
322
+ <div class="cf7_style_options">
323
+ </div>
324
+
325
+ <?php
326
+ break;
327
+ }
328
+ }
329
+ ?>
330
+ <p class="submit">
331
+ <input name="save<?php echo $i; ?>" type="submit" value="Save changes" class="button-primary" />
332
+ <input type="hidden" name="custom" value="save" />
333
+ </p>
334
+ </form>
335
+
336
+ <form method="post">
337
+ <p class="reset">
338
+ <input name="reset" type="submit" value="Reset to default" class="button-secondary" />
339
+ <input type="hidden" name="custom" value="reset" />
340
+ </p>
341
+ </form>
342
+
343
+ </div>
344
+ <?php
345
+ }
346
+
347
+ add_action('admin_menu', 'cf7_style_add_admin');
348
+
349
+
350
+ /**
351
+ * Enqueue admin scrips and style
352
+ */
353
+ function cf7_style_add_init() {
354
+
355
+ // Add the color picker
356
+ wp_enqueue_style( 'wp-color-picker' );
357
+ wp_enqueue_script( 'wp-color-picker-script', plugins_url('/admin/js/color.picker.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
358
+
359
+ wp_enqueue_style( "cf7_style_admin_css", plugin_dir_url( __FILE__ ) . "/admin/css/admin.css", false, "1.0", "all");
360
+ wp_enqueue_script( "cf7_style_admin_js", plugin_dir_url( __FILE__ ) . "/admin/js/admin.js", false, "1.0");
361
+ wp_enqueue_script( "cf7_style_admin_ajax_js", plugin_dir_url( __FILE__ ) . "/admin/js/ajax.preview.tool.js", false, "1.0");
362
+ }
363
+ add_action('admin_init', 'cf7_style_add_init');
364
+
365
+
366
+ /**
367
+ * Embed Google Fonts
368
+ */
369
+ function cf7_style_fonts() {
370
+ $cf7_style_google_font = get_option( 'cf7_style_google_fonts' );
371
+ if( empty( $cf7_style_google_font ) || $cf7_style_google_font == 'Default' ) {
372
+ $cf7_style_google_font = "Bitter";
373
+ }
374
+
375
+ $query_args = array(
376
+ 'family' => urlencode( $cf7_style_google_font ),
377
+ 'subset' => urlencode( 'latin,latin-ext' ),
378
+ );
379
+ $google_font_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );
380
+
381
+ return $google_font_url;
382
+ }
383
+
384
+ /**
385
+ * Embed Google Fonts for input
386
+ */
387
+ function cf7_style_fonts_for_inputs() {
388
+ $cf7_style_google_font = get_option( 'cf7_style_google_fonts_for_input_text' );
389
+ if( empty( $cf7_style_google_font ) || $cf7_style_google_font == 'Default') {
390
+ $cf7_style_google_font = "Open Sans";
391
+ }
392
+
393
+ $query_args = array(
394
+ 'family' => urlencode( $cf7_style_google_font ),
395
+ 'subset' => urlencode( 'latin,latin-ext' ),
396
+ );
397
+ $google_font_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );
398
+
399
+ return $google_font_url;
400
+
401
+ }
402
+
403
+
404
+ /**
405
+ * Enqueues scripts and styles for front end
406
+ */
407
+ function cf7_style_scripts_styles() {
408
+
409
+ wp_enqueue_script( 'jquery' );
410
+
411
+ // Embed Google Fonts
412
+ wp_enqueue_style( 'cf7-xmas-fonts', cf7_style_fonts(), array(), null );
413
+
414
+ // Embed Google Fonts for input
415
+ wp_enqueue_style( 'cf7-xmas-fonts-inputs', cf7_style_fonts_for_inputs(), array(), null );
416
+
417
+ // Loads our main script.
418
+ wp_enqueue_script( "cf7_style_frontend_js", plugin_dir_url( __FILE__ ) . "/js/frontend.js", false, "1.0");
419
+
420
+ // Loads our main stylesheet
421
+ wp_enqueue_style( "cf7_style_frontend_css", plugin_dir_url( __FILE__ ) . "/css/frontend.css", false, "1.0", "all");
422
+
423
+ }
424
+ add_action( 'wp_enqueue_scripts', 'cf7_style_scripts_styles' );
425
+
426
+
427
+ /**
428
+ * Declare selected Google Font for admin area
429
+ */
430
+ function cf7_style_admin_font() {
431
+ ?>
432
+ <style type="text/css">
433
+ <?php
434
+ $cf7_style_font_label = get_option( 'cf7_style_google_fonts' );
435
+ $cf7_style_font_input = get_option( 'cf7_style_google_fonts_for_input_text' );
436
+
437
+ // Google Fonts Array for label and input
438
+ $google_font_label = explode( ':', $cf7_style_font_label );
439
+ $google_font_input = explode( ':', $cf7_style_font_input );
440
+ if( !empty( $google_font_label[0] ) && $google_font_label[0] != 'Default' ) {
441
+ ?>
442
+ .cf7_style_opts .font-viewer,
443
+ .cf7_style_opts .font-viewer3 {
444
+ font-family: "<?php echo $google_font_label[0]; ?>";
445
+ }
446
+ <?php
447
+ }
448
+ if( !empty( $google_font_input[0] ) && $google_font_input[0] != 'Default' ) {
449
+ ?>
450
+ .cf7_style_opts .font-viewer2 {
451
+ font-family: "<?php echo $google_font_input[0]; ?>";
452
+ }
453
+ <?php
454
+ }
455
+ ?>
456
+ </style>
457
+ <?php
458
+ }
459
+ add_action( 'admin_head', 'cf7_style_admin_font' );
460
+
461
+
462
+ /**
463
+ * Body class
464
+ *
465
+ * Adds a body class to the $classes array
466
+ * from the selected Contact Style template
467
+ *
468
+ * @param string $cf7_style_templates Contact style template
469
+ * @return $classes
470
+ */
471
+ function cf7_style_body_class( $classes ) {
472
+
473
+ // Get the selected template
474
+ $cf7_style_templates = get_option( 'cf7_style_templates' );
475
+
476
+ // add the template class to the $classes array
477
+ $classes[] = $cf7_style_templates;
478
+
479
+ return $classes;
480
+ }
481
+ add_filter( 'body_class', 'cf7_style_body_class' );
482
+
483
+
484
+ /**
485
+ * Output css style for frontend
486
+ */
487
+ function cf7_style_frontend_output() {
488
+ ?>
489
+ <style type="text/css">
490
+ <?php
491
+ /**
492
+ * Declare input font-family for frontend
493
+ */
494
+ $cf7_style_google_font = get_option( 'cf7_style_google_fonts' );
495
+ $google_font_family = explode( ':', $cf7_style_google_font );
496
+ if( !empty( $google_font_family[0] ) && $google_font_family[0] != 'Default' ) {
497
+ ?>
498
+ .wpcf7 input,
499
+ .wpcf7 textarea,
500
+ .wpcf7 form {
501
+ font-family: "<?php echo $google_font_family[0]; ?>";
502
+ }
503
+ <?php
504
+ }
505
+
506
+ $cf7_style_font_label = get_option( 'cf7_style_google_fonts' );
507
+ $cf7_style_font_input = get_option( 'cf7_style_google_fonts_for_input_text' );
508
+
509
+ // Google Fonts Array for label and input
510
+ $google_font_label = explode( ':', $cf7_style_font_label );
511
+ $google_font_input = explode( ':', $cf7_style_font_input );
512
+ if( !empty( $google_font_label[0] ) && $google_font_label[0] != 'Default' && !empty( $google_font_input[0] ) && $google_font_input[0] != 'Default' ) {
513
+ ?>
514
+ .wpcf7,
515
+ .wpcf7 form,
516
+ .wpcf7 form {
517
+ font-family: "<?php echo $google_font_label[0]; ?>";
518
+ }
519
+ .wpcf7 input,
520
+ .wpcf7 textarea {
521
+ font-family: "<?php echo $google_font_input[0]; ?>";
522
+ }
523
+ <?php
524
+ }
525
+
526
+
527
+ /**
528
+ * Change the form background color
529
+ */
530
+ $cf7_style_form_background = get_option( 'cf7_style_form_bg' );
531
+ $cf7_style_form_background = explode( ':', $cf7_style_form_background );
532
+ if( !empty( $cf7_style_form_background[0] ) ) {
533
+ ?>
534
+ .wpcf7 {
535
+ background-color: <?php echo $cf7_style_form_background[0]; ?>;
536
+ }
537
+ <?php
538
+ }
539
+
540
+ /**
541
+ * Change the background color for input and textarea
542
+ */
543
+ $cf7_style_input_background = get_option( 'cf7_style_input_bg' );
544
+ $cf7_style_input_background = explode( ':', $cf7_style_input_background );
545
+ if( !empty( $cf7_style_input_background[0] ) ) {
546
+ ?>
547
+ .wpcf7 input,
548
+ .wpcf7 textarea{
549
+ background-color: <?php echo $cf7_style_input_background[0]; ?>;
550
+ }
551
+ <?php
552
+ }
553
+
554
+ /**
555
+ * Change the label color
556
+ */
557
+ $cf7_style_label_color = get_option( 'cf7_style_label_color' );
558
+ $cf7_style_label_color = explode( ':', $cf7_style_label_color );
559
+ if( !empty( $cf7_style_label_color[0] ) ) {
560
+ ?>
561
+ .wpcf7 .wpcf7-form p{
562
+ color: <?php echo $cf7_style_label_color[0]; ?>;
563
+ }
564
+ <?php
565
+ }
566
+
567
+ /**
568
+ * Change the text color for input and textarea
569
+ */
570
+ $cf7_style_input_text_color = get_option( 'cf7_style_input_text_color' );
571
+ $cf7_style_input_text_color = explode( ':', $cf7_style_input_text_color );
572
+ if( !empty( $cf7_style_input_text_color[0] ) ) {
573
+ ?>
574
+ .wpcf7 .wpcf7-form input,
575
+ .wpcf7 .wpcf7-form textarea{
576
+ color: <?php echo $cf7_style_input_text_color[0]; ?>;
577
+ }
578
+ <?php
579
+ }
580
+
581
+ /**
582
+ * Change the border color for input and textarea
583
+ */
584
+ $cf7_style_input_border_color = get_option( 'cf7_style_input_border_color' );
585
+ $cf7_style_input_border_color = explode( ':', $cf7_style_input_border_color );
586
+ if( !empty( $cf7_style_input_border_color[0] ) ) {
587
+ ?>
588
+ .wpcf7 .wpcf7-form input,
589
+ .wpcf7 .wpcf7-form textarea {
590
+ border: 1px solid <?php echo $cf7_style_input_border_color[0]; ?>;
591
+ }
592
+ <?php
593
+ }
594
+ ?>
595
+ </style>
596
+ <?php
597
+ }
598
+ add_action( 'wp_head', 'cf7_style_frontend_output' );
599
+
600
+ /**
601
+ * Change the menu label to Contact Style
602
+ */
603
+ function cf7_style_change_menu_label() {
604
+ global $menu;
605
+
606
+ $menu[28.5][0] = 'Contact Style';
607
+ }
608
+ add_action( 'admin_menu', 'cf7_style_change_menu_label' );
cf7-style.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
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.0.1
7
+ Author: REEA
8
+ Author URI: http://www.reea.net/
9
+ License: GPL2
10
+ */
11
+
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
+ */
20
+ function contact_form_7_check() {
21
+
22
+ // WordPress active plugins
23
+ $active_plugins = get_option( 'active_plugins' );
24
+
25
+ if ( $active_plugins ) {
26
+ // plugins to active
27
+ $required_plugin = 'contact-form-7/wp-contact-form-7.php';
28
+
29
+ if ( ! in_array( $required_plugin, $active_plugins ) ) {
30
+
31
+ $html = '<div class="updated">';
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
+ }
56
+ } // end if $active_plugins
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' );
css/frontend.css ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Frontend Css
3
+ */
4
+
5
+
6
+ /*
7
+ Xmas Classic
8
+ */
9
+ .xmas-classic .wpcf7 {
10
+ position: relative;
11
+ }
12
+ .xmas-classic .wpcf7 form {
13
+ background: url("../images/xmas-classic/bg-repeat.png") repeat-y scroll 1px 1px rgba(0, 0, 0, 0);
14
+ display: block;
15
+ margin: auto;
16
+ overflow: hidden;
17
+ text-align: center;
18
+ width: 100%;
19
+ }
20
+ .xmas-classic .header {
21
+ background: url("../images/xmas-classic/top_border.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
22
+ height: 23px;
23
+ width: 100%;
24
+ }
25
+ .xmas-classic .left {
26
+ background: url("../images/xmas-classic/left_part_bg.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
27
+ bottom: 255px;
28
+ height: 129px;
29
+ left: -73px;
30
+ position: absolute;
31
+ width: 99px;
32
+ }
33
+ .xmas-classic .wpcf7 p {
34
+ color: #482C09;
35
+ margin-bottom: 20px;
36
+ margin-left: 27px;
37
+ width: 350px;
38
+ }
39
+ .xmas-classic .wpcf7 span {
40
+ display: block;
41
+ }
42
+ .xmas-classic .footer {
43
+ background: url("../images/xmas-classic/bottombg.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
44
+ bottom: 0;
45
+ height: 255px;
46
+ margin-left: -70px;
47
+ width: 100%;
48
+ }
49
+ .xmas-classic .wpcf7 form input,
50
+ .xmas-classic .wpcf7 form textarea {
51
+ display: inline-block;
52
+ *display: inline;
53
+ *zoom: 1;
54
+ -moz-border-radius:4px;
55
+ -webkit-border-radius:4px;
56
+ border-radius: 4px;
57
+ background-color: #f3eadf;
58
+ border: 1px dotted #b2a28e;
59
+ }
60
+ .xmas-classic .wpcf7 form input {
61
+ height: 28px;
62
+ padding: 3px 5px;
63
+ line-height: 28px;
64
+ }
65
+ .xmas-classic .wpcf7 .wpcf7-form-control-wrap input,
66
+ .xmas-classic .wpcf7 .wpcf7-form-control-wrap textarea {
67
+ display: block;
68
+ width: 100%;
69
+ }
70
+ .xmas-classic .wpcf7 form textarea {
71
+ resize: vertical;
72
+ margin-bottom: 10px;
73
+ }
74
+
75
+ .xmas-classic .wpcf7 .wpcf7-submit {
76
+ background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
77
+ border: medium none;
78
+ bottom: 20px;
79
+ height: 54px;
80
+ left: 30px;
81
+ position: absolute;
82
+ text-indent: -9999px;
83
+ width: 78px;
84
+ }
85
+
86
+
87
+ /*
88
+ Xmas Red
89
+ */
90
+ .xmas-red .wpcf7 {
91
+ width: 600px;
92
+ color: #fff;
93
+ font-size: 25px;
94
+ }
95
+
96
+ .xmas-red .wpcf7 form {
97
+ width: 600px;
98
+ margin: 0 auto;
99
+ background: url(../images/xmas-red/middle.png) repeat-y top center;
100
+ position: relative;
101
+ }
102
+
103
+ .xmas-red .wpcf7 .header {
104
+ display: block;
105
+ background: url(../images/xmas-red/header.png) no-repeat 32px top;
106
+ width: 600px;
107
+ height: 94px;
108
+ }
109
+
110
+ .xmas-red .wpcf7 .footer {
111
+ display: block;
112
+ background: url(../images/xmas-red/footer.png) no-repeat top center;
113
+ width: 600px;
114
+ height: 94px;
115
+ margin-top: -10px;
116
+ }
117
+
118
+ .xmas-red .wpcf7 p {
119
+ width: 370px;
120
+ margin: 0 auto;
121
+ }
122
+
123
+ .xmas-red .wpcf7 input,
124
+ .xmas-red .wpcf7 textarea {
125
+ color: #222;
126
+ width: 100%;
127
+ font-size: 16px;
128
+ }
129
+
130
+ .xmas-red .wpcf7 textarea {
131
+ height: 120px;
132
+ resize: vertical;
133
+ }
134
+
135
+ .xmas-red .wpcf7 .wpcf7-submit {
136
+ display: block;
137
+ width: 232px;
138
+ height: 126px;
139
+ background: url(../images/xmas-red/send.png) no-repeat top center;
140
+ position: absolute;
141
+ bottom: -125px;
142
+ right: 0;
143
+ text-indent: -9999px;
144
+ border: none;
145
+ -webkit-box-shadow: none;
146
+ -moz-box-shadow: none;
147
+ box-shadow: none;
148
+ }
149
+
150
+ .xmas-red .wpcf7-validation-errors,
151
+ .xmas-red .wpcf7-mail-sent-ok,
152
+ .xmas-classic .wpcf7-validation-errors,
153
+ .xmas-classic .wpcf7-mail-sent-ok{
154
+ border: none;
155
+ width: 350px;
156
+ font-size: 22px;
157
+ color: #FC8181;
158
+ margin-left: 25px;
159
+ padding: 0;
160
+ }
161
+
162
+ .xmas-red .wpcf7-mail-sent-ok,
163
+ .xmas-classic .wpcf7-mail-sent-ok {
164
+ color: #73C94E;
165
+ }
166
+
167
+ .xmas-red span.wpcf7-not-valid-tip,
168
+ .xmas-classic span.wpcf7-not-valid-tip {
169
+ left: 0;
170
+ top: 0;
171
+ padding: 5px 10px;
172
+ width: 368px;
173
+ font-size: 16px;
174
+ border: none;
175
+ display: block;
176
+ color: #FC8181;
177
+ -webkit-border-radius: 5px;
178
+ -moz-border-radius: 5px;
179
+ border-radius: 5px;
180
+ }
181
+
182
+ .xmas-red span.wpcf7-list-item {
183
+ display: inline-block;
184
+ height: 32px;
185
+ }
186
+
187
+ .xmas-red .wpcf7-radio .wpcf7-list-item {
188
+ background: url(../images/xmas-red/radio.png) no-repeat 0 6px;
189
+ }
190
+
191
+ .xmas-red .wpcf7-radio .wpcf7-list-item.active {
192
+ background-position: 0 -27px;
193
+ }
194
+
195
+ .xmas-red .wpcf7-radio .wpcf7-list-item-label {
196
+ display: inline-block;
197
+ vertical-align: top;
198
+ }
199
+
200
+ .xmas-red span.wpcf7-list-item input[type="radio"] {
201
+ width: 30px;
202
+ height: 30px;
203
+ cursor: pointer;
204
+
205
+ /* IE 8 */
206
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
207
+
208
+ /* IE 5-7 */
209
+ filter: alpha(opacity=0);
210
+
211
+ /* Netscape */
212
+ -moz-opacity: 0;
213
+
214
+ /* Safari 1.x */
215
+ -khtml-opacity: 0;
216
+
217
+ /* Good browsers */
218
+ opacity: 0;
219
+
220
+ /*position: absolute;
221
+ overflow: hidden;
222
+ clip: rect(0 0 0 0);
223
+ height:1px;
224
+ width:1px;
225
+ margin:-1px;
226
+ padding:0;
227
+ border:0;*/
228
+
229
+ }
230
+
231
+
232
+
233
+
234
+
235
+ /*
236
+ Xmas Simple
237
+ */
238
+ .xmas-simple .wpcf7 {
239
+ width: 570px;
240
+ padding: 50px 20px 15px 20px;
241
+ margin-bottom: 20px;
242
+ color: #1b0a00;
243
+ position: relative;
244
+
245
+ }
246
+
247
+ .xmas-simple .wpcf7 form {
248
+ width: 425px;
249
+ margin: 0 auto;
250
+ padding: 20px;
251
+ border-left: dashed 2px #542c0e;
252
+ border-right: dashed 2px #542c0e;
253
+ background: url(../images/xmas-simple/middle.png) repeat-y center top;
254
+ }
255
+
256
+ .xmas-simple .wpcf7 p {
257
+ width: 250px;
258
+ margin: 15px auto;
259
+ }
260
+
261
+ .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 {
262
+ width: 100%;
263
+ background: transparent;
264
+ border: dashed 2px #7d5f48;
265
+ }
266
+
267
+ .xmas-simple .wpcf7 textarea {
268
+ height: 110px;
269
+ resize: vertical;
270
+ }
271
+
272
+ .xmas-simple .wpcf7 .header,
273
+ .xmas-simple .wpcf7 .footer {
274
+ width: 425px;
275
+ height: 17px;
276
+ margin: 0 auto;
277
+ padding: 20px 20px 0 20px;
278
+ background: url( '../images/xmas-simple/header.png' ) no-repeat -4px 10px;
279
+ border: dashed 2px #542c0e;
280
+ border-bottom: none;
281
+ }
282
+
283
+ .xmas-simple .wpcf7 .footer {
284
+ border-top: none;
285
+ border-bottom: dashed 2px #542c0e;
286
+ background: url( '../images/xmas-simple/footer.png' ) no-repeat 0 0;
287
+ padding-bottom: 10px;
288
+ }
289
+
290
+ .xmas-simple .wpcf7 .ribbon {
291
+ width: 182px;
292
+ height: 202px;
293
+ position: absolute;
294
+ background: url( '../images/xmas-simple/ribbon.png' ) no-repeat;
295
+ top: 0;
296
+ right: 0;
297
+ }
298
+
299
+ .xmas-simple div.wpcf7-response-output {
300
+ width: 250px;
301
+ margin: 0 auto;
302
+ border: none;
303
+ color: #ee0000;
304
+ }
305
+
306
+ .xmas-simple .wpcf7-submit {
307
+ background: #e7e3d0;
308
+ color: #1b0a00;
309
+ border-top: solid 1px #fff;
310
+ font-size: 14px;
311
+ padding: 9px 15px;
312
+ height: 40px;
313
+ -webkit-border-radius: 15px 18px 7px 9px;
314
+ -moz-border-radius: 15px 18px 7px 9px;
315
+ border-radius: 15px 18px 7px 9px;
316
+ -webkit-box-shadow: -3px 3px 9px 1px #999;
317
+ box-shadow: -3px 3px 9px 1px #999;
318
+ }
319
+
320
+
321
+
322
+ /**
323
+ * Fix Error tooltips position
324
+ */
325
+ .xmas-simple span.wpcf7-not-valid-tip {
326
+ top: -4px;
327
+ left: 2px;
328
+ height: 30px;
329
+ line-height: 30px;
330
+ padding-left: 9px;
331
+ width: 245px;
332
+ color: #ee0000;
333
+ background: #fff;
334
+ border: none;
335
+ }
336
+ /*Christmas clasic - unique*/
337
+ .xmas-classic .wpcf7-not-valid-tip{
338
+ width: 100%;
339
+ background: transparent;
340
+ }
images/xmas-classic/bg-repeat.png ADDED
Binary file
images/xmas-classic/bottombg.png ADDED
Binary file
images/xmas-classic/left_part_bg.png ADDED
Binary file
images/xmas-classic/top_border.png ADDED
Binary file
images/xmas-red/checkbox.png ADDED
Binary file
images/xmas-red/footer.png ADDED
Binary file
images/xmas-red/header.png ADDED
Binary file
images/xmas-red/middle.png ADDED
Binary file
images/xmas-red/radio.png ADDED
Binary file
images/xmas-red/send.png ADDED
Binary file
images/xmas-simple/footer.png ADDED
Binary file
images/xmas-simple/header.png ADDED
Binary file
images/xmas-simple/middle.png ADDED
Binary file
images/xmas-simple/paper.jpg ADDED
Binary file
images/xmas-simple/ribbon.png ADDED
Binary file
js/frontend.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ jQuery functions for the Front end area
3
+ */
4
+ jQuery(document).ready( function( $ ) {
5
+
6
+ // Xmas Classic
7
+ $('.xmas-classic .wpcf7').prepend('<div class="header"></div><div class="left"></div>').append('<div class="footer"></div>');
8
+
9
+ // Xmas Red
10
+ $('.xmas-red .wpcf7').prepend('<div class="header"></div><div class="left"></div>').append('<div class="footer"></div>');
11
+ $('.xmas-red .wpcf7-radio .wpcf7-list-item').first().addClass('active');
12
+ $('.xmas-red .wpcf7-radio .wpcf7-list-item input').on( 'click', function() {
13
+ $('.xmas-red .wpcf7-radio .wpcf7-list-item').removeClass('active');
14
+ $(this).parent().addClass('active');
15
+ });
16
+
17
+ $('.xmas-red .wpcf7-checkbox .wpcf7-list-item input').on( 'click', function() {
18
+ $(this).parent().toggleClass('active');
19
+ });
20
+
21
+ // Xmas Simple
22
+ $('.xmas-simple .wpcf7').prepend( '<div class="header"></div><div class="middle"></div><div class="ribbon"></div>' ).append('<div class="footer"></div>');
23
+
24
+ });
readme.txt ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
4
+ Requires at least: 3.0.1
5
+ Tested up to: 3.8.1
6
+ Stable tag: 4.3.1
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 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
+
23
+
24
+ == Installation ==
25
+
26
+ 1. Upload the entire `contact-form-7-style` folder to the `/wp-content/plugins/` directory
27
+ 2. Make sure that Contact Form 7 is installed and activated ( an admin notice will check for this )
28
+ 3. Activate the plugin through the 'Plugins' menu in WordPress
29
+
30
+ You will find 'Contact Style' menu in your WordPress admin panel.
31
+
32
+ == Screenshots ==
33
+
34
+ 1. screenshot-1.jpg
35
+ 2. screenshot-2.jpg
36
+
37
+ == Changelog ==
38
+
39
+ = 1.0 =
40
+ * First plugin version.
41
+
42
+ = 1.0.1 =
43
+ * Fixed x-mas classic display on 2014 wordpress theme.
screenshot-1.jpg ADDED
Binary file
screenshot-2.jpg ADDED
Binary file