1 ##parameters=createPresentationPage=None, savePresentation=None, deletePresentation=None, defineSample=None, deleteSample=None, ajax=''
2 from Products
.CMFCore
.utils
import getToolByName
3 atool
= getToolByName(context
, 'portal_attachment')
4 attachments
= atool
.getAttachmentsFor(context
)
5 form
= context
.REQUEST
.form
7 if createPresentationPage
and \
8 context
.createPresentationPage() and \
9 context
.setStatus(True, 'Object created.') and \
10 context
.setRedirect(context
, 'object/presentation', ajax
=ajax
):
13 if savePresentation
and \
14 context
.editPresentationPage(form
.get('presentation_page', '')) and \
15 context
.setStatus(True, 'Saved changes.') :
16 attachments
.removeUnusedAttachments(context
.presentation_page
)
17 return context
.setRedirect(context
, 'object/view', ajax
=ajax
)
19 if deletePresentation
and \
20 context
.deletePresentationPage() and \
21 context
.setStatus(True, 'Object deleted.') :
22 attachments
.removeUnusedAttachments('')
23 return context
.setRedirect(context
, 'object/view', ajax
=ajax
)
26 context
.setSamplePhoto(form
.get('path')) and \
27 context
.setStatus(True, 'Saved changes.') and \
28 context
.setRedirect(context
, 'object/view', ajax
=ajax
) :
32 context
.setSamplePhoto(None) and \
33 context
.setStatus(True, 'Saved changes.') and \
34 context
.setRedirect(context
, 'object/view', ajax
=ajax
) :
38 return context
.portfolio_presentation_template(**options
)