function addanother_form_node_type_form_alter

cis7 addanother.module addanother_form_node_type_form_alter(&$form, &$form_state)
cle7 addanother.module addanother_form_node_type_form_alter(&$form, &$form_state)
elmsmedia7 addanother.module addanother_form_node_type_form_alter(&$form, &$form_state)
icor7 addanother.module addanother_form_node_type_form_alter(&$form, &$form_state)
meedjum_blog7 addanother.module addanother_form_node_type_form_alter(&$form, &$form_state)
mooc7 addanother.module addanother_form_node_type_form_alter(&$form, &$form_state)

Alter content type settings to add our options.

File

sites/all/modules/ulmus/addanother/addanother.module, line 91
Presents users with an option to create another node of the same type after a node is added.

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, FALSE),
      '#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, FALSE),
      '#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, FALSE),
      '#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, FALSE),
      '#description' => t('Enable this checkbox if you want to also show a "Add another" tab on node edit pages of this type. Tis option does nothing if the Add Another tab is disabled.'),
    );
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.