features.block.inc 856 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Implements hook_features_api().
  4. */
  5. function block_features_api() {
  6. return array();
  7. }
  8. /**
  9. * Implements hook_features_export().
  10. */
  11. function block_features_export($data, &$export) {
  12. $pipe = array();
  13. foreach ($data as $bid) {
  14. $split = explode('-', $bid);
  15. $module = array_shift($split);
  16. $delta = implode('-', $split);
  17. $export['dependencies'][$module] = $module;
  18. switch ($module) {
  19. case 'views':
  20. if (strlen($delta) == 32) {
  21. $hashes = variable_get('views_block_hashes', array());
  22. if (!empty($hashes[$delta])) {
  23. $delta = $hashes[$delta];
  24. }
  25. }
  26. $delta_split = explode('-', $delta);
  27. $view_name = $delta_split[0];
  28. if (!empty($view_name)) {
  29. $pipe['views'][] = $view_name;
  30. }
  31. break;
  32. }
  33. }
  34. return $pipe;
  35. }