-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmongodb.admin.inc
More file actions
executable file
·59 lines (50 loc) · 1.16 KB
/
mongodb.admin.inc
File metadata and controls
executable file
·59 lines (50 loc) · 1.16 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
51
52
53
54
55
56
57
58
59
<?php
/**
* @file
* Mongodb module menu callback's handlers
*/
/**
* Mongodb settings form
*
* @param array $form_state
* @return array
*/
function mongodb_settings_form(&$form_state) {
$form = array();
$form['mongodb_enabled'] = array(
'#title' => 'Use mongodb',
'#type' => 'checkbox',
'#default_value' => variable_get('mongodb_enabled', FALSE),
);
// $form['export'] = array(
// '#type' => 'submit',
// '#name' => 'export',
// '#value' => t('Save and export'),
// '#weight' => 1,
// );
$form['index'] = array(
'#type' => 'submit',
'#name' => 'index',
'#value' => t('Save and ensure indexes'),
'#weight' => 1,
);
$form['#submit'][] = 'mongodb_settings_form_submit';
return system_settings_form($form);
}
/**
* Mongodb settings form submit
*
* @param <type> $form
* @param <type> $form_state
*/
function mongodb_settings_form_submit($form, &$form_state) {
if (!_MONGODB_ENABLED) {
return;
}
// if ($form_state['clicked_button']['#name'] == 'export') {
// mongodb_export();
// }
elseif ($form_state['clicked_button']['#name'] == 'index') {
mongodb_ensure_index();
}
}