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
ea3765d4
Commit
ea3765d4
authored
Oct 15, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge bugfixes from zpt-1_4_0
parent
7cbbf24c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
21 deletions
+43
-21
lib/python/Products/PageTemplates/Expressions.py
lib/python/Products/PageTemplates/Expressions.py
+2
-1
lib/python/Products/PageTemplates/HISTORY.txt
lib/python/Products/PageTemplates/HISTORY.txt
+16
-0
lib/python/Products/PageTemplates/PageTemplateFile.py
lib/python/Products/PageTemplates/PageTemplateFile.py
+12
-5
lib/python/Products/PageTemplates/ZopePageTemplate.py
lib/python/Products/PageTemplates/ZopePageTemplate.py
+13
-15
No files found.
lib/python/Products/PageTemplates/Expressions.py
View file @
ea3765d4
...
...
@@ -89,7 +89,7 @@ Page Template-specific implementation of TALES, with handlers
for Python expressions, string literals, and paths.
"""
__version__
=
'$Revision: 1.2
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
2
$'
[
11
:
-
2
]
import
re
,
sys
from
TALES
import
Engine
,
CompilerError
,
_valid_name
,
NAME_RE
,
\
...
...
@@ -125,6 +125,7 @@ if sys.modules.has_key('Zope'):
else
:
from
ZPythonExpr
import
PythonExpr
,
_SecureModuleImporter
,
\
call_with_ns
SecureModuleImporter
=
_SecureModuleImporter
()
else
:
from
PythonExpr
import
getSecurityManager
,
PythonExpr
def
call_with_ns
(
f
,
ns
,
arg
=
1
):
...
...
lib/python/Products/PageTemplates/HISTORY.txt
View file @
ea3765d4
...
...
@@ -4,6 +4,22 @@ Page Template history
PageTemplates. Change information for the current release can be found
in the file CHANGES.txt.
Version 1.4.1
Bugs Fixed
- Tracebacks were often truncated.
- __bobo_traverse__ objects, such as the root, triggered
security incorrectly when traversed.
- If a PageTemplate was owned by a missing user, or one with
insufficient permissions, the editing form broke.
- PageTemplateFiles didn't bind 'user'.
- There was no help.
Version 1.4.0
Features Added
...
...
lib/python/Products/PageTemplates/PageTemplateFile.py
View file @
ea3765d4
...
...
@@ -87,7 +87,7 @@
Zope object encapsulating a Page Template from the filesystem.
"""
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
5
$'
[
11
:
-
2
]
import
os
,
AccessControl
,
Acquisition
,
sys
from
Globals
import
package_home
,
DevelopmentMode
...
...
@@ -98,8 +98,14 @@ from Shared.DC.Scripts.Signature import FuncCode
from
AccessControl
import
getSecurityManager
from
OFS.Traversable
import
Traversable
from
PageTemplate
import
PageTemplate
from
ZopePageTemplate
import
SecureModuleImporter
from
Expressions
import
SecureModuleImporter
from
ComputedAttribute
import
ComputedAttribute
from
ExtensionClass
import
Base
class
MacroCollection
(
Base
):
def
__of__
(
self
,
parent
):
parent
.
_cook_check
()
return
parent
.
_v_macros
class
PageTemplateFile
(
Script
,
PageTemplate
,
Traversable
):
"Zope wrapper for filesystem Page Template using TAL, TALES, and METAL"
...
...
@@ -110,6 +116,7 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
func_code
=
FuncCode
((),
0
)
_need__name__
=
1
_v_last_read
=
0
macros
=
MacroCollection
()
_default_bindings
=
{
'name_subpath'
:
'traverse_subpath'
}
...
...
@@ -125,8 +132,8 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
elif
type
(
_prefix
)
is
not
type
(
''
):
_prefix
=
package_home
(
_prefix
)
name
=
kw
.
get
(
'__name__'
)
if
n
ot
n
ame
:
name
=
os
.
path
.
split
(
filename
)[
-
1
]
if
name
:
self
.
_need__name__
=
0
self
.
__name__
=
name
self
.
filename
=
filename
=
os
.
path
.
join
(
_prefix
,
filename
+
'.zpt'
)
...
...
lib/python/Products/PageTemplates/ZopePageTemplate.py
View file @
ea3765d4
...
...
@@ -87,7 +87,7 @@
Zope object encapsulating a Page Template.
"""
__version__
=
'$Revision: 1.
19
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
20
$'
[
11
:
-
2
]
import
os
,
AccessControl
,
Acquisition
,
sys
from
Globals
import
DTMLFile
,
MessageDialog
,
package_home
...
...
@@ -104,6 +104,8 @@ from OFS.Traversable import Traversable
from
OFS.PropertyManager
import
PropertyManager
from
PageTemplate
import
PageTemplate
from
TALES
import
TALESError
from
Expressions
import
SecureModuleImporter
from
PageTemplateFile
import
PageTemplateFile
try
:
from
webdav.Lockable
import
ResourceLockedError
...
...
@@ -124,12 +126,13 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
func_defaults
=
None
func_code
=
FuncCode
((),
0
)
_default_bindings
=
{
'name_subpath'
:
'traverse_subpath'
}
_default_bindings
=
{}
_default_content_fn
=
os
.
path
.
join
(
package_home
(
globals
()),
'www'
,
'default.html'
)
manage_options
=
(
{
'label'
:
'Edit'
,
'action'
:
'pt_editForm'
},
{
'label'
:
'Edit'
,
'action'
:
'pt_editForm'
,
'help'
:
(
'PageTemplates'
,
'PageTemplate_Edit.stx'
)},
{
'label'
:
'Test'
,
'action'
:
'ZScriptHTML_tryForm'
},
)
+
PropertyManager
.
manage_options
\
+
Historical
.
manage_options
\
...
...
@@ -162,6 +165,11 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
'ZScriptHTML_tryForm'
,
'PrincipiaSearchSource'
,
'document_src'
,
'source.html'
,
'source.xml'
)
pt_editForm
=
PageTemplateFile
(
'www/ptEdit'
,
globals
(),
__name__
=
'pt_editForm'
)
pt_editForm
.
_owner
=
None
manage
=
manage_main
=
pt_editForm
security
.
declareProtected
(
'Change Page Templates'
,
'pt_editAction'
,
'pt_setTitle'
,
'pt_edit'
,
'pt_upload'
,
'pt_changePrefs'
)
...
...
@@ -335,10 +343,9 @@ class Src(Acquisition.Explicit):
d
=
ZopePageTemplate
.
__dict__
d
[
'source.xml'
]
=
d
[
'source.html'
]
=
Src
()
from
Expressions
import
_SecureModuleImporter
SecureModuleImporter
=
_SecureModuleImporter
()
# Product registration and Add support
manage_addPageTemplateForm
=
PageTemplateFile
(
'www/ptAdd'
,
globals
())
from
urllib
import
quote
def
manage_addPageTemplate
(
self
,
id
,
title
=
None
,
text
=
None
,
...
...
@@ -368,16 +375,7 @@ def manage_addPageTemplate(self, id, title=None, text=None,
REQUEST
.
RESPONSE
.
redirect
(
u
+
'/manage_main'
)
return
''
#manage_addPageTemplateForm = DTMLFile('dtml/ptAdd', globals())
def
initialize
(
context
):
from
PageTemplateFile
import
PageTemplateFile
manage_addPageTemplateForm
=
PageTemplateFile
(
'www/ptAdd'
,
globals
())
_editForm
=
PageTemplateFile
(
'www/ptEdit'
,
globals
())
ZopePageTemplate
.
manage
=
_editForm
ZopePageTemplate
.
manage_main
=
_editForm
ZopePageTemplate
.
pt_editForm
=
_editForm
_editForm
.
_owner
=
None
context
.
registerClass
(
ZopePageTemplate
,
permission
=
'Add Page Templates'
,
...
...
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