]> dev.renevier.net Git - syj.git/blobdiff - application/views/scripts/idx/index.phtml
routes profile
[syj.git] / application / views / scripts / idx / index.phtml
index b69bf38d99e14f30fb9c3516e13c276315737e13..f5b7b6771b37a5ee82079259065a6a9b49ceab44 100644 (file)
@@ -71,12 +71,9 @@ if ($this->errorMsg) {
                 <div id="path-infos-content" class="menu-item">
 
                     <div id="path-directlink-title" class="info-title"><?php echo $this->translate("direct link")?></div>
-                    <div id="path-directlink-content"><?php
-                            $serverUrl = rtrim($this->serverUrl(), '/');
-                            $baseUrl = trim($this->baseUrl(), '/');
-                            $fullBaseUrl = $serverUrl . '/' . ($baseUrl ? ($baseUrl . '/'): '');
+                    <div id="path-directlink-content" class="info-content"><?php
                             $urlcomp = urlencode($this->path->urlcomp ?: $this->path->id);
-                            $href = $fullBaseUrl . 'idx/' . $urlcomp . '?format=raw';
+                            $href = $this->baseUrl() . '/idx/' . $urlcomp . '?format=raw';
                             printf('<a href="%s" title="%s">%s</a>',
                                         $href,
                                         $this->translate('direct link'),
@@ -84,23 +81,34 @@ if ($this->errorMsg) {
                         ?></div>
 
                     <div id="path-export-title" class="info-title"><?php echo $this->translate("export")?></div>
-                    <div id="path-export-content"><?php
-                       $href = $fullBaseUrl . 'geom/' . urlencode($this->path->id) . '.kml';
+                    <div id="path-export-content" class="info-content"><?php
+                       $fileName = $this->path->title ?: $this->path->id;
+                       $href = $this->baseUrl() . '/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/' . urlencode($this->path->id) . '.gpx';
+                       $href = $this->baseUrl() . '/geom/' . rawurlencode($fileName) . '.gpx';
                        printf('<a href="%s" title="%s">%s</a>',
                                         $href,
                                         $this->translate('gpx export'),
                                         $this->translate('gpx export'));
                        ?>
+                </div>
+
+                <?php if ($this->profileActive) { ?>
+                <div id="path-profile-title" class="info-title"><?php echo $this->translate("altitude profile")?></div>
+                <div id="path-profile-content" class="info-content"><?php
+                        $urlcomp = urlencode($this->path->urlcomp ?: $this->path->id);
+                        $href = $this->baseUrl() . '/profile/' . $urlcomp . '.png';
+                        $imgsrc =  $this->addParamToUrl($href, 'size', 'small', true);
+                        printf('<a href="%s"><img src="%s"></a>', $href, $imgsrc);
+                ?></div>
+                <?php }?>
 
 
-                </div>
             </div>
         </div>
     <?php }?>