You are here

disable_field.install in Disable Field 7

Same filename and directory in other branches
  1. 8.2 disable_field.install
  2. 8 disable_field.install

Install and uninstall functions for the Disable Textfield module.

File

disable_field.install
View source
<?php

/**
 * @file
 * Install and uninstall functions for the Disable Textfield module.
 */

/**
 * Implements hook_schema().
 */
function disable_field_schema() {
  $schema['disable_field'] = array(
    'description' => 'The base table for Disable fields.',
    'fields' => array(
      'entity_type' => array(
        'description' => 'Entity Type of Field.',
        'type' => 'varchar',
        'length' => 100,
        'not null' => FALSE,
      ),
      'bundle' => array(
        'description' => 'Bundle type of Field.',
        'type' => 'varchar',
        'length' => 100,
        'not null' => FALSE,
      ),
      'page' => array(
        'description' => 'Disable in.',
        'type' => 'varchar',
        'length' => 100,
        'not null' => FALSE,
      ),
      'disable_page' => array(
        'description' => 'Disabled',
        'type' => 'varchar',
        'length' => 100,
        'not null' => FALSE,
      ),
      'field_name' => array(
        'description' => 'Field to disable/enable.',
        'type' => 'varchar',
        'length' => 100,
        'not null' => FALSE,
      ),
      'roles' => array(
        'description' => 'Field to disable/enable for Roles.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
      'status' => array(
        'description' => 'Status of Field.',
        'type' => 'varchar',
        'length' => 100,
        'not null' => FALSE,
      ),
    ),
  );
  return $schema;
}

/**
 * Implements hook_unistall().
 */
function disable_field_uninstall_schema() {
  if (db_table_exists('disable_field')) {
    db_drop_table('disable_field');
  }
}

Functions

Namesort descending Description
disable_field_schema Implements hook_schema().
disable_field_uninstall_schema Implements hook_unistall().