add 'target' argument to 'getActions()' methods

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2545 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2008-04-26 12:43:44 +00:00
parent b92824d978
commit 720a79a34c

View file

@ -86,13 +86,14 @@ class BlogView(ConceptView):
def macro(self): def macro(self):
return view_macros.macros['blog'] return view_macros.macros['blog']
def getActions(self, category='object', page=None): def getActions(self, category='object', page=None, target=None):
blogOwnerId = self.blogOwnerId blogOwnerId = self.blogOwnerId
if blogOwnerId: if blogOwnerId:
principal = self.request.principal principal = self.request.principal
if principal and principal.id != blogOwnerId: if principal and principal.id != blogOwnerId:
return [] return []
return actions.get(category, ['createBlogPost'], view=self, page=page) return actions.get(category, ['createBlogPost'],
view=self, page=page, target=target)
@Lazy @Lazy
def blogOwnerId(self): def blogOwnerId(self):
@ -131,14 +132,14 @@ class BlogPostView(ConceptView):
data['privateComment'] = u'' data['privateComment'] = u''
return data return data
def getActions(self, category='object', page=None): def getActions(self, category='object', page=None, target=None):
actions = [] actions = []
if category == 'portlet' and self.editable: if category == 'portlet' and self.editable:
actions.append(DialogAction(self, title=_(u'Edit Blog Post...'), actions.append(DialogAction(self, title=_(u'Edit Blog Post...'),
description=_(u'Modify blog post.'), description=_(u'Modify blog post.'),
viewName='edit_blogpost.html', viewName='edit_blogpost.html',
dialogName='editBlogPost', dialogName='editBlogPost',
page=page)) page=page, target=target))
#self.registerDojoTextWidget() #self.registerDojoTextWidget()
self.registerDojoDateWidget() self.registerDojoDateWidget()
return actions return actions