-
Notifications
You must be signed in to change notification settings - Fork 0
/
tn_d7_profile_nathub_panopoly.profile
77 lines (58 loc) · 2.78 KB
/
tn_d7_profile_nathub_panopoly.profile
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
68
69
70
71
72
73
74
75
76
77
<?php
/**
* @ file tn_d7_profile_nathub.profile
* Based heavily on the Panopoly install profile.
*/
/**
* Implements hook_install_tasks()
*/
function tn_d7_profile_nathub_install_tasks(&$install_state) {
$tasks = array();
// Add the Panopoly app selection to the installation process
require_once(drupal_get_path('module', 'apps') . '/apps.profile.inc');
$tasks = $tasks + apps_profile_install_tasks($install_state, array('machine name' => 'panopoly', 'default apps' => array('panopoly_demo')));
return $tasks;
}
/**
* Implements hook_install_tasks_alter()
*/
function tn_d7_profile_nathub_install_tasks_alter(&$tasks, $install_state) {
// Magically go one level deeper in solving years of dependency problems
require_once(drupal_get_path('module', 'panopoly_core') . '/panopoly_core.profile.inc');
$tasks['install_load_profile']['function'] = 'panopoly_core_install_load_profile';
}
/**
* Implements hook_form_FORM_ID_alter()
*/
function tn_d7_profile_nathub_form_install_configure_form_alter(&$form, $form_state) {
// Hide some messages from various modules that are just too chatty.
drupal_get_messages('status');
drupal_get_messages('warning');
// Set reasonable defaults for site configuration form
$form['site_information']['site_name']['#default_value'] = 'Transition Network National Hub';
$form['admin_account']['account']['name']['#default_value'] = 'Hub Admin';
$form['server_settings']['site_default_country']['#default_value'] = 'UK';
$form['server_settings']['date_default_timezone']['#default_value'] = 'Europe/London'; // West coast, best coast
// Define a default email address if we can guess a valid one
$form['site_information']['site_mail']['#default_value'] = 'website@Transition Network.org.uk';
$form['admin_account']['account']['mail']['#default_value'] = 'Transition [email protected]';
}
/**
* Implements hook_form_FORM_ID_alter()
*/
function tn_d7_profile_nathub_form_apps_profile_apps_select_form_alter(&$form, $form_state) {
// For some things there are no need
$form['apps_message']['#access'] = FALSE;
$form['apps_fieldset']['apps']['#title'] = NULL;
// Improve style of apps selection form
if (isset($form['apps_fieldset'])) {
$manifest = apps_manifest(apps_servers('panopoly'));
foreach ($manifest['apps'] as $name => $app) {
if ($name != '#theme') {
$form['apps_fieldset']['apps']['#options'][$name] = '<strong>' . $app['name'] . '</strong><p><div class="admin-options"><div class="form-item">' . theme('image', array('path' => $app['logo']['path'], 'height' => '32', 'width' => '32')) . '</div>' . $app['description'] . '</div></p>';
}
}
}
// Remove the demo content selection option since this is handled through the Panopoly demo module.
$form['default_content_fieldset']['#access'] = FALSE;
}