Skip to content

Instantly share code, notes, and snippets.

@pounard
Created February 3, 2015 11:12
Show Gist options
  • Save pounard/6f620cc38063d1a652d1 to your computer and use it in GitHub Desktop.
Save pounard/6f620cc38063d1a652d1 to your computer and use it in GitHub Desktop.
mimemail-7.x-1.0-beta1 -mailsystem
diff -urN mimemail.orig//mimemail.info mimemail//mimemail.info
--- mimemail.orig//mimemail.info 2015-01-12 12:06:10.000000000 +0100
+++ mimemail//mimemail.info 2015-01-12 12:08:23.000000000 +0100
@@ -1,6 +1,5 @@
name = Mime Mail
description = Send MIME-encoded emails with embedded images and attachments.
-dependencies[] = mailsystem
package = Mail
core = 7.x
diff -urN mimemail.orig//mimemail.install mimemail//mimemail.install
--- mimemail.orig//mimemail.install 2015-01-12 12:06:10.000000000 +0100
+++ mimemail//mimemail.install 2015-01-12 12:09:08.000000000 +0100
@@ -13,23 +13,9 @@
}
/**
- * Implements hook_enable().
- */
-function mimemail_enable() {
- module_load_include('module', 'mailsystem');
- mailsystem_set(
- array(
- mailsystem_default_id() => 'MimeMailSystem',
- 'mimemail' => 'MimeMailSystem',
- )
- );
-}
-
-/**
* Implements hook_disable().
*/
function mimemail_disable() {
- mailsystem_clear(array('mimemail' => 'MimeMailSystem'));
variable_set('mimemail_alter', FALSE);
}
@@ -57,51 +43,6 @@
}
}
-/**
- * Implements hook_requirements().
- *
- * Ensures that the newly-required Mail System module is available, or else
- * disables the Mime Mail module and returns an informative error message.
- */
-function mimemail_requirements($phase) {
- if ($phase === 'install' || module_exists('mailsystem')) {
- return array();
- }
- $args = array(
- '!mailsystem' => url('http://drupal.org/project/mailsystem'),
- '%mailsystem' => 'Mail System',
- '!mimemail' => url('http://drupal.org/project/mimemail'),
- '%mimemail' => 'Mime Mail',
- );
- if ( module_enable(array('mailsystem'))
- && module_load_include('module', 'mailsystem')
- ) {
- drupal_set_message(
- t('The %mailsystem module has been enabled because the %mimemail module now requires it.', $args)
- );
- return array();
- }
- return array(
- 'mimemail_mailsystem' => array(
- 'title' => t('%mailsystem module', $args),
- 'value' => t('Not installed'),
- 'description' => t(
- 'The <a href="!smtp">%mimemail</a> module dependencies have changed. Please download and install the required <a href="!mailsystem">%mailsystem</a> module, then re-enable the <a href="!mimemail">%mimemail</a> module.', $args
- ),
- 'severity' => REQUIREMENT_ERROR,
- ),
- );
-}
-
-/**
- * Check installation requirements.
- */
-function mimemail_update_7000() {
- if ($requirements = mimemail_requirements('runtime')) {
- throw new DrupalUpdateException($requirements['mimemail_mailsystem']['description']);
- }
-}
-
/**
* Deletes useless variables.
*/
diff -urN mimemail.orig//theme/mimemail.theme.inc mimemail//theme/mimemail.theme.inc
--- mimemail.orig//theme/mimemail.theme.inc 2015-01-12 12:06:10.000000000 +0100
+++ mimemail//theme/mimemail.theme.inc 2015-01-12 12:08:12.000000000 +0100
@@ -32,7 +32,7 @@
* @see mimemail-message.tpl.php
*/
function template_preprocess_mimemail_message(&$variables) {
- $theme = mailsystem_get_mail_theme();
+ $theme = $theme = variable_get('theme_default', variable_get('mimemail_mail_theme', NULL));
$themepath = drupal_get_path('theme', $theme);
$sitestyle = variable_get('mimemail_sitestyle', 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment