You are here

msnf.install in Multistep Nodeform 7

Same filename and directory in other branches
  1. 6 msnf.install

Installation routines for module "Multistep Nodeform".

File

msnf.install
View source
<?php

/**
 * @file
 * Installation routines for module "Multistep Nodeform".
 */

/**
 * Implements hook_install().
 */
function msnf_install() {

  // Set weight to 100 to make sure this module is the last one called on hooks.
  db_update('system')
    ->fields(array(
    'weight' => 100,
  ))
    ->condition('name', 'msnf')
    ->execute();
}

/**
 * Implements hook_uninstall().
 */
function msnf_uninstall() {

  // Remove variables created by Multistep eNtityform.
  db_delete('variable')
    ->condition('name', 'msnf\\_%', 'LIKE');
}

/**
 * Implements hook_schema().
 *
 * Defines the database schema for module "Multistep Nodeform".
 */
function msnf_schema() {
  $schema['msnf_step'] = array(
    'description' => 'Table that contains step entries and settings from module msnf.',
    // CTools export definitions.
    'export' => array(
      'key' => 'identifier',
      'identifier' => 'msnf',
      'default hook' => 'msnf_step_info',
      'save callback' => 'msnf_step_save',
      'delete callback' => 'msnf_step_export_delete',
      'can disable' => TRUE,
      'api' => array(
        'owner' => 'msnf',
        'api' => 'msnf',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'The primary identifier for a form step.',
        'no export' => TRUE,
      ),
      'identifier' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The unique string identifier for a form step.',
      ),
      'step_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The name of this form step.',
      ),
      'entity_type' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'bundle' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'data' => array(
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
        'description' => 'Serialized data containing the form step properties that do not warrant a dedicated column.',
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'indexes' => array(
      'step_name' => array(
        'step_name',
      ),
    ),
    'unique keys' => array(
      'identifier' => array(
        'identifier',
      ),
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
msnf_install Implements hook_install().
msnf_schema Implements hook_schema().
msnf_uninstall Implements hook_uninstall().