View source
<?php
function img_assist_schema() {
$schema['img_assist_map'] = array(
'description' => t('Stores references of image files to content.'),
'fields' => array(
'nid' => array(
'description' => t('The {node}.nid of the content referencing the image file.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'iid' => array(
'description' => t('The {image}.nid of the image file referenced by the content.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'nid',
'iid',
),
);
return $schema;
}
function img_assist_install() {
drupal_install_schema('img_assist');
}
function img_assist_uninstall() {
drupal_uninstall_schema('img_assist');
variable_del('img_assist_page_styling');
variable_del('img_assist_link');
variable_del('img_assist_all');
variable_del('img_assist_pages');
variable_del('img_assist_link');
variable_del('img_assist_preview_count');
variable_del('img_assist_max_size');
variable_del('img_assist_popup_label');
variable_del('img_assist_default_label');
variable_del('img_assist_create_derivatives');
variable_del('img_assist_default_link_behavior');
variable_del('img_assist_default_link_url');
variable_del('img_assist_default_insert_mode');
variable_del('img_assist_load_title');
variable_del('img_assist_load_description');
variable_del('img_assist_vocabs');
variable_del('img_assist_default_alignment');
variable_del('img_assist_all');
}
function img_assist_update_6200() {
$ret = array();
variable_del('img_assist_preview_count');
if (!module_exists('views')) {
db_query("UPDATE {system} SET status = %d WHERE type = '%s' AND name = '%s'", 0, 'module', 'img_assist');
drupal_set_message('Image assist has been disabled, because it requires <a href="http://drupal.org/project/views">Views</a> module to be installed.', 'error');
}
return $ret;
}