You are here

function viewscarousel_get_views in Views carousel 5

Return url of all page views that are of the type 'carousel'.

2 calls to viewscarousel_get_views()
viewscarousel_form_alter in ./viewscarousel.module
Implementation of hook_form_alter(). Add carousel settings to block views, on Drupal's block configuration form.
viewscarousel_menu in ./viewscarousel.module
Implementation of hook_menu().

File

./viewscarousel.module, line 133
Enable the creation of dynamic loading carousel widgets with views.

Code

function viewscarousel_get_views($type = 'page', $reset = FALSE) {
  static $views;
  if (is_null($views[$type]) || $reset) {
    $views[$type] = array();
    $where = $type == 'page' ? "page = 1 AND page_type = 'carousel'" : "block = 1 AND block_type = 'carousel'";
    $result = db_query("SELECT name, url FROM {view_view} WHERE {$where} ORDER BY name");
    while ($row = db_fetch_object($result)) {
      $views[$type][$row->name] = $row;
    }
  }
  return $views[$type];
}