fgcf.views_default.inc 717 B

12345678910111213141516171819202122232425262728293031323334353637
  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. return array();
  15. $info = fgcf_views_api();
  16. $path = $info['path'];
  17. $defaults = basename(__FILE__);
  18. $views = array();
  19. foreach (new DirectoryIterator($path) as $file_info) {
  20. if ($file_info->isDot()) {
  21. continue;
  22. }
  23. $name = $file_info->getFilename();
  24. if ($name == $defaults || !preg_match('/^fgcf_\w*\.php$/', $name, $matches)) {
  25. continue;
  26. }
  27. require_once $name; // will define $view and $handler
  28. $views[$view->name] = $view;
  29. unset($view, $handler);
  30. }
  31. return $views;
  32. }