/[drupal]/contributions/modules/uc_setcom/uc_setcom.install
ViewVC logotype

Contents of /contributions/modules/uc_setcom/uc_setcom.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Wed Oct 7 10:51:08 2009 UTC (6 weeks, 6 days ago) by maxheadroom
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, HEAD
Changes since 1.1: +8 -1 lines
File MIME type: text/x-php
Upgrade HEAD to Drupal 6
1 <?php
2 // $Id: uc_setcom.install,v 1.1.2.1 2009/02/23 12:01:06 maxheadroom Exp $
3
4 /**
5 *@file
6 **/
7
8 /**
9 * Implementation of hook_install().
10 */
11 function uc_setcom_install() {
12 $t = get_t();
13
14 switch ($GLOBALS['db_type']) {
15 case 'mysql':
16 case 'mysqli':
17 db_query("INSERT INTO {uc_order_statuses} (order_status_id, title, state, weight, locked) VALUES ('setcom_payment_denied', '". $t('Setcom payment denied') ."', 'post_checkout', 5, 1);");
18 db_query("INSERT INTO {uc_order_statuses} (order_status_id, title, state, weight, locked) VALUES ('setcom_payment_pending', '". $t('Setcom payment pending') ."', 'post_checkout', 6, 1);");
19 db_query("INSERT INTO {uc_order_statuses} (order_status_id, title, state, weight, locked) VALUES ('setcom_payment_received', '". $t('Setcom payment received') ."', 'payment_received', 8, 1);");
20 drupal_set_message(t('Setcom order statuses created'));
21 break;
22
23 case 'pgsql':
24 drupal_set_message(t('This module does not support pgsql'), 'error');
25 break;
26 }
27 }
28
29 /**
30 * Implementation of hook_uninstall().
31 */
32 function uc_setcom_uninstall() {
33 // Remove tables.
34 drupal_uninstall_schema('uc_setcom');
35
36 db_query("DELETE FROM {uc_order_statuses} WHERE order_status_id = 'setcom_payment_denied';");
37 db_query("DELETE FROM {uc_order_statuses} WHERE order_status_id = 'setcom_payment_pending';");
38 db_query("DELETE FROM {uc_order_statuses} WHERE order_status_id = 'setcom_payment_received';");
39 drupal_set_message(t('Setcom order statuses removed'));
40 }

  ViewVC Help
Powered by ViewVC 1.1.2