You are here

styles.install in Styles 6

Same filename and directory in other branches
  1. 6.2 styles.install
  2. 7.2 styles.install
  3. 7 styles.install

Install, update and uninstall functions for the Styles module.

File

styles.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the Styles module.
 */

/**
 * Implement hook_install().
 */
function styles_install() {
  return array();
}

/**
 * Implement hook_uninstall().
 */
function styles_uninstall() {
  foreach (styles_variable_default() as $variable => $value) {
    styles_variable_del($variable);
  }
  return array(
    array(
      'success' => TRUE,
      'query' => "Deleted all variables in the Styles namespace.",
    ),
  );
}

/**
 * Add new theme functions.
 */
function styles_update_6001() {
  drupal_rebuild_theme_registry();
  return array();
}

/**
 * Implement hook_schema().
 */
function styles_schema() {
  $schema = array();
  $schema['cache_styles'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['cache_styles']['description'] = 'Cache table used to store information display manipulations that are in-progress.';
  $schema['styles'] = array(
    'description' => 'Stores configuration options for styles.',
    'fields' => array(
      'sid' => array(
        'description' => 'The primary identifier for a style.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The style name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'sid',
    ),
    'indexes' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  $schema['style_effects'] = array(
    'description' => 'Stores configuration options for style effects.',
    'fields' => array(
      'seid' => array(
        'description' => 'The primary identifier for a style effect.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'sid' => array(
        'description' => 'The {styles}.sid for a style.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'weight' => array(
        'description' => 'The weight of the effect in the style.',
        'type' => 'int',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'name' => array(
        'description' => 'The unique name of the effect to be executed.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'data' => array(
        'description' => 'The configuration data for the effect.',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'seid',
    ),
    'indexes' => array(
      'sid' => array(
        'sid',
      ),
      'weight' => array(
        'weight',
      ),
    ),
    'foreign keys' => array(
      'sid' => array(
        'styles' => 'sid',
      ),
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
styles_install Implement hook_install().
styles_schema Implement hook_schema().
styles_uninstall Implement hook_uninstall().
styles_update_6001 Add new theme functions.