Index: formblock.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/formblock/formblock.module,v
retrieving revision 1.4.2.1
diff -u -F^function -r1.4.2.1 formblock.module
--- formblock.module	30 May 2008 22:10:23 -0000	1.4.2.1
+++ formblock.module	30 Sep 2008 04:09:19 -0000
@@ -31,6 +31,8 @@ function formblock_block($op = 'list', $
       $blocks = array();
       $blocks['user_register'] = array(
         'info' => t('User registration form'));
+      $blocks['contact_site'] = array(
+        'info' => t('Site-wide contact form'));
       foreach (node_get_types('names') as $type => $name) {
         if (variable_get('formblock_expose_'. $type, 0)) {
           $blocks[$type] = array(
@@ -41,18 +43,37 @@ function formblock_block($op = 'list', $
       return $blocks;
 
     case 'view':
-      // Don't display the form to logged in users or if registration is disabled
-      if ($delta == 'user_register') {
-        global $user;
-        if (!$user->uid && variable_get('user_register', 1)) {
-          drupal_add_css(drupal_get_path('module', 'formblock'). '/formblock.css', 'module', 'all');
-          return array(
-            'subject' => t('Create new account'), 
-            'content' => drupal_get_form('user_register')
-          );
-        }
-      } else {
-        return formblock_get_block($delta);
+      switch ($delta) {
+        case 'user_register':
+          global $user;
+          // Don't display the form to logged in users or if registration is disabled
+          if (!$user->uid && variable_get('user_register', 1)) {
+            drupal_add_css(drupal_get_path('module', 'formblock'). '/formblock.css', 'module', 'all');
+            return array(
+              'subject' => t('Create new account'), 
+              'content' => drupal_get_form('user_register')
+            );
+          }
+          break;
+
+        case 'contact_site':
+          if (user_access('access site-wide contact form')) {
+            if (!flood_is_allowed('contact', variable_get('contact_hourly_threshold', 3))) {
+              $content = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold', 3)));
+            }
+            else {
+              module_load_include('inc', 'contact', 'contact.pages');
+              $content = drupal_get_form('contact_mail_page');
+            }
+            return array(
+              'subject' => t('Contact'),
+              'content' => $content,
+            );
+          }
+          break;
+
+        default:
+          return formblock_get_block($delta);
       }
   }
 }
@@ -75,4 +96,4 @@ function formblock_get_block($type) {
       'content' => $form,
     );
   }
-}
\ No newline at end of file
+}
