diff --git block_api.info block_api.info
index d430cf1..09f76bb 100644
--- block_api.info
+++ block_api.info
@@ -1,5 +1,5 @@
-; $Id$

-

-name = "Block API"

-description = "An API allowing modules to create custom block types."

+; $Id$
+
+name = "Block API"
+description = "An API allowing modules to create custom block types."
 core = 6.x
\ No newline at end of file
diff --git block_api.install block_api.install
index 80ea42c..61bf1bf 100644
--- block_api.install
+++ block_api.install
@@ -1,60 +1,60 @@
-<?php

-// $Id$

-

-function block_api_install() {

-  drupal_install_schema('block_api');

-}

-

-function block_api_uninstall() {

-  drupal_uninstall_schema('block_api');

-}

-

-function block_api_schema() {

-  $schema['block_api'] = array(

-    'description' => t('Table storing the settings for all blocks defined through the block_api.'),

-    'fields' => array(

-      'module' => array(

-        'description' => t('The name of the module implementing the block.'),

-        'type' => 'varchar',

-        'length' => '32',

-        'not null' => TRUE,

-      ),

-      'delta' => array(

-        'description' => t('The machine name defined by the user when creating the block.'),

-        'type' => 'varchar',

-        'length' => '64',

-        'not null' => TRUE,

-      ),

-      'admin_title' => array(

-        'description' => t('The admin name defined by the user when creating the block.'),

-        'type' => 'varchar',

-        'length' => '64',

-        'not null' => TRUE,

-      ),

-      'block_type' => array(

-        'description' => t('The type of block defined by the module.'),

-        'type' => 'varchar',

-        'length' => '32',

-        'not null' => TRUE,

-      ),

-      'storage' => array(

-        'description' => t('The type of storage used for this block.'),

-        'type' => 'int',

-        'unsigned' => TRUE,

-        'size' => 'tiny',

-        'not null' => TRUE,

-        'default' => 0,

-      ),

-      'settings' => array(

-        'description' => t('A serialized array of variables for this block.'),

-        'type' => 'text',

-        'size' => 'big',

-        'not null' => TRUE,

-      ),

-    ),

-    'unique keys' => array(

-      'module' => array('module', 'delta', 'block_type')

-    ),

-  );

-  return $schema;

+<?php
+// $Id$
+
+function block_api_install() {
+  drupal_install_schema('block_api');
+}
+
+function block_api_uninstall() {
+  drupal_uninstall_schema('block_api');
+}
+
+function block_api_schema() {
+  $schema['block_api'] = array(
+    'description' => t('Table storing the settings for all blocks defined through the block_api.'),
+    'fields' => array(
+      'module' => array(
+        'description' => t('The name of the module implementing the block.'),
+        'type' => 'varchar',
+        'length' => '32',
+        'not null' => TRUE,
+      ),
+      'delta' => array(
+        'description' => t('The machine name defined by the user when creating the block.'),
+        'type' => 'varchar',
+        'length' => '64',
+        'not null' => TRUE,
+      ),
+      'admin_title' => array(
+        'description' => t('The admin name defined by the user when creating the block.'),
+        'type' => 'varchar',
+        'length' => '64',
+        'not null' => TRUE,
+      ),
+      'block_type' => array(
+        'description' => t('The type of block defined by the module.'),
+        'type' => 'varchar',
+        'length' => '32',
+        'not null' => TRUE,
+      ),
+      'storage' => array(
+        'description' => t('The type of storage used for this block.'),
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'size' => 'tiny',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'settings' => array(
+        'description' => t('A serialized array of variables for this block.'),
+        'type' => 'text',
+        'size' => 'big',
+        'not null' => TRUE,
+      ),
+    ),
+    'unique keys' => array(
+      'module' => array('module', 'delta', 'block_type')
+    ),
+  );
+  return $schema;
 }
\ No newline at end of file
diff --git block_api.module block_api.module
index 9a40135..4b14f0d 100644
--- block_api.module
+++ block_api.module
@@ -1,243 +1,243 @@
-<?php

-

-define('BLOCK_API_STORAGE_DATABASE', 0);

-define('BLOCK_API_STORAGE_OWN', 1);

-

-/**

- * Load the blocks settings.

- */

-function _block_api_get_config($module, $delta) {

-  // Get the details of the block from the database and return in array

-  $block_data = db_fetch_object(db_query("SELECT block_type, admin_title, storage, settings FROM {block_api} WHERE module = '%s' AND delta = '%s'", $module, $delta));

-  return array(

-    'delta' => $delta,

-    'module' => $module,

-    'block_type' => $block_data->block_type,

-    'admin_title' => $block_data->admin_title,

-    'storage' => $block_data->storage,

-    'settings' => unserialize($block_data->settings),

-  );

-}

-

-/**

- * Get a list of all block types that modules define.

- */

-function _block_api_get_types() {

-  $types = array();

-  foreach (module_implements('block_api_info') as $module) {

-    $module_types = module_invoke($module, 'block_api_info');

-    foreach ($module_types as $type => $data) {

-      $types[$module.':'. $type] = $data['title'];

-    }

-  }

-  return $types;

-}

-

-/**

- * Get a specific block types details.

- */

-function _block_api_get_type($module, $type) {

-  $types = module_invoke($module, 'block_api_info');

-  return $types[$type];

-}

-

-/**

- * Hook to allow modules to define cache of their blocks.

- */

-function block_api_block_list($module) {

-  $sql = "SELECT delta, admin_title FROM {block_api} WHERE module = '%s'";

-  $query = db_query($sql, $module);

-  while ($data = db_fetch_object($query)) {

-    $blocks[$data->delta]['info'] = t('!title', array('!title' => $data->admin_title));

-    // Do we allow modules to hook in here?  Allows them to define cache etc if required.

-  }

-  return $blocks;

-}

-

-/**

- * Hook to allow modules to add form data to their block configuration form.

- */

-function block_api_block_configure($module, $delta, $edit) {

-  $config = _block_api_get_config($module, $delta);

-  if ($config['storage'] == 0) {

-    $edit = $config['settings'];

-  }

-  $form = module_invoke($module, 'block_api_form', $config, $edit);

-  $form['admin_title'] = array(

-    '#type' => 'textfield',

-    '#title' => t('Block description'),

-    '#default_value' => $config['admin_title'],

-    '#weight' => -20,

-    '#description' => t('A brief description of your block. Used on the <a href="@overview">block overview page</a>.', array('@overview' => url('admin/build/block'))),

-    '#required' => TRUE,

-  );

-  return $form;

-}

-

-/**

- * Hook to allow modules to save their block configuration.

- */

-function block_api_block_save($module, $delta, $edit) {

-  $config = _block_api_get_config($module, $delta);

-  if ($config['storage'] == 0) {

-    db_query("UPDATE {block_api} SET settings = '%s', admin_title = '%s' WHERE module = '%s' AND delta = '%s' AND block_type = '%s'", serialize($edit), $edit['admin_title'], $module, $delta, $config['block_type']);

-  }

-  module_invoke($module, 'block_api_save', $config, $edit);

-}

-

-/**

- * Hook to allow modules to send the output for their block.

- */

-function block_api_block_view($module, $delta, $edit) {

-  $config = _block_api_get_config($module, $delta);

-  return module_invoke($module, 'block_api_view', $config);

-}

-

-/**

- * Implementation of hook_menu().

- */

-function block_api_menu() {

-  $items['admin/build/block/add-module-block'] = array(

-    'title' => 'Add module block',

-    'description' => 'Add a new custom block',

-    'page callback' => 'drupal_get_form',

-    'page arguments' => array('block_api_create_form'),

-    'access arguments' => array('administer blocks'),

-    'type' => MENU_LOCAL_TASK,

-  );

-  $items['admin/build/block/delete-module-block'] = array(

-    'title' => 'Delete module block',

-    'access arguments' => array('administer blocks'),

-    'page callback' => 'drupal_get_form',

-    'page arguments' => array('block_api_delete'),

-    'type' => MENU_CALLBACK,

-  );

-  return $items;

-}

-

-/**

- * Get a list of all blocks using the Block API.

- */

-function block_api_get_blocks() {

-  $blocks = array();

-  $sql = "SELECT module, delta, admin_title FROM {block_api}";

-  $query = db_query($sql);

-  while ($data = db_fetch_object($query)) {

-    $blocks[$data->module .'_'. $data->delta] = array('module' => $data->module, 'delta' => $data->delta);

-  }

-  return $blocks;

-}

-

-/**

- * Add a delete button to the block admin form.

- */

-function block_api_form_block_admin_display_form_alter(&$form, $form_state) {

-  $blocks = block_api_get_blocks();

-  foreach ($blocks as $key => $block) {

-    $form[$key]['delete'] = array('#value' => l(t('delete'), 'admin/build/block/delete-module-block/'. $block['module'] .'/'. $block['delta']));

-  }

-}

-

-/**

- * Menu callback: Delete the block from the menu path.

- */

-function block_api_delete(&$form_state, $module, $delta) {

-  $config = _block_api_get_config($module, $delta);

-  $form['block_title'] = array('#type' => 'hidden', '#value' => $config['admin_title']);

-  $form['block_type'] = array('#type' => 'hidden', '#value' => $config['block_type']);

-  $form['module'] = array('#type' => 'hidden', '#value' => $config['module']);

-  $form['delta'] = array('#type' => 'hidden', '#value' => $config['delta']);

-

-  return confirm_form($form, t('Are you sure you want to delete the "%name" block?', array('%name' => $config['admin_title'])), 'admin/build/block', NULL, t('Delete'), t('Cancel'));

-}

-

-/**

- * Submit handler to delete block.

- */

-function block_api_delete_submit($form, &$form_state) {

-  // Remove the configuration settings

-  db_query("DELETE FROM {block_api} WHERE module = '%s' AND delta = '%s' AND block_type = '%s'", $form_state['values']['module'], $form_state['values']['delta'], $form_state['values']['block_type']);

-  

-  // Allow other modules to remove any unneeded block configuration settings that they saved.

-  module_invoke($form_state['values']['module'], 'block_api_delete', $form_state['values']['block_type'], $form_state['values']['delta']);

-

-  db_query("DELETE FROM {blocks} WHERE module = '%s' AND delta = '%s'", $form_state['values']['module'], $form_state['values']['delta']);

-  db_query("DELETE FROM {blocks_roles} WHERE module = '%s' AND delta = '%s'", $form_state['values']['module'], $form_state['values']['delta']);

-  drupal_set_message(t('The "%name" block has been removed.', array('%name' => $form_state['values']['block_title'])));

-  cache_clear_all();

-  $form_state['redirect'] = 'admin/build/block';

-  return;

-}

-

-/**

- * Menu callback: Create the form to add a new block.

- */

-function block_api_create_form($form_state) {

-  $form['settings'] = array(

-    '#type' => 'fieldset',

-    '#title' => t('Block settings'),

-    '#collapsible' => FALSE,

-  );

-  $form['settings']['admin_name'] = array(

-    '#type' => 'textfield',

-    '#title' => t('Administrative name'),

-    '#description' => t('The human-readable name of this content type.'),

-    '#required' => TRUE,

-  );

-  $form['settings']['machine_name'] = array(

-    '#type' => 'textfield',

-    '#title' => t('Machine name'),

-    '#description' => t('The machine-readable name of this content type. This name must contain only lowercase letters, numbers, and underscores.'),

-    '#required' => TRUE,

-  );

-  $form['settings']['block_type'] = array(

-    '#type' => 'select',

-    '#title' => t('Block type'),

-    '#description' => t('The type of block you want to create.'),

-    '#required' => TRUE,

-    '#options' => _block_api_get_types(),

-  );

-  $form['submit'] = array(

-    '#type' => 'submit',

-    '#value' => t('Add block'),

-  );

-  return $form;

-}

-

-/**

- * Validation handler for new block form.

- */

-function block_api_create_form_validate($form, &$form_state) {

-  if (!preg_match('!^[a-z0-9_]+$!', $form_state['values']['machine_name'])) {

-    form_set_error('machine_name', t('The machine-readable name must contain only lowercase letters, numbers, and underscores.'));

-  }

-}

-

-/**

- * Submit handler for new block form.

- */

-function block_api_create_form_submit($form, &$form_state) {

-  // Get the module name and block type selected by the user.

-  list($module, $block_type) = explode(':', $form_state['values']['block_type']);

-	$details = _block_api_get_type($module, $block_type);

-  $delta = $form_state['values']['machine_name'];

-  

-  // Save the data in to the {block_api} table.

-  db_query("INSERT INTO {block_api} (module, delta, block_type, admin_title, settings, storage) VALUES ('%s', '%s', '%s', '%s', '%s', %d)", $module, $delta, $block_type, $form_state['values']['admin_name'], serialize($form_state['values']), $details['storage']);

-  

-  // Save the block to the {blocks} table. Code copied from the block module.  

-  foreach (list_themes() as $key => $theme) {

-    if ($theme->status) {

-      db_query("INSERT INTO {blocks} (visibility, pages, custom, title, module, theme, status, weight, delta, cache) VALUES(%d, '%s', %d, '%s', '%s', '%s', %d, %d, '%s', %d)", 0, '', 0, '', $module, $theme->name, 0, 0, $delta, BLOCK_NO_CACHE);

-    }

-  }

-

-  drupal_set_message(t('The block has been created.'));

-  cache_clear_all();

-  

-  // As a backup in case of problems we redirect back to the blocks admin page, this should never happen.

-  $redirect = 'admin/build/block';

-  if ($module && $delta) $redirect = 'admin/build/block/configure/'. $module .'/'. $delta;

-  $form_state['redirect'] = $redirect;

-  return;

-}

+<?php
+
+define('BLOCK_API_STORAGE_DATABASE', 0);
+define('BLOCK_API_STORAGE_OWN', 1);
+
+/**
+ * Load the blocks settings.
+ */
+function _block_api_get_config($module, $delta) {
+  // Get the details of the block from the database and return in array
+  $block_data = db_fetch_object(db_query("SELECT block_type, admin_title, storage, settings FROM {block_api} WHERE module = '%s' AND delta = '%s'", $module, $delta));
+  return array(
+    'delta' => $delta,
+    'module' => $module,
+    'block_type' => $block_data->block_type,
+    'admin_title' => $block_data->admin_title,
+    'storage' => $block_data->storage,
+    'settings' => unserialize($block_data->settings),
+  );
+}
+
+/**
+ * Get a list of all block types that modules define.
+ */
+function _block_api_get_types() {
+  $types = array();
+  foreach (module_implements('block_api_info') as $module) {
+    $module_types = module_invoke($module, 'block_api_info');
+    foreach ($module_types as $type => $data) {
+      $types[$module.':'. $type] = $data['title'];
+    }
+  }
+  return $types;
+}
+
+/**
+ * Get a specific block types details.
+ */
+function _block_api_get_type($module, $type) {
+  $types = module_invoke($module, 'block_api_info');
+  return $types[$type];
+}
+
+/**
+ * Hook to allow modules to define cache of their blocks.
+ */
+function block_api_block_list($module) {
+  $sql = "SELECT delta, admin_title FROM {block_api} WHERE module = '%s'";
+  $query = db_query($sql, $module);
+  while ($data = db_fetch_object($query)) {
+    $blocks[$data->delta]['info'] = t('!title', array('!title' => $data->admin_title));
+    // Do we allow modules to hook in here?  Allows them to define cache etc if required.
+  }
+  return $blocks;
+}
+
+/**
+ * Hook to allow modules to add form data to their block configuration form.
+ */
+function block_api_block_configure($module, $delta, $edit) {
+  $config = _block_api_get_config($module, $delta);
+  if ($config['storage'] == 0) {
+    $edit = $config['settings'];
+  }
+  $form = module_invoke($module, 'block_api_form', $config, $edit);
+  $form['admin_title'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Block description'),
+    '#default_value' => $config['admin_title'],
+    '#weight' => -20,
+    '#description' => t('A brief description of your block. Used on the <a href="@overview">block overview page</a>.', array('@overview' => url('admin/build/block'))),
+    '#required' => TRUE,
+  );
+  return $form;
+}
+
+/**
+ * Hook to allow modules to save their block configuration.
+ */
+function block_api_block_save($module, $delta, $edit) {
+  $config = _block_api_get_config($module, $delta);
+  if ($config['storage'] == 0) {
+    db_query("UPDATE {block_api} SET settings = '%s', admin_title = '%s' WHERE module = '%s' AND delta = '%s' AND block_type = '%s'", serialize($edit), $edit['admin_title'], $module, $delta, $config['block_type']);
+  }
+  module_invoke($module, 'block_api_save', $config, $edit);
+}
+
+/**
+ * Hook to allow modules to send the output for their block.
+ */
+function block_api_block_view($module, $delta, $edit) {
+  $config = _block_api_get_config($module, $delta);
+  return module_invoke($module, 'block_api_view', $config);
+}
+
+/**
+ * Implementation of hook_menu().
+ */
+function block_api_menu() {
+  $items['admin/build/block/add-module-block'] = array(
+    'title' => 'Add module block',
+    'description' => 'Add a new custom block',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('block_api_create_form'),
+    'access arguments' => array('administer blocks'),
+    'type' => MENU_LOCAL_TASK,
+  );
+  $items['admin/build/block/delete-module-block'] = array(
+    'title' => 'Delete module block',
+    'access arguments' => array('administer blocks'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('block_api_delete'),
+    'type' => MENU_CALLBACK,
+  );
+  return $items;
+}
+
+/**
+ * Get a list of all blocks using the Block API.
+ */
+function block_api_get_blocks() {
+  $blocks = array();
+  $sql = "SELECT module, delta, admin_title FROM {block_api}";
+  $query = db_query($sql);
+  while ($data = db_fetch_object($query)) {
+    $blocks[$data->module .'_'. $data->delta] = array('module' => $data->module, 'delta' => $data->delta);
+  }
+  return $blocks;
+}
+
+/**
+ * Add a delete button to the block admin form.
+ */
+function block_api_form_block_admin_display_form_alter(&$form, $form_state) {
+  $blocks = block_api_get_blocks();
+  foreach ($blocks as $key => $block) {
+    $form[$key]['delete'] = array('#value' => l(t('delete'), 'admin/build/block/delete-module-block/'. $block['module'] .'/'. $block['delta']));
+  }
+}
+
+/**
+ * Menu callback: Delete the block from the menu path.
+ */
+function block_api_delete(&$form_state, $module, $delta) {
+  $config = _block_api_get_config($module, $delta);
+  $form['block_title'] = array('#type' => 'hidden', '#value' => $config['admin_title']);
+  $form['block_type'] = array('#type' => 'hidden', '#value' => $config['block_type']);
+  $form['module'] = array('#type' => 'hidden', '#value' => $config['module']);
+  $form['delta'] = array('#type' => 'hidden', '#value' => $config['delta']);
+
+  return confirm_form($form, t('Are you sure you want to delete the "%name" block?', array('%name' => $config['admin_title'])), 'admin/build/block', NULL, t('Delete'), t('Cancel'));
+}
+
+/**
+ * Submit handler to delete block.
+ */
+function block_api_delete_submit($form, &$form_state) {
+  // Remove the configuration settings
+  db_query("DELETE FROM {block_api} WHERE module = '%s' AND delta = '%s' AND block_type = '%s'", $form_state['values']['module'], $form_state['values']['delta'], $form_state['values']['block_type']);
+  
+  // Allow other modules to remove any unneeded block configuration settings that they saved.
+  module_invoke($form_state['values']['module'], 'block_api_delete', $form_state['values']['block_type'], $form_state['values']['delta']);
+
+  db_query("DELETE FROM {blocks} WHERE module = '%s' AND delta = '%s'", $form_state['values']['module'], $form_state['values']['delta']);
+  db_query("DELETE FROM {blocks_roles} WHERE module = '%s' AND delta = '%s'", $form_state['values']['module'], $form_state['values']['delta']);
+  drupal_set_message(t('The "%name" block has been removed.', array('%name' => $form_state['values']['block_title'])));
+  cache_clear_all();
+  $form_state['redirect'] = 'admin/build/block';
+  return;
+}
+
+/**
+ * Menu callback: Create the form to add a new block.
+ */
+function block_api_create_form($form_state) {
+  $form['settings'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Block settings'),
+    '#collapsible' => FALSE,
+  );
+  $form['settings']['admin_name'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Administrative name'),
+    '#description' => t('The human-readable name of this content type.'),
+    '#required' => TRUE,
+  );
+  $form['settings']['machine_name'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Machine name'),
+    '#description' => t('The machine-readable name of this content type. This name must contain only lowercase letters, numbers, and underscores.'),
+    '#required' => TRUE,
+  );
+  $form['settings']['block_type'] = array(
+    '#type' => 'select',
+    '#title' => t('Block type'),
+    '#description' => t('The type of block you want to create.'),
+    '#required' => TRUE,
+    '#options' => _block_api_get_types(),
+  );
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Add block'),
+  );
+  return $form;
+}
+
+/**
+ * Validation handler for new block form.
+ */
+function block_api_create_form_validate($form, &$form_state) {
+  if (!preg_match('!^[a-z0-9_]+$!', $form_state['values']['machine_name'])) {
+    form_set_error('machine_name', t('The machine-readable name must contain only lowercase letters, numbers, and underscores.'));
+  }
+}
+
+/**
+ * Submit handler for new block form.
+ */
+function block_api_create_form_submit($form, &$form_state) {
+  // Get the module name and block type selected by the user.
+  list($module, $block_type) = explode(':', $form_state['values']['block_type']);
+	$details = _block_api_get_type($module, $block_type);
+  $delta = $form_state['values']['machine_name'];
+  
+  // Save the data in to the {block_api} table.
+  db_query("INSERT INTO {block_api} (module, delta, block_type, admin_title, settings, storage) VALUES ('%s', '%s', '%s', '%s', '%s', %d)", $module, $delta, $block_type, $form_state['values']['admin_name'], serialize($form_state['values']), $details['storage']);
+  
+  // Save the block to the {blocks} table. Code copied from the block module.  
+  foreach (list_themes() as $key => $theme) {
+    if ($theme->status) {
+      db_query("INSERT INTO {blocks} (visibility, pages, custom, title, module, theme, status, weight, delta, cache) VALUES(%d, '%s', %d, '%s', '%s', '%s', %d, %d, '%s', %d)", 0, '', 0, '', $module, $theme->name, 0, 0, $delta, BLOCK_NO_CACHE);
+    }
+  }
+
+  drupal_set_message(t('The block has been created.'));
+  cache_clear_all();
+  
+  // As a backup in case of problems we redirect back to the blocks admin page, this should never happen.
+  $redirect = 'admin/build/block';
+  if ($module && $delta) $redirect = 'admin/build/block/configure/'. $module .'/'. $delta;
+  $form_state['redirect'] = $redirect;
+  return;
+}
diff --git html_block/html_block.info html_block/html_block.info
index 3402c79..df73cac 100644
--- html_block/html_block.info
+++ html_block/html_block.info
@@ -1,6 +1,6 @@
-; $Id$

-

-name = "HTML Block"

-description = "An example module which replaces the exact functionality of the core Block module to show you how the API works."

-core = 6.x

-dependencies[] = block_api

+; $Id$
+
+name = "HTML Block"
+description = "An example module which replaces the exact functionality of the core Block module to show you how the API works."
+core = 6.x
+dependencies[] = block_api
diff --git html_block/html_block.module html_block/html_block.module
index bd34486..73467f2 100644
--- html_block/html_block.module
+++ html_block/html_block.module
@@ -1,41 +1,41 @@
-<?php

-// $Id$

-

-function html_block_block_api_info() {

-  $types['html'] = array(

-    'title' => t('HTML Block'),

-    'description' => t('Create a basic block containing HTML code.'),

-    'storage' => BLOCK_API_STORAGE_DATABASE,

-  );

-  return $types;

-}

-

-function html_block_block($op = 'list', $delta = NULL, $edit = array()) {

-  $function = 'block_api_block_'. $op;

-  return $function('html_block', $delta, $edit);

-}

-

-function html_block_block_api_form($config, $edit) {

-  if ($config['block_type'] == 'html') {

-    $form['block_body']['body'] = array(

-      '#type' => 'textarea',

-      '#title' => t('Block body'),

-      '#description' => t('The content of the block as shown to the user.'),

-      '#rows' => 15,

-      '#required' => TRUE,

-      '#default_value' => $config['settings']['body'],

-    );

-    if (!isset($config['settings']['format'])) {

-      $config['settings']['format'] = FILTER_FORMAT_DEFAULT;

-    }

-    $form['block_body']['format'] = filter_form($config['settings']['format']);

-  }

-  return $form;

-}

-

-function html_block_block_api_view($config) {

-  if ($config['block_type'] == 'html') {

-    $output .= $config['settings']['body'];

-  }

-  return array('content' => $output);

-}

+<?php
+// $Id$
+
+function html_block_block_api_info() {
+  $types['html'] = array(
+    'title' => t('HTML Block'),
+    'description' => t('Create a basic block containing HTML code.'),
+    'storage' => BLOCK_API_STORAGE_DATABASE,
+  );
+  return $types;
+}
+
+function html_block_block($op = 'list', $delta = NULL, $edit = array()) {
+  $function = 'block_api_block_'. $op;
+  return $function('html_block', $delta, $edit);
+}
+
+function html_block_block_api_form($config, $edit) {
+  if ($config['block_type'] == 'html') {
+    $form['block_body']['body'] = array(
+      '#type' => 'textarea',
+      '#title' => t('Block body'),
+      '#description' => t('The content of the block as shown to the user.'),
+      '#rows' => 15,
+      '#required' => TRUE,
+      '#default_value' => $config['settings']['body'],
+    );
+    if (!isset($config['settings']['format'])) {
+      $config['settings']['format'] = FILTER_FORMAT_DEFAULT;
+    }
+    $form['block_body']['format'] = filter_form($config['settings']['format']);
+  }
+  return $form;
+}
+
+function html_block_block_api_view($config) {
+  if ($config['block_type'] == 'html') {
+    $output .= $config['settings']['body'];
+  }
+  return array('content' => $output);
+}
