Extended Management Tabs Mixin Product
Extended Management Tabs Mixin Product
Version 0.0.5
Demo
Try the demo product BeingBoring.
Screenshots
Have a look at the Screenshots, click on the (Edit, MyMenu1 or MyMenu4) for a simulation of the behaviour.
Wiki
ExtendedManagmentTabsMixinWiki
Credits
htrd for "How-To: FunctionTemplate".
Install
Untar the ExtendedManagmentTabsMixin.0.0.5.tgz in Zope's root folder and it will unpack to directories:
./lib/python/Products/ExtendedManagmentTabs ./lib/python/Shared/Torped
Usage
In your product include the following code to make use of ExtendedManagmentTabsMixin:
...class YourClass(ExtendedManagmentTabs.ExtendedManagmentTabs, ...):
...
# this is your sub menu, usual manage_options syntax manage_main_submenu = ( { 'label':
Sub Menu Item 1
, 'action':manage_main_sub1
, 'submenu': None, 'help':( "YourClass","manage_main_sub1.stx") }, ... )# this is your regular manage_options with a new entry
submenu
that points # at the your submenu as defined above. manage_options = ( { 'label':Edit
, 'action':manage_main
, 'submenu': manage_main_submenu, 'help':( "YourClass","manage_main.stx") }, ... )# this rows precompiles your menu hieraki into a indexed structure. _v_manage_options_label_index = ExtendedManagmentTabs.createManageIndex(manage_options=manage_options)
...
# DTML file that saves the title by calling title, or what ever you want it to do. manage_main = HTMLFile("manage_main", globals())
def manage_edit(self, title, REQUEST=None): """This method is called from the DTML method manage_main.""" self.title = title
...
# classic syntax if REQUEST is not None: return self.manage_main(self,REQUEST,management_view="Edit", manage_tabs_message="The object have been changed")
# or alternative syntax if REQUEST is not None: return self.manage_main(self,REQUEST,management_view=("Edit",), manage_tabs_message="The object have been changed")
# If this method should represent the Sub Menu Item 1: if REQUEST is not None: return self.manage_main_sub1(self,REQUEST, management_view=("Edit","Sub Menu Item 1"), manage_tabs_message="The object have been changed")