'HTML Mail',
'!htmlmail' => 'http://drupal.org/project/htmlmail',
'%mailsystem' => 'Mail System',
'!mailsystem' => 'http://drupal.org/project/mailsystem',
);
$result['htmlmail_mailsystem'] = array(
'title' => t('%mailsystem module', $args),
'value' => t('7.x-1.x'),
'description' => t(
'%htmlmail new requires %mailsystem 7.x-2.6 or later. Please download and install a recent version of %mailsystem, then re-enable the %htmlmail module.', $args
),
'severity' => REQUIREMENT_ERROR,
);
return $result;
}
/**
* Implements hook_update_N().
*
* Removes variables that are no longer used.
*/
function htmlmail_update_7200() {
variable_del('htmlmail_header');
variable_del('htmlmail_footer');
variable_del('htmlmail_css');
}
/**
* Implements hook_update_N().
*
* Rename HTMLMailMailSystem to HTMLMailSystem.
*/
function htmlmail_update_7201() {
module_load_include('module', 'mailsystem');
foreach (mailsystem_get() as $name => $value) {
if ($value == 'HTMLMailMailSystem') {
mailsystem_set(array($name => 'HTMLMailSystem'));
}
}
}
/**
* Implements hook_update_N().
*
* Increase module weight so dependent modules get loaded first.
*/
function htmlmail_update_7202() {
db_query("UPDATE {system} SET weight = 10 WHERE type = 'module' AND name = 'htmlmail'");
}
function htmlmail_update_7203() {
if ($requirements = htmlmail_requirements('runtime')) {
$requirement = array_shift($requirements);
throw new DrupalUpdateException($requirement['description']);
}
}
/**
* Implements hook_enable().
*/
function htmlmail_enable() {
module_load_include('module', 'mailsystem');
mailsystem_set(array('htmlmail' => 'HTMLMailSystem'));
}
/**
* Implements hook_disable().
*/
function htmlmail_disable() {
// Check is necessary because a 7.x-1.x to 7.x-2.x upgrade
// may not have mailsystem installed.
if (function_exists('mailsystem_clear')) {
mailsystem_clear(array('htmlmail' => 'HTMLMailSystem'));
}
}
/**
* Implements hook_install().
*/
function htmlmail_install() {
htmlmail_update_7202();
}
/**
* Implements hook_uninstall().
*/
function htmlmail_uninstall() {
db_query("DELETE FROM {variable} WHERE name LIKE 'htmlmail_%'");
cache_clear_all('variables', 'cache');
}