Hi, Where in the Zope src is the menu labeled "Select type to add..." created? We want to change this pulldown menu but I'm not familiar w/ the Zope src code. I started w/ the obvious: after pointing my browser at http:// myhost:8080/manage and getting the Zope page, I did Netscape -> View -> Page Source and see the 3 frames. I think the menu I'm interested in is in the frame w/ src="http://myhost:8080/manage_workspace" w/ name= "manage_main". So I searched thru. the src, grep'ng for some strings and located "manage_main" in ZopePageTemplate.py. But that's as far as I got. I'm new to Zope, don't have time to step thru. all the code, but gotta dive in and make some changes to this menu. Please help! And if there's some documentation that describes the code, I'd be stoked. Thanks, -- marc ---------------------------------------------------------------- Marc Perry MPerry@lbl.gov Lawrence Berkeley National Laboratory WORK# (510) 486-6786 1 Cyclotron Road FAX# (510) 486-6363 Berkeley, CA 94720 MS: 50A-3111
ZOPEINSTANCE/lib/python/OFS/dtml/main.dtml greetings buelent
Marcia Perry wrote:
Where in the Zope src is the menu labeled "Select type to add..." created?
Generally you cannot change this menu. At least not in the standard Zope management interface. A Zope with a management interface that was handicapped in this way could also be pretty dangerous. You can however do it in your own products. So if you want your user to be able to only add some kind of objetcs in a folder, you create a ZClass or a Python products. Then you can decide which products can be added to your own folder. If you create a ZClass you should just subclass ObjectManager, and then inside the product there will be a tab called "Subobjects" where you can select possible "legal" objects that the user can add. --------------------------------- If you really want to get dirty. Which I would *strongly* advice against, you must look in: <ZOPE>\lib\python\OFS\ObjectManager.py and overwrite "all_meta_types()". This functions returns a list of tuples, telling which objects to be added to the "add *" selectbox. But it WILL bite you later. For further info google for "meta_types" and "all_meta_types" regards Max M
If you want to remove (Hide) items in this menu, the easiest way is to download my PatchKit product ( http://www.zope.org/Members/haqa/PatchKit ) which allows you to choose items to hide from the "select..." list. If you want to add items to the list, the easiest way is to look around Zope.org's Products section ( http://www.zope.org/Products ) which contains MANY products that you can add to the list simply by installing them. Hope this helps, and hope you enjoy learning and using Zope. (I did, and still do!) Adrian... -- The difficulty of tactical maneuvering consists in turning the devious into the direct, and misfortune into gain. - Sun Tzu ----- Original Message ----- From: "Marcia Perry" <mperry@lbl.gov> To: <zope-dev@zope.org> Sent: Friday, March 15, 2002 3:02 AM Subject: [Zope-dev] Modifying a menu
Hi,
Where in the Zope src is the menu labeled "Select type to add..." created?
We want to change this pulldown menu but I'm not familiar w/ the Zope src code. I started w/ the obvious: after pointing my browser at http:// myhost:8080/manage and getting the Zope page, I did Netscape -> View -> Page Source and see the 3 frames. I think the menu I'm interested in is in the frame w/ src="http://myhost:8080/manage_workspace" w/ name= "manage_main". So I searched thru. the src, grep'ng for some strings and located "manage_main" in ZopePageTemplate.py. But that's as far as I got. I'm new to Zope, don't have time to step thru. all the code, but gotta dive in and make some changes to this menu.
Please help! And if there's some documentation that describes the code, I'd be stoked.
Thanks, -- marc ---------------------------------------------------------------- Marc Perry MPerry@lbl.gov Lawrence Berkeley National Laboratory WORK# (510) 486-6786 1 Cyclotron Road FAX# (510) 486-6363 Berkeley, CA 94720 MS: 50A-3111
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
but gotta dive in and make some changes to this menu.
It depends on what type of change you want to make. This menu does not exist in it's finished form anywhere in the code, but it it's contents are created each time you view it, and modified depending on several parameters. So modifying it is not just a question of finding out where it's created.
participants (5)
-
Adrian Hungate -
buelent aldemir -
Lennart Regebro -
Marcia Perry -
Max M