source: sipes/cord/modules/block/block.install @ 8a8efa8

stableversion-3.0
Last change on this file since 8a8efa8 was b354002, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se agrego el directorio del cord

  • Propiedad mode establecida a 100755
File size: 5.9 KB
Línea 
1<?php
2
3/**
4 * Implementation of hook_schema().
5 */
6function block_schema() {
7  $schema['blocks'] = array(
8    'description' => 'Stores block settings, such as region and visibility settings.',
9    'fields' => array(
10      'bid' => array(
11        'type' => 'serial',
12        'not null' => TRUE,
13        'description' => 'Primary Key: Unique block ID.',
14      ),
15      'module' => array(
16        'type' => 'varchar',
17        'length' => 64,
18        'not null' => TRUE,
19        'default' => '',
20        'description' => "The module from which the block originates; for example, 'user' for the Who's Online block, and 'block' for any custom blocks.",
21      ),
22      'delta' => array(
23        'type' => 'varchar',
24        'length' => 32,
25        'not null' => TRUE,
26        'default' => '0',
27        'description' => 'Unique ID for block within a module.',
28      ),
29      'theme' => array(
30        'type' => 'varchar',
31        'length' => 64,
32        'not null' => TRUE,
33        'default' => '',
34        'description' => 'The theme under which the block settings apply.',
35      ),
36      'status' => array(
37        'type' => 'int',
38        'not null' => TRUE,
39        'default' => 0,
40        'size' => 'tiny',
41        'description' => 'Block enabled status. (1 = enabled, 0 = disabled)',
42      ),
43      'weight' => array(
44        'type' => 'int',
45        'not null' => TRUE,
46        'default' => 0,
47        'size' => 'tiny',
48        'description' => 'Block weight within region.',
49      ),
50      'region' => array(
51        'type' => 'varchar',
52        'length' => 64,
53        'not null' => TRUE,
54        'default' => '',
55        'description' => 'Theme region within which the block is set.',
56      ),
57      'custom' => array(
58        'type' => 'int',
59        'not null' => TRUE,
60        'default' => 0,
61        'size' => 'tiny',
62        'description' => 'Flag to indicate how users may control visibility of the block. (0 = Users cannot control, 1 = On by default, but can be hidden, 2 = Hidden by default, but can be shown)',
63      ),
64      'throttle' => array(
65        'type' => 'int',
66        'not null' => TRUE,
67        'default' => 0,
68        'size' => 'tiny',
69        'description' => 'Flag to indicate whether or not to remove block when website traffic is high. (1 = throttle, 0 = do not throttle)',
70      ),
71      'visibility' => array(
72        'type' => 'int',
73        'not null' => TRUE,
74        'default' => 0,
75        'size' => 'tiny',
76        'description' => 'Flag to indicate how to show blocks on pages. (0 = Show on all pages except listed pages, 1 = Show only on listed pages, 2 = Use custom PHP code to determine visibility)',
77      ),
78      'pages' => array(
79        'type' => 'text',
80        'not null' => TRUE,
81        'description' => 'Contents of the "Pages" block; contains either a list of paths on which to include/exclude the block or PHP code, depending on "visibility" setting.',
82      ),
83      'title' => array(
84        'type' => 'varchar',
85        'length' => 64,
86        'not null' => TRUE,
87        'default' => '',
88        'description' => 'Custom title for the block. (Empty string will use block default title, &lt;none&gt; will remove the title, text will cause block to use specified title.)',
89      ),
90      'cache' => array(
91        'type' => 'int',
92        'not null' => TRUE,
93        'default' => 1,
94        'size' => 'tiny',
95        'description' => 'Binary flag to indicate block cache mode. (-1: Do not cache, 1: Cache per role, 2: Cache per user, 4: Cache per page, 8: Block cache global) See BLOCK_CACHE_* constants in block.module for more detailed information.',
96      ),
97    ),
98    'primary key' => array('bid'),
99    'unique keys' => array(
100      'tmd' => array('theme', 'module', 'delta'),
101    ),
102    'indexes' => array(
103      'list' => array('theme', 'status', 'region', 'weight', 'module'),
104    ),
105  );
106
107  $schema['blocks_roles'] = array(
108    'description' => 'Sets up access permissions for blocks based on user roles',
109    'fields' => array(
110      'module' => array(
111        'type' => 'varchar',
112        'length' => 64,
113        'not null' => TRUE,
114        'description' => "The block's origin module, from {blocks}.module.",
115      ),
116      'delta'  => array(
117        'type' => 'varchar',
118        'length' => 32,
119        'not null' => TRUE,
120        'description' => "The block's unique delta within module, from {blocks}.delta.",
121      ),
122      'rid' => array(
123        'type' => 'int',
124        'unsigned' => TRUE,
125        'not null' => TRUE,
126        'description' => "The user's role ID from {users_roles}.rid.",
127      ),
128    ),
129    'primary key' => array(
130      'module',
131      'delta',
132      'rid'
133    ),
134    'indexes' => array(
135      'rid' => array('rid'),
136    ),
137  );
138
139  $schema['boxes'] = array(
140    'description' => 'Stores contents of custom-made blocks.',
141    'fields' => array(
142      'bid' => array(
143        'type' => 'serial',
144  'unsigned' => TRUE,
145        'not null' => TRUE,
146        'description' => "The block's {blocks}.bid.",
147      ),
148      'body' => array(
149        'type' => 'text',
150        'not null' => FALSE,
151        'size' => 'big',
152        'description' => 'Block contents.',
153      ),
154      'info' => array(
155        'type' => 'varchar',
156        'length' => 128,
157        'not null' => TRUE,
158        'default' => '',
159        'description' => 'Block description.',
160      ),
161      'format' => array(
162        'type' => 'int',
163        'size' => 'small',
164        'not null' => TRUE,
165        'default' => 0,
166        'description' => "Block body's {filter_formats}.format; for example, 1 = Filtered HTML.",
167      )
168    ),
169    'unique keys' => array('info' => array('info')),
170    'primary key' => array('bid'),
171  );
172
173  $schema['cache_block'] = drupal_get_schema_unprocessed('system', 'cache');
174  $schema['cache_block']['description'] = 'Cache table for the Block module to store already built blocks, identified by module, delta, and various contexts which may change the block, such as theme, locale, and caching mode defined for the block.';
175
176  return $schema;
177}
178
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.