[Zope] [python script] problem with AUTHENTICATED_USER
I have another problem (not in relation with AUTHENTICATED_USER): I would like to know if a special function exists to transform special char in html (like HTMLentities in PHP or escape in javascript) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] [python script] problem with AUTHENTICATED_USER
I have problem with my python script. I want to check if a user has a the "manager" role, and add an option in a menu in this case Here is my script: for el in rep.objectValues('Folder'): if el.id=="Administration" and AUTHENTICATED_USER.has_role(self, ["Manager"]): #add option to the menu but Zope displays me an error: Error Type: NameError Error Value: global name 'AUTHENTICATED_USER' is not defined I don't know what is the problem. I use sessionUserFolder (a Zope products), so I think it could be the reason of the problem. Thank you for your help ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re:[Zope] [Zope/DTML] accessing PARENTS url with dtml tag ???
thanks a lot for your help, it works perfectly -original message-- Try this construction: Object: url: Cliff BonviciniJ at keops.net <http://mail.zope.org/mailman/listinfo/zope> wrote: > I have found a similar problem at this url: > <http://mail.zope.org/pipermail/zope/2000-August/115809.html> > > I want to do the same a Kapil, but in DTML. > I tried different solutions: > 1) > 2) > > but I still have the problem. > I wannt to display (in DTML) the absolute URL of the parent, but it doesn't > work: > it displays the absolute url of the CURRENT object. > > could you help me to find the solution please? > > thanks (and excuse for my lack in english) > ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] [Zope/DTML] accessing PARENTS url with dtml tag ???
I have found a similar problem at this url: http://mail.zope.org/pipermail/zope/2000-August/115809.html I want to do the same a Kapil, but in DTML. I tried different solutions: 1) 2) but I still have the problem. I wannt to display (in DTML) the absolute URL of the parent, but it doesn't work: it displays the absolute url of the CURRENT object. could you help me to find the solution please? thanks (and excuse for my lack in english) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] how to expand a branch using dtml-tree ?
I would like to know if its possible to expand a specified branch of a tree,using the dtml-tree tags. I use this tag to display the tree of my site: But I have a problem.I want the chosen branch to keep expanded when the user click on the link. At the moment, when I click on a branch (expanded or not), the page is called buit the tree is initialised (all branches collapsed) So I wonder if its possible to kepp the branch expanded (by adding a special line, or send via post the id of the branch and expand it on the next loading of the page). I add that The tree is in the same page and I don't want to use frames thanks a lot for your help, and scuse for the english ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Zope/python: downloading images from the web and add them to Zope
I would like to know how to add image file from an URL. I created a form with to pissibilities: add an image from a local file , and a image from an url here is my form: get from disk: get from the internethttp://www.monsite.fr/monimage.jpg"; disabled="disabled"> This form call a python script: if REQUEST.sourcePict=="file": pathImgs.manage_addProduct['OFSP'].manage_addImage("pict_"+id, REQUEST.pict_file, title="pictogramme metier", precondition="", content_type="") else: pathImgs.manage_addProduct['OFSP'].manage_addImage("pict_"+id, REQUEST.pict_internet, title="pictogramme metier", precondition="", content_type="") With a locl file it works (case sourcePict=file), but when I want to add images from an url, it doesn't work. I suppose that the second parameter of manage_addImage must be a file type.In the first case, it works , but in the second, the parameter passed is a string (complete url of the image). so how to do? thanks for your answers and excuse me for the lack in English (I'm french) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )