PropertyFolder management_page_charset patch
--- dtml/propertiesForm.dtml.orig 2003-02-03 06:14:58.000000000 +0800
+++ dtml/propertiesForm.dtml 2004-02-13 22:54:39.000000000 +0800
@@ -1,6 +1,25 @@
-<dtml-call "REQUEST.set('management_page_charset','UTF-8')">
-<dtml-call "REQUEST.set('management_page_charset_tag','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',
+ _['management_page_charset'])">
+ <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-if>
<dtml-var manage_page_header>
<dtml-with "_(management_view='Properties')">
<dtml-var manage_tabs>
@@ -8,22 +27,22 @@
<dtml-if Principia-Version>
<p>
-<em>You are currently working in version <dtml-var Principia-Version></em>
+<em>You are currently working in version &dtml-Principia-Version;</em>
</p>
</dtml-if Principia-Version>
-<dtml-if object_type><h3 class="message"><dtml-var object_type></h3></dtml-if>
+<dtml-if object_type><h3 class="message">&dtml-object_type;</h3></dtml-if>
<p class="form-help">
<dtml-if PropertyFolderDescription>
- <dtml-var PropertyFolderDescription>
+&dtml-PropertyFolderDescription;
<dtml-else>
Properties allow you to assign simple values to Zope objects. To change
property values, edit the values and click "Save Changes".
</dtml-if>
</p>
-<form action="<dtml-var URL1>" method="post">
+<form action="&dtml-URL1;" method="post">
<dtml-if propertyMap>
<table cellspacing="0" cellpadding="2" border="0">
@@ -49,78 +68,79 @@
</tr>
<dtml-in propertyMap mapping>
+<dtml-let type="not _.has_key('type') and 'string' or type">
<tr>
<td align="left" valign="top" width="16">
<dtml-if property_extensible_schema__>
<dtml-if "'d' in _['sequence-item'].get('mode', 'awd')">
<input type="checkbox" name="_ids:<dtml-var "REQUEST['management_page_charset_tag']">string:list" value="<dtml-var id html_quote>"
- id="cb-<dtml-var id>">
+ id="cb-&dtml-id;">
<dtml-else>
</dtml-if>
</dtml-if>
</td>
<td align="left" valign="top">
<div class="form-label">
- <label for="cb-<dtml-var id>"><dtml-var "propertyLabel(id)"></label>
+ <label for="cb-&dtml-id;"><dtml-var "propertyLabel(id)" html_quote></label>
</div>
</td>
<td align="left" valign="top">
<dtml-if "'w' in _['sequence-item'].get('mode', 'awd')">
<dtml-if "type == 'int'">
- <input type="text" name="<dtml-var id>:<dtml-var
- type>" size="<dtml-var dtpref_cols missing="35">" value="<dtml-if "hasProperty(id)"><dtml-var
+ <input type="text" name="&dtml-id;:&dtml-type;"
+ size="<dtml-var dtpref_cols missing="35">" value="<dtml-if "hasProperty(id)"><dtml-var
"'%s' % getProperty(id)" html_quote></dtml-if>">
<dtml-elif "type == 'long'">
- <input type="text" name="<dtml-var id>:<dtml-var type>" size="<dtml-var dtpref_cols missing="35">"
+ <input type="text" name="&dtml-id;:&dtml-type;" size="<dtml-var dtpref_cols missing="35">"
value="<dtml-if "hasProperty(id)"><dtml-var
"('%s' % getProperty(id))" html_quote></dtml-if>">
<dtml-elif "type in ('float', 'date')">
- <input type="text" name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']"><dtml-var type>" size="<dtml-var dtpref_cols missing="35">"
+ <input type="text" name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" size="<dtml-var dtpref_cols missing="35">"
value="<dtml-var "getProperty(id)" html_quote>">
<dtml-elif "type in ['string','ustring']">
- <input type="text" name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']"><dtml-var type>" size="<dtml-var dtpref_cols missing="35">"
+ <input type="text" name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" size="<dtml-var dtpref_cols missing="35">"
value="<dtml-var "getProperty(id)" html_quote>">
<dtml-elif "type=='boolean'">
- <input type="checkbox" name="<dtml-var id>:boolean" size="<dtml-var dtpref_cols missing="35">"
+ <input type="checkbox" name="&dtml-id;:boolean" size="<dtml-var dtpref_cols missing="35">"
<dtml-if "getProperty(id)">CHECKED</dtml-if>>
<dtml-elif "type in ['tokens','utokens']">
- <input type="text" name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']"><dtml-var type>" size="<dtml-var dtpref_cols missing="35">"
- value="<dtml-in "getProperty(id)"><dtml-var sequence-item html_quote> </dtml-in>">
+ <input type="text" name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" size="<dtml-var dtpref_cols missing="35">"
+ value="<dtml-in "getProperty(id)">&dtml-sequence-item; </dtml-in>">
<dtml-elif "type in ['text','utext']">
- <textarea name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']"><dtml-var type>" rows="<dtml-var
+ <textarea name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" rows="<dtml-var
dtpref_rows missing="35">" cols="<dtml-var dtpref_cols missing="35">"><dtml-var
"getProperty(id)" html_quote></textarea>
<dtml-elif "type in ['lines','ulines']">
- <textarea name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']"><dtml-var type>" rows="6" cols="<dtml-var dtpref_cols missing="35">"><dtml-in
- "getProperty(id)"><dtml-var sequence-item html_quote><dtml-if
+ <textarea name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" rows="6" cols="<dtml-var dtpref_cols missing="35">"><dtml-in
+ "getProperty(id)">&dtml-sequence-item;<dtml-if
sequence-end><dtml-else><dtml-var "'\n'"></dtml-if></dtml-in></textarea>
<dtml-elif "type=='selection'">
<dtml-if "hasProperty(select_variable)">
<div class="form-element">
- <select name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']">text">
+ <select name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">text">
<dtml-in "getProperty(select_variable)">
<option
<dtml-if "_['sequence-item']==getProperty(id)">SELECTED</dtml-if>
- ><dtml-var sequence-item html_quote></option>
+ >&dtml-sequence-item;</option>
</dtml-in>
</select>
</div>
<dtml-elif "_.has_key(select_variable)">
<div class="form-element">
- <select name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']">text">
+ <select name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">text">
<dtml-in "_[select_variable]">
<option
<dtml-if "_['sequence-item']==getProperty(id)">SELECTED</dtml-if>
- ><dtml-var sequence-item html_quote></option>
+ >&dtml-sequence-item;</option>
</dtml-in>
</select>
</div>
<dtml-else>
<div class="form-text">
- No value for <dtml-var select_variable>.
+ No value for &dtml-select_variable;.
</div>
</dtml-if>
@@ -128,31 +148,31 @@
<dtml-if "hasProperty(select_variable)">
<div class="form-element">
- <select name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']">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)))">">
<dtml-in "getProperty(select_variable)">
<option<dtml-if
"getProperty(id) and (_['sequence-item'] in getProperty(id))"
> SELECTED</dtml-if
- >><dtml-var sequence-item html_quote></option>
+ >>&dtml-sequence-item;</option>
</dtml-in>
</select>
</div>
<dtml-elif "_.has_key(select_variable)">
<div class="form-element">
- <select name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']">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]))">">
<dtml-in "_[select_variable]">
<option<dtml-if
"getProperty(id) and (_['sequence-item'] in getProperty(id))"
> SELECTED</dtml-if
- >><dtml-var sequence-item html_quote></option>
+ >>&dtml-sequence-item;</option>
</dtml-in>
</select>
</div>
<dtml-else>
<div class="form-text">
- No value for <dtml-var select_variable>.
+ No value for &dtml-select_variable;.
</div>
</dtml-if>
<dtml-else>
@@ -171,17 +191,18 @@
<dtml-if property_extensible_schema__>
<br />
<dtml-unless sequence-start>
- <a href="manage_movePropertyUp?id=<dtml-var id>"
+ <a href="manage_movePropertyUp?id=&dtml-id;"
><img src="/misc_/PropertyObject/up" border="0"></a>
</dtml-unless>
<dtml-unless sequence-end>
- <a href="manage_movePropertyDown?id=<dtml-var id>"
+ <a href="manage_movePropertyDown?id=&dtml-id;"
><img src="/misc_/PropertyObject/down" border="0"></a>
</dtml-unless>
</dtml-if>
</div>
</td>
</tr>
+</dtml-let>
</dtml-in>
<tr>
<td colspan="2"> </td>
@@ -230,7 +251,7 @@
<dtml-if property_extensible_schema__>
-<form action="<dtml-var URL1>/manage_addProperty" method="post">
+<form action="&dtml-URL1;/manage_addProperty" method="post">
<p class="form-help">
To add a new property, enter a name, type and value for the new
+++ dtml/propertiesForm.dtml 2004-02-13 22:54:39.000000000 +0800
@@ -1,6 +1,25 @@
-<dtml-call "REQUEST.set('management_page_charset','UTF-8')">
-<dtml-call "REQUEST.set('management_page_charset_tag','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',
+ _['management_page_charset'])">
+ <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-if>
<dtml-var manage_page_header>
<dtml-with "_(management_view='Properties')">
<dtml-var manage_tabs>
@@ -8,22 +27,22 @@
<dtml-if Principia-Version>
<p>
-<em>You are currently working in version <dtml-var Principia-Version></em>
+<em>You are currently working in version &dtml-Principia-Version;</em>
</p>
</dtml-if Principia-Version>
-<dtml-if object_type><h3 class="message"><dtml-var object_type></h3></dtml-if>
+<dtml-if object_type><h3 class="message">&dtml-object_type;</h3></dtml-if>
<p class="form-help">
<dtml-if PropertyFolderDescription>
- <dtml-var PropertyFolderDescription>
+&dtml-PropertyFolderDescription;
<dtml-else>
Properties allow you to assign simple values to Zope objects. To change
property values, edit the values and click "Save Changes".
</dtml-if>
</p>
-<form action="<dtml-var URL1>" method="post">
+<form action="&dtml-URL1;" method="post">
<dtml-if propertyMap>
<table cellspacing="0" cellpadding="2" border="0">
@@ -49,78 +68,79 @@
</tr>
<dtml-in propertyMap mapping>
+<dtml-let type="not _.has_key('type') and 'string' or type">
<tr>
<td align="left" valign="top" width="16">
<dtml-if property_extensible_schema__>
<dtml-if "'d' in _['sequence-item'].get('mode', 'awd')">
<input type="checkbox" name="_ids:<dtml-var "REQUEST['management_page_charset_tag']">string:list" value="<dtml-var id html_quote>"
- id="cb-<dtml-var id>">
+ id="cb-&dtml-id;">
<dtml-else>
</dtml-if>
</dtml-if>
</td>
<td align="left" valign="top">
<div class="form-label">
- <label for="cb-<dtml-var id>"><dtml-var "propertyLabel(id)"></label>
+ <label for="cb-&dtml-id;"><dtml-var "propertyLabel(id)" html_quote></label>
</div>
</td>
<td align="left" valign="top">
<dtml-if "'w' in _['sequence-item'].get('mode', 'awd')">
<dtml-if "type == 'int'">
- <input type="text" name="<dtml-var id>:<dtml-var
- type>" size="<dtml-var dtpref_cols missing="35">" value="<dtml-if "hasProperty(id)"><dtml-var
+ <input type="text" name="&dtml-id;:&dtml-type;"
+ size="<dtml-var dtpref_cols missing="35">" value="<dtml-if "hasProperty(id)"><dtml-var
"'%s' % getProperty(id)" html_quote></dtml-if>">
<dtml-elif "type == 'long'">
- <input type="text" name="<dtml-var id>:<dtml-var type>" size="<dtml-var dtpref_cols missing="35">"
+ <input type="text" name="&dtml-id;:&dtml-type;" size="<dtml-var dtpref_cols missing="35">"
value="<dtml-if "hasProperty(id)"><dtml-var
"('%s' % getProperty(id))" html_quote></dtml-if>">
<dtml-elif "type in ('float', 'date')">
- <input type="text" name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']"><dtml-var type>" size="<dtml-var dtpref_cols missing="35">"
+ <input type="text" name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" size="<dtml-var dtpref_cols missing="35">"
value="<dtml-var "getProperty(id)" html_quote>">
<dtml-elif "type in ['string','ustring']">
- <input type="text" name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']"><dtml-var type>" size="<dtml-var dtpref_cols missing="35">"
+ <input type="text" name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" size="<dtml-var dtpref_cols missing="35">"
value="<dtml-var "getProperty(id)" html_quote>">
<dtml-elif "type=='boolean'">
- <input type="checkbox" name="<dtml-var id>:boolean" size="<dtml-var dtpref_cols missing="35">"
+ <input type="checkbox" name="&dtml-id;:boolean" size="<dtml-var dtpref_cols missing="35">"
<dtml-if "getProperty(id)">CHECKED</dtml-if>>
<dtml-elif "type in ['tokens','utokens']">
- <input type="text" name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']"><dtml-var type>" size="<dtml-var dtpref_cols missing="35">"
- value="<dtml-in "getProperty(id)"><dtml-var sequence-item html_quote> </dtml-in>">
+ <input type="text" name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" size="<dtml-var dtpref_cols missing="35">"
+ value="<dtml-in "getProperty(id)">&dtml-sequence-item; </dtml-in>">
<dtml-elif "type in ['text','utext']">
- <textarea name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']"><dtml-var type>" rows="<dtml-var
+ <textarea name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" rows="<dtml-var
dtpref_rows missing="35">" cols="<dtml-var dtpref_cols missing="35">"><dtml-var
"getProperty(id)" html_quote></textarea>
<dtml-elif "type in ['lines','ulines']">
- <textarea name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']"><dtml-var type>" rows="6" cols="<dtml-var dtpref_cols missing="35">"><dtml-in
- "getProperty(id)"><dtml-var sequence-item html_quote><dtml-if
+ <textarea name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">&dtml-type;" rows="6" cols="<dtml-var dtpref_cols missing="35">"><dtml-in
+ "getProperty(id)">&dtml-sequence-item;<dtml-if
sequence-end><dtml-else><dtml-var "'\n'"></dtml-if></dtml-in></textarea>
<dtml-elif "type=='selection'">
<dtml-if "hasProperty(select_variable)">
<div class="form-element">
- <select name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']">text">
+ <select name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">text">
<dtml-in "getProperty(select_variable)">
<option
<dtml-if "_['sequence-item']==getProperty(id)">SELECTED</dtml-if>
- ><dtml-var sequence-item html_quote></option>
+ >&dtml-sequence-item;</option>
</dtml-in>
</select>
</div>
<dtml-elif "_.has_key(select_variable)">
<div class="form-element">
- <select name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']">text">
+ <select name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">text">
<dtml-in "_[select_variable]">
<option
<dtml-if "_['sequence-item']==getProperty(id)">SELECTED</dtml-if>
- ><dtml-var sequence-item html_quote></option>
+ >&dtml-sequence-item;</option>
</dtml-in>
</select>
</div>
<dtml-else>
<div class="form-text">
- No value for <dtml-var select_variable>.
+ No value for &dtml-select_variable;.
</div>
</dtml-if>
@@ -128,31 +148,31 @@
<dtml-if "hasProperty(select_variable)">
<div class="form-element">
- <select name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']">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)))">">
<dtml-in "getProperty(select_variable)">
<option<dtml-if
"getProperty(id) and (_['sequence-item'] in getProperty(id))"
> SELECTED</dtml-if
- >><dtml-var sequence-item html_quote></option>
+ >>&dtml-sequence-item;</option>
</dtml-in>
</select>
</div>
<dtml-elif "_.has_key(select_variable)">
<div class="form-element">
- <select name="<dtml-var id>:<dtml-var "REQUEST['management_page_charset_tag']">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]))">">
<dtml-in "_[select_variable]">
<option<dtml-if
"getProperty(id) and (_['sequence-item'] in getProperty(id))"
> SELECTED</dtml-if
- >><dtml-var sequence-item html_quote></option>
+ >>&dtml-sequence-item;</option>
</dtml-in>
</select>
</div>
<dtml-else>
<div class="form-text">
- No value for <dtml-var select_variable>.
+ No value for &dtml-select_variable;.
</div>
</dtml-if>
<dtml-else>
@@ -171,17 +191,18 @@
<dtml-if property_extensible_schema__>
<br />
<dtml-unless sequence-start>
- <a href="manage_movePropertyUp?id=<dtml-var id>"
+ <a href="manage_movePropertyUp?id=&dtml-id;"
><img src="/misc_/PropertyObject/up" border="0"></a>
</dtml-unless>
<dtml-unless sequence-end>
- <a href="manage_movePropertyDown?id=<dtml-var id>"
+ <a href="manage_movePropertyDown?id=&dtml-id;"
><img src="/misc_/PropertyObject/down" border="0"></a>
</dtml-unless>
</dtml-if>
</div>
</td>
</tr>
+</dtml-let>
</dtml-in>
<tr>
<td colspan="2"> </td>
@@ -230,7 +251,7 @@
<dtml-if property_extensible_schema__>
-<form action="<dtml-var URL1>/manage_addProperty" method="post">
+<form action="&dtml-URL1;/manage_addProperty" method="post">
<p class="form-help">
To add a new property, enter a name, type and value for the new