Force baseurl because it is used in redirect
[platal.git] / modules / geoloc.php
index fdb8289..49f3895 100644 (file)
@@ -60,7 +60,7 @@ class GeolocModule extends PLModule
 
         $fields = new SFieldGroup(true, advancedSearchFromInput());
         $search = $fields->get_url();
-        if (Env::has('only_current') && Env::get('only_current') != 'on') {
+        if (Env::has('only_current') && Env::v('only_current') != 'on') {
             $search .= '&only_current=';
         }
         $search = preg_replace('/(^|&)mapid=([0-9]+)(&|$)/','\1\3', $search);
@@ -92,7 +92,7 @@ class GeolocModule extends PLModule
         $querystring = $this->_make_qs();
         $initfile    = urlencode('geolocInit.php?'.$querystring);
 
-        if (urlencode(Env::get('initfile')) != $initfile) {
+        if (urlencode(Env::v('initfile')) != $initfile) {
             header("Location: dynamap.php?initfile=$initfile{$querystring}");
             die();
         }
@@ -111,7 +111,7 @@ class GeolocModule extends PLModule
     {
         global $globals;
 
-        new_nonhtml_page('geoloc/geolocInit.tpl', AUTH_COOKIE);
+        $page->changeTpl('geoloc/geolocInit.tpl', NO_SKIN);
 
         header('Content-type: text/xml');
         $page->assign('querystring', $this->_make_qs());
@@ -123,9 +123,7 @@ class GeolocModule extends PLModule
 
         header("Content-type: text/xml");
 
-        new_nonhtml_page('geoloc/getCityInfos.tpl', AUTH_COOKIE);
-        // to debug sql use the next line
-        //new_skinned_page('', AUTH_COOKIE);
+        $page->changeTpl('geoloc/getCityInfos.tpl', NO_SKIN);
 
         require_once('geoloc.inc.php');
         require_once('search.inc.php');
@@ -153,11 +151,10 @@ class GeolocModule extends PLModule
 
         // to debug sql use the next line
         if (Env::has('debug')) {
-            $page->changeTpl('geoloc/getData.tpl');
-            $page->assign('simple', true);
+            $page->changeTpl('geoloc/getData.tpl', SIMPLE);
         } else {
             header("Content-type: text/xml");
-            new_nonhtml_page('geoloc/getData.tpl', AUTH_COOKIE);
+            $page->changeTpl('geoloc/getData.tpl', NO_SKIN);
         }
 
         require_once 'geoloc.inc.php';
@@ -166,7 +163,7 @@ class GeolocModule extends PLModule
         $querystring = $this->_make_qs();
         $page->assign('searchvars', $querystring);
 
-        $mapid = Env::has('mapid') ? Env::getInt('mapid', -2) : false;
+        $mapid = Env::has('mapid') ? Env::i('mapid', -2) : false;
 
         list($countries, $cities) = geoloc_getData_subcountries($mapid, advancedSearchFromInput(), 10);