updated date pathauto addressfield honeypot features modules

This commit is contained in:
Bachir Soussi Chiadmi
2015-10-12 12:03:12 +02:00
parent 0ba0c21bb9
commit eb699f528d
109 changed files with 5363 additions and 2372 deletions

View File

@@ -32,7 +32,7 @@ function honeypot_admin_form($form, &$form_state) {
$form['configuration']['honeypot_element_name'] = array(
'#type' => 'textfield',
'#title' => t('Honeypot element name'),
'#description' => t("The name of the Honeypot form field. It's usually most effective to use a generic name like email, homepage, or name, but this should be changed if it interferes with fields that are already in your forms. Must not contain spaces or special characters."),
'#description' => t("The name of the Honeypot form field. It's usually most effective to use a generic name like email, homepage, or link, but this should be changed if it interferes with fields that are already in your forms. Must not contain spaces or special characters."),
'#default_value' => variable_get('honeypot_element_name', 'url'),
'#required' => TRUE,
'#size' => 30,
@@ -170,11 +170,25 @@ function honeypot_admin_form_validate($form, &$form_state) {
if (!preg_match("/^[-_a-zA-Z0-9]+$/", $form_state['values']['honeypot_element_name'])) {
form_set_error('honeypot_element_name', t("The element name cannot contain spaces or other special characters."));
}
// Make sure Honeypot element name isn't one of the reserved names.
$reserved_element_names = array(
'name',
'pass',
'website',
);
if (in_array($form_state['values']['honeypot_element_name'], $reserved_element_names)) {
form_set_error('honeypot_element_name', t("The element name cannot match one of the common Drupal form field names (e.g. @names).", array('@names' => implode(', ', $reserved_element_names))));
}
}
/**
* Clear the honeypot form cache on submit.
* Honeypot admin form submit callback.
*/
function honeypot_admin_form_submit($form, &$form_state) {
// Create CSS file for honeypot.
honeypot_create_css($form_state['values']['honeypot_element_name']);
// Clear the Honeypot form cache on submit.
cache_clear_all('honeypot_protected_forms', 'cache');
}