| 1 |
<?php
|
| 2 |
// $Id: signup.views_default.inc,v 1.8 2009/07/22 21:47:01 dww Exp $
|
| 3 |
|
| 4 |
|
| 5 |
/**
|
| 6 |
* @file
|
| 7 |
* Provides default views on behalf of the signup module.
|
| 8 |
*/
|
| 9 |
|
| 10 |
/**
|
| 11 |
* Implementation of hook_views_default_views().
|
| 12 |
*/
|
| 13 |
function signup_views_default_views() {
|
| 14 |
// Search the "default_views" directory for files ending in .view.php.
|
| 15 |
$files = file_scan_directory(drupal_get_path('module', 'signup'). '/views/default_views', 'view.php');
|
| 16 |
foreach ($files as $absolute => $file) {
|
| 17 |
if (strpos($file->name, '_vbo_') !== FALSE && !module_exists('views_bulk_operations')) {
|
| 18 |
// This is a VBO-specific view, but we don't have VBO, so skip it.
|
| 19 |
continue;
|
| 20 |
}
|
| 21 |
require_once $absolute;
|
| 22 |
if (isset($view)) {
|
| 23 |
// $file->name has the ".php" stripped off, but still has the ".view".
|
| 24 |
$view_name = substr($file->name, 0, strrpos($file->name, '.'));
|
| 25 |
$views[$view_name] = $view;
|
| 26 |
}
|
| 27 |
}
|
| 28 |
return $views;
|
| 29 |
}
|
| 30 |
|