You are here

function htmlmail_get_allowed_themes in HTML Mail 7.2

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 htmlmail.module \htmlmail_get_allowed_themes()

Returns an associative array of allowed themes.

Based on code from the og_theme module.

Return value

array The keys are the machine-readable names and the values are the .info file names.

2 calls to htmlmail_get_allowed_themes()
htmlmail_admin_settings in ./htmlmail.admin.inc
Form constructor for the admin settings form.
htmlmail_get_selected_theme in ./htmlmail.module
Returns the selected theme to use for outgoing emails.

File

./htmlmail.module, line 199
Sends system emails in HTML.

Code

function &htmlmail_get_allowed_themes() {
  $allowed =& drupal_static(__FUNCTION__);
  if (!isset($allowed)) {
    $allowed = array(
      '' => t('No theme'),
    );
    $themes = list_themes();
    module_load_include('inc', 'system', 'system.admin');
    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;
}