<?php
function uc_radio_images_schema() {
  $schema['uc_radio_images'] = array (
  'description' => t('Holds the image paths for options.'),
    'fields' => array(
      'aid' => array(
        'description' => t('The attribute id.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE),
      'oid' => array(
        'description' => t('The option id.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE),
      'image_path' => array(
        'description' => t('Where the image is located.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => ''),
      ),
    'primary key' => array('aid', 'oid'),
    );
	return $schema;
}
  
function uc_radio_images_install() {
  // Create my tables.
  drupal_install_schema('uc_radio_images');
    // Add ImageCache Preset
    $imagecachepreset = imagecache_preset_save(array('presetname' => 'radio_thumb'));
    // Add ImageCache Action
    $imagecacheaction = new stdClass ();
    $imagecacheaction->presetid = $imagecachepreset['presetid'];
    $imagecacheaction->module = 'imagecache';
    $imagecacheaction->action = 'imagecache_scale';
    $imagecacheaction->data = array('width' => '50', 'height' => '50' );
    drupal_write_record('imagecache_action', $imagecacheaction);

}

function uc_radio_images_uninstall() {
  // Drop my tables.
  drupal_uninstall_schema('uc_radio_images');
  // Delete the ImageCache Preset
  imagecache_preset_delete(imagecache_preset_by_name('radio_thumb'));
}
?>