Skip to content
Snippets Groups Projects
Commit f104fd73 authored by Tim Steiner's avatar Tim Steiner
Browse files

Initial version of the unl install profile.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@137 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 223c8f88
No related branches found
No related tags found
No related merge requests found
name = UNL
description = Setup an empty UNL Drupal site.
version = VERSION
core = 7.x
dependencies[] = block
dependencies[] = color
dependencies[] = comment
dependencies[] = contextual
dependencies[] = dashboard
dependencies[] = help
dependencies[] = image
dependencies[] = menu
dependencies[] = path
dependencies[] = taxonomy
dependencies[] = dblog
dependencies[] = search
dependencies[] = shortcut
dependencies[] = toolbar
dependencies[] = overlay
dependencies[] = field_ui
dependencies[] = file
dependencies[] = rdf
dependencies[] = wysiwyg
dependencies[] = imce
dependencies[] = imce_wysiwyg
dependencies[] = unl
dependencies[] = unl_blocks
files[] = unl.profile
; Information added by drupal.org packaging script on 2010-05-23
version = "7.0-alpha5"
project = "drupal"
datestamp = "1274628610"
<?php
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*/
function unl_profile_install()
{
// Start out by calling the standard profile's setup.
require_once dirname(__FILE__) . '/../standard/standard.install';
standard_install();
// Enable some standard blocks.
$values = array(
array(
'module' => 'system',
'delta' => 'main',
'theme' => 'unl_wdn',
'status' => 1,
'weight' => 0,
'region' => 'content',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'system',
'delta' => 'main-menu',
'theme' => 'unl_wdn',
'status' => 1,
'weight' => 0,
'region' => 'navlinks',
'pages' => '',
'cache' => -1,
),
);
$query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
foreach ($values as $record) {
$query->values($record);
}
$query->execute();
theme_enable(array('unl_wdn'));
variable_set('theme_default', 'unl_wdn');
// Update the settings file to use shared database tables (unless this is the default site)
if (conf_path() != 'sites/default') {
$shared_prefix = unl_profile_get_default_site_db_prefix();
$settings['databases'] = array(
'value' => $GLOBALS['databases'],
'required' => TRUE
);
$settings['databases']['value']['default']['default']['prefix'] = array(
'default' => $GLOBALS['databases']['default']['default']['prefix'],
'authmap' => $shared_prefix,
'filter' => $shared_prefix,
'filter_format' => $shared_prefix,
'role' => $shared_prefix,
'sessions' => $shared_prefix,
'users' => $shared_prefix,
'users_roles' => $shared_prefix,
'wysiwyg' => $shared_prefix
);
$settings['drupal_hash_salt'] = array(
'value' => 'FOOBAR' . $GLOBALS['drupal_hash_salt'],
'required' => TRUE,
);
$settings_dir = DRUPAL_ROOT . DIRECTORY_SEPARATOR . conf_path();
$settings_file = $settings_dir . '/settings.php';
$writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE);
drupal_rewrite_settings($settings);
// Only enable CAS on subsites until we get some sort of bootstrap setup.
module_enable(array('unl_cas'));
}
//$permissions = array_keys(module_invoke_all('permission'));
//print_r($permissions);
//user_role_grant_permissions(3, array($permissions));
echo "\nducks\n";
return;
}
/**
* Load the default site's config file and return the db_prefix value from it.
*/
function unl_profile_get_default_site_db_prefix()
{
$default_site_settings_file = DRUPAL_ROOT . '/sites/default/settings.php';
require $default_site_settings_file;
return $databases['default']['default']['prefix'];
}
<?php
/**
* Implements hook_form_alter().
*
* Allows the profile to alter the site configuration form.
*/
function unl_wdn_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'install_configure_form') {
// Set default for site name field.
$form['site_information']['site_name']['#default_value'] = $_SERVER['SERVER_NAME'];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment