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

Contents of /contributions/modules/slicedbook_navigation/slicedbook_navigation.install

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


Revision 1.2 - (show annotations) (download) (as text)
Fri Nov 2 13:28:57 2007 UTC (2 years ago) by jfberroyer
Branch: MAIN
CVS Tags: DRUPAL-5--2-0, HEAD
Branch point for: DRUPAL-5--2
Changes since 1.1: +35 -0 lines
File MIME type: text/x-php
Add install file
1 <?php
2 function slicedbook_navigation_install() {
3 switch ($GLOBALS['db_type']) {
4 case 'mysqli':
5 case 'mysql':
6 $query1 = db_query("CREATE TABLE {slicedbook_navigation} (
7 nid INT NOT NULL,
8 attribute VARCHAR( 128 ) NOT NULL,
9 PRIMARY KEY ( `nid` )
10 ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
11 if ($query1) {
12 $created = TRUE;
13 }
14 break;
15
16 case 'pgsql':
17 $query1 = db_query("CREATE TABLE {slicedbook_navigation} (
18 nid INT NOT NULL,
19 attribute VARCHAR(128) NOT NULL,
20 PRIMARY KEY (nid)
21 )");
22 if ($query1) {
23 $created = TRUE;
24 }
25 break;
26 }
27
28 if ($created) {
29 drupal_set_message(t('Sliced Book Navigation module installed successfully.'));
30 }
31 else {
32 drupal_set_message(t('Table installation for the Sliced Book Navigation module was unsuccessful. The tables may need to be installed by hand.'), 'error');
33 }
34 }
35 ?>

  ViewVC Help
Powered by ViewVC 1.1.2