Attachment 'action_MyWikiPages.py'
Download 1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - MyWikiPages action
4
5 Copyright (c) 2006 by Keith Schwols <kcs@fc.intel.com>
6 All rights reserved, see COPYING for details.
7
8 2006 - kcs
9 The MyWikiPages action shows you all the pages in the Wiki that you have created.
10 The output is a list similar to the TitleIndex or WordIndex pages.
11
12 This action requires the MyWikiPages macro code to function.
13 """
14
15 from MoinMoin import config, util, wikiutil
16 import re
17
18 def execute(pagename, request):
19 """
20 optional parameters:
21 @user = UserName you wish a report for. Current User is not specified
22 @max_days = number of days to go back in the log. Default is beginning of time
23 @hide_deleted = 1 if you want skip reporting non-existent pages
24 """
25 my_pages = wikiutil.importPlugin(request.cfg, 'macro', 'MyWikiPages')
26 my_pages.request = request
27 my_pages.formatter = request.formatter
28 my_pages.formatter.page = request.page
29
30 request.http_headers()
31 # This action generate data using the user language
32 request.setContentLanguage(request.lang)
33
34 wikiutil.send_title(request, 'MyWikiPages', pagename=pagename)
35
36 request.write(request.formatter.startContent("content"))
37
38 ##ToDo find a standard MoinMoin mechanism to parse args
39 args=""
40 user = str(request.form.get('user',[''])[0])
41 if user != '':
42 args = "user=%s" % user
43 max_days = int(request.form.get('max_days', [0])[0])
44 if max_days != 0:
45 args = args + ", max_days=%03d" % max_days
46 hide_deleted = int(request.form.get('hide_deleted',[0])[0])
47 if hide_deleted == 1:
48 args = args + ", hide_deleted=1"
49 my_pages(my_pages,args);
50
51 # End content and send footer
52 request.write(request.formatter.endContent())
53 wikiutil.send_footer(request, pagename)
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.