You are here

brilliant_gallery.module in Brilliant Gallery 7.2

File

brilliant_gallery.module
View source
<?php

// Menu structure
module_load_include('inc', 'brilliant_gallery', 'brilliant_gallery_menu');

// Config form
module_load_include('inc', 'brilliant_gallery', 'brilliant_gallery_config');

// Other functions
module_load_include('inc', 'brilliant_gallery', 'brilliant_gallery');

//module_load_include('inc', 'brilliant_gallery', 'brilliant_gallery.views');
module_load_include('inc', 'brilliant_gallery', 'brilliant_gallery_formatters');
module_load_include('inc', 'brilliant_gallery', 'brilliant_gallery_cron');

/**
 * Implements hook_views_api().
 */
function brilliant_gallery_views_api() {
  return array(
    'api' => 3,
    'path' => drupal_get_path('module', 'brilliant_gallery') . '/views',
  );
}

/**
 * Implements hook_views_default_views().
 * Imports views from the /views directory; see http://bonify.io/blog/2014/09/how-export-your-views-code-and-why
 */
function brilliant_gallery_views_default_views() {
  $path = __DIR__ . '/views/default/*.view.inc';
  $views = array();
  foreach (glob($path) as $views_filename) {
    $view = FALSE;
    require_once $views_filename;
    $views[$view->name] = $view;

    // $view exists in the included file.
    unset($view);
  }
  return $views;
}

/**
 * Implements hook_permission().
 */
function brilliant_gallery_permission() {
  return array(
    'access brilliant_gallery' => array(
      'title' => t('Access Brilliant Gallery'),
      'description' => t('Allow access to Brilliant Gallery.'),
    ),
    'administer brilliant_gallery' => array(
      'title' => t('Administer Brilliant Gallery'),
      'description' => t('Set roles that may access the settings of Brilliant Gallery.'),
    ),
  );
}

/**
 * Implements hook_help().
 */
function brilliant_gallery_help($path, $arg) {
  switch ($path) {
    case "admin/help#brilliant_gallery":
      return '<h3>' . t('About') . '</h3>' . '<p>' . t("Highly customizable Drupal module creating a table gallery of quality-scaled images from any number of folders.") . '</p>';
  }
}

/**
 * @todo Please document this function.
 */
function brilliant_gallery_perms() {
  drupal_goto('admin/people/permissions', array(
    'fragment' => 'module-brilliant_gallery',
  ));
}

/**
 * Implements hook_filter_info().
 */
function brilliant_gallery_filter_info() {
  $filters = array();
  $filters['filter_brilliant_gallery'] = array(
    'title' => t('Brilliant Gallery tag'),
    'description' => t('Substitutes a special Brilliant Gallery tag [bg|...] with the actual gallery table.'),
    'prepare callback' => 'brilliant_gallery_filter_brilliant_gallery_prepare',
    'process callback' => 'brilliant_gallery_filter_brilliant_gallery_process',
  );
  return $filters;
}

/**
 * Implements hook_filter_brilliant_gallery_prepare().
 */
function brilliant_gallery_filter_brilliant_gallery_prepare($text, $filter) {
  return $text;
}

/**
 * Implements hook_filter_brilliant_gallery_process().
 */
function brilliant_gallery_filter_brilliant_gallery_process($text, $filter) {
  $text = brilliant_gallery_replace_tags($text);
  return $text;
}

Functions

Namesort descending Description
brilliant_gallery_filter_brilliant_gallery_prepare Implements hook_filter_brilliant_gallery_prepare().
brilliant_gallery_filter_brilliant_gallery_process Implements hook_filter_brilliant_gallery_process().
brilliant_gallery_filter_info Implements hook_filter_info().
brilliant_gallery_help Implements hook_help().
brilliant_gallery_permission Implements hook_permission().
brilliant_gallery_perms @todo Please document this function.
brilliant_gallery_views_api Implements hook_views_api().
brilliant_gallery_views_default_views Implements hook_views_default_views(). Imports views from the /views directory; see http://bonify.io/blog/2014/09/how-export-your-views-code-and-why