You are here

function node_registration_type_settings in Node registration 7

Form for registration type settings.

1 string reference to 'node_registration_type_settings'
node_registration_menu in ./node_registration.module
Implements hook_menu().

File

includes/node_registration.forms.inc, line 647
New registration forms. Public and admin.

Code

function node_registration_type_settings($form, &$form_state, $registration_type) {
  $form['#registration_type'] = $registration_type;
  $type = $registration_type->type;

  // This might be a 'private fields' bundle and that can't have settings.
  if (preg_match('/^node_(\\d+)$/', $type, $match)) {
    $node = node_load($match[1]);
    $goto = 'admin/structure/node_registration' . ($node ? '/manage/' . $node->type : '');
    return drupal_goto($goto);
  }
  $settings = _node_registration_node_type_settings($type);
  $form['events'] = array(
    '#type' => 'fieldset',
    '#title' => t('Events'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['events']['toggle_enabled_in_node_form'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show registration status checkbox in node form'),
    '#default_value' => $settings->toggle_enabled_in_node_form,
    '#description' => t('Will add a vertical tab with enabled checkbox to the node form.'),
  );
  $form['events']['no_register_page'] = array(
    '#type' => 'checkbox',
    '#title' => t('Disable register page'),
    '#default_value' => $settings->no_register_page,
    '#description' => t('Will hide the register tab on the node page and deny access to the register page for all people without Administer registration permission.'),
  );
  $form += _node_registration_type_settings_form($type, $settings);
  $form['register_cancel']['help'] = array(
    '#markup' => '<p>' . t('To disable registration on this <strong>content type</strong>, or to change the <strong>date field</strong>, go to the !settings_link.', array(
      '!settings_link' => l(t('content type settings page'), 'admin/structure/types/manage/' . $type, array(
        'fragment' => 'edit-registration',
      )),
    )) . '</p>',
    '#weight' => -10,
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  $form['#submit'][] = 'node_registration_type_settings_submit';
  $form['#submit'][] = 'node_registration_submit_locale_kick';
  return $form;
}