2009-08-21 07:50:08 +00:00
<?php
// $Id$
/**
2009-12-04 16:49:48 +00:00
* Implements hook_install().
2009-08-21 07:50:08 +00:00
*
* Perform actions to set up the site for this profile.
*/
2010-01-04 23:08:34 +00:00
function minimal_install() {
2009-12-03 15:33:42 +00:00
// Add text formats.
$plain_text_format = array(
'name' => 'Plain text',
'weight' => 10,
'filters' => array(
// Escape all HTML.
'filter_html_escape' => array(
'weight' => 0,
'status' => 1,
),
// Line break filter.
'filter_autop' => array(
'weight' => 1,
'status' => 1,
),
),
);
$plain_text_format = (object) $plain_text_format;
filter_format_save($plain_text_format);
// Set the fallback format to plain text.
variable_set('filter_fallback_format', $plain_text_format->format);
2009-08-21 07:50:08 +00:00
// Enable some standard blocks.
$values = array(
array(
'module' => 'system',
'delta' => 'main',
'theme' => 'garland',
'status' => 1,
'weight' => 0,
'region' => 'content',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'user',
'delta' => 'login',
'theme' => 'garland',
'status' => 1,
'weight' => 0,
'region' => 'sidebar_first',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'system',
'delta' => 'navigation',
'theme' => 'garland',
'status' => 1,
'weight' => 0,
'region' => 'sidebar_first',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'system',
'delta' => 'management',
'theme' => 'garland',
'status' => 1,
'weight' => 1,
'region' => 'sidebar_first',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'system',
'delta' => 'help',
'theme' => 'garland',
'status' => 1,
'weight' => 0,
'region' => 'help',
'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
// Enable default permissions for system roles.
2010-02-06 16:29:35 +00:00
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content'));
- Patch #11218 by David_Rothstein, sun, quicksketch, duncf, awood456, dropcube, mgifford | pwolanin, dww, RobRoy, Crell, webchick, beginner, ray007, bjaspan, chx, Gábor Hojtsy, Steven, Dries, lutegrass, sym, guardian, matt2000, geerlingguy, SeanBannister, matt westgate, com2, praseodym: allow default text formats per role, and integrate text format permissions.
2009-09-20 07:32:19 +00:00
user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', 'access comments', 'post comments', 'post comments without approval', 'use text format 1'));
2009-08-21 07:50:08 +00:00
}