take all possible extensions into account when building link to document

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3167 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2009-01-21 06:18:13 +00:00
parent ffaab40522
commit 362eab61a5

View file

@ -88,9 +88,11 @@ class ItemView(BaseView):
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 = ''
extensions = '.' + (mimeTypes.get(self.context.contentType) or ['bin'])
extension = extensions[0]
for ext in extensions:
if self.title.endswith('.' + ext):
extension = ''
return '%s/d%s/%s%s' % (baseUrl, urlInfo.path, self.title, extension)
@property