Use new name, ViewPageTemplateFile

parent 9ca465a5
...@@ -39,7 +39,7 @@ from Products.Five.browser.resource import FileResourceFactory ...@@ -39,7 +39,7 @@ from Products.Five.browser.resource import FileResourceFactory
from Products.Five.browser.resource import ImageResourceFactory from Products.Five.browser.resource import ImageResourceFactory
from Products.Five.browser.resource import PageTemplateResourceFactory from Products.Five.browser.resource import PageTemplateResourceFactory
from Products.Five.browser.resource import DirectoryResourceFactory from Products.Five.browser.resource import DirectoryResourceFactory
from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.Five.metaclass import makeClass from Products.Five.metaclass import makeClass
from Products.Five.security import getSecurityInfo, protectClass, protectName from Products.Five.security import getSecurityInfo, protectClass, protectName
from Products.Five.security import CheckerPrivateId from Products.Five.security import CheckerPrivateId
...@@ -185,7 +185,7 @@ class view(zope_app_view): ...@@ -185,7 +185,7 @@ class view(zope_app_view):
for pname, attribute, template in self.pages: for pname, attribute, template in self.pages:
if template: if template:
cdict[pname] = ZopeTwoPageTemplateFile(template) cdict[pname] = ViewPageTemplateFile(template)
if attribute and attribute != name: if attribute and attribute != name:
cdict[attribute] = cdict[pname] cdict[attribute] = cdict[pname]
else: else:
...@@ -421,7 +421,7 @@ def makeClassForTemplate(filename, globals=None, used_for=None, ...@@ -421,7 +421,7 @@ def makeClassForTemplate(filename, globals=None, used_for=None,
# XXX needs to deal with security from the bases? # XXX needs to deal with security from the bases?
if cdict is None: if cdict is None:
cdict = {} cdict = {}
cdict.update({'index': ZopeTwoPageTemplateFile(filename, globals), cdict.update({'index': ViewPageTemplateFile(filename, globals),
'__name__': name}) '__name__': name})
bases += (ViewMixinForTemplates,) bases += (ViewMixinForTemplates,)
class_ = makeClass("SimpleViewClass from %s" % filename, bases, cdict) class_ = makeClass("SimpleViewClass from %s" % filename, bases, cdict)
......
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