#100793: Respect Node access settings.
[project/panels.git] / panels.install
CommitLineData
9f3609c9
EM
1<?php
2// $Id$
3
4/**
5 * Install the panels tables
6 */
7function panels_install() {
8 switch ($GLOBALS['dbtype']) {
9 case 'pgsql':
784053c5
EM
10 db_query(<<<EOT
11 CREATE TABLE {panels_info} (
12 did int not null default 0 primary key,
13 title varchar(128),
14 access varchar(128),
15 path varchar(128),
16 css_id varchar(128),
17 layout varchar(32)
18 );
19EOT
20 );
21
22 db_query("CREATE SEQUENCE {panels_info}_id_seq;");
23
24 db_query(<<<EOT
25 CREATE TABLE {panels_area} (
26 did int NOT NULL DEFAULT 0,
27 area varchar(32),
28 type varchar(32),
29 configuration text,
30 position int
31 );
32EOT
33 );
34
35 db_query("CREATE INDEX {panels_area}_did_idx ON {panels_area} (did);");
36 break;
9f3609c9
EM
37 case 'mysql':
38 case 'mysqli':
39 default:
40 db_query(<<<EOT
41 create table {panels_info} (
42 did int(10) not null default 0 primary key,
43 title varchar(128),
44 access varchar(128),
45 path varchar(128),
46 css_id varchar(128),
47 layout varchar(32)
ba91a2ea 48 ) /*!40100 DEFAULT CHARACTER SET utf8 */
9f3609c9
EM
49EOT
50 );
51 db_query(<<<EOT
52 create table {panels_area} (
53 did int(10) not null default 0,
54 area varchar(32),
55 type varchar(32),
56 configuration longtext,
57 position int(5),
58 key (did)
ba91a2ea 59 ) /*!40100 DEFAULT CHARACTER SET utf8 */
9f3609c9
EM
60EOT
61 );
9f3609c9
EM
62 }
63}
64
ba91a2ea
EM
65/**
66 * Update the tables to UTF-8
67 */
68function panels_update_1() {
69 return _system_update_utf8(array('panels_info', 'panels_area'));
70}