You are here

function messaging_method_disable in Messaging 6

Same name and namespace in other branches
  1. 6.4 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

6 calls to messaging_method_disable()
messaging_mail_disable in messaging_mail/messaging_mail.module
Implementation of hook_disable()
messaging_mime_mail_disable in messaging_mime_mail/messaging_mime_mail.module
Implementation of hook_disable()
messaging_phpmailer_disable in messaging_phpmailer/messaging_phpmailer.install
Implementation of hook_disable()
messaging_privatemsg_disable in messaging_privatemsg/messaging_privatemsg.module
Implementation of hook_disable()
messaging_simple_disable in messaging_simple/messaging_simple.module
Implementation of hook_disable()

... See full list

File

./messaging.module, line 865

Code

function messaging_method_disable($method) {
  module_load_include('install', 'messaging');
  if ($replace = messaging_update_method_replace($method)) {
    messaging_update_method_disable($method, $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');
  }
}