backport, bug fix pour geoloc avec ie en https
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 24 Jul 2006 22:52:06 +0000 (22:52 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 24 Jul 2006 22:52:06 +0000 (22:52 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@634 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/geoloc.php
templates/geoloc/getData.tpl
templates/geoloc/index.tpl

index c808fbd..35223ca 100644 (file)
@@ -25,8 +25,8 @@ class GeolocModule extends PLModule
     {
         return array(
             'geoloc'                  => $this->make_hook('default', AUTH_COOKIE),
-            'geoloc/icon.php'         => $this->make_hook('icon',    AUTH_COOKIE),
-            'geoloc/dynamap.php'      => $this->make_hook('dynamap', AUTH_COOKIE),
+            'geoloc/icon.swf'         => $this->make_hook('icon',    AUTH_COOKIE),
+            'geoloc/dynamap.swf'      => $this->make_hook('dynamap', AUTH_COOKIE),
             'geoloc/geolocInit.php'   => $this->make_hook('init',    AUTH_COOKIE),
             'geoloc/getCityInfos.php' => $this->make_hook('city',    AUTH_COOKIE),
             'geoloc/getData.php'      => $this->make_hook('data',    AUTH_COOKIE),
@@ -74,6 +74,7 @@ class GeolocModule extends PLModule
         global $globals;
 
         header("Content-type: application/x-shockwave-flash");
+        header("Pragma:");
 
         if ($globals->geoloc->use_map) {
             readfile($globals->geoloc->icon_path);
@@ -87,17 +88,10 @@ class GeolocModule extends PLModule
     {
         global $globals;
 
-        $querystring = $this->_make_qs();
-        $initfile    = urlencode('geolocInit.php?'.$querystring);
-
-        if (urlencode(Env::v('initfile')) != $initfile) {
-            header("Location: dynamap.php?initfile=$initfile{$querystring}");
-            die();
-        }
-
         header("Content-type: application/x-shockwave-flash");
 
         if ($globals->geoloc->use_map) {
+            header("Pragma:");
             readfile($globals->geoloc->dynamap_path);
             exit;
         }
@@ -112,6 +106,7 @@ class GeolocModule extends PLModule
         $page->changeTpl('geoloc/geolocInit.tpl', NO_SKIN);
 
         header('Content-type: text/xml');
+        header('Pragma:');
         $page->assign('querystring', $this->_make_qs());
     }
 
@@ -120,6 +115,7 @@ class GeolocModule extends PLModule
         global $globals;
 
         header("Content-type: text/xml");
+        header("Pragma:");
 
         $page->changeTpl('geoloc/getCityInfos.tpl', NO_SKIN);
 
@@ -152,6 +148,7 @@ class GeolocModule extends PLModule
             $page->changeTpl('geoloc/getData.tpl', SIMPLE);
         } else {
             header("Content-type: text/xml");
+            header("Pragma:");
             $page->changeTpl('geoloc/getData.tpl', NO_SKIN);
         }
 
index 81a1918..d884cd3 100644 (file)
@@ -29,7 +29,7 @@
       </file>\r
       {if $country.nbPop > 0 or $country.id eq 0}\r
       <map x="{$country.x}" y="{$country.y}" height="{$country.height}" width="{$country.width}" ratio="{$country.rat}"/>\r
-      <icon x="{$country.xPop}" y="{$country.yPop}" nb="{$country.nbPop}" size="{$country.rad}" name="{$country.name|utf8_encode}" yellow="{$country.yellow}"/>\r
+      <icon x="{$country.xPop}" y="{$country.yPop}" nb="{$country.nbPop}" size="{$country.rad}" name="{$country.name|utf8_encode}" green="{if $country.nbPop}{$country.yellow/$country.nbPop}{else}0{/if}" blue="0" alpha="0.7"/>\r
       <moreinfos url="getData.php?{$searchvars}mapid={$country.id}"/>\r
       {/if}\r
     </country>\r
@@ -38,7 +38,7 @@
   <cities>\r
     {foreach from=$cities item="city"}\r
     <city id="{$city.id}" name="{$city.name}">\r
-      <icon x="{$city.x}" y="{$city.y}" nb="{$city.pop}" size="{$city.size}" name="{$city.name}" yellow="{$city.yellow}"/>\r
+      <icon x="{$city.x}" y="{$city.y}" nb="{$city.pop}" size="{$city.size}" name="{$city.name}" green="{if $city.pop}{$city.yellow/$city.pop}{else}0{/if}" blue="0"/>\r
       <moreinfos url="getCityInfos.php?{$searchvars}cityid={$city.id}"/>\r
     </city>\r
     {/foreach}\r
index 8d0983e..f25d38d 100644 (file)
@@ -57,20 +57,28 @@ function searchMapId(f)
 {/if}
 
 </script>
-{if !$dynamap_vars and $localises}
+{if $localises}
   <p class="descr">
     Aujourd'hui {$localises} de nos camarades sont localisés grâce à leurs adresses personnelles.
   </p>
 {/if}
 {if $globals->geoloc->use_map}
   <p class="center">
-    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="600" height="450" id="dynamap" align="middle">
-    <param name="allowScriptAccess" value="sameDomain" />
-    <param name="quality" value="high" />
-    <param name="bgcolor" value="#ffffff" />
-    <param name="movie" value="dynamap{if $dynamap_vars neq 'none'}_{$dynamap_vars|default:"only_current=on"}{/if}.swf" />
-    <embed src="geoloc/dynamap{if $dynamap_vars neq 'none'}_{$dynamap_vars|default:"only_current=on"}{/if}.swf" quality="high" bgcolor="#ffffff" width="600" height="450" name="dynamap" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
-    </object>
+    <embed
+      src="dynamap.swf"
+      quality="high"
+      bgcolor="#ffffff"
+      width="600"
+      height="450"
+      name="dynamap"
+      id="dynamap"
+      align="middle"
+      flashvars="{$flashvars}"
+      type="application/x-shockwave-flash"
+      menu="false"
+      wmode="opaque"
+      salign="tl"
+      pluginspage="{$protocole}://www.macromedia.com/go/getflashplayer" />
   </p>
   <p class="smaller">Carte fournie gracieusement par <a href="http://www.geodesix.com/">Geodesix</a>.</p>
   {if !$no_annu}