Contact Form Clean and Simple - Version 4.0.7

Version Description

Download this release

Release Info

Developer megnicholas
Plugin Icon wp plugin Contact Form Clean and Simple
Version 4.0.7
Comparing to
See all releases

Version 4.0.7

class.cff.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class cff
4
+ {
5
+ public
6
+ function __construct()
7
+ {
8
+ $this->Upgrade();
9
+
10
+ //add settings link to plugins page
11
+ add_filter("plugin_action_links", array(
12
+ $this,
13
+ 'SettingsLink'
14
+ ) , 10, 2);
15
+
16
+ //allow short codes to be added in the widget area
17
+ add_filter('widget_text', 'do_shortcode');
18
+
19
+ //add action for loading js files
20
+ add_action('wp_enqueue_scripts', array(
21
+ $this,
22
+ 'RegisterScripts'
23
+ ));
24
+
25
+ //create the settings page
26
+ $settings = new cff_settings();
27
+ }
28
+
29
+ function RegisterScripts()
30
+ {
31
+ wp_register_script('jquery-validate', CFF_PLUGIN_URL . '/js/jquery.validate.min.js', array(
32
+ 'jquery'
33
+ ) , '1.10.0', true);
34
+ wp_register_script('jquery-meta', CFF_PLUGIN_URL . '/js/jquery.metadata.js', array(
35
+ 'jquery'
36
+ ) , '4187', true);
37
+ wp_register_script('jquery-validate-contact-form', CFF_PLUGIN_URL . '/js/jquery.validate.contact.form.js', array(
38
+ 'jquery'
39
+ ) , '1.00', true);
40
+ wp_register_style('bootstrap', CFF_PLUGIN_URL . '/css/bootstrap-forms.min.css', null, '2.3.1');
41
+ }
42
+
43
+ function Upgrade()
44
+ {
45
+ $options = get_option('cff_options');
46
+ $updated = false;
47
+
48
+ if (trim(get_option('recaptcha_public_key')) <> '')
49
+ {
50
+ $options['recaptcha_public_key'] = get_option('recaptcha_public_key');
51
+ delete_option('recaptcha_public_key');
52
+ $updated = true;
53
+ }
54
+
55
+ if (trim(get_option('recaptcha_private_key')) <> '')
56
+ {
57
+ $options['recaptcha_private_key'] = get_option('recaptcha_private_key');
58
+ delete_option('recaptcha_private_key');
59
+ $updated = true;
60
+ }
61
+
62
+ if ($updated) update_option('cff_options', $option);
63
+ }
64
+
65
+ /*
66
+ * Add the settings link to the plugin page
67
+ */
68
+
69
+ function SettingsLink($links, $file)
70
+ {
71
+
72
+ if ($file == CFF_PLUGIN_NAME . '/' . CFF_PLUGIN_NAME . '.php')
73
+ {
74
+
75
+ /*
76
+ * Insert the link at the beginning
77
+ */
78
+ $in = '<a href="options-general.php?page=contact-form-settings">' . __('Settings', 'contact-form') . '</a>';
79
+ array_unshift($links, $in);
80
+
81
+ /*
82
+ * Insert at the end
83
+ */
84
+
85
+ // $links[] = '<a href="options-general.php?page=contact-form-settings">'.__('Settings','contact-form').'</a>';
86
+
87
+ }
88
+
89
+ return $links;
90
+ }
91
+ static
92
+ function Log($message)
93
+ {
94
+
95
+ if (WP_DEBUG === true)
96
+ {
97
+
98
+ if (is_array($message) || is_object($message))
99
+ {
100
+ error_log(print_r($message, true));
101
+ }
102
+ else
103
+ {
104
+ error_log($message);
105
+ }
106
+ }
107
+ }
108
+ }
109
+
class.cff_contact.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * class for holding and validating data captured from the contact form
5
+ */
6
+
7
+ class cff_Contact
8
+ {
9
+ var $Name;
10
+ var $Email;
11
+ var $ConfirmEmail;
12
+ var $Message;
13
+ var $ErrorMessage;
14
+ var $RecaptchaPublicKey;
15
+ var $RecaptchaPrivateKey;
16
+ var $Errors;
17
+
18
+ function __construct()
19
+ {
20
+ $this->Errors = array();
21
+
22
+ if (cff_PluginSettings::UseRecaptcha())
23
+ {
24
+ $this->RecaptchaPublicKey = cff_PluginSettings::PublicKey();
25
+ $this->RecaptchaPrivateKey = cff_PluginSettings::PrivateKey();
26
+ }
27
+
28
+ if ($_SERVER['REQUEST_METHOD'] == 'POST')
29
+ {
30
+ $this->Name = filter_var($_POST['cf-Name'], FILTER_SANITIZE_STRING);
31
+ unset($_POST['cf-Name']);
32
+ $this->Email = filter_var($_POST['cf-Email'], FILTER_SANITIZE_EMAIL);
33
+ unset($_POST['cf-Email']);
34
+ $this->ConfirmEmail = filter_var($_POST['cfconfirm-email'], FILTER_SANITIZE_EMAIL);
35
+ unset($_POST['cfconfirm-email']);
36
+ $this->Message = filter_var($_POST['cf-Message'], FILTER_SANITIZE_STRING);
37
+ unset($_POST['cf-Message']);
38
+ }
39
+ }
40
+
41
+ function IsValid()
42
+ {
43
+ $this->Errors = array();
44
+
45
+ if ($_SERVER['REQUEST_METHOD'] != 'POST')
46
+ return false;
47
+
48
+ //check nonce
49
+
50
+ if (!wp_verify_nonce($_POST['cff_nonce'], 'cff_contact'))
51
+ return false;
52
+
53
+ // email and confirm email are the same
54
+
55
+ if ($this->Email != $this->ConfirmEmail) $this->Errors['Confirm-Email'] = 'Sorry the email addresses do not match.';
56
+
57
+ //email
58
+
59
+ if (strlen($this->Email) == 0) $this->Errors['Email'] = "Please give your email address.";
60
+
61
+ //email
62
+
63
+ if (strlen($this->ConfirmEmail) == 0) $this->Errors['Confirm-Email'] = "Please confirm your email address.";
64
+
65
+ //name
66
+
67
+ if (strlen($this->Name) == 0) $this->Errors['Name'] = "Please give your name.";
68
+
69
+ //email
70
+
71
+ if (strlen($this->Message) == 0) $this->Errors['Message'] = "Please enter a message.";
72
+
73
+ //email invalid address
74
+
75
+ if (strlen($this->Email) > 0 && !filter_var($this->Email, FILTER_VALIDATE_EMAIL)) $this->Errors['Email'] = "Please enter a valid email address.";
76
+
77
+ //check recaptcha but only if we have keys
78
+
79
+ if ($this->RecaptchaPublicKey <> '' && $this->RecaptchaPrivateKey <> '')
80
+ {
81
+ $resp = recaptcha_check_answer($this->RecaptchaPrivateKey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
82
+
83
+ if (!$resp->is_valid) $this->Errors['recaptcha'] = "Sorry the code wasn't entered correctly please try again.";
84
+ }
85
+
86
+ return count($this->Errors) == 0;
87
+ }
88
+ }
89
+
class.cff_pluginsettings.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class cff_PluginSettings
4
+ {
5
+ static
6
+ function UseRecaptcha()
7
+ {
8
+
9
+ /* @var $options type array*/
10
+ $options = get_option('cff_options');
11
+
12
+ return isset($options['use_recaptcha']) ? true : false;
13
+ }
14
+ static
15
+ function Theme()
16
+ {
17
+ $options = get_option('cff_options');
18
+
19
+ return isset($options['theme']) ? $options['theme'] : 'red';
20
+ }
21
+ static
22
+ function PublicKey()
23
+ {
24
+ $options = get_option('cff_options');
25
+
26
+ return $options['recaptcha_public_key'];
27
+ }
28
+ static
29
+ function PrivateKey()
30
+ {
31
+ $options = get_option('cff_options');
32
+
33
+ return $options['recaptcha_private_key'];
34
+ }
35
+ static
36
+ function SentMessageHeading()
37
+ {
38
+ $options = get_option('cff_options');
39
+
40
+ return isset($options['sent_message_heading']) ? $options['sent_message_heading'] : "Message Sent";
41
+ }
42
+ static
43
+ function SentMessageBody()
44
+ {
45
+ $options = get_option('cff_options');
46
+
47
+ return isset($options['sent_message_body']) ? $options['sent_message_body'] : "Thank you for your message, we will be in touch very shortly.";
48
+ }
49
+ static
50
+ function Message()
51
+ {
52
+ $options = get_option('cff_options');
53
+
54
+ return isset($options['message']) ? $options['message'] : "Please enter your contact details and a short message below and I will try to answer your query as soon as possible.";
55
+ }
56
+ static
57
+ function LoadStyleSheet()
58
+ {
59
+ $options = get_option('cff_options');
60
+
61
+ return isset($options['load_stylesheet']) ? $options['load_stylesheet'] : true;
62
+ }
63
+ static
64
+ function UseClientValidation()
65
+ {
66
+ $options = get_option('cff_options');
67
+
68
+ return isset($options['use_client_validation']) ? $options['use_client_validation'] : true;
69
+ }
70
+ }
71
+
class.cff_settings.php ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * creates the settings page for the plugin
5
+ */
6
+
7
+ class cff_settings
8
+ {
9
+ public
10
+ function __construct()
11
+ {
12
+
13
+ if (is_admin())
14
+ {
15
+ add_action('admin_menu', array(
16
+ $this,
17
+ 'add_plugin_page'
18
+ ));
19
+ add_action('admin_init', array(
20
+ $this,
21
+ 'page_init'
22
+ ));
23
+ }
24
+ }
25
+ public
26
+ function add_plugin_page()
27
+ {
28
+
29
+ // This page will be under "Settings"
30
+ add_options_page('Settings Admin', 'Contact Form', 'manage_options', 'contact-form-settings', array(
31
+ $this,
32
+ 'create_admin_page'
33
+ ));
34
+ }
35
+ public
36
+ function create_admin_page()
37
+ {
38
+ ?>
39
+ <div class="wrap">
40
+ <?php screen_icon(); ?>
41
+ <h2> Clean and Simple Contact Form Settings</h2>
42
+ <hr/>
43
+ <form method="post" action="options.php">
44
+ <?php submit_button(); ?>
45
+ <?php
46
+
47
+ // This prints out all hidden setting fields
48
+ settings_fields('test_option_group');
49
+ do_settings_sections('contact-form-settings');
50
+ ?>
51
+ <?php submit_button(); ?>
52
+ </form>
53
+ </div>
54
+ <?php
55
+ }
56
+ public
57
+ function page_init()
58
+ {
59
+ add_settings_section('section_recaptcha', '<h3>ReCAPTCHA Settings</h3>', array(
60
+ $this,
61
+ 'print_section_info_recaptcha'
62
+ ) , 'contact-form-settings');
63
+ register_setting('test_option_group', 'array_key', array(
64
+ $this,
65
+ 'check_form'
66
+ ));
67
+ add_settings_field('use_recaptcha', 'Use reCAPTCHA : ', array(
68
+ $this,
69
+ 'create_fields'
70
+ ) , 'contact-form-settings', 'section_recaptcha', array(
71
+ 'use_recaptcha'
72
+ ));
73
+ add_settings_field('theme', 'reCAPTCHA Theme : ', array(
74
+ $this,
75
+ 'create_fields'
76
+ ) , 'contact-form-settings', 'section_recaptcha', array(
77
+ 'theme'
78
+ ));
79
+ add_settings_field('recaptcha_public_key', 'reCAPTCHA Public Key : ', array(
80
+ $this,
81
+ 'create_fields'
82
+ ) , 'contact-form-settings', 'section_recaptcha', array(
83
+ 'recaptcha_public_key'
84
+ ));
85
+ add_settings_field('recaptcha_private_key', 'reCAPTCHA Private Key : ', array(
86
+ $this,
87
+ 'create_fields'
88
+ ) , 'contact-form-settings', 'section_recaptcha', array(
89
+ 'recaptcha_private_key'
90
+ ));
91
+ add_settings_section('section_message', '<h3>Message Settings</h3>', array(
92
+ $this,
93
+ 'print_section_info_message'
94
+ ) , 'contact-form-settings');
95
+ add_settings_field('message', 'Message : ', array(
96
+ $this,
97
+ 'create_fields'
98
+ ) , 'contact-form-settings', 'section_message', array(
99
+ 'message'
100
+ ));
101
+ add_settings_field('sent_message_heading', 'Message Sent Heading : ', array(
102
+ $this,
103
+ 'create_fields'
104
+ ) , 'contact-form-settings', 'section_message', array(
105
+ 'sent_message_heading'
106
+ ));
107
+ add_settings_field('sent_message_body', 'Message Sent Content : ', array(
108
+ $this,
109
+ 'create_fields'
110
+ ) , 'contact-form-settings', 'section_message', array(
111
+ 'sent_message_body'
112
+ ));
113
+ add_settings_section('section_styling', '<h3>Styling and Validation</h3>', array(
114
+ $this,
115
+ 'print_section_info_styling'
116
+ ) , 'contact-form-settings');
117
+ add_settings_field('load_stylesheet', 'Use this plugin\'s default stylesheet (un-tick to use your theme\'s style sheet instead): ', array(
118
+ $this,
119
+ 'create_fields'
120
+ ) , 'contact-form-settings', 'section_styling', array(
121
+ 'load_stylesheet'
122
+ ));
123
+ add_settings_field('use_client_validation', 'Use client side validation (Ajax): ', array(
124
+ $this,
125
+ 'create_fields'
126
+ ) , 'contact-form-settings', 'section_styling', array(
127
+ 'use_client_validation'
128
+ ));
129
+ }
130
+ public
131
+ function check_form($input)
132
+ {
133
+ $options = get_option(CFF_OPTIONS_KEY);
134
+
135
+ if (isset($input['use_recaptcha']))
136
+ {
137
+ $options['use_recaptcha'] = true;
138
+ }
139
+ else
140
+ {
141
+ unset($options['use_recaptcha']);
142
+ }
143
+
144
+ if (isset($input['theme'])) $options['theme'] = filter_var($input['theme'], FILTER_SANITIZE_STRING);
145
+
146
+ if (isset($input['recaptcha_public_key'])) $options['recaptcha_public_key'] = filter_var($input['recaptcha_public_key'], FILTER_SANITIZE_STRING);
147
+
148
+ if (isset($input['recaptcha_private_key'])) $options['recaptcha_private_key'] = filter_var($input['recaptcha_private_key'], FILTER_SANITIZE_STRING);
149
+ $options['sent_message_heading'] = filter_var($input['sent_message_heading'], FILTER_SANITIZE_STRING);
150
+ $options['sent_message_body'] = filter_var($input['sent_message_body'], FILTER_SANITIZE_STRING);
151
+ $options['message'] = filter_var($input['message'], FILTER_SANITIZE_STRING);
152
+
153
+ if (isset($input['load_stylesheet'])) $options['load_stylesheet'] = true;
154
+ else $options['load_stylesheet'] = false;
155
+
156
+ if (isset($input['use_client_validation'])) $options['use_client_validation'] = true;
157
+ else $options['use_client_validation'] = false;
158
+ update_option(CFF_OPTIONS_KEY, $options);
159
+
160
+ return $input;
161
+ }
162
+ public
163
+ function print_section_info_recaptcha()
164
+ {
165
+ print 'Enter your reCAPTCHA settings below:';
166
+ print "<p>To use reCAPTCHA you must get an API key from <a target='_blank' href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a></p>";
167
+ }
168
+ public
169
+ function print_section_info_message()
170
+ {
171
+ print 'Enter your message settings below:';
172
+ }
173
+ public
174
+ function print_section_info_styling()
175
+ {
176
+
177
+ //print 'Enter your styling settings below:';
178
+
179
+ }
180
+ public
181
+ function create_fields($args)
182
+ {
183
+ $fieldname = $args[0];
184
+
185
+ switch ($fieldname)
186
+ {
187
+ case 'use_recaptcha':
188
+ $checked = cff_PluginSettings::UseRecaptcha() == true ? "checked" : "";
189
+ ?><input type="checkbox" <?php echo $checked; ?> id="use_recaptcha" name="array_key[use_recaptcha]"><?php
190
+ break;
191
+ case 'load_stylesheet':
192
+ $checked = cff_PluginSettings::LoadStyleSheet() == true ? "checked" : "";
193
+ ?><input type="checkbox" <?php echo $checked; ?> id="load_stylesheet" name="array_key[load_stylesheet]"><?php
194
+ break;
195
+ case 'recaptcha_public_key':
196
+ $disabled = cff_PluginSettings::UseRecaptcha() == false ? "disabled" : "";
197
+ ?><input <?php echo $disabled; ?> type="text" size="60" id="recaptcha_public_key" name="array_key[recaptcha_public_key]" value="<?=cff_PluginSettings::PublicKey(); ?>" /><?php
198
+ break;
199
+ case 'recaptcha_private_key':
200
+ $disabled = cff_PluginSettings::UseRecaptcha() == false ? "disabled" : "";
201
+ ?><input <?php echo $disabled; ?> type="text" size="60" id="recaptcha_private_key" name="array_key[recaptcha_private_key]" value="<?=cff_PluginSettings::PrivateKey(); ?>" /><?php
202
+ break;
203
+ case 'sent_message_heading':
204
+ ?><input type="text" size="60" id="sent_message_heading" name="array_key[sent_message_heading]" value="<?=cff_PluginSettings::SentMessageHeading(); ?>" /><?php
205
+ break;
206
+ case 'sent_message_body':
207
+ ?><textarea cols="63" rows="8" name="array_key[sent_message_body]"><?=cff_PluginSettings::SentMessageBody(); ?></textarea><?php
208
+ break;
209
+ case 'message':
210
+ ?><textarea cols="63" rows="8" name="array_key[message]"><?=cff_PluginSettings::Message(); ?></textarea><?php
211
+ break;
212
+ case 'theme':
213
+ $theme = cff_PluginSettings::Theme();
214
+ $disabled = cff_PluginSettings::UseRecaptcha() == false ? "disabled" : "";
215
+ ?>
216
+ <select <?php echo $disabled; ?> id="array_key[theme]" name="array_key[theme]">
217
+ <option <?php echo $theme == "red" ? "selected" : ""; ?> value="red">Red</option>
218
+ <option <?php echo $theme == "white" ? "selected" : ""; ?> value="white">White</option>
219
+ <option <?php echo $theme == "blackglass" ? "selected" : ""; ?> value="blackglass">Blackglass</option>
220
+ <option <?php echo $theme == "clean" ? "selected" : ""; ?> value="clean">Clean</option>
221
+ </select>
222
+ <?php
223
+ break;
224
+ case 'use_client_validation':
225
+ $checked = cff_PluginSettings::UseClientValidation() == true ? "checked" : "";
226
+ ?><input type="checkbox" <?php echo $checked; ?> id="use_client_validation" name="array_key[use_client_validation]"><?php
227
+ break;
228
+ default:
229
+ break;
230
+ }
231
+ }
232
+ }
233
+
class.view.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class CFF_View
4
+ {
5
+ /**
6
+ * Path of the view to render
7
+ */
8
+ var $view = "";
9
+ /**
10
+ * Variables for the view
11
+ */
12
+ var $vars = array();
13
+ /**
14
+ * Construct a view from a file in the
15
+ */
16
+ public
17
+ function __construct($view)
18
+ {
19
+
20
+ if (file_exists(CFF_PLUGIN_DIR . "/views/" . $view . ".view.php"))
21
+ {
22
+ $this->view = CFF_PLUGIN_DIR . "/views/" . $view . ".view.php";
23
+ }
24
+ else
25
+ {
26
+ wp_die(__("View " . CFF_PLUGIN_URL . "/views/" . $view . ".view.php" . " not found"));
27
+ }
28
+ }
29
+ /**
30
+ * set a variable which gets rendered in the view
31
+ */
32
+ public
33
+ function Set($name, $value)
34
+ {
35
+ $this->vars[$name] = $value;
36
+ }
37
+ /**
38
+ * render the view
39
+ */
40
+ public
41
+ function Render()
42
+ {
43
+ extract($this->vars, EXTR_SKIP);
44
+ ob_start();
45
+ include $this->view;
46
+
47
+ return ob_get_clean();
48
+ }
49
+ }
50
+
clean-and-simple-contact-form-by-meg-nicholas.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Clean and Simple Contact Form
4
+ */
5
+
6
+ /*
7
+ Plugin Name: Clean and Simple Contact Form
8
+ Plugin URI: http://megnicholas.co.uk/wordpress-plugins/clean-and-simple-contact-form
9
+ Description: A clean and simple contact form with Google reCAPTCHA and Twitter Bootstrap markup.
10
+ Version: 4.0.7
11
+ Author: Meghan Nicholas
12
+ Author URI: http://megnicholas.co.uk
13
+ License: GPLv2 or later
14
+ */
15
+
16
+ /*
17
+ This program is free software; you can redistribute it and/or
18
+ modify it under the terms of the GNU General Public License
19
+ as published by the Free Software Foundation; either version 2
20
+ of the License, or (at your option) any later version.
21
+
22
+ This program is distributed in the hope that it will be useful,
23
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ GNU General Public License for more details.
26
+
27
+ You should have received a copy of the GNU General Public License
28
+ along with this program; if not, write to the Free Software
29
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30
+ */
31
+
32
+ /*
33
+ * @package Main
34
+ */
35
+ include ('shortcodes/contact-form.php');
36
+ include ('class.cff.php');
37
+ include ('class.cff_pluginsettings.php');
38
+ include ('class.cff_settings.php');
39
+ include ('class.cff_contact.php');
40
+ include ('class.view.php');
41
+
42
+ if (cff_PluginSettings::UseRecaptcha()) include ('recaptcha-php-1.11/recaptchalib.php');
43
+
44
+ if (!defined('CFF_THEME_DIR')) define('CFF_THEME_DIR', ABSPATH . 'wp-content/themes/' . get_template());
45
+
46
+ if (!defined('CFF_PLUGIN_NAME')) define('CFF_PLUGIN_NAME', 'clean-and-simple-contact-form-by-meg-nicholas');
47
+
48
+ if (!defined('CFF_PLUGIN_DIR')) define('CFF_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . CFF_PLUGIN_NAME);
49
+
50
+ if (!defined('CFF_PLUGIN_URL')) define('CFF_PLUGIN_URL', WP_PLUGIN_URL . '/' . CFF_PLUGIN_NAME);
51
+
52
+ if (!defined('CFF_VERSION_KEY')) define('CFF_VERSION_KEY', 'cff_version');
53
+
54
+ if (!defined('CFF_VERSION_NUM')) define('CFF_VERSION_NUM', '4.0.7');
55
+
56
+ if (!defined('CFF_OPTIONS_KEY')) define('CFF_OPTIONS_KEY', 'cff_options');
57
+
58
+ add_option(CFF_VERSION_KEY, CFF_VERSION_NUM);
59
+
60
+ $cff = new cff();
61
+
css/bootstrap-forms.min.css ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Bootstrap v2.3.1
3
+ *
4
+ * Copyright 2012 Twitter, Inc
5
+ * Licensed under the Apache License v2.0
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
9
+ */
10
+ .clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0;}
11
+ .clearfix:after{clear:both;}
12
+ .hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;}
13
+ .input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
14
+ form{margin:0 0 20px;}
15
+ fieldset{padding:0;margin:0;border:0;}
16
+ legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333333;border:0;border-bottom:1px solid #e5e5e5;}legend small{font-size:15px;color:#999999;}
17
+ label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px;}
18
+ input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;}
19
+ label{display:block;margin-bottom:5px;}
20
+ select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555555;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;vertical-align:middle;}
21
+ input,textarea,.uneditable-input{width:206px;}
22
+ textarea{height:auto;}
23
+ textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#ffffff;border:1px solid #cccccc;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-webkit-transition:border linear .2s, box-shadow linear .2s;-moz-transition:border linear .2s, box-shadow linear .2s;-o-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82, 168, 236, 0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);}
24
+ input[type="radio"],input[type="checkbox"]{margin:4px 0 0;*margin-top:0;margin-top:1px \9;line-height:normal;}
25
+ input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto;}
26
+ select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px;}
27
+ select{width:220px;border:1px solid #cccccc;background-color:#ffffff;}
28
+ select[multiple],select[size]{height:auto;}
29
+ select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
30
+ .uneditable-input,.uneditable-textarea{color:#999999;background-color:#fcfcfc;border-color:#cccccc;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;}
31
+ .uneditable-input{overflow:hidden;white-space:nowrap;}
32
+ .uneditable-textarea{width:auto;height:auto;}
33
+ input:-moz-placeholder,textarea:-moz-placeholder{color:#999999;}
34
+ input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999999;}
35
+ input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999999;}
36
+ .radio,.checkbox{min-height:20px;padding-left:20px;}
37
+ .radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px;}
38
+ .controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px;}
39
+ .radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle;}
40
+ .radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px;}
41
+ .input-mini{width:60px;}
42
+ .input-small{width:90px;}
43
+ .input-medium{width:150px;}
44
+ .input-large{width:210px;}
45
+ .input-xlarge{width:270px;}
46
+ .input-xxlarge{width:530px;}
47
+ input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0;}
48
+ .input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block;}
49
+ input,textarea,.uneditable-input{margin-left:0;}
50
+ .controls-row [class*="span"]+[class*="span"]{margin-left:20px;}
51
+ input.span12,textarea.span12,.uneditable-input.span12{width:926px;}
52
+ input.span11,textarea.span11,.uneditable-input.span11{width:846px;}
53
+ input.span10,textarea.span10,.uneditable-input.span10{width:766px;}
54
+ input.span9,textarea.span9,.uneditable-input.span9{width:686px;}
55
+ input.span8,textarea.span8,.uneditable-input.span8{width:606px;}
56
+ input.span7,textarea.span7,.uneditable-input.span7{width:526px;}
57
+ input.span6,textarea.span6,.uneditable-input.span6{width:446px;}
58
+ input.span5,textarea.span5,.uneditable-input.span5{width:366px;}
59
+ input.span4,textarea.span4,.uneditable-input.span4{width:286px;}
60
+ input.span3,textarea.span3,.uneditable-input.span3{width:206px;}
61
+ input.span2,textarea.span2,.uneditable-input.span2{width:126px;}
62
+ input.span1,textarea.span1,.uneditable-input.span1{width:46px;}
63
+ .controls-row{*zoom:1;}.controls-row:before,.controls-row:after{display:table;content:"";line-height:0;}
64
+ .controls-row:after{clear:both;}
65
+ .controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left;}
66
+ .controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px;}
67
+ input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eeeeee;}
68
+ input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent;}
69
+ .control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853;}
70
+ .control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;}
71
+ .control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #dbc59e;}
72
+ .control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853;}
73
+ .control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48;}
74
+ .control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;}
75
+ .control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #d59392;}
76
+ .control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48;}
77
+ .control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847;}
78
+ .control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;}
79
+ .control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7aba7b;}
80
+ .control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847;}
81
+ .control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad;}
82
+ .control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad;}
83
+ .control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7ab5d3;}
84
+ .control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad;}
85
+ input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b;}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;}
86
+ .form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1;}.form-actions:before,.form-actions:after{display:table;content:"";line-height:0;}
87
+ .form-actions:after{clear:both;}
88
+ .help-block,.help-inline{color:#595959;}
89
+ .help-block{display:block;margin-bottom:10px;}
90
+ .help-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding-left:5px;}
91
+ .input-append,.input-prepend{display:inline-block;margin-bottom:10px;vertical-align:middle;font-size:0;white-space:nowrap;}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu,.input-append .popover,.input-prepend .popover{font-size:14px;}
92
+ .input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2;}
93
+ .input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #ffffff;background-color:#eeeeee;border:1px solid #ccc;}
94
+ .input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
95
+ .input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546;}
96
+ .input-prepend .add-on,.input-prepend .btn{margin-right:-1px;}
97
+ .input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;}
98
+ .input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;}
99
+ .input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px;}
100
+ .input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;}
101
+ .input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;}
102
+ .input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;}
103
+ .input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;}
104
+ .input-prepend.input-append .btn-group:first-child{margin-left:0;}
105
+ input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;}
106
+ .form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
107
+ .form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px;}
108
+ .form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0;}
109
+ .form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0;}
110
+ .form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px;}
111
+ .form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;*zoom:1;margin-bottom:0;vertical-align:middle;}
112
+ .form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none;}
113
+ .form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block;}
114
+ .form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0;}
115
+ .form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle;}
116
+ .form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0;}
117
+ .control-group{margin-bottom:10px;}
118
+ legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate;}
119
+ .form-horizontal .control-group{margin-bottom:20px;*zoom:1;}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";line-height:0;}
120
+ .form-horizontal .control-group:after{clear:both;}
121
+ .form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right;}
122
+ .form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0;}.form-horizontal .controls:first-child{*padding-left:180px;}
123
+ .form-horizontal .help-block{margin-bottom:0;}
124
+ .form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px;}
125
+ .form-horizontal .form-actions{padding-left:180px;}
126
+ .btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333333;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top, #ffffff, #e6e6e6);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(top, #ffffff, #e6e6e6);background-image:-o-linear-gradient(top, #ffffff, #e6e6e6);background-image:linear-gradient(to bottom, #ffffff, #e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #cccccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);}.btn:hover,.btn:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333333;background-color:#e6e6e6;*background-color:#d9d9d9;}
127
+ .btn:active,.btn.active{background-color:#cccccc \9;}
128
+ .btn:first-child{*margin-left:0;}
129
+ .btn:hover,.btn:focus{color:#333333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position 0.1s linear;-moz-transition:background-position 0.1s linear;-o-transition:background-position 0.1s linear;transition:background-position 0.1s linear;}
130
+ .btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
131
+ .btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);}
132
+ .btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
133
+ .btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
134
+ .btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px;}
135
+ .btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
136
+ .btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0;}
137
+ .btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px;}
138
+ .btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
139
+ .btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
140
+ .btn-block+.btn-block{margin-top:5px;}
141
+ input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%;}
142
+ .btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255, 255, 255, 0.75);}
143
+ .btn-primary{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #0088cc, #0044cc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));background-image:-webkit-linear-gradient(top, #0088cc, #0044cc);background-image:-o-linear-gradient(top, #0088cc, #0044cc);background-image:linear-gradient(to bottom, #0088cc, #0044cc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);border-color:#0044cc #0044cc #002a80;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#0044cc;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#ffffff;background-color:#0044cc;*background-color:#003bb3;}
144
+ .btn-primary:active,.btn-primary.active{background-color:#003399 \9;}
145
+ .btn-warning{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(to bottom, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#ffffff;background-color:#f89406;*background-color:#df8505;}
146
+ .btn-warning:active,.btn-warning.active{background-color:#c67605 \9;}
147
+ .btn-danger{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#da4f49;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(to bottom, #ee5f5b, #bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#bd362f;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#ffffff;background-color:#bd362f;*background-color:#a9302a;}
148
+ .btn-danger:active,.btn-danger.active{background-color:#942a25 \9;}
149
+ .btn-success{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#5bb75b;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(to bottom, #62c462, #51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#51a351;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#ffffff;background-color:#51a351;*background-color:#499249;}
150
+ .btn-success:active,.btn-success.active{background-color:#408140 \9;}
151
+ .btn-info{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#49afcd;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(to bottom, #5bc0de, #2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#2f96b4;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#ffffff;background-color:#2f96b4;*background-color:#2a85a0;}
152
+ .btn-info:active,.btn-info.active{background-color:#24748c \9;}
153
+ .btn-inverse{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#363636;background-image:-moz-linear-gradient(top, #444444, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));background-image:-webkit-linear-gradient(top, #444444, #222222);background-image:-o-linear-gradient(top, #444444, #222222);background-image:linear-gradient(to bottom, #444444, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#222222;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-inverse:hover,.btn-inverse:focus,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#ffffff;background-color:#222222;*background-color:#151515;}
154
+ .btn-inverse:active,.btn-inverse.active{background-color:#080808 \9;}
155
+ button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0;}
156
+ button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px;}
157
+ button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px;}
158
+ button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px;}
159
+ .btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
160
+ .btn-link{border-color:transparent;cursor:pointer;color:#0088cc;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
161
+ .btn-link:hover,.btn-link:focus{color:#005580;text-decoration:underline;background-color:transparent;}
162
+ .btn-link[disabled]:hover,.btn-link[disabled]:focus{color:#333333;text-decoration:none;}
js/jquery.metadata.js ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Metadata - jQuery plugin for parsing metadata from elements
3
+ *
4
+ * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl.html
9
+ *
10
+ * Revision: $Id: jquery.metadata.js 4187 2007-12-16 17:15:27Z joern.zaefferer $
11
+ *
12
+ */
13
+
14
+ /**
15
+ * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
16
+ * in the JSON will become a property of the element itself.
17
+ *
18
+ * There are three supported types of metadata storage:
19
+ *
20
+ * attr: Inside an attribute. The name parameter indicates *which* attribute.
21
+ *
22
+ * class: Inside the class attribute, wrapped in curly braces: { }
23
+ *
24
+ * elem: Inside a child element (e.g. a script tag). The
25
+ * name parameter indicates *which* element.
26
+ *
27
+ * The metadata for an element is loaded the first time the element is accessed via jQuery.
28
+ *
29
+ * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
30
+ * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
31
+ *
32
+ * @name $.metadata.setType
33
+ *
34
+ * @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
35
+ * @before $.metadata.setType("class")
36
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
37
+ * @desc Reads metadata from the class attribute
38
+ *
39
+ * @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
40
+ * @before $.metadata.setType("attr", "data")
41
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
42
+ * @desc Reads metadata from a "data" attribute
43
+ *
44
+ * @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
45
+ * @before $.metadata.setType("elem", "script")
46
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
47
+ * @desc Reads metadata from a nested script element
48
+ *
49
+ * @param String type The encoding type
50
+ * @param String name The name of the attribute to be used to get metadata (optional)
51
+ * @cat Plugins/Metadata
52
+ * @descr Sets the type of encoding to be used when loading metadata for the first time
53
+ * @type undefined
54
+ * @see metadata()
55
+ */
56
+
57
+ (function($) {
58
+
59
+ $.extend({
60
+ metadata : {
61
+ defaults : {
62
+ type: 'class',
63
+ name: 'metadata',
64
+ cre: /({.*})/,
65
+ single: 'metadata'
66
+ },
67
+ setType: function( type, name ){
68
+ this.defaults.type = type;
69
+ this.defaults.name = name;
70
+ },
71
+ get: function( elem, opts ){
72
+ var settings = $.extend({},this.defaults,opts);
73
+ // check for empty string in single property
74
+ if ( !settings.single.length ) settings.single = 'metadata';
75
+
76
+ var data = $.data(elem, settings.single);
77
+ // returned cached data if it already exists
78
+ if ( data ) return data;
79
+
80
+ data = "{}";
81
+
82
+ if ( settings.type == "class" ) {
83
+ var m = settings.cre.exec( elem.className );
84
+ if ( m )
85
+ data = m[1];
86
+ } else if ( settings.type == "elem" ) {
87
+ if( !elem.getElementsByTagName )
88
+ return undefined;
89
+ var e = elem.getElementsByTagName(settings.name);
90
+ if ( e.length )
91
+ data = $.trim(e[0].innerHTML);
92
+ } else if ( elem.getAttribute != undefined ) {
93
+ var attr = elem.getAttribute( settings.name );
94
+ if ( attr )
95
+ data = attr;
96
+ }
97
+
98
+ if ( data.indexOf( '{' ) <0 )
99
+ data = "{" + data + "}";
100
+
101
+ data = eval("(" + data + ")");
102
+
103
+ $.data( elem, settings.single, data );
104
+ return data;
105
+ }
106
+ }
107
+ });
108
+
109
+ /**
110
+ * Returns the metadata object for the first member of the jQuery object.
111
+ *
112
+ * @name metadata
113
+ * @descr Returns element's metadata object
114
+ * @param Object opts An object contianing settings to override the defaults
115
+ * @type jQuery
116
+ * @cat Plugins/Metadata
117
+ */
118
+ $.fn.metadata = function( opts ){
119
+ return $.metadata.get( this[0], opts );
120
+ };
121
+
122
+ })(jQuery);
js/jquery.validate.contact.form.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery Contact-Form Validation - v1.0.0 - 22/04/2013
2
+ * Author Meghan Nicholas
3
+ * Licence GPL2 */
4
+
5
+ jQuery(document).ready(function($) {
6
+
7
+ $('#frmContact').validate({
8
+
9
+ errorElement: 'span',
10
+ errorClass: 'help-inline',
11
+
12
+ highlight: function(element) {
13
+ $(element).closest('.control-group').removeClass('success').addClass('error');
14
+ },
15
+ success: function(element) {
16
+ element
17
+ .closest('.control-group').removeClass('error').addClass('success');
18
+ }
19
+
20
+
21
+ });
22
+
23
+ });
js/jquery.validate.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery Validation Plugin - v1.10.0 - 9/7/2012
2
+ * https://github.com/jzaefferer/jquery-validation
3
+ * Copyright (c) 2012 Jörn Zaefferer; Licensed MIT, GPL */
4
+ (function(a){a.extend(a.fn,{validate:function(b){if(!this.length){b&&b.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm)),c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){if(a(this[0]).is("form"))return this.validate().form();var b=!0,c=a(this[0].form).validate();return this.each(function(){b&=c.element(this)}),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d=this[0];if(b){var e=a.data(d.form,"validator").settings,f=e.rules,g=a.validator.staticRules(d);switch(b){case"add":a.extend(g,a.validator.normalizeRule(c)),f[d.name]=g,c.messages&&(e.messages[d.name]=a.extend(e.messages[d.name],c.messages));break;case"remove":if(!c)return delete f[d.name],g;var h={};return a.each(c.split(/\s/),function(a,b){h[b]=g[b],delete g[b]}),h}}var i=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(d),a.validator.classRules(d),a.validator.attributeRules(d),a.validator.staticRules(d)),d);if(i.required){var j=i.required;delete i.required,i=a.extend({required:j},i)}return i}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+b.value)},filled:function(b){return!!a.trim(""+b.value)},unchecked:function(a){return!a.checked}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return arguments.length===1?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),c)}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a,b){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(a)).hide())},onfocusout:function(a,b){!this.checkable(a)&&(a.name in this.submitted||!this.optional(a))&&this.element(a)},onkeyup:function(a,b){if(b.which===9&&this.elementValue(a)==="")return;(a.name in this.submitted||a===this.lastActive)&&this.element(a)},onclick:function(a,b){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){b.type==="radio"?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){b.type==="radio"?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function d(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,"");c.settings[d]&&c.settings[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var b=this.groups={};a.each(this.settings.groups,function(c,d){a.each(d.split(/\s/),function(a,d){b[d]=c})});var c=this.settings.rules;a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",d).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",d),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){b=this.validationTargetFor(this.clean(b)),this.lastElement=b,this.prepareElement(b),this.currentElements=a(b);var c=this.check(b)!==!1;return c?delete this.invalid[b.name]:this.invalid[b.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),c},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0;for(var c in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()===0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(a){return a.element.name===b.name}).length===1&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.replace(" ",".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c=a(b).attr("type"),d=a(b).val();return c==="radio"||c==="checkbox"?a('input[name="'+a(b).attr("name")+'"]:checked').val():typeof d=="string"?d.replace(/\r/g,""):d},check:function(b){b=this.validationTargetFor(this.clean(b));var c=a(b).rules(),d=!1,e=this.elementValue(b),f;for(var g in c){var h={method:g,parameters:c[g]};try{f=a.validator.methods[g].call(this,e,b,h.parameters);if(f==="dependency-mismatch"){d=!0;continue}d=!1;if(f==="pending"){this.toHide=this.toHide.not(this.errorsFor(b));return}if(!f)return this.formatAndAdd(b,h),!1}catch(i){throw this.settings.debug&&window.console&&console.log("exception occured when checking element "+b.id+", check the '"+h.method+"' method",i),i}}if(d)return;return this.objectLength(c)&&this.successList.push(b),!0},customMetaMessage:function(b,c){if(!a.metadata)return;var d=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return d&&d.messages&&d.messages[c]},customDataMessage:function(b,c){return a(b).data("msg-"+c.toLowerCase())||b.attributes&&a(b).attr("data-msg-"+c.toLowerCase())},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==undefined)return arguments[a];return undefined},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||undefined,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;typeof d=="function"?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b;for(a=0;this.errorList[a];a++){var c=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message)}this.errorList.length&&(this.toShow=this.toShow.add(this.containers));if(this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d=this.errorsFor(b);d.length?(d.removeClass(this.settings.validClass).addClass(this.settings.errorClass),d.attr("generated")&&d.html(c)):(d=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(b),generated:!0}).addClass(this.settings.errorClass).html(c||""),this.settings.wrapper&&(d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b))),!c&&this.settings.success&&(d.text(""),typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d,b)),this.toShow=this.toShow.add(d)},errorsFor:function(b){var c=this.idOrName(b);return this.errors().filter(function(){return a(this).attr("for")===c})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){return this.checkable(a)&&(a=this.findByName(a.name).not(this.settings.ignore)[0]),a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find('[name="'+b+'"]')},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a,b){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&this.pendingRequest===0&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&this.pendingRequest===0&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c={},d=a(b);for(var e in a.validator.methods){var f;e==="required"?(f=d.get(0).getAttribute(e),f===""&&(f=!0),f=!!f):f=d.attr(e),f?c[e]=f:d[0].getAttribute("type")===e&&(c[e]=!0)}return c.maxlength&&/-1|2147483647|524288/.test(c.maxlength)&&delete c.maxlength,c},metadataRules:function(b){if(!a.metadata)return{};var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1){delete b[d];return}if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=e.param!==undefined?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength","min","max"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){b[this]&&(b[this]=[Number(b[this][0]),Number(b[this][1])])}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b.messages&&delete b.messages,b},normalizeRule:function(b){if(typeof b=="string"){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=d!==undefined?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if(c.nodeName.toLowerCase()==="select"){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e=this.previousValue(c);this.settings.messages[c.name]||(this.settings.messages[c.name]={}),e.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=e.message,d=typeof d=="string"&&{url:d}||d;if(this.pending[c.name])return"pending";if(e.old===b)return e.valid;e.old=b;var f=this;this.startRequest(c);var g={};return g[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:g,success:function(d){f.settings.messages[c.name].remote=e.originalMessage;var g=d===!0||d==="true";if(g){var h=f.formSubmitted;f.prepareElement(c),f.formSubmitted=h,f.successList.push(c),delete f.invalid[c.name],f.showErrors()}else{var i={},j=d||f.defaultMessage(c,"remote");i[c.name]=e.message=a.isFunction(j)?j(b):j,f.invalid[c.name]=!0,f.showErrors(i)}e.valid=g,f.stopRequest(c,g)}},d)),"pending"},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a)},url:function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c=0,d=0,e=!1;a=a.replace(/\D/g,"");for(var f=a.length-1;f>=0;f--){var g=a.charAt(f);d=parseInt(g,10),e&&(d*=2)>9&&(d-=9),c+=d,e=!e}return c%10===0},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()}}}),a.format=a.validator.format})(jQuery),function(a){var b={};if(a.ajaxPrefilter)a.ajaxPrefilter(function(a,c,d){var e=a.port;a.mode==="abort"&&(b[e]&&b[e].abort(),b[e]=d)});else{var c=a.ajax;a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return e==="abort"?(b[f]&&b[f].abort(),b[f]=c.apply(this,arguments)):c.apply(this,arguments)}}}(jQuery),function(a){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&a.each({focus:"focusin",blur:"focusout"},function(b,c){function d(b){return b=a.event.fix(b),b.type=c,a.event.handle.call(this,b)}a.event.special[c]={setup:function(){this.addEventListener(b,d,!0)},teardown:function(){this.removeEventListener(b,d,!0)},handler:function(b){var d=arguments;return d[0]=a.event.fix(b),d[0].type=c,a.event.handle.apply(this,d)}}}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);if(e.is(b))return d.apply(e,arguments)})}})}(jQuery)
readme.txt ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Clean and Simple Contact Form ===
2
+ Contributors: MegNicholas
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AKQM4KSBQ4H66
4
+ License: GPLv2 or later
5
+ License URI: http://www.gnu.org/licenses/gpl.html
6
+ Tags: simple, contact, form, bootstrap, twitter, google, reCAPTCHA, ajax, secure
7
+ Requires at least: 3.3
8
+ Tested up to: 3.5
9
+ Stable tag: 4.0.7
10
+
11
+ A clean and simple contact form with Google reCAPTCHA and Twitter Bootstrap markup.
12
+
13
+ == Description ==
14
+ A clean and simple contact form with Google reCAPTCHA and Twitter Bootstrap markup.
15
+
16
+ * **Clean**: all user inputs are stripped in order to avoid cross-site scripting (XSS) vulnerabilities.
17
+
18
+ * **Simple**: Ajax enabled validation for immediate response and guidance for your users (can be switched off).
19
+
20
+ * **Stylish**: Use the included stylesheet or switch it off and use your own for seamless integration with your website.
21
+ Uses **Twitter Bootstrap** classes.
22
+
23
+ This is a straightforward contact form for your WordPress site. There is very minimal set-up
24
+ required.
25
+
26
+ A standard set of input boxes are provided, these include Email Address, Name, Message and a nice big ‘Send Message’ button.
27
+
28
+ When your user has completed the form an email will be sent to you containing your user’s message. To reply simply click the ‘reply’ button on your email client. The email address used is the one you have set up in WordPress under ‘Settings’ -> ‘General’, so do check this is correct.
29
+
30
+ To help prevent spam, this plugin allows you to add a ‘reCAPTCHA’. This adds a picture of a couple of words to the bottom of the form. Your user must correctly type the words before the form can be submitted, and in so doing, prove that they are human.
31
+
32
+ = Why Choose This Plugin? =
33
+ Granted there are many plugins of this type in existence already. Why use this one in-particular?
34
+
35
+ Here’s why:
36
+
37
+ * Minimal setup. Simply activate the plugin and place the shortcode [contact-form] on any post or page.
38
+
39
+ * **Safe**. All input entered by your user is stripped back to minimise as far as possible the likelihood of any malicious user attempting to inject a script into your website. You can turn on reCAPTCHA to avoid your form being abused by bots.
40
+
41
+ * **Ajax enabled**. You have the option to turn on ajax (client-side) validation which gives your users immediate guidance when completing the form without having to wait for the page to refresh.
42
+
43
+ * The form can **integrate seamlessly into your website**. Turn off the plugin’s default css style sheet so that your theme’s style sheet can be used instead.
44
+
45
+ * If your theme is based on **twitter bootstrap** then this plugin will fit right in because it already has all the right div’s and CSS classes for bootstrap.
46
+
47
+ * This plugin will only link in its jQuery file where it’s needed, it **will not impose** itself on every page of your whole site!
48
+
49
+ * Works with the **latest version of WordPress**.
50
+
51
+ * Written by an **experienced PHP programmer** and rigorously tested as standard practice.
52
+
53
+ Hopefully this plugin will fulfil all your needs, if not get in-touch http://megnicholas.co.uk/contact-me and I will customise to your exact requirements.
54
+
55
+ == Installation ==
56
+ There are two ways to install:
57
+
58
+ 1. Click the ‘Install Now’ link from the plugin library listing to automatically download and install.
59
+
60
+ 2. Download the plugin as a zip file. To install the zip file simply double click to extract it and place the ‘contact-form’ folder in your wordpress plugins folder, i.e. <wordpress>/wp-content/plugins where <wordpress> is the directory that you installed WordPress in.
61
+
62
+ == How to Use ==
63
+ Unless you want to change messages or add reCAPTCHA to your contact form then this plugin will work without any additional setup.
64
+
65
+ Important: Check that you have an email address set-up in your WordPress ‘Settings’->’General’ page. This is the address that the plugin will use to send the contents of the contact form.
66
+
67
+ To add the contact form to your WordPress website simply place the shortcode [contact-form] on the post or page that you wish the form to appear on.
68
+
69
+ == Additional Settings ==
70
+ This plugin will work as is without any additional setup. You have the option to change the default messages that are displayed to your user and to add reCAPTCHA capabilities.
71
+
72
+ Go to the settings screen for the contact form plugin.
73
+
74
+ You will find a link to the setting screen against the entry of this plugin on the ‘Installed Plugins’ page.
75
+
76
+ Here is a list of things that you can change
77
+
78
+ * **Message**: The message displayed to the user at the top of the contact form.
79
+
80
+ * **Message** Sent Heading: The message heading or title displayed to the user after the message has been sent.
81
+
82
+ * **Message Sent Content**: The message content or body displayed to the user after the message has been sent.
83
+
84
+ * **Use this plugin’s default stylesheet**: The plugin comes with a default style sheet to make the form look nice for your user. Untick this if you want to use your theme’s stylesheet instead. The default stylesheet will simply not be linked in.
85
+
86
+ * **Use client side validation (Ajax)**: When ticked the contact form will be validated on the client giving your user instant feedback if they have filled the form in incorrectly. If you wish the form to be validated only on the server then untick this option.
87
+
88
+ * **Use reCAPTCHA**: Tick this option if you wish your form to have a reCAPTCHA box. ReCAPTCHA helps to avoid spam bots using your form by checking that the form filler is actually a real person. To use reCAPTCHA you will need to get a some special keys from google. Once you have your keys enter them into the Public key and Private key boxes
89
+
90
+ * **reCAPTCHA Public Key**: Enter the public key that you obtained from here.
91
+
92
+ * **reCAPTCHA Private Key**: Enter the private key that you obtained from here.
93
+
94
+ * **reCAPTCHA Theme**: Here you can change the reCAPTCHA box theme so that it fits with the style of your website.
95
+
96
+ == Screenshots ==
97
+ 1. Contact Form With reCAPTCHA
98
+ 2. Contact Form Without reCAPTCHA
99
+ 3. Message Sent
100
+ 4. Contact Form Options Screen
101
+
102
+ == Demo ==
103
+ This is a demonstration of this plugin working on the default Twenty Twelve theme.
104
+ [Clean and Simple Contact Form Demonstration] (http://demo.megnicholas.co.uk/wordpress-clean-and-simple-contact-form “Plugin Demonstration”)
105
+
106
+ == Frequently Asked Questions ==
107
+ A clean and simple contact form with Google reCAPTCHA and Twitter Bootstrap markup.
108
+
109
+ == Changelog ==
110
+ Version 4.07
111
+ 1: Fixed a bug: Plugin name is actually clean-and-simple-contact-form-by-meg-nicholas now (not contact-form) but this new name needed to be updated in the plugin settings definitions. I also needed to rename contact-form.php to clean-and-simple-contact-form-by-meg-nicholas.php. My thanks to Jakub for finding this bug.
112
+ 2: If your webpage is ssl then recaptcha will now also use ssl mode.
113
+
114
+
115
+ == Upgrade Notice ==
116
+ Fixed a bug which occurred when plugin name was changed. Recaptcha will now use ssl if your webpage is ssl.
recaptcha-php-1.11/LICENSE ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
2
+ AUTHORS:
3
+ Mike Crawford
4
+ Ben Maurer
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
recaptcha-php-1.11/README ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ reCAPTCHA README
2
+ ================
3
+
4
+ The reCAPTCHA PHP Lirary helps you use the reCAPTCHA API. Documentation
5
+ for this library can be found at
6
+
7
+ http://recaptcha.net/plugins/php
recaptcha-php-1.11/example-captcha.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <body>
3
+ <form action="" method="post">
4
+ <?php
5
+
6
+ require_once('recaptchalib.php');
7
+
8
+ // Get a key from https://www.google.com/recaptcha/admin/create
9
+ $publickey = "";
10
+ $privatekey = "";
11
+
12
+ # the response from reCAPTCHA
13
+ $resp = null;
14
+ # the error code from reCAPTCHA, if any
15
+ $error = null;
16
+
17
+ # was there a reCAPTCHA response?
18
+ if ($_POST["recaptcha_response_field"]) {
19
+ $resp = recaptcha_check_answer ($privatekey,
20
+ $_SERVER["REMOTE_ADDR"],
21
+ $_POST["recaptcha_challenge_field"],
22
+ $_POST["recaptcha_response_field"]);
23
+
24
+ if ($resp->is_valid) {
25
+ echo "You got it!";
26
+ } else {
27
+ # set the error code so that we can display it
28
+ $error = $resp->error;
29
+ }
30
+ }
31
+ echo recaptcha_get_html($publickey, $error);
32
+ ?>
33
+ <br/>
34
+ <input type="submit" value="submit" />
35
+ </form>
36
+ </body>
37
+ </html>
recaptcha-php-1.11/example-mailhide.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html><body>
2
+ <?
3
+ require_once ("recaptchalib.php");
4
+
5
+ // get a key at http://www.google.com/recaptcha/mailhide/apikey
6
+ $mailhide_pubkey = '';
7
+ $mailhide_privkey = '';
8
+
9
+ ?>
10
+
11
+ The Mailhide version of example@example.com is
12
+ <? echo recaptcha_mailhide_html ($mailhide_pubkey, $mailhide_privkey, "example@example.com"); ?>. <br>
13
+
14
+ The url for the email is:
15
+ <? echo recaptcha_mailhide_url ($mailhide_pubkey, $mailhide_privkey, "example@example.com"); ?> <br>
16
+
17
+ </body></html>
recaptcha-php-1.11/recaptchalib.php ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * This is a PHP library that handles calling reCAPTCHA.
4
+ * - Documentation and latest version
5
+ * http://recaptcha.net/plugins/php/
6
+ * - Get a reCAPTCHA API Key
7
+ * https://www.google.com/recaptcha/admin/create
8
+ * - Discussion group
9
+ * http://groups.google.com/group/recaptcha
10
+ *
11
+ * Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
12
+ * AUTHORS:
13
+ * Mike Crawford
14
+ * Ben Maurer
15
+ *
16
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
17
+ * of this software and associated documentation files (the "Software"), to deal
18
+ * in the Software without restriction, including without limitation the rights
19
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
+ * copies of the Software, and to permit persons to whom the Software is
21
+ * furnished to do so, subject to the following conditions:
22
+ *
23
+ * The above copyright notice and this permission notice shall be included in
24
+ * all copies or substantial portions of the Software.
25
+ *
26
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32
+ * THE SOFTWARE.
33
+ */
34
+
35
+ /**
36
+ * The reCAPTCHA server URL's
37
+ */
38
+ define("RECAPTCHA_API_SERVER", "http://www.google.com/recaptcha/api");
39
+ define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api");
40
+ define("RECAPTCHA_VERIFY_SERVER", "www.google.com");
41
+
42
+ /**
43
+ * Encodes the given data into a query string format
44
+ * @param $data - array of string elements to be encoded
45
+ * @return string - encoded request
46
+ */
47
+ function _recaptcha_qsencode ($data) {
48
+ $req = "";
49
+ foreach ( $data as $key => $value )
50
+ $req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
51
+
52
+ // Cut the last '&'
53
+ $req=substr($req,0,strlen($req)-1);
54
+ return $req;
55
+ }
56
+
57
+
58
+
59
+ /**
60
+ * Submits an HTTP POST to a reCAPTCHA server
61
+ * @param string $host
62
+ * @param string $path
63
+ * @param array $data
64
+ * @param int port
65
+ * @return array response
66
+ */
67
+ function _recaptcha_http_post($host, $path, $data, $port = 80) {
68
+
69
+ $req = _recaptcha_qsencode ($data);
70
+
71
+ $http_request = "POST $path HTTP/1.0\r\n";
72
+ $http_request .= "Host: $host\r\n";
73
+ $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
74
+ $http_request .= "Content-Length: " . strlen($req) . "\r\n";
75
+ $http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
76
+ $http_request .= "\r\n";
77
+ $http_request .= $req;
78
+
79
+ $response = '';
80
+ if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
81
+ die ('Could not open socket');
82
+ }
83
+
84
+ fwrite($fs, $http_request);
85
+
86
+ while ( !feof($fs) )
87
+ $response .= fgets($fs, 1160); // One TCP-IP packet
88
+ fclose($fs);
89
+ $response = explode("\r\n\r\n", $response, 2);
90
+
91
+ return $response;
92
+ }
93
+
94
+
95
+
96
+ /**
97
+ * Gets the challenge HTML (javascript and non-javascript version).
98
+ * This is called from the browser, and the resulting reCAPTCHA HTML widget
99
+ * is embedded within the HTML form it was called from.
100
+ * @param string $pubkey A public key for reCAPTCHA
101
+ * @param string $error The error given by reCAPTCHA (optional, default is null)
102
+ * @param boolean $use_ssl Should the request be made over ssl? (optional, default is false)
103
+
104
+ * @return string - The HTML to be embedded in the user's form.
105
+ */
106
+ function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
107
+ {
108
+ if ($pubkey == null || $pubkey == '') {
109
+ die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
110
+ }
111
+
112
+ if ($use_ssl) {
113
+ $server = RECAPTCHA_API_SECURE_SERVER;
114
+ } else {
115
+ $server = RECAPTCHA_API_SERVER;
116
+ }
117
+
118
+ $errorpart = "";
119
+ if ($error) {
120
+ $errorpart = "&amp;error=" . $error;
121
+ }
122
+ return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
123
+
124
+ <noscript>
125
+ <iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
126
+ <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
127
+ <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
128
+ </noscript>';
129
+ }
130
+
131
+
132
+
133
+
134
+ /**
135
+ * A ReCaptchaResponse is returned from recaptcha_check_answer()
136
+ */
137
+ class ReCaptchaResponse {
138
+ var $is_valid;
139
+ var $error;
140
+ }
141
+
142
+
143
+ /**
144
+ * Calls an HTTP POST function to verify if the user's guess was correct
145
+ * @param string $privkey
146
+ * @param string $remoteip
147
+ * @param string $challenge
148
+ * @param string $response
149
+ * @param array $extra_params an array of extra variables to post to the server
150
+ * @return ReCaptchaResponse
151
+ */
152
+ function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array())
153
+ {
154
+ if ($privkey == null || $privkey == '') {
155
+ die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
156
+ }
157
+
158
+ if ($remoteip == null || $remoteip == '') {
159
+ die ("For security reasons, you must pass the remote ip to reCAPTCHA");
160
+ }
161
+
162
+
163
+
164
+ //discard spam submissions
165
+ if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) {
166
+ $recaptcha_response = new ReCaptchaResponse();
167
+ $recaptcha_response->is_valid = false;
168
+ $recaptcha_response->error = 'incorrect-captcha-sol';
169
+ return $recaptcha_response;
170
+ }
171
+
172
+ $response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify",
173
+ array (
174
+ 'privatekey' => $privkey,
175
+ 'remoteip' => $remoteip,
176
+ 'challenge' => $challenge,
177
+ 'response' => $response
178
+ ) + $extra_params
179
+ );
180
+
181
+ $answers = explode ("\n", $response [1]);
182
+ $recaptcha_response = new ReCaptchaResponse();
183
+
184
+ if (trim ($answers [0]) == 'true') {
185
+ $recaptcha_response->is_valid = true;
186
+ }
187
+ else {
188
+ $recaptcha_response->is_valid = false;
189
+ $recaptcha_response->error = $answers [1];
190
+ }
191
+ return $recaptcha_response;
192
+
193
+ }
194
+
195
+ /**
196
+ * gets a URL where the user can sign up for reCAPTCHA. If your application
197
+ * has a configuration page where you enter a key, you should provide a link
198
+ * using this function.
199
+ * @param string $domain The domain where the page is hosted
200
+ * @param string $appname The name of your application
201
+ */
202
+ function recaptcha_get_signup_url ($domain = null, $appname = null) {
203
+ return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname));
204
+ }
205
+
206
+ function _recaptcha_aes_pad($val) {
207
+ $block_size = 16;
208
+ $numpad = $block_size - (strlen ($val) % $block_size);
209
+ return str_pad($val, strlen ($val) + $numpad, chr($numpad));
210
+ }
211
+
212
+ /* Mailhide related code */
213
+
214
+ function _recaptcha_aes_encrypt($val,$ky) {
215
+ if (! function_exists ("mcrypt_encrypt")) {
216
+ die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
217
+ }
218
+ $mode=MCRYPT_MODE_CBC;
219
+ $enc=MCRYPT_RIJNDAEL_128;
220
+ $val=_recaptcha_aes_pad($val);
221
+ return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
222
+ }
223
+
224
+
225
+ function _recaptcha_mailhide_urlbase64 ($x) {
226
+ return strtr(base64_encode ($x), '+/', '-_');
227
+ }
228
+
229
+ /* gets the reCAPTCHA Mailhide url for a given email, public key and private key */
230
+ function recaptcha_mailhide_url($pubkey, $privkey, $email) {
231
+ if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
232
+ die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
233
+ "you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
234
+ }
235
+
236
+
237
+ $ky = pack('H*', $privkey);
238
+ $cryptmail = _recaptcha_aes_encrypt ($email, $ky);
239
+
240
+ return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
241
+ }
242
+
243
+ /**
244
+ * gets the parts of the email to expose to the user.
245
+ * eg, given johndoe@example,com return ["john", "example.com"].
246
+ * the email is then displayed as john...@example.com
247
+ */
248
+ function _recaptcha_mailhide_email_parts ($email) {
249
+ $arr = preg_split("/@/", $email );
250
+
251
+ if (strlen ($arr[0]) <= 4) {
252
+ $arr[0] = substr ($arr[0], 0, 1);
253
+ } else if (strlen ($arr[0]) <= 6) {
254
+ $arr[0] = substr ($arr[0], 0, 3);
255
+ } else {
256
+ $arr[0] = substr ($arr[0], 0, 4);
257
+ }
258
+ return $arr;
259
+ }
260
+
261
+ /**
262
+ * Gets html to display an email address given a public an private key.
263
+ * to get a key, go to:
264
+ *
265
+ * http://www.google.com/recaptcha/mailhide/apikey
266
+ */
267
+ function recaptcha_mailhide_html($pubkey, $privkey, $email) {
268
+ $emailparts = _recaptcha_mailhide_email_parts ($email);
269
+ $url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
270
+
271
+ return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
272
+ "' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);
273
+
274
+ }
275
+
276
+
277
+ ?>
shortcodes/contact-form.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_shortcode('contact-form', 'cff_ContactForm');
3
+
4
+ function cff_ContactForm()
5
+ {
6
+
7
+ $contact = new cff_Contact;
8
+
9
+ if ($contact->IsValid())
10
+ {
11
+ $headers = 'From: "' . $contact->Name . '" <' . $contact->Email . '>';
12
+
13
+ if (wp_mail(get_bloginfo('admin_email') , get_bloginfo('name') . ' - Web Enquiry', $contact->Message, $headers))
14
+ {
15
+ $view = new CFF_View('message-sent');
16
+ $view->Set('heading',cff_PluginSettings::SentMessageHeading());
17
+ $view->Set('message',cff_PluginSettings::SentMessageBody());
18
+ }
19
+ else
20
+ {
21
+ $view = new CFF_View('message-not-sent');
22
+ }
23
+
24
+ return $view->Render();
25
+ }
26
+
27
+ //here we need some jquery scripts and styles, so load them here
28
+ if ( cff_PluginSettings::UseClientValidation() == true) {
29
+ wp_enqueue_script('jquery-validate');
30
+ wp_enqueue_script('jquery-meta');
31
+ wp_enqueue_script('jquery-validate-contact-form');
32
+ }
33
+
34
+ //only load the stylesheet if required
35
+ if ( cff_PluginSettings::LoadStyleSheet() == true)
36
+ wp_enqueue_style('bootstrap');
37
+
38
+ //set-up the view
39
+ if ( $contact->RecaptchaPublicKey<>'' && $contact->RecaptchaPrivateKey<>'')
40
+ $view = new CFF_View('contact-form-with-recaptcha');
41
+ else
42
+ $view = new CFF_View('contact-form');
43
+
44
+ $view->Set('contact',$contact);
45
+ $view->Set('message',cff_PluginSettings::Message());
46
+ $view->Set('version', CFF_VERSION_NUM);
47
+
48
+ return $view->Render();
49
+
50
+ }
51
+
52
+
53
+
uninstall.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ //if uninstall not called from WordPress exit
4
+
5
+ if (!defined('WP_UNINSTALL_PLUGIN')) exit();
6
+ delete_option('cff_options');
7
+ delete_option('cff_version');
8
+
views/contact-form-with-recaptcha.view.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript">
2
+ var RecaptchaOptions = {
3
+ theme : '<?php echo cff_PluginSettings::Theme(); ?>'
4
+ };
5
+ </script>
6
+
7
+
8
+ <p><?php echo $message; ?></p>
9
+
10
+ <form id="contact-form" name="frmContact" method="post">
11
+
12
+ <?php wp_nonce_field('cff_contact','cff_nonce'); ?>
13
+
14
+ <!-- Clean and Simple Contact Form. Version <?php echo $version; ?> -->
15
+ <div class="control-group">
16
+ <div class="controls">
17
+ <p class="text-error"><?php if (isset($contact->Errors['recaptcha'])) echo $contact->Errors['recaptcha']; ?></p>
18
+ </div>
19
+ </div>
20
+
21
+
22
+ <!--email address -->
23
+ <div class="control-group<?php
24
+ if (isset($contact->Errors['Email'])) echo ' error'; ?>">
25
+ <label class="control-label" for="cf-Email">Email Address:</label>
26
+ <div class="controls">
27
+ <input class="input-xlarge {email:true, required:true, messages:{required:'Please give your email address.',email:'Please enter a valid email address.'}}" type="text" id="cf-Email" name="cf-Email" value="<?php echo $contact->Email; ?>" placeholder="Your Email Address">
28
+ <span class="help-inline"><?php echo $contact->Errors['Email']; ?></span>
29
+ </div>
30
+ </div>
31
+
32
+ <!--confirm email address -->
33
+ <div class="control-group<?php
34
+ if (isset($contact->Errors['Confirm-Email'])) echo ' error'; ?>">
35
+ <label class="control-label" for="cfconfirm-email">Confirm Email Address:</label>
36
+ <div class="controls">
37
+ <input class="input-xlarge {email:true, required:true, equalTo:cfemail, messages:{equalTo:'Please repeat the email address above.', required:'Please give your email address.',email:'Please enter a valid email address.'}}" type="text" id="cfconfirm-email" name="cfconfirm-email" value="<?php echo $contact->ConfirmEmail; ?>" placeholder="Confirm Your Email Address">
38
+ <span class="help-inline"><?php echo $contact->Errors['Confirm-Email']; ?></span>
39
+ </div>
40
+ </div>
41
+
42
+ <!-- name -->
43
+ <div class="control-group<?php
44
+ if (isset($contact->Errors['Name'])) echo ' error'; ?>">
45
+ <label class="control-label" for="cf-Name">Name:</label>
46
+ <div class="controls">
47
+ <input class="input-xlarge {required:true, messages:{required:'Please give your name.'}}" type="text" id="cf-Name" name="cf-Name" value="<?php echo $contact->Name; ?>" placeholder="Your Name">
48
+ <span class="help-inline"><?php echo $contact->Errors['Name']; ?></span>
49
+ </div>
50
+ </div>
51
+
52
+ <!-- message -->
53
+ <div class="control-group<?php
54
+ if (isset($contact->Errors['Message'])) echo ' error'; ?>">
55
+ <label class="control-label" for="cf-Message">Message:</label>
56
+ <div class="controls">
57
+ <textarea class="input-xlarge {required:true, messages:{required:'Please give a message.'}}" id="cf-Message" name="cf-Message" rows="10" placeholder="Your Message"><?php echo $contact->Message; ?></textarea>
58
+ <span class="help-inline"><?php echo $contact->Errors['Message']; ?></span>
59
+ </div>
60
+ </div>
61
+
62
+ <div class="control-group<?php
63
+ if (isset($contact->Errors['recaptcha'])) echo ' error'; ?>">
64
+ <div id="recaptcha_div" class="controls">
65
+ <?php echo recaptcha_get_html($contact->RecaptchaPublicKey,null,$_SERVER['HTTPS'] == "on"); ?>
66
+ <span class="help-inline"><?php echo $contact->Errors['recaptcha']; ?></span>
67
+ </div>
68
+ </div>
69
+
70
+ <div class="control-group">
71
+ <div class="controls">
72
+ <button type="submit" class="btn">Send Message</button>
73
+ </div>
74
+ </div>
75
+ </form>
views/contact-form.view.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p><?php echo $message; ?></p>
2
+
3
+ <form id="frmContact" name="frmContact" method="post">
4
+
5
+ <?php wp_nonce_field('cff_contact','cff_nonce'); ?>
6
+
7
+ <!-- Clean and Simple Contact Form by megnicholas. Version <?php echo $version; ?> -->
8
+
9
+ <!--email address -->
10
+ <div class="control-group<?php
11
+ if (isset($contact->Errors['Email'])) echo ' error'; ?>">
12
+ <label class="control-label" for="cf-Email">Email Address:</label>
13
+ <div class="controls">
14
+ <input class="input-xlarge {email:true, required:true, messages:{required:'Please give your email address.',email:'Please enter a valid email address.'}}" type="text" id="cf-Email" name="cf-Email" value="<?php echo $contact->Email; ?>" placeholder="Your Email Address">
15
+ <span class="help-inline"><?php if (isset($contact->Errors['Email'])) echo $contact->Errors['Email']; ?></span>
16
+ </div>
17
+ </div>
18
+
19
+ <!--confirm email address -->
20
+ <div class="control-group<?php
21
+ if (isset($contact->Errors['Confirm-Email'])) echo ' error'; ?>">
22
+ <label class="control-label" for="cfconfirm-email">Confirm Email Address:</label>
23
+ <div class="controls">
24
+ <input class="input-xlarge {email:true, required:true, equalTo:cfemail, messages:{equalTo:'Please repeat the email address above.', required:'Please give your email address.',email:'Please enter a valid email address.'}}" type="text" id="cfconfirm-email" name="cfconfirm-email" value="<?php echo $contact->ConfirmEmail; ?>" placeholder="Confirm Your Email Address">
25
+ <span class="help-inline"><?php if (isset($contact->Errors['Confirm-Email'])) echo $contact->Errors['Confirm-Email']; ?></span>
26
+ </div>
27
+ </div>
28
+
29
+ <!-- name -->
30
+ <div class="control-group<?php
31
+ if (isset($contact->Errors['Name'])) echo ' error'; ?>">
32
+ <label class="control-label" for="cf-Name">Name:</label>
33
+ <div class="controls">
34
+ <input class="input-xlarge {required:true, messages:{required:'Please give your name.'}}" type="text" id="cf-Name" name="cf-Name" value="<?php echo $contact->Name; ?>" placeholder="Your Name">
35
+ <span class="help-inline"><?php if (isset($contact->Errors['Name'])) echo $contact->Errors['Name']; ?></span>
36
+ </div>
37
+ </div>
38
+
39
+ <!-- message -->
40
+ <div class="control-group<?php
41
+ if (isset($contact->Errors['Message'])) echo ' error'; ?>">
42
+ <label class="control-label" for="cf-Message">Message:</label>
43
+ <div class="controls">
44
+ <textarea class="input-xlarge {required:true, messages:{required:'Please give a message.'}}" id="cf-Message" name="cf-Message" rows="10" placeholder="Your Message"><?php echo $contact->Message; ?></textarea>
45
+ <span class="help-inline"><?php if (isset($contact->Errors['Message'])) echo $contact->Errors['Message']; ?></span>
46
+ </div>
47
+ </div>
48
+
49
+ <div class="control-group">
50
+ <div class="controls">
51
+ <button type="submit" class="btn">Send Message</button>
52
+ </div>
53
+ </div>
54
+ </form>
views/message-not-sent.view.php ADDED
@@ -0,0 +1 @@
 
1
+ <p>Sorry, there has been a problem and your message was not sent.</p>
views/message-sent.view.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <h3><?php echo $heading; ?></h3>
2
+ <p><?php echo $message; ?> </p>