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

Contents of /contributions/modules/navigate/navigate.install

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


Revision 1.6 - (show annotations) (download) (as text)
Sat Nov 8 19:53:21 2008 UTC (12 months, 2 weeks ago) by stompeers
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +81 -81 lines
File MIME type: text/x-php
Removing window-style EOL's .
1 <?php
2 // $Id: navigate.install,v 1.5 2008/11/08 19:31:16 stompeers Exp $
3
4
5 /**
6 * @file
7 * Navigate installation file
8 */
9
10
11 /**
12 * Implementation of hook_install().
13 */
14 function navigate_install() {
15 switch ($GLOBALS['db_type']) {
16 case 'mysql':
17 case 'mysqli':
18 db_query("CREATE TABLE {navigate_cache} (
19 uid int(11) NOT NULL,
20 content longtext NOT NULL
21 ) /*!40100 DEFAULT CHARACTER SET utf8 */;"
22 );
23 db_query("CREATE TABLE {navigate_user_settings} (
24 uid int(11) NOT NULL,
25 name varchar(250) NOT NULL,
26 value text NOT NULL,
27 wid int(11) NOT NULL
28 ) /*!40100 DEFAULT CHARACTER SET utf8 */;"
29 );
30 db_query("CREATE TABLE {navigate_widgets} (
31 wid int(11) NOT NULL,
32 uid int(11) NOT NULL,
33 type varchar(250) NOT NULL,
34 weight int(11) NOT NULL,
35 module varchar(250) NOT NULL
36 ) /*!40100 DEFAULT CHARACTER SET utf8 */"
37 );
38 break;
39 case 'pgsql':
40 db_query("CREATE TABLE {navigate_cache} (
41 uid int NOT NULL,
42 content text NOT NULL
43 )");
44 db_query("CREATE TABLE {navigate_user_settings} (
45 uid int NOT NULL,
46 name varchar(250) NOT NULL,
47 value text NOT NULL,
48 wid int NOT NULL
49 )");
50 db_query("CREATE TABLE {navigate_widgets} (
51 wid int NOT NULL,
52 uid int NOT NULL,
53 type varchar(250) NOT NULL,
54 weight int NOT NULL,
55 module varchar(250) NOT NULL
56 )");
57 db_query('CREATE SEQUENCE {navigate_widgets}_wid_seq');
58 break;
59
60 db_query("UPDATE {system} SET weight = 100 WHERE name = 'navigate'");
61 }
62 drupal_set_message(t('Navigate has been installed. To use navigate, click the semi-hidden icon in the upper left hand corner of the screen. For more help, visit '. l('/admin/help/navigate', 'admin/help/navigate') .'. Make sure to enable it for your users in '. l('access control', 'admin/user/access') .'.'));
63 }
64
65
66 /**
67 * Implementation of hook_uninstall().
68 */
69 function navigate_uninstall() {
70 db_query("DELETE FROM {variable} WHERE name LIKE 'navigate_%'");
71 db_query('DROP TABLE {navigate_cache}');
72 db_query('DROP TABLE {navigate_user_settings}');
73 db_query('DROP TABLE {navigate_widgets}');
74 switch ($GLOBALS['db_type']) {
75 case 'pgsql':
76 db_query('DROP SEQUENCE {navigate_widgets}_wid_seq');
77 break;
78 }
79
80 drupal_set_message(t('Navigate variables and tables have been removed.'));
81 }

  ViewVC Help
Powered by ViewVC 1.1.2