You are here

function system_form_install_configure_form_alter in Drupal Commons 6

Same name and namespace in other branches
  1. 6.2 drupal_commons.profile \system_form_install_configure_form_alter()

Alter the install profile configuration

File

./drupal_commons.profile, line 575

Code

function system_form_install_configure_form_alter(&$form, $form_state) {

  // Add option to turn on forced login
  $form['site_information']['commons_force_login'] = array(
    '#type' => 'checkbox',
    '#title' => t('Force users to login'),
    '#description' => t('If checked, users will be required to log into the site to access it. Users who are not logged in will be redirected to a login page. Select this setting if your Commons site must be closed to the public, such as a company intranet.'),
  );

  // Add timezone options required by date (Taken from Open Atrium)
  if (function_exists('date_timezone_names') && function_exists('date_timezone_update_site')) {
    $form['server_settings']['date_default_timezone']['#access'] = FALSE;
    $form['server_settings']['#element_validate'] = array(
      'date_timezone_update_site',
    );
    $form['server_settings']['date_default_timezone_name'] = array(
      '#type' => 'select',
      '#title' => t('Default time zone'),
      '#default_value' => NULL,
      '#options' => date_timezone_names(FALSE, TRUE),
      '#description' => st('Select the default site time zone. If in doubt, choose the timezone that is closest to your location which has the same rules for daylight saving time.'),
      '#required' => TRUE,
    );
  }

  // Add an additional submit handler to process the form
  $form['#submit'][] = 'drupal_commons_install_configure_form_submit';
}