From bd00b181f0a875c9aaa814f7967aa6dc157eaebf Mon Sep 17 00:00:00 2001
From: Eelke Blok <eelke@blokspeed.net>
Date: Sun, 13 Mar 2011 15:41:00 +0100
Subject: [PATCH] Mollom intergation for email.module

---
 code/sites/all/modules/email/email.module |   41 ++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/code/sites/all/modules/email/email.module b/code/sites/all/modules/email/email.module
index c5001ed..5044ef0 100644
--- a/code/sites/all/modules/email/email.module
+++ b/code/sites/all/modules/email/email.module
@@ -351,9 +351,10 @@ function email_mail_page_form($form_state, $node, $field_name, $email) {
   $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Send e-mail'),
-    '#validate' => array('email_mail_page_form_validate'),
     '#submit' => array('email_mail_page_form_submit'),
   );
+  $form['#validate'] = array('email_mail_page_form_validate');
+  
   return $form;
 }
 
@@ -464,3 +465,41 @@ function email_admin_settings() {
   );
   return system_settings_form($form);
 }
+
+/**
+ * Implementation of hook_mollom_form_list()
+ */
+function email_mollom_form_list() {
+  $forms['email_mail_page_form'] = array(
+    'title' => t('Email contact form'),
+  );
+  
+  return $forms;
+}
+
+/**
+ * Implementation of hook_mollom_form_info()
+ */
+function email_mollom_form_info($form_id) {
+  switch ($form_id) {
+    // Mymodule's comment form.
+    case 'email_mail_page_form':
+      $form_info = array(
+        'mode' => MOLLOM_MODE_ANALYSIS,
+        'mail ids' => array('mymodule_comment_mail'),
+        'elements' => array(
+          'mail' => t('Sender e-mail address'),
+          'name' => t('Sender name'),
+          'subject' => t('Subject'),
+          'message' => t('Message'),
+      
+        ),
+        'mapping' => array(
+          'post_title' => 'subject',
+          'author_name' => 'name',
+          'author_mail' => 'mail',
+        ),
+      );
+      return $form_info;
+  }
+}
\ No newline at end of file
-- 
1.7.4.1

