12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- // $Id$
- /**
- * @file
- * Implementation of hook_views_default_views().
- *
- */
- /**
- * Implements hook_views_default_views().
- *
- * @return array
- */
- function fgcf_views_default_views() {
- // Needed to avoid fatal 'class view not found' error when Features
- // checks the status of the feature.
- views_include('view');
- $info = fgcf_views_api();
- $path = $info['path'];
- $defaults = basename(__FILE__);
- $views = array();
- foreach (new DirectoryIterator($path) as $file_info) {
- if ($file_info->isDot()) {
- continue;
- }
- $name = $file_info->getFilename();
- if ($name == $defaults || !preg_match('/^fgcf_\w*\.php$/', $name, $matches)) {
- continue;
- }
- require_once $name; // will define $view and $handler
- $views[$view->name] = $view;
- unset($view, $handler);
- }
- return $views;
- }
|