Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -39,14 +39,14 @@ function template_header($title,$head) {
|
||||
if (maintenanceMode){$maintenanceMode = maintenanceMode();} else {$maintenanceMode = '';}
|
||||
|
||||
$veliti_analytics = '';
|
||||
if (veliti_analytics && $_COOKIE['cookie_consent'] == 'accepted'){
|
||||
$veliti_analytics = '<script src="'.$base_url.'/lib/analytics/analytics.js"></script>';
|
||||
if (veliti_analytics && (!isset($_COOKIE['cookie_consent']) || (isset($_COOKIE['cookie_consent']) && $_COOKIE['cookie_consent'] != 'declined'))){
|
||||
$veliti_analytics = '<script src="'.base_url.'lib/analytics/analytics.js"></script>';
|
||||
}
|
||||
|
||||
$tag_manager_header = '';
|
||||
$tag_manager_body = '';
|
||||
|
||||
if (isset($_COOKIE['cookie_consent']) && $_COOKIE['cookie_consent'] == 'accepted') {
|
||||
if (!isset($_COOKIE['cookie_consent']) || (isset($_COOKIE['cookie_consent']) && $_COOKIE['cookie_consent'] != 'declined')) {
|
||||
|
||||
$tag_manager_header = "
|
||||
<script>
|
||||
@@ -70,6 +70,11 @@ $view = '
|
||||
<link rel="icon" type="image/png" href="'.base_url.icon_image.'">
|
||||
<link href="'.base_url.'custom/css/main.css" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css">
|
||||
<link rel="icon" type="image/png" href="'.base_url.'custom/assets/favicon/favicon-96x96.png" sizes="96x96" />
|
||||
<link rel="shortcut icon" href="'.base_url.'custom/assets/favicon/favicon.ico" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="'.base_url.'custom/assets/favicon/apple-touch-icon.png" />
|
||||
<meta name="apple-mobile-web-app-title" content="MorvalWatches" />
|
||||
<link rel="manifest" href="'.base_url.'custom/assets/favicon/site.webmanifest" />
|
||||
'.$head.'
|
||||
'.$tag_manager_header.'
|
||||
<script>
|
||||
@@ -197,6 +202,9 @@ $view = '
|
||||
<span class="star-rating">★★★★★</span>
|
||||
'.($header_rating ?? 'Client rate 5.0/5.0').'
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://www.valuedshops.com/webshop/Morval-Watches_1223642" class="webwinkelkeurPopup" title="WebwinkelKeur" target="_blank"><img src="https://dashboard.webwinkelkeur.nl/banners/5/1223642/1767769194000.svg" width="18" height="18" alt="WebwinkelKeur Banner"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Header -->
|
||||
@@ -599,10 +607,11 @@ function template_footer() {
|
||||
|
||||
<div class="container">
|
||||
<div class="payment-methods">
|
||||
<img src="'.base_url.'custom/assets/iDEAL.png" alt="iDeal" class="payment-method">
|
||||
<img src="'.base_url.'custom/assets/wero.svg" alt="iDeal" class="payment-method">
|
||||
<img src="'.base_url.'custom/assets/mastercard.png" alt="Mastercard" class="payment-method">
|
||||
<img src="'.base_url.'custom/assets/visa.png" alt="Visa" class="payment-method">
|
||||
<img src="'.base_url.'custom/assets/paypal.png" alt="Pay Pal" class="payment-method">
|
||||
<a href="https://www.valuedshops.com/webshop/Morval-Watches_1223642" class="webwinkelkeurPopup" title="WebwinkelKeur" target="_blank"><img src="https://dashboard.webwinkelkeur.nl/banners/5/1223642/1767769194000.svg" width="32" height="32" alt="WebwinkelKeur Banner"></a>
|
||||
</div>
|
||||
|
||||
<div class="footer-bottom">
|
||||
@@ -879,7 +888,7 @@ EOT;
|
||||
|
||||
// Cookie consent banner
|
||||
function cookie_consent() {
|
||||
if (isset($_COOKIE['cookie_consent']) && $_COOKIE['cookie_consent'] == 'accepted') {
|
||||
if (isset($_COOKIE['cookie_consent'])) {
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -897,8 +906,8 @@ function cookie_consent() {
|
||||
location.reload();
|
||||
};
|
||||
document.getElementById("decline-cookies").onclick = function() {
|
||||
document.cookie = "cookie_consent=declined; path=/; max-age=15768000";
|
||||
document.getElementById("cookie-consent-banner").style.display = "none";
|
||||
document.cookie = "cookie_consent=declined; path=/; max-age=432000";
|
||||
location.reload();
|
||||
};
|
||||
</script>
|
||||
';
|
||||
|
||||
Reference in New Issue
Block a user