Attachment 'pagelist-099-01.patch'
Download 1 Index: EventCalendar.py
2 ===================================================================
3 --- EventCalendar.py (revision 167)
4 +++ EventCalendar.py (revision 170)
5 @@ -27,6 +27,7 @@
6 * numcal: # of calendar. default: 1
7 * showlastweekday: shows the event at the last weekday if the recurred weekday is not available. (1: enalbed, 0: disabled). default: 0
8 * showerror: shows error messages below the calendar if event data format is invalid. (1: enalbed, 0: disabled). default: 1
9 + * showpagelist: shows a list of the pages used for event data below the calendar. (1: enalbed, 0: disabled). default: 1
10 * showweeknumber: shows the week number of the year (1: enalbed, 0: disabled). default: 0
11
12
13 @@ -216,6 +217,7 @@
14 numcal = 1
15 showlastweekday = 0
16 showerror = 1
17 + showpagelist = 1
18 showweeknumber = 0
19 debug = 0
20
21 @@ -294,11 +296,13 @@
22
23 if cal_action == 'weekly':
24 html_result = showweeklycalendar()
25 -
26 -
27 +
28 +
29 # format output
30 html.append( html_result )
31 html.append( showmenubar() )
32 +
33 + html.append( show_page_list() )
34
35 if Params.showerror and Globs.errormsg:
36 html.append(u'<p><i><font size="2" color="#aa0000"><ol>%s</ol></font></i>' % Globs.errormsg)
37 @@ -411,6 +415,13 @@
38 except (TypeError, ValueError):
39 Params.showweeknumber = 0
40
41 + # show definition table
42 + # default: 1
43 + try:
44 + Params.showpagelist = int(params.get('showpagelist', '1'))
45 + except (TypeError, ValueError):
46 + Params.showpagelist = 1
47 +
48 # default bgcolor
49 Params.bgcolor = '#ddffdd'
50
51 @@ -666,6 +677,43 @@
52 return html
53
54
55 +def show_page_list():
56 + html = ""
57 + request = Globs.request
58 + formatter = Globs.formatter
59 +
60 + if Params.showpagelist:
61 + source_pages = []
62 +
63 + events, cal_events, labels = loadEvents()
64 +
65 + for eid in events.keys():
66 + event = events[eid]
67 + refer = event['refer']
68 + refer_url = '%s/%s' % (request.getScriptname(), wikiutil.quoteWikinameURL(refer))
69 + targetlink = '<a href="%s">%s</a>' % ( refer_url, wikiutil.escape(refer))
70 + source_pages.append( targetlink )
71 +
72 + from sets import Set
73 + page_set = Set(source_pages)
74 +
75 + html = "\n"
76 + html += formatter.paragraph(1)
77 + html += "Constructed from events defined on these pages"
78 + html += formatter.paragraph(0)
79 + html += "\n"
80 + html += formatter.bullet_list(1)
81 + html += "\n"
82 + for p in page_set:
83 + html += formatter.listitem(1)
84 + html += p
85 + html += formatter.listitem(0)
86 + html += "\n"
87 + html += formatter.bullet_list(0)
88 + html += "\n"
89 +
90 + return html
91 +
92 def getdatefield(str_date):
93 str_year = ''
94 str_month = ''
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.