Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
9f53addc
Commit
9f53addc
authored
Oct 30, 2016
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add back ZMI copy/cut/paste/rename actions.
parent
6aa45223
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
2 deletions
+56
-2
src/OFS/CopySupport.py
src/OFS/CopySupport.py
+26
-2
src/OFS/dtml/main.dtml
src/OFS/dtml/main.dtml
+22
-0
src/OFS/interfaces.py
src/OFS/interfaces.py
+8
-0
No files found.
src/OFS/CopySupport.py
View file @
9f53addc
...
...
@@ -230,7 +230,7 @@ class CopyContainer(Base):
notify
(
ObjectClonedEvent
(
ob
))
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
)
return
self
.
manage_main
(
self
,
REQUEST
,
cb_dataValid
=
1
)
elif
op
==
1
:
# Move operation
...
...
@@ -298,7 +298,7 @@ class CopyContainer(Base):
path
=
'%s'
%
cookie_path
(
REQUEST
),
expires
=
'Wed, 31-Dec-97 23:59:59 GMT'
)
REQUEST
[
'__cp'
]
=
None
return
self
.
manage_main
(
self
,
REQUEST
)
return
self
.
manage_main
(
self
,
REQUEST
,
cb_dataValid
=
0
)
return
result
...
...
@@ -407,6 +407,30 @@ class CopyContainer(Base):
return
ob
def
cb_dataValid
(
self
):
# Return true if clipboard data seems valid.
try
:
_cb_decode
(
self
.
REQUEST
[
'__cp'
])
except
Exception
:
return
0
return
1
def
cb_dataItems
(
self
):
# List of objects in the clip board
try
:
cp
=
_cb_decode
(
self
.
REQUEST
[
'__cp'
])
except
Exception
:
return
[]
oblist
=
[]
app
=
self
.
getPhysicalRoot
()
for
mdata
in
cp
[
1
]:
m
=
loadMoniker
(
mdata
)
oblist
.
append
(
m
.
bind
(
app
))
return
oblist
validClipData
=
cb_dataValid
def
_verifyObjectPaste
(
self
,
object
,
validate_src
=
1
):
# Verify whether the current user is allowed to paste the
# passed object into self. This is determined by checking
...
...
src/OFS/dtml/main.dtml
View file @
9f53addc
...
...
@@ -109,6 +109,20 @@
<td align="left" valign="top" width="16"></td>
<td align="left" valign="top">
<div class="form-element">
<dtml-unless dontAllowCopyAndPaste>
<input class="form-element" type="submit" name="manage_renameForm:method"
value="Rename" />
<dtml-if "_.SecurityCheckPermission('Delete objects',this())">
<input class="form-element" type="submit" name="manage_cutObjects:method"
value="Cut" />
</dtml-if>
<input class="form-element" type="submit" name="manage_copyObjects:method"
value="Copy" />
<dtml-if cb_dataValid>
<input class="form-element" type="submit" name="manage_pasteObjects:method"
value="Paste" />
</dtml-if>
</dtml-unless>
<dtml-if "_.SecurityCheckPermission('Delete objects',this())">
<input class="form-element" type="submit" name="manage_delObjects:method"
value="Delete" />
...
...
@@ -126,6 +140,14 @@
There are currently no items in <em>&dtml-title_or_id;</em>
<br /><br />
</div>
<dtml-unless dontAllowCopyAndPaste>
<dtml-if cb_dataValid>
<div class="form-element">
<input class="form-element" type="submit" name="manage_pasteObjects:method"
value="Paste" />
</div>
</dtml-if>
</dtml-unless>
</td>
</tr>
</table>
...
...
src/OFS/interfaces.py
View file @
9f53addc
...
...
@@ -609,6 +609,14 @@ class ICopyContainer(Interface):
"""Clone an object, creating a new object with the given id.
"""
def
cb_dataValid
():
"""Return true if clipboard data seems valid.
"""
def
cb_dataItems
():
"""List of objects in the clip board.
"""
def
_verifyObjectPaste
(
object
,
validate_src
=
1
):
"""Verify whether the current user is allowed to paste the passed
object into self. This is determined by checking to see if the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment