You are here

function htmlmail_get_allowed_themes in HTML Mail 7

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

Returns an associative array of allowed themes. The keys are the machine-readable names and the values are the .info file names. Code shamelessly stolen from the og_theme module.

2 calls to htmlmail_get_allowed_themes()
htmlmail_admin_settings in ./htmlmail.admin.inc
Implements hook_admin_settings().
htmlmail_get_selected_theme in ./htmlmail.module
Returns the selected theme to use for outgoing emails. for use in a theme callback function.

File

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

Code

function htmlmail_get_allowed_themes() {
  $allowed =& drupal_static(__FUNCTION__);
  if (!isset($allowed)) {
    $allowed = array(
      '' => t('No theme'),
    );
    module_load_include('inc', 'system', 'system.admin');
    $themes = list_themes();
    uasort($themes, 'system_sort_modules_by_info_name');
    foreach ($themes as $key => $value) {
      if ($value->status) {
        $allowed[$key] = check_plain($value->info['name']);
      }
    }
  }
  return $allowed;
}