src/Elements/Bundle/DemiFrontendBundle/Resources/views/Includes/layout/js-config.html.twig line 1

Open in your IDE?
  1. {% set currency = demi_paymentGetCurrency() %}
  2. {% set currency = currency is not empty ? currency : demi_paymentGetDefaultCurrency('symbol') %}
  3. {% set position = demi_core_configuration('getDefaultPosition',[]) %}
  4. {% if position is not empty %}
  5.     {% set pos = {'lat': position.getLatitude(), 'lng': position.getLongitude()} %}
  6. {% else %}
  7.     {% set pos = null %}
  8. {% endif %}
  9. {% set selectableRoomQuantity = tvbPackage is defined and tvbPackage is not null ? false : demi_core_configuration('getEnableUnitSearch',[]) %}
  10. {% do jsConfig().add({
  11.     'lang': app.request.locale,
  12.     'local': app.request.locale ~ "-" ~ demi_findFirstRegionforLanguage(app.request.locale),
  13.     'admin': editmode ? true : false,
  14.     'currency': currency,
  15.     'currencyCode': demi_paymentGetDefaultCurrency(),
  16.     'isClickable': true,
  17.     'isPhone': pimcore_device().isPhone(),
  18.     'maxNightsSelectionCalendar': demi_core_configuration('getMaxNightsSelectionCalendar',[]),
  19.     'tracking': true,
  20.     'googleMapAPIKey': demi_getMapsKey(),
  21.     'accommodationMapDefaultPosition': pos,
  22.     'accommodationMapDefaultZoom': demi_core_configuration('getDefaultZoomLevel',[]),
  23.     'maxProspectSelection': demi_core_configuration('getMaxAmountBrochures',[]),
  24.     'selectableRoomQuantity': selectableRoomQuantity
  25. }) %}
  26. {% set dsiOptions = demi_getDsiOptions() %}
  27. {% set currentDate = carbon().create() %}
  28. {% if dsiOptions['vacancySync'] is defined and  dsiOptions['vacancySync']['days'] is defined and dsiOptions['vacancySync']['days']>0%}
  29.     {% set currentDate = currentDate.addDays(dsiOptions['vacancySync']['days']) %}
  30.     {% do jsConfig().add({'maxDate': currentDate.format('Y') ~ '-' ~ currentDate.format('m') ~ '-' ~ currentDate.format('d') ~'T00:00'}) %}
  31. {% endif %}