{% if editmode %}
{{ include('includes/backend-kopf.html.twig') }}
{% set tabContentArray = {1: 'Optional', 2: 'Content'} %}
{% set tab = 1 %}
<div id="content">
{% if tabContentArray is defined and tab in tabContentArray|keys %}
{{ admin_tabs(tab, tabContentArray) | raw }}
{% endif %}
<section class="tabContent">
<p class="hl">Optionale Einstellung:</p>
{% set element = 'artikel' %}
<div id="{{ element }} ">
{{ pimcore_multiselect(element, {
'width': 200,
'height': 100,
'store': [
['abstand-top', 'Abstand nach oben'],
['abstand-bottom', 'Abstand nach unten']
]
}) }}
</div>
</section>
{% if tabContentArray is defined and 2 in tabContentArray|keys %}
{{ admin_tabs(2, tabContentArray) | raw }}
<section class="tabContent">
<div style="100%;height: 35px;">
<div style="width: calc(100% - 20px);background-color:#f193f8; border:1px solid #cc21c1; padding:10px;">
<strong>Die Zuweisung ist optional!</strong><br/><br/>Diese Zuweisung wird nur benötigt:<br/> - wenn die Seite als Theme
'neutral' ist<br/>- oder Betriebe (unterschidlicher Kategorien) auf der Map gezeigt werden sollen
</div>
</div>
<div style="width: 100%;padding-left:37px;margin-top:100px;"><p class="hl">Bitte aus dem Ordner
"geo-location_oeffnungszeiten_kontakt"
Kategorie-Ordner zuweisen:</p></div>
<div class="dragdrop"><span class="parentbox">
{{ pimcore_relations("objectGeolocationFolder", {
"types": ["object"],
"subtypes": {
"object": ["object"]
},
"classes": ["geolocation"],
"width" : "750px",
"disableInlineUpload" : true
}) }}
</span></div>
<br/><br/><br/><br/>
</section>
{% endif %}
</div>
{{ include('includes/backend-fuss.html.twig') }}
{% else %}
{% set abstand_top_class = (checkMultiselect(pimcore_multiselect("artikel"),'abstand-top') == true)? ' abstand-top' : '' %}
{% set abstand_bottom_class = (checkMultiselect(pimcore_multiselect("artikel"),'abstand-bottom') == true)? ' abstand-bottom' : '' %}
{% set abstandClasses = abstand_top_class ~ abstand_bottom_class %}
<style media="screen">
.gmap {
height: 500px;
}
.gmap-filter {
padding-top: 1em;
padding-bottom: 0.5em;
}
.gmap-filter h5 {
margin-bottom: 0;
}
.gmap-iframe {
border: none;
width: 100%;
height: 100%;
}
#gmap-filter-rent:checked ~ [for="gmap-filter-rent"] span {
border: 1px solid #164194;
background-color: #164194;
color: #fff;
}
#gmap-filter-homes:checked ~ [for="gmap-filter-homes"] span {
border: 1px solid #bc9f60;
background-color: #bc9f60;
color: #000;
}
#gmap-filter-shops:checked ~ [for="gmap-filter-shops"] span {
border: 1px solid #f1f1f1;
background-color: #f1f1f1;
color: #e50000;
}
</style>
{% if document.getProperty('theme_doc') == 'neutral' %}
<div class="gmap-filter constrainer-maxsize edgepadding">
<h5> {{ 'map_filter'|trans }}</h5>
<div style="position:relative;">
<input class="hide-checkbox" id="gmap-filter-rent" data-marker-group="rent" type="checkbox" checked="checked"/>
<input class="hide-checkbox" id="gmap-filter-shops" data-marker-group="shops" type="checkbox" checked="checked"/>
<input class="hide-checkbox" id="gmap-filter-homes" data-marker-group="homes" type="checkbox" checked="checked"/>
<label class="gmap-filter-btn" for="gmap-filter-rent"><span>{{ text_rent }}</span></label>
<label class="gmap-filter-btn" for="gmap-filter-homes"><span>{{ text_homes }}</span></label>
<label class="gmap-filter-btn" for="gmap-filter-shops"><span>{{ text_shops }}</span></label>
</div>
<div>
<small>{{ 'map_zeigen-oder-verbergen'|trans }}</small>
</div>
</div>
{% endif %}
<div class="gmap" data-url="">
<iframe src="" data-messenger="" class="gmap-iframe"></iframe>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
var gmapElement = document.querySelector('.gmap');
if (gmapElement) {
gmapElement.dataset.url = window.location.href;
}
});
(function () {
var moduleName = 'gmap_module'; // naming convention XXX_module
if (typeof selt === 'undefined') {
selt = {
modules: {}
};
} else if (!selt.modules) {
selt.modules = {};
}
selt.modules[moduleName] = {
name: moduleName,
init: function () {
// console.log('init', this.name);
gmap_module();
}
};
function updateLogoBar(logoBarUrl) {
$.ajax({
type: "GET",
url: logoBarUrl
}).done(function (result, success, obj) {
if (obj.status === 200) {
var logobar = $('[data-logobar]');
if (logobar.length) {
logobar.owlCarousel('destroy');
logobar.html(result);
selt.modules.logo_slider_module.init();
}
}
});
};
function gmap_module() {
var messenger = new selt.Messenger(),
mapIframe = $('[data-messenger]')[0],
mapFrameContent = mapIframe.contentWindow;
// init postMessage
messenger.init(mapFrameContent);
// add listener command
messenger.command['gmap.ready'] = function () {
var message = {
name: "gmap.coordsToMarker",
params: {{ mapArray| json_encode() | raw }}
};
messenger.sendMessage(message);
};
messenger.command['gmap.update_logobar'] = function (message) {
logoBarUrl = '/marken?lg=de&id=' + message.params.id;
updateLogoBar(logoBarUrl);
};
// show / hide marker groups
document.querySelectorAll('[data-marker-group]').forEach(function (item) {
item.addEventListener('click', function () {
var message = {
name: "gmap.toggleGroup",
params: {type: this.getAttribute('data-marker-group'), checked: this.checked}
};
messenger.sendMessage(message);
})
})
mapIframe.setAttribute('src', '/bundles/app/static/init/gmap/gmap.php');
}
}());//EOS
</script>
{% endif %}