1 book.admin.inc book_admin_settings($form, &$form_state)

Form constructor for the book settings form.

See also

book_menu()

book_admin_settings_submit()

book_admin_settings_validate()

Related topics

File

core/modules/book/book.admin.inc, line 51
Administration page callbacks for the Book module.

Code

function book_admin_settings($form, &$form_state) {
  $types = node_type_get_names();
  $config = config('book.settings');
  $form['book_allowed_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Content types allowed in book outlines'),
    '#default_value' => $config->get('book_allowed_types'),
    '#options' => $types,
    '#description' => t('Users with the %outline-perm permission can add all content types.', array('%outline-perm' => t('Administer book outlines'))),
    '#required' => TRUE,
  );
  $form['book_child_type'] = array(
    '#type' => 'radios',
    '#title' => t('Content type for child pages'),
    '#default_value' => $config->get('book_child_type'),
    '#options' => $types,
    '#required' => TRUE,
  );
  $form['array_filter'] = array('#type' => 'value', '#value' => TRUE);
  $form['#validate'][] = 'book_admin_settings_validate';

  $form['actions']['#type'] = 'actions';
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration')
  );
  return $form;
}