projects
/
Portfolio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ménage. jslint ok.
[Portfolio.git]
/
skins
/
lrservice.py
diff --git
a/skins/lrservice.py
b/skins/lrservice.py
index
821bad1
..
8b56499
100644
(file)
--- a/
skins/lrservice.py
+++ b/
skins/lrservice.py
@@
-12,9
+12,9
@@
fg = context.REQUEST.form.get
method = fg('method')
if method == 'normaliseAndCreatePath' :
method = fg('method')
if method == 'normaliseAndCreatePath' :
- normalizedPath
=
[]
+ normalizedPath
, uids = [],
[]
o = portal
o = portal
- path = fg('path', '').split('
/'
)
+ path = fg('path', '').split('
') # séparateur : 0x09 (tabulation
)
for part in path :
validId = makeValidId(o, part, allow_dup=1)
if o.hasObject(validId) :
for part in path :
validId = makeValidId(o, part, allow_dup=1)
if o.hasObject(validId) :
@@
-24,8
+24,10
@@
if method == 'normaliseAndCreatePath' :
id = o.invokeFactory('Portfolio', validId, title=part)
o = o[id]
normalizedPath.append(id)
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')
elif method == 'uploadPhoto' :
path = fg('normalizedPath')
@@
-43,3
+45,9
@@
elif method == 'uploadPhoto' :
photo = portfolio[photoId]
uid = uidtool.register(photo)
return '%s %s' % (uid, photo.absolute_url())
photo = portfolio[photoId]
uid = uidtool.register(photo)
return '%s %s' % (uid, photo.absolute_url())
+
+elif method in ('deletePhoto', 'deletePortfolio') :
+ o = uidtool.queryObject(fg('uid'))
+ if o :
+ parent = o.getParentNode()
+ parent.manage_delObjects([o.getId()])