You are here

function signup_form_content_field_edit_form_alter in Signup 6

Same name and namespace in other branches
  1. 6.2 includes/date.inc \signup_form_content_field_edit_form_alter()
  2. 7 includes/date.inc \signup_form_content_field_edit_form_alter()

Alter the form for configuring CCK date fields on node types.

Hooks into CCK Date fields to provide an option to use the current field as the Signup date field (for autoclose and reminder emails).

File

includes/date.inc, line 102
Code to support using CCK date fields for time-based signup functionality.

Code

function signup_form_content_field_edit_form_alter(&$form, &$form_state) {
  $type = $form['type_name']['#value'];
  if (in_array($form['#field']['type'], array(
    'date',
    'datestamp',
    'datetime',
  )) && variable_get('signup_node_default_state_' . $type, 'disabled') != 'disabled') {
    $form['signup'] = array(
      '#type' => 'fieldset',
      '#title' => t('Signup settings'),
      '#collapsible' => TRUE,
      '#weight' => 1,
    );
    $form['signup']['signup_date_field'] = _signup_date_field_element($type);
    $form['#submit'][] = '_signup_date_field_form_submit';

    // Make sure the submit button comes after the signup settings fieldset.
    $form['submit']['#weight'] = 50;
  }
}