templates/module/Map/__google-map-betriebe.html.twig line 1

Open in your IDE?
  1. {% if editmode %}
  2.     {{ include('includes/backend-kopf.html.twig') }}
  3.     {% set tabContentArray = {1: 'Optional', 2: 'Content'} %}
  4.     {% set tab = 1 %}
  5.     <div id="content">        
  6.             {% if tabContentArray is defined and tab in tabContentArray|keys %}
  7.                 {{ admin_tabs(tab, tabContentArray) | raw }}
  8.             {% endif %} 
  9.             <section class="tabContent">
  10.                 <p class="hl">Optionale Einstellung:</p>
  11.                 {% set element = 'artikel' %}
  12.                 <div id="{{ element }} ">
  13.                     {{ pimcore_multiselect(element, {
  14.                             'width': 200,
  15.                             'height': 100,
  16.                             'store': [
  17.                                 ['abstand-top', 'Abstand nach oben'],
  18.                                 ['abstand-bottom', 'Abstand nach unten']
  19.                             ]
  20.                         }) }}
  21.                 </div>
  22.             </section>
  23.              {% if tabContentArray is defined and 2 in tabContentArray|keys %}
  24.                 {{ admin_tabs(2, tabContentArray) | raw }}
  25.                 <section class="tabContent">
  26.                     <div style="100%;height: 35px;">
  27.                     <div style="width: calc(100% - 20px);background-color:#f193f8; border:1px solid #cc21c1; padding:10px;">
  28.                         <strong>Die Zuweisung ist optional!</strong><br/><br/>Diese Zuweisung wird nur benötigt:<br/> - wenn die Seite als Theme
  29.                         'neutral' ist<br/>- oder Betriebe (unterschidlicher Kategorien) auf der Map gezeigt werden sollen
  30.                     </div>
  31.                 </div>
  32.                 <div style="width: 100%;padding-left:37px;margin-top:100px;"><p class="hl">Bitte aus dem Ordner
  33.                         "geo-location_oeffnungszeiten_kontakt"
  34.                         Kategorie-Ordner zuweisen:</p></div>
  35.                  <div class="dragdrop"><span class="parentbox">
  36.                     {{ pimcore_relations("objectGeolocationFolder", {
  37.                             "types": ["object"],
  38.                             "subtypes": {
  39.                                 "object": ["object"]
  40.                             },
  41.                             "classes": ["geolocation"],
  42.                             "width" : "750px",
  43.                             "disableInlineUpload" : true
  44.                         }) }}
  45.                 </span></div>
  46.                 <br/><br/><br/><br/>
  47.                 </section>
  48.             {% endif %}
  49.     </div>
  50.     {{ include('includes/backend-fuss.html.twig') }}
  51. {% else %}
  52.     {% set abstand_top_class = (checkMultiselect(pimcore_multiselect("artikel"),'abstand-top') == true)? ' abstand-top' : '' %}
  53.     {% set abstand_bottom_class = (checkMultiselect(pimcore_multiselect("artikel"),'abstand-bottom') == true)? ' abstand-bottom' : '' %}
  54.     {% set abstandClasses = abstand_top_class ~ abstand_bottom_class %}
  55.     <style media="screen">
  56.         .gmap {
  57.             height: 500px;
  58.         }
  59.         .gmap-filter {
  60.             padding-top: 1em;
  61.             padding-bottom: 0.5em;
  62.         }
  63.         .gmap-filter h5 {
  64.             margin-bottom: 0;
  65.         }
  66.         .gmap-iframe {
  67.             border: none;
  68.             width: 100%;
  69.             height: 100%;
  70.         }
  71.         #gmap-filter-rent:checked ~ [for="gmap-filter-rent"] span {
  72.             border: 1px solid #164194;
  73.             background-color: #164194;
  74.             color: #fff;
  75.         }
  76.         #gmap-filter-homes:checked ~ [for="gmap-filter-homes"] span {
  77.             border: 1px solid #bc9f60;
  78.             background-color: #bc9f60;
  79.             color: #000;
  80.         }
  81.         #gmap-filter-shops:checked ~ [for="gmap-filter-shops"] span {
  82.             border: 1px solid #f1f1f1;
  83.             background-color: #f1f1f1;
  84.             color: #e50000;
  85.         }
  86.     </style>
  87.     {% if document.getProperty('theme_doc') == 'neutral' %}
  88.         <div class="gmap-filter constrainer-maxsize edgepadding">
  89.             <h5> {{ 'map_filter'|trans }}</h5>
  90.             <div style="position:relative;">
  91.                 <input class="hide-checkbox" id="gmap-filter-rent" data-marker-group="rent" type="checkbox" checked="checked"/>
  92.                 <input class="hide-checkbox" id="gmap-filter-shops" data-marker-group="shops" type="checkbox" checked="checked"/>
  93.                 <input class="hide-checkbox" id="gmap-filter-homes" data-marker-group="homes" type="checkbox" checked="checked"/>
  94.                 <label class="gmap-filter-btn" for="gmap-filter-rent"><span>{{ text_rent }}</span></label>
  95.                 <label class="gmap-filter-btn" for="gmap-filter-homes"><span>{{ text_homes }}</span></label>
  96.                 <label class="gmap-filter-btn" for="gmap-filter-shops"><span>{{ text_shops }}</span></label>
  97.             </div>
  98.             <div>
  99.                 <small>{{ 'map_zeigen-oder-verbergen'|trans }}</small>
  100.             </div>
  101.         </div>
  102.     {% endif %}
  103.     <div class="gmap" data-url="">
  104.         <iframe src="" data-messenger="" class="gmap-iframe"></iframe>
  105.     </div>
  106.     <script>
  107.     document.addEventListener('DOMContentLoaded', function() {
  108.       var gmapElement = document.querySelector('.gmap');
  109.       if (gmapElement) {
  110.         gmapElement.dataset.url = window.location.href;
  111.       }
  112.     });
  113.         (function () {
  114.             var moduleName = 'gmap_module'; // naming convention XXX_module
  115.             if (typeof selt === 'undefined') {
  116.                 selt = {
  117.                     modules: {}
  118.                 };
  119.             } else if (!selt.modules) {
  120.                 selt.modules = {};
  121.             }
  122.             selt.modules[moduleName] = {
  123.                 name: moduleName,
  124.                 init: function () {
  125.                     // console.log('init', this.name);
  126.                     gmap_module();
  127.                 }
  128.             };
  129.             function updateLogoBar(logoBarUrl) {
  130.                 $.ajax({
  131.                     type: "GET",
  132.                     url: logoBarUrl
  133.                 }).done(function (result, success, obj) {
  134.                     if (obj.status === 200) {
  135.                         var logobar = $('[data-logobar]');
  136.                         if (logobar.length) {
  137.                             logobar.owlCarousel('destroy');
  138.                             logobar.html(result);
  139.                             selt.modules.logo_slider_module.init();
  140.                         }
  141.                     }
  142.                 });
  143.             };
  144.             function gmap_module() {
  145.                 var messenger = new selt.Messenger(),
  146.                     mapIframe = $('[data-messenger]')[0],
  147.                     mapFrameContent  = mapIframe.contentWindow;
  148.                 // init postMessage
  149.                 messenger.init(mapFrameContent);
  150.                 // add listener command
  151.                 messenger.command['gmap.ready'] = function () {
  152.                     var message = {
  153.                         name: "gmap.coordsToMarker",
  154.                         params: {{ mapArray| json_encode() | raw }}
  155.                     };
  156.                     messenger.sendMessage(message);
  157.                 };
  158.                 messenger.command['gmap.update_logobar'] = function (message) {
  159.                     logoBarUrl = '/marken?lg=de&id=' + message.params.id;
  160.                     updateLogoBar(logoBarUrl);
  161.                 };
  162.                 // show / hide marker groups
  163.                 document.querySelectorAll('[data-marker-group]').forEach(function (item) {
  164.                     item.addEventListener('click', function () {
  165.                         var message = {
  166.                             name: "gmap.toggleGroup",
  167.                             params: {type: this.getAttribute('data-marker-group'), checked: this.checked}
  168.                         };
  169.                         messenger.sendMessage(message);
  170.                     })
  171.                 })
  172.                 mapIframe.setAttribute('src', '/bundles/app/static/init/gmap/gmap.php');
  173.             }
  174.         }());//EOS
  175.     </script>
  176. {% endif %}