Attachment 'PDFIcon1_0_0.py'
Download 1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - PDFIcon macro display a PDF icon which generate a PDF document
4
5 This macro is display a picture which is a link to ?action=PDF to create
6 a PDF document at once. The idear is to show a PDF ready page.
7
8 @copyright: 2006 Raphael Bossek <raphael.bossek@solutions4linux.de>
9 @license: GNU GPL, see COPYING for details.
10
11 2006-08-31 Raphael Bossek
12 * Initial release 1.0.0
13 """
14
15 def execute (macro, args):
16 if not getattr (macro.request.cfg, 'pdficon_imageurl', None):
17 macro.request.cfg.pdficon_imageurl = u'/icons/pdf.png'
18
19 if macro.form.get(u'action', [u''])[0] != 'print':
20 return u'<div style="float:right;"><a href="?action=PDF&generate=1"><img src="%s" style="margin:.3em 0;" title="%s" border="0" /></a></div>\n' % (macro.request.cfg.pdficon_imageurl, macro.request.getText(u'Create PDF document'),)
21 return u''
22
23 # vim:ts=4:sw=4
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.