You are here

function mailsystem_system_info_alter in Mail System 7.3

Implements hook_system_info_alter().

Prevent the module from being disabled while the mail_system variable is still using the MailsystemDelegateMailSystem class.

File

./mailsystem.module, line 446
Provide UI for controlling the mail_system variable.

Code

function mailsystem_system_info_alter(&$info, $file, $type) {
  if ($type == 'module' && $file->name == 'mailsystem') {
    $mail_system = mailsystem_get();
    foreach ($mail_system as $key => $class) {
      if ($class == 'MailsystemDelegateMailSystem') {
        $info['required'] = TRUE;
        $info['explanation'] = t('<em>Mail System</em> cannot be disabled until each custom setting on its <a href="@url">configure page</a> is either removed, or uses the same class for both its formatting and delivery class.', array(
          '@url' => url('admin/config/system/mailsystem'),
        ));
      }
    }
  }
}