minimal.install 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the minimal installation profile.
  5. */
  6. /**
  7. * Implements hook_install().
  8. *
  9. * Performs actions to set up the site for this profile.
  10. *
  11. * @see system_install()
  12. */
  13. function minimal_install() {
  14. // Enable some standard blocks.
  15. $default_theme = variable_get('theme_default', 'bartik');
  16. $values = array(
  17. array(
  18. 'module' => 'system',
  19. 'delta' => 'main',
  20. 'theme' => $default_theme,
  21. 'status' => 1,
  22. 'weight' => 0,
  23. 'region' => 'content',
  24. 'pages' => '',
  25. 'cache' => -1,
  26. ),
  27. array(
  28. 'module' => 'user',
  29. 'delta' => 'login',
  30. 'theme' => $default_theme,
  31. 'status' => 1,
  32. 'weight' => 0,
  33. 'region' => 'sidebar_first',
  34. 'pages' => '',
  35. 'cache' => -1,
  36. ),
  37. array(
  38. 'module' => 'system',
  39. 'delta' => 'navigation',
  40. 'theme' => $default_theme,
  41. 'status' => 1,
  42. 'weight' => 0,
  43. 'region' => 'sidebar_first',
  44. 'pages' => '',
  45. 'cache' => -1,
  46. ),
  47. array(
  48. 'module' => 'system',
  49. 'delta' => 'management',
  50. 'theme' => $default_theme,
  51. 'status' => 1,
  52. 'weight' => 1,
  53. 'region' => 'sidebar_first',
  54. 'pages' => '',
  55. 'cache' => -1,
  56. ),
  57. array(
  58. 'module' => 'system',
  59. 'delta' => 'help',
  60. 'theme' => $default_theme,
  61. 'status' => 1,
  62. 'weight' => 0,
  63. 'region' => 'help',
  64. 'pages' => '',
  65. 'cache' => -1,
  66. ),
  67. );
  68. $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
  69. foreach ($values as $record) {
  70. $query->values($record);
  71. }
  72. $query->execute();
  73. // Allow visitor account creation, but with administrative approval.
  74. variable_set('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL);
  75. // Enable default permissions for system roles.
  76. user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content'));
  77. user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content'));
  78. }