This repository was archived by the owner on May 31, 2021. It is now read-only.
forked from amstaker/Meredith-Spot-IM-Drupal-7
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathspot_im.admin.inc
More file actions
60 lines (53 loc) · 1.69 KB
/
spot_im.admin.inc
File metadata and controls
60 lines (53 loc) · 1.69 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
60
<?php
/**
* @file
* Contains the administrative functions of the Spot.IM integration module.
*
* This file is included by the core Spot.IM integration module, and includes
* the settings form.
*/
/**
* Callback used to create the admin form for configuring Spot.IM.
*
* @ingroup forms
*/
function spot_im_admin_settings_form() {
$form = array();
$form['spot_im_enabled'] = array(
'#type' => 'radios',
'#title' => t('Spot.IM Integration Enabled?'),
'#options' => array(
1 => t('Yes'),
0 => t('No'),
),
'#default_value' => variable_get('spot_im_enabled', 0),
);
$form['spot_im_enabled_home_page'] = array(
'#type' => 'radios',
'#title' => t('Spot.IM Enabled on Homepage?'),
'#options' => array(
1 => t('Yes'),
0 => t('No'),
),
'#default_value' => variable_get('spot_im_enabled_home_page', 0),
);
$form['spot_im_id'] = array(
'#type' => 'textfield',
'#title' => t('Company Specific Spot.IM ID'),
'#default_value' => variable_get('spot_im_id', 'sp_xxxxxxxx'),
'#description' => t('This is provided from the vendor Example: "sp_xxxxxxxx".'),
);
// Originally documented @ http://www.sitepoint.com/building-drupal-7-module-show-latest-nodes/.
$types = node_type_get_types();
foreach ($types as $node_type) {
$nodetypes[$node_type->type] = $node_type->name;
}
$form['spot_im_shownodes_nodes_toshow'] = array(
'#type' => 'checkboxes',
'#title' => t('Select the nodes to show'),
'#options' => $nodetypes,
'#default_value' => variable_get('spot_im_shownodes_nodes_toshow', array('')),
'#description' => t('All the node types selected will be shown.'),
);
return system_settings_form($form);
}