You are here

views_jqfx_galleria.module in Views jQFX Galleria 7

Integrating Galleria with Views jQFX.

File

views_jqfx_galleria.module
View source
<?php

/**
 *  @file
 *  Integrating Galleria with Views jQFX.
 */

/**
 * Implements hook_theme().
 */
function views_jqfx_galleria_theme($existing, $type, $theme, $path) {
  return array(
    'views_jqfx_galleria' => array(
      'variables' => array(
        'view' => NULL,
        'options' => array(),
        'rows' => array(),
        'title' => '',
      ),
      'template' => 'views-jqfx-galleria',
      'file' => 'views_jqfx_galleria.theme.inc',
      'path' => $path . '/theme',
    ),
  );
}

/**
 * Scan Galleria theme folder and return theme list.
 */
function views_jqfx_galleria_get_themes() {

  // Path to galleria themes
  $theme_path = libraries_get_path('galleria') . '/themes';

  // List themes
  $files = file_scan_directory($theme_path, '/.*/', array(
    'recurse' => FALSE,
  ));
  $themes = array();
  if (is_array($files)) {
    foreach ($files as $path => $file) {
      if (is_dir($path) && file_exists($path . '/galleria.' . $file->filename . '.css')) {
        $themes[] = $file->filename;
        asort($themes);
      }
    }
  }
  return drupal_map_assoc($themes);
}

Functions

Namesort descending Description
views_jqfx_galleria_get_themes Scan Galleria theme folder and return theme list.
views_jqfx_galleria_theme Implements hook_theme().