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' => '
'. (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 Compose tips page. ', array('!filter' => $html_filter_format_name, '@formats_descriptions' => url('filter/tips'))) : t('The message will be sent as plain text.')) .'
', + // 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 = ''. (variable_get('mass_contact_html_d', 1) ? t('The message will be sent using the !filter input format. More information about formatting options. ', array('!filter' => $html_filter_format_name, '@formats_descriptions' => url('filter/tips'))) : t('The message will be sent as plain text.')) .'
'; + + $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' => ''. (variable_get('mass_contact_html_d', 1) ? t('The message will be sent as HTML.') : t('The message will be sent as plain text.')) .'
', ); // 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' => ''. (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 Compose tips page. ', array('!filter' => $html_filter_format_name, '@formats_descriptions' => url('filter/tips'))) : t('The message will be sent as plain text.')) .'
', + // 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 = ''. (variable_get('mass_contact_html_d', 1) ? t('The message will be sent using the !filter input format. More information about formatting options. ', array('!filter' => $html_filter_format_name, '@formats_descriptions' => url('filter/tips'))) : t('The message will be sent as plain text.')) .'
'; + + $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; } }