You are here

eloqua_webform.install in Eloqua 7.2

Same filename and directory in other branches
  1. 7 eloqua_webform/eloqua_webform.install

Eloqua Webform install, schema, uninstall and update hooks.

File

eloqua_webform/eloqua_webform.install
View source
<?php

/**
 * @file
 * Eloqua Webform install, schema, uninstall and update hooks.
 */

/**
 * Implements hook_schema().
 */
function eloqua_webform_schema() {
  $schema = array();
  $schema['eloqua_saved_posts'] = array(
    'description' => 'Webform Settings',
    'primary key' => array(
      'post_id',
    ),
    'unique keys' => array(),
    'indexes' => array(
      'eloqua_saved_posts_form_id' => array(
        'form_id',
      ),
    ),
    'fields' => array(
      'form_id' => array(
        // Associated form ID.
        'description' => 'Form ID that generated this post',
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'post_id' => array(
        // Serial number.
        'type' => 'serial',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'status' => array(
        // Form posted status.
        'description' => 'Eloqua option name',
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'post_time' => array(
        // Post time.
        'description' => 'Node ID',
        'type' => 'int',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'data' => array(
        // Form Contents.
        'description' => 'Extra data to be stored with the field',
        'type' => 'text',
        'size' => 'normal',
        /* 16KB in MySQL */
        'not null' => TRUE,
      ),
    ),
  );
  $schema['eloqua_webform'] = array(
    'description' => 'Webform Settings',
    'primary key' => array(
      'nid',
    ),
    'unique keys' => array(),
    'indexes' => array(
      'eloqua_webform_active' => array(
        'is_active',
      ),
    ),
    'fields' => array(
      'nid' => array(
        // Webform node ID.
        'description' => 'Node ID',
        'type' => 'int',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'form_name' => array(
        // Eloqua form name.
        'description' => 'Eloqua form name',
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'is_active' => array(
        // Is this webform Eloqua enabled?
        'description' => 'Whether this form is Eloqua active',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'unsigned' => TRUE,
      ),
      'data' => array(
        'description' => 'Extra data to be stored with the field',
        'type' => 'text',
        'size' => 'normal',
        /* 16KB in mySql */
        'not null' => TRUE,
      ),
    ),
  );
  return $schema;
}

/**
 * Implements hook_install().
 */
function eloqua_webform_install() {
  variable_set('eloqua_webform_process_submit', 0);
}

/**
 * Adds the eloqua_webform_process_submit variable.
 */
function eloqua_webform_update_7000() {
  variable_set('eloqua_webform_process_submit', 0);
}

Functions

Namesort descending Description
eloqua_webform_install Implements hook_install().
eloqua_webform_schema Implements hook_schema().
eloqua_webform_update_7000 Adds the eloqua_webform_process_submit variable.