static function Messaging_Method::method_disable in Messaging 7
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.
4 calls to Messaging_Method::method_disable()
- messaging_htmlmail_disable in messaging_htmlmail/
messaging_htmlmail.module - Implementation of hook_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_simple_disable in messaging_simple/
messaging_simple.module - Implementation of hook_disable()
File
- ./
messaging.method.inc, line 93 - Drupal Messaging Framework - Send_Method class file
Class
- Messaging_Method
- Base class for all Incoming and Sending methods
Code
static function 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');
}
}