Attachment 'css-macro.py'
Download 1 """
2 CSS macro
3
4 by julian.romero@es.francetelecom.com
5 """
6
7 import string
8 from MoinMoin import wikiutil, config, user
9
10 def execute(macro, args):
11 out = ''
12 if args==None:
13 return '<p><strong class="error">La macro CSS necesita una WikiPage como parametro</strong></p>'
14
15 tmp = (args.replace(" ","")+",").split(",")
16 name = tmp[0]
17 site = tmp[1]
18
19 if site==None or site=='':
20 site=''
21 elif site=='wiki':
22 site = 'http://wiki.project.ws'
23 else:
24 site = 'http://%s.project.ws' % (site)
25
26 out += '<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="%s/%s?action=css">' % (site, name)
27 out += "\n"
28 out += '<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="%s/%s/%s?action=css">' % (site,name,macro.request.user.theme_name)
29 out += "\n"
30 return out
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.