-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolas-2445-entity-translations.patch
68 lines (65 loc) · 2.52 KB
/
solas-2445-entity-translations.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
diff --git a/eck.features.inc b/eck.features.inc
index 2fb9c69..938a941 100644
--- a/eck.features.inc
+++ b/eck.features.inc
@@ -33,7 +33,7 @@ function eck_entity_type_features_export($data, &$export, $module_name = '') {
$export['features']['eck_entity_type'][$entity_type] = $entity_type;
$export['dependencies']['eck_entity_type'] = 'eck';
//@TODO we need to add dependencies on the modules implementing the property behaviors
- //currently they are all implemented by ECK but in the future, people might have their custom
+ //currently they are all implemented by ECK but in the future, people might have their custom
//behaviors.. or we might have behaviors provided by contrib.
$export['dependencies']['features'] = 'features';
}
@@ -61,7 +61,7 @@ function eck_entity_type_features_export_render($module, $data, $export = NULL)
//This data is being generated by ECK, so no need to export it
//$entity_metadata = entity_metadata_wrapper($entity_type_name);
$entity_type = EntityType::loadByName($entity_type_name);
-
+
$elements['name'] = $entity_type->name;
$elements['label'] = $entity_type->label;
$elements['properties'] = $entity_type->properties;
@@ -87,7 +87,7 @@ function eck_entity_type_features_revert($module) {
* Rebuilds eck entities from code defaults.
*/
function eck_entity_type_features_rebuild($module) {
-
+
if ($default_entities = features_get_default('eck_entity_type', $module)) {
foreach ($default_entities as $entity_type_name => $entity_type_info) {
@@ -209,29 +209,30 @@ function eck_bundle_features_export_render($module, $data, $export = NULL) {
'entity_type' => NULL,
'name' => NULL,
'label' => NULL,
+ 'config' => FALSE,
);
$output = array();
$output[] = ' $items = array(';
-
+
foreach($data as $bundle_machine_name){
$bundle = Bundle::loadByMachineName($bundle_machine_name);
unset($bundle->id);
-
+
foreach($elements as $key => $value){
$elements[$key] = $bundle->{$key};
}
-
+
// @TODO: Can entities exist without bundles?
// Yes they can, but in ECK (as it is right now) all entities start with a bundle
//I believe you can delete all the bundles from an entity type and everything would still
//work, but I have not tried it.
-
+
$output[] = " '{$bundle->machine_name}' => ". features_var_export($elements) .",";
}
-
+
$output[] = ' );';
-
+
$output[] = ' return $items;';
return array('eck_bundle_info' => implode("\n", $output));