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
2b9aff10
Commit
2b9aff10
authored
May 11, 2000
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector #1065: add multi-rename
parent
0c99ceab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
23 deletions
+31
-23
lib/python/OFS/CopySupport.py
lib/python/OFS/CopySupport.py
+16
-2
lib/python/OFS/renameForm.dtml
lib/python/OFS/renameForm.dtml
+15
-21
No files found.
lib/python/OFS/CopySupport.py
View file @
2b9aff10
...
...
@@ -83,7 +83,7 @@
#
##############################################################################
__doc__
=
"""Copy interface"""
__version__
=
'$Revision: 1.4
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
9
$'
[
11
:
-
2
]
import
sys
,
string
,
Globals
,
Moniker
,
tempfile
,
ExtensionClass
from
marshal
import
loads
,
dumps
...
...
@@ -102,7 +102,7 @@ class CopyContainer(ExtensionClass.Base):
__ac_permissions__
=
(
(
'View management screens'
,
(
'manage_cutObjects'
,
'manage_copyObjects'
,
'manage_pasteObjects'
,
'manage_renameForm'
,
'manage_renameObject'
,)),
'manage_renameForm'
,
'manage_renameObject
s'
,
'manage_renameObjects
'
,)),
)
...
...
@@ -120,6 +120,9 @@ class CopyContainer(ExtensionClass.Base):
def
manage_CopyContainerFirstItem
(
self
,
REQUEST
):
return
self
.
_getOb
(
REQUEST
[
'ids'
][
0
])
def
manage_CopyContainerAllItems
(
self
,
REQUEST
):
return
map
(
lambda
i
,
s
=
self
:
s
.
_getOb
(
i
),
tuple
(
REQUEST
[
'ids'
]))
def
manage_cutObjects
(
self
,
ids
,
REQUEST
=
None
):
"""Put a reference to the objects named in ids in the clip board"""
if
type
(
ids
)
is
type
(
''
):
...
...
@@ -241,6 +244,17 @@ class CopyContainer(ExtensionClass.Base):
manage_renameForm
=
Globals
.
HTMLFile
(
'renameForm'
,
globals
())
def
manage_renameObjects
(
self
,
ids
,
new_ids
,
REQUEST
=
None
):
"""Rename several sub-objects"""
if
len
(
ids
)
!=
len
(
new_ids
):
raise
'BadRequst'
,
'Please rename each listed object.'
for
i
in
range
(
len
(
ids
)):
if
ids
[
i
]
!=
new_ids
[
i
]:
self
.
manage_renameObject
(
ids
[
i
],
new_ids
[
i
],
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
,
update_menu
=
1
)
return
None
def
manage_renameObject
(
self
,
id
,
new_id
,
REQUEST
=
None
):
"""Rename a particular sub-object"""
try
:
self
.
_checkId
(
new_id
)
...
...
lib/python/OFS/renameForm.dtml
View file @
2b9aff10
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML
lang=
"en"
>
<HEAD>
<TITLE>
Rename Item
</TITLE>
<TITLE>
Rename Item
s
</TITLE>
</HEAD>
<BODY
BGCOLOR=
"#FFFFFF"
LINK=
"#000099"
VLINK=
"#555555"
>
<dtml-if
expr=
"_.hasattr(REQUEST, 'ids') and REQUEST['ids']"
>
<dtml-with
expr=
"manage_CopyContainerFirstItem(REQUEST)"
>
<dtml-if
cb_isMoveable
>
<dtml-if
expr=
"_.hasattr(REQUEST, 'ids')"
>
<H2>
Rename Items
</H2>
<H2>
Rename
<dtml-var
meta_type
></H2>
<dtml-var
"
HelpSys
.
HelpButton
('
Folder_Rename
.
dtml
','
OFSP
')"
>
...
...
@@ -14,45 +13,40 @@
<P>
<FORM
ACTION=
"<dtml-var URL1>"
METHOD=
"POST"
>
<TABLE
CELLSPACING=
"0"
>
<dtml-in
expr=
"manage_CopyContainerAllItems(REQUEST)"
>
<TR>
<TD
ALIGN=
"LEFT"
VALIGN=
"TOP"
>
<IMG
SRC=
"<dtml-var SCRIPT_NAME>/<dtml-var icon>"
ALT=
""
BORDER=
"0"
>
</TD>
<dtml-if
cb_isMoveable
>
<TD
ALIGN=
"LEFT"
VALIGN=
"TOP"
>
<dtml-var
id
>
</TD>
</TR>
<TR>
<TD
ALIGN=
"LEFT"
VALIGN=
"TOP"
>
<STRONG>
to:
</STRONG>
</TD>
<TD
ALIGN=
"LEFT"
VALIGN=
"TOP"
>
<INPUT
TYPE=
"TEXT"
NAME=
"new_id"
SIZE=
"20"
value=
"&dtml-id;"
>
<INPUT
TYPE=
"HIDDEN"
NAME=
"ids:list"
VALUE=
"<dtml-var id html_quote>"
>
<INPUT
TYPE=
"TEXT"
NAME=
"new_ids"
SIZE=
"20"
value=
"&dtml-id;"
>
</TD>
<dtml-else>
<TD
ALIGN=
"LEFT"
VALIGN=
"TOP"
COLSPAN=
"3"
>
<dtml-var
id
>
may not be renamed.
</TD>
</dtml-if>
</TR>
</dtml-in>
<TR>
<TD></TD>
<TD>
<INPUT
TYPE=
"HIDDEN"
NAME=
"id"
VALUE=
"<dtml-var id html_quote>"
>
<TD
COLSPAN=
"3"
>
<INPUT
TYPE=
"HIDDEN"
NAME=
":default_method"
VALUE=
"manage_renameObject"
>
<INPUT
TYPE=
"submit"
NAME=
"manage_renameObject:method"
VALUE=
" Ok "
>
<INPUT
TYPE=
"submit"
NAME=
"manage_renameObject
s
:method"
VALUE=
" Ok "
>
<INPUT
TYPE=
"submit"
NAME=
"manage_main:method"
VALUE=
"Cancel"
>
</TD>
</TR>
</TABLE>
</FORM>
<dtml-else>
<FORM
ACTION=
"manage_main"
METHOD=
"GET"
>
<CENTER>
<BR><BR>
The item
<EM><dtml-var
id
></EM>
does not support this operation.
<P>
<INPUT
TYPE=
"submit"
NAME=
"submit"
VALUE=
" Ok "
>
</CENTER>
</FORM>
</dtml-if>
</dtml-with>
<dtml-else>
<FORM
ACTION=
"manage_main"
METHOD=
"GET"
>
<CENTER>
...
...
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