-
Notifications
You must be signed in to change notification settings - Fork 0
/
offline.php
100 lines (91 loc) · 3.95 KB
/
offline.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
93
94
95
96
97
98
99
100
<?php
defined('MAUTIC_OFFLINE') or die('access denied');
// Get the URLs base path
$inDev = strpos($_SERVER['SCRIPT_NAME'], 'index_dev.php') !== false;
$base = str_replace(['index.php', 'index_dev.php'], '', $_SERVER['SCRIPT_NAME']);
// Determine if there is an asset prefix
$root = __DIR__;
include $root.'/app/config/paths.php';
$assetPrefix = $paths['asset_prefix'];
if (!empty($assetPrefix)) {
if (substr($assetPrefix, -1) == '/') {
$assetPrefix = substr($assetPrefix, 0, -1);
}
}
$assetBase = $assetPrefix.$base.$paths['assets'];
// Allow a custom error page
if (file_exists(__DIR__.'/custom_offline.php')) {
include __DIR__.'/custom_offline.php';
exit;
}
if (empty($inline)): ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="author" content="">
<title>Site is offline</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" type="image/x-icon" href="<?php echo $assetBase.'/images/favicon.ico'; ?>"/>
<link rel="stylesheet" href="<?php echo $assetBase.'/css/libraries.css'; ?>"/>
<link rel="stylesheet" href="<?php echo $assetBase.'/css/app.css'; ?>"/>
</head>
<body>
<div class="container">
<?php endif; ?>
<div class="row">
<?php if (!empty($error)): ?>
<div class="<?php echo (!empty($error['isPrevious']) || $inline) ? 'col-sm-12' : 'col-sm-offset-2 col-sm-8'; ?>">
<div class="bg-white pa-sm" style=" word-wrap: break-word;<?php if (empty($error['isPrevious']) && !$inline): ?> margin-top:100px;<?php endif; ?>">
<?php if ($inline): ?>
<h3><i class="fa fa-warning fa-fw text-danger pull-left"></i><?php echo $error['message']; ?></h3>
<h6 class="text-muted"><?php echo $error['file'].':'.$error['line']; ?></h6>
<?php else: ?>
<div class="text-center"><i class="fa fa-warning fa-5x"></i></div>
<div class="alert alert-danger">
<div><?php echo $error['message']; ?></div>
<div class="text-muted small text-right mt-10"><?php echo $error['file'].':'.$error['line']; ?></div>
</div>
<?php endif; ?>
<?php if (!empty($error['trace'])): ?>
<div class="well well-sm" tabindex="-1" style="<?php echo (empty($inline)) ? '' : 'max-height: 100px; overflow: scroll;'; ?>" onclick="this.focus();">
<?php
if (is_array($error['trace']) && !empty($error['trace'])):
$traces = $error['trace'];
include __DIR__.'/app/bundles/CoreBundle/Views/Exception/traces.html.php';
else:
echo '<pre>'.$error['trace'].'</pre>';
endif;
?>
<div class="clearfix"></div>
</div>
<?php endif; ?>
<div id="previous"></div>
</div>
</div>
<?php elseif ($inline): ?>
<div class="col-xs-12">
<h3><i class="fa fa-warning fa-fw text-danger"></i><?php echo $message; ?></h3>
<?php if (!empty($submessage)): ?>
<h4 class="mt-15"><?php echo $submessage; ?></h4>
<?php endif; ?>
</div>
<?php else: ?>
<div class="col-sm-offset-3 col-sm-6">
<div class="bg-white pa-lg text-center" style="margin-top:100px;">
<i class="fa fa-warning fa-5x"></i>
<h2><?php echo $message; ?></h2>
<?php if (!empty($submessage)): ?>
<h4 class="mt-15"><?php echo $submessage; ?></h4>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>
<?php if (empty($inline)): ?>
</div>
</body>
</html>
<?php endif; ?>