forked from ding2/ding_content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathding_content.install
179 lines (172 loc) · 5.94 KB
/
ding_content.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
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
* Handle installation related tasks and update functions.
*/
/**
* Implements hook_install().
*/
function ding_content_install() {
ding_content_remove_html5_video_display();
}
/**
* Default settings for file display.
*/
function ding_content_remove_html5_video_display() {
$video_inserts = array(
array(
'name' => 'video__default__file_field_file_audio',
'weight' => 0,
'status' => 0,
'settings' => 'a:4:{s:8:"controls";i:1;s:8:"autoplay";i:0;s:4:"loop";i:0;s:22:"multiple_file_behavior";s:4:"tags";}',
),
array(
'name' => 'video__default__file_field_file_default',
'weight' => 0,
'status' => 0,
'settings' => 's:0:"";',
),
array(
'name' => 'video__default__file_field_file_download_link',
'weight' => 0,
'status' => 0,
'settings' => 'a:1:{s:4:"text";s:20:"Download [file:name]";}',
), array(
'name' => 'video__default__file_field_file_table',
'weight' => 0,
'status' => 0,
'settings' => 's:0:"";',
), array(
'name' => 'video__default__file_field_file_url_plain',
'weight' => 0,
'status' => 0,
'settings' => 's:0:"";',
), array(
'name' => 'video__default__file_field_file_video',
'weight' => 0,
'status' => 0,
'settings' => 'a:6:{s:8:"controls";i:1;s:8:"autoplay";i:0;s:4:"loop";i:0;s:5:"width";s:0:"";s:6:"height";s:0:"";s:22:"multiple_file_behavior";s:4:"tags";}',
), array(
'name' => 'video__default__file_field_media_large_icon',
'weight' => -45,
'status' => 0,
'settings' => 's:0:"";',
), array(
'name' => 'video__default__media_vimeo_image',
'weight' => 2,
'status' => 1,
'settings' => 'a:1:{s:11:"image_style";s:5:"large";}',
), array(
'name' => 'video__default__media_vimeo_video',
'weight' => 1,
'status' => 1,
'settings' => 'a:10:{s:5:"width";s:3:"640";s:6:"height";s:3:"390";s:5:"color";s:0:"";s:8:"protocol";s:7:"http://";s:8:"autoplay";i:0;s:4:"loop";i:0;s:5:"title";i:1;s:6:"byline";i:1;s:8:"portrait";i:1;s:3:"api";i:0;}',
), array(
'name' => 'video__default__media_youtube_image',
'weight' => 2,
'status' => 1,
'settings' => 'a:1:{s:11:"image_style";s:5:"large";}',
), array(
'name' => 'video__default__media_youtube_video',
'weight' => 1,
'status' => 1,
'settings' => 'a:15:{s:5:"width";s:3:"640";s:6:"height";s:3:"390";s:5:"theme";s:4:"dark";s:5:"color";s:3:"red";s:8:"autohide";s:1:"2";s:8:"autoplay";i:0;s:4:"loop";i:0;s:8:"showinfo";i:1;s:14:"modestbranding";i:0;s:3:"rel";i:1;s:8:"nocookie";i:0;s:16:"protocol_specify";i:0;s:8:"protocol";s:6:"https:";s:11:"enablejsapi";i:0;s:6:"origin";s:0:"";}',
), array(
'name' => 'video__teaser__file_field_file_audio',
'weight' => 0,
'status' => 0,
'settings' => 'a:4:{s:8:"controls";i:1;s:8:"autoplay";i:0;s:4:"loop";i:0;s:22:"multiple_file_behavior";s:4:"tags";}',
),
array(
'name' => 'video__teaser__file_field_file_default',
'weight' => 0,
'status' => 0,
'settings' => 's:0:"";',
),
array(
'name' => 'video__teaser__file_field_file_download_link',
'weight' => 0,
'status' => 0,
'settings' => 'a:1:{s:4:"text";s:20:"Download [file:name]";}',
),
array(
'name' => 'video__teaser__file_field_file_table',
'weight' => 0,
'status' => 0,
'settings' => 's:0:"";',
),
array(
'name' => 'video__teaser__file_field_file_url_plain',
'weight' => 0,
'status' => 0,
'settings' => 's:0:"";',
),
array(
'name' => 'video__teaser__file_field_file_video',
'weight' => 0,
'status' => 0,
'settings' => 'a:6:{s:8:"controls";i:1;s:8:"autoplay";i:0;s:4:"loop";i:0;s:5:"width";s:0:"";s:6:"height";s:0:"";s:22:"multiple_file_behavior";s:4:"tags";}',
),
array(
'name' => 'video__teaser__file_field_media_large_icon',
'weight' => 0,
'status' => 0,
'settings' => 's:0:"";',
),
array(
'name' => 'video__teaser__media_vimeo_image',
'weight' => 2,
'status' => 1,
'settings' => 'a:1:{s:11:"image_style";s:5:"large";}',
),
array(
'name' => 'video__teaser__media_vimeo_video',
'weight' => 1,
'status' => 1,
'settings' => 'a:10:{s:5:"width";s:3:"560";s:6:"height";s:3:"340";s:5:"color";s:0:"";s:8:"protocol";s:7:"http://";s:8:"autoplay";i:0;s:4:"loop";i:0;s:5:"title";i:1;s:6:"byline";i:1;s:8:"portrait";i:1;s:3:"api";i:0;}',
),
array(
'name' => 'video__teaser__media_youtube_image',
'weight' => 2,
'status' => 1,
'settings' => 'a:1:{s:11:"image_style";s:5:"large";}',
),
array(
'name' => 'video__teaser__media_youtube_video',
'weight' => 1,
'status' => 1,
'settings' => 'a:15:{s:5:"width";s:3:"560";s:6:"height";s:3:"340";s:5:"theme";s:4:"dark";s:5:"color";s:3:"red";s:8:"autohide";s:1:"2";s:8:"autoplay";i:0;s:4:"loop";i:0;s:8:"showinfo";i:1;s:14:"modestbranding";i:0;s:3:"rel";i:1;s:8:"nocookie";i:0;s:16:"protocol_specify";i:0;s:8:"protocol";s:6:"https:";s:11:"enablejsapi";i:0;s:6:"origin";s:0:"";}',
),
);
foreach ($video_inserts as $video_insert) {
db_insert('file_display')
->fields($video_insert)
->execute();
}
}
/**
* Remove old path alias from ding_path_alias.
*/
function ding_content_update_7000() {
$nids = db_select('node', 'n')
->fields('n', array('nid'))
->condition('type', 'ding_library')
->execute();
foreach ($nids as $nid) {
db_delete('url_alias')
->condition('source', 'node/' . $nid->nid . '/events')
->execute();
db_delete('url_alias')
->condition('source', 'node/' . $nid->nid . '/news')
->execute();
db_delete('url_alias')
->condition('source', 'node/' . $nid->nid . '/about')
->execute();
}
}
/**
* Remove HTML5 video.
*/
function ding_content_upadte_7001() {
ding_content_remove_html5_video_display();
}