updated rules

This commit is contained in:
2020-06-23 12:29:12 +02:00
parent 35b78db5c0
commit da7085e201
72 changed files with 2402 additions and 1060 deletions
@@ -1,7 +1,8 @@
<?php
/**
* @file Includes any rules integration provided by the module.
* @file
* Includes any rules integration provided by the module.
*/
/**
@@ -20,13 +21,22 @@ foreach (rules_core_modules() as $module) {
* for providing some general stuff.
*/
function rules_core_modules() {
$return = array('data', 'entity', 'node', 'system', 'user', 'rules_core');
foreach (array('comment', 'taxonomy', 'php', 'path') as $module) {
if (module_exists($module)) {
$return[] = $module;
// Make use of the fast, advanced drupal static pattern.
static $drupal_static_fast;
if (!isset($drupal_static_fast)) {
$drupal_static_fast = &drupal_static(__FUNCTION__);
}
$modules = &$drupal_static_fast;
if (!isset($modules)) {
$modules = array('data', 'entity', 'node', 'system', 'user', 'rules_core');
foreach (array('comment', 'taxonomy', 'php', 'path') as $module) {
if (module_exists($module)) {
$modules[] = $module;
}
}
}
return $return;
return $modules;
}
/**
@@ -46,12 +56,20 @@ function _rules_rules_collect_items($hook) {
* Implements hook_rules_file_info().
*/
function rules_rules_file_info() {
$items = array();
foreach (rules_core_modules() as $module) {
if (function_exists($function = "rules_{$module}_file_info")) {
$items = array_merge($items, (array)$function());
// Automatically add "$module.rules.inc" for each module.
$items[] = 'modules/' . $module . '.rules';
// Make use of the fast, advanced drupal static pattern.
static $drupal_static_fast;
if (!isset($drupal_static_fast)) {
$drupal_static_fast = &drupal_static(__FUNCTION__);
}
$items = &$drupal_static_fast;
if (!isset($items)) {
$items = array();
foreach (rules_core_modules() as $module) {
if (function_exists($function = "rules_{$module}_file_info")) {
$items = array_merge($items, (array) $function());
// Automatically add "$module.rules.inc" for each module.
$items[] = 'modules/' . $module . '.rules';
}
}
}
return $items;