You are here

function spam_load_inc_files in Spam 6

Load the inc files for the various content types.

1 call to spam_load_inc_files()
spam.module in ./spam.module
Spam module, v3 Copyright(c) 2006-2008 Jeremy Andrews <jeremy@tag1consulting.com>. All rights reserved.

File

./spam.module, line 956
Spam module, v3 Copyright(c) 2006-2008 Jeremy Andrews <jeremy@tag1consulting.com>. All rights reserved.

Code

function spam_load_inc_files() {
  $path = drupal_get_path('module', 'spam') . '/content';

  // These files must be names spam_content_*.inc, such as spam_content_node.inc.
  $files = drupal_system_listing('spam_content_.*\\.inc$', $path, 'name', 0);
  foreach ($files as $file) {
    $module = substr_replace($file->name, '', 0, 13);
    if (module_exists($module)) {
      require_once './' . $file->filename;
    }
  }
}