You are here

function _rules_include_get_files in Rules 6

1 call to _rules_include_get_files()
rules_include in rules/rules.module
Includes rules specific include files

File

rules/rules.module, line 974
Rules engine module

Code

function _rules_include_get_files($type) {
  $files = array();
  $rules_path = drupal_get_path('module', 'rules');
  if ($type == 'rules') {

    //make sure this is included before, as it contains some base classes
    $files[] = $rules_path . '/rules.data_types.inc';
    $files[] = $rules_path . '/rules.variables.inc';
    $files[] = $rules_path . '/rules.input_evaluators.inc';
  }
  foreach (module_list() as $module) {
    $module_path = drupal_get_path('module', $module);
    if (file_exists("{$module_path}/{$module}.{$type}.inc")) {
      $files[] = "./{$module_path}/{$module}.{$type}.inc";
    }
    else {
      if (file_exists("{$module_path}/includes/{$module}.{$type}.inc")) {
        $files[] = "./{$module_path}/includes/{$module}.{$type}.inc";
      }
      else {
        if (file_exists("{$rules_path}/modules/{$module}.{$type}.inc")) {
          $files[] = "./{$rules_path}/modules/{$module}.{$type}.inc";
        }
      }
    }
  }
  return $files;
}