Math Captcha - Version 1.0.0

Version Description

  • Initial release

=

Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Math Captcha
Version 1.0.0
Comparing to
See all releases

Version 1.0.0

css/images/bg_fallback.png ADDED
Binary file
css/images/icon_sprite.png ADDED
Binary file
css/images/slider_handles.png ADDED
Binary file
css/images/slider_handles@2x.png ADDED
Binary file
css/images/ui-icons_222222_256x240.png ADDED
Binary file
css/images/ui-icons_454545_256x240.png ADDED
Binary file
css/math-captcha-admin.css ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ .math-captcha { width:68%; margin-right:20px; }
2
+ .math-captcha-settings { width:68%; margin-right:20px; }
3
+ .math-captcha-settings h3 { font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif; font-weight: bold; }
4
+ .math-captcha-settings hr, .df-credits hr { border: solid #ddd; border-width: 1px 0 0; clear: both; height: 0; -moz-box-shadow: 0px 1px 0px #fff; -webkit-box-shadow: 0px 1px 0px #fff; box-shadow: 0px 1px 0px #fff; margin:15px 0; }
5
+ .df-credits { width:28%; max-width:350px; margin-top:20px; border:1px solid #ddd; background:#fcfcfc; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
6
+ .df-credits h3 { margin-top:5px; }
7
+ .df-credits h3.metabox-title { background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset; -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset; border: 1px solid; border-color: #21759b; border-bottom-color: #1e6a8d; -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5); box-shadow: inset 0 1px 0 rgba(120,200,230,0.5); color: #fff; text-decoration: none; text-shadow: 0 1px 0 rgba(0,0,0,0.5); margin:0; line-height:32px; font-weight:normal; padding:0 10px; }
8
+ .df-credits .inner { padding:15px 10px; }
9
+ .df-credits .df-link { font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; font-style:italic; margin:0; }
10
+ .df-credits .df-link a { vertical-align: middle; padding: 5px 0 0 4px; }
css/wp-like-ui-theme.css ADDED
@@ -0,0 +1,774 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI CSS Framework 1.8.7
3
+ *
4
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Theming/API
9
+ */
10
+
11
+ /* Layout helpers
12
+ ----------------------------------*/
13
+ .ui-helper-hidden { display: none; }
14
+ .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
+ .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
+ .ui-helper-clearfix { display: inline-block; }
18
+ /* required comment for clearfix to work in Opera \*/
19
+ * html .ui-helper-clearfix { height:1%; }
20
+ .ui-helper-clearfix { display:block; }
21
+ /* end clearfix */
22
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23
+
24
+
25
+ /* Interaction Cues
26
+ ----------------------------------*/
27
+ .ui-state-disabled { cursor: default !important; }
28
+
29
+
30
+ /* Icons
31
+ ----------------------------------*/
32
+
33
+ /* states and images */
34
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
35
+
36
+
37
+ /* Misc visuals
38
+ ----------------------------------*/
39
+
40
+ /* Overlays */
41
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42
+
43
+
44
+ /*
45
+ * jQuery UI CSS Framework 1.8.7
46
+ *
47
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
48
+ * Dual licensed under the MIT or GPL Version 2 licenses.
49
+ * http://jquery.org/license
50
+ *
51
+ * http://docs.jquery.com/UI/Theming/API
52
+ *
53
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ctl=themeroller
54
+ */
55
+
56
+
57
+ /* Component containers
58
+ ----------------------------------*/
59
+ .ui-widget { font-family: Arial,sans-serif; font-size: 1.1em; }
60
+ .ui-widget .ui-widget { font-size: 1em; }
61
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Arial,sans-serif; font-size: 1em; }
62
+ .ui-widget-content { border: 1px solid #dfdfdf; background: #ffffff; color: #333333; font-size:12px; }
63
+ .ui-widget-content a { color: #333333; }
64
+ .ui-widget-header { border: 1px solid #dfdfdf; color: #333333; font-weight: normal; }
65
+ .ui-widget-header {
66
+ background: #f3f3f3 url(images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
67
+ background: -moz-linear-gradient(top, #f9f9f9 0%, #ececec 100%); /* FF3.6+ */
68
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ececec)); /* Chrome,Safari4+ */
69
+ background: -webkit-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Chrome10+,Safari5.1+ */
70
+ background: -o-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Opera11.10+ */
71
+ background: -ms-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* IE10+ */
72
+ background: linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* W3C */
73
+ }
74
+ .ui-widget-header a { color: #333333; }
75
+
76
+ /* Interaction states
77
+ ----------------------------------*/
78
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #dfdfdf; font-weight: normal; color: #333333; }
79
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
80
+ background: #f9f9f9 url(images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
81
+ background: -moz-linear-gradient(top, #f9f9f9 0%, #ececec 100%); /* FF3.6+ */
82
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ececec)); /* Chrome,Safari4+ */
83
+ background: -webkit-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Chrome10+,Safari5.1+ */
84
+ background: -o-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Opera11.10+ */
85
+ background: -ms-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* IE10+ */
86
+ background: linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* W3C */
87
+ -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
88
+ -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
89
+ box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
90
+ }
91
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #333333; text-decoration: none; }
92
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #bbbbbb; font-weight: normal; color: #313131; }
93
+ .ui-state-hover a, .ui-state-hover a:hover { color: #313131; text-decoration: none; }
94
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
95
+ outline: none;
96
+ color: #ffffff;
97
+ border-color: #21759b #21759b #1e6a8d;
98
+ background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
99
+ background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
100
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
101
+ background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
102
+ background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
103
+ background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
104
+ background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
105
+ -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
106
+ -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
107
+ box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
108
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
109
+ }
110
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #fff; text-decoration: none; }
111
+ .ui-widget :active { outline: none; }
112
+
113
+ /* Interaction Cues
114
+ ----------------------------------*/
115
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #e6db55; background: #ffffe0; color: #333; }
116
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #333; }
117
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { border: 1px solid #cc0000; background: #ffebe8; color: #333; }
118
+ .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
119
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
120
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: normal; }
121
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { font-weight: normal; }
122
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
123
+
124
+ /* Icons
125
+ ----------------------------------*/
126
+
127
+ /* states and images */
128
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
129
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
130
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
131
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_454545_256x240.png); }
132
+ .ui-state-hover .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
133
+ .ui-state-focus .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
134
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
135
+ .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
136
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon { background: url(images/icon_sprite.png) -16px 0 no-repeat !important; }
137
+ .ui-state-highlight .ui-icon, .ui-state-error .ui-icon { margin-top: -1px; }
138
+
139
+ /* positioning */
140
+ .ui-icon-carat-1-n { background-position: 0 0; }
141
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
142
+ .ui-icon-carat-1-e { background-position: -32px 0; }
143
+ .ui-icon-carat-1-se { background-position: -48px 0; }
144
+ .ui-icon-carat-1-s { background-position: -64px 0; }
145
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
146
+ .ui-icon-carat-1-w { background-position: -96px 0; }
147
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
148
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
149
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
150
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
151
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
152
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
153
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
154
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
155
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
156
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
157
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
158
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
159
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
160
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
161
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
162
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
163
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
164
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
165
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
166
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
167
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
168
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
169
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
170
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
171
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
172
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
173
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
174
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
175
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
176
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
177
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
178
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
179
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
180
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
181
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
182
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
183
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
184
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
185
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
186
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
187
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
188
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
189
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
190
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
191
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
192
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
193
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
194
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
195
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
196
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
197
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
198
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
199
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
200
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
201
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
202
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
203
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
204
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
205
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
206
+ .ui-icon-extlink { background-position: -32px -80px; }
207
+ .ui-icon-newwin { background-position: -48px -80px; }
208
+ .ui-icon-refresh { background-position: -64px -80px; }
209
+ .ui-icon-shuffle { background-position: -80px -80px; }
210
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
211
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
212
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
213
+ .ui-icon-folder-open { background-position: -16px -96px; }
214
+ .ui-icon-document { background-position: -32px -96px; }
215
+ .ui-icon-document-b { background-position: -48px -96px; }
216
+ .ui-icon-note { background-position: -64px -96px; }
217
+ .ui-icon-mail-closed { background-position: -80px -96px; }
218
+ .ui-icon-mail-open { background-position: -96px -96px; }
219
+ .ui-icon-suitcase { background-position: -112px -96px; }
220
+ .ui-icon-comment { background-position: -128px -96px; }
221
+ .ui-icon-person { background-position: -144px -96px; }
222
+ .ui-icon-print { background-position: -160px -96px; }
223
+ .ui-icon-trash { background-position: -176px -96px; }
224
+ .ui-icon-locked { background-position: -192px -96px; }
225
+ .ui-icon-unlocked { background-position: -208px -96px; }
226
+ .ui-icon-bookmark { background-position: -224px -96px; }
227
+ .ui-icon-tag { background-position: -240px -96px; }
228
+ .ui-icon-home { background-position: 0 -112px; }
229
+ .ui-icon-flag { background-position: -16px -112px; }
230
+ .ui-icon-calendar { background-position: -32px -112px; }
231
+ .ui-icon-cart { background-position: -48px -112px; }
232
+ .ui-icon-pencil { background-position: -64px -112px; }
233
+ .ui-icon-clock { background-position: -80px -112px; }
234
+ .ui-icon-disk { background-position: -96px -112px; }
235
+ .ui-icon-calculator { background-position: -112px -112px; }
236
+ .ui-icon-zoomin { background-position: -128px -112px; }
237
+ .ui-icon-zoomout { background-position: -144px -112px; }
238
+ .ui-icon-search { background-position: -160px -112px; }
239
+ .ui-icon-wrench { background-position: -176px -112px; }
240
+ .ui-icon-gear { background-position: -192px -112px; }
241
+ .ui-icon-heart { background-position: -208px -112px; }
242
+ .ui-icon-star { background-position: -224px -112px; }
243
+ .ui-icon-link { background-position: -240px -112px; }
244
+ .ui-icon-cancel { background-position: 0 -128px; }
245
+ .ui-icon-plus { background-position: -16px -128px; }
246
+ .ui-icon-plusthick { background-position: -32px -128px; }
247
+ .ui-icon-minus { background-position: -48px -128px; }
248
+ .ui-icon-minusthick { background-position: -64px -128px; }
249
+ .ui-icon-close { background-position: -80px -128px; }
250
+ .ui-icon-closethick { background-position: -96px -128px; }
251
+ .ui-icon-key { background-position: -112px -128px; }
252
+ .ui-icon-lightbulb { background-position: -128px -128px; }
253
+ .ui-icon-scissors { background-position: -144px -128px; }
254
+ .ui-icon-clipboard { background-position: -160px -128px; }
255
+ .ui-icon-copy { background-position: -176px -128px; }
256
+ .ui-icon-contact { background-position: -192px -128px; }
257
+ .ui-icon-image { background-position: -208px -128px; }
258
+ .ui-icon-video { background-position: -224px -128px; }
259
+ .ui-icon-script { background-position: -240px -128px; }
260
+ .ui-icon-alert { background-position: 0 -144px; }
261
+ .ui-icon-info { background: url(images/icon_sprite.png) 0 0 no-repeat !important; }
262
+ .ui-icon-notice { background-position: -32px -144px; }
263
+ .ui-icon-help { background-position: -48px -144px; }
264
+ .ui-icon-check { background-position: -64px -144px; }
265
+ .ui-icon-bullet { background-position: -80px -144px; }
266
+ .ui-icon-radio-off { background-position: -96px -144px; }
267
+ .ui-icon-radio-on { background-position: -112px -144px; }
268
+ .ui-icon-pin-w { background-position: -128px -144px; }
269
+ .ui-icon-pin-s { background-position: -144px -144px; }
270
+ .ui-icon-play { background-position: 0 -160px; }
271
+ .ui-icon-pause { background-position: -16px -160px; }
272
+ .ui-icon-seek-next { background-position: -32px -160px; }
273
+ .ui-icon-seek-prev { background-position: -48px -160px; }
274
+ .ui-icon-seek-end { background-position: -64px -160px; }
275
+ .ui-icon-seek-start { background-position: -80px -160px; }
276
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
277
+ .ui-icon-seek-first { background-position: -80px -160px; }
278
+ .ui-icon-stop { background-position: -96px -160px; }
279
+ .ui-icon-eject { background-position: -112px -160px; }
280
+ .ui-icon-volume-off { background-position: -128px -160px; }
281
+ .ui-icon-volume-on { background-position: -144px -160px; }
282
+ .ui-icon-power { background-position: 0 -176px; }
283
+ .ui-icon-signal-diag { background-position: -16px -176px; }
284
+ .ui-icon-signal { background-position: -32px -176px; }
285
+ .ui-icon-battery-0 { background-position: -48px -176px; }
286
+ .ui-icon-battery-1 { background-position: -64px -176px; }
287
+ .ui-icon-battery-2 { background-position: -80px -176px; }
288
+ .ui-icon-battery-3 { background-position: -96px -176px; }
289
+ .ui-icon-circle-plus { background-position: 0 -192px; }
290
+ .ui-icon-circle-minus { background-position: -16px -192px; }
291
+ .ui-icon-circle-close { background-position: -32px -192px; }
292
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
293
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
294
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
295
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
296
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
297
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
298
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
299
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
300
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
301
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
302
+ .ui-icon-circle-check { background-position: -208px -192px; }
303
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
304
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
305
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
306
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
307
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
308
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
309
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
310
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
311
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
312
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
313
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
314
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
315
+
316
+
317
+ /* Misc visuals
318
+ ----------------------------------*/
319
+
320
+ /* Corner radius */
321
+ .ui-corner-tl { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; }
322
+ .ui-corner-tr { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
323
+ .ui-corner-bl { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
324
+ .ui-corner-br { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
325
+ .ui-corner-top { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
326
+ .ui-corner-bottom { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
327
+ .ui-corner-right { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
328
+ .ui-corner-left { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
329
+ .ui-corner-all { -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
330
+
331
+ /* Overlays */
332
+ .ui-widget-overlay { background: #262b33; opacity: .70;filter:Alpha(Opacity=70); }
333
+ .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #000000; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
334
+ * jQuery UI Resizable 1.8.7
335
+ *
336
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
337
+ * Dual licensed under the MIT or GPL Version 2 licenses.
338
+ * http://jquery.org/license
339
+ *
340
+ * http://docs.jquery.com/UI/Resizable#theming
341
+ */
342
+ .ui-resizable { position: relative;}
343
+ .ui-resizable-handle { position: absolute; font-size: 0.1px; z-index: 999; display: block;}
344
+ .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
345
+ .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
346
+ .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
347
+ .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
348
+ .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
349
+ .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
350
+ .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
351
+ .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
352
+ .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
353
+ * jQuery UI Selectable 1.8.7
354
+ *
355
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
356
+ * Dual licensed under the MIT or GPL Version 2 licenses.
357
+ * http://jquery.org/license
358
+ *
359
+ * http://docs.jquery.com/UI/Selectable#theming
360
+ */
361
+ .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
362
+ /*
363
+ * jQuery UI Accordion 1.8.7
364
+ *
365
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
366
+ * Dual licensed under the MIT or GPL Version 2 licenses.
367
+ * http://jquery.org/license
368
+ *
369
+ * http://docs.jquery.com/UI/Accordion#theming
370
+ */
371
+ /* IE/Win - Fix animation bug - #4615 */
372
+ .ui-accordion { width: 100%; }
373
+ .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 0.2em; zoom: 1; height:30px; line-height:30px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
374
+ .ui-accordion .ui-accordion-header.ui-state-active { -moz-border-radius: 3px 3px 0 0; -webkit-border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0; }
375
+ .ui-accordion .ui-accordion-content { -moz-border-radius: 0 0 3px 3px; -webkit-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px; }
376
+ .ui-accordion .ui-accordion-li-fix { display: inline; }
377
+ .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
378
+ .ui-accordion .ui-accordion-header a { display: block; font-size: 12px; font-weight: normal; padding: 0 .5em 0 1em; }
379
+ .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
380
+ .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; display:none; }
381
+ .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; display: none; zoom: 1; }
382
+ .ui-accordion .ui-accordion-content-active { display: block; }/*
383
+ * jQuery UI Autocomplete 1.8.7
384
+ *
385
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
386
+ * Dual licensed under the MIT or GPL Version 2 licenses.
387
+ * http://jquery.org/license
388
+ *
389
+ * http://docs.jquery.com/UI/Autocomplete#theming
390
+ */
391
+ .ui-autocomplete {
392
+ position: absolute; cursor: default; z-index: 3;
393
+ -moz-border-radius: 0;
394
+ -webkit-border-radius: 0;
395
+ border-radius: 0;
396
+ -moz-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
397
+ -webkit-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
398
+ box-shadow: 0 1px 5px rgba(0,0,0,0.3);
399
+ }
400
+
401
+ /* workarounds */
402
+ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
403
+
404
+ /*
405
+ * jQuery UI Menu 1.8.7
406
+ *
407
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
408
+ * Dual licensed under the MIT or GPL Version 2 licenses.
409
+ * http://jquery.org/license
410
+ *
411
+ * http://docs.jquery.com/UI/Menu#theming
412
+ */
413
+ .ui-menu {
414
+ list-style:none;
415
+ padding: 2px;
416
+ margin: 0;
417
+ display:block;
418
+ float: left;
419
+ }
420
+ .ui-menu .ui-menu {
421
+ margin-top: -3px;
422
+ }
423
+ .ui-menu .ui-menu-item {
424
+ margin:0;
425
+ padding: 0;
426
+ zoom: 1;
427
+ float: left;
428
+ clear: left;
429
+ width: 100%;
430
+ }
431
+ .ui-menu .ui-menu-item a {
432
+ text-decoration:none;
433
+ display:block;
434
+ padding:.2em .4em;
435
+ line-height:1.5;
436
+ zoom:1;
437
+ }
438
+ .ui-menu .ui-menu-item a.ui-state-hover,
439
+ .ui-menu .ui-menu-item a.ui-state-active {
440
+ font-weight: normal;
441
+ margin: -1px;
442
+ background: #5f83b9;
443
+ color: #FFFFFF;
444
+ text-shadow: 0px 1px 1px #234386;
445
+ border-color: #466086;
446
+ -moz-border-radius: 0;
447
+ -webkit-border-radius: 0;
448
+ border-radius: 0;
449
+ }
450
+ /*
451
+ * jQuery UI Button 1.8.7
452
+ *
453
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
454
+ * Dual licensed under the MIT or GPL Version 2 licenses.
455
+ * http://jquery.org/license
456
+ *
457
+ * http://docs.jquery.com/UI/Button#theming
458
+ */
459
+ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; -webkit-user-select: none; -moz-user-select: none; user-select: none; } /* the overflow property removes extra width in IE */
460
+ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
461
+ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
462
+ .ui-button-icons-only { width: 3.4em; }
463
+ button.ui-button-icons-only { width: 3.7em; }
464
+
465
+ /* button animation properties */
466
+ .ui-button {
467
+ -webkit-transition: -webkit-box-shadow 0.25s ease-in-out;
468
+ -moz-transition: -moz-box-shadow 0.25s ease-in-out;
469
+ -o-transition: -o-box-shadow 0.25s ease-in-out;
470
+ }
471
+
472
+ /*states*/
473
+ .ui-button.ui-state-hover {
474
+ -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
475
+ -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
476
+ box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
477
+ }
478
+
479
+ /*button text element */
480
+ .ui-button .ui-button-text { display: block; line-height: 23px; font-size: 12px; font-weight: normal; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
481
+ .ui-button.ui-state-active .ui-button-text { display: block; font-size: 12px; font-weight: normal; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); border: 1px solid #21759B #21759B #1E6A8D; }
482
+ .ui-button-text-only .ui-button-text { padding: 0 1em; }
483
+ .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
484
+ .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: 0 1em 0 2.1em; }
485
+ .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: 0 2.1em .0 1em; }
486
+ .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
487
+ /* no icon support for input elements, provide padding by default */
488
+ input.ui-button { font-size: 12px; font-weight: normal; padding: 0 1em !important; height: 30px; line-height:30px; }
489
+ /*remove submit button internal padding in Firefox*/
490
+ input.ui-button::-moz-focus-inner {
491
+ border: 0;
492
+ padding: 0;
493
+ }
494
+ /* fix webkits handling of the box model */
495
+ @media screen and (-webkit-min-device-pixel-ratio:0) {
496
+ input.ui-button {
497
+ height: 30px !important;
498
+ vertical-align: bottom;
499
+ }
500
+ }
501
+
502
+ /*button icon element(s) */
503
+ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
504
+ .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
505
+ .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
506
+ .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
507
+ .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
508
+
509
+ /*button sets*/
510
+ .ui-buttonset { margin-right: 7px; }
511
+ .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
512
+ .ui-buttonset .ui-button.ui-state-active { color: #ffffff; border-color: #21759B #21759B #1E6A8D; }
513
+ .ui-buttonset .ui-button.ui-state-active {
514
+ background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
515
+ background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
516
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
517
+ background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
518
+ background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
519
+ background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
520
+ background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
521
+ -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
522
+ -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
523
+ box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
524
+ }
525
+
526
+ /* workarounds */
527
+ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
528
+ /*
529
+ * jQuery UI Dialog 1.8.7
530
+ *
531
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
532
+ * Dual licensed under the MIT or GPL Version 2 licenses.
533
+ * http://jquery.org/license
534
+ *
535
+ * http://docs.jquery.com/UI/Dialog#theming
536
+ */
537
+ .ui-dialog { position: absolute; padding: 0; width: 300px; overflow: hidden; }
538
+ .ui-dialog {
539
+ -webkit-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
540
+ -moz-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
541
+ box-shadow: 0 2px 12px rgba(0,0,0,0.6);
542
+ outline:none;
543
+ }
544
+ .ui-dialog .ui-dialog-titlebar { padding: 0.7em 1em 0.6em 1em; position: relative; border: none; border-bottom: 1px solid #dfdfdf; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
545
+ .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; font-size: 12px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
546
+ .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .8em; top: 60%; width: 16px; margin: -10px 0 0 0; padding: 0; height: 16px; overflow:hidden; border:none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
547
+ .ui-dialog .ui-dialog-titlebar-close span { display: block; background: url(images/icon_sprite.png) 0 -16px no-repeat; top:0; left:0; margin:0; }
548
+ .ui-dialog .ui-dialog-titlebar-close span.ui-button-text { display:none; }
549
+ .ui-dialog .ui-dialog-titlebar-close:hover span { background-position: -16px -16px; }
550
+ .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; border:none; background:none; }
551
+ .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
552
+ .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
553
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
554
+ .ui-dialog .ui-dialog-buttonpane button {
555
+ margin: .5em .4em .5em 0;
556
+ cursor: pointer;
557
+ outline: none;
558
+ color: #ffffff;
559
+ border-color: #21759b #21759b #1e6a8d;
560
+ background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
561
+ background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
562
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
563
+ background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
564
+ background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
565
+ background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
566
+ background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
567
+ -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
568
+ -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
569
+ box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
570
+ }
571
+ .ui-dialog .ui-dialog-buttonpane .ui-button-text {
572
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
573
+ }
574
+ .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
575
+ .ui-draggable .ui-dialog-titlebar { cursor: move; }
576
+ /*
577
+ * jQuery UI Slider 1.8.16
578
+ *
579
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
580
+ * Dual licensed under the MIT or GPL Version 2 licenses.
581
+ * http://jquery.org/license
582
+ *
583
+ * http://docs.jquery.com/UI/Slider#theming
584
+ */
585
+ .ui-slider { position: relative; text-align: left; background: #f1f1f1; border: none; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; display: inline-block; *display: inline !important; *zoom: 1; }
586
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 17px; height: 21px; cursor: default; background: url(images/slider_handles.png) 0 0 no-repeat; outline: none; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; border: none; }
587
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background: #2e9fd2; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; }
588
+ .ui-slider .ui-slider-handle.ui-state-active { background-position: -17px 0; }
589
+
590
+ .ui-slider-horizontal { height: 7px; }
591
+ .ui-slider-horizontal .ui-slider-handle { top: -5px; margin-left: -.6em; }
592
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
593
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
594
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
595
+
596
+ .ui-slider-vertical { width: 7px; height: 100px; }
597
+ .ui-slider-vertical .ui-slider-handle { left: -.4em; margin-left: 0; margin-bottom: -.6em; }
598
+ .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
599
+ .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
600
+ .ui-slider-vertical .ui-slider-range-max { top: 0; }/*
601
+ * jQuery UI Tabs 1.8.7
602
+ *
603
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
604
+ * Dual licensed under the MIT or GPL Version 2 licenses.
605
+ * http://jquery.org/license
606
+ *
607
+ * http://docs.jquery.com/UI/Tabs#theming
608
+ */
609
+ .ui-tabs { position: relative; zoom: 1; border: 0; background: transparent; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
610
+ .ui-tabs .ui-tabs-nav { margin: 0; padding: 0; background: transparent; border-width: 0 0 1px 0; }
611
+ .ui-tabs .ui-tabs-nav {
612
+ -moz-border-radius: 0;
613
+ -webkit-border-radius: 0;
614
+ border-radius: 0;
615
+ }
616
+ .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset; -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;}
617
+ .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; font-size: 12px; font-weight: normal; outline: none; }
618
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; background: #fff; border-color: #dfdfdf; }
619
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; outline: none; color:#333; }
620
+ .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
621
+ .ui-tabs .ui-tabs-panel { display: block; border-width: 0 1px 1px 1px; padding: 1em 1.4em; background: none; }
622
+ .ui-tabs .ui-tabs-panel { background: #FFF;
623
+ -moz-border-radius: 0;
624
+ -webkit-border-radius: 0;
625
+ border-radius: 0;
626
+ }
627
+ .ui-tabs .ui-tabs-hide { display: none !important; }
628
+ /*
629
+ * jQuery UI Datepicker 1.8.7
630
+ *
631
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
632
+ * Dual licensed under the MIT or GPL Version 2 licenses.
633
+ * http://jquery.org/license
634
+ *
635
+ * http://docs.jquery.com/UI/Datepicker#theming
636
+ */
637
+ .ui-datepicker { width: 17em; padding: 0; display: none; border-color: #DDDDDD; }
638
+ .ui-datepicker {
639
+ -moz-box-shadow: 0 4px 8px rgba(0,0,0,0.5);
640
+ -webkit-box-shadow: 0 4px 8px rgba(0,0,0,0.5);
641
+ box-shadow: 0 4px 8px rgba(0,0,0,0.5);
642
+ }
643
+ .ui-datepicker .ui-datepicker-header { position:relative; padding:.35em 0; border: none; border-bottom: 1px solid #dfdfdf; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
644
+ .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 6px; width: 1.8em; height: 1.8em; }
645
+ .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { border: 1px none; }
646
+ .ui-datepicker .ui-datepicker-prev { left:2px; }
647
+ .ui-datepicker .ui-datepicker-next { right:2px; }
648
+ .ui-datepicker .ui-datepicker-prev span { background-position: 0px -32px !important; }
649
+ .ui-datepicker .ui-datepicker-next span { background-position: -16px -32px !important; }
650
+ .ui-datepicker .ui-datepicker-prev-hover span { background-position: 0px -48px !important; }
651
+ .ui-datepicker .ui-datepicker-next-hover span { background-position: -16px -48px !important; }
652
+ .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; background: url(images/icon_sprite.png) no-repeat; }
653
+ .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; font-size: 12px; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
654
+ .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
655
+ .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
656
+ .ui-datepicker select.ui-datepicker-month,
657
+ .ui-datepicker select.ui-datepicker-year { width: 49%;}
658
+ .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
659
+ .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: normal; border: 0; }
660
+ .ui-datepicker td { border: 0; padding: 1px; }
661
+ .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: center; text-decoration: none; }
662
+ .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
663
+ .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; width:auto; overflow:visible; height:25px; line-height:22px; padding: 0 10px 1px; }
664
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
665
+ .ui-datepicker table .ui-state-highlight { }
666
+ .ui-datepicker table .ui-state-hover {
667
+ border: 1px solid #dfdfdf;
668
+ background: #f9f9f9 url(images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
669
+ background: -moz-linear-gradient(top, #f9f9f9 0%, #ececec 100%); /* FF3.6+ */
670
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ececec)); /* Chrome,Safari4+ */
671
+ background: -webkit-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Chrome10+,Safari5.1+ */
672
+ background: -o-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Opera11.10+ */
673
+ background: -ms-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* IE10+ */
674
+ background: linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* W3C */
675
+ -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
676
+ -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
677
+ box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
678
+ }
679
+ .ui-datepicker-calendar .ui-state-default { background:none; border-color:#fff; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
680
+ .ui-datepicker-calendar .ui-state-active, .ui-datepicker-calendar .ui-state-active.ui-state-hover {
681
+ outline: none;
682
+ color: #ffffff;
683
+ border-color: #21759b #21759b #1e6a8d;
684
+ background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
685
+ background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
686
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
687
+ background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
688
+ background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
689
+ background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
690
+ background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
691
+ -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
692
+ -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
693
+ box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
694
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
695
+ font-weight: normal;
696
+ }
697
+
698
+ /* with multiple calendars */
699
+ .ui-datepicker.ui-datepicker-multi { width:auto; }
700
+ .ui-datepicker-multi .ui-datepicker-group { float:left; }
701
+ .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
702
+ .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
703
+ .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
704
+ .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
705
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
706
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
707
+ .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
708
+ .ui-datepicker-row-break { clear:both; width:100%; }
709
+
710
+ /* RTL support */
711
+ .ui-datepicker-rtl { direction: rtl; }
712
+ .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
713
+ .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
714
+ .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
715
+ .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
716
+ .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
717
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
718
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
719
+ .ui-datepicker-rtl .ui-datepicker-group { float:right; }
720
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
721
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
722
+
723
+ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
724
+ .ui-datepicker-cover {
725
+ display: none; /*sorry for IE5*/
726
+ display/**/: block; /*sorry for IE5*/
727
+ position: absolute; /*must have*/
728
+ z-index: -1; /*must have*/
729
+ filter: mask(); /*must have*/
730
+ top: -4px; /*must have*/
731
+ left: -4px; /*must have*/
732
+ width: 200px; /*must have*/
733
+ height: 200px; /*must have*/
734
+ }
735
+ /*
736
+ * jQuery UI Progressbar 1.8.16
737
+ *
738
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
739
+ * Dual licensed under the MIT or GPL Version 2 licenses.
740
+ * http://jquery.org/license
741
+ *
742
+ * http://docs.jquery.com/UI/Progressbar#theming
743
+ */
744
+ .ui-progressbar { height: 10px; text-align: left; border: 0 none; background: #f1f1f1; border: none; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
745
+ }
746
+ .ui-progressbar .ui-progressbar-value { margin: -1px; height:100%; border: 0 none; }
747
+ .ui-progressbar .ui-progressbar-value { background: #2e9fd2; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset;
748
+ }
749
+
750
+ /* Extra Input Field Styling */
751
+ .ui-form textarea, .ui-form input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]) {
752
+ color:#333;
753
+ padding: 3px;
754
+ -webkit-border-radius: 2px;
755
+ -moz-border-radius: 2px;
756
+ border-radius: 2px;
757
+ border: 1px solid #dfdfdf;
758
+ outline: none;
759
+ -webkit-transition: all 0.25s ease-in-out;
760
+ -moz-transition: all 0.25 ease-in-out;
761
+ -o-transition: all 0.25s ease-in-out;
762
+ -moz-box-sizing: border-box;
763
+ font-family:Arial, Helvetica, sans-serif;
764
+ font-size:12px;
765
+ }
766
+ .ui-form textarea:hover, .ui-form input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):hover {
767
+ border: 1px solid #dfdfdf;
768
+ }
769
+ .ui-form textarea:focus, .ui-form input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):focus {
770
+ border: 1px solid #aaa;
771
+ -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
772
+ -moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
773
+ box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
774
+ }
images/logo-dfactory.png ADDED
Binary file
includes/math-captcha-cf7.php ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ A module for [mathcaptcha]
4
+ **/
5
+
6
+ //shortcode handler
7
+ add_action('init', 'wpcf7_add_shortcode_mathcaptcha', 5);
8
+
9
+ function wpcf7_add_shortcode_mathcaptcha()
10
+ {
11
+ wpcf7_add_shortcode('mathcaptcha', 'wpcf7_mathcaptcha_shortcode_handler', TRUE);
12
+ }
13
+
14
+ function wpcf7_mathcaptcha_shortcode_handler($tag)
15
+ {
16
+ global $mc_class;
17
+
18
+ $tag = new WPCF7_Shortcode($tag);
19
+
20
+ if(empty($tag->name))
21
+ return '';
22
+
23
+ $validation_error = wpcf7_get_validation_error($tag->name);
24
+ $class = wpcf7_form_controls_class($tag->type);
25
+
26
+ if($validation_error)
27
+ {
28
+ $class .= ' wpcf7-not-valid';
29
+ }
30
+
31
+ $atts = array();
32
+ $atts['size'] = 2;
33
+ $atts['maxlength'] = 2;
34
+ $atts['class'] = $tag->get_class_option($class);
35
+ $atts['id'] = $tag->get_option('id', 'id', true);
36
+ $atts['tabindex'] = $tag->get_option('tabindex', 'int', true);
37
+ $atts['aria-required'] = 'true';
38
+ $atts['type'] = 'text';
39
+ $atts['name'] = $tag->name;
40
+ $atts['value'] = '';
41
+ $atts = wpcf7_format_atts($atts);
42
+
43
+ $mc_form = $mc_class->generate_captcha_phrase('cf7');
44
+ $mc_form[$mc_form['input']] = '<input %2$s />';
45
+
46
+ return sprintf('<label>'.apply_filters('math_captcha_title', $mc_class->get_attribute('title')).'</label><br /><span class="wpcf7-form-control-wrap %1$s">'.$mc_form[1].$mc_form[2].$mc_form[3].'%3$s</span>', $tag->name, $atts, $validation_error);
47
+ }
48
+
49
+
50
+ //validation
51
+ add_filter('wpcf7_validate_mathcaptcha', 'wpcf7_mathcaptcha_validation_filter', 10, 2);
52
+
53
+ function wpcf7_mathcaptcha_validation_filter($result, $tag)
54
+ {
55
+ global $mc_class;
56
+
57
+ $tag = new WPCF7_Shortcode($tag);
58
+ $name = $tag->name;
59
+
60
+ if(!is_admin() && isset($_POST[$name]))
61
+ {
62
+ if($_POST[$name] !== '')
63
+ {
64
+ if($mc_class->get_attribute('session_id') !== '' && get_transient('cf7_'.$mc_class->get_attribute('session_id')) !== FALSE)
65
+ {
66
+ if(strcmp(get_transient('cf7_'.$mc_class->get_attribute('session_id')), sha1($mc_class->get_attribute('crypt_key').$_POST[$name].$mc_class->get_attribute('session_id'), FALSE)) !== 0)
67
+ {
68
+ $result['valid'] = FALSE;
69
+ $result['reason'][$name] = wpcf7_get_message('wrong_mathcaptcha');
70
+ }
71
+ }
72
+ else
73
+ {
74
+ $result['valid'] = FALSE;
75
+ $result['reason'][$name] = wpcf7_get_message('time_mathcaptcha');
76
+ }
77
+ }
78
+ else
79
+ {
80
+ $result['valid'] = FALSE;
81
+ $result['reason'][$name] = wpcf7_get_message('fill_mathcaptcha');
82
+ }
83
+ }
84
+
85
+ return $result;
86
+ }
87
+
88
+
89
+ //messages
90
+ add_filter('wpcf7_messages', 'wpcf7_mathcaptcha_messages');
91
+
92
+ function wpcf7_mathcaptcha_messages($messages)
93
+ {
94
+ global $mc_class;
95
+
96
+ return array_merge(
97
+ $messages,
98
+ array(
99
+ 'wrong_mathcaptcha' => array(
100
+ 'description' => __('Invalid captcha value.', 'math-captcha'),
101
+ 'default' => $mc_class->err_msg['wrong']
102
+ ),
103
+ 'fill_mathcaptcha' => array(
104
+ 'description' => __('Please enter captcha value.', 'math-captcha'),
105
+ 'default' => $mc_class->err_msg['fill']
106
+ ),
107
+ 'time_mathcaptcha' => array(
108
+ 'description' => __('Captcha time expired.', 'math-captcha'),
109
+ 'default' => $mc_class->err_msg['time']
110
+ )
111
+ )
112
+ );
113
+ }
114
+
115
+
116
+ //warning message
117
+ add_action('wpcf7_admin_notices', 'wpcf7_mathcaptcha_display_warning_message');
118
+
119
+ function wpcf7_mathcaptcha_display_warning_message()
120
+ {
121
+ if(empty($_GET['post']) || !($contact_form = wpcf7_contact_form( $_GET['post'])))
122
+ return;
123
+
124
+ $has_tags = (bool)$contact_form->form_scan_shortcode(array('type' => array('mathcaptcha')));
125
+
126
+ if(!$has_tags)
127
+ return;
128
+ }
129
+
130
+
131
+ //tag generator
132
+ add_action('admin_init', 'wpcf7_add_tag_generator_mathcaptcha', 45);
133
+
134
+ function wpcf7_add_tag_generator_mathcaptcha()
135
+ {
136
+ if(!function_exists('wpcf7_add_tag_generator'))
137
+ return;
138
+
139
+ wpcf7_add_tag_generator('mathcaptcha', __('Math Captcha', 'math-captcha'), 'wpcf7-mathcaptcha', 'wpcf7_tg_pane_mathcaptcha');
140
+ }
141
+
142
+
143
+ function wpcf7_tg_pane_mathcaptcha(&$contact_form)
144
+ {
145
+ echo '
146
+ <div id="wpcf7-mathcaptcha" class="hidden">
147
+ <form action="">
148
+ <table>
149
+ <tr>
150
+ <td>
151
+ '.esc_html(__('Name', 'math-captcha')).'<br />
152
+ <input type="text" name="name" class="tg-name oneline" />
153
+ </td>
154
+ </tr>
155
+ </table>
156
+ <table class="scope mathcaptcha">
157
+ <caption>'.esc_html(__('Input field settings', 'math-captcha')).'</caption>
158
+ <tr>
159
+ <td>
160
+ <code>id</code> ('.esc_html(__('optional', 'math-captcha')).')<br />
161
+ <input type="text" name="id" class="idvalue oneline option" />
162
+ </td>
163
+ <td>
164
+ <code>class</code> ('.esc_html(__('optional', 'math-captcha')).')<br />
165
+ <input type="text" name="class" class="classvalue oneline option" />
166
+ </td>
167
+ </tr>
168
+ </table>
169
+ <div class="tg-tag">
170
+ '.esc_html(__('Copy this code and paste it into the form left.', 'math-captcha')).'<br />
171
+ <input type="text" name="mathcaptcha" class="tag" readonly="readonly" onfocus="this.select()" />
172
+ </div>
173
+ </form>
174
+ </div>';
175
+ }
176
+ ?>
index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
js/math-captcha-admin.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ jQuery(document).ready(function($) {
2
+ $('#mc_enable_for, #mc_hide_for_logged, #mc_mathematical_operations, #mc_groups').buttonset();
3
+ });
languages/math-captcha-pl_PL.mo ADDED
Binary file
languages/math-captcha-pl_PL.po ADDED
@@ -0,0 +1,666 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Math Captcha\n"
4
+ "POT-Creation-Date: 2013-06-13 20:00+0100\n"
5
+ "PO-Revision-Date: 2013-06-13 20:09+0100\n"
6
+ "Last-Translator: Bartosz Arendt <info@digitalfactory.pl>\n"
7
+ "Language-Team: dFactory <info@dfactory.eu>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.5\n"
13
+ "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../math-captcha.php:70 ../math-captcha.php:71 ../math-captcha.php:72
19
+ msgid "ERROR"
20
+ msgstr "BŁĄD"
21
+
22
+ #: ../math-captcha.php:70 ../includes/math-captcha-cf7.php:104
23
+ msgid "Please enter captcha value."
24
+ msgstr "Proszę wpisać wartość."
25
+
26
+ #: ../math-captcha.php:71 ../includes/math-captcha-cf7.php:100
27
+ msgid "Invalid captcha value."
28
+ msgstr "Nieprawidłowa wartość."
29
+
30
+ #: ../math-captcha.php:72 ../includes/math-captcha-cf7.php:108
31
+ msgid "Captcha time expired."
32
+ msgstr "Upłynął czas."
33
+
34
+ #: ../math-captcha.php:503
35
+ msgid "one"
36
+ msgstr "jeden"
37
+
38
+ #: ../math-captcha.php:504
39
+ msgid "two"
40
+ msgstr "dwa"
41
+
42
+ #: ../math-captcha.php:505
43
+ msgid "three"
44
+ msgstr "trzy"
45
+
46
+ #: ../math-captcha.php:506
47
+ msgid "four"
48
+ msgstr "cztery"
49
+
50
+ #: ../math-captcha.php:507
51
+ msgid "five"
52
+ msgstr "pięć"
53
+
54
+ #: ../math-captcha.php:508
55
+ msgid "six"
56
+ msgstr "sześć"
57
+
58
+ #: ../math-captcha.php:509
59
+ msgid "seven"
60
+ msgstr "siedem"
61
+
62
+ #: ../math-captcha.php:510
63
+ msgid "eight"
64
+ msgstr "osiem"
65
+
66
+ #: ../math-captcha.php:511
67
+ msgid "nine"
68
+ msgstr "dziewięć"
69
+
70
+ #: ../math-captcha.php:512
71
+ msgid "ten"
72
+ msgstr "dziesięć"
73
+
74
+ #: ../math-captcha.php:513
75
+ msgid "eleven"
76
+ msgstr "jedenaście"
77
+
78
+ #: ../math-captcha.php:514
79
+ msgid "twelve"
80
+ msgstr "dwanaście"
81
+
82
+ #: ../math-captcha.php:515
83
+ msgid "thirteen"
84
+ msgstr "trzynaście"
85
+
86
+ #: ../math-captcha.php:516
87
+ msgid "fourteen"
88
+ msgstr "czternaście"
89
+
90
+ #: ../math-captcha.php:517
91
+ msgid "fifteen"
92
+ msgstr "piętnaście"
93
+
94
+ #: ../math-captcha.php:518
95
+ msgid "sixteen"
96
+ msgstr "szesnaście"
97
+
98
+ #: ../math-captcha.php:519
99
+ msgid "seventeen"
100
+ msgstr "siedemnaście"
101
+
102
+ #: ../math-captcha.php:520
103
+ msgid "eighteen"
104
+ msgstr "osiemnaście"
105
+
106
+ #: ../math-captcha.php:521
107
+ msgid "nineteen"
108
+ msgstr "dziewiętnaście"
109
+
110
+ #: ../math-captcha.php:522
111
+ msgid "twenty"
112
+ msgstr "dwadzieścia"
113
+
114
+ #: ../math-captcha.php:523
115
+ msgid "thirty"
116
+ msgstr "trzydzieści"
117
+
118
+ #: ../math-captcha.php:524
119
+ msgid "forty"
120
+ msgstr "czterdzieści"
121
+
122
+ #: ../math-captcha.php:525
123
+ msgid "fifty"
124
+ msgstr "pięćdziesiąt"
125
+
126
+ #: ../math-captcha.php:526
127
+ msgid "sixty"
128
+ msgstr "sześćdziesiąt"
129
+
130
+ #: ../math-captcha.php:527
131
+ msgid "seventy"
132
+ msgstr "siedemdziesiąt"
133
+
134
+ #: ../math-captcha.php:528
135
+ msgid "eighty"
136
+ msgstr "osiemdziesiąt"
137
+
138
+ #: ../math-captcha.php:529
139
+ msgid "ninety"
140
+ msgstr "dziewięćdziesiąt"
141
+
142
+ #: ../math-captcha.php:824
143
+ msgid "login form"
144
+ msgstr "formularz logowania"
145
+
146
+ #: ../math-captcha.php:825
147
+ msgid "registration form"
148
+ msgstr "formularz rejestracji"
149
+
150
+ #: ../math-captcha.php:826
151
+ msgid "reset password form"
152
+ msgstr "resetowanie hasła"
153
+
154
+ #: ../math-captcha.php:827
155
+ msgid "comment form"
156
+ msgstr "komentarze"
157
+
158
+ #: ../math-captcha.php:828
159
+ msgid "bbpress"
160
+ msgstr "bbpress"
161
+
162
+ #: ../math-captcha.php:829
163
+ msgid "contact form 7"
164
+ msgstr "contact form 7"
165
+
166
+ #: ../math-captcha.php:832
167
+ msgid "yes"
168
+ msgstr "tak"
169
+
170
+ #: ../math-captcha.php:833
171
+ msgid "no"
172
+ msgstr "nie"
173
+
174
+ #: ../math-captcha.php:836
175
+ msgid "addition (+)"
176
+ msgstr "dodawanie (+)"
177
+
178
+ #: ../math-captcha.php:837
179
+ msgid "subtraction (-)"
180
+ msgstr "odejmowanie (-)"
181
+
182
+ #: ../math-captcha.php:838
183
+ msgid "multiplication (&#215;)"
184
+ msgstr "mnożenie (&#215;)"
185
+
186
+ #: ../math-captcha.php:839
187
+ msgid "division (&#247;)"
188
+ msgstr "dzielenie (&#247;)"
189
+
190
+ #: ../math-captcha.php:842
191
+ msgid "numbers"
192
+ msgstr "liczby"
193
+
194
+ #: ../math-captcha.php:843
195
+ msgid "words"
196
+ msgstr "słowa"
197
+
198
+ #: ../math-captcha.php:852
199
+ msgid "Math Captcha settings"
200
+ msgstr "Ustawienia Math Captcha"
201
+
202
+ #: ../math-captcha.php:853
203
+ msgid "Enable Math Captcha for"
204
+ msgstr "Włącz captcha dla"
205
+
206
+ #: ../math-captcha.php:854
207
+ msgid "Hide for logged in users"
208
+ msgstr "Ukryj dla zalogowanych"
209
+
210
+ #: ../math-captcha.php:855
211
+ msgid "Mathematical operations"
212
+ msgstr "Operacje matematyczne"
213
+
214
+ #: ../math-captcha.php:856
215
+ msgid "Display captcha as"
216
+ msgstr "Wyśiwtlaj captcha jako"
217
+
218
+ #: ../math-captcha.php:857
219
+ msgid "Captcha field title"
220
+ msgstr "Tytuł pola captcha"
221
+
222
+ #: ../math-captcha.php:858
223
+ msgid "Captcha time"
224
+ msgstr "Czas captcha"
225
+
226
+ #: ../math-captcha.php:875
227
+ msgid "Select were would you like to use Math Captcha."
228
+ msgstr "Wybierz w których miejscach chcesz używać Math Captcha"
229
+
230
+ #: ../math-captcha.php:893
231
+ msgid "Would you like to hide captcha for logged in users?"
232
+ msgstr "Czy chcesz ukryć captcha dla zalogowanych użytkowników?"
233
+
234
+ #: ../math-captcha.php:903
235
+ msgid ""
236
+ "Select what kind of mathematical operation will be used to generate captcha."
237
+ msgstr ""
238
+ "Wybierz jakie rodzaje operacji matematycznych będą stosowane w captcha."
239
+
240
+ #: ../math-captcha.php:913
241
+ msgid "Enter the time (in seconds) a user has to enter captcha value."
242
+ msgstr "Podaj czas (w sekundach) w jakim należy uzupełnić pole captcha."
243
+
244
+ #: ../math-captcha.php:931 ../math-captcha.php:949
245
+ msgid "Opis"
246
+ msgstr ""
247
+
248
+ #: ../math-captcha.php:991
249
+ msgid ""
250
+ "You need to check at least one mathematical operation. Defaults settings of "
251
+ "this option restored."
252
+ msgstr ""
253
+ "Musisz wybrać przynajmniej jedną operację. Przywrócono domyślne ustawienie "
254
+ "tej opcji."
255
+
256
+ #: ../math-captcha.php:1007
257
+ msgid ""
258
+ "You need to check at least one group. Defaults settings of this option "
259
+ "restored."
260
+ msgstr ""
261
+ "Musisz wybrać przynajmniej jedną grupę. Przywrócono domyślne ustawienie tej "
262
+ "opcji."
263
+
264
+ #: ../math-captcha.php:1034 ../math-captcha.php:1035 ../math-captcha.php:1047
265
+ #: ../math-captcha.php:1060 ../includes/math-captcha-cf7.php:139
266
+ msgid "Math Captcha"
267
+ msgstr "Math Captcha"
268
+
269
+ #: ../math-captcha.php:1062
270
+ msgid "Need support?"
271
+ msgstr "Potrzebujesz pomocy?"
272
+
273
+ #: ../math-captcha.php:1063
274
+ msgid ""
275
+ "If you are having problems with this plugin, please talk about them in the"
276
+ msgstr "Jeśli masz jakiekolwiek problemy z tą wtyczką, powiedz o tym na"
277
+
278
+ #: ../math-captcha.php:1063
279
+ msgid "Support forum"
280
+ msgstr "Forum pomocy"
281
+
282
+ #: ../math-captcha.php:1065
283
+ msgid "Do you like this plugin?"
284
+ msgstr "Lubisz tę wtyczkę?"
285
+
286
+ #: ../math-captcha.php:1066
287
+ msgid "Rate it 5"
288
+ msgstr "Oceń ją na 5"
289
+
290
+ #: ../math-captcha.php:1066
291
+ msgid "on WordPress.org"
292
+ msgstr "na WordPress.org"
293
+
294
+ #: ../math-captcha.php:1067
295
+ msgid "Blog about it & link to the"
296
+ msgstr "Napisz o niej i dodaj link do"
297
+
298
+ #: ../math-captcha.php:1067
299
+ msgid "plugin page"
300
+ msgstr "strony wtyczki"
301
+
302
+ #: ../math-captcha.php:1068
303
+ msgid "Check out our other"
304
+ msgstr "Sprawdź nasze inne"
305
+
306
+ #: ../math-captcha.php:1068
307
+ msgid "WordPress plugins"
308
+ msgstr "wtyczki do WordPressa"
309
+
310
+ #: ../math-captcha.php:1071
311
+ msgid "Created by"
312
+ msgstr "Stworzone przez"
313
+
314
+ #: ../math-captcha.php:1132
315
+ msgid "Support"
316
+ msgstr "Forum pomocy"
317
+
318
+ #: ../math-captcha.php:1154
319
+ msgid "Settings"
320
+ msgstr "Ustawienia"
321
+
322
+ #: ../includes/math-captcha-cf7.php:151
323
+ msgid "Name"
324
+ msgstr "Nazwa"
325
+
326
+ #: ../includes/math-captcha-cf7.php:157
327
+ msgid "Input field settings"
328
+ msgstr "Ustawienia pola"
329
+
330
+ #: ../includes/math-captcha-cf7.php:160 ../includes/math-captcha-cf7.php:164
331
+ msgid "optional"
332
+ msgstr "opcjonalne"
333
+
334
+ #: ../includes/math-captcha-cf7.php:170
335
+ msgid "Copy this code and paste it into the form left."
336
+ msgstr "Skopij i wkej ten kod do formularza po lewej."
337
+
338
+ #~ msgid "form top"
339
+ #~ msgstr "na górze formularza"
340
+
341
+ #~ msgid "before form fields"
342
+ #~ msgstr "przed polami formularza"
343
+
344
+ #~ msgid "form bottom"
345
+ #~ msgstr "na dole formularza"
346
+
347
+ #~ msgid "after form"
348
+ #~ msgstr "po formularzu"
349
+
350
+ #~ msgid "WordPress default"
351
+ #~ msgstr "Domyślny WordPressa"
352
+
353
+ #~ msgid "Bootstrap"
354
+ #~ msgstr "Bootstrap"
355
+
356
+ #~ msgid "do not hide"
357
+ #~ msgstr "nie ukrywaj"
358
+
359
+ #~ msgid "1 second"
360
+ #~ msgstr "1 sekunda"
361
+
362
+ #~ msgid "2 seconds"
363
+ #~ msgstr "2 sekundy"
364
+
365
+ #~ msgid "3 seconds"
366
+ #~ msgstr "3 sekundy"
367
+
368
+ #~ msgid "5 seconds"
369
+ #~ msgstr "5 sekund"
370
+
371
+ #~ msgid "10 seconds"
372
+ #~ msgstr "10 sekund"
373
+
374
+ #~ msgid "fade"
375
+ #~ msgstr "zanikanie"
376
+
377
+ #~ msgid "slide"
378
+ #~ msgstr "zjeżdżanie"
379
+
380
+ #~ msgid "approved"
381
+ #~ msgstr "zatwierdzone"
382
+
383
+ #~ msgid "unapproved"
384
+ #~ msgstr "niezatwierdzone"
385
+
386
+ #~ msgid "trash"
387
+ #~ msgstr "w koszu"
388
+
389
+ #~ msgid "spam"
390
+ #~ msgstr "spam"
391
+
392
+ #~ msgid "Inline Edit"
393
+ #~ msgstr "Edycja"
394
+
395
+ #~ msgid "Messages"
396
+ #~ msgstr "Komunikaty"
397
+
398
+ #~ msgid "Edit"
399
+ #~ msgstr "Edytuj"
400
+
401
+ #~ msgid "Save"
402
+ #~ msgstr "Zapisz"
403
+
404
+ #~ msgid "Cancel"
405
+ #~ msgstr "Anuluj"
406
+
407
+ #~ msgid "Time remaining"
408
+ #~ msgstr "Pozostały czas"
409
+
410
+ #~ msgid "Delete"
411
+ #~ msgstr "Usuń"
412
+
413
+ #~ msgid "Unapprove"
414
+ #~ msgstr "Odrzuć"
415
+
416
+ #~ msgid "Spam"
417
+ #~ msgstr "Oznacz jako spam"
418
+
419
+ #~ msgid "Trash"
420
+ #~ msgstr "Kosz"
421
+
422
+ #~ msgid "Approve"
423
+ #~ msgstr "Zatwierdź"
424
+
425
+ #~ msgid "Restore"
426
+ #~ msgstr "Przywróć"
427
+
428
+ #~ msgid "Unspam"
429
+ #~ msgstr "Odznacz spam"
430
+
431
+ #~ msgid "Comments statuses"
432
+ #~ msgstr "Statusy komentarzy"
433
+
434
+ #~ msgid "Comment Edit Timer"
435
+ #~ msgstr "Edycja komentarza"
436
+
437
+ #~ msgid "Editing time"
438
+ #~ msgstr "Czas edycji"
439
+
440
+ #~ msgid "Delete permanently button"
441
+ #~ msgstr "Przycisk Usuń"
442
+
443
+ #~ msgid "Edit comment effect"
444
+ #~ msgstr "Efekt przy edycji komentarza"
445
+
446
+ #~ msgid "CSS style"
447
+ #~ msgstr "Styl CSS"
448
+
449
+ #~ msgid "Show on hover"
450
+ #~ msgstr "Pokaż po najechaniu"
451
+
452
+ #~ msgid "Highlight comments"
453
+ #~ msgstr "Podświetlanie komentarzy"
454
+
455
+ #~ msgid "Highlight colors"
456
+ #~ msgstr "Kolory podświetlenia"
457
+
458
+ #~ msgid "Messages Settings"
459
+ #~ msgstr "Ustawienia komunikatów"
460
+
461
+ #~ msgid "Message box position for logged in users"
462
+ #~ msgstr "Pozycja pola z komunikatami dla zalogowanych użytkowników"
463
+
464
+ #~ msgid "Message box position for logged out users"
465
+ #~ msgstr "Pozycja pola z komunikatami dla niezalogowanych użytkowników"
466
+
467
+ #~ msgid "Show message effect"
468
+ #~ msgstr "Efekt wyświetlania komunikatów"
469
+
470
+ #~ msgid "Hide message effect"
471
+ #~ msgstr "Efekt ukrywania komunikatów"
472
+
473
+ #~ msgid "Hide message after"
474
+ #~ msgstr "Ukrywanie komunikatów po"
475
+
476
+ #~ msgid ""
477
+ #~ "Comment timer allows users to edit their comments for specified time."
478
+ #~ msgstr ""
479
+ #~ "Stoper komentarza pozwala użytkownikom na edycję ich komentarzy przez "
480
+ #~ "określony czas."
481
+
482
+ #~ msgid "How much time (in minutes) a user has to edit a published comment"
483
+ #~ msgstr ""
484
+ #~ "Jak długo (w minutach) użtkownik może edytować opublikowany komentarz"
485
+
486
+ #~ msgid "Pick highlight colors for specific comment statuses"
487
+ #~ msgstr "Wybierz kolory podświetlenia określonych statusów komentarzy"
488
+
489
+ #~ msgid "Highlight comments with specific colors"
490
+ #~ msgstr "Podświetl komentarze określonym kolorem"
491
+
492
+ #~ msgid "Show inline edit actions only on hovering over a comment"
493
+ #~ msgstr "Wyświetl przyciski tylko po najechaniu myszką na komentarz"
494
+
495
+ #~ msgid ""
496
+ #~ "Select comments of which statuses will be available for moderation on the "
497
+ #~ "front-end of your site"
498
+ #~ msgstr ""
499
+ #~ "Wybierz statusy komentarzy, które będą dostępne do moderacji na stronie"
500
+
501
+ #~ msgid ""
502
+ #~ "This will add Delete to edit buttons that allows you to permanently "
503
+ #~ "delete comments"
504
+ #~ msgstr ""
505
+ #~ "Zostanie dodany przycisk Usuń do przycików edycji, który umożliwia trwałe "
506
+ #~ "usunięcie komentarzy"
507
+
508
+ #~ msgid "Select animation for showing messages"
509
+ #~ msgstr "Wybierz animację przy wyświetlaniu komunikatów"
510
+
511
+ #~ msgid "Select animation for hiding messages"
512
+ #~ msgstr "Wybierz animację przy ukrywaniu komunikatów"
513
+
514
+ #~ msgid "Select animation effect for edit comment"
515
+ #~ msgstr "Wybierz animację przy edycji komentarza"
516
+
517
+ #~ msgid "Choose your message box style"
518
+ #~ msgstr "Wybierz styl dla pola z komunikatami"
519
+
520
+ #~ msgid "Select style for Inline Edit buttons"
521
+ #~ msgstr "Wybierz styl dla przycisków edycji"
522
+
523
+ #~ msgid "Select for how long message box should be displayed"
524
+ #~ msgstr "Wybierz przez jaki czas ma być wyświetlany komunikat"
525
+
526
+ #~ msgid "Select message box position for logged in users"
527
+ #~ msgstr "Wybierz pozycję pola z komunikatami dla zalogowanych użytkowników"
528
+
529
+ #~ msgid "Select message box position for logged out users"
530
+ #~ msgstr ""
531
+ #~ "Wybierz pozycję pola z komunikatami dla niezalogowanych użytkowników"
532
+
533
+ #~ msgid "Ajaxed Comments"
534
+ #~ msgstr "Komentarze Ajax"
535
+
536
+ #~ msgid "Ajaxed Comments Settings"
537
+ #~ msgstr "Ustawienia komentarzy Ajax"
538
+
539
+ #~ msgid "Error has occurred. Please try again later or reload a page."
540
+ #~ msgstr ""
541
+ #~ "Wystąpił nieznany błąd. Proszę spróbować później lub odświeżyć stronę."
542
+
543
+ #~ msgid "Comment is empty."
544
+ #~ msgstr "Komentarz jest pusty."
545
+
546
+ #~ msgid "Are you sure you want to delete this comment?"
547
+ #~ msgstr "Jesteś pewny, że chcesz usunąć ten komentarz."
548
+
549
+ #~ msgid "Unknown error has occurred."
550
+ #~ msgstr "Wystąpił nieznany błąd."
551
+
552
+ #~ msgid "Widgets"
553
+ #~ msgstr "Widgety"
554
+
555
+ #~ msgid "Custom Post Types"
556
+ #~ msgstr "Własne typy wpisów"
557
+
558
+ #~ msgid "Custom Post Type Archives"
559
+ #~ msgstr "Archiwa własnych typów wpisów"
560
+
561
+ #~ msgid "Categories"
562
+ #~ msgstr "Kategorie"
563
+
564
+ #~ msgid "Taxonomies"
565
+ #~ msgstr "Taksonomie"
566
+
567
+ #~ msgid "Others"
568
+ #~ msgstr "Inne"
569
+
570
+ #~ msgid "Users"
571
+ #~ msgstr "Użytkownicy"
572
+
573
+ #~ msgid "Languages"
574
+ #~ msgstr "Języki"
575
+
576
+ #~ msgid "Front Page"
577
+ #~ msgstr "Strona główna"
578
+
579
+ #~ msgid "Blog Page"
580
+ #~ msgstr "Strona z wpisami"
581
+
582
+ #~ msgid "Single Posts"
583
+ #~ msgstr "Pojedyncze wpisy"
584
+
585
+ #~ msgid "Sticky Posts"
586
+ #~ msgstr "Wpisy przyklejone"
587
+
588
+ #~ msgid "Author Archive"
589
+ #~ msgstr "Archiwum autora"
590
+
591
+ #~ msgid "Date Archive"
592
+ #~ msgstr "Archiwum daty"
593
+
594
+ #~ msgid "404 Page"
595
+ #~ msgstr "Strona błędów 404"
596
+
597
+ #~ msgid "Search Page"
598
+ #~ msgstr "Strona wyszukiwania"
599
+
600
+ #~ msgid "Logged out users"
601
+ #~ msgstr "Wylogowani użytkownicy"
602
+
603
+ #~ msgid "Restrict widgets"
604
+ #~ msgstr "Ograniczenia widgetów"
605
+
606
+ #~ msgid ""
607
+ #~ "Use this settings to manage access to widgets page and to restrict "
608
+ #~ "availability of certain widgets, sidebars and widgets options to site "
609
+ #~ "administrators only."
610
+ #~ msgstr ""
611
+ #~ "Użyj tych ustawień aby określić kto może mieć dostęp do widgetów, jakie "
612
+ #~ "widgety, panele boczne i ustawienia widgetów są dostępne dla użytkowników "
613
+ #~ "a jakie tylko dla administratorów."
614
+
615
+ #~ msgid "Restrict Users"
616
+ #~ msgstr "Ograniczenia użytkowników"
617
+
618
+ #~ msgid "Select user roles restricted to manage widgets."
619
+ #~ msgstr "Wybierz role użytkowników, którzy mogą zarządzać widgetami."
620
+
621
+ #~ msgid "Restrict Sidebars"
622
+ #~ msgstr "Ograniczenia paneli bocznych"
623
+
624
+ #~ msgid "Select which sidebars will be restricted to admins only."
625
+ #~ msgstr ""
626
+ #~ "Wybierz panele boczne, które będą dostępne tylko dla administratorów."
627
+
628
+ #~ msgid "Restrict Widgets"
629
+ #~ msgstr "Ograniczenia widgetów"
630
+
631
+ #~ msgid "Select which widgets will be restricted to admins only."
632
+ #~ msgstr "Wybierz widgety, któe będą dostępne tylko dla administratorów."
633
+
634
+ #~ msgid "Restrict Widget Options"
635
+ #~ msgstr "Ograniczenia opcji widgetów"
636
+
637
+ #~ msgid "Select which widget options will be restricted to admins only."
638
+ #~ msgstr ""
639
+ #~ "Wybierz które opcje widgetów, będą dostępne tylko dla administratorów."
640
+
641
+ #~ msgid "Restrict Option Groups"
642
+ #~ msgstr "Ograniczenia grup opcji"
643
+
644
+ #~ msgid "Display widget options in groups"
645
+ #~ msgstr "Wyświetl opcje widgetów w grupach"
646
+
647
+ #~ msgid "Plugin Deactivation"
648
+ #~ msgstr "Deaktywacja wtyczki"
649
+
650
+ #~ msgid "Remove all plugin data on deactivation"
651
+ #~ msgstr "Usuń wszystkie dane wtyczki podczas deaktywacji"
652
+
653
+ #~ msgid "Single %s"
654
+ #~ msgstr "Pojedyncze %s"
655
+
656
+ #~ msgid "%s Archive"
657
+ #~ msgstr "Archiwum %s"
658
+
659
+ #~ msgid "Display / Hide Widget"
660
+ #~ msgstr "Wyświetl / Ukryj widget"
661
+
662
+ #~ msgid "Display widget on selected"
663
+ #~ msgstr "Wyświetl widget na wybranych stronach"
664
+
665
+ #~ msgid "Hide widget on selected"
666
+ #~ msgstr "Ukryj widget na wybranych stronach"
languages/math-captcha.pot ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Math Captcha\n"
4
+ "POT-Creation-Date: 2013-06-13 19:58+0100\n"
5
+ "PO-Revision-Date: 2013-06-13 20:00+0100\n"
6
+ "Last-Translator: Bartosz Arendt <info@digitalfactory.pl>\n"
7
+ "Language-Team: dFactory <info@dfactory.eu>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.5\n"
13
+ "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../math-captcha.php:70 ../math-captcha.php:71 ../math-captcha.php:72
19
+ msgid "ERROR"
20
+ msgstr ""
21
+
22
+ #: ../math-captcha.php:70 ../includes/math-captcha-cf7.php:104
23
+ msgid "Please enter captcha value."
24
+ msgstr ""
25
+
26
+ #: ../math-captcha.php:71 ../includes/math-captcha-cf7.php:100
27
+ msgid "Invalid captcha value."
28
+ msgstr ""
29
+
30
+ #: ../math-captcha.php:72 ../includes/math-captcha-cf7.php:108
31
+ msgid "Captcha time expired."
32
+ msgstr ""
33
+
34
+ #: ../math-captcha.php:503
35
+ msgid "one"
36
+ msgstr ""
37
+
38
+ #: ../math-captcha.php:504
39
+ msgid "two"
40
+ msgstr ""
41
+
42
+ #: ../math-captcha.php:505
43
+ msgid "three"
44
+ msgstr ""
45
+
46
+ #: ../math-captcha.php:506
47
+ msgid "four"
48
+ msgstr ""
49
+
50
+ #: ../math-captcha.php:507
51
+ msgid "five"
52
+ msgstr ""
53
+
54
+ #: ../math-captcha.php:508
55
+ msgid "six"
56
+ msgstr ""
57
+
58
+ #: ../math-captcha.php:509
59
+ msgid "seven"
60
+ msgstr ""
61
+
62
+ #: ../math-captcha.php:510
63
+ msgid "eight"
64
+ msgstr ""
65
+
66
+ #: ../math-captcha.php:511
67
+ msgid "nine"
68
+ msgstr ""
69
+
70
+ #: ../math-captcha.php:512
71
+ msgid "ten"
72
+ msgstr ""
73
+
74
+ #: ../math-captcha.php:513
75
+ msgid "eleven"
76
+ msgstr ""
77
+
78
+ #: ../math-captcha.php:514
79
+ msgid "twelve"
80
+ msgstr ""
81
+
82
+ #: ../math-captcha.php:515
83
+ msgid "thirteen"
84
+ msgstr ""
85
+
86
+ #: ../math-captcha.php:516
87
+ msgid "fourteen"
88
+ msgstr ""
89
+
90
+ #: ../math-captcha.php:517
91
+ msgid "fifteen"
92
+ msgstr ""
93
+
94
+ #: ../math-captcha.php:518
95
+ msgid "sixteen"
96
+ msgstr ""
97
+
98
+ #: ../math-captcha.php:519
99
+ msgid "seventeen"
100
+ msgstr ""
101
+
102
+ #: ../math-captcha.php:520
103
+ msgid "eighteen"
104
+ msgstr ""
105
+
106
+ #: ../math-captcha.php:521
107
+ msgid "nineteen"
108
+ msgstr ""
109
+
110
+ #: ../math-captcha.php:522
111
+ msgid "twenty"
112
+ msgstr ""
113
+
114
+ #: ../math-captcha.php:523
115
+ msgid "thirty"
116
+ msgstr ""
117
+
118
+ #: ../math-captcha.php:524
119
+ msgid "forty"
120
+ msgstr ""
121
+
122
+ #: ../math-captcha.php:525
123
+ msgid "fifty"
124
+ msgstr ""
125
+
126
+ #: ../math-captcha.php:526
127
+ msgid "sixty"
128
+ msgstr ""
129
+
130
+ #: ../math-captcha.php:527
131
+ msgid "seventy"
132
+ msgstr ""
133
+
134
+ #: ../math-captcha.php:528
135
+ msgid "eighty"
136
+ msgstr ""
137
+
138
+ #: ../math-captcha.php:529
139
+ msgid "ninety"
140
+ msgstr ""
141
+
142
+ #: ../math-captcha.php:824
143
+ msgid "login form"
144
+ msgstr ""
145
+
146
+ #: ../math-captcha.php:825
147
+ msgid "registration form"
148
+ msgstr ""
149
+
150
+ #: ../math-captcha.php:826
151
+ msgid "reset password form"
152
+ msgstr ""
153
+
154
+ #: ../math-captcha.php:827
155
+ msgid "comment form"
156
+ msgstr ""
157
+
158
+ #: ../math-captcha.php:828
159
+ msgid "bbpress"
160
+ msgstr ""
161
+
162
+ #: ../math-captcha.php:829
163
+ msgid "contact form 7"
164
+ msgstr ""
165
+
166
+ #: ../math-captcha.php:832
167
+ msgid "yes"
168
+ msgstr ""
169
+
170
+ #: ../math-captcha.php:833
171
+ msgid "no"
172
+ msgstr ""
173
+
174
+ #: ../math-captcha.php:836
175
+ msgid "addition (+)"
176
+ msgstr ""
177
+
178
+ #: ../math-captcha.php:837
179
+ msgid "subtraction (-)"
180
+ msgstr ""
181
+
182
+ #: ../math-captcha.php:838
183
+ msgid "multiplication (&#215;)"
184
+ msgstr ""
185
+
186
+ #: ../math-captcha.php:839
187
+ msgid "division (&#247;)"
188
+ msgstr ""
189
+
190
+ #: ../math-captcha.php:842
191
+ msgid "numbers"
192
+ msgstr ""
193
+
194
+ #: ../math-captcha.php:843
195
+ msgid "words"
196
+ msgstr ""
197
+
198
+ #: ../math-captcha.php:852
199
+ msgid "Math Captcha settings"
200
+ msgstr ""
201
+
202
+ #: ../math-captcha.php:853
203
+ msgid "Enable Math Captcha for"
204
+ msgstr ""
205
+
206
+ #: ../math-captcha.php:854
207
+ msgid "Hide for logged in users"
208
+ msgstr ""
209
+
210
+ #: ../math-captcha.php:855
211
+ msgid "Mathematical operations"
212
+ msgstr ""
213
+
214
+ #: ../math-captcha.php:856
215
+ msgid "Display captcha as"
216
+ msgstr ""
217
+
218
+ #: ../math-captcha.php:857
219
+ msgid "Captcha field title"
220
+ msgstr ""
221
+
222
+ #: ../math-captcha.php:858
223
+ msgid "Captcha time"
224
+ msgstr ""
225
+
226
+ #: ../math-captcha.php:875
227
+ msgid "Select were would you like to use Math Captcha."
228
+ msgstr ""
229
+
230
+ #: ../math-captcha.php:893
231
+ msgid "Would you like to hide captcha for logged in users?"
232
+ msgstr ""
233
+
234
+ #: ../math-captcha.php:903
235
+ msgid ""
236
+ "Select what kind of mathematical operation will be used to generate captcha."
237
+ msgstr ""
238
+
239
+ #: ../math-captcha.php:913
240
+ msgid "Enter the time (in seconds) a user has to enter captcha value."
241
+ msgstr ""
242
+
243
+ #: ../math-captcha.php:931 ../math-captcha.php:949
244
+ msgid "Opis"
245
+ msgstr ""
246
+
247
+ #: ../math-captcha.php:991
248
+ msgid ""
249
+ "You need to check at least one mathematical operation. Defaults settings of "
250
+ "this option restored."
251
+ msgstr ""
252
+
253
+ #: ../math-captcha.php:1007
254
+ msgid ""
255
+ "You need to check at least one group. Defaults settings of this option "
256
+ "restored."
257
+ msgstr ""
258
+
259
+ #: ../math-captcha.php:1034 ../math-captcha.php:1035 ../math-captcha.php:1047
260
+ #: ../math-captcha.php:1060 ../includes/math-captcha-cf7.php:139
261
+ msgid "Math Captcha"
262
+ msgstr ""
263
+
264
+ #: ../math-captcha.php:1062
265
+ msgid "Need support?"
266
+ msgstr ""
267
+
268
+ #: ../math-captcha.php:1063
269
+ msgid ""
270
+ "If you are having problems with this plugin, please talk about them in the"
271
+ msgstr ""
272
+
273
+ #: ../math-captcha.php:1063
274
+ msgid "Support forum"
275
+ msgstr ""
276
+
277
+ #: ../math-captcha.php:1065
278
+ msgid "Do you like this plugin?"
279
+ msgstr ""
280
+
281
+ #: ../math-captcha.php:1066
282
+ msgid "Rate it 5"
283
+ msgstr ""
284
+
285
+ #: ../math-captcha.php:1066
286
+ msgid "on WordPress.org"
287
+ msgstr ""
288
+
289
+ #: ../math-captcha.php:1067
290
+ msgid "Blog about it & link to the"
291
+ msgstr ""
292
+
293
+ #: ../math-captcha.php:1067
294
+ msgid "plugin page"
295
+ msgstr ""
296
+
297
+ #: ../math-captcha.php:1068
298
+ msgid "Check out our other"
299
+ msgstr ""
300
+
301
+ #: ../math-captcha.php:1068
302
+ msgid "WordPress plugins"
303
+ msgstr ""
304
+
305
+ #: ../math-captcha.php:1071
306
+ msgid "Created by"
307
+ msgstr ""
308
+
309
+ #: ../math-captcha.php:1132
310
+ msgid "Support"
311
+ msgstr ""
312
+
313
+ #: ../math-captcha.php:1154
314
+ msgid "Settings"
315
+ msgstr ""
316
+
317
+ #: ../includes/math-captcha-cf7.php:151
318
+ msgid "Name"
319
+ msgstr ""
320
+
321
+ #: ../includes/math-captcha-cf7.php:157
322
+ msgid "Input field settings"
323
+ msgstr ""
324
+
325
+ #: ../includes/math-captcha-cf7.php:160 ../includes/math-captcha-cf7.php:164
326
+ msgid "optional"
327
+ msgstr ""
328
+
329
+ #: ../includes/math-captcha-cf7.php:170
330
+ msgid "Copy this code and paste it into the form left."
331
+ msgstr ""
readme.txt ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Math Captcha ===
2
+ Contributors: dfactory
3
+ Donate link: http://www.dfactory.eu/
4
+ Tags: antispam, capcha, captcha, captha, catcha, comment, comments, spam, security, login, lost password, math captcha, registration, cf7, contact, contact forms, form, contact form 7, bbpress
5
+ Requires at least: 3.3
6
+ Tested up to: 3.5.1
7
+ Stable tag: 1.0.0
8
+ License: MIT License
9
+ License URI: http://opensource.org/licenses/MIT
10
+
11
+ Math Captcha is a very effective CAPTCHA for WordPress that integrates into login, registration, comments, bbPress and Contact Form 7.
12
+
13
+ == Description ==
14
+
15
+ [Math Captcha](http://www.dfactory.eu/plugins/math-captcha/) is a very effective and easy to use CAPTCHA for WordPress that seamlessly integrates into login, registration, lost password, comments, bbPress and Contact Form 7.
16
+
17
+ For more information, check out the [plugin page](http://www.dfactory.eu/plugins/math-captcha/) or see the [Support Forum](http://www.dfactory.eu/support/).
18
+
19
+ = Features include: =
20
+
21
+ * Select where to use math captcha: login, registration and lost password forms, comments, bbPress and Contact Form 7
22
+ * Hiding captcha for logged in users
23
+ * Select which mathematical operation to use
24
+ * Displaying captcha as numbers and/or words
25
+ * Option to set captcha field title
26
+ * Option to set captcha input time
27
+ * .pot file for translations included
28
+
29
+
30
+ == Installation ==
31
+
32
+ 1. Install Math Captcha either via the WordPress.org plugin directory, or by uploading the files to your server</li>
33
+ 1. Activate the plugin through the 'Plugins' menu in WordPress</li>
34
+ 1. Go to the Math Captcha menu and set your captcha display settings.</li>
35
+
36
+ == Frequently Asked Questions ==
37
+
38
+ No questions yet.
39
+
40
+ == Screenshots ==
41
+
42
+ 1. screenshot-1.png
43
+
44
+ == Changelog ==
45
+
46
+ = 1.0.0 =
47
+ * Initial release
48
+
49
+ == Upgrade Notice ==
50
+
51
+ = 1.0.0 =
52
+ Initial Math Captcha release
wp-math-captcha.php ADDED
@@ -0,0 +1,1235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Math Captcha
4
+ Description: Math Captcha is a <strong>very effective CAPTCHA for WordPress</strong> that integrates into login, registration, comments, bbPress and Contact Form 7.
5
+ Version: 1.0.0
6
+ Author: dFactory
7
+ Author URI: http://www.dfactory.eu/
8
+ Plugin URI: http://www.dfactory.eu/plugins/math-captcha/
9
+ License: MIT License
10
+ License URI: http://opensource.org/licenses/MIT
11
+
12
+ Math Captcha
13
+ Copyright (C) 2013, Digital Factory - info@digitalfactory.pl
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+
22
+
23
+ class Math_Captcha
24
+ {
25
+ private $defaults = array(
26
+ 'enable_for' => array(
27
+ 'login_form' => FALSE,
28
+ 'registration_form' => TRUE,
29
+ 'reset_password_form' => TRUE,
30
+ 'comment_form' => TRUE,
31
+ 'bbpress' => FALSE,
32
+ 'contact_form_7' => FALSE
33
+ ),
34
+ 'hide_for_logged_users' => TRUE,
35
+ 'title' => 'Math Captcha',
36
+ 'mathematical_operations' => array(
37
+ 'addition' => TRUE,
38
+ 'subtraction' => TRUE,
39
+ 'multiplication' => FALSE,
40
+ 'division' => FALSE
41
+ ),
42
+ 'groups' => array(
43
+ 'numbers' => TRUE,
44
+ 'words' => FALSE
45
+ ),
46
+ 'time' => 60
47
+ );
48
+ private $options = array();
49
+ private $choice = array();
50
+ private $enable_for = array();
51
+ private $mathematical_operations = array();
52
+ private $groups = array();
53
+ private $error_messages = array();
54
+ private $errors;
55
+ private $session_id = '';
56
+ private $crypt_key = 'u.%ds)4;?D<gM#%fd!W2]9';
57
+ public $err_msg = array();
58
+
59
+
60
+ public function __construct()
61
+ {
62
+ register_activation_hook(__FILE__, array(&$this, 'activation'));
63
+ register_deactivation_hook(__FILE__, array(&$this, 'deactivation'));
64
+
65
+ //get defaults
66
+ $this->options = get_option('mc_options');
67
+
68
+ //error messages
69
+ $this->err_msg = array(
70
+ 'fill' => '<strong>'. __('ERROR', 'math-captcha').'</strong>: '.__('Please enter captcha value.', 'math-captcha'),
71
+ 'wrong' => '<strong>'. __('ERROR', 'math-captcha').'</strong>: '.__('Invalid captcha value.', 'math-captcha'),
72
+ 'time' => '<strong>'. __('ERROR', 'math-captcha').'</strong>: '.__('Captcha time expired.', 'math-captcha')
73
+ );
74
+
75
+ //actions
76
+ add_action('plugins_loaded', array(&$this, 'init_mc_session'), 1);
77
+ add_action('plugins_loaded', array(&$this, 'load_actions_filters'), 1);
78
+ add_action('plugins_loaded', array(&$this, 'load_textdomain'));
79
+ add_action('plugins_loaded', array(&$this, 'load_defaults'));
80
+ add_action('admin_init', array(&$this, 'register_settings'));
81
+ add_action('admin_menu', array(&$this, 'admin_menu_options'));
82
+ add_action('admin_enqueue_scripts', array(&$this, 'admin_comments_scripts_styles'));
83
+
84
+ //filters
85
+ add_filter('plugin_action_links', array(&$this, 'plugin_settings_link'), 10, 2);
86
+ add_filter('plugin_row_meta', array(&$this, 'plugin_extend_links'), 10, 2);
87
+ add_filter('shake_error_codes', array(&$this, 'add_shake_error_codes'), 1);
88
+ }
89
+
90
+
91
+ /**
92
+ * Loads required filters
93
+ */
94
+ public function load_actions_filters()
95
+ {
96
+ global $pagenow;
97
+
98
+ include_once(ABSPATH.'wp-admin/includes/plugin.php');
99
+
100
+ //comments
101
+ if($this->options['enable_for']['comment_form'] === TRUE)
102
+ {
103
+ if(!is_user_logged_in())
104
+ {
105
+ add_action('comment_form_after_fields', array(&$this, 'add_captcha_form'));
106
+ }
107
+ else
108
+ {
109
+ if($this->options['hide_for_logged_users'] === FALSE)
110
+ {
111
+ add_action('comment_form_logged_in_after', array(&$this, 'add_captcha_form'));
112
+ }
113
+ }
114
+
115
+ add_filter('preprocess_comment', array(&$this, 'add_comment_with_captcha'));
116
+ }
117
+
118
+ //login, register, lost-password
119
+ if($pagenow === 'wp-login.php')
120
+ {
121
+ $action = (isset($_GET['action']) && $_GET['action'] !== '' ? $_GET['action'] : NULL);
122
+
123
+ if($this->options['enable_for']['registration_form'] === TRUE && (!is_user_logged_in() || (is_user_logged_in() && $this->options['hide_for_logged_users'] === FALSE)) && $action === 'register')
124
+ {
125
+ add_action('register_form', array(&$this, 'add_captcha_form'));
126
+ add_action('register_post', array(&$this, 'add_user_with_captcha'), 10, 3);
127
+ add_action('signup_extra_fields', array(&$this, 'add_captcha_form'));
128
+ add_filter('wpmu_validate_user_signup', array(&$this, 'validate_user_with_captcha'));
129
+ }
130
+
131
+ if($this->options['enable_for']['reset_password_form'] === TRUE && (!is_user_logged_in() || (is_user_logged_in() && $this->options['hide_for_logged_users'] === FALSE)) && $action === 'lostpassword')
132
+ {
133
+ add_action('lostpassword_form', array(&$this, 'add_captcha_form'));
134
+ add_action('lostpassword_post', array(&$this, 'check_lost_password_with_captcha'));
135
+ }
136
+
137
+ if($this->options['enable_for']['login_form'] === TRUE && (!is_user_logged_in() || (is_user_logged_in() && $this->options['hide_for_logged_users'] === FALSE)) && $action === NULL)
138
+ {
139
+ add_action('login_form', array(&$this, 'add_captcha_form'));
140
+ add_filter('login_redirect', array(&$this, 'redirect_login_with_captcha'), 10, 3);
141
+ }
142
+ }
143
+
144
+ //bbPress
145
+ if($this->options['enable_for']['bbpress'] === TRUE)
146
+ {
147
+ if(is_plugin_active('bbpress/bbpress.php') && (!is_user_logged_in() || (is_user_logged_in() && $this->options['hide_for_logged_users'] === FALSE)))
148
+ {
149
+ add_action('bbp_theme_after_reply_form_content', array(&$this, 'add_bbp_captcha_form'));
150
+ add_action('bbp_theme_after_topic_form_content', array(&$this, 'add_bbp_captcha_form'));
151
+ add_action('bbp_new_reply_pre_extras', array(&$this, 'check_bbpress_captcha'));
152
+ add_action('bbp_new_topic_pre_extras', array(&$this, 'check_bbpress_captcha'));
153
+ }
154
+ }
155
+
156
+ //Contact Form 7
157
+ if($this->options['enable_for']['contact_form_7'] === TRUE)
158
+ {
159
+ if(is_plugin_active('contact-form-7/wp-contact-form-7.php') && (!is_user_logged_in() || (is_user_logged_in() && $this->options['hide_for_logged_users'] === FALSE)))
160
+ {
161
+ global $mc_class;
162
+ $mc_class = $this;
163
+
164
+ include_once('includes/math-captcha-cf7.php');
165
+ }
166
+ }
167
+ }
168
+
169
+
170
+ /**
171
+ * Gets attribute from options
172
+ */
173
+ public function get_attribute($attr)
174
+ {
175
+ switch($attr)
176
+ {
177
+ case 'session_id':
178
+ case 'crypt_key':
179
+ return $this->{$attr};
180
+ case 'title':
181
+ return $this->options['title'];
182
+ default:
183
+ return '';
184
+ }
185
+ }
186
+
187
+
188
+ /**
189
+ * Validates lost password form
190
+ */
191
+ public function check_lost_password_with_captcha()
192
+ {
193
+ $this->errors = new WP_Error();
194
+ $user_error = FALSE;
195
+ $user_data = NULL;
196
+
197
+ //checks captcha
198
+ if(isset($_POST['mc-value']) && $_POST['mc-value'] !== '')
199
+ {
200
+ if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
201
+ {
202
+ if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
203
+ {
204
+ $this->errors->add('math-captcha-error', $this->err_msg['wrong']);
205
+ }
206
+ }
207
+ else
208
+ {
209
+ $this->errors->add('math-captcha-error', $this->err_msg['time']);
210
+ }
211
+ }
212
+ else
213
+ {
214
+ $this->errors->add('math-captcha-error', $this->err_msg['fill']);
215
+ }
216
+
217
+ //checks user_login (from wp-login.php)
218
+ if(empty($_POST['user_login']))
219
+ {
220
+ $user_error = TRUE;
221
+ }
222
+ elseif(strpos($_POST['user_login'], '@'))
223
+ {
224
+ $user_data = get_user_by('email', trim($_POST['user_login']));
225
+
226
+ if(empty($user_data))
227
+ {
228
+ $user_error = TRUE;
229
+ }
230
+ }
231
+ else
232
+ {
233
+ $user_data = get_user_by('login', trim($_POST['user_login']));
234
+ }
235
+
236
+ if(!$user_data)
237
+ {
238
+ $user_error = TRUE;
239
+ }
240
+
241
+ //something went wrong?
242
+ if(!empty($this->errors->errors))
243
+ {
244
+ //nasty hack (captcha is wrong but user_login is ok)
245
+ if($user_error === FALSE)
246
+ {
247
+ add_filter('allow_password_reset', array(&$this, 'add_lostpassword_wp_message'));
248
+ }
249
+ else
250
+ {
251
+ add_filter('login_errors', array(&$this, 'add_lostpassword_captcha_message'));
252
+ }
253
+ }
254
+ }
255
+
256
+
257
+ /**
258
+ * Adds lost password errors
259
+ */
260
+ public function add_lostpassword_captcha_message($errors)
261
+ {
262
+ return $errors.$this->errors->errors['math-captcha-error'][0];
263
+ }
264
+
265
+
266
+ /**
267
+ * Adds lost password errors (special way)
268
+ */
269
+ public function add_lostpassword_wp_message()
270
+ {
271
+ return $this->errors;
272
+ }
273
+
274
+
275
+ /**
276
+ * Validates register form
277
+ */
278
+ public function add_user_with_captcha($login, $email, $errors)
279
+ {
280
+ if(isset($_POST['mc-value']) && $_POST['mc-value'] !== '')
281
+ {
282
+ if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
283
+ {
284
+ if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
285
+ {
286
+ $errors->add('math-captcha-error', $this->err_msg['wrong']);
287
+ }
288
+ }
289
+ else
290
+ {
291
+ $errors->add('math-captcha-error', $this->err_msg['time']);
292
+ }
293
+ }
294
+ else
295
+ {
296
+ $errors->add('math-captcha-error', $this->err_msg['fill']);
297
+ }
298
+
299
+ return $errors;
300
+ }
301
+
302
+
303
+ /**
304
+ * Posts login form
305
+ */
306
+ public function redirect_login_with_captcha($redirect, $bool, $errors)
307
+ {
308
+ $error = FALSE;
309
+ $act = '';
310
+
311
+ if(isset($_GET['captcha']) && in_array($_GET['captcha'], array('fill', 'wrong', 'time'), TRUE))
312
+ {
313
+ $errors->add('math-captcha-error', $this->err_msg[$_GET['captcha']]);
314
+ }
315
+
316
+ if(!empty($_POST))
317
+ {
318
+ if(isset($_POST['mc-value']) && $_POST['mc-value'] !== '')
319
+ {
320
+ if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
321
+ {
322
+ if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
323
+ {
324
+ $error = (!is_wp_error($errors) ? TRUE : $errors->add('math-captcha-error', $this->err_msg['wrong']));
325
+ $act = 'wrong';
326
+ }
327
+ }
328
+ else
329
+ {
330
+ $error = (!is_wp_error($errors) ? TRUE : $errors->add('math-captcha-error', $this->err_msg['time']));
331
+ $act = 'time';
332
+ }
333
+ }
334
+ else
335
+ {
336
+ $error = (!is_wp_error($errors) ? TRUE : $errors->add('math-captcha-error', $this->err_msg['fill']));
337
+ $act = 'fill';
338
+ }
339
+ }
340
+
341
+ if($error === FALSE || isset($_GET['captcha']))
342
+ {
343
+ return $redirect;
344
+ }
345
+ else
346
+ {
347
+ wp_clear_auth_cookie();
348
+ return site_url('/wp-login.php'.($act !== '' ? '?captcha='.$act : ''));
349
+ }
350
+ }
351
+
352
+
353
+ /**
354
+ * Adds shake
355
+ */
356
+ public function add_shake_error_codes($codes)
357
+ {
358
+ $codes[] = 'math-captcha-error';
359
+
360
+ return $codes;
361
+ }
362
+
363
+
364
+ /**
365
+ * Validates register form
366
+ */
367
+ public function validate_user_with_captcha($result)
368
+ {
369
+ if(isset($_POST['mc-value']) && $_POST['mc-value'] !== '')
370
+ {
371
+ if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
372
+ {
373
+ if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
374
+ {
375
+ $results['errors']->add('math-captcha-error', $this->err_msg['wrong']);
376
+ }
377
+ }
378
+ else
379
+ {
380
+ $results['errors']->add('math-captcha-error', $this->err_msg['time']);
381
+ }
382
+ }
383
+ else
384
+ {
385
+ $results['errors']->add('math-captcha-error', $this->err_msg['fill']);
386
+ }
387
+
388
+ return $results;
389
+ }
390
+
391
+
392
+ /**
393
+ * Adds captcha to comment form
394
+ */
395
+ public function add_comment_with_captcha($comment)
396
+ {
397
+ if(isset($_POST['mc-value']) && (!is_admin() || DOING_AJAX) && ($comment['comment_type'] === '' || $comment['comment_type'] === 'comment'))
398
+ {
399
+ if($_POST['mc-value'] !== '')
400
+ {
401
+ if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
402
+ {
403
+ if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) === 0)
404
+ {
405
+ return $comment;
406
+ }
407
+ else
408
+ {
409
+ wp_die($this->err_msg['wrong']);
410
+ }
411
+ }
412
+ else
413
+ {
414
+ wp_die($this->err_msg['time']);
415
+ }
416
+ }
417
+ else
418
+ {
419
+ wp_die($this->err_msg['fill']);
420
+ }
421
+ }
422
+ else
423
+ {
424
+ return $comment;
425
+ }
426
+ }
427
+
428
+
429
+ /**
430
+ * Initializes cookie-session
431
+ */
432
+ public function init_mc_session()
433
+ {
434
+ if(isset($_COOKIE['mc_session_id']))
435
+ {
436
+ $this->session_id = $_COOKIE['mc_session_id'];
437
+ }
438
+ else
439
+ {
440
+ include_once(ABSPATH.'wp-includes/class-phpass.php');
441
+
442
+ $hasher = new PasswordHash(8, FALSE);
443
+ $this->session_id = sha1($hasher->get_random_bytes(64));
444
+ }
445
+
446
+ setcookie('mc_session_id', $this->session_id, current_time('timestamp') + apply_filters('math_captcha_time', $this->options['time']), COOKIEPATH, COOKIE_DOMAIN);
447
+ }
448
+
449
+
450
+ /**
451
+ * Shows and generates captcha
452
+ */
453
+ public function add_captcha_form()
454
+ {
455
+ if(is_admin())
456
+ return;
457
+
458
+ $captcha_title = apply_filters('math_captcha_title', $this->options['title']);
459
+
460
+ echo '<p class="math-captcha-form">';
461
+ if (!empty($captcha_title))
462
+ {
463
+ echo '<label>'.$captcha_title.'<br /></label>';
464
+ }
465
+ echo '<span>'.$this->generate_captcha_phrase('default').'</span>
466
+ </p>';
467
+ }
468
+
469
+
470
+ /**
471
+ * Shows and generates captcha for bbPress
472
+ */
473
+ public function add_bbp_captcha_form()
474
+ {
475
+ if(is_admin())
476
+ return;
477
+
478
+ $captcha_title = apply_filters('math_captcha_title', $this->options['title']);
479
+
480
+ echo '<p class="math-captcha-form">';
481
+ if (!empty($captcha_title))
482
+ {
483
+ echo '<label>'.$captcha_title.'<br /></label>';
484
+ }
485
+ echo '<span>'.$this->generate_captcha_phrase('default').'</span>
486
+ </p>';
487
+ }
488
+
489
+
490
+ /**
491
+ * Validates bbpress topics and replies
492
+ */
493
+ public function check_bbpress_captcha()
494
+ {
495
+ if(isset($_POST['mc-value']) && $_POST['mc-value'] !== '')
496
+ {
497
+ if($this->session_id !== '' && get_transient('bbp_'.$this->session_id) !== FALSE)
498
+ {
499
+ if(strcmp(get_transient('bbp_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
500
+ {
501
+ bbp_add_error('math-captcha-wrong', $this->err_msg['wrong']);
502
+ }
503
+ }
504
+ else
505
+ {
506
+ bbp_add_error('math-captcha-wrong', $this->err_msg['time']);
507
+ }
508
+ }
509
+ else
510
+ {
511
+ bbp_add_error('math-captcha-wrong', $this->err_msg['fill']);
512
+ }
513
+ }
514
+
515
+
516
+ /**
517
+ * Encodes chars
518
+ */
519
+ private function encode_operation($string)
520
+ {
521
+ $chars = str_split($string);
522
+ $seed = mt_rand(0, (int)abs(crc32($string) / strlen($string)));
523
+
524
+ foreach($chars as $key => $char)
525
+ {
526
+ $ord = ord($char);
527
+
528
+ //ignore non-ascii chars
529
+ if($ord < 128)
530
+ {
531
+ //pseudo "random function"
532
+ $r = ($seed * (1 + $key)) % 100;
533
+
534
+ if($r > 60 && $char !== '@') {} // plain character (not encoded), if not @-sign
535
+ elseif($r < 45) $chars[$key] = '&#x'.dechex($ord).';'; //hexadecimal
536
+ else $chars[$key] = '&#'.$ord.';'; //decimal (ascii)
537
+ }
538
+ }
539
+
540
+ return implode('', $chars);
541
+ }
542
+
543
+
544
+ /**
545
+ * Converts numbers to words
546
+ */
547
+ private function numberToWords($number)
548
+ {
549
+ $words = array(
550
+ 1 => __('one', 'math-captcha'),
551
+ 2 => __('two', 'math-captcha'),
552
+ 3 => __('three', 'math-captcha'),
553
+ 4 => __('four', 'math-captcha'),
554
+ 5 => __('five', 'math-captcha'),
555
+ 6 => __('six', 'math-captcha'),
556
+ 7 => __('seven', 'math-captcha'),
557
+ 8 => __('eight', 'math-captcha'),
558
+ 9 => __('nine', 'math-captcha'),
559
+ 10 => __('ten', 'math-captcha'),
560
+ 11 => __('eleven', 'math-captcha'),
561
+ 12 => __('twelve', 'math-captcha'),
562
+ 13 => __('thirteen', 'math-captcha'),
563
+ 14 => __('fourteen', 'math-captcha'),
564
+ 15 => __('fifteen', 'math-captcha'),
565
+ 16 => __('sixteen', 'math-captcha'),
566
+ 17 => __('seventeen', 'math-captcha'),
567
+ 18 => __('eighteen', 'math-captcha'),
568
+ 19 => __('nineteen', 'math-captcha'),
569
+ 20 => __('twenty', 'math-captcha'),
570
+ 30 => __('thirty', 'math-captcha'),
571
+ 40 => __('forty', 'math-captcha'),
572
+ 50 => __('fifty', 'math-captcha'),
573
+ 60 => __('sixty', 'math-captcha'),
574
+ 70 => __('seventy', 'math-captcha'),
575
+ 80 => __('eighty', 'math-captcha'),
576
+ 90 => __('ninety', 'math-captcha')
577
+ );
578
+
579
+ if(isset($words[$number]))
580
+ {
581
+ return $words[$number];
582
+ }
583
+ else
584
+ {
585
+ $reverse = FALSE;
586
+
587
+ switch(get_bloginfo('language'))
588
+ {
589
+ case 'de-DE':
590
+ $spacer = 'und';
591
+ $reverse = TRUE;
592
+ break;
593
+ case 'nl-NL':
594
+ $spacer = 'en';
595
+ $reverse = TRUE;
596
+ break;
597
+ case 'pl-PL':
598
+ $spacer = ' ';
599
+ break;
600
+ case 'en-EN':
601
+ default:
602
+ $spacer = '-';
603
+ }
604
+
605
+ $first = (int)(substr($number, 0, 1) * 10);
606
+ $second = (int)substr($number, -1);
607
+
608
+ return ($reverse === FALSE ? $words[$first].$spacer.$words[$second] : $words[$second].$spacer.$words[$first]);
609
+ }
610
+ }
611
+
612
+
613
+ /**
614
+ * Generates captcha
615
+ */
616
+ public function generate_captcha_phrase($form = '')
617
+ {
618
+ $ops = array(
619
+ 'addition' => '+',
620
+ 'subtraction' => '-',
621
+ 'multiplication' => '&#215;',
622
+ 'division' => '&#247;',
623
+ );
624
+
625
+ $operations = $groups = array();
626
+ $input = '<input type="text" size="2" length="2" id="mc-input" name="mc-value" value="" aria-required="true" style="width:50px;" />';
627
+
628
+ //available operations
629
+ foreach($this->options['mathematical_operations'] as $operation => $enable)
630
+ {
631
+ if($enable === TRUE)
632
+ {
633
+ $operations[] = $operation;
634
+ }
635
+ }
636
+
637
+ //available groups
638
+ foreach($this->options['groups'] as $group => $enable)
639
+ {
640
+ if($enable === TRUE)
641
+ {
642
+ $groups[] = $group;
643
+ }
644
+ }
645
+
646
+ //number of groups
647
+ $ao = count($groups);
648
+
649
+ //operation
650
+ $rnd_op = $operations[mt_rand(0, count($operations) - 1)];
651
+ $number[3] = $ops[$rnd_op];
652
+
653
+ //place where to put empty input
654
+ $rnd_input = mt_rand(0, 2);
655
+
656
+ switch($rnd_op)
657
+ {
658
+ case 'addition':
659
+ if($rnd_input === 0)
660
+ {
661
+ $number[0] = mt_rand(1, 10);
662
+ $number[1] = mt_rand(1, 89);
663
+ }
664
+ elseif($rnd_input === 1)
665
+ {
666
+ $number[0] = mt_rand(1, 89);
667
+ $number[1] = mt_rand(1, 10);
668
+ }
669
+ elseif($rnd_input === 2)
670
+ {
671
+ $number[0] = mt_rand(1, 9);
672
+ $number[1] = mt_rand(1, 10 - $number[0]);
673
+ }
674
+
675
+ $number[2] = $number[0] + $number[1];
676
+ break;
677
+ case 'subtraction':
678
+ if($rnd_input === 0)
679
+ {
680
+ $number[0] = mt_rand(2, 10);
681
+ $number[1] = mt_rand(1, $number[0] - 1);
682
+ }
683
+ elseif($rnd_input === 1)
684
+ {
685
+ $number[0] = mt_rand(11, 99);
686
+ $number[1] = mt_rand(1, 10);
687
+ }
688
+ elseif($rnd_input === 2)
689
+ {
690
+ $number[0] = mt_rand(11, 99);
691
+ $number[1] = mt_rand($number[0] - 10, $number[0] - 1);
692
+ }
693
+
694
+ $number[2] = $number[0] - $number[1];
695
+ break;
696
+ case 'multiplication':
697
+ if($rnd_input === 0)
698
+ {
699
+ $number[0] = mt_rand(1, 10);
700
+ $number[1] = mt_rand(1, 9);
701
+ }
702
+ elseif($rnd_input === 1)
703
+ {
704
+ $number[0] = mt_rand(1, 9);
705
+ $number[1] = mt_rand(1, 10);
706
+ }
707
+ elseif($rnd_input === 2)
708
+ {
709
+ $number[0] = mt_rand(1, 10);
710
+ $number[1] = ($number[0] > 5 ? 1 : ($number[0] === 4 && $number[0] === 5 ? mt_rand(1, 2) : ($number[0] === 3 ? mt_rand(1, 3) : ($number[0] === 2 ? mt_rand(1, 5) : mt_rand(1, 10)))));
711
+ }
712
+
713
+ $number[2] = $number[0] * $number[1];
714
+ break;
715
+ case 'division':
716
+ if($rnd_input === 0)
717
+ {
718
+ $divide = array(2 => array(1, 2), 3 => array(1, 3), 4 => array(1, 2, 4), 5 => array(1, 5), 6 => array(1, 2, 3, 6), 7 => array(1, 7), 8 => array(1, 2, 4, 8), 9 => array(1, 3, 9), 10 => array(1, 2, 5, 10));
719
+ $number[0] = mt_rand(2, 10);
720
+ $number[1] = $divide[$number[0]][mt_rand(0, count($divide[$number[0]]) - 1)];
721
+ }
722
+ elseif($rnd_input === 1)
723
+ {
724
+ $divide = array(1 => 99, 2 => 49, 3 => 33, 4 => 24, 5 => 19, 6 => 16, 7 => 14, 8 => 12, 9 => 11, 10 => 9);
725
+ $number[1] = mt_rand(1, 10);
726
+ $number[0] = $number[1] * mt_rand(1, $divide[$number[1]]);
727
+ }
728
+ elseif($rnd_input === 2)
729
+ {
730
+ $divide = array(1 => 99, 2 => 49, 3 => 33, 4 => 24, 5 => 19, 6 => 16, 7 => 14, 8 => 12, 9 => 11, 10 => 9);
731
+ $number[2] = mt_rand(1, 10);
732
+ $number[0] = $number[2] * mt_rand(1, $divide[$number[2]]);
733
+ $number[1] = (int)($number[0] / $number[2]);
734
+ }
735
+
736
+ if(!isset($number[2]))
737
+ {
738
+ $number[2] = (int)($number[0] / $number[1]);
739
+ }
740
+ break;
741
+ }
742
+
743
+ //words
744
+ if($ao === 1 && $groups[0] === 'words')
745
+ {
746
+ if($rnd_input === 0)
747
+ {
748
+ $number[1] = $this->numberToWords($number[1]);
749
+ $number[2] = $this->numberToWords($number[2]);
750
+ }
751
+ elseif($rnd_input === 1)
752
+ {
753
+ $number[0] = $this->numberToWords($number[0]);
754
+ $number[2] = $this->numberToWords($number[2]);
755
+ }
756
+ elseif($rnd_input === 2)
757
+ {
758
+ $number[0] = $this->numberToWords($number[0]);
759
+ $number[1] = $this->numberToWords($number[1]);
760
+ }
761
+ }
762
+ //numbers and words
763
+ elseif($ao === 2)
764
+ {
765
+ if($rnd_input === 0)
766
+ {
767
+ if(mt_rand(1, 2) === 2)
768
+ {
769
+ $number[1] = $this->numberToWords($number[1]);
770
+ $number[2] = $this->numberToWords($number[2]);
771
+ }
772
+ else
773
+ {
774
+ $number[$tmp = mt_rand(1, 2)] = $this->numberToWords($number[$tmp]);
775
+ }
776
+ }
777
+ elseif($rnd_input === 1)
778
+ {
779
+ if(mt_rand(1, 2) === 2)
780
+ {
781
+ $number[0] = $this->numberToWords($number[0]);
782
+ $number[2] = $this->numberToWords($number[2]);
783
+ }
784
+ else
785
+ {
786
+ $number[$tmp = array_rand(array(0 => 0, 2 => 2), 1)] = $this->numberToWords($number[$tmp]);
787
+ }
788
+ }
789
+ elseif($rnd_input === 2)
790
+ {
791
+ if(mt_rand(1, 2) === 2)
792
+ {
793
+ $number[0] = $this->numberToWords($number[0]);
794
+ $number[1] = $this->numberToWords($number[1]);
795
+ }
796
+ else
797
+ {
798
+ $number[$tmp = mt_rand(0, 1)] = $this->numberToWords($number[$tmp]);
799
+ }
800
+ }
801
+ }
802
+
803
+ if(in_array($form, array('default', 'bbpress'), TRUE))
804
+ {
805
+ //position of empty input
806
+ if($rnd_input === 0)
807
+ {
808
+ $return = $input.' '.$number[3].' '.$this->encode_operation($number[1]).' = '.$this->encode_operation($number[2]);
809
+ }
810
+ elseif($rnd_input === 1)
811
+ {
812
+ $return = $this->encode_operation($number[0]).' '.$number[3].' '.$input.' = '.$this->encode_operation($number[2]);
813
+ }
814
+ elseif($rnd_input === 2)
815
+ {
816
+ $return = $this->encode_operation($number[0]).' '.$number[3].' '.$this->encode_operation($number[1]).' = '.$input;
817
+ }
818
+
819
+ $transient_name = ($form === 'bbpress' ? 'bbp' : 'mc');
820
+ }
821
+ elseif($form === 'cf7')
822
+ {
823
+ $return = array();
824
+
825
+ if($rnd_input === 0)
826
+ {
827
+ $return['input'] = 1;
828
+ $return[2] = ' '.$number[3].' '.$this->encode_operation($number[1]).' = ';
829
+ $return[3] = $this->encode_operation($number[2]);
830
+ }
831
+ elseif($rnd_input === 1)
832
+ {
833
+ $return[1] = $this->encode_operation($number[0]).' '.$number[3].' ';
834
+ $return['input'] = 2;
835
+ $return[3] = ' = '.$this->encode_operation($number[2]);
836
+ }
837
+ elseif($rnd_input === 2)
838
+ {
839
+ $return[1] = $this->encode_operation($number[0]).' '.$number[3].' ';
840
+ $return[2] = $this->encode_operation($number[1]).' = ';
841
+ $return['input'] = 3;
842
+ }
843
+
844
+ $transient_name = 'cf7';
845
+ }
846
+
847
+ set_transient($transient_name.'_'.$this->session_id, sha1($this->crypt_key.$number[$rnd_input].$this->session_id, FALSE), apply_filters('math_captcha_time', $this->options['time']));
848
+
849
+ return $return;
850
+ }
851
+
852
+
853
+ /**
854
+ * Activation
855
+ */
856
+ public function activation()
857
+ {
858
+ add_option('mc_options', $this->defaults, '', 'no');
859
+ }
860
+
861
+
862
+ /**
863
+ * Deactivation
864
+ */
865
+ public function deactivation()
866
+ {
867
+ delete_option('mc_options');
868
+ }
869
+
870
+
871
+ /**
872
+ * Load defaults
873
+ */
874
+ public function load_defaults()
875
+ {
876
+ $this->enable_for = array(
877
+ 'login_form' => __('login form', 'math-captcha'),
878
+ 'registration_form' => __('registration form', 'math-captcha'),
879
+ 'reset_password_form' => __('reset password form', 'math-captcha'),
880
+ 'comment_form' => __('comment form', 'math-captcha'),
881
+ 'bbpress' => __('bbpress', 'math-captcha'),
882
+ 'contact_form_7' => __('contact form 7', 'math-captcha')
883
+ );
884
+ $this->choice = array(
885
+ 'yes' => __('yes', 'math-captcha'),
886
+ 'no' => __('no', 'math-captcha')
887
+ );
888
+ $this->mathematical_operations = array(
889
+ 'addition' => __('addition (+)', 'math-captcha'),
890
+ 'subtraction' => __('subtraction (-)', 'math-captcha'),
891
+ 'multiplication' => __('multiplication (&#215;)', 'math-captcha'),
892
+ 'division' => __('division (&#247;)', 'math-captcha')
893
+ );
894
+ $this->groups = array(
895
+ 'numbers' => __('numbers', 'math-captcha'),
896
+ 'words' => __('words', 'math-captcha')
897
+ );
898
+ }
899
+
900
+
901
+ /**
902
+ * Registers settings
903
+ */
904
+ public function register_settings()
905
+ {
906
+ //inline edit
907
+ register_setting('mc_options', 'mc_options', array(&$this, 'validate_configuration'));
908
+ add_settings_section('math_captcha_settings', __('Math Captcha settings', 'math-captcha'), '', 'mc_options');
909
+ add_settings_field('mc_enable_for', __('Enable Math Captcha for', 'math-captcha'), array(&$this, 'mc_enable_captcha_for'), 'mc_options', 'math_captcha_settings');
910
+ add_settings_field('mc_hide_for_logged_users', __('Hide for logged in users', 'math-captcha'), array(&$this, 'mc_hide_for_logged_users'), 'mc_options', 'math_captcha_settings');
911
+ add_settings_field('mc_mathematical_operations', __('Mathematical operations', 'math-captcha'), array(&$this, 'mc_mathematical_operations'), 'mc_options', 'math_captcha_settings');
912
+ add_settings_field('mc_groups', __('Display captcha as', 'math-captcha'), array(&$this, 'mc_groups'), 'mc_options', 'math_captcha_settings');
913
+ add_settings_field('mc_title', __('Captcha field title', 'math-captcha'), array(&$this, 'mc_title'), 'mc_options', 'math_captcha_settings');
914
+ add_settings_field('mc_time', __('Captcha time', 'math-captcha'), array(&$this, 'mc_time'), 'mc_options', 'math_captcha_settings');
915
+ }
916
+
917
+
918
+ /**
919
+ * Setting field - enable for
920
+ */
921
+ public function mc_enable_captcha_for()
922
+ {
923
+ echo '
924
+ <div id="mc_enable_for">';
925
+
926
+ foreach($this->enable_for as $val => $trans)
927
+ {
928
+ echo '
929
+ <input id="mc-enable-for-'.$val.'" type="checkbox" name="mc_options[enable_for][]" value="'.$val.'" '.checked(TRUE, $this->options['enable_for'][$val], FALSE).' '.disabled((($val === 'contact_form_7' && !is_plugin_active('contact-form-7/wp-contact-form-7.php')) || ($val === 'bbpress' && !is_plugin_active('bbpress/bbpress.php'))), TRUE, FALSE).' />
930
+ <label for="mc-enable-for-'.$val.'">'.$trans.'</label>';
931
+ }
932
+
933
+ echo '
934
+ <p class="description">'.__('Select were would you like to use Math Captcha.', 'math-captcha').'</p>
935
+ </div>';
936
+ }
937
+
938
+
939
+ /**
940
+ * Setting field - hide for logged in users
941
+ */
942
+ public function mc_hide_for_logged_users()
943
+ {
944
+ echo '
945
+ <div id="mc_hide_for_logged">';
946
+
947
+ foreach($this->choice as $val => $trans)
948
+ {
949
+ echo '
950
+ <input id="mc-hide-for-logged-'.$val.'" type="radio" name="mc_options[hide_for_logged_users]" value="'.$val.'" '.checked(($val === 'yes' ? TRUE : FALSE), $this->options['hide_for_logged_users'], FALSE).' />
951
+ <label for="mc-hide-for-logged-'.$val.'">'.$trans.'</label>';
952
+ }
953
+
954
+ echo '
955
+ <p class="description">'.__('Would you like to hide captcha for logged in users?', 'math-captcha').'</p>
956
+ </div>';
957
+ }
958
+
959
+
960
+ /**
961
+ * Setting field - title
962
+ */
963
+ public function mc_title()
964
+ {
965
+ echo '
966
+ <div id="mc_title">
967
+ <input type="text" name="mc_options[title]" value="'.$this->options['title'].'" />
968
+ <p class="description">'.__('Select what kind of mathematical operation will be used to generate captcha.', 'math-captcha').'</p>
969
+ </div>';
970
+ }
971
+
972
+
973
+ /**
974
+ * Setting field - time
975
+ */
976
+ public function mc_time()
977
+ {
978
+ echo '
979
+ <div id="mc_time">
980
+ <input type="text" name="mc_options[time]" value="'.$this->options['time'].'" />
981
+ <p class="description">'.__('Enter the time (in seconds) a user has to enter captcha value.', 'math-captcha').'</p>
982
+ </div>';
983
+ }
984
+
985
+
986
+ /**
987
+ * Setting field - methematical operations
988
+ */
989
+ public function mc_mathematical_operations()
990
+ {
991
+ echo '
992
+ <div id="mc_mathematical_operations">';
993
+
994
+ foreach($this->mathematical_operations as $val => $trans)
995
+ {
996
+ echo '
997
+ <input id="mc-mathematical-operations-'.$val.'" type="checkbox" name="mc_options[mathematical_operations][]" value="'.$val.'" '.checked(TRUE, $this->options['mathematical_operations'][$val], FALSE).' />
998
+ <label for="mc-mathematical-operations-'.$val.'">'.$trans.'</label>';
999
+ }
1000
+
1001
+ echo '
1002
+ <p class="description">'.__('Opis', 'math-captcha').'</p>
1003
+ </div>';
1004
+ }
1005
+
1006
+
1007
+ /**
1008
+ * Setting field - groups
1009
+ */
1010
+ public function mc_groups()
1011
+ {
1012
+ echo '
1013
+ <div id="mc_groups">';
1014
+
1015
+ foreach($this->groups as $val => $trans)
1016
+ {
1017
+ echo '
1018
+ <input id="mc-groups-'.$val.'" type="checkbox" name="mc_options[groups][]" value="'.$val.'" '.checked(TRUE, $this->options['groups'][$val], FALSE).' />
1019
+ <label for="mc-groups-'.$val.'">'.$trans.'</label>';
1020
+ }
1021
+
1022
+ echo '
1023
+ <p class="description">'.__('Opis', 'math-captcha').'</p>
1024
+ </div>';
1025
+ }
1026
+
1027
+
1028
+ /**
1029
+ * Validates settings
1030
+ */
1031
+ public function validate_configuration($input)
1032
+ {
1033
+ if(isset($_POST['save_mc_options']))
1034
+ {
1035
+ $enable_for = array();
1036
+ $mathematical_operations = array();
1037
+ $groups = array();
1038
+
1039
+ if(empty($input['enable_for']))
1040
+ {
1041
+ foreach($this->defaults['enable_for'] as $enable => $bool)
1042
+ {
1043
+ $input['enable_for'][$enable] = FALSE;
1044
+ }
1045
+ }
1046
+ else
1047
+ {
1048
+ foreach($this->enable_for as $enable => $trans)
1049
+ {
1050
+ $enable_for[$enable] = (in_array($enable, $input['enable_for']) ? TRUE : FALSE);
1051
+ }
1052
+
1053
+ $input['enable_for'] = $enable_for;
1054
+ }
1055
+
1056
+ if(!is_plugin_active('contact-form-7/wp-contact-form-7.php') && $this->options['enable_for']['contact_form_7'] === TRUE)
1057
+ {
1058
+ $input['enable_for']['contact_form_7'] = TRUE;
1059
+ }
1060
+
1061
+ if(!is_plugin_active('bbpress/bbpress.php') && $this->options['enable_for']['bbpress'] === TRUE)
1062
+ {
1063
+ $input['enable_for']['bbpress'] = TRUE;
1064
+ }
1065
+
1066
+ if(empty($input['mathematical_operations']))
1067
+ {
1068
+ add_settings_error('empty-operations', 'settings_updated', __('You need to check at least one mathematical operation. Defaults settings of this option restored.', 'math-captcha'), 'error');
1069
+
1070
+ $input['mathematical_operations'] = $this->defaults['mathematical_operations'];
1071
+ }
1072
+ else
1073
+ {
1074
+ foreach($this->mathematical_operations as $operation => $trans)
1075
+ {
1076
+ $mathematical_operations[$operation] = (in_array($operation, $input['mathematical_operations']) ? TRUE : FALSE);
1077
+ }
1078
+
1079
+ $input['mathematical_operations'] = $mathematical_operations;
1080
+ }
1081
+
1082
+ if(empty($input['groups']))
1083
+ {
1084
+ add_settings_error('empty-groups', 'settings_updated', __('You need to check at least one group. Defaults settings of this option restored.', 'math-captcha'), 'error');
1085
+
1086
+ $input['groups'] = $this->defaults['groups'];
1087
+ }
1088
+ else
1089
+ {
1090
+ foreach($this->groups as $group => $trans)
1091
+ {
1092
+ $groups[$group] = (in_array($group, $input['groups']) ? TRUE : FALSE);
1093
+ }
1094
+
1095
+ $input['groups'] = $groups;
1096
+ }
1097
+
1098
+ $input['hide_for_logged_users'] = (isset($input['hide_for_logged_users']) && in_array($input['hide_for_logged_users'], array_keys($this->choice)) ? ($input['hide_for_logged_users'] === 'yes' ? TRUE : FALSE) : $this->defaults['hide_for_logged_users']);
1099
+ $input['title'] = trim(sanitize_text_field($input['title']));
1100
+ $time = (int)$input['time'];
1101
+ $input['time'] = ($time < 0 ? $this->defaults['time'] : $time);
1102
+ }
1103
+
1104
+ return $input;
1105
+ }
1106
+
1107
+
1108
+ /**
1109
+ * Adds options menu
1110
+ */
1111
+ public function admin_menu_options()
1112
+ {
1113
+ $watermark_settings_page = add_options_page(
1114
+ __('Math Captcha', 'math-captcha'),
1115
+ __('Math Captcha', 'math-captcha'),
1116
+ 'manage_options',
1117
+ 'math-captcha',
1118
+ array(&$this, 'options_page')
1119
+ );
1120
+ }
1121
+
1122
+
1123
+ /**
1124
+ * Shows options page
1125
+ */
1126
+ public function options_page()
1127
+ {
1128
+ echo '
1129
+ <div class="wrap">'.screen_icon().'
1130
+ <h2>'.__('Math Captcha', 'math-captcha').'</h2>
1131
+ <div class="metabox-holder postbox-container math-captcha-settings">
1132
+ <form action="options.php" method="post">';
1133
+
1134
+ wp_nonce_field('update-options');
1135
+ settings_fields('mc_options');
1136
+ do_settings_sections('mc_options');
1137
+ submit_button('', 'primary', 'save_mc_options', TRUE);
1138
+
1139
+ echo '
1140
+ </form>
1141
+ </div>
1142
+ <div class="df-credits postbox-container">
1143
+ <h3 class="metabox-title">'.__('Math Captcha', 'math-captcha').'</h3>
1144
+ <div class="inner">
1145
+ <h3>'.__('Need support?', 'math-captcha').'</h3>
1146
+ <p>'.__('If you are having problems with this plugin, please talk about them in the', 'math-captcha').' <a href="http://dfactory.eu/support/" target="_blank" title="'.__('Support forum','math-captcha').'">'.__('Support forum', 'math-captcha').'</a></p>
1147
+ <hr />
1148
+ <h3>'.__('Do you like this plugin?', 'math-captcha').'</h3>
1149
+ <p><a href="http://wordpress.org/support/view/plugin-reviews/math-captcha" target="_blank" title="'.__('Rate it 5', 'math-captcha').'">'.__('Rate it 5', 'math-captcha').'</a> '.__('on WordPress.org', 'math-captcha').'<br />'.
1150
+ __('Blog about it & link to the', 'math-captcha').' <a href="http://dfactory.eu/plugins/math-captcha/" target="_blank" title="'.__('plugin page', 'math-captcha').'">'.__('plugin page', 'math-captcha').'</a><br />'.
1151
+ __('Check out our other', 'math-captcha').' <a href="http://dfactory.eu/plugins/" target="_blank" title="'.__('WordPress plugins', 'math-captcha').'">'.__('WordPress plugins', 'math-captcha').'</a>
1152
+ </p>
1153
+ <hr />
1154
+ <p class="df-link">'.__('Created by', 'math-captcha').' <a href="http://www.dfactory.eu" target="_blank" title="dFactory - Quality plugins for WordPress"><img src="'.plugins_url('/images/logo-dfactory.png' , __FILE__ ).'" title="dFactory - Quality plugins for WordPress" alt="dFactory - Quality plugins for WordPress" /></a></p>
1155
+ </div>
1156
+ </div>
1157
+ <div class="clear"></div>
1158
+ </div>';
1159
+ }
1160
+
1161
+
1162
+ /**
1163
+ * Enqueues scripts and styles (admin side)
1164
+ */
1165
+ public function admin_comments_scripts_styles($page)
1166
+ {
1167
+ if(is_admin() && $page === 'settings_page_math-captcha')
1168
+ {
1169
+ wp_enqueue_script(
1170
+ 'math-captcha',
1171
+ plugins_url('/js/math-captcha-admin.js', __FILE__),
1172
+ array('jquery', 'jquery-ui-core', 'jquery-ui-button')
1173
+ );
1174
+
1175
+ wp_enqueue_style('math-captcha-admin', plugins_url('/css/math-captcha-admin.css', __FILE__));
1176
+ wp_enqueue_style('math-captcha-front', plugins_url('/css/wp-like-ui-theme.css', __FILE__));
1177
+ }
1178
+ }
1179
+
1180
+
1181
+ /**
1182
+ * Loads textdomain
1183
+ */
1184
+ public function load_textdomain()
1185
+ {
1186
+ load_plugin_textdomain('math-captcha', FALSE, dirname(plugin_basename(__FILE__)).'/languages/');
1187
+ }
1188
+
1189
+
1190
+ /**
1191
+ * Add links to Support Forum
1192
+ */
1193
+ public function plugin_extend_links($links, $file)
1194
+ {
1195
+ if (!current_user_can('install_plugins'))
1196
+ return $links;
1197
+
1198
+ $plugin = plugin_basename(__FILE__);
1199
+
1200
+ if ($file == $plugin)
1201
+ {
1202
+ return array_merge(
1203
+ $links,
1204
+ array(sprintf('<a href="http://www.dfactory.eu/support/forum/math-captcha/" target="_blank">%s</a>', __('Support', 'math-captcha')))
1205
+ );
1206
+ }
1207
+
1208
+ return $links;
1209
+ }
1210
+
1211
+
1212
+ /**
1213
+ * Add links to Settings page
1214
+ */
1215
+ function plugin_settings_link($links, $file)
1216
+ {
1217
+ if(!is_admin() || !current_user_can('manage_options'))
1218
+ return $links;
1219
+
1220
+ static $plugin;
1221
+
1222
+ $plugin = plugin_basename(__FILE__);
1223
+
1224
+ if($file == $plugin)
1225
+ {
1226
+ $settings_link = sprintf('<a href="%s">%s</a>', admin_url('options-general.php').'?page=math-captcha', __('Settings', 'math-captcha'));
1227
+ array_unshift($links, $settings_link);
1228
+ }
1229
+
1230
+ return $links;
1231
+ }
1232
+ }
1233
+
1234
+ $math_captcha = new Math_Captcha();
1235
+ ?>