Attachment 'CreateNewPage1.6_to_1.9.patch'
Download 1 --- CreateNewPage1.6.py 2011-04-13 00:18:09.695830813 -0400
2 +++ CreateNewPage.py 2011-04-12 23:59:31.750618438 -0400
3 @@ -1,4 +1,4 @@
4 -# -*- coding: iso-8859-1 -*-
5 +# -*- coding: utf-8 -*-
6 """
7 MoinMoin - CreateNewPage Action
8
9 @@ -48,48 +48,55 @@
10 filter = request.cfg.cache.page_template_regex.search
11 results = request.rootpage.getPageList(filter=filter)
12 results.sort()
13 - templates.append("<option selected>%s</option>" % '') # _('<None>')
14 + templates.append("<option selected=\"selected\">%s</option>" % '') # _('<None>')
15 for result in results:
16 templates.append("<option>%s</option>" % result)
17
18 # Assemble form
19 - sn = request.getScriptname()
20 - pi = request.getPathinfo()
21 + sn = request.script_root
22 + pi = request.path
23 action = u"%s%s" % (sn, pi)
24 lang_attr = request.theme.ui_lang_attr()
25
26 form = '''
27 -<form action="%(action)s" method="POST">
28 -<div class="userpref" %(lang_attr)s>
29 -<input type="hidden" name="action" value="CreateNewPage">
30 -<table border="0">
31 -<tr>
32 -<td><strong>%(template)s</strong></td>
33 -<td>
34 -<select name="template" size="1">
35 -%(templates)s
36 -</select>
37 -</td>
38 -</tr>
39 -<tr>
40 -<td><strong>%(input)s</strong></td>
41 -<td><input type="text" name="newpage" value="" size="36"></td>
42 -</tr>
43 -<tr>
44 -<td><strong></strong></td>
45 -<td><input type="submit" name="create" value="%(button)s"></td>
46 -</tr>
47 -</table>
48 -</div>
49 -</form>''' % { 'action': action,
50 - 'lang_attr': lang_attr,
51 - 'template': _('Page Template'),
52 - 'templates': ''.join(templates),
53 - 'input': _('Page Name'),
54 - 'button': _('Create') }
55 + <form action="%(action)s" method="POST">
56 + <div class="userpref" lang="%(lang_attr)s">
57 + <input type="hidden" name="action" value="CreateNewPage" />
58 + <table style="border:0;">
59 + <tr>
60 + <td><span class="bold">%(template)s</span></td>
61 + <td>
62 + <select name="template" size="1">
63 + %(templates)s
64 + </select>
65 + </td>
66 + </tr>
67 + <tr>
68 + <td><span class="bold">%(input)s</span></td>
69 + <td><input type="text" name="newpage" value="" size="36" /></td>
70 + </tr>
71 + <tr>
72 + <td> </td>
73 + <td><input type="submit" name="create" value="%(button)s" /></td>
74 + </tr>
75 + </table>
76 + </div>
77 + </form>''' % { 'action': action,
78 + 'lang_attr': lang_attr,
79 + 'template': _('Page Template'),
80 + 'templates': ''.join(templates),
81 + 'input': _('Page Name'),
82 + 'button': _('Create') }
83
84 # Output form
85 - request.emit_http_headers()
86 + # fixed for 1.9
87 + try:
88 + request.emit_http_headers()
89 + except AttributeError:
90 + try:
91 + request.http_headers()
92 + except AttributeError:
93 + pass
94 request.theme.send_title(_('Create New Page'), pagename=self.pagename, msg=msg)
95 request.write(request.formatter.startContent("content"))
96 request.write(request.formatter.rawHTML(unicode(form)))
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.