-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage_background.install
More file actions
179 lines (169 loc) · 4.58 KB
/
page_background.install
File metadata and controls
179 lines (169 loc) · 4.58 KB
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
<?php
/**
* @file
* Page Background Install.
*/
/**
* Implements hook_schema().
*/
function page_background_schema() {
$schema['url_background_images'] = array(
'fields' => array(
'bid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Association ID',
),
'path' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
'description' => 'Page path',
),
'fid' => array(
'type' => 'int',
'default' => 0,
'description' => 'File ID',
),
'weight' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'weight',
),
'bglinkurl' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Background Link url',
),
'bgtext' => array(
'type' => 'text',
'not null' => FALSE,
'description' => 'Background Slogan Text',
),
'bgtextformat' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Background Slogan Text Format',
),
'bgtextlang' => array(
'type' => 'varchar',
'length' => 10,
'not null' => FALSE,
'description' => 'Background Slogan Text Language',
),
'image_alt' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Background Image Alt Text',
),
'image_title' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Background Image Title Text',
),
'created' => array(
'type' => 'int',
'not null' => TRUE,
'description' => 'unix time',
),
),
'description' => 'Store Paths Background Images',
'primary key' => array('bid'),
'indexes' => array(
'path' => array('path'),
'bgtextlang' => array('bgtextlang'),
),
);
return $schema;
}
/**
* Implements hook_update_N().
*/
function page_background_update_7000(&$sandbox) {
db_add_field('url_background_images', 'weight', array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'weight',
));
}
/**
* Implements hook_update_N().
*/
function page_background_update_7100(&$sandbox) {
db_add_field('url_background_images', 'bglinkurl', array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Background Link url',
));
}
/**
* Implements hook_update_N().
*/
function page_background_update_7101(&$sandbox) {
db_add_field('url_background_images', 'bgtext', array(
'type' => 'text',
'not null' => FALSE,
'description' => 'Background Slogan Text',
));
db_add_field('url_background_images', 'bgtextformat', array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Background Slogan Text Format',
));
db_add_field('url_background_images', 'bgtextlang', array(
'type' => 'varchar',
'length' => 2,
'not null' => FALSE,
'description' => 'Background Slogan Text Language',
));
db_add_index('url_background_images', 'bgtextlang', array('bgtextlang'));
}
/**
* Implements hook_update_N().
*/
function page_background_update_7102(&$sandbox) {
db_add_field('url_background_images', 'image_alt', array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Background Image Alt Text',
));
db_add_field('url_background_images', 'image_title', array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Background Image Title Text',
));
}
/**
* Implements hook_requirements().
*/
function page_background_requirements($phase) {
$requirements = array();
// Ensure translations do not break at install time.
$t = get_t();
if ($phase == 'runtime') {
$requirements['jquery.cycle'] = array(
'title' => $t('jQuery Cycle Library'),
);
if (_page_background_cycle_library_path() != FALSE) {
$requirements['jquery.cycle']['value'] = $t('Installed');
$requirements['jquery.cycle']['severity'] = REQUIREMENT_OK;
} else {
$requirements['jquery.cycle']['value'] = $t('Not Installed');
$requirements['jquery.cycle']['severity'] = REQUIREMENT_INFO;
$requirements['jquery.cycle']['description'] = $t("Cycle library not installed. Page Background Slideshows won't be available.");
}
}
return $requirements;
}