Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial commit.

  • Loading branch information...
commit c2e7f9cfa69961bff84879bdb3be6e6ba6bff7ea 0 parents
Patrick Connolly authored
6 drupalgithub.info
... ... @@ -0,0 +1,6 @@
  1 +name = Drupal GitHub
  2 +description = Attempt to Integrate Drupal with GitHub.
  3 +version = VERSION
  4 +core = 7.x
  5 +dependencies[] = block
  6 +dependencies[] = dblog
81 drupalgithub.install
... ... @@ -0,0 +1,81 @@
  1 +<?php
  2 +/**
  3 + * @file
  4 + * Install, update and uninstall functions for the drupalgithub install profile.
  5 + */
  6 +
  7 +/**
  8 + * Implements hook_install().
  9 + *
  10 + * Performs actions to set up the site for this profile.
  11 + *
  12 + * @see system_install()
  13 + */
  14 +function drupalgithub_install() {
  15 + // Enable some standard blocks.
  16 + $default_theme = variable_get('theme_default', 'bartik');
  17 + $values = array(
  18 + array(
  19 + 'module' => 'system',
  20 + 'delta' => 'main',
  21 + 'theme' => $default_theme,
  22 + 'status' => 1,
  23 + 'weight' => 0,
  24 + 'region' => 'content',
  25 + 'pages' => '',
  26 + 'cache' => -1,
  27 + ),
  28 + array(
  29 + 'module' => 'user',
  30 + 'delta' => 'login',
  31 + 'theme' => $default_theme,
  32 + 'status' => 1,
  33 + 'weight' => 0,
  34 + 'region' => 'sidebar_first',
  35 + 'pages' => '',
  36 + 'cache' => -1,
  37 + ),
  38 + array(
  39 + 'module' => 'system',
  40 + 'delta' => 'navigation',
  41 + 'theme' => $default_theme,
  42 + 'status' => 1,
  43 + 'weight' => 0,
  44 + 'region' => 'sidebar_first',
  45 + 'pages' => '',
  46 + 'cache' => -1,
  47 + ),
  48 + array(
  49 + 'module' => 'system',
  50 + 'delta' => 'management',
  51 + 'theme' => $default_theme,
  52 + 'status' => 1,
  53 + 'weight' => 1,
  54 + 'region' => 'sidebar_first',
  55 + 'pages' => '',
  56 + 'cache' => -1,
  57 + ),
  58 + array(
  59 + 'module' => 'system',
  60 + 'delta' => 'help',
  61 + 'theme' => $default_theme,
  62 + 'status' => 1,
  63 + 'weight' => 0,
  64 + 'region' => 'help',
  65 + 'pages' => '',
  66 + 'cache' => -1,
  67 + ),
  68 + );
  69 + $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
  70 + foreach ($values as $record) {
  71 + $query->values($record);
  72 + }
  73 + $query->execute();
  74 +
  75 + // Allow visitor account creation, but with administrative approval.
  76 + variable_set('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL);
  77 +
  78 + // Enable default permissions for system roles.
  79 + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content'));
  80 + user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content'));
  81 +}
15 drupalgithub.profile
... ... @@ -0,0 +1,15 @@
  1 +<?php
  2 +/**
  3 + * @file
  4 + * Enables modules and site configuration for a drupalgithub site installation.
  5 + */
  6 +
  7 +/**
  8 + * Implements hook_form_FORM_ID_alter() for install_configure_form().
  9 + *
  10 + * Allows the profile to alter the site configuration form.
  11 + */
  12 +function drupalgithub_form_install_configure_form_alter(&$form, $form_state) {
  13 + // Pre-populate the site name with the server name.
  14 + $form['site_information']['site_name']['#default_value'] = $_SERVER['SERVER_NAME'];
  15 +}

0 comments on commit c2e7f9c

Please sign in to comment.
Something went wrong with that request. Please try again.