You are here

function _asset_include in Asset 5

Same name and namespace in other branches
  1. 6 inc/asset.routines.inc \_asset_include()
1 call to _asset_include()
asset.module in ./asset.module

File

./asset.module, line 6

Code

function _asset_include() {

  // get the path once
  $path = drupal_get_path('module', 'asset');

  // load the views hooks if the views module is enabled
  if (module_exists('views')) {
    require_once $path . '/asset_views.inc';
  }

  // Load all our module 'on behalfs'.
  $files = drupal_system_listing('asset_.*\\.inc$', $path . '/modules', 'name', 0);
  foreach ($files as $file) {

    // The filename format is very specific. It must be asset_MODULENAME.inc
    $module = substr_replace($file->name, '', 0, 6);
    if (module_exists($module)) {
      require_once "./{$file->filename}";
    }
  }
}