| 1 |
<?php
|
| 2 |
// $Id $
|
| 3 |
|
| 4 |
function path_access_schema() {
|
| 5 |
$schema['path_access'] = array(
|
| 6 |
'fields' => array(
|
| 7 |
'pid' => array(
|
| 8 |
'type' => 'serial',
|
| 9 |
'not null' => TRUE,
|
| 10 |
),
|
| 11 |
'rid' => array(
|
| 12 |
'type' => 'int',
|
| 13 |
'not null' => TRUE,
|
| 14 |
'default' => 0,
|
| 15 |
),
|
| 16 |
'pages' => array(
|
| 17 |
'type' => 'text',
|
| 18 |
),
|
| 19 |
'visibility' => array(
|
| 20 |
'type' => 'int',
|
| 21 |
'size' => 'tiny',
|
| 22 |
'not null' => TRUE,
|
| 23 |
'default' => 0,
|
| 24 |
),
|
| 25 |
),
|
| 26 |
'indexes' => array(
|
| 27 |
'rid' => array('rid'),
|
| 28 |
),
|
| 29 |
'primary key' => array('pid'),
|
| 30 |
);
|
| 31 |
return $schema;
|
| 32 |
}
|
| 33 |
|
| 34 |
function path_access_install() {
|
| 35 |
$res = drupal_install_schema('path_access');
|
| 36 |
$success = TRUE;
|
| 37 |
foreach($res as $v) {
|
| 38 |
if($v['success'] !== TRUE) {
|
| 39 |
$success = FALSE;
|
| 40 |
break;
|
| 41 |
}
|
| 42 |
}
|
| 43 |
if ($success) {
|
| 44 |
drupal_set_message(t('Path Access module installed tables successfully.'));
|
| 45 |
}
|
| 46 |
else {
|
| 47 |
drupal_set_message(t('The installation of Path Access module was unsuccessful.'), 'error');
|
| 48 |
}
|
| 49 |
}
|
| 50 |
|
| 51 |
function path_access_uninstall() {
|
| 52 |
$res = drupal_uninstall_schema('path_access');
|
| 53 |
$success = TRUE;
|
| 54 |
foreach($res as $v) {
|
| 55 |
if($v['success'] !== TRUE) {
|
| 56 |
$success = FALSE;
|
| 57 |
break;
|
| 58 |
}
|
| 59 |
}
|
| 60 |
if ($success) {
|
| 61 |
drupal_set_message(t('Path Access module uninstalled tables successfully.'));
|
| 62 |
}
|
| 63 |
else {
|
| 64 |
drupal_set_message(t('The uninstallation of Path Access module was unsuccessful.'), 'error');
|
| 65 |
}
|
| 66 |
}
|
| 67 |
|
| 68 |
// vim: set ft=php syntax=php expandtab ts=2 sw=2 autoindent smartindent:
|