You are here

rotor.install in Rotor Banner 5.7

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

File

rotor.install
View source
<?php

/**
 * Install hook
 */
function rotor_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {rotor_item} (\n        nid int(10) unsigned NOT NULL,\n        file_path varchar(255) NULL,\n        PRIMARY KEY (nid));");
      drupal_set_message(t('Rotor table created'));
      break;
  }
}

/**
 * Unistalla hook
 */
function rotor_uninstall() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("DROP TABLE {rotor_item};");
      variable_del('rotor_max_items');
      variable_del('rotor_seconds');
      variable_del('rotor_show_tabs');
      variable_del('rotor_group_tabs');
      drupal_set_message(t('Rotor unistalled'));
      break;
  }
}

Functions

Namesort descending Description
rotor_install Install hook
rotor_uninstall Unistalla hook