contact_admin_settings

Versions
4.7 – 6
contact_admin_settings()

Settings tab. Using a form rather than hook_settings().

Code

modules/contact.module, line 273

<?php
function contact_admin_settings() {
  $form['contact_form_information'] = array('#type' => 'textarea',
    '#title' => t('Additional information'),
    '#default_value' => variable_get('contact_form_information', t('You can leave a message using the contact form below.')),
    '#description' => t('Information to show on the <a href="%form">contact page</a>. Can be anything from submission guidelines to your postal address or telephone number.', array('%form' => url('contact'))),
  );
  $form['contact_hourly_threshold'] = array('#type' => 'select',
    '#title' => t('Hourly threshold'),
    '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50)),
    '#default_value' => variable_get('contact_hourly_threshold', 3),
    '#description' => t('The maximum number of contact form submissions a user can perform per hour.'),
  );
  $form['submit'] = array('#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  $form['reset'] = array('#type' => 'submit',
    '#value' => t('Reset to defaults'),
  );
  // Use system_settings_form for the callback.
  return drupal_get_form('contact_admin_settings', $form, 'system_settings_form');
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.