### Eclipse Workspace Patch 1.0 #P mimemail Index: includes/mimemail.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mimemail/includes/mimemail.admin.inc,v retrieving revision 1.1 diff -u -r1.1 mimemail.admin.inc --- includes/mimemail.admin.inc 22 Feb 2009 20:55:46 -0000 1.1 +++ includes/mimemail.admin.inc 15 Aug 2010 16:27:34 -0000 @@ -26,6 +26,15 @@ } } + // Check for the existence of a mail.css file in the current theme folder. + $theme = variable_get('theme_default', NULL); + $mailstyle = drupal_get_path('theme', $theme) . '/mail.css'; + // Disable site style sheets including option if found. + if (is_file($mailstyle)) { + variable_set('mimemail_sitestyle', 0); + $disable_sitestyle = TRUE; + } + $engines = mimemail_get_engines(); $form = array(); @@ -44,6 +53,15 @@ '#description' => t('Use the mime mail module to deliver all site messages. With this option, system emails will have styles and formatting'), ); + // Optional including of site style sheets. + $form['mimemail']['mimemail_sitestyle'] = array( + '#type' => 'checkbox', + '#title' => t('Include site style sheets'), + '#default_value' => variable_get('mimemail_sitestyle', 0), + '#description' => t('Gather all style sheets when no mail.css found in the default theme directory.'), + '#disabled' => $disable_sitestyle, + ); + $filter_format = variable_get('mimemail_format', FILTER_FORMAT_DEFAULT); $form['mimemail']['mimemail_format'] = filter_form($filter_format, NULL, array("mimemail_format")); Index: mimemail.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mimemail/mimemail.install,v retrieving revision 1.2 diff -u -r1.2 mimemail.install --- mimemail.install 1 Jul 2010 17:44:31 -0000 1.2 +++ mimemail.install 15 Aug 2010 16:27:34 -0000 @@ -20,6 +20,7 @@ 'mimemail_incoming', 'mimemail_key', 'mimemail_textonly', + 'mimemail_sitestyle' ); foreach ($variables as $variable) { variable_del($variable); Index: theme/mimemail.theme.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mimemail/theme/mimemail.theme.inc,v retrieving revision 1.6 diff -u -r1.6 mimemail.theme.inc --- theme/mimemail.theme.inc 12 Aug 2010 10:38:02 -0000 1.6 +++ theme/mimemail.theme.inc 15 Aug 2010 16:27:34 -0000 @@ -27,13 +27,16 @@ $theme = variable_get('theme_default', NULL); $mailstyle = drupal_get_path('theme', $theme) .'/mail.css'; + // Check if site style sheets including is enabled. + $sitestyle = variable_get('mimemail_sitestyle', 0); + // Check for the existence of a mail.css file in the current theme folder if (@file_exists($mailstyle)) { $styles = $mailstyle; } - // If no mail.css was found, gather all style sheets - // and embed a version of all style definitions - else { + // If no mail.css was found and the site style sheets including is enabled + // gather all style sheets and embed a version of all style definitions. + else if ($sitestyle) { $styles = preg_replace('|