forked from acquia/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlightning.profile
More file actions
55 lines (47 loc) · 1.41 KB
/
lightning.profile
File metadata and controls
55 lines (47 loc) · 1.41 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
<?php
/**
* @file
* Enables modules and site configuration for Lightning site installation.
*/
/**
* Implements hook_form_FORM_ID_alter() for install_configure_form().
*/
function lightning_form_install_configure_form_alter(&$form, $form_state) {
// Remove any non-error messages set by enabled modules.
$messages = array('completed', 'status', 'warning');
foreach ($messages as $message) {
drupal_get_messages($message, TRUE);
}
// Add 'Lightning' fieldset and options.
$form['lightning'] = array(
'#type' => 'fieldset',
'#title' => st('Lightning'),
'#weight' => -5,
'#collapsible' => FALSE,
'#tree' => FALSE,
);
// Checkbox to enable Lightning options.
$form['lightning']['extensions'] = array(
'#type' => 'checkboxes',
'#title' => st('Enable Extensions'),
'#description' => st('Optionally install extra features'),
'#options' => array(
'lightning_demo' => st('Demo Content'),
'lightning_devel' => st('Developer Tools'),
),
'#weight' => 0,
);
// Additional submit handlers for Lightning settings.
$form['#submit'][] = 'lightning_extensions_enable';
}
/**
* Enable requested Lightning extensions.
*/
function lightning_extensions_enable($form_id, &$form_state) {
$values = $form_state['values'];
if (isset($values['extensions'])) {
foreach ($values['extensions'] as $module) {
module_enable(array($module), TRUE);
}
}
}