You are here

function quant_get_quants in Quant 6

Same name and namespace in other branches
  1. 7 quant.module \quant_get_quants()

Fetch all available quants

2 calls to quant_get_quants()
quant_admin_settings in includes/forms.inc
Provide admin settings form
quant_page in includes/pages.inc
The analytics page callback

File

./quant.module, line 83

Code

function quant_get_quants() {
  static $quants = array();

  // Act if the static cache is not yet populated
  if (empty($quants)) {

    // Check the cache table next
    $cache_key = 'quants';
    $cache = cache_get($cache_key);

    // See if the cache has data
    if (isset($cache->data)) {

      // Use the cached tree
      $quants = $cache->data;
    }
    else {

      // Invoke the hooks
      $quants = module_invoke_all('quants');

      // Allow modules to alter the quants
      drupal_alter('quants', $quants);

      // Cache the quants
      cache_set($cache_key, $quants);
    }
  }
  return $quants;
}