function library_admin_settings in Library 6
Same name and namespace in other branches
- 5.2 library.admin.inc \library_admin_settings()
- 6.2 library.admin.inc \library_admin_settings()
- 7 library.admin.inc \library_admin_settings()
Menu callback: Edit Library Settings.
1 string reference to 'library_admin_settings'
- library_menu in ./
library.module - Implementation of hook_menu().
File
- ./
library.admin.inc, line 11 - Administrative settings for the library module
Code
function library_admin_settings() {
$form = array();
$form['library_item_barcodes'] = array(
'#type' => 'checkbox',
'#title' => t('Use Barcodes/Unique Identifiers for Library Items'),
'#default_value' => variable_get('library_item_barcodes', 0),
'#return_value' => 1,
'#description' => t('This is recommended if you have multiple copies of an item. However, you must have unique identifiers for every instance. If you have multiple copies but do not use barcodes, library management will be against whether any copy is available and will not track any specific copy.'),
);
$form['library_unique_titles'] = array(
'#type' => 'checkbox',
'#title' => t('Check that Library Item Titles are Unique (Within a Given Content Type)'),
'#default_value' => variable_get('library_unique_titles', 0),
'#return_value' => 1,
'#description' => t('To display a warning if a title is a duplicate, check this box. This is highly recommended if you are not using barcodes.'),
);
$form['library_search_block'] = array(
'#type' => 'checkbox',
'#title' => t('Modify default search block to search library content.'),
'#default_value' => variable_get('library_search_block', 0),
'#return_value' => 1,
);
$form['library_status_display'] = array(
'#type' => 'checkbox',
'#title' => t('Library Status'),
'#default_value' => variable_get('library_status_display', 0),
'#return_value' => 1,
'#description' => t('To display library status on individual library nodes, check this box.'),
);
$form['library_action_display'] = array(
'#type' => 'fieldset',
'#title' => t('Action Links to Display'),
'#description' => t("Select which actions can be taken given a library item's status. If no actions are selected for a given status, no action links will be displayed on items with that status."),
);
$when_available = array();
$when_unavailable = array();
$when_reference = array();
foreach (library_actions() as $aid => $action) {
switch ($action['status_change']) {
case LIBRARY_ACTION_NO_CHANGE:
$when_available[$aid] = $action['name'];
$when_unavailable[$aid] = $action['name'];
$when_reference[$aid] = $action['name'];
break;
case LIBRARY_ACTION_TYPE_UNAVAILABLE:
$when_available[$aid] = $action['name'];
break;
case LIBRARY_ACTION_TYPE_AVAILABLE:
$when_unavailable[$aid] = $action['name'];
break;
}
}
$form['library_action_display']['library_links_display_available'] = array(
'#type' => 'checkboxes',
'#title' => t('On Available Items'),
'#default_value' => variable_get('library_links_display_available', array()),
'#options' => $when_available,
);
$form['library_action_display']['library_links_display_unavailable'] = array(
'#type' => 'checkboxes',
'#title' => t('On Unavailable Items'),
'#default_value' => variable_get('library_links_display_unavailable', array()),
'#options' => $when_unavailable,
);
$form['library_action_display']['library_links_display_reference'] = array(
'#type' => 'checkboxes',
'#title' => t('On Reference Only Items'),
'#default_value' => variable_get('library_links_display_reference', array()),
'#options' => $when_reference,
);
$form['library_item_list_display'] = array(
'#type' => 'fieldset',
'#title' => t('Library Search Results Display'),
'#description' => t('The columns chosen below will be added to the node fields that you have selected to display.'),
);
$form['library_item_list_display']['library_quantity_display'] = array(
'#type' => 'checkbox',
'#title' => t('Quantity'),
'#default_value' => variable_get('library_quantity_display', 0),
);
$form['library_item_list_display']['library_list_status_display'] = array(
'#type' => 'checkbox',
'#title' => t('Status'),
'#default_value' => variable_get('library_list_status_display', 0),
);
if (module_exists('taxonomy')) {
$vocabularies = array();
foreach (taxonomy_get_vocabularies() as $vid => $vocab) {
$vocabularies[$vid] = $vocab->name;
}
$form['library_item_list_display']['library_taxonomy_display'] = array(
'#type' => 'checkboxes',
'#title' => t('Display Associated Taxonomy Terms in Library View'),
'#default_value' => variable_get('library_taxonomy_display', array()),
'#options' => $vocabularies,
'#description' => t('Select the vocabularies from which you would like to display taxonomy terms. If no vocabularies are selected, terms will not be displayed.'),
);
}
$form['library_text_display'] = array(
'#type' => 'fieldset',
'#title' => t('Library Text'),
'#description' => t('Customize the text display.'),
);
$form['library_text_display']['library_available_text'] = array(
'#type' => 'textfield',
'#title' => t('Available Status Text'),
'#default_value' => variable_get('library_available_text', 'AVAILABLE'),
'#size' => 20,
'#maxlength' => 20,
'#description' => t("Examples: in, checked in"),
);
$form['library_text_display']['library_unavailable_noduedates_text'] = array(
'#type' => 'textfield',
'#title' => t('Unavailable Status Text (Without Due Dates)'),
'#default_value' => variable_get('library_unavailable_noduedates_text', 'UNAVAILABLE'),
'#size' => 20,
'#maxlength' => 20,
'#description' => t("Examples: out, checked out"),
);
$form['library_text_display']['library_reference_only_text'] = array(
'#type' => 'textfield',
'#title' => t('Reference Only Status Text'),
'#default_value' => variable_get('library_reference_only_text', 'REFERENCE ONLY'),
'#size' => 20,
'#maxlength' => 20,
);
return system_settings_form($form);
}