[Zope] Managing manage-tabs

Wolfram Kerber wk@gallileus.de
Wed, 5 Dec 2001 17:57:49 +0100


There are two things that you can do:

1) use redirects

2) in your dtml-files insert the header like so:

<dtml-var manage_page_header>
<dtml-with "_(management_view='Your_Manage_Tab_Label')">
<dtml-var manage_tabs>
</dtml-with>


Wolfram

----- Original Message -----
From: "Nico de Boer" <nico@nfg.nl>
To: <zope@zope.org>
Sent: Wednesday, December 05, 2001 5:02 PM
Subject: [Zope] Managing manage-tabs


> Hello,
>
> I'm having a problem with my products managing tabs.
>
> It is a folderish product. I want to create a mailform with this
> product.
>
> I have created a manage tab 'Form', which is made at initialization of
> the product (with manage_addDTMLDocument). The tab 'Form' shows a
> textarea  where the form can be made in html-code . But when I want to
> save the changes I return to the manage tab 'Edit'. When I save the
> changes I want to return to the tab 'Form'. Has this something to do
> with manage_addDTMLDocument ?
> It seems like a simple problem, but I can't fix it. Can anyone help me
> out?
>
> Here is a snippet of my code:
>
> import Globals
> from Globals import DTMLFile, MessageDialog
> from OFS.Folder import Folder
> from OFS.DTMLDocument import *
>
> import string, smtplib, re, urllib
>
> FormMail_Add = DTMLFile('dtml/FormMail_Add', globals())
>
> def manage_FormMail_Add(self, id, title='', formulier='', REQUEST=None):
>     """constructor MailProduct"""
>     self._setObject(id, FormMail(id, title, formulier))
>     if REQUEST is not None:
>     return self.manage_main(self, REQUEST)
>
> class FormMail(Folder):
>     """FormMail object."""
>
>     meta_type = 'Mail Formulier'
>
>     manage_options = (
>     { 'label': 'Edit', 'action': 'manage_main' },
>     { 'label': 'Form', 'action': 'manage_formulier' },
>     { 'label': 'View ', 'action': 'state_engine' },
>     )
>
> ##edit the sender, to, subject of the email form
>     manage_formulier = DTMLFile('dtml/formulierEdit', globals())
>
> ##edit the html-coded form of the email form
>     manage_main = DTMLFile('dtml/FormMail_Edit', globals())
>
>     def __init__(self, id, title='', formulier=''):
>         """Initialization MailProduct"""
>         self.id = id
>         self.title = title
>         self.formulier = self.init_form()
>         self.Add_Formulier()
>
>     def manage_edit(self, title='', REQUEST=None):
>         """
>         Edits content of the MailForm
>         """
>         self.title = string.strip(title)
>         if REQUEST:
>             message= 'Wijzigingen bewaard.'
>             return self.manage_main(self, REQUEST,
>                                     manage_tabs_message=message)
>
>     def Add_Formulier(self):
>         """Add a formulier to the FormMail product"""
>
self.manage_addDTMLDocument('form',title='Formulier',file=self.formulier)
>
>     def Edit_Formulier(self, formulier='', REQUEST=None):
>         """Edit the formulier"""
>         self.formulier = self.safe_unquote(formulier)
>         if REQUEST:
>             message= 'Changes saved.'
>             return self.manage_formulier(self, REQUEST,
manage_tabs_message=message)
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )