-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathding_availability.admin.inc
More file actions
50 lines (43 loc) · 1.75 KB
/
ding_availability.admin.inc
File metadata and controls
50 lines (43 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* @file
* The administration interface to select the data well types that should have
* holdings information.
*/
/**
* Administration for to select which data well types that should have holdings
* information displayed.
*/
function ding_availability_admin_holdings_settings($form_state) {
$form = array();
// Add button to update the types from the data well. Which requires us to
// load the administration file for the ting module to get the information.
form_load_include($form_state, 'inc', 'ting', 'ting.admin');
$form['update'] = array(
'#type' => 'fieldset',
'#title' => t('Update from datawell'),
'#description' => t('Update the lists of known types and sources by asking the datawell for all types and sorces.'),
);
$form['update']['update'] = array(
'#type' => 'submit',
'#value' => t('Update'),
'#submit' => array('ting_admin_reservable_settings_update'),
);
// Get available types.
$types = variable_get('ting_well_types', array());
$form['ding_availability_holdings'] = array(
'#type' => 'fieldset',
'#title' => t('Holdings information'),
'#tree' => FALSE,
'#description' => t("Which ting object types should display provider holdings information in the holding field e.g. on the ting object view"),
);
$form['ding_availability_holdings']['ding_availability_holdings_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Types'),
'#options' => drupal_map_assoc(array_keys($types)),
'#default_value' => variable_get('ding_availability_holdings_types', _ding_availability_holdings_default_types()),
);
// Save us the trouble of running array_filter.
$form['array_filter'] = array('#type' => 'value', '#value' => TRUE);
return system_settings_form($form);
}