[CMF-checkins] CVS: CMF/CMFDefault/dtml - metadataElementPolicies.dtml:1.3

Florent Guillaume fg@nuxeo.com
Fri, 5 Jul 2002 15:45:36 -0400


Update of /cvs-repository/CMF/CMFDefault/dtml
In directory cvs.zope.org:/tmp/cvs-serv2727/CMFDefault/dtml

Modified Files:
	metadataElementPolicies.dtml 
Log Message:
Fixed the Types Tool so that TypeInformation's Title is decorrelated
from its Id (the old TypeInformation.Type() should not be used anymore).

The Id is what gets put in the "portal_type" attribute of a content
object, which one gets at using somecontent.getPortalTypeName(). The
Title is returned by somecontent.Type().

"portal_type" is now indexed, and in most cases should be used when
doing catalog queries instead of "Type". Note that when upgrading from
older versions this index will have to be added by hand (see
INSTALL.txt).

Fixed PortalFolder's filtering so that it correctly restricts itself to
the portal types allowed by the TypesTool (Tracker #483).



=== CMF/CMFDefault/dtml/metadataElementPolicies.dtml 1.2 => 1.3 ===
  <tr valign="top">
   <th> Content type </th>
-  <td> &dtml-typ;</td>
+  <td>
+    <dtml-if "typ == '<default>'">
+      &dtml-typ;
+    <dtml-else>
+      <dtml-let typeinfo="portal_types.getTypeInfo(typ)">
+        <dtml-if typeinfo>
+          <dtml-var "typeinfo.Title()" html_quote>
+        <dtml-else>
+          &dtml-typ; (deleted)
+        </dtml-if>
+      </dtml-let>
+    </dtml-if>
+  </td>
   <th> Required? </th>
   <td>
     <input type="checkbox" name="is_required:boolean" &dtml-rqd;>
@@ -107,12 +119,11 @@
  <tr valign="top">
   <th> Content type </th>
 
-  <dtml-let types="portal_types.listContentTypes()"
-  >
+  <dtml-let typeinfos="portal_types.listTypeInfo()">
   <td>
    <select name="content_type">
-    <dtml-in types>
-     <option value="&dtml-sequence-item;"> &dtml-sequence-item; </option>
+    <dtml-in typeinfos>
+     <option value="&dtml-getId;"> &dtml-Title; </option>
     </dtml-in>
    </select>
   </td>