Commit f4dc9cd9 authored by Brian Lloyd's avatar Brian Lloyd

forward port Toby's encoding fixes

parent adf2107f
<dtml-call "REQUEST.set('management_page_charset','UTF-8')"> <dtml-if management_page_charset>
<dtml-comment>
A site-global encoding specification in a property.
Note that this feature only works if there are no unicode objects
around. This means that this feature is not likely to be supported
in all future versions of zope.
</dtml-comment>
<dtml-call "REQUEST.set('management_page_charset_tag','')">
<dtml-else>
<dtml-comment>
Thankfully no site-global encoding specification in a property.
We can set UTF-8, and unicode properties will work.
</dtml-comment>
<dtml-call "REQUEST.set('management_page_charset','UTF-8')">
<dtml-call "REQUEST.set('management_page_charset_tag','UTF-8:')">
</dtml-if>
<dtml-if "REQUEST.get('management_page_charset',None)=='UTF-8'">
<dtml-var "u' '"> <dtml-var "u' '">
</dtml-if>
<dtml-var manage_page_header> <dtml-var manage_page_header>
<dtml-with "_(management_view='Properties')"> <dtml-with "_(management_view='Properties')">
<dtml-var manage_tabs> <dtml-var manage_tabs>
...@@ -45,7 +63,7 @@ property values, edit the values and click &quot;Save Changes&quot;. ...@@ -45,7 +63,7 @@ property values, edit the values and click &quot;Save Changes&quot;.
<tr> <tr>
<td align="left" valign="top" width="16"> <td align="left" valign="top" width="16">
<dtml-if "'d' in _['sequence-item'].get('mode', 'awd')"> <dtml-if "'d' in _['sequence-item'].get('mode', 'awd')">
<input type="checkbox" name="_ids:utf8:string:list" value="&dtml-id;" <input type="checkbox" name="_ids:<dtml-var "REQUEST['management_page_charset_tag']">string:list" value="&dtml-id;"
id="cb-&dtml-id;"> id="cb-&dtml-id;">
<dtml-else> <dtml-else>
</dtml-if> </dtml-if>
...@@ -65,21 +83,21 @@ property values, edit the values and click &quot;Save Changes&quot;. ...@@ -65,21 +83,21 @@ property values, edit the values and click &quot;Save Changes&quot;.
<input type="text" name="&dtml-id;:&dtml-type;" size="35" <input type="text" name="&dtml-id;:&dtml-type;" size="35"
value="<dtml-if "hasProperty(id)"><dtml-var "('%s' % getProperty(id))" html_quote></dtml-if>"> value="<dtml-if "hasProperty(id)"><dtml-var "('%s' % getProperty(id))" html_quote></dtml-if>">
<dtml-elif "type in ('float', 'date')"> <dtml-elif "type in ('float', 'date')">
<input type="text" name="&dtml-id;:utf8:&dtml-type;" size="35" <input type="text" name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" size="35"
value="<dtml-var "getProperty(id)" html_quote>"> value="<dtml-var "getProperty(id)" html_quote>">
<dtml-elif "type in ['string','ustring']"> <dtml-elif "type in ['string','ustring']">
<input type="text" name="&dtml-id;:utf8:&dtml-type;" size="35" <input type="text" name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" size="35"
value="<dtml-var "getProperty(id)" html_quote>"> value="<dtml-var "getProperty(id)" html_quote>">
<dtml-elif "type=='boolean'"> <dtml-elif "type=='boolean'">
<input type="checkbox" name="&dtml-id;:boolean" size="35" <input type="checkbox" name="&dtml-id;:boolean" size="35"
<dtml-if "getProperty(id)">CHECKED</dtml-if>> <dtml-if "getProperty(id)">CHECKED</dtml-if>>
<dtml-elif "type in ['tokens','utokens']"> <dtml-elif "type in ['tokens','utokens']">
<input type="text" name="&dtml-id;:utf8:&dtml-type;" size="35" <input type="text" name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" size="35"
value="<dtml-in "getProperty(id)">&dtml-sequence-item; </dtml-in>"> value="<dtml-in "getProperty(id)">&dtml-sequence-item; </dtml-in>">
<dtml-elif "type in ['text','utext']"> <dtml-elif "type in ['text','utext']">
<textarea name="&dtml-id;:utf8:&dtml-type;" rows="6" cols="35"><dtml-var "getProperty(id)" html_quote></textarea> <textarea name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" rows="6" cols="35"><dtml-var "getProperty(id)" html_quote></textarea>
<dtml-elif "type in ['lines','ulines']"> <dtml-elif "type in ['lines','ulines']">
<textarea name="&dtml-id;:utf8:&dtml-type;" rows="6" cols="35"><dtml-in <textarea name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" rows="6" cols="35"><dtml-in
"getProperty(id)">&dtml-sequence-item;<dtml-if "getProperty(id)">&dtml-sequence-item;<dtml-if
sequence-end><dtml-else><dtml-var "'\n'"></dtml-if></dtml-in></textarea> sequence-end><dtml-else><dtml-var "'\n'"></dtml-if></dtml-in></textarea>
...@@ -87,7 +105,7 @@ property values, edit the values and click &quot;Save Changes&quot;. ...@@ -87,7 +105,7 @@ property values, edit the values and click &quot;Save Changes&quot;.
<dtml-if "hasProperty(select_variable)"> <dtml-if "hasProperty(select_variable)">
<div class="form-element"> <div class="form-element">
<select name="&dtml-id;:utf8:text"> <select name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">text">
<dtml-in "getProperty(select_variable)"> <dtml-in "getProperty(select_variable)">
<option <option
<dtml-if "_['sequence-item']==getProperty(id)">SELECTED</dtml-if> <dtml-if "_['sequence-item']==getProperty(id)">SELECTED</dtml-if>
...@@ -97,7 +115,7 @@ property values, edit the values and click &quot;Save Changes&quot;. ...@@ -97,7 +115,7 @@ property values, edit the values and click &quot;Save Changes&quot;.
</div> </div>
<dtml-elif "_.has_key(select_variable)"> <dtml-elif "_.has_key(select_variable)">
<div class="form-element"> <div class="form-element">
<select name="&dtml-id;:utf8:text"> <select name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">text">
<dtml-in "_[select_variable]"> <dtml-in "_[select_variable]">
<option <option
<dtml-if "_['sequence-item']==getProperty(id)">SELECTED</dtml-if> <dtml-if "_['sequence-item']==getProperty(id)">SELECTED</dtml-if>
...@@ -115,7 +133,7 @@ property values, edit the values and click &quot;Save Changes&quot;. ...@@ -115,7 +133,7 @@ property values, edit the values and click &quot;Save Changes&quot;.
<dtml-if "hasProperty(select_variable)"> <dtml-if "hasProperty(select_variable)">
<div class="form-element"> <div class="form-element">
<select name="&dtml-id;:utf8:list:string" multiple <select name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">list:string" multiple
size="<dtml-var "_.min(7, _.len(getProperty(select_variable)))">"> size="<dtml-var "_.min(7, _.len(getProperty(select_variable)))">">
<dtml-in "getProperty(select_variable)"> <dtml-in "getProperty(select_variable)">
<option<dtml-if <option<dtml-if
...@@ -127,7 +145,7 @@ property values, edit the values and click &quot;Save Changes&quot;. ...@@ -127,7 +145,7 @@ property values, edit the values and click &quot;Save Changes&quot;.
</div> </div>
<dtml-elif "_.has_key(select_variable)"> <dtml-elif "_.has_key(select_variable)">
<div class="form-element"> <div class="form-element">
<select name="&dtml-id;:utf8:list:string" multiple <select name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">list:string" multiple
size="<dtml-var "_.min(7, _.len(_[select_variable]))">"> size="<dtml-var "_.min(7, _.len(_[select_variable]))">">
<dtml-in "_[select_variable]"> <dtml-in "_[select_variable]">
<option<dtml-if <option<dtml-if
...@@ -218,7 +236,7 @@ property and click the &quot;Add&quot; button. ...@@ -218,7 +236,7 @@ property and click the &quot;Add&quot; button.
</div> </div>
</td> </td>
<td align="left" valign="top"> <td align="left" valign="top">
<input type="text" name="id:utf8:string" size="30" value=""/> <input type="text" name="id:<dtml-var "REQUEST['management_page_charset_tag']">string" size="30" value=""/>
</td> </td>
<td align="left" valign="top" class="form-label"> <td align="left" valign="top" class="form-label">
Type Type
...@@ -233,12 +251,14 @@ property and click the &quot;Add&quot; button. ...@@ -233,12 +251,14 @@ property and click the &quot;Add&quot; button.
<option>lines</option> <option>lines</option>
<option>long</option> <option>long</option>
<option selected>string</option> <option selected>string</option>
<dtml-if "REQUEST['management_page_charset'] == 'UTF-8'">
<option>ustring</option> <option>ustring</option>
<option>text</option> <option>text</option>
<option>tokens</option> <option>tokens</option>
<option>utext</option> <option>utext</option>
<option>utokens</option> <option>utokens</option>
<option>ulines</option> <option>ulines</option>
</dtml-if>
<option>selection</option> <option>selection</option>
<option>multiple selection</option> <option>multiple selection</option>
</select> </select>
...@@ -252,7 +272,11 @@ property and click the &quot;Add&quot; button. ...@@ -252,7 +272,11 @@ property and click the &quot;Add&quot; button.
</div> </div>
</td> </td>
<td colspan=2 align="left" valign="top"> <td colspan=2 align="left" valign="top">
<input type="text" name="value:utf8:ustring" size="30" /> <dtml-if "REQUEST['management_page_charset'] == 'UTF-8'">
<input type="text" name="value:UTF-8:ustring" size="30" />
<dtml-else>
<input type="text" name="value:string" size="30" />
</dtml-if>
</td> </td>
<td align="right" valign="top"> <td align="right" valign="top">
<div class="form-element"> <div class="form-element">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment