You are here

function messaging_method_disable in Messaging 6.4

Same name and namespace in other branches
  1. 6 messaging.module \messaging_method_disable()
  2. 6.2 messaging.module \messaging_method_disable()
  3. 6.3 messaging.module \messaging_method_disable()

Update messaging method.

When a messaging method is disabled, we need to update current settings for this and other modues

Parameters

$method: Method to disable

$replace: Optional replacement method suggested by the disabled one.

7 calls to messaging_method_disable()
messaging_mail_disable in messaging_mail/messaging_mail.module
Implementation of hook_disable()
Messaging_Methods_Tests::testMessagingMethods in tests/messaging_methods.test
Test message sending callbacks for enabled plug-ins
messaging_mime_mail_disable in messaging_mime_mail/messaging_mime_mail.module
Implementation of hook_disable()
messaging_phpmailer_disable in messaging_phpmailer/messaging_phpmailer.module
Implementation of hook_disable()
messaging_privatemsg_disable in messaging_privatemsg/messaging_privatemsg.module
Implementation of hook_disable()

... See full list

File

./messaging.module, line 641

Code

function messaging_method_disable($method, $replace = NULL) {
  module_load_include('install', 'messaging');
  $replace = isset($replace) ? $replace : messaging_update_method_replace($method, TRUE);
  messaging_update_method_disable($method, $replace);
  if ($replace) {
    drupal_set_message(t('Disabled messaging sending method %method and replaced by %replace', array(
      '%method' => messaging_method_info($method, 'title'),
      '%replace' => messaging_method_info($replace, 'title'),
    )));
  }
  else {

    // It seems all methods are disabled, print warning
    drupal_set_message(t('Disabled messaging sending method but cannot find a replacement. Please, enable some other sending method.'), 'error');
  }
}