Back to index

moin  1.9.0~rc2
quickunlink.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - remove a quicklink from the user's quicklinks
00004 
00005     @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
00006                 2006 MoinMoin:ThomasWaldmann
00007     @license: GNU GPL, see COPYING for details.
00008 """
00009 from MoinMoin.Page import Page
00010 
00011 def execute(pagename, request):
00012     """ Remove the current wiki page from the user's quicklinks """
00013     _ = request.getText
00014     msg = None
00015 
00016     if not request.user.valid:
00017         msg = _("You must login to remove a quicklink.")
00018     elif request.user.isQuickLinkedTo([pagename]):
00019         if request.user.removeQuicklink(pagename):
00020             msg = _('Your quicklink to this page has been removed.')
00021         else: # should not happen
00022             msg = _('Your quicklink to this page could not be removed.')
00023     else:
00024         msg = _('You need to have a quicklink to this page to remove it.')
00025     if msg:
00026         request.theme.add_msg(msg)
00027     Page(request, pagename).send_page()
00028