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.
  • [get | view] (2005-10-31 18:42:02, 65.4 KB) [[attachment:EventCalendar-080.py]]
  • [get | view] (2005-11-22 17:40:26, 55.4 KB) [[attachment:EventCalendar-090.py]]
  • [get | view] (2006-01-15 16:25:08, 57.2 KB) [[attachment:EventCalendar-091.py]]
  • [get | view] (2006-01-17 08:02:06, 75.4 KB) [[attachment:EventCalendar-092.py]]
  • [get | view] (2006-01-18 03:54:33, 75.6 KB) [[attachment:EventCalendar-093.py]]
  • [get | view] (2006-02-25 09:00:17, 74.8 KB) [[attachment:EventCalendar-094-easytime.py]]
  • [get | view] (2006-02-06 04:39:13, 76.2 KB) [[attachment:EventCalendar-094.py]]
  • [get | view] (2006-04-17 13:21:03, 122.7 KB) [[attachment:EventCalendar-096.py]]
  • [get | view] (2006-05-12 15:26:40, 150.6 KB) [[attachment:EventCalendar-098.py]]
  • [get | view] (2008-11-05 16:58:27, 3.2 KB) [[attachment:EventCalendar-099-01.py.patch]]
  • [get | view] (2006-05-23 09:50:33, 152.3 KB) [[attachment:EventCalendar-099.py]]
  • [get | view] (2008-02-14 05:18:57, 1.0 KB) [[attachment:EventCalendar-099.py.patch]]
  • [get | view] (2009-07-15 23:35:13, 151.1 KB) [[attachment:EventCalendar-099a.py]]
  • [get | view] (2013-01-21 02:05:25, 152.4 KB) [[attachment:EventCalendar-099b.py]]
  • [get | view] (2006-11-30 15:51:59, 1.8 KB) [[attachment:defaults-099-01.patch]]
  • [get | view] (2005-10-31 18:35:06, 5.0 KB) [[attachment:eventcal-080.css]]
  • [get | view] (2005-10-31 18:35:01, 11.3 KB) [[attachment:eventcal-080.py]]
  • [get | view] (2005-11-22 17:40:51, 6.8 KB) [[attachment:eventcal-090.css]]
  • [get | view] (2005-11-22 17:40:40, 18.1 KB) [[attachment:eventcal-090.py]]
  • [get | view] (2006-04-17 13:22:09, 8.9 KB) [[attachment:eventcal-096.css]]
  • [get | view] (2006-02-08 02:31:50, 1.4 KB) [[attachment:eventcalendar-094-01.patch]]
  • [get | view] (2006-11-30 15:52:26, 12.2 KB) [[attachment:label_priority-099-01.patch]]
  • [get | view] (2006-11-16 17:06:28, 1.1 KB) [[attachment:pagelinks-099-01.patch]]
  • [get | view] (2006-11-16 17:06:52, 2.9 KB) [[attachment:pagelist-099-01.patch]]
  • [get | view] (2006-03-29 07:37:02, 118.7 KB) [[attachment:snap-daily.jpg]]
  • [get | view] (2006-01-18 03:52:49, 23.2 KB) [[attachment:snap-list.jpg]]
  • [get | view] (2006-01-18 03:52:40, 37.4 KB) [[attachment:snap-monthly.jpg]]
  • [get | view] (2006-03-29 07:35:54, 43.8 KB) [[attachment:snap-simple.jpg]]
  • [get | view] (2006-01-18 03:53:04, 29.4 KB) [[attachment:snap-upcoming.jpg]]
  • [get | view] (2006-03-29 07:36:43, 161.0 KB) [[attachment:snap-weekly.jpg]]
  • [get | view] (2007-06-12 19:51:39, 55.0 KB) [[attachment:time_bug.PNG]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.