2009-08-21 07:50:08 +00:00
|
|
|
<?php
|
2012-02-29 21:19:26 +00:00
|
|
|
/**
|
|
|
|
* @file
|
2012-06-13 17:59:14 +00:00
|
|
|
* Install, update and uninstall functions for the minimal install profile.
|
2012-02-29 21:19:26 +00:00
|
|
|
*/
|
2009-08-21 07:50:08 +00:00
|
|
|
|
|
|
|
/**
|
2009-12-04 16:49:48 +00:00
|
|
|
* Implements hook_install().
|
2009-08-21 07:50:08 +00:00
|
|
|
*
|
2012-02-29 21:19:26 +00:00
|
|
|
* Performs actions to set up the site for this profile.
|
|
|
|
*
|
|
|
|
* @see system_install()
|
2009-08-21 07:50:08 +00:00
|
|
|
*/
|
2010-01-04 23:08:34 +00:00
|
|
|
function minimal_install() {
|
2012-08-31 16:46:33 +00:00
|
|
|
$default_theme = 'stark';
|
2011-12-13 03:29:45 +00:00
|
|
|
|
2009-08-21 07:50:08 +00:00
|
|
|
// Enable some standard blocks.
|
|
|
|
$values = array(
|
|
|
|
array(
|
|
|
|
'module' => 'user',
|
|
|
|
'delta' => 'login',
|
2010-07-08 03:41:27 +00:00
|
|
|
'theme' => $default_theme,
|
2009-08-21 07:50:08 +00:00
|
|
|
'status' => 1,
|
|
|
|
'weight' => 0,
|
|
|
|
'region' => 'sidebar_first',
|
|
|
|
'pages' => '',
|
|
|
|
'cache' => -1,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'module' => 'system',
|
|
|
|
'delta' => 'navigation',
|
2010-07-08 03:41:27 +00:00
|
|
|
'theme' => $default_theme,
|
2009-08-21 07:50:08 +00:00
|
|
|
'status' => 1,
|
|
|
|
'weight' => 0,
|
|
|
|
'region' => 'sidebar_first',
|
|
|
|
'pages' => '',
|
|
|
|
'cache' => -1,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'module' => 'system',
|
|
|
|
'delta' => 'management',
|
2010-07-08 03:41:27 +00:00
|
|
|
'theme' => $default_theme,
|
2009-08-21 07:50:08 +00:00
|
|
|
'status' => 1,
|
|
|
|
'weight' => 1,
|
|
|
|
'region' => 'sidebar_first',
|
|
|
|
'pages' => '',
|
|
|
|
'cache' => -1,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
$query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
|
|
|
|
foreach ($values as $record) {
|
|
|
|
$query->values($record);
|
|
|
|
}
|
2009-11-10 17:27:54 +00:00
|
|
|
$query->execute();
|
2009-08-27 20:25:29 +00:00
|
|
|
|
2012-01-08 07:14:15 +00:00
|
|
|
// Set front page to "node".
|
2012-07-02 17:20:33 +00:00
|
|
|
config('system.site')->set('page.front', 'node')->save();
|
2012-01-08 07:14:15 +00:00
|
|
|
|
2010-05-27 12:29:39 +00:00
|
|
|
// Allow visitor account creation, but with administrative approval.
|
2012-08-26 21:15:58 +00:00
|
|
|
config('user.settings')->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
|
2010-05-27 12:29:39 +00:00
|
|
|
|
2009-08-27 20:25:29 +00:00
|
|
|
// Enable default permissions for system roles.
|
2010-02-06 16:29:35 +00:00
|
|
|
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content'));
|
2010-02-06 16:30:27 +00:00
|
|
|
user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content'));
|
2009-08-21 07:50:08 +00:00
|
|
|
}
|