fixes: could not export paths without title v.0.3.8
authorArno Renevier <arno@renevier.net>
Mon, 31 Oct 2011 07:49:18 +0000 (08:49 +0100)
committerArno Renevier <arno@renevier.net>
Mon, 31 Oct 2011 07:49:18 +0000 (08:49 +0100)
application/views/scripts/idx/index.phtml

index 03355a2..da47129 100644 (file)
@@ -85,14 +85,15 @@ if ($this->errorMsg) {
 
                     <div id="path-export-title" class="info-title"><?php echo $this->translate("export")?></div>
                     <div id="path-export-content"><?php
-                       $href = $fullBaseUrl . 'geom/' . rawurlencode($this->path->displayTitle) . '.kml';
+                       $fileName = $this->path->title ?: $this->path->id;
+                       $href = $fullBaseUrl . 'geom/' . rawurlencode($fileName) . '.kml';
                        printf('<a href="%s" title="%s">%s</a>',
                                         $href,
                                         $this->translate('kml export'),
                                         $this->translate('kml export'));
 
                         print '<br>';
-                       $href = $fullBaseUrl . 'geom/' . rawurlencode($this->path->displayTitle) . '.gpx';
+                       $href = $fullBaseUrl . 'geom/' . rawurlencode($fileName) . '.gpx';
                        printf('<a href="%s" title="%s">%s</a>',
                                         $href,
                                         $this->translate('gpx export'),