Commit de7501f9 authored by jcnventura's avatar jcnventura

Issue #1372180: add warning in status report for incompatible mailsystem settings.

parent ee50bd2c
......@@ -27,6 +27,15 @@ function print_mail_enable() {
}
}
/**
* Implements hook_disable().
*/
function print_mail_disable() {
if (module_exists('mailsystem')) {
mailsystem_clear(array('print_mail' => ''));
}
}
/**
* Implements hook_uninstall().
*/
......
......@@ -92,6 +92,31 @@ function print_mail_menu() {
return $items;
}
/**
* Implements hook_requirements().
*/
function print_mail_requirements($phase) {
$requirements = array();
$t = get_t();
switch ($phase) {
// At runtime, make sure that a PDF generation tool is selected
case 'runtime':
if (module_exists('mailsystem')) {
$mail_system = mailsystem_get();
if (!isset($mail_system['print_mail']) || ($mail_system['print_mail'] != 'DefaultMailSystem')) {
$requirements['print_mail_mailsystem'] = array(
'title' => $t('Printer, email and PDF versions - Send by email'),
'value' => $t('Incompatible Mail System setting detected'),
'description' => $t('The send by email module requires the use of the DefaultMailSystem, please configure it in the !url.', array('!url' => l($t('Mail System Settings page'), 'admin/config/system/mailsystem'))),
'severity' => REQUIREMENT_WARNING,
);
}
}
}
return $requirements;
}
/**
* Implements hook_block_info().
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment