-
Notifications
You must be signed in to change notification settings - Fork 13
/
open_data_schema_map.admin.inc
49 lines (47 loc) · 1.76 KB
/
open_data_schema_map.admin.inc
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
<?php
/**
* @file
* ODSM Admin form functions.
*/
/**
* ODSM Admin Settings Form.
*
* @param array $form_state
* Form state array
*
* @return array
* Form array
*/
function open_data_schema_map_admin_settings_form($form_state) {
$available_filters = _open_data_schema_map_get_available_filters('name');
$form['data_json'] = array(
'#type' => 'fieldset',
'#title' => t('Data Federation Filters'),
'#description' => t('Use this form to exclude specific groups from federated data. Currently, these filters are available to schemas:') . ' ' . implode(', ', $available_filters),
);
$group_options = array();
$result = db_query("SELECT node.title AS node_title, node.nid AS nid
FROM {node} node
WHERE ((node.status = '1') AND (node.type IN ('group')) )
ORDER BY node_title ASC"
);
if ($result) {
foreach ($result as $record) {
$group_options[$record->nid] = $record->node_title;
}
}
$form['data_json']['odsm_settings_groups'] = array(
'#type' => 'checkboxes',
'#title' => t('Groups to include'),
'#default_value' => variable_get('odsm_settings_groups', array()),
'#options' => $group_options,
'#description' => t('If none of the groups are selected, all groups will be included in the data.json. If any of the groups are checked, only datasets belonging to those groups will be included.'),
);
$form['data_json']['odsm_settings_no_publishers'] = array(
'#type' => 'checkbox',
'#title' => t('Include datasets with no listed publisher in the data.json.'),
'#description' => t('If this option is selected, datasets with no listed publisher will be given the default publisher name.'),
'#default_value' => variable_get('odsm_settings_no_publishers', 1),
);
return system_settings_form($form);
}