function at_get_setting

cis7 get.inc at_get_setting($setting_name, $theme = NULL)
cle7 get.inc at_get_setting($setting_name, $theme = NULL)
elmsmedia7 get.inc at_get_setting($setting_name, $theme = NULL)
icor7 get.inc at_get_setting($setting_name, $theme = NULL)
meedjum_blog7 get.inc at_get_setting($setting_name, $theme = NULL)
mooc7 get.inc at_get_setting($setting_name, $theme = NULL)

Retrieve a setting for the current theme or for a given theme.

AT's stripped down optimized version of theme_get_setting(). Why? Because it wayfasterbetter, emphasis on the faster which is really the only valid reason to do something as stupid as this, and it is faster, considerably faster. Doing this wiped 100ms off page generation time.

Parameters

$setting_name:

null $theme:

See also

http://api.drupal.org/api/drupal/includes!theme.inc/function/theme_get_s...

55 calls to at_get_setting()
adaptivetheme_breadcrumb in sites/all/themes/ulmus/adaptivetheme/at_core/inc/theme.inc
Returns HTML for a breadcrumb trail.
adaptivetheme_css_alter in sites/all/themes/ulmus/adaptivetheme/at_core/inc/alter.inc
hook_css_alter()
adaptivetheme_field__image in sites/all/themes/ulmus/adaptivetheme/at_core/inc/theme.inc
Returns HTML for an image field.
adaptivetheme_form_search_form_alter in sites/all/themes/ulmus/adaptivetheme/at_core/inc/alter.inc
hook_form_FORM_ID_alter() Modify the Advanced Search Form
adaptivetheme_form_system_theme_settings_alter in sites/all/themes/ulmus/adaptivetheme/at_core/theme-settings.php
@file Implimentation of hook_form_system_theme_settings_alter()

... See full list

File

sites/all/themes/ulmus/adaptivetheme/at_core/inc/get.inc, line 21
Provides frequently used functions that get theme info, settings and other data.

Code

function at_get_setting($setting_name, $theme = NULL) {
  $cache = &drupal_static(__FUNCTION__, array());

  // If no key is given, use the current theme if we can determine it.
  if (!isset($theme)) {
    $theme = !empty($GLOBALS['theme_key']) ? $GLOBALS['theme_key'] : '';
  }

  if (empty($cache[$theme])) {

    // Get the values for the theme-specific settings from the .info files
    if ($theme) {
      $themes = list_themes();
      $theme_object = $themes[$theme];

      // Create a list which includes the current theme and all its base themes.
      if (isset($theme_object->base_themes)) {
        $theme_keys = array_keys($theme_object->base_themes);
        $theme_keys[] = $theme;
      }
      else {
        $theme_keys = array($theme);
      }

      foreach ($theme_keys as $theme_key) {
        if (!empty($themes[$theme_key]->info['settings'])) {
          $cache[$theme] = $themes[$theme_key]->info['settings'];
        }
      }

      // Get the saved theme-specific settings from the database.
      $cache[$theme] = array_merge($cache[$theme], variable_get('theme_' . $theme . '_settings', array()));
    }
  }

  return isset($cache[$theme][$setting_name]) ? $cache[$theme][$setting_name] : NULL;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.