-
Notifications
You must be signed in to change notification settings - Fork 1
/
md_slider.install
executable file
·101 lines (97 loc) · 2.64 KB
/
md_slider.install
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
<?php
use Drupal\image\Entity\ImageStyle;
/**
* Implements hook_schema().
*/
function md_slider_schema() {
$schema['md_sliders'] = array(
'description' => 'Slideshows table',
'fields' => array(
'slid' => array(
'description' => 'Primary key for identify a slideshow.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'title' => array(
'description' => 'The name of slideshow.',
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
'description' => array(
'description' => 'The description about slideshow is created.',
'type' => 'varchar',
'length' => 1000,
),
'machine_name' => array(
'description' => 'The machine name of slideshow. The uniquied values.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'settings' => array(
'description' => 'A serialized array settings for slideshow.',
'type' => 'blob',
'size' => 'big',
'not null' => TRUE,
),
),
'primary key' => array('slid'),
);
$schema['md_slides'] = array(
'description' => 'Slides table',
'fields' => array(
'sid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Primary key for identify a slide.',
),
'name' => array(
'type' => 'text',
'description' => 'The name of slider.',
'size' => 'big',
'not null' => TRUE,
),
'slid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => "Slideshow id contain this slide.",
),
'position' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Order of slide in slideshow.',
),
'settings' => array(
'type' => 'blob',
'not null' => TRUE,
'size' => 'big',
'description' => "Settings for tab",
),
'layers' => array(
'type' => 'blob',
'not null' => TRUE,
'size' => 'big',
'description' => "Items in this slide",
),
),
'foreign keys' => array(
'md_sliders' => array(
'table' => 'md_sliders',
'columns' => array('slid' => 'slid'),
),
),
'primary key' => array('sid'),
);
return $schema;
}
function md_slider_uninstall() {
// Remove the css directory
file_unmanaged_delete_recursive(file_default_scheme() . '://md-slider-css');
// Remove image style md_slider_thumb
ImageStyle::load('md_slider_thumb')->delete();
}