Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (40 sloc) 1.11 KB
<?php
// $Id$
/**
* @file
* Install Ubercart Gift Wrap option at checkout
*/
require_once('uc_gift_wrap.constants.inc');
/**
* Install the initial schema.
*/
function uc_gift_wrap_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {uc_gift_wrap} (
order_id int(11) NOT NULL,
gift_text varchar(200) default NULL,
PRIMARY KEY (order_id)
) /*!40100 DEFAULT CHARACTER SET utf8 */;");
db_query("CREATE TABLE {uc_gift_wrap_node} (
nid int(11) NOT NULL,
gift_wrap_available int(1) default 1 NOT NULL,
PRIMARY KEY (nid)
) /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case 'pgsql':
// To be implemented....
break;
}
}
/**
* Implementation of hook_uninstall().
*/
function uc_gift_wrap_uninstall() {
db_query('DROP TABLE {uc_gift_wrap}');
db_query('DROP TABLE {uc_gift_wrap_node}');
variable_del(_UCGW_VAR_PER_ITEM);
variable_del(_UCGW_VAR_DEFAULT_ON);
variable_del(_UCGW_VAR_CHARGE);
}