You are here

function signup_alter_node_type_form in Signup 5.2

Same name and namespace in other branches
  1. 5 signup.module \signup_alter_node_type_form()

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

1 call to signup_alter_node_type_form()
signup_form_alter in ./signup.module
Implementation of hook_form_alter().

File

./signup.module, line 424
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_alter_node_type_form($form_id, &$form) {
  $type = $form['old_type']['#value'];
  $form['signup'] = array(
    '#type' => 'fieldset',
    '#title' => t('Signup settings'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $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 (function_exists('_signup_date_alter_node_type_form')) {
    _signup_date_alter_node_type_form($form_id, $form);
  }
}