You are here

linkimagefield.install in Link Image Field 7

Same filename and directory in other branches
  1. 5 linkimagefield.install
  2. 6 linkimagefield.install

linkimagefield install and update code. Defines the field schema.

File

linkimagefield.install
View source
<?php

// $Id$

/**
 * @file
 *
 * linkimagefield install and update code.
 * Defines the field schema.
 */

/**
 * Implements hook_field_schema().
 */
function linkimagefield_field_schema($field) {
  return array(
    'columns' => array(
      'fid' => array(
        'description' => 'The {file_managed}.fid being referenced in this field.',
        'type' => 'int',
        'not null' => FALSE,
        'unsigned' => TRUE,
      ),
      'alt' => array(
        'description' => "Alternative image text, for the image's 'alt' attribute.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'longdesc' => array(
        'description' => "A link to a page with a long description of the image, for the image's 'londesc' attribute.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'title' => array(
        'description' => "Image title text, for the image's 'title' attribute.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'url' => array(
        'description' => "The URL used for the image link.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'target' => array(
        'description' => "The target type of the image link.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'class' => array(
        'description' => "For adding a class attribute to the anchor.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'rel' => array(
        'description' => "A relation tag for bots or lightboxes.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'width' => array(
        'description' => 'The width of the image in pixels.',
        'type' => 'int',
        'unsigned' => TRUE,
      ),
      'height' => array(
        'description' => 'The height of the image in pixels.',
        'type' => 'int',
        'unsigned' => TRUE,
      ),
    ),
    'indexes' => array(
      'fid' => array(
        'fid',
      ),
    ),
    'foreign keys' => array(
      'fid' => array(
        'table' => 'file_managed',
        'columns' => array(
          'fid' => 'fid',
        ),
      ),
    ),
  );
}

Functions