You are here

function htmlmail_get_selected_theme in HTML Mail 7

Same name and namespace in other branches
  1. 8.2 htmlmail.module \htmlmail_get_selected_theme()
  2. 6.2 htmlmail.module \htmlmail_get_selected_theme()
  3. 7.2 htmlmail.module \htmlmail_get_selected_theme()

Returns the selected theme to use for outgoing emails. for use in a theme callback function.

1 call to htmlmail_get_selected_theme()
HTMLMailMailSystem::format in ./htmlmail.mail.inc
Format emails according to module settings.
1 string reference to 'htmlmail_get_selected_theme'
htmlmail_menu in ./htmlmail.module
Implements hook_menu().

File

./htmlmail.module, line 159
Send system emails in HTML.

Code

function htmlmail_get_selected_theme(&$selected = NULL) {
  if (!isset($selected)) {
    $selected = variable_get('htmlmail_theme', '');
  }

  // Make sure the selected theme is allowed.
  $themes = htmlmail_get_allowed_themes();
  if (isset($themes[$selected])) {
    return $selected;
  }

  // If a theme was specified but not allowed, fall back to site defaults.
  return $GLOBALS['theme'];
}