You are here

function signup_form_node_type_form_alter in Signup 6

Same name and namespace in other branches
  1. 6.2 signup.module \signup_form_node_type_form_alter()
  2. 7 signup.module \signup_form_node_type_form_alter()

Alters the form for administrator settings per node type. (admin/content/types)

File

./signup.module, line 716
The Signup module (http://drupal.org/project/signup) manages replies to nodes. In particular, it's good for event management. Signup supports sending reminder emails and automatically closing signups for nodes with a start time, via the Event…

Code

function signup_form_node_type_form_alter(&$form, &$form_state) {
  $type = $form['old_type']['#value'];
  $form['signup'] = array(
    '#type' => 'fieldset',
    '#title' => t('Signup settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#group' => 'additional_settings',
  );
  $form['signup']['signup_node_default_state'] = array(
    '#type' => 'radios',
    '#title' => t('Signup options'),
    '#options' => array(
      'disabled' => t('Disabled'),
      'allowed_off' => t('Allowed (off by default)'),
      'enabled_on' => t('Enabled (on by default)'),
    ),
    '#default_value' => variable_get('signup_node_default_state_' . $type, 'disabled'),
    '#description' => t('If %disabled is selected, signups will not be possible for this content type. If %allowed_off is selected, signups will be off by default, but users with the %admin_all_signups permission will be able to allow signups for specific posts of this content type. If %enabled_on is selected, users will be allowed to signup for this content type unless an administrator disbles signups on specific posts.', array(
      '%disabled' => t('Disabled'),
      '%allowed_off' => t('Allowed (off by default)'),
      '%enabled_on' => t('Enabled (on by default)'),
      '%admin_all_signups' => t('administer all signups'),
    )),
  );
  if (!empty($type) && function_exists('_signup_date_alter_node_type_form')) {
    _signup_date_alter_node_type_form($form, $form_state);
  }
}