view data/plugin/macro/ @ 625:f4e63b74b969

FormSubmit: adapt to werkzeug MultiDict
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 25 Mar 2013 17:47:30 +0100
parents 03bb9b27aca8
children 127da830be6c
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - LinkTo

    print a list of pages who links to the current page

    @copyright:  2001 Juergen Hermann <>,
                 2011 MoinMoin:ReimarBauer

    @license: GNU GPL, see COPYING for details.
Dependencies = ["namespace"]

def macro_LinkTo(macro, reverse=False):
    request = macro.request
    formatter = request.formatter
    pages = request.rootpage.getPageDict()
    pagelist = pages.keys()
    pageobjs = []
    for name in pagelist:
        if in pages[name].getPageLinks(request):

    links = [''.join([formatter.listitem(1),
                formatter.url(1, href=page.url(request, escape=0)),
                formatter.url(0)]) for page in pageobjs]
    if reverse:
    return ''.join(links)