}
if (!$pathMapper->find($idx, $path)) {
- if ($pathMapper->hasexisted($idx)) {
- $api->setCode(410);
- } else {
- $api->setCode(404);
+ if (!$pathMapper->findByTitle($idx, $path)) {
+ if ($pathMapper->hasexisted($idx)) {
+ $api->setCode(410);
+ } else {
+ $api->setCode(404);
+ }
+ return;
}
- return;
}
switch ($ext) {
return $this->_fetchItem($select, $path);
}
+ public function findByTitle($title, Syj_Model_Path $path) {
+ $select = $this->_select();
+ $select->where('title = ?', (string)$title);
+ return $this->_fetchItem($select, $path);
+ }
+
public function findByUrl($url, Syj_Model_Path $path) {
$select = $this->_select();
$select->where('id = ?', (int)$url)->orWhere('urlcomp = ?', (string)$url);
<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';
+ $href = $fullBaseUrl . 'geom/' . rawurlencode($this->path->displayTitle) . '.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 = $fullBaseUrl . 'geom/' . rawurlencode($this->path->displayTitle) . '.gpx';
printf('<a href="%s" title="%s">%s</a>',
$href,
$this->translate('gpx export'),