Commit 69e7b060 authored by Matthias Hutterer's avatar Matthias Hutterer
Browse files

#133575 added settings form to change value of email_hourly_threshold

parent f0c9a2e4
......@@ -243,13 +243,20 @@ function theme_email_textfield($element) {
*/
function email_menu() {
$items['email/%/%'] = array(
'title' => t('Email Contact Form'),
'title' => 'Email Contact Form',
'page callback' => 'email_mail_page',
'page arguments' => array(1, 2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
$items['admin/settings/email'] = array(
'title' => 'CCK Email Contact Form Settings',
'description' => 'Administer flood control settings for email contact forms',
'page callback' => 'drupal_get_form',
'page arguments' => array('email_admin_settings'),
'access arguments' => array('administer site configuration'),
);
return $items;
}
......@@ -444,3 +451,16 @@ function email_token_values($type, $object = NULL, $options = array()) {
return $tokens;
}
}
/**
* Settings for contact form
*/
function email_admin_settings() {
$form['email_hourly_threshold'] = array('#type' => 'select',
'#title' => t('Hourly threshold for a CCK Email contact form'),
'#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50)),
'#default_value' => variable_get('email_hourly_threshold', 3),
'#description' => t('The maximum number of contact form submissions a user can perform per hour.'),
);
return system_settings_form($form);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment