summaryrefslogtreecommitdiffstats
path: root/print_mail
diff options
context:
space:
mode:
authorJoao Ventura2012-05-10 14:04:52 +0000
committerJoao Ventura2012-05-10 15:42:50 +0000
commitde7501f9dd4605c2f02528a5d3c0f99b99cde6d4 (patch)
treed934d40aca14341178a63a6f6be961d240f0bca7 /print_mail
parentee50bd2c2ec4acafcfd241a9ece8d759281ff54e (diff)
Issue #1372180: add warning in status report for incompatible mailsystem settings.
Diffstat (limited to 'print_mail')
-rw-r--r--print_mail/print_mail.install9
-rw-r--r--print_mail/print_mail.module25
2 files changed, 34 insertions, 0 deletions
diff --git a/print_mail/print_mail.install b/print_mail/print_mail.install
index 67082cb..8045cfc 100644
--- a/print_mail/print_mail.install
+++ b/print_mail/print_mail.install
@@ -28,6 +28,15 @@ function print_mail_enable() {
}
/**
+ * Implements hook_disable().
+ */
+function print_mail_disable() {
+ if (module_exists('mailsystem')) {
+ mailsystem_clear(array('print_mail' => ''));
+ }
+}
+
+/**
* Implements hook_uninstall().
*/
function print_mail_uninstall() {
diff --git a/print_mail/print_mail.module b/print_mail/print_mail.module
index b966dcf..54b2e5a 100644
--- a/print_mail/print_mail.module
+++ b/print_mail/print_mail.module
@@ -93,6 +93,31 @@ function print_mail_menu() {
}
/**
+ * 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().
*/
function print_mail_block_info() {