view MoinMoin/macro/EditTemplates.py @ 1550:a4f0632414da

using request.cfg.cache more
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 14 Sep 2006 22:49:42 +0200
parents e36313297589
children d6b93908e4d9
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - Create an action link

    @copyright: 2004 by Johannes Berg <johannes@sipsolutions.de>
    @license: GNU GPL, see COPYING for details.
"""

import re

Dependencies = ["language"]
from MoinMoin import wikiutil

def execute(self, args):
    # Get list of template pages readable by current user
    filter = self.request.cfg.cache.page_template_regex.search
    templates = self.request.rootpage.getPageList(filter=filter)
    result = []
    if templates:
        templates.sort()
        page = self.formatter.page
        # send list of template pages
        result.append(self.formatter.bullet_list(1))
        for template in templates:
            result.append(self.formatter.listitem(1))
            result.append(page.link_to(self.request, template, querystr={'action': 'edit', 'template': template}))
            result.append(self.formatter.listitem(0))
        result.append(self.formatter.bullet_list(0))
    return ''.join(result)