SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/views/components/fb_google_map.php

  1. <?php
  2. use Sprout\Helpers\Enc;
  3. use Sprout\Helpers\Form;
  4. use Sprout\Helpers\Needs;
  5.  
  6. Needs::addCssInclude('https://unpkg.com/leaflet@1.5.1/dist/leaflet.css', ['integrity' => 'sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==', 'crossorigin' => ''], 'leaflet_css');
  7. Needs::addJavascriptInclude('https://unpkg.com/leaflet@1.5.1/dist/leaflet.js', ['integrity' => 'sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==', 'crossorigin' => ''], 'leaflet_js');
  8. Needs::fileGroup('sprout/map_widget');
  9. ?>
  10.  
  11. <div class="fb-google-map">
  12. <input type="hidden" data-field="lat" name="<?php echo Enc::html($names[0]); ?>" value="<?php echo Enc::html($values[0]); ?>">
  13. <input type="hidden" data-field="lng" name="<?php echo Enc::html($names[1]); ?>" value="<?php echo Enc::html($values[1]); ?>">
  14.  
  15. <?php if (isset($names[2])): ?>
  16. <?php if (!empty($values[2])): ?>
  17. <input type="hidden" data-field="zoom" name="<?php echo Enc::html($names[2]); ?>" value="<?php echo Enc::html($values[2]); ?>">
  18. <?php else: ?>
  19. <input type="hidden" data-field="zoom" name="<?php echo Enc::html($names[2]); ?>" value="9">
  20. <?php endif; ?>
  21. <?php endif; ?>
  22.  
  23. <div class="fb-google-map--search">
  24.  
  25. <div class="field-group-wrap -clearfix">
  26. <div class="field-group-item col col--two-third">
  27. <?php
  28. Form::nextFieldDetails('', false);
  29. echo Form::text('fb-google-map--search-name', ['-wrapper-class' => 'white', 'placeholder' => 'Search...', 'id' => 'fb-google-map--search-name', 'class' => 'fb-google-map--search-name']);
  30. ?>
  31. </div>
  32. <div class="field-group-item col col--one-third">
  33. <button type="button" class="button button-blue icon-after icon-search fb-google-map--search-go">Search</button>
  34. </div>
  35. </div>
  36.  
  37. </div>
  38.  
  39. <div id="map_<?php echo Enc::html($unique); ?>" class="fb-google-map--inner"></div>
  40. </div>
  41.  
  42.