Skip to content
Browse files

Initial commit.

  • Loading branch information...
0 parents commit c2e7f9cfa69961bff84879bdb3be6e6ba6bff7ea @patcon committed Aug 24, 2012
Showing with 102 additions and 0 deletions.
  1. +6 −0 drupalgithub.info
  2. +81 −0 drupalgithub.install
  3. +15 −0 drupalgithub.profile
6 drupalgithub.info
@@ -0,0 +1,6 @@
+name = Drupal GitHub
+description = Attempt to Integrate Drupal with GitHub.
+version = VERSION
+core = 7.x
+dependencies[] = block
+dependencies[] = dblog
81 drupalgithub.install
@@ -0,0 +1,81 @@
+<?php
+/**
+ * @file
+ * Install, update and uninstall functions for the drupalgithub install profile.
+ */
+
+/**
+ * Implements hook_install().
+ *
+ * Performs actions to set up the site for this profile.
+ *
+ * @see system_install()
+ */
+function drupalgithub_install() {
+ // Enable some standard blocks.
+ $default_theme = variable_get('theme_default', 'bartik');
+ $values = array(
+ array(
+ 'module' => 'system',
+ 'delta' => 'main',
+ 'theme' => $default_theme,
+ 'status' => 1,
+ 'weight' => 0,
+ 'region' => 'content',
+ 'pages' => '',
+ 'cache' => -1,
+ ),
+ array(
+ 'module' => 'user',
+ 'delta' => 'login',
+ 'theme' => $default_theme,
+ 'status' => 1,
+ 'weight' => 0,
+ 'region' => 'sidebar_first',
+ 'pages' => '',
+ 'cache' => -1,
+ ),
+ array(
+ 'module' => 'system',
+ 'delta' => 'navigation',
+ 'theme' => $default_theme,
+ 'status' => 1,
+ 'weight' => 0,
+ 'region' => 'sidebar_first',
+ 'pages' => '',
+ 'cache' => -1,
+ ),
+ array(
+ 'module' => 'system',
+ 'delta' => 'management',
+ 'theme' => $default_theme,
+ 'status' => 1,
+ 'weight' => 1,
+ 'region' => 'sidebar_first',
+ 'pages' => '',
+ 'cache' => -1,
+ ),
+ array(
+ 'module' => 'system',
+ 'delta' => 'help',
+ 'theme' => $default_theme,
+ '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);
+ }
+ $query->execute();
+
+ // Allow visitor account creation, but with administrative approval.
+ variable_set('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL);
+
+ // Enable default permissions for system roles.
+ user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content'));
+ user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content'));
+}
15 drupalgithub.profile
@@ -0,0 +1,15 @@
+<?php
+/**
+ * @file
+ * Enables modules and site configuration for a drupalgithub site installation.
+ */
+
+/**
+ * Implements hook_form_FORM_ID_alter() for install_configure_form().
+ *
+ * Allows the profile to alter the site configuration form.
+ */
+function drupalgithub_form_install_configure_form_alter(&$form, $form_state) {
+ // Pre-populate the site name with the server name.
+ $form['site_information']['site_name']['#default_value'] = $_SERVER['SERVER_NAME'];
+}

0 comments on commit c2e7f9c

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