[CMF-checkins] CVS: CMF/CMFCore - TypesTool.py:1.30
Chris Withers
chrisw@nipltd.com
Sat, 9 Feb 2002 15:13:46 -0500
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv8613/CMFCore
Modified Files:
TypesTool.py
Log Message:
Fix for Tracker #458
=== CMF/CMFCore/TypesTool.py 1.29 => 1.30 ===
from utils import UniqueObject, SimpleItemWithProperties, tuplize
from utils import _dtmldir, _checkPermission, cookString
-import urllib
from utils import _dtmldir, _checkPermission, cookString, getToolByName
import string
from AccessControl import getSecurityManager, ClassSecurityInfo
@@ -552,14 +551,25 @@
"""
return self._actions
+ def __bobo_traverse__(self, TraversalRequest, name):
+ # Nasty hack to get around main.dtml's quoting of
+ # all_meta_types' actions
+
+ if name=='manage_addTypeInfoForm':
+ stack = TraversalRequest['TraversalRequestNameStack']
+ if stack:
+ TraversalRequest['type_type']=stack[0]
+ stack[:]=[]
+
+ return getattr(self,name)
+
def all_meta_types(self):
all = TypesTool.inheritedAttribute('all_meta_types')(self)
factypes = []
for name, fac in _type_factories.items():
- query = urllib.urlencode({'type_type': name})
factypes.append({
'name': fac.meta_type,
- 'action': 'manage_addTypeInfoForm?%s' % query,
+ 'action': 'manage_addTypeInfoForm/%s' % name,
'permission': CMFCorePermissions.ManagePortal,
})
factypes.extend(all)