Révision 950416da
Ajouté par Assos Assos il y a plus de 5 ans
drupal7/sites/all/modules/rules/rules.features.inc | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* Provides Features integration for the Rules module, based upon the features |
|
6 |
* integration provided by the Entity API. |
|
5 |
* Provides Features integration for the Rules module. |
|
6 |
* |
|
7 |
* This code is based upon the features integration provided by the Entity API. |
|
7 | 8 |
*/ |
8 | 9 |
|
9 |
|
|
10 | 10 |
/** |
11 | 11 |
* Controller handling the features integration. |
12 | 12 |
*/ |
... | ... | |
24 | 24 |
|
25 | 25 |
/** |
26 | 26 |
* Generates the result for hook_features_export(). |
27 |
* Overridden to add in rules specific stuff. |
|
27 |
* |
|
28 |
* Overridden to add in rules-specific stuff. |
|
28 | 29 |
*/ |
29 | 30 |
public function export($data, &$export, $module_name = '') { |
30 | 31 |
$pipe = parent::export($data, $export, $module_name); |
... | ... | |
34 | 35 |
// Add in plugin / element specific additions. |
35 | 36 |
$iterator = new RecursiveIteratorIterator($rules_config, RecursiveIteratorIterator::SELF_FIRST); |
36 | 37 |
foreach ($iterator as $element) { |
37 |
if ($element->facesAs('RulesPluginFeaturesIntegrationInterace')) { |
|
38 |
// Directly use __call() so we cann pass $export by reference.
|
|
38 |
if ($element->facesAs('RulesPluginFeaturesIntegrationInterface')) {
|
|
39 |
// Directly use __call() so we can pass $export by reference. |
|
39 | 40 |
$element->__call('features_export', array(&$export, &$pipe, $module_name)); |
40 | 41 |
} |
41 | 42 |
} |
42 | 43 |
} |
43 | 44 |
return $pipe; |
44 | 45 |
} |
46 |
|
|
45 | 47 |
} |
46 | 48 |
|
47 | 49 |
/** |
48 | 50 |
* Default extension callback used as default for the abstract plugin class. |
49 |
* Actions / conditions may override this with their own implementation, which |
|
51 |
* |
|
52 |
* Actions and conditions may override this with an implementation which |
|
50 | 53 |
* actually does something. |
51 | 54 |
* |
52 |
* @see RulesPluginFeaturesIntegrationInterace |
|
55 |
* @see RulesPluginFeaturesIntegrationInterface
|
|
53 | 56 |
*/ |
54 | 57 |
function rules_features_abstract_default_features_export(&$export, &$pipe, $module_name = '', $element) { |
55 |
|
|
58 |
// Do nothing. |
|
56 | 59 |
} |
57 | 60 |
|
58 | 61 |
/** |
62 |
* Interface to give features access to the faces extensions mechanism. |
|
63 |
* |
|
59 | 64 |
* Interface that allows rules plugins or actions/conditions to customize the |
60 | 65 |
* features export by implementing the interface using the faces extensions |
61 | 66 |
* mechanism. |
... | ... | |
63 | 68 |
* @see hook_rules_plugin_info() |
64 | 69 |
* @see hook_rules_action_info() |
65 | 70 |
*/ |
66 |
interface RulesPluginFeaturesIntegrationInterace { |
|
71 |
interface RulesPluginFeaturesIntegrationInterface {
|
|
67 | 72 |
|
68 | 73 |
/** |
69 | 74 |
* Allows customizing the features export for a given rule element. |
70 | 75 |
*/ |
71 |
function features_export(&$export, &$pipe, $module_name = ''); |
|
76 |
public function features_export(&$export, &$pipe, $module_name = ''); |
|
77 |
|
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* Interface for backwards compatibility with older versions of Rules. |
|
82 |
* |
|
83 |
* Mis-spelled interface provided so that contributed modules which were |
|
84 |
* implementing the wrong spelling (corrected in Rules 7.x-2.12) will not stop |
|
85 |
* working now that the interface is spelled correctly. |
|
86 |
* |
|
87 |
* @todo Remove this when we can be sure that no contributed modules are |
|
88 |
* still using the wrong spelling. |
|
89 |
*/ |
|
90 |
interface RulesPluginFeaturesIntegrationInterace extends RulesPluginFeaturesIntegrationInterface { |
|
72 | 91 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules