remove obsolete path elements when building URL to document
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2975 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
a74579af97
commit
e6be710a0a
1 changed files with 4 additions and 1 deletions
|
@ -85,10 +85,13 @@ class ItemView(BaseView):
|
|||
@Lazy
|
||||
def downloadUrl(self):
|
||||
urlInfo = self.context.externalURLInfo
|
||||
baseUrl = urlInfo.baseUrl
|
||||
while 'bscw.cgi' in baseUrl and not baseUrl.endswith('bscw.cgi'):
|
||||
baseUrl, ignore = baseUrl.rsplit('/', 1)
|
||||
extension = '.' + (mimeTypes.get(self.context.contentType) or ['bin'])[0]
|
||||
if self.title.endswith(extension):
|
||||
extension = ''
|
||||
return '%s/d%s/%s%s' % (urlInfo.baseUrl, urlInfo.path, self.title, extension)
|
||||
return '%s/d%s/%s%s' % (baseUrl, urlInfo.path, self.title, extension)
|
||||
|
||||
@property
|
||||
def breadCrumbs(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue