You are here

function patron_admin_settings in Library 6

Same name and namespace in other branches
  1. 5.2 patron/patron.module \patron_admin_settings()

Menu callback: Edit Patron Settings.

1 string reference to 'patron_admin_settings'
patron_menu in patron/patron.module
Implementation of hook_menu()

File

patron/patron.module, line 461

Code

function patron_admin_settings() {
  $form = array();
  $form['patron_use_barcodes'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use Library Cards (with Barcodes) for Library Patrons'),
    '#default_value' => variable_get('patron_use_barcodes', 0),
    '#return_value' => 1,
    '#description' => t('This will allow you to use library cards.  However, you must have a unique barcode for every patron.'),
  );
  $form['user_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('User Settings'),
  );
  $form['user_settings']['patron_is_user'] = array(
    '#type' => 'checkbox',
    '#title' => t('Associate Library Patrons with Drupal Users'),
    '#default_value' => variable_get('patron_is_user', 0),
    '#return_value' => 1,
    '#description' => t('You must create the user account first, and the Drupal user and library patron must have the same email address.'),
  );

  /* Only allow if patrons do NOT have library cards!! */
  if (variable_get('patron_use_barcodes', PATRON_NO_BARCODES) == PATRON_NO_BARCODES) {
    $form['user_settings']['patron_autocreate'] = array(
      '#type' => 'checkbox',
      '#title' => t('Autocreate Library Patron on User Registration and Delete on User Deletion'),
      '#default_value' => variable_get('patron_autocreate', 0),
      '#return_value' => 1,
      '#description' => t('You must associate library patrons with drupal users first.'),
    );
  }
  return system_settings_form($form);
}