You are here

function better_statistics_load_active_incs in Better Statistics 7

Loads module.statistics.inc files for all active fields.

2 calls to better_statistics_load_active_incs()
better_statistics_ajax_handler in ./better_statistics.ajax.inc
Handles Better Statistics AJAX POST requests.
better_statistics_exit in ./better_statistics.module
Implements hook_exit().

File

./better_statistics.module, line 352
Drupal hook implementations for the Better Statistics module.

Code

function better_statistics_load_active_incs() {

  // Prevent this function from loading it multiple times.
  static $loaded;
  if (empty($loaded)) {
    $loaded = TRUE;

    // Include this module's API file because of how core fields are implemented.
    require_once dirname(__FILE__) . '/better_statistics.statistics.inc';

    // Loop through each file stored in the active incs list and include it.
    // These are stored in a variable rather than being assembled dynamically
    // due to the nature of cached pages and their bootstrap status.
    $incs = variable_get('better_statistics_active_incs', array());
    foreach ($incs as $file) {

      // If there's an inc file and it hasn't been loaded yet, load it.
      if (file_exists($file)) {
        require_once $file;
      }
    }
  }
}