[CMF-checkins] CVS: Products/CMFDefault/skins/zpt_control - addtoFavorites.py:1.1

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Jul 6 11:47:42 EDT 2004


Update of /cvs-repository/Products/CMFDefault/skins/zpt_control
In directory cvs.zope.org:/tmp/cvs-serv29515/CMFDefault/skins/zpt_control

Added Files:
	addtoFavorites.py 
Log Message:
- copied addtoFavorites.py from skins/control
- removed dependency on getActionById()


=== Added File Products/CMFDefault/skins/zpt_control/addtoFavorites.py ===
##parameters=
##
from Products.CMFCore.utils import getToolByName

mtool = getToolByName(script, 'portal_membership')
utool = getToolByName(script, 'portal_url')

home = mtool.getHomeFolder()
if not hasattr(home, 'Favorites'):
    home.manage_addPortalFolder(id='Favorites', title='Favorites')
favorites = getattr(home, 'Favorites')

f_id = 'fav_' + str( int( context.ZopeTime() ) )
f_title = context.TitleOrId()
f_url = utool.getRelativeUrl(context)
favorites.invokeFactory('Favorite', id=f_id, title=f_title, remote_url=f_url)

context.setRedirect(context, 'object/view')



More information about the CMF-checkins mailing list