Browse code

Initial commit

Benjamin Roth authored on16/03/2023 20:22:35
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,185 @@
1
+<?php
2
+if (TL_MODE == 'FE') {
3
+    $GLOBALS['TL_CSS'][] = 'files/base/layout/css/elements/custom-elements/ce_rsce_actionmodal.min.css|static';
4
+}
5
+?>
6
+
7
+
8
+    <div class="modal <?php echo $this->class; ?>" id="actionModal_<?php echo $this->id; ?>"
9
+         tabindex="-1" aria-hidden="true">
10
+        <div class="modal-dialog <?php echo $this->modal_size; ?> modal-dialog-centered"
11
+             data-aos="<?php if ($this->animation_type) : ?><?php echo $this->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
12
+            <div class="modal-content"
13
+                 <?php if ($this->modal_backgroundcolor): ?>style="background-color: <?php echo $this->modal_backgroundcolor; ?>"<?php endif; ?>>
14
+
15
+                <?php if ($this->modal_headline): ?>
16
+                    <div class="modal-header" data-aos="animate__fadeInUp">
17
+                        <h5 class="modal-title">
18
+                            <?php echo $this->modal_headline; ?>
19
+                        </h5>
20
+                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Schließen">
21
+
22
+                        </button>
23
+                    </div>
24
+                <?php endif; ?>
25
+                <div class="modal-body">
26
+
27
+                    <?php if ($this->image): ?>
28
+                        <div class="modal--image mb-2 <?php if ($this->remove_image_padding): ?>without-padding<?php endif; ?>">
29
+                            <?php if (!$this->modal_headline): ?>
30
+                                <button type="button" class="btn--close" data-bs-dismiss="modal" aria-label="Schließen"
31
+                                        style="<?php if ($this->image_right_col_text_color): ?>color: <?php echo $this->image_right_col_text_color; ?><?php endif; ?>">
32
+                                    <i class="fal fa-times"></i>
33
+                                </button>
34
+                            <?php endif; ?>
35
+
36
+
37
+                            <?php if ($this->as_bg): ?>
38
+                                <div class="modal-image--wrapper lazy"
39
+                                     data-bg="<?= Image::get(FilesModel::findByUuid($this->image)->path, null, null, null); ?>"
40
+                                     style="background-position: center center; background-repeat: no-repeat; background-size: cover; <?php if ($this->fixed_height): ?>min-height: <?php echo $this->fixed_height; ?><?php endif; ?>"></div>
41
+                            <?php else: ?>
42
+                                <img style="<?php if ($this->fixed_height): ?>height: <?php echo $this->fixed_height; ?><?php endif; ?>"
43
+                                     class="lazy"
44
+                                     data-src="<?= Image::get(FilesModel::findByUuid($this->image)->path, null, null, null); ?>">
45
+                            <?php endif; ?>
46
+
47
+                            <div class="image--content">
48
+                                <div class="row gy-0 gx-lg-4 align-items-center">
49
+                                    <?php if ($this->image_headline_left): ?>
50
+                                        <div class="col-12 left--col <?php if ($this->image_headline_right || $this->image_text_right): ?>col-lg-5<?php endif; ?>">
51
+                                            <div class="modal-image--big-headline" data-aos="animate__fadeInLeft">
52
+                                                <span><?php echo $this->image_headline_left; ?></span>
53
+                                            </div>
54
+                                        </div>
55
+                                    <?php endif; ?>
56
+                                    <?php if ($this->image_headline_right || $this->image_text_right): ?>
57
+                                        <div class="col-12 d-none d-xl-block right--col <?php if ($this->image_headline_left): ?>col-lg-7<?php endif; ?>">
58
+                                            <div class="modal-image--text-wrapper" data-aos="animate__fadeInRight"
59
+                                                 style="<?php if ($this->image_right_col_background_color): ?>background-color: <?php echo $this->image_right_col_background_color; ?>;<?php endif; ?> <?php if ($this->image_right_col_text_color): ?>color: <?php echo $this->image_right_col_text_color; ?><?php endif; ?>">
60
+                                                <?php if ($this->image_headline_right): ?>
61
+                                                    <span><?php echo $this->image_headline_right; ?></span>
62
+                                                <?php endif; ?>
63
+                                                <?php if ($this->image_text_right): ?><?php echo $this->image_text_right; ?><?php endif; ?>
64
+                                            </div>
65
+                                        </div>
66
+                                    <?php endif; ?>
67
+                                </div>
68
+                            </div>
69
+
70
+                        </div>
71
+                    <?php endif; ?>
72
+
73
+                    <div class="modal--lower-content">
74
+
75
+
76
+                        <div class="row gx-lg-4">
77
+
78
+                            <?php if ($this->image_left): ?>
79
+                                <div class="col-12 col-md-5">
80
+                                    <img class="lazy" data-aos="animate__fadeIn"
81
+                                         data-src="<?= Image::get(FilesModel::findByUuid($this->image_left)->path, null, null, null); ?>
82
+                                ">
83
+                                </div>
84
+                            <?php endif; ?>
85
+
86
+                            <div class="col">
87
+                                <?php if ($this->headline): ?>
88
+                                    <div class="modal--headline" data-aos="animate__fadeInUp">
89
+                                        <span class="h2"><?php echo $this->headline; ?></span>
90
+                                    </div>
91
+                                <?php endif; ?>
92
+
93
+                                <?php if ($this->progress_amount): ?>
94
+                                    <div class="modal--progress mb-3" data-aos="animate__fadeInUp">
95
+                                        <?php if ($this->progress_image): ?>
96
+                                            <div class="progressbar--images">
97
+                                                <?php for ($i = 0; $i <= $this->progress_amount; $i++) : ?>
98
+                                                    <img class="lazy"
99
+                                                         data-src="<?= Image::get(FilesModel::findByUuid($this->progress_image)->path, null, null, null); ?>">
100
+                                                <?php endfor; ?>
101
+                                            </div>
102
+                                        <?php else: ?>
103
+                                            <div class="progress">
104
+                                                <div class="progress-bar progress-bar-striped progress-bar-animated"
105
+                                                     role="progressbar"
106
+                                                     aria-valuenow="<?php echo $this->progress_amount; ?>"
107
+                                                     aria-valuemin="0"
108
+                                                     aria-valuemax="100"
109
+                                                     style="width: <?php echo $this->progress_amount; ?>%"></div>
110
+                                            </div>
111
+                                        <?php endif; ?>
112
+                                    </div>
113
+                                <?php endif; ?>
114
+
115
+                                <?php if ($this->text): ?>
116
+                                    <div class="modal--text" data-aos="animate__fadeInUp">
117
+                                        <?php echo $this->text; ?>
118
+                                    </div>
119
+                                <?php endif; ?>
120
+                            </div>
121
+                        </div>
122
+                    </div>
123
+                </div>
124
+                <?php if ($this->buttons[0]->link_text != "" || $this->show_footer_close) : ?>
125
+                    <div class="modal-footer ">
126
+
127
+                        <?php if ($this->buttons[0]->link_text != "") : ?>
128
+                            <div class="ce--buttons mt-3">
129
+                                <?php foreach ($this->buttons as $b) : ?>
130
+                                    <a class="d-inline-block btn me-2 <?php if ($b->link_size) : ?><?php echo $b->link_size; ?><?php endif; ?> <?php echo $b->link_type; ?>"
131
+                                       data-aos="animate__fadeInUp"
132
+                                       href="<?php echo $b->link_url; ?><?php if ($b->link_betreff) : ?>?subject=<?php echo $b->link_betreff; ?><?php endif; ?>"><?php echo $b->link_text; ?> </a>
133
+                                <?php endforeach ?>
134
+                            </div>
135
+                        <?php endif; ?>
136
+
137
+                        <?php if ($this->show_footer_close && !$this->sponsors): ?>
138
+                            <div class="text-end mt-3">
139
+                                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Schließen
140
+                                </button>
141
+                            </div>
142
+                        <?php endif; ?>
143
+                        <?php if ($this->sponsors): ?>
144
+                            <div class="text-end mt-3">
145
+                                <?php foreach ($this->sponsors as $s) : ?><?php if ($s->link): ?>
146
+                                    <a href="<?php echo $s->link; ?>" target="_blank"><?php endif; ?>
147
+                                    <img class="lazy d-inline-block ms-2"
148
+                                         data-src="<?= Image::get(FilesModel::findByUuid($s->image)->path, null, null, null); ?>">
149
+                                    <?php if ($s->link): ?></a><?php endif; ?><?php endforeach ?>
150
+                            </div>
151
+                        <?php endif; ?>
152
+                    </div>
153
+                <?php endif; ?>
154
+            </div>
155
+        </div>
156
+    </div>
157
+
158
+<?php if (TL_MODE == 'FE'): ?>
159
+    <script type="text/javascript">
160
+        $(window).on('load', function () {
161
+            <?php if ($this->cookie_hide) : ?>
162
+            if (!Cookies.get('actionModal_<?php echo $this->id; ?>')) {
163
+                <?php endif; ?>
164
+                $('#actionModal_<?php echo $this->id; ?>').modal('show');
165
+                <?php if ($this->cookie_hide) : ?>
166
+            }
167
+            <?php endif; ?>
168
+        });
169
+
170
+        <?php if ($this->cookie_hide) : ?>
171
+        var myActionModal = document.getElementById('actionModal_<?php echo $this->id; ?>')
172
+        myActionModal.addEventListener('hidden.bs.modal', function (event) {
173
+
174
+            if (Cookies.get('cookie_basefeatures')) {
175
+                Cookies.set('actionModal_<?php echo $this->id; ?>', 'true', {
176
+                    secure: true,
177
+                    expires: 7,
178
+                    sameSite: 'strict'
179
+                })
180
+            }
181
+
182
+        }, {passive: true})
183
+        <?php endif; ?>
184
+    </script>
185
+<?php endif; ?>
0 186
\ No newline at end of file