Newer
Older
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
<?php
// $Id$
/**
* @file
* Contains install, update, and uninstall functions for Skinr.
*/
/**
* Implementation of hook_schema.
*/
function delta_schema() {
$schema['delta_theme_settings'] = array(
'description' => t('Stores theme-settings templates that allow overriding the theme settings used based on various contexts.'),
'fields' => array(
'tid' => array(
'description' => 'The unique ID of the theme settings template',
'type' => 'serial',
'length' => 5,
'not null' => TRUE,
),
'name' => array(
'description' => 'The friendly name of this theme settings template.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'system_name' => array(
'description' => 'The system name of this theme settings template.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'theme' => array(
'description' => 'The theme for which this theme settings template is relevant.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'data' => array(
'description' => t('Serialized data which is a copy of the theme settings array stored in the system table based on these overrides'),
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
'serialize' => TRUE,
),
),
'primary key' => array('tid'),
'indexes' => array(
'theme' => array('theme'),
'system_name' => array('system_name'),
'tid' => array('tid'),
),
);
$schema['delta_theme_overrides'] = array(
'description' => t('Override criteria for when to display an alternate theme settings template.'),
'fields' => array(
'did' => array(
'description' => 'The unique ID of the theme settings override',
'type' => 'serial',
'length' => 5,
'not null' => TRUE,
),
'tid' => array(
'description' => t('The template id this override uses. Relates to the tid field in {delta_theme_settings}'),
'type' => 'int',
'length' => 5,
'not null' => TRUE,
),
'name' => array(
'description' => 'The friendly name of this theme settings override.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'system_name' => array(
'description' => 'The system name of this theme settings override.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'condition' => array(
'description' => t('The condition in which this override fires.'),
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'weight' => array(
'description' => t('Weight field to prioritize the override.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'status' => array(
'description' => 'Boolean indicating whether or not this item is enabled.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('did'),
);
return $schema;
}
/**
* Implementation of hook_uninstall().
*/
function delta_uninstall() {
// Remove all skinr variables.
db_delete('variable')
->condition('name', 'delta_%', 'LIKE')
->execute();
}