You are here

delta.install in Delta 7

Same filename and directory in other branches
  1. 6 delta.install
  2. 7.3 delta.install
  3. 7.2 delta.install

File

delta.install
View source
<?php

/**
 * @file
 */

/**
 * Implementation of hook_install
 * @see http://api.drupal.org/api/function/hook_install/6
 */
function delta_install() {

  // isntall database schema
  drupal_install_schema('delta');
}

/**
 * Implementation of hook_uninstall
 * @see http://api.drupal.org/api/function/hook_uninstall/6
 */
function delta_uninstall() {

  // uninstall database schema
  drupal_uninstall_schema('delta');

  // Delete menu links.
  db_query("DELETE FROM {menu_links} WHERE module = 'delta'");

  // in case project/admin has altered our links
  db_query("DELETE FROM {menu_links} WHERE link_path = 'admin/build/delta-theme-settings'");
  menu_cache_clear_all();

  // remove any set variables
  variable_del('delta_themes');
}

/**
 * Implementation of hook_schema
 * @see http://api.drupal.org/api/function/hook_schema/6
 */
function delta_schema() {
  $schema['delta_theme_settings'] = array(
    'description' => t('Stores theme-settings templates that allow overriding the theme settings used based on various contexts.'),
    'fields' => array(
      'tid' => array(
        'description' => t('Theme Settings Template ID'),
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => t('Friendly name for this template'),
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
      'theme' => array(
        'description' => t('TODO: please describe this field!'),
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
      'data' => array(
        'description' => t('Serialized data which is a copy of the theme settings array stored in the system table based on these overrides'),
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'tid',
    ),
  );
  $schema['delta_theme_overrides'] = array(
    'description' => t('Override criteria for when to display an alternate theme settings template.'),
    'fields' => array(
      'did' => array(
        'description' => t('Delta ID'),
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'tid' => array(
        'description' => t('Template ID'),
        'type' => 'int',
        'not null' => TRUE,
      ),
      'system_name' => array(
        'description' => t('usable system name'),
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => t('readable pretty name'),
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
      'value' => array(
        'description' => t('the stored serialized array of theme-settings'),
        'type' => 'text',
        'not null' => TRUE,
      ),
      'weight' => array(
        'description' => t('the priority weight of the override. Allows multiple overrides to apply to same content, then determines which takes priority.'),
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'theme' => array(
        'description' => t('TODO: please describe this field!'),
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'did',
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
delta_install Implementation of hook_install
delta_schema Implementation of hook_schema
delta_uninstall Implementation of hook_uninstall