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
e15046bc
Commit
e15046bc
authored
Mar 22, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bugs in managing meta_type and the icon.
parent
2e82c096
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
21 deletions
+16
-21
lib/python/ZClasses/Basic.py
lib/python/ZClasses/Basic.py
+16
-21
No files found.
lib/python/ZClasses/Basic.py
View file @
e15046bc
...
...
@@ -97,17 +97,22 @@ class ZClassBasicSheet(OFS.PropertySheets.PropertySheet,
def
manage_edit
(
self
,
meta_type
=
''
,
icon
=
''
,
file
=
''
,
REQUEST
=
None
):
"""Set basic item properties.
"""
klass
=
self
.
aq_inner
.
aq_parent
.
aq_parent
.
_zclass_
if
meta_type
:
self
.
setClassAttr
(
'meta_type'
,
meta_type
)
if
file
:
# and hasattr(file, 'content_type'):
if
hasattr
(
klass
,
'ziconImage'
):
klass
.
ziconImage
.
manage_upload
(
fil
e
)
els
e
:
__traceback_info__
=
file
image
=
self
.
getClassAttr
(
'ziconImage'
,
Non
e
)
if
image
is
Non
e
:
self
.
setClassAttr
(
'ziconImage'
,
OFS
.
Image
.
Image
(
'ziconImage'
,
''
,
file
))
if
not
icon
:
self
.
setClassAttr
(
'icon'
,
REQUEST
[
'URL1'
]
+
'/ziconImage'
)
else
:
image
.
manage_upload
(
file
)
if
(
not
icon
)
and
REQUEST
:
icon
=
(
REQUEST
[
'URL3'
][
len
(
REQUEST
[
'BASE1'
])
+
1
:]
+
'/ziconImage'
)
if
icon
:
self
.
setClassAttr
(
'icon'
,
icon
)
...
...
@@ -116,22 +121,12 @@ class ZClassBasicSheet(OFS.PropertySheets.PropertySheet,
self
,
REQUEST
,
manage_tabs_message
=
'Basic properties changed'
)
class
ziconImage
(
ExtensionClass
.
Base
):
"Computed icon attribute"
def
__of__
(
self
,
parent
):
return
_ziconImage
()
ziconImage
=
ziconImage
()
def
icon
_
(
self
):
icon
=
self
.
aq_inner
.
aq_parent
.
aq_parent
.
_zclass_
.
icon
def
icon
(
self
):
return
self
.
getClassAttr
(
'icon'
,
''
)
class
_ziconImage
(
ExtensionClass
.
Base
):
"The real Computed icon attribute"
def
__of__
(
self
,
ps
):
klass
=
ps
.
aq_inner
.
aq_parent
.
aq_parent
.
_zclass_
return
klass
.
ziconImage
def
meta_type
(
self
):
return
self
.
getClassAttr
(
'meta_type'
,
''
)
class
ZClassViewsSheet
(
OFS
.
PropertySheets
.
PropertySheet
,
OFS
.
PropertySheets
.
View
):
...
...
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