Back to index

moin  1.9.0~rc2
Functions | Variables
MoinMoin.macro.EditTemplates Namespace Reference

Functions

def macro_EditTemplates

Variables

list Dependencies = ["language"]

Function Documentation

Definition at line 12 of file EditTemplates.py.

00012 
00013 def macro_EditTemplates(macro):
00014     result = ''
00015     # we don't want to spend much CPU for spiders requesting nonexisting pages
00016     if not macro.request.isSpiderAgent:
00017         # Get list of template pages readable by current user
00018         filterfn = macro.request.cfg.cache.page_template_regexact.search
00019         templates = macro.request.rootpage.getPageList(filter=filterfn)
00020         result = []
00021         if templates:
00022             templates.sort()
00023             page = macro.formatter.page
00024             # send list of template pages
00025             result.append(macro.formatter.bullet_list(1))
00026             for template in templates:
00027                 result.append(macro.formatter.listitem(1))
00028                 result.append(page.link_to(macro.request, template, querystr={'action': 'edit', 'template': template}))
00029                 result.append(macro.formatter.listitem(0))
00030             result.append(macro.formatter.bullet_list(0))
00031         result = ''.join(result)
00032     return result
00033 

Variable Documentation

Definition at line 10 of file EditTemplates.py.