method = fg('method')
if method == 'normaliseAndCreatePath' :
- normalizedPath = []
+ normalizedPath, uids = [], []
o = portal
path = fg('path', '').split(' ') # séparateur : 0x09 (tabulation)
for part in path :
id = o.invokeFactory('Portfolio', validId, title=part)
o = o[id]
normalizedPath.append(id)
+ uid = uidtool.register(o)
+ uids.append(uid)
- return '/'.join(normalizedPath)
+ return '%s\n%s' % ('/'.join(normalizedPath), ' '.join([str(uid) for uid in uids]))
elif method == 'uploadPhoto' :
path = fg('normalizedPath')
uid = uidtool.register(photo)
return '%s %s' % (uid, photo.absolute_url())
-elif method == 'deletePhoto' :
- photo = uidtool.queryObject(fg('uid'))
- if photo :
- parent = photo.getParentNode()
- parent.manage_delObjects([photo.getId()])
+elif method in ('deletePhoto', 'deletePortfolio') :
+ o = uidtool.queryObject(fg('uid'))
+ if o :
+ parent = o.getParentNode()
+ parent.manage_delObjects([o.getId()])