You are here

dynamic_background_views.install in Dynamic Background 6

Installes the database scheme and handles install and uninstall of the module.

File

modules/dynamic_background_views/dynamic_background_views.install
View source
<?php

/**
 * @file
 * Installes the database scheme and handles install and uninstall of the
 * module.
 */

/**
 * Implementation of hook_schema(), which create the dynamic background table
 * used to store information about user selection of images.
 */
function dynamic_background_views_schema() {
  $schema = array();
  $schema['dynamic_background_views'] = array(
    'description' => t('Stores information about dynamic backgrounds for each view display'),
    'fields' => array(
      'view_id' => array(
        'type' => 'text',
        'not null' => TRUE,
      ),
      'data' => array(
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_install().
 */
function dynamic_background_views_install() {
  drupal_install_schema('dynamic_background_views');

  // Make this module's weight heavy, so it overrides dynamic background main module.
  db_query("UPDATE {system} SET weight = 215 WHERE type = 'module' AND name = 'dynamic_background_views'");
}

/**
 * Implementation of hook_uninstall():
 */
function dynamic_background_views_uninstall() {

  // Remove database table.
  drupal_uninstall_schema('dynamic_background_views');

  // Remove settings.
  variable_del('dynamic_background_views');
  variable_del('dynamic_background_views_css');
  variable_del('dynamic_background_views_imagecache');
}

Functions

Namesort descending Description
dynamic_background_views_install Implementation of hook_install().
dynamic_background_views_schema Implementation of hook_schema(), which create the dynamic background table used to store information about user selection of images.
dynamic_background_views_uninstall Implementation of hook_uninstall():