wing.views.inc 467 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * @file
  4. * Views hooks for Wing.
  5. */
  6. /**
  7. * Implements hook_views_default_views().
  8. */
  9. function wing_views_default_views() {
  10. $path = drupal_get_path('module', 'wing') . '/views';
  11. $di = new DirectoryIterator($path);
  12. $views = array();
  13. foreach ($di as $file) {
  14. if ($file->isFile() && preg_match('/^wing-.*\.view\.inc$/', $file->getFilename())) {
  15. require $file->getPathname();
  16. $views[$view->name] = $view;
  17. }
  18. }
  19. return $views;
  20. }