You are here

rotor.install in Rotor Banner 6

Same filename and directory in other branches
  1. 5.7 rotor.install
  2. 5 rotor.install
  3. 6.2 rotor.install
  4. 7 rotor.install

Provides install and uninstall functions for rotor.

@author Nestor Mata Cuthbert, nestor@achieveinternet.com. http://www.achieveinternet.com

File

rotor.install
View source
<?php

/**
 * @file
 * Provides install and uninstall functions for rotor.
 *
 * @author Nestor Mata Cuthbert, nestor@achieveinternet.com. http://www.achieveinternet.com
 */

/**
 * Implementation of hook_install().
 */
function rotor_install() {
  drupal_install_schema('rotor');
  drupal_set_message(t('Rotor Banner installed'));
}

/**
 * Implementation of hook_uninstall().
 */
function rotor_uninstall() {
  drupal_uninstall_schema('rotor');
  db_query("DELETE FROM {variable} WHERE name LIKE 'rotor_%'");
  drupal_set_message(t('Rotor Banner unistalled'));
}

/**
 * Implementation of hook_schema().
 */
function rotor_schema() {
  $schema['rotor_item'] = array(
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The node id associated.',
      ),
      'file_path' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => 255,
        'description' => 'The path of the image that will be displayed.',
      ),
      'alt_text' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => 255,
        'description' => 'The alt text for the rotor item image.',
      ),
      'url' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => 255,
        'description' => 'The url of the image that will be actived.',
      ),
      'link_target' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => 255,
        'description' => 'The target for the link.',
      ),
    ),
    'primary key' => array(
      'nid',
    ),
    'description' => 'The file path for the rotor item image.',
  );
  return $schema;
}

/**
 * Implementation of hook_update_N().
 */
function rotor_update_6000() {
  $ret = array();
  db_add_field($ret, 'rotor_item', 'url', array(
    'type' => 'varchar',
    'not null' => FALSE,
    'length' => 255,
    'description' => 'The url of the image that will be actived.',
  ));
  db_add_field($ret, 'rotor_item', 'alt_text', array(
    'type' => 'varchar',
    'not null' => FALSE,
    'length' => 255,
    'description' => 'The alt text for the rotor item image.',
  ));
  return $ret;
}
function rotor_update_6001() {
  $ret = array();
  db_add_field($ret, 'rotor_item', 'link_target', array(
    'type' => 'varchar',
    'not null' => FALSE,
    'length' => 255,
    'description' => 'The target for the link.',
  ));
  return $ret;
}

Functions

Namesort descending Description
rotor_install Implementation of hook_install().
rotor_schema Implementation of hook_schema().
rotor_uninstall Implementation of hook_uninstall().
rotor_update_6000 Implementation of hook_update_N().
rotor_update_6001