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

Diff of /contributions/modules/path_access/path_access.install

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

revision 1.1.4.2, Mon Aug 27 14:38:39 2007 UTC revision 1.1.4.3, Sat Feb 9 18:29:54 2008 UTC
# Line 1  Line 1 
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':
# Line 21  function path_access_install() { Line 20  function path_access_install() {
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) {
# Line 30  function path_access_install() { Line 46  function path_access_install() {
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    }

Legend:
Removed from v.1.1.4.2  
changed lines
  Added in v.1.1.4.3

  ViewVC Help
Powered by ViewVC 1.1.2