You are here

function addanother_admin in Add Another 7

Same name and namespace in other branches
  1. 5 addanother.module \addanother_admin()
  2. 6 addanother.module \addanother_admin()
  3. 7.2 addanother.module \addanother_admin()

This function sets up the admin/settings/addanother settings page.

1 string reference to 'addanother_admin'
addanother_menu in ./addanother.module
Implement hook_menu().

File

./addanother.module, line 102
Presents users with an option to create another node of the same type after a node is added.

Code

function addanother_admin($form, &$form_state) {
  $form['addanother_nodes'] = array(
    '#type' => 'fieldset',
    '#title' => t('Content settings'),
  );
  $form['addanother_nodes']['addanother_nodetypes'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Enable Add another for these content types'),
    '#options' => node_type_get_names(),
    '#default_value' => variable_get('addanother_nodetypes', array()),
    '#description' => t('An <em>Add another</em> message will be shown after creating these content types'),
  );
  $form['addanother_display'] = array(
    '#type' => 'fieldset',
    '#title' => t('Display settings'),
  );
  $form['addanother_display']['addanother_message'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display the Add another message after node creation.'),
    '#default_value' => variable_get('addanother_message', TRUE),
  );
  $form['addanother_display']['addanother_tab'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display the Add another tab on supported node types.'),
    '#default_value' => variable_get('addanother_tab', FALSE),
  );
  $form['addanother_display']['addanother_tab_edit'] = array(
    '#type' => 'checkbox',
    '#title' => t('Also display the Add another tab on supported node edit pages.'),
    '#default_value' => variable_get('addanother_tab_edit', FALSE),
  );
  return system_settings_form($form);
}