ml_image.install in Media Library 6
Media Library Image install procedures
File
ml_image/ml_image.installView source
<?php
/**
* @file
* Media Library Image install procedures
*/
/**
* Implementation of hook_install()
*/
function ml_image_install() {
drupal_install_schema('ml_image');
}
/**
* Implementation of hook_uninstall()
*/
function ml_image_uninstall() {
drupal_uninstall_schema('ml_image');
}
/**
* Implementation of hook_schema()
*/
function ml_image_schema() {
$schema['ml_image_metadata'] = array(
'description' => 'Stores metadata for images',
'fields' => array(
'fid' => array(
'description' => 'The file identifier, referencing {files}.fid',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'title' => array(
'description' => 'Descriptive image title',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'copyright' => array(
'description' => 'Copyright short information',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'author' => array(
'description' => 'Photographer name',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'source' => array(
'description' => 'Source of image',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array(
'fid',
),
);
$schema['ml_image_term'] = array(
'description' => 'Stores metadata tags for images',
'fields' => array(
'fid' => array(
'description' => 'The file identifier, referencing {files}.fid',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'tid' => array(
'description' => 'The term identifier, referencing {term_data}.tid',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'indexes' => array(
'fid' => array(
'fid',
),
),
'primary key' => array(
'fid',
'tid',
),
);
return $schema;
}
Functions
Name | Description |
---|---|
ml_image_install | Implementation of hook_install() |
ml_image_schema | Implementation of hook_schema() |
ml_image_uninstall | Implementation of hook_uninstall() |