function classified_views_default_views in Classified Ads 7.3
Same name and namespace in other branches
- 6.3 views/classified.views_default.inc \classified_views_default_views()
Implements hook_views_default_views().
File
- views/
classified.views_default.inc, line 32 - Default Views for the classified module.
Code
function classified_views_default_views() {
$views = array();
$path = drupal_get_path('module', 'classified') . '/views';
foreach (file_scan_directory($path, '/.*\\.php$/') as $file) {
// $view is redefined by the require_once. This is a safety net.
$view = array();
require_once DRUPAL_ROOT . '/' . $file->filename;
// phpcs:disable
$views[$view->name] = $view;
// phpcs:enabled
}
return $views;
}