X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/3e0a2c257d49fb162da9c70d2f70194036235166..959d888c17d1403d2eeecc19bc4b5e2c8d1debf6:/skins/custom_control/addtoFavorites.py?ds=inline diff --git a/skins/custom_control/addtoFavorites.py b/skins/custom_control/addtoFavorites.py deleted file mode 100644 index 2816b6f..0000000 --- a/skins/custom_control/addtoFavorites.py +++ /dev/null @@ -1,23 +0,0 @@ -## Script (Python) "addtoFavorites" -##title=Add item to favourites -##parameters=ajax='' - -#TODO : translate messages -#from Products.PlacelessTranslationService.MessageID import MessageIDFactory -#_ = MessageIDFactory('plinn') -_ = lambda x : lambda : x - -portal = context.portal_url.getPortalObject() -ttool = portal.portal_types -homeFolder = portal.portal_membership.getHomeFolder() - -if not hasattr(homeFolder, 'Favorites'): - ttool.constructContent( 'Plinn Folder', homeFolder, 'Favorites', title=str(_('Favorites')) ) - -targetFolder = getattr( homeFolder, 'Favorites' ) -new_id='fav_' + str(int( context.ZopeTime())) -myPath=context.portal_url.getRelativeUrl(context) -targetFolder.invokeFactory( 'Favorite', id=new_id, title=context.TitleOrId(), remote_url=myPath) - -context.setStatus(True, 'Favorite added.') -context.setRedirect(context, 'object/view', ajax=ajax)