-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbunchball.admin.inc
67 lines (58 loc) · 2.86 KB
/
bunchball.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
<?php
/**
* @file
* Main admin form for bunchball module.
*/
/**
* Form callback for admin form.
*/
function bunchball_admin_form($form, &$form_state) {
ctools_include('dependent');
$links = array(
'!content_actions' => l('content actions', 'admin/config/people/bunchball/entities'),
'!user_actions' => l('user actions', 'admin/config/people/bunchball/user-interaction'),
);
$form['description'] = array(
'#markup' => t('Connection to Bunchball Nitro requires a subscription. Once subscribed, use the values on the Nitro Admin console to complete the fields below to connect the service. Then configure the !content_actions and !user_actions to track.', $links),
);
$form['bunchball_apikey'] = array(
'#type' => 'textfield',
'#default_value' => isset($form_state['values']['bunchball_apikey']) ? $form_state['values']['bunchball_apikey'] : variable_get('bunchball_apikey', ''),
'#title' => t('API Key'),
'#required' => TRUE,
);
$form['bunchball_apisecret'] = array(
'#type' => 'textfield',
'#default_value' => isset($form_state['values']['bunchball_apisecret']) ? $form_state['values']['bunchball_apisecret'] : variable_get('bunchball_apisecret', ''),
'#title' => t('API Secret'),
'#required' => TRUE,
);
$form['bunchball_environment'] = array(
'#type' => 'select',
'#description' => t('Point to Sandbox for testing and Production for your live environment.'),
'#options' => array(
0 => ' ',
'production' => t('Production'),
'sandbox' => t('Sandbox')
),
'#required' => TRUE,
'#default_value' => isset($form_state['values']['bunchball_environment']) ? $form_state['values']['bunchball_environment'] : variable_get('bunchball_environment', ''),
);
$form['bunchball_production_url'] = array(
'#title' => t('Production server url'),
'#type' => 'textfield',
'#default_value' => isset($form_state['values']['bunchball_production_url']) ? $form_state['values']['bunchball_production_url'] : variable_get('bunchball_production_url', ''),
'#process' => array('ctools_dependent_process'),
'#dependency' => array('edit-bunchball-environment' => array('production')),
'#description' => t('The Buncball production URL. Most likely http://<domain>.bunchball.net/nitro/xml'),
);
$form['bunchball_sandbox_url'] = array(
'#title' => t('Sandbox server url'),
'#type' => 'textfield',
'#default_value' => isset($form_state['values']['bunchball_sandbox_url']) ? $form_state['values']['bunchball_sandbox_url'] : variable_get('bunchball_sandbox_url', 'http://sandbox.bunchball.net/nitro/xml'),
'#process' => array('ctools_dependent_process'),
'#dependency' => array('edit-bunchball-environment' => array('sandbox')),
'#description' => t('The Bunchball sandbox URL. Most likely http://sandbox.bunchball.net/nitro/xml'),
);
return system_settings_form($form);
}