Index: profiles/small_business/small_business.profile
===================================================================
RCS file: profiles/small_business/small_business.profile
diff -N profiles/small_business/small_business.profile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ profiles/small_business/small_business.profile	23 Jun 2008 22:21:41 -0000
@@ -0,0 +1,194 @@
+<?php
+// $Id$
+
+
+/**
+ * Installation profile for a small business website. Project page: http://drupal.org/node/197235
+ */
+function small_business_profile_modules() {
+  return array('color', 'comment', 'help', 'menu', 'taxonomy', 'dblog', 'contact');
+}
+
+function small_business_profile_details() {
+  return array(
+    'name' => 'Small Business',
+    'description' => 'This installation profile sets up a simple small business website.',
+  );
+}
+
+function small_business_create_new_node($node) {
+  db_query("INSERT INTO {node} (nid, vid, type, title, uid, status, created, changed, comment, promote, moderate, sticky) VALUES (%d, %d, '%s', '%s', %d, %d, %d, %d, 0, %d, 0, %d)",
+    $node['nid'], $node['vid'], $node['type'], $node['title'], 1, $node['status'], time(), time(),
+    $node['promote'], $node['sticky']
+  );
+
+  db_query("INSERT INTO {node_revisions} (nid, vid, uid, title, body, teaser, log, timestamp, format) VALUES (%d, %d, 1, '%s', '%s', '%s', '', %d, %d)",
+    $node['nid'], $node['vid'], $node['title'], $node['body'], $node['teaser'], time(), $node['format']
+  );
+}
+
+function small_business_create_primary_link($name, $url) {
+  $links = array(
+    'menu_name' => 'primary-links',
+    'link_title' => $name,
+    'link_path' => $url,
+  );
+  menu_link_save($links);
+}
+
+function small_business_profile_task_list() {}
+
+function small_business_profile_tasks(&$task, $url) {
+  $site_name = variable_get('site_name', "Example Company");
+  variable_set('site_footer', st('Copyright &copy; @year @site_name', array('@site_name' => $site_name, '@year' => date('Y'))));
+
+  // Insert default user-defined node types into the database. For a complete
+  // list of available node type attributes, refer to the node type API
+  // documentation at: http://api.drupal.org/api/HEAD/function/hook_node_info.
+  $types = array(
+    array(
+      'type' => 'page',
+      'name' => st('Page'),
+      'module' => 'node',
+      'description' => st("A <em>page</em>, similar in form to an <em>article</em>, is a simple method for creating and displaying information that rarely changes, such as an \"About us\" section of a website. By default, a <em>page</em> entry does not allow visitor comments and is not featured on the site's initial home page."),
+      'custom' => TRUE,
+      'modified' => TRUE,
+      'locked' => FALSE,
+      'help' => '',
+      'min_word_count' => '',
+    ),
+    array(
+      'type' => 'article',
+      'name' => st('Article'),
+      'module' => 'node',
+      'description' => st("An <em>article</em>, similar in form to a <em>page</em>, is ideal for creating and displaying content that informs or engages website visitors. Press releases, site announcements, and informal blog-like entries may all be created with an <em>article</em> entry. By default, an <em>article</em> entry is automatically featured on the site's initial home page, and provides the ability to post comments."),
+      'custom' => TRUE,
+      'modified' => TRUE,
+      'locked' => FALSE,
+      'help' => '',
+      'min_word_count' => '',
+    ),
+  );
+
+  foreach ($node_types as $type) {
+    $type = (object) _node_type_set_defaults($type);
+    node_type_save($type);
+  }
+
+  $nodes = array(
+    array(
+      'nid' => 1,
+      'vid' => 1,
+      'status' => 1,
+      'promote' => 0,
+      'sticky' => 0,
+      'type' => 'page',
+      'format' => 1,
+      'title' => st('About Us'),
+      'body' => st('This is a page describing what the company does. Some possible content may include history of the company, location, and testimonials. Modify this page with your own content.'),
+      'teaser' => '',
+    ),
+    array(
+      'nid' => 2,
+      'vid' => 2,
+      'status' => 1,
+      'promote' => 0,
+      'sticky' => 0,
+      'format' => 1,
+      'type' => 'page',
+      'title' => st('Latest News'),
+      'teaser' => '',
+      'body' => st('Update this page to contain all your latest news.'),
+    ),
+    array(
+      'nid' => 3,
+      'vid' => 3,
+      'status' => 1,
+      'promote' => 0,
+      'sticky' => 0,
+      'format' => 1,
+      'type' => 'page',
+      'title' => st('Services Offered'),
+      'teaser' => '',
+      'body' => st('This page is to tell your visitors what services you offer. <em>Sample Service</em>'),
+    ),
+    array(
+      'nid' => 4,
+      'vid' => 4,
+      'status' => 1,
+      'promote' => 1,
+      'format' => 1,
+      'sticky' => 0,
+      'type' => 'story',
+      'title' => st('Welcome'),
+      'body' => st('Welcome to this new Small Business website. You can change this content in the Administration. It is reccomended that you enable Clean Urls if you haven\'t already.'),
+      'teaser' => st('Welcome to this new Small Business website. You can change this content in the Administration.'),
+    ),
+  );
+
+  foreach ($nodes as $node) {
+    small_business_create_new_node($node);
+
+    // This links the newly created node to the primary-link
+    if ($node['type'] == "page") {
+      small_business_create_primary_link($node['title'], 'node/'. $node['nid']);
+    }
+  }
+
+  // Creates error pages
+  $nodes = array(
+    array(
+      'nid' => 5,
+      'vid' => 5,
+      'status' => 1,
+      'promote' => 0,
+      'format' => 1,
+      'sticky' => 0,
+      'teaser' => '',
+      'type' => 'page',
+      'title' => st('Page Not Found'),
+      'body' => st('Oops!! It looks as the page you are a looking for no longer exists or your URL is incorrectly formatted.'),
+    ),
+    array(
+      'nid' => 6,
+      'vid' => 6,
+      'teaser' => '',
+      'status' => 1,
+      'sticky' => 0,
+      'promote' => 0,
+      'format' => 1,
+      'type' => 'page',
+      'title' => st('Access Denied'),
+      'body' => st('You are not authorized to view this page.'),
+    ),
+  );
+
+  foreach ($nodes as $node) {
+    small_business_create_new_node($node);
+  }
+
+  variable_set('site_404', 'node/5');
+  variable_set('site_403', 'node/6');
+
+  $contact_form = array(
+    'cid' => 1,
+    'category' => 'Contact Us',
+    'recipients' => variable_get('site_mail', 'error@example.com'),
+    'reply' => 'Thank you for contacting us. We will contact you shortly.',
+    'weight' => 0,
+    'selected' => 1,
+  );
+
+  // Add site wide contact form
+  db_query("INSERT INTO {contact} (cid,category,recipients,reply,weight,selected) VALUES (%d, '%s', '%s', '%s', %d, %d)",
+    $contact_form['cid'], $contact_form['category'],
+    $contact_form['recipients'], $contact_form['reply'], $contact_form['weight'], $contact_form['selected']
+  );
+
+  small_business_create_primary_link("Contact Us", "contact");
+
+  // Update user permissions for Site-wide contact form
+  db_query("UPDATE permission SET perm = 'access site-wide contact form, access content' WHERE rid = 1");
+  db_query("UPDATE permission SET perm = 'access comments, post comments, post comments without approval, access site-wide contact form' WHERE rid = 2");
+}
+
