If I understand what you are trying to do correctly, then all you need is to have your product's icon property be a method that returns the path to the correct icon (Like you would normally have the icon property set to). I use this for a couple of products too. Something like: class MyClass(.... normal stuff ...): """ """ def icon(self): """ """ if self._i_am_broken_: return "misc_/MyProduct/MyClassBrokenIcon" else: return "misc_/MyProduct/MyClassNotBrokenIcon" You've got to love python :) Adrian... -- Adrian Hungate Try Zope - http://www.zope.org - You might like it. If you do, try my Zope products - http://www.zope.org/Members/haqa - You might like them too! -----Original Message----- From: brian.r.brinegar.1 [mailto:brinegar@purdue.edu] Sent: 05 October 2001 22:05 To: zope-dev@zope.org Subject: [Zope-dev] Product Icon I am currently working on a product which has the sole purpose of referencing other objects. One of the properties is the path to another Zope object. Then methods are defined like getObject(), getPath(). We use it as a way to manage news and events that show on several sites that opperate on our Zope server. It allows one group to add a news document in their folder and if another group would like that news item to show on their site they can create a reference to it. Anyway, what happens from time to time is an object is referencing another object when it gets deleted/renamed/moved and that breaks the reference. The product handles this gracefully, however I would like to have the icon change from our standard icon to a broken icon. Any hints? --Brian Brinegar ECN Web Technician MSEE 104 A 494-3106 http://www.geeksoft.net/ _______________________________________________ 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 )
I'm using the CMF, and I've implement an "email_this_page" method, that prompts for an email address, then uses the sendmail tag to email the html contents of a page, like yahoo and other sites commonly do. I want to include the standard_html_header and standard_html_footer in the email message, so it's easy for the recipient to navigate to the web site. But when I tested it out, I noticed I got all the management buttons like "Reject" and "Reconfigure portal" in the email message! Of course they required authentication, but it'd rather render the page as it would be seen by the anonymous user. What I need is something like the effect of a setuid/seteuid system calls, that temporarily downgrades the Zope user to anonymous, while it renders the html headers and footers. As a stab in the dark, I tried changing the proxy role of the dtml script that uses the sendmail tag and renders the html, but I still got the management buttons. Is it as simple as temporarily changing some properties of the request? Or is there an extension or product that can do that? Thanks! http://www.WorldTradeCenterDisaster.com:8080/Memorial -Don
Hi Don, Instead of including the rendered standard_html_header and standard_html_footer in the emailed page, why not have a "emailed_html_header" and "emailed_html_footer", which are prerendered copies of a toolbar and other things as seen by the anonymous user? The setuid/setgid thing is tricky and since the outcomes will be about the same (always showing folks an anonymous-based toolbar), including static content is easier. - C Don Hopkins wrote:
I'm using the CMF, and I've implement an "email_this_page" method, that prompts for an email address, then uses the sendmail tag to email the html contents of a page, like yahoo and other sites commonly do. I want to include the standard_html_header and standard_html_footer in the email message, so it's easy for the recipient to navigate to the web site. But when I tested it out, I noticed I got all the management buttons like "Reject" and "Reconfigure portal" in the email message! Of course they required authentication, but it'd rather render the page as it would be seen by the anonymous user.
What I need is something like the effect of a setuid/seteuid system calls, that temporarily downgrades the Zope user to anonymous, while it renders the html headers and footers. As a stab in the dark, I tried changing the proxy role of the dtml script that uses the sendmail tag and renders the html, but I still got the management buttons. Is it as simple as temporarily changing some properties of the request? Or is there an extension or product that can do that? Thanks!
http://www.WorldTradeCenterDisaster.com:8080/Memorial
-Don
_______________________________________________ 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 )
-- Chris McDonough Zope Corporation http://www.zope.org http://www.zope.com "Killing hundreds of birds with thousands of stones"
participants (3)
-
Adrian Hungate -
Chris McDonough -
Don Hopkins