Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
b8427365
Commit
b8427365
authored
Jul 28, 2007
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support a bunch of top-level TALES variables
parent
e004dfd3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
lib/python/Products/Five/browser/pagetemplatefile.py
lib/python/Products/Five/browser/pagetemplatefile.py
+22
-1
No files found.
lib/python/Products/Five/browser/pagetemplatefile.py
View file @
b8427365
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
$Id$
$Id$
"""
"""
import
zope.app.pagetemplate
import
zope.app.pagetemplate
from
Acquisition
import
aq_parent
from
AccessControl
import
getSecurityManager
from
Products.PageTemplates.Expressions
import
SecureModuleImporter
from
Products.PageTemplates.Expressions
import
SecureModuleImporter
from
Products.PageTemplates.Expressions
import
createTrustedZopeEngine
from
Products.PageTemplates.Expressions
import
createTrustedZopeEngine
...
@@ -31,7 +34,25 @@ class ViewPageTemplateFile(zope.app.pagetemplate.ViewPageTemplateFile):
...
@@ -31,7 +34,25 @@ class ViewPageTemplateFile(zope.app.pagetemplate.ViewPageTemplateFile):
def
pt_getContext
(
self
,
instance
,
request
,
**
kw
):
def
pt_getContext
(
self
,
instance
,
request
,
**
kw
):
context
=
super
(
ViewPageTemplateFile
,
self
).
pt_getContext
(
context
=
super
(
ViewPageTemplateFile
,
self
).
pt_getContext
(
instance
,
request
,
**
kw
)
instance
,
request
,
**
kw
)
context
[
'modules'
]
=
SecureModuleImporter
# get the root
obj
=
context
[
'context'
]
root
=
None
while
(
getattr
(
obj
,
'getPhysicalRoot'
,
None
)
is
None
and
aq_parent
(
obj
)
is
not
None
):
obj
=
aq_parent
(
obj
)
if
getattr
(
obj
,
'getPhysicalRoot'
,
None
)
is
not
None
:
root
=
obj
.
getPhysicalRoot
()
context
.
update
(
here
=
context
[
'context'
],
# philiKON thinks container should be the view,
# but BBB is more important than aesthetics.
container
=
context
[
'context'
],
root
=
root
,
modules
=
SecureModuleImporter
,
traverse_subpath
=
[],
# BBB, never really worked
user
=
getSecurityManager
().
getUser
()
)
return
context
return
context
# BBB
# BBB
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment