You are here

function mailsystem_clear in Mail System 7.3

Same name and namespace in other branches
  1. 8 mailsystem.module \mailsystem_clear()
  2. 8.2 mailsystem.module \mailsystem_clear()
  3. 6.2 mailsystem.module \mailsystem_clear()
  4. 6 mailsystem.module \mailsystem_clear()
  5. 7 mailsystem.module \mailsystem_clear()
  6. 7.2 mailsystem.module \mailsystem_clear()

Helps other modules safely remove their settings from mail_system.

Function should be called from the other module's hook_disable() function.

Parameters

array $setting: An associative array ($module => $classname) describing a module and associated MailSystemInterface class that are being disabled.

  • $module is the machine-readable module name.
  • $classname is a class that implements MailSystemInterface.

If $classname is empty, only the $module entry is removed.

1 call to mailsystem_clear()
mailsystem_admin_remove_setting_submit in ./mailsystem.admin.inc
Form API submit callback: Remove a custom setting.

File

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

Code

function mailsystem_clear(array $setting) {
  variable_set('mail_system', array_merge(mailsystem_defaults(), array_diff_key(array_diff(mailsystem_get(), $setting), $setting)));
  foreach (array_keys($setting) as $key) {
    variable_del("mailsystem_delegate:{$key}");
  }
}