i18n_node.features.inc 734 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * @file
  4. * Feature integration
  5. */
  6. /**
  7. * Implements hook_features_pipe_node_alter().
  8. */
  9. function i18n_node_features_pipe_node_alter(&$pipe, $data, $export) {
  10. if (!empty($data) && module_exists('variable')) {
  11. variable_include();
  12. foreach (variable_list_module('i18n_node') as $variable) {
  13. if (isset($variable['multiple']) && $variable['multiple'] === 'node_type') {
  14. $children = variable_build($variable['name']);
  15. if (!empty($children['children'])) {
  16. foreach ($children['children'] as $child_variable) {
  17. if (in_array($child_variable['index'], $data)) {
  18. $pipe['variable'][] = $child_variable['name'];
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }