Back to index

moin  1.9.0~rc2
Functions
MoinMoin.action.quicklink Namespace Reference

Functions

def execute

Function Documentation

def MoinMoin.action.quicklink.execute (   pagename,
  request 
)
Add the current wiki page to the user quicklinks 

Definition at line 11 of file quicklink.py.

00011 
00012 def execute(pagename, request):
00013     """ Add the current wiki page to the user quicklinks """
00014     _ = request.getText
00015 
00016     if not request.user.valid:
00017         request.theme.add_msg(_("You must login to add a quicklink."), "error")
00018     elif not request.user.isQuickLinkedTo([pagename]):
00019         if request.user.addQuicklink(pagename):
00020             request.theme.add_msg(_('A quicklink to this page has been added for you.'), "info")
00021         else: # should not happen
00022             request.theme.add_msg(_('A quicklink to this page could not be added for you.'), "error")
00023     else:
00024         request.theme.add_msg(_('You already have a quicklink to this page.'))
00025 
00026     Page(request, pagename).send_page()
00027