updated rules

This commit is contained in:
2021-07-12 09:49:00 +02:00
parent 7b1e954f7f
commit fd5d68d5e9
75 changed files with 5254 additions and 1335 deletions

View File

@@ -2,11 +2,11 @@
/**
* @file
* Provides Features integration for the Rules module, based upon the features
* integration provided by the Entity API.
* Provides Features integration for the Rules module.
*
* This code is based upon the features integration provided by the Entity API.
*/
/**
* Controller handling the features integration.
*/
@@ -24,7 +24,8 @@ class RulesFeaturesController extends EntityDefaultFeaturesController {
/**
* Generates the result for hook_features_export().
* Overridden to add in rules specific stuff.
*
* Overridden to add in rules-specific stuff.
*/
public function export($data, &$export, $module_name = '') {
$pipe = parent::export($data, $export, $module_name);
@@ -34,28 +35,32 @@ class RulesFeaturesController extends EntityDefaultFeaturesController {
// Add in plugin / element specific additions.
$iterator = new RecursiveIteratorIterator($rules_config, RecursiveIteratorIterator::SELF_FIRST);
foreach ($iterator as $element) {
if ($element->facesAs('RulesPluginFeaturesIntegrationInterace')) {
// Directly use __call() so we cann pass $export by reference.
if ($element->facesAs('RulesPluginFeaturesIntegrationInterface')) {
// Directly use __call() so we can pass $export by reference.
$element->__call('features_export', array(&$export, &$pipe, $module_name));
}
}
}
return $pipe;
}
}
/**
* Default extension callback used as default for the abstract plugin class.
* Actions / conditions may override this with their own implementation, which
*
* Actions and conditions may override this with an implementation which
* actually does something.
*
* @see RulesPluginFeaturesIntegrationInterace
* @see RulesPluginFeaturesIntegrationInterface
*/
function rules_features_abstract_default_features_export(&$export, &$pipe, $module_name = '', $element) {
// Do nothing.
}
/**
* Interface to give features access to the faces extensions mechanism.
*
* Interface that allows rules plugins or actions/conditions to customize the
* features export by implementing the interface using the faces extensions
* mechanism.
@@ -63,10 +68,24 @@ function rules_features_abstract_default_features_export(&$export, &$pipe, $modu
* @see hook_rules_plugin_info()
* @see hook_rules_action_info()
*/
interface RulesPluginFeaturesIntegrationInterace {
interface RulesPluginFeaturesIntegrationInterface {
/**
* Allows customizing the features export for a given rule element.
*/
function features_export(&$export, &$pipe, $module_name = '');
public function features_export(&$export, &$pipe, $module_name = '');
}
/**
* Interface for backwards compatibility with older versions of Rules.
*
* Mis-spelled interface provided so that contributed modules which were
* implementing the wrong spelling (corrected in Rules 7.x-2.12) will not stop
* working now that the interface is spelled correctly.
*
* @todo Remove this when we can be sure that no contributed modules are
* still using the wrong spelling.
*/
interface RulesPluginFeaturesIntegrationInterace extends RulesPluginFeaturesIntegrationInterface {
}