summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/ctools/page_manager/page_manager.install
blob: b170ce7215913c0d6964440c48fba5dc98de7182 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?php

/**
 * @file
 * Installation routines for page manager module.
 */

/**
 * Implements hook_schema().
 */
function page_manager_schema() {
  // This should always point to our 'current' schema. This makes it relatively easy
  // to keep a record of schema as we make changes to it.
  return page_manager_schema_1();
}

/**
 * Schema version 1 for Panels in D6.
 */
function page_manager_schema_1() {
  $schema['page_manager_handlers'] = array(
    'export' => array(
      'identifier' => 'handler',
      'bulk export' => TRUE,
      'export callback' => 'page_manager_export_task_handler',
      'load callback' => 'page_manager_export_task_handler_load',
      'delete callback' => 'page_manager_delete_task_handler',
      'primary key' => 'did',
      'api' => array(
        'owner' => 'page_manager',
        'api' => 'pages_default',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'did' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'no export' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Unique ID for this task handler. Used to identify it programmatically.',
      ),
      'task' => array(
        'type' => 'varchar',
        'length' => '64',
        'description' => 'ID of the task this handler is for.',
      ),
      'subtask' => array(
        'type' => 'varchar',
        'length' => '64',
        'description' => 'ID of the subtask this handler is for.',
        'not null' => TRUE,
        'default' => '',
      ),
      'handler' => array(
        'type' => 'varchar',
        'length' => '64',
        'description' => 'ID of the task handler being used.',
      ),
      'weight' => array(
        'type' => 'int',
        'description' => 'The order in which this handler appears. Lower numbers go first.',
      ),
      'conf' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Serialized configuration of the handler, if needed.',
        'not null' => TRUE,
        'serialize' => TRUE,
        'object default' => array(),
      ),
    ),
    'primary key' => array('did'),
    'unique keys' => array(
      'name' => array('name'),
    ),
    'indexes' => array('fulltask' => array('task', 'subtask', 'weight')),
  );

  $schema['page_manager_weights'] = array(
    'description' => 'Contains override weights for page_manager handlers that are in code.',
    'fields' => array(
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Unique ID for this task handler. Used to identify it programmatically.',
        'not null' => TRUE,
        'default' => '',
      ),
      'weight' => array(
        'type' => 'int',
        'description' => 'The order in which this handler appears. Lower numbers go first.',
      ),
    ),
    'primary key' => array('name'),
    'indexes' => array(
      'weights' => array('name', 'weight'),
    ),
  );

  $schema['page_manager_pages'] = array(
    'description' => 'Contains page subtasks for implementing pages with arbitrary tasks.',
    'export' => array(
      'identifier' => 'page',
      'bulk export' => TRUE,
      'export callback' => 'page_manager_page_export',
      'api' => array(
        'owner' => 'page_manager',
        'api' => 'pages_default',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'pid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'no export' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Unique ID for this subtask. Used to identify it programmatically.',
      ),
      'task' => array(
        'type' => 'varchar',
        'length' => '64',
        'description' => 'What type of page this is, so that we can use the same mechanism for creating tighter UIs for targeted pages.',
        'default' => 'page',
      ),
      'admin_title' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Human readable title for this page subtask.',
      ),
      'admin_description' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Administrative description of this item.',
        'object default' => '',
      ),
      'path' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'The menu path that will invoke this task.',
      ),
      'access' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Access configuration for this path.',
        'not null' => TRUE,
        'serialize' => TRUE,
        'object default' => array(),
      ),
      'menu' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Serialized configuration of Drupal menu visibility settings for this item.',
        'not null' => TRUE,
        'serialize' => TRUE,
        'object default' => array(),
      ),
      'arguments' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Configuration of arguments for this menu item.',
        'not null' => TRUE,
        'serialize' => TRUE,
        'object default' => array(),
      ),
      'conf' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Serialized configuration of the page, if needed.',
        'not null' => TRUE,
        'serialize' => TRUE,
        'object default' => array(),
      ),
    ),
    'primary key' => array('pid'),
    'unique keys' => array(
      'name' => array('name'),
    ),
    'indexes' => array('task' => array('task')),
  );

  return $schema;
}

/**
 * Implements hook_install().
 */
function page_manager_install() {
  db_update('system')
    ->fields(array('weight' => 99))
    ->condition('name', 'page_manager')
    ->execute();
}