2008-07-05 10:58:12 +00:00
|
|
|
<?php
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return an array of the modules to be enabled when this profile is installed.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* An array of modules to enable.
|
|
|
|
*/
|
|
|
|
function expert_profile_modules() {
|
2009-02-10 03:28:51 +00:00
|
|
|
return array('block', 'dblog');
|
2008-07-05 10:58:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a description of the profile for the initial installation screen.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* An array with keys 'name' and 'description' describing this profile,
|
|
|
|
* and optional 'language' to override the language selection for
|
|
|
|
* language-specific profiles.
|
|
|
|
*/
|
|
|
|
function expert_profile_details() {
|
|
|
|
return array(
|
2008-11-23 18:13:41 +00:00
|
|
|
'name' => 'Drupal (minimal)',
|
|
|
|
'description' => 'Create a Drupal site with only required modules enabled.'
|
2008-07-05 10:58:12 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a list of tasks that this profile supports.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* A keyed array of tasks the profile will perform during
|
|
|
|
* the final stage. The keys of the array will be used internally,
|
|
|
|
* while the values will be displayed to the user in the installer
|
|
|
|
* task list.
|
|
|
|
*/
|
|
|
|
function expert_profile_task_list() {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Perform any final installation tasks for this profile.
|
|
|
|
*/
|
|
|
|
function expert_profile_tasks(&$task, $url) {
|
2009-05-21 21:12:25 +00:00
|
|
|
|
|
|
|
// Enable some standard blocks.
|
2009-04-29 08:04:24 +00:00
|
|
|
$values = array(
|
2009-05-21 21:12:25 +00:00
|
|
|
array(
|
|
|
|
'module' => 'system',
|
|
|
|
'delta' => 'main',
|
|
|
|
'theme' => 'garland',
|
|
|
|
'status' => 1,
|
|
|
|
'weight' => 0,
|
|
|
|
'region' => 'content',
|
|
|
|
'pages' => '',
|
|
|
|
'cache' => -1,
|
|
|
|
),
|
2009-04-29 08:04:24 +00:00
|
|
|
array(
|
|
|
|
'module' => 'user',
|
|
|
|
'delta' => 'login',
|
|
|
|
'theme' => 'garland',
|
|
|
|
'status' => 1,
|
|
|
|
'weight' => 0,
|
|
|
|
'region' => 'left',
|
|
|
|
'pages' => '',
|
2009-04-30 21:44:20 +00:00
|
|
|
'cache' => -1,
|
2009-04-29 08:04:24 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'module' => 'system',
|
|
|
|
'delta' => 'navigation',
|
|
|
|
'theme' => 'garland',
|
|
|
|
'status' => 1,
|
|
|
|
'weight' => 0,
|
|
|
|
'region' => 'left',
|
|
|
|
'pages' => '',
|
2009-04-30 21:44:20 +00:00
|
|
|
'cache' => -1,
|
2009-04-29 08:04:24 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'module' => 'system',
|
|
|
|
'delta' => 'management',
|
|
|
|
'theme' => 'garland',
|
|
|
|
'status' => 1,
|
|
|
|
'weight' => 1,
|
|
|
|
'region' => 'left',
|
|
|
|
'pages' => '',
|
2009-04-30 21:44:20 +00:00
|
|
|
'cache' => -1,
|
2009-04-29 08:04:24 +00:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'module' => 'system',
|
|
|
|
'delta' => 'help',
|
|
|
|
'theme' => 'garland',
|
|
|
|
'status' => 1,
|
|
|
|
'weight' => 0,
|
|
|
|
'region' => 'help',
|
|
|
|
'pages' => '',
|
2009-04-30 21:44:20 +00:00
|
|
|
'cache' => -1,
|
2009-04-29 08:04:24 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
$query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
|
|
|
|
foreach ($values as $record) {
|
|
|
|
$query->values($record);
|
|
|
|
}
|
|
|
|
$query->execute();
|
2008-07-05 10:58:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of hook_form_alter().
|
|
|
|
*
|
|
|
|
* Allows the profile to alter the site-configuration form. This is
|
|
|
|
* called through custom invocation, so $form_state is not populated.
|
|
|
|
*/
|
|
|
|
function expert_form_alter(&$form, $form_state, $form_id) {
|
|
|
|
if ($form_id == 'install_configure') {
|
|
|
|
// Set default for site name field.
|
|
|
|
$form['site_information']['site_name']['#default_value'] = $_SERVER['SERVER_NAME'];
|
|
|
|
}
|
|
|
|
}
|