You are here

function addanother_form_node_type_form_alter in Add Another 7.2

Same name and namespace in other branches
  1. 8 addanother.module \addanother_form_node_type_form_alter()

Alter content type settings to add our options.

File

./addanother.module, line 140
The main file for the addanother module.

Code

function addanother_form_node_type_form_alter(&$form, &$form_state) {
  if (isset($form['#node_type'])) {
    $form['addanother_display'] = array(
      '#type' => 'fieldset',
      '#title' => t('Add another settings'),
      '#collapsible' => TRUE,
      '#group' => 'additional_settings',
    );
    $form['addanother_display']['addanother_button'] = array(
      '#type' => 'checkbox',
      '#title' => t('Display Add another button on node add form.'),
      '#default_value' => variable_get('addanother_button_' . $form['#node_type']->type, variable_get('addanother_default_button', TRUE)),
      '#description' => t('Enable this checkbox if you want to provide a "Save and add another" button on the node add form for your users.'),
    );
    $form['addanother_display']['addanother_message'] = array(
      '#type' => 'checkbox',
      '#title' => t('Display the Add another message after node creation.'),
      '#default_value' => variable_get('addanother_message_' . $form['#node_type']->type, variable_get('addanother_default_message', TRUE)),
      '#description' => t('Enable this checkbox if you want to show a "Add another..." message after creating a new node.'),
    );
    $form['addanother_display']['addanother_tab'] = array(
      '#type' => 'checkbox',
      '#title' => t('Display the Add another tab.'),
      '#default_value' => variable_get('addanother_tab_' . $form['#node_type']->type, variable_get('addanother_default_tab', TRUE)),
      '#description' => t('Enable this checkbox if you want to show a "Add another" tab on nodes of this type.'),
    );
    $form['addanother_display']['addanother_tab_edit'] = array(
      '#type' => 'checkbox',
      '#title' => t('Also Display Add another tab on edit page.'),
      '#default_value' => variable_get('addanother_tab_edit_' . $form['#node_type']->type, variable_get('addanother_default_tab_edit', TRUE)),
      '#description' => t('Enable this checkbox if you want to also show a "Add another" tab on node edit pages of this type. This option does nothing if the Add Another tab is disabled.'),
    );
  }
}