Commit 8bf40628 authored by Evan Simpson's avatar Evan Simpson

Add user variable, and return the actual changed text in the edit form.

parent c7aa5250
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
Zope object encapsulating a Page Template. Zope object encapsulating a Page Template.
""" """
__version__='$Revision: 1.8 $'[11:-2] __version__='$Revision: 1.9 $'[11:-2]
import os, AccessControl, Acquisition, sys import os, AccessControl, Acquisition, sys
from Globals import DTMLFile, MessageDialog, package_home from Globals import DTMLFile, MessageDialog, package_home
...@@ -159,6 +159,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable, ...@@ -159,6 +159,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
self.expand=expand self.expand=expand
self.pt_setTitle(title) self.pt_setTitle(title)
self.pt_edit(text, content_type) self.pt_edit(text, content_type)
REQUEST.set('text', self.read()) # May not equal 'text'!
message = "Saved changes." message = "Saved changes."
if getattr(self, '_v_warnings', None): if getattr(self, '_v_warnings', None):
message = ("<strong>Warning:</strong> <i>%s</i>" message = ("<strong>Warning:</strong> <i>%s</i>"
...@@ -237,6 +238,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable, ...@@ -237,6 +238,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
# Execute the template in a new security context. # Execute the template in a new security context.
security=getSecurityManager() security=getSecurityManager()
bound_names['user'] = security.getUser()
security.addContext(self) security.addContext(self)
try: try:
return self.pt_render(extra_context=bound_names) return self.pt_render(extra_context=bound_names)
......
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