-
Notifications
You must be signed in to change notification settings - Fork 0
/
dash.module
57 lines (47 loc) · 1.32 KB
/
dash.module
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
<?php
/**
* @file
* Dashboard functionality with Guzzle.
*/
//require_once "dash.services.inc";
module_load_include('inc', 'dash', 'dash.services');
/**
* Implements hook_menu().
*/
function dash_menu() {
$items['admin/dash'] = array(
'title' => 'Configure Dash',
'type' => MENU_NORMAL_ITEM,
'page callback' => 'drupal_get_form',
'page arguments' => array('dash_config_form'),
'access arguments' => array('administer dash configuration'),
);
$items['admin/dash/refresh'] = array(
'title' => 'Refresh Dashboard Information',
'type' => MENU_CALLBACK,
'page callback' => 'dash_refresh',
'access arguments' => array('get dashboard information'),
);
return $items;
}
/**
* Configuration form.
*/
function dash_config_form($form, &$form_state) {
$form['authentication'] = array(
'#type' => 'fieldset',
'#title' => t('Dash Authentication'),
'#description' => t('Enter your Dash credentials.'),
);
$form['authentication']['dash_username'] = array(
'#type' => 'textfield',
'#title' => t('Dash User Name'),
'#default_value' => variable_get('dash_username'),
);
$form['authentication']['dash_pass'] = array(
'#type' => 'password',
'#title' => t('Password'),
'#default_value' => variable_get('dash_pass'),
);
return system_settings_form($form);
}