fgcf.views_default.inc 699 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. // $Id$
  3. /**
  4. * @file
  5. * Implementation of hook_views_default_views().
  6. *
  7. */
  8. /**
  9. * Implements hook_views_default_views().
  10. *
  11. * @return array
  12. */
  13. function fgcf_views_default_views() {
  14. $info = fgcf_views_api();
  15. $path = $info['path'];
  16. $defaults = basename(__FILE__);
  17. $views = array();
  18. foreach (new DirectoryIterator($path) as $file_info) {
  19. if ($file_info->isDot()) {
  20. continue;
  21. }
  22. $name = $file_info->getFilename();
  23. if ($name == $defaults || !preg_match('/^fgcf_\w*\.php$/', $name, $matches)) {
  24. continue;
  25. }
  26. require_once $name; // will define $view and $handler
  27. $views[$view->name] = $view;
  28. unset($view, $handler);
  29. }
  30. return $views;
  31. }