| 1 |
<?php |
<?php |
| 2 |
/* $Id:$ */ |
/* $Id: path_access.install,v 1.1.4.2 2007/08/27 14:38:39 budda Exp $ */ |
| 3 |
|
|
| 4 |
function path_access_install() { |
function path_access_install() { |
|
drupal_set_message('Installing Path Access'); |
|
| 5 |
switch ($GLOBALS['db_type']) { |
switch ($GLOBALS['db_type']) { |
| 6 |
case 'mysqli': |
case 'mysqli': |
| 7 |
case 'mysql': |
case 'mysql': |
| 20 |
|
|
| 21 |
$success = TRUE; |
$success = TRUE; |
| 22 |
break; |
break; |
| 23 |
|
|
| 24 |
|
case 'pgsql': |
| 25 |
|
db_query("CREATE SEQUENCE {path_access_seq}; |
| 26 |
|
CREATE TABLE {path_access} ( |
| 27 |
|
pid integer not null default nextval('path_access_seq'), |
| 28 |
|
rid integer not null default 0, |
| 29 |
|
pages text, |
| 30 |
|
visibility smallint not null default 0, |
| 31 |
|
PRIMARY KEY(pid) |
| 32 |
|
); |
| 33 |
|
"); |
| 34 |
|
|
| 35 |
|
db_query("INSERT INTO {path_access} (rid, pages, visibility) VALUES (1, '', 0)"); |
| 36 |
|
db_query("INSERT INTO {path_access} (rid, pages, visibility) VALUES (2, '', 0)"); |
| 37 |
|
|
| 38 |
|
$success = TRUE; |
| 39 |
|
break; |
| 40 |
} |
} |
| 41 |
|
|
| 42 |
if ($success) { |
if ($success) { |
| 46 |
drupal_set_message(t('The installation of Path Access module was unsuccessful.'), 'error'); |
drupal_set_message(t('The installation of Path Access module was unsuccessful.'), 'error'); |
| 47 |
} |
} |
| 48 |
} |
} |
| 49 |
|
|
| 50 |
|
function path_access_uninstall() { |
| 51 |
|
db_query('DROP TABLE {path_access}'); |
| 52 |
|
db_query('DROP SEQUENCE {path_access_seq}'); |
| 53 |
|
} |