Index: mass_contact.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/mass_contact/mass_contact.module,v
retrieving revision 1.9.2.21
diff -u -r1.9.2.21 mass_contact.module
--- mass_contact.module	12 May 2010 06:12:45 -0000	1.9.2.21
+++ mass_contact.module	25 May 2010 09:18:48 -0000
@@ -1069,6 +1069,11 @@
 
     ////////////////////////////////////////////////////////////
     // Add the field for specifying the body of the message.
+    $form['body_filter'] = array(
+      '#prefix'   => '<div class="body-field-wrapper">',
+      '#suffix'   => '</div>',
+    );
+
     $form['body_filter']['message'] = array(
       '#type'     => 'textarea',
       '#title'    => t('Message'),
@@ -1103,18 +1108,22 @@
       // Check if the user is allowed to override the input format setting.
       if (variable_get('mass_contact_html_format_override', 0)) {
         // The user is allowed, so add that to the form.
-        $form['html_filter']['format'] = filter_form($html_filter_format, NULL, array('mass_contact_html_format'));
+        $form['body_filter']['format'] = filter_form($html_filter_format, NULL, array('mass_contact_html_format'));
       }
       else {
-        // The user is not allowed, so save the setting for later use.
-        $form['html_format'] = array(
-          '#type'  => 'value',
-          '#value' => $html_filter_format,
-        );
-        // Display information to the user.
-        $form['html-info'] = array(
-          '#value' => '<p>'. (variable_get('mass_contact_html_d', 1) ? t('The message will be sent using the !filter input format. More information about what is available is on the <a href="@formats_descriptions">Compose tips</a> page. ', array('!filter' => $html_filter_format_name, '@formats_descriptions' => url('filter/tips'))) : t('The message will be sent as plain text.')) .'</p>',
+        // Only one format available: use a hidden form item and only show tips.
+        $value = filter_resolve_format($html_filter_format);
+        $extra = theme('filter_tips_more_info');
+        $info = '<p>'. (variable_get('mass_contact_html_d', 1) ? t('The message will be sent using the !filter input format. <a href="@formats_descriptions">More information about formatting options</a>. ', array('!filter' => $html_filter_format_name, '@formats_descriptions' => url('filter/tips'))) : t('The message will be sent as plain text.')) .'</p>';
+
+        $force_format[$html_filter_format] = array('#type' => 'value', '#value' => $html_filter_format, '#parents' => array('format'));
+        $tips = _filter_tips($html_filter_format, FALSE);
+        $force_format['format']['guidelines'] = array(
+          '#title' => t('Formatting guidelines'),
+          '#value' => $info . theme('filter_tips', $tips, FALSE, $extra),
         );
+
+        $form['body_filter']['format'] = $force_format;
       }
     }
     else {
@@ -1132,18 +1141,22 @@
           '#value' => '<p>'. (variable_get('mass_contact_html_d', 1) ? t('The message will be sent as HTML.') : t('The message will be sent as plain text.')) .'</p>',
         );
         // The user is allowed, so add that to the form.
-        $form['html_filter']['format'] = filter_form($html_filter_format, NULL, array('mass_contact_html_format'));
+        $form['body_filter']['format'] = filter_form($html_filter_format, NULL, array('mass_contact_html_format'));
       }
       else {
-        // The user is not allowed, so save the setting for later use.
-        $form['html_format'] = array(
-          '#type'  => 'value',
-          '#value' => $html_filter_format,
-        );
-        $form['html-info'] = array(
-        // Display information to the user.
-          '#value' => '<p>'. (variable_get('mass_contact_html_d', 1) ? t('The message will be sent as HTML, using the !filter input format. More information about what is available is on the <a href="@formats_descriptions">Compose tips</a> page. ', array('!filter' => $html_filter_format_name, '@formats_descriptions' => url('filter/tips'))) : t('The message will be sent as plain text.')) .'</p>',
+        // Only one format available: use a hidden form item and only show tips.
+        $value = filter_resolve_format($html_filter_format);
+        $extra = theme('filter_tips_more_info');
+        $info = '<p>'. (variable_get('mass_contact_html_d', 1) ? t('The message will be sent using the !filter input format. <a href="@formats_descriptions">More information about formatting options</a>. ', array('!filter' => $html_filter_format_name, '@formats_descriptions' => url('filter/tips'))) : t('The message will be sent as plain text.')) .'</p>';
+
+        $force_format[$html_filter_format] = array('#type' => 'value', '#value' => $html_filter_format, '#parents' => array('format'));
+        $tips = _filter_tips($html_filter_format, FALSE);
+        $force_format['format']['guidelines'] = array(
+          '#title' => t('Formatting guidelines'),
+          '#value' => $info . theme('filter_tips', $tips, FALSE, $extra),
         );
+
+        $form['body_filter']['format'] = $force_format;
       }
     }
 
