Commit e038e9a6 authored by Nicolas Delaby's avatar Nicolas Delaby

calculate url only once

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20170 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 889f5002
...@@ -364,7 +364,10 @@ class OOoChartWidget(Widget.Widget): ...@@ -364,7 +364,10 @@ class OOoChartWidget(Widget.Widget):
UrlIconOOo='%s/misc_/ERP5OOo/OOo.png' % here.ERP5Site_getAbsoluteUrl() UrlIconOOo='%s/misc_/ERP5OOo/OOo.png' % here.ERP5Site_getAbsoluteUrl()
UrlIconPdf='%s/misc_/ERP5Form/PDF.png' % here.ERP5Site_getAbsoluteUrl() UrlIconPdf='%s/misc_/ERP5Form/PDF.png' % here.ERP5Site_getAbsoluteUrl()
if render_format == 'html' : if render_format == 'html':
field_absolute_url = '%s/%s/%s' % (here.absolute_url(),
form.getId(),
field.getId())
css_class = field.get_value('css_class') css_class = field.get_value('css_class')
format = field.get_value('image_format') format = field.get_value('image_format')
if format == '': if format == '':
...@@ -372,11 +375,9 @@ class OOoChartWidget(Widget.Widget): ...@@ -372,11 +375,9 @@ class OOoChartWidget(Widget.Widget):
display = field.get_value('image_display') display = field.get_value('image_display')
if format in STANDARD_IMAGE_FORMAT_LIST: if format in STANDARD_IMAGE_FORMAT_LIST:
main_content = '''<div class="OOoChartContent"> main_content = '''<div class="OOoChartContent">
<img class="%s" src="%s/%s/%s?render_format=%s&display=%s" title="%s" alt="%s"/"> <img class="%s" src="%s?render_format=%s&display=%s" title="%s" alt="%s"/">
</div>''' % (css_class, </div>''' % (css_class,
here.absolute_url(), field_absolute_url,
form.getId(),
field.getId(),
format, format,
display, display,
title, title,
...@@ -385,19 +386,15 @@ class OOoChartWidget(Widget.Widget): ...@@ -385,19 +386,15 @@ class OOoChartWidget(Widget.Widget):
if format == 'raw': if format == 'raw':
main_content = '''<div class="OOoChartContent"> main_content = '''<div class="OOoChartContent">
<a href="%s/%s/%s?render_format=&display=%s"><img src="%s" alt="OOo"/></a></div> <a href="%s?render_format=&display=%s"><img src="%s" alt="OOo"/></a></div>
''' % (here.absolute_url(), ''' % (field_absolute_url,
form.getId(),
field.getId(),
display, display,
UrlIconOOo) UrlIconOOo)
return main_content return main_content
if format == 'pdf': if format == 'pdf':
main_content = '''<div class="OOoChartContent"> main_content = '''<div class="OOoChartContent">
<a href="%s/%s/%s?render_format=pdf&display=%s"><img src="%s" alt="PDF" /></a> <a href="%s?render_format=pdf&display=%s"><img src="%s" alt="PDF" /></a>
</div>''' % (here.absolute_url(), </div>''' % (field_absolute_url,
form.getId(),
field.getId(),
display, display,
UrlIconPdf) UrlIconPdf)
return main_content return main_content
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment