Changeset 1708 for ZMS/trunk


Ignore:
Timestamp:
25.10.2011 17:46:29 (7 months ago)
Author:
zmsdev
Message:

applied fix for utf8 characters in content-object configuration with page-templates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ZMS/trunk/ZMSMetaobjManager.py

    r1678 r1708  
    5757        attr['custom'] = blob 
    5858      elif ob.meta_type in [ 'Page Template']: 
    59         attr['custom'] = ob.read() 
     59        attr['custom'] = unicode(ob.read()).encode('utf-8') 
    6060      elif ob.meta_type in [ 'Script (Python)']: 
    6161        attr['custom'] = ob.read() 
     
    12051205                tmpltName = 'Template: %s'%newValue['name'] 
    12061206                tmpltCustom = [] 
    1207                 tmpltCustom.append('<dtml-comment>--// BO %s //--</dtml-comment>\n'%tmpltId) 
     1207                tmpltCustom.append('<!-- %s -->\n'%tmpltId) 
    12081208                tmpltCustom.append('\n') 
     1209                tmpltCustom.append('<span tal:omit-tag="" tal:define="global\n') 
     1210                tmpltCustom.append('\t\tzmscontext options/zmscontext">\n') 
    12091211                if newValue['type'] == 'ZMSRecordSet': 
    1210                   tmpltCustom.append('  <h2><dtml-var "getTitlealt(REQUEST)"></h2>\n') 
    1211                   tmpltCustom.append('  <p class="description"><dtml-var "len(getObjProperty(getMetaobj(meta_id)[\'attrs\'][0][\'id\'],REQUEST))"> <dtml-var "getLangStr(\'ATTR_RECORDS\',lang)"></p>\n') 
     1212                  tmpltCustom.append('\t<h2 tal:content="python:zmscontext.getTitlealt(request)">The title.alt</h2>\n') 
     1213                  tmpltCustom.append('\t<p class="description" tal:content="python:\'%i %s\'%(len(zmscontext.attr(zmscontext.getMetaobj(zmscontext.meta_id)[\'attrs\'][0][\'id\'])),zmscontext.getLangStr(\'ATTR_RECORDS\',request[\'lang\']))">#N records</p>\n') 
     1214                tmpltCustom.append('</span>\n') 
    12121215                tmpltCustom.append('\n') 
    1213                 tmpltCustom.append('<dtml-comment>--// EO %s //--</dtml-comment>\n'%tmpltId) 
     1216                tmpltCustom.append('<!-- /%s -->\n'%tmpltId) 
    12141217                tmpltCustom = ''.join(tmpltCustom) 
    1215                 message += self.setMetaobjAttr(id,None,tmpltId,tmpltName,0,0,0,'DTML Method',[],tmpltCustom) 
     1218                message += self.setMetaobjAttr(id,None,tmpltId,tmpltName,0,0,0,'zpt',[],tmpltCustom) 
    12161219              message += self.getZMILangStr('MSG_INSERTED')%id 
    12171220            # Insert Attribute. 
Note: See TracChangeset for help on using the changeset viewer.