Proposal // bug fixing / pyscript, superres
"Christian Meier" <[email protected]>
| Newsgroups | gmane.comp.cms.zms.devel |
|---|---|
| Message-ID | <006901c8fee4$ff71dd30$533a1e8d@mdcno3> |
Hello, we encountered two problems in zms-2.11 up to #292: [1] PythonScripts have no Manager-proxy-role - if DTMLMethods/Documents are inserted via ZMS, Manager-proxy-role is set implicitly - we need Manager-proxy-role in PythonScripts too, because of accessing MyFile-Objects in dictionaries for instance - find patch for \zms\ZMSMetaobjManager.py attached [2] ZMSGraphic.superres configuration setting is ignored - find patches for \zms\dtml\ZMSObject\input_fields.dtml and \zms\_objtypes.py attached Regards, Christian Meier
input_fields.dtml.patch
(application/octet-stream, 931 B)
--- \zms\dtml\ZMSObject\input_fields.dtml Fri Jul 18 08:23:32 2008
+++ \zms\dtml\ZMSObject\input_fields.dtml Fri Aug 15 16:15:29 2008
@@ -113,14 +113,17 @@
<dtml-comment>
##### Primitive #####
</dtml-comment>
<dtml-elif "not ((objAttr['meta_type']=='?') or (objAttr['id'] in ['displaytype','format']) or (objAttr['id'].find('align')>0 and _.len(filter_list(metaObj['attrs'],'id',objAttr['id'][:objAttr['id'].find('align')],'=='))>0))">
+<dtml-if "(metaObj['id']=='ZMSGraphic' and ((key=='imgsuperres' and getConfProperty('ZMSGraphic.superres',0)==1) or key!='imgsuperres')) or metaObj['id']!='ZMSGraphic'">
<tr id="tr_<dtml-var key>" valign="top">
<td><div class="form-label<dtml-if disabled>-disabled</dtml-if>"><dtml-var elLabel><dtml-if required><sup style="color:red">*</sup></dtml-if></div></td>
<td><dtml-var "getObjInput(key,REQUEST)"></td>
</tr>
</dtml-if
></dtml-if
+></dtml-if
></dtml-let
></dtml-in>
_objtypes.py.patch
(application/octet-stream, 674 B)
--- \zms\_objtypes.py Mon May 26 14:23:54 2008
+++ \zms\_objtypes.py Fri Aug 15 15:56:00 2008
@@ -233,11 +233,11 @@
# Zoom (SuperRes).
# ----------------
key = 'imgsuperres'
- if key in self.getObjAttrs().keys():
+ if key in self.getObjAttrs().keys() and self.getConfProperty('ZMSGraphic.superres',0)==1:
imgzoomobj = self.getObjProperty(key,REQUEST)
if imgzoomobj is not None:
s_url = getHref2Zoom(self,imgzoomobj,key,800,600,REQUEST)
imgzoomclazz = 'superzoom'
imgzoomalt = '%s (%s)'%(self.getZMILangStr('ATTR_SUPERRES'),imgzoomobj.getDataSizeStr())
ZMSMetaObjManager.py.patch
(application/octet-stream, 777 B)
--- \zms\ZMSMetaobjManager.py Thu Jun 26 13:19:10 2008
+++ \zms\ZMSMetaobjManager.py Fri Aug 15 15:55:55 2008
@@ -586,14 +586,17 @@
s.find( '# --// BO %s('%newId) == 0 and \
s.find( ') //--') > 0:
params = s[s.find('(')+1:s.rfind(')')]
while len(s) > 0 and ord(s[-1]) == 13:
s = s[:-1]
body += s + '\n'
count += 1
obElmnt.ZPythonScript_setTitle( newName)
obElmnt.ZPythonScript_edit( params=params, body=body)
+ roles=[ 'Manager']
+ obElmnt._proxy_roles=tuple(roles)
# Assign Attributes to Meta-Object.
ob['zms_system'] = int( ob['zms_system'] and (oldId is None or zms_system))
self.model[id] = ob