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
f9ca9c73
Commit
f9ca9c73
authored
Jun 21, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enhance the manage_addPageTemplate constructor.
parent
aaf6c749
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
lib/python/Products/PageTemplates/CHANGES.txt
lib/python/Products/PageTemplates/CHANGES.txt
+2
-0
lib/python/Products/PageTemplates/ZopePageTemplate.py
lib/python/Products/PageTemplates/ZopePageTemplate.py
+8
-3
No files found.
lib/python/Products/PageTemplates/CHANGES.txt
View file @
f9ca9c73
...
...
@@ -9,6 +9,8 @@ Page Template changes
Features Added
- Allow any false value in tal:repeat to act as an empty sequence.
- manage_addPageTemplate accepts optional title and text
arguments, and returns the new object if REQUEST is None.
Bugs Fixed
...
...
lib/python/Products/PageTemplates/ZopePageTemplate.py
View file @
f9ca9c73
...
...
@@ -87,7 +87,7 @@
Zope object encapsulating a Page Template.
"""
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
import
os
,
AccessControl
,
Acquisition
,
sys
from
Globals
import
DTMLFile
,
MessageDialog
,
package_home
...
...
@@ -308,12 +308,17 @@ SecureModuleImporter = _SecureModuleImporter()
# Product registration and Add support
from
urllib
import
quote
def
manage_addPageTemplate
(
self
,
id
,
REQUEST
=
None
,
submit
=
None
):
def
manage_addPageTemplate
(
self
,
id
,
title
=
None
,
text
=
None
,
REQUEST
=
None
,
submit
=
None
):
"Add a Page Template with optional file content."
id
=
str
(
id
)
if
REQUEST
is
None
:
self
.
_setObject
(
id
,
ZopePageTemplate
(
id
))
self
.
_setObject
(
id
,
ZopePageTemplate
(
id
,
text
))
ob
=
getattr
(
self
,
id
)
if
title
:
ob
.
pt_setTitle
(
title
)
return
ob
else
:
file
=
REQUEST
.
form
.
get
(
'file'
)
headers
=
getattr
(
file
,
'headers'
,
None
)
...
...
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