1 |
caf16a48
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
function bootstrap_preprocess_bootstrap_carousel(&$variables) {
|
17 |
|
|
$variables['attributes']['class'][] = 'carousel';
|
18 |
|
|
$variables['attributes']['class'][] = 'slide';
|
19 |
|
|
$variables['attributes']['data-ride'] = 'carousel';
|
20 |
|
|
if (empty($variables['attributes']['id'])) {
|
21 |
|
|
$variables['attributes']['id'] = drupal_html_id('carousel');
|
22 |
|
|
}
|
23 |
|
|
$default_data_attributes = array(
|
24 |
|
|
'interval' => 5000,
|
25 |
|
|
'pause' => TRUE,
|
26 |
|
|
'wrap' => TRUE,
|
27 |
|
|
);
|
28 |
|
|
foreach ($default_data_attributes as $name => $value) {
|
29 |
|
|
if ($variables[$name] !== $value) {
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
if (is_bool($variables[$name])) {
|
33 |
|
|
$variables[$name] = $variables[$name] ? 'true' : 'false';
|
34 |
|
|
}
|
35 |
|
|
$variables['attributes']['data-' . $name] = $variables[$name];
|
36 |
|
|
}
|
37 |
|
|
}
|
38 |
|
|
}
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
function bootstrap_process_bootstrap_carousel(&$variables) {
|
50 |
|
|
$variables['target'] = '#' . $variables['attributes']['id'];
|
51 |
|
|
$variables['attributes'] = drupal_attributes($variables['attributes']);
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
foreach ($variables['items'] as $delta => $item) {
|
55 |
|
|
|
56 |
|
|
if (is_string($item)) {
|
57 |
|
|
$variables['items'][$delta] = array(
|
58 |
|
|
'image' => $item,
|
59 |
|
|
);
|
60 |
|
|
}
|
61 |
|
|
|
62 |
|
|
$variables['items'][$delta] += array(
|
63 |
|
|
'title' => NULL,
|
64 |
|
|
'description' => NULL,
|
65 |
|
|
'url' => NULL,
|
66 |
|
|
);
|
67 |
1f623f01
|
Assos Assos
|
|
68 |
|
|
if (!empty($variables['items'][$delta]['title'])) {
|
69 |
|
|
$variables['items'][$delta]['title'] = _bootstrap_filter_xss(render($item['title']));
|
70 |
|
|
}
|
71 |
|
|
|
72 |
|
|
if (!empty($variables['items'][$delta]['description'])) {
|
73 |
|
|
$variables['items'][$delta]['description'] = _bootstrap_filter_xss(render($item['description']));
|
74 |
|
|
}
|
75 |
|
|
|
76 |
caf16a48
|
Assos Assos
|
}
|
77 |
|
|
} |