This repository has been archived by the owner on Feb 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdul_bento.admin.inc
executable file
·117 lines (94 loc) · 4.14 KB
/
dul_bento.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
function dul_bento_admin_settings() {
$form['results_title'] = array(
'#type' => 'textfield',
'#title' => t('Bento Page Title'),
'#description' => t('Enter the desired title for bento search results'),
'#default_value' => variable_get('dul_bento.results_title', ''),
);
$form['results_url'] = array(
'#type' => 'textfield',
'#title' => t('Bento URL'),
'#description' => t('Enter the desired URL for bento search results (no initial or trailing slashes)'),
'#default_value' => variable_get('dul_bento.results_url', ''),
);
$form['summon_accessId'] = array(
'#type' => 'textfield',
'#title' => t('Summon Access ID'),
'#description' => t('Enter the Summon Access ID'),
'#default_value' => variable_get('dul_bento.summon_accessId', ''),
);
$form['summon_secretKey'] = array(
'#type' => 'textfield',
'#title' => t('Summon Secret Key'),
'#description' => t('Enter the Summon Secret Key'),
'#default_value' => variable_get('dul_bento.summon_secretKey', ''),
);
$form['summon_clientKey'] = array(
'#type' => 'textfield',
'#title' => t('Summon Client Key'),
'#description' => t('Enter the Summon Client Key'),
'#default_value' => variable_get('dul_bento.summon_clientKey', ''),
);
$form['libkey_token'] = array(
'#type' => 'textfield',
'#title' => t('LibKey API Token'),
'#description' => t('Enter the LibKey API Token'),
'#default_value' => variable_get('dul_bento.libkey_token', ''),
);
$form['libkey_ID'] = array(
'#type' => 'textfield',
'#title' => t('LibKey ID'),
'#description' => t('Enter the LibKey ID'),
'#default_value' => variable_get('dul_bento.libkey_ID', ''),
);
$form['bento_results_index'] = array(
'#type' => 'checkbox',
'#title' => t('Index the results page'),
'#description' => t('defaults to "no" (for purposes of search engine indexing)'),
'#default_value' => variable_get('dul_bento.bento_results_index', ''),
);
$form['bento_logging'] = array(
'#type' => 'checkbox',
'#title' => t('Activate Bento Logging'),
'#description' => t('Dumps log file to ../backup'),
'#default_value' => variable_get('dul_bento.bento_logging', ''),
);
$form['bento_logging_daily'] = array(
'#type' => 'checkbox',
'#title' => t('Use Daily Log Files'),
'#description' => t('If selected, a new file will also be generate every 24 hours - only check if using logging.'),
'#default_value' => variable_get('dul_bento.bento_logging_daily', ''),
);
$form['summon_other_content_types'] = array(
'#type' => 'textarea',
'#title' => t('Summon "Other" Content Types'),
'#description' => t('Enter the list of content types'),
'#default_value' => variable_get('dul_bento.summon_other_content_types', ''),
);
$form['summon_other_libraries'] = array(
'#type' => 'textarea',
'#title' => t('Summon "Other" Libraries'),
'#description' => t('Enter the list of libraries'),
'#default_value' => variable_get('dul_bento.summon_other_libraries', ''),
);
$form['#submit'][] = 'dul_bento_admin_settings_submit';
return system_settings_form($form);
}
/**
* Submit callback for the above form function^
*/
function dul_bento_admin_settings_submit($form, $form_state) {
variable_set('dul_bento.results_title', $form_state['values']['results_title']);
variable_set('dul_bento.results_url', $form_state['values']['results_url']);
variable_set('dul_bento.summon_accessId', $form_state['values']['summon_accessId']);
variable_set('dul_bento.summon_secretKey', $form_state['values']['summon_secretKey']);
variable_set('dul_bento.summon_clientKey', $form_state['values']['summon_clientKey']);
variable_set('dul_bento.libkey_token', $form_state['values']['libkey_token']);
variable_set('dul_bento.libkey_ID', $form_state['values']['libkey_ID']);
variable_set('dul_bento.bento_results_index', $form_state['values']['bento_results_index']);
variable_set('dul_bento.bento_logging', $form_state['values']['bento_logging']);
variable_set('dul_bento.bento_logging_daily', $form_state['values']['bento_logging_daily']);
variable_set('dul_bento.summon_other_content_types', $form_state['values']['summon_other_content_types']);
variable_set('dul_bento.summon_other_libraries', $form_state['values']['summon_other_libraries']);
}