You are here

token_custom.install in Custom Tokens 5

File

token_custom.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function token_custom_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {token_custom} (\n        tkid INTEGER NOT NULL,\n        id VARCHAR(100) NOT NULL,\n        description VARCHAR(255) NOT NULL,\n        type VARCHAR(32) NOT NULL,\n        php LONGTEXT NOT NULL,\n        PRIMARY KEY (tkid)\n        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
  }
  drupal_set_message(t('The Custom Tokens module was installed.'));
}
function token_custom_uninstall() {
  db_query('DROP TABLE {token_custom}');
}

Functions