index.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. if (cfr('USERSMAP')) {
  3. $altercfg = $ubillingConfig->getAlter();
  4. if ($altercfg['SWYMAP_ENABLED']) {
  5. set_time_limit(0);
  6. //wysiwyg build map placement
  7. if (wf_CheckPost(array('buildplacing', 'placecoords'))) {
  8. if (cfr('BUILDS')) {
  9. zb_AddressChangeBuildGeo(ubRouting::post('buildplacing'), ubRouting::post('placecoords'));
  10. rcms_redirect("?module=usersmap&locfinder=true");
  11. } else {
  12. show_window(__('Error'), __('Access denied'));
  13. }
  14. }
  15. $ymconf = $ubillingConfig->getYmaps();
  16. $ym_center = $ymconf['CENTER'];
  17. $ym_zoom = $ymconf['ZOOM'];
  18. $ym_type = $ymconf['TYPE'];
  19. $ym_lang = $ymconf['LANG'];
  20. $area = '';
  21. //show map container
  22. um_ShowMapContainer();
  23. //collect biulds geolocation data
  24. $placemarks = um_MapDrawBuilds();
  25. //setting custom zoom and map center if need to find some build
  26. if (wf_CheckGet(array('findbuild'))) {
  27. $ym_zoom = $ymconf['FINDING_ZOOM'];
  28. $ym_center = vf($_GET['findbuild']);
  29. if ($ymconf['FINDING_CIRCLE']) {
  30. $radius = 30;
  31. $area = sm_MapAddCircle($_GET['findbuild'], $radius, __('Search area radius') . ' ' . $radius . ' ' . __('meters'), __('Search area'));
  32. } else {
  33. $area = '';
  34. }
  35. }
  36. if (wf_CheckGet(array('locfinder'))) {
  37. sm_MapInit($ym_center, $ym_zoom, $ym_type, $placemarks, um_MapLocationFinder(), $ym_lang);
  38. } else {
  39. sm_MapInit($ym_center, $ym_zoom, $ym_type, $area . $placemarks, '', $ym_lang);
  40. }
  41. } else {
  42. show_window(__('Error'), __('This module is disabled'));
  43. }
  44. } else {
  45. show_error(__('Access denied'));
  46. }