added viewName parameter to action, + adjustment of building URL
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2300 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
2740774b3d
commit
5263601212
1 changed files with 13 additions and 2 deletions
|
@ -37,6 +37,7 @@ class Action(object):
|
|||
condition = True
|
||||
permission = None
|
||||
url = '.'
|
||||
viewName = ''
|
||||
targetWindow = ''
|
||||
title = ''
|
||||
description = ''
|
||||
|
@ -56,14 +57,24 @@ class Action(object):
|
|||
|
||||
@Lazy
|
||||
def url(self):
|
||||
return self.view.url
|
||||
return self.getActionUrl(self.view.url)
|
||||
|
||||
def getActionUrl(self, baseUrl):
|
||||
if self.viewName:
|
||||
return '/'.join((baseUrl, self.viewName))
|
||||
else:
|
||||
return baseUrl
|
||||
|
||||
|
||||
class TargetAction(Action):
|
||||
|
||||
@Lazy
|
||||
def url(self):
|
||||
return self.view.virtualTargetUrl
|
||||
if self.page is None:
|
||||
baseUrl = self.view.virtualTargetUrl
|
||||
else:
|
||||
baseUrl = self.page.virtualTargetUrl
|
||||
return self.getActionUrl(baseUrl)
|
||||
|
||||
|
||||
class DialogAction(Action):
|
||||
|
|
Loading…
Add table
Reference in a new issue