forked from JeremyEnglert/JointsWP
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheurega-anmeldung.php
92 lines (74 loc) · 2.7 KB
/
eurega-anmeldung.php
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
<?php
/*
Template Name: Eurega Anmeldung
*/
?>
<?php
// Set No-Cache Header
header('Cache-Control: no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
?>
<?php get_header(); ?>
<style>
.anmeldung__container {
position: relative;
width: 100vw;
}
.anmeldung__container iframe {
width: 100%;
}
</style>
<div id="content">
<div id="inner-content" class="row">
<main id="main" class="large-8 medium-8 columns first anmeldung__container" role="main">
<?php
the_post();
get_template_part( 'parts/loop', 'archive' );
?>
<?php
$protocol = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';
$queryParams = array();
if (isset($_GET['previewToken'])) {
$queryParams['previewToken'] = $_GET['previewToken'];
}
if (preg_match('(.*\.eurega\.test)', $_SERVER['HTTP_HOST'])) {
$queryParams['dev'] = 'true';
$apiUrl = "${protocol}api.eurega.test:${_ENV['API_PORT']}/anmeldung/form";
} else {
$apiUrl = "${protocol}api.eurega.org/anmeldung/form";
}
$apiUrl .= ($queryParams) ? '?' . http_build_query($queryParams) : '';
if ($_GET['debug']) {
print("API-URL: " . $apiUrl);
}
$frontendUrl = '';
if ($_GET['url']) {
$frontendUrl = '#!' . $_GET['url'];
}
echo '<iframe id="anmeldung-iframe" src="' . $apiUrl . $frontendUrl . '" scrolling="no" noresize allowfullscreen frameborder="0"></iframe>';
// echo file_get_contents($apiUrl);
?>
</main> <!-- end #main -->
</div> <!-- end #inner-content -->
</div> <!-- end #content -->
<script src="//api.eurega.<?php echo strpos($_SERVER['HTTP_HOST'], '.test') !== false ? "test:${_ENV['API_PORT']}" : 'org'; ?>/components/iframe-resizer/js/iframeResizer.min.js?v=3.6.5"></script>
<script>
(function() {
iFrameResize({
checkOrigin: [
'http://api.eurega.test',
'https://api.eurega.test',
'http://www.eurega.test',
'https://www.eurega.test',
'http://api.eurega.org',
'https://api.eurega.org',
'http://www.eurega.org',
'https://www.eurega.org'
],
heightCalculationMethod: 'documentElementScroll',
moveToAnchor: '#anmeldung_container'
});
}())
</script>
<?php get_footer(); ?>