You are here

function ultimenu_get_settings in Ultimenu 7

A wrapper function for variable_get.

Allows storing variables in one place rather than setting and calling each.

9 calls to ultimenu_get_settings()
theme_ultimenu_link in templates/ultimenu.theme.inc
HTML for a menu link and ultimenu.
ultimenu_admin_settings in includes/ultimenu.admin.inc
Menu callback for 'admin/structure/ultimenu'.
ultimenu_blocks_enabled in includes/ultimenu.utilities.inc
Check for an Ultimenu block enabled by settings.
ultimenu_get_config in includes/ultimenu.utilities.inc
The configuration for the requested block delta.
ultimenu_get_skins in includes/ultimenu.utilities.inc
Retrieves stored CSS files for Ultimenu skins.

... See full list

File

includes/ultimenu.utilities.inc, line 284
Misc functions that hardly change.

Code

function ultimenu_get_settings($setting_name = NULL, $default = NULL) {
  $cache =& drupal_static(__FUNCTION__);
  if (empty($cache)) {
    $settings = variable_get('ultimenu_settings', array());
    if (isset($settings[$setting_name]) && ($setting = $settings[$setting_name]) !== NULL) {
      return $setting;
    }
  }
  else {
    if (isset($cache[$setting_name])) {
      return $cache[$setting_name];
    }
  }
  return $default;
}