You are here

function onlyone_admin_settings in Allow a content type only once (Only One) 7

Form constructor for Only One Settings form.

Parameters

array $form: The form element.

array $form_state: The form state.

1 string reference to 'onlyone_admin_settings'
onlyone_menu in ./onlyone.module
Implements hook_menu().

File

./onlyone.admin.inc, line 119
Calls results to administration's pages for the Only One module.

Code

function onlyone_admin_settings(array $form, array &$form_state) {
  $form['onlyone_new_menu_entry'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show configured content types in a new menu entry'),
    '#description' => t("If you check this item a new menu entry named 'Add content (Only One)' will be created in Administration » Content, and all the configured content types to have Only One content will be moved there."),
    '#default_value' => variable_get('onlyone_new_menu_entry'),
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );

  // Set a submit handler manually because the default submit handler
  // gets overridden by the system_settings_form() submit handler.
  $form['#submit'][] = 'onlyone_admin_settings_submit';
  return $form;
}