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

Contents of /contributions/modules/profile_map/profile_map.install

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


Revision 1.1 - (show annotations) (download) (as text)
Wed Jul 23 22:06:50 2008 UTC (16 months ago) by gestaltware
Branch: MAIN
CVS Tags: DRUPAL-5--1-1, DRUPAL-5--1-0, HEAD
File MIME type: text/x-php
Initial Release for Drupal 5.x.
1 <?php
2 // $Id$
3
4 /**
5 * Implementation of hook_install().
6 */
7 function profile_map_install() {
8 switch ($GLOBALS['db_type']) {
9 case 'mysqli':
10 case 'mysql':
11 db_query("CREATE TABLE if not exists {profile_map} (
12 fid int(11) NOT NULL,
13 category varchar(32) NOT NULL,
14 field varchar(32) NOT NULL,
15 PRIMARY KEY (fid)
16 ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
17 break;
18
19 case 'pgsql':
20 db_query("CREATE TABLE if not exists {profile_map} (
21 fid int(11) NOT NULL,
22 category varchar(32) NOT NULL,
23 field varchar(32) NOT NULL,
24 PRIMARY KEY (fid)
25 )");
26 break;
27 }
28 drupal_set_message(t('Profile Map table installed. !Configure_Profile_Map', array(
29 '!Configure_Profile_Map' => l('Configure Profile Map', 'admin/settings/profile_map')
30 )));
31 }
32
33
34 /**
35 * Implementation of hook_uninstall().
36 */
37 function profile_map_uninstall() {
38 db_query("DROP TABLE {profile_map}");
39 $vars = array(
40 'profile_map_name_view',
41 'profile_map_name-label_view',
42 'profile_map_address_view',
43 'profile_map_address-label_view',
44 'profile_map_phone_view',
45 'profile_map_phone-label_view',
46 'profile_map_messaging_view',
47 'profile_map_messaging-label_view',
48 );
49 foreach ($vars as $var) {
50 variable_del($var);
51 }
52 drupal_set_message(t('Profile Map table and variables removed.'));
53
54 cache_clear_all();
55 }

  ViewVC Help
Powered by ViewVC 1.1.2