View source
<?php
function panopoly_install_tasks(&$install_state) {
$tasks = array();
drupal_add_css(drupal_get_path('profile', 'panopoly') . '/panopoly.css');
$panopoly_server = array(
'machine name' => 'panopoly',
'default apps' => array(
'panopoly_demo',
),
'default content callback' => 'panopoly_default_content',
);
require_once drupal_get_path('module', 'apps') . '/apps.profile.inc';
$tasks = $tasks + apps_profile_install_tasks($install_state, $panopoly_server);
require_once drupal_get_path('module', 'panopoly_theme') . '/panopoly_theme.profile.inc';
$tasks = $tasks + panopoly_theme_profile_theme_selection_install_task($install_state);
return $tasks;
}
function panopoly_install_tasks_alter(&$tasks, $install_state) {
require_once drupal_get_path('module', 'panopoly_core') . '/panopoly_core.profile.inc';
$tasks['install_load_profile']['function'] = 'panopoly_core_install_load_profile';
require_once drupal_get_path('module', 'panopoly_core') . '/panopoly_core.profile.inc';
if (!(count(install_find_locales($install_state['parameters']['profile'])) > 1)) {
$tasks['install_select_locale']['function'] = 'panopoly_core_install_locale_selection';
}
}
function panopoly_form_install_configure_form_alter(&$form, $form_state) {
drupal_get_messages('status');
drupal_get_messages('warning');
$form['site_information']['site_name']['#default_value'] = 'Panopoly';
$form['admin_account']['account']['name']['#default_value'] = 'admin';
$form['server_settings']['site_default_country']['#default_value'] = 'US';
$form['server_settings']['date_default_timezone']['#default_value'] = 'America/Los_Angeles';
if (valid_email_address('admin@' . $_SERVER['HTTP_HOST'])) {
$form['site_information']['site_mail']['#default_value'] = 'admin@' . $_SERVER['HTTP_HOST'];
$form['admin_account']['account']['mail']['#default_value'] = 'admin@' . $_SERVER['HTTP_HOST'];
}
}
function panopoly_form_apps_profile_apps_select_form_alter(&$form, $form_state) {
$form['apps_message']['#access'] = FALSE;
$form['apps_fieldset']['apps']['#title'] = NULL;
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>';
}
}
}
}
function panopoly_default_content(&$modules) {
$files = system_rebuild_module_data();
foreach ($modules as $module) {
if (isset($files[$module . '_demo'])) {
$modules[] = $module . '_demo';
}
}
}