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
d9a4d738
Commit
d9a4d738
authored
Dec 08, 2005
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quick'n dirty Z3 ZPT integration, we can edit and render....
parent
53ca50ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
2 deletions
+36
-2
lib/python/Products/ZPT/ZPT.py
lib/python/Products/ZPT/ZPT.py
+30
-1
lib/python/Products/ZPT/www/ptAdd.zpt
lib/python/Products/ZPT/www/ptAdd.zpt
+1
-1
lib/python/Products/ZPT/www/ptEdit.zpt
lib/python/Products/ZPT/www/ptEdit.zpt
+5
-0
No files found.
lib/python/Products/ZPT/ZPT.py
View file @
d9a4d738
...
...
@@ -21,19 +21,48 @@ from types import StringType
from
Globals
import
DTMLFile
,
ImageFile
,
MessageDialog
,
package_home
,
Persistent
from
zLOG
import
LOG
,
ERROR
,
INFO
from
OFS.SimpleItem
import
SimpleItem
import
AccessControl
from
AccessControl
import
getSecurityManager
from
zope.pagetemplate.pagetemplate
import
PageTemplate
from
Products.PageTemplates.PageTemplateFile
import
PageTemplateFile
class
ZPT
(
PageTemplate
):
class
ZPT
(
SimpleItem
,
PageTemplate
):
"Zope wrapper for Page Template using TAL, TALES, and METAL"
meta_type
=
'ZPT'
manage_options
=
(
{
'label'
:
'Edit'
,
'action'
:
'pt_editForm'
,
'help'
:
(
'PageTemplates'
,
'PageTemplate_Edit.stx'
)},
{
'label'
:
'Test'
,
'action'
:
'ZScriptHTML_tryForm'
},
)
\
+
SimpleItem
.
manage_options
\
security
=
AccessControl
.
ClassSecurityInfo
()
def
__init__
(
self
,
id
,
text
=
None
,
content_type
=
None
):
self
.
id
=
str
(
id
)
security
.
declareProtected
(
'View'
,
'__call__'
)
security
.
declareProtected
(
'View'
,
'view'
)
def
view
(
self
):
"""view """
return
self
()
security
.
declareProtected
(
'Change Page Templates'
,
'pt_editAction'
,
'pt_setTitle'
,
'pt_edit'
,
'pt_upload'
,
'pt_changePrefs'
)
def
pt_editAction
(
self
,
REQUEST
,
title
,
text
,
content_type
,
expand
):
"""Change the title and document."""
print
text
print
content_type
self
.
pt_edit
(
text
,
content_type
)
message
=
'done'
return
self
.
pt_editForm
(
manage_tabs_message
=
message
)
pt_editForm
=
PageTemplateFile
(
'www/ptEdit'
,
globals
(),
__name__
=
'pt_editForm'
)
...
...
lib/python/Products/ZPT/www/ptAdd.zpt
View file @
d9a4d738
...
...
@@ -10,7 +10,7 @@ from a local file by typing the file name or using the <em>browse</em>
button.
</p>
<form action="manage_add
PageTemplate
" method="post"
<form action="manage_add
ZPT
" method="post"
enctype="multipart/form-data">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
...
...
lib/python/Products/ZPT/www/ptEdit.zpt
View file @
d9a4d738
...
...
@@ -39,8 +39,10 @@
</div>
</td>
<td align="left" valign="top" colspan=2>
<!--
<a href="source.html" tal:condition="here/html">Browse HTML source</a>
<a href="source.xml" tal:condition="not:here/html">Browse XML source</a>
-->
<br>
<input type="hidden" name="expand:int:default" value="0">
<input type="checkbox" value="1" name="expand:int"
...
...
@@ -49,6 +51,8 @@
</td>
</tr>
<span tal:content="python: context.pt_errors(None)" />
<!--
<tr tal:define="errors here/pt_errors" tal:condition="errors">
<tal:block define="global body python:here.document_src({'raw':1})"/>
<td align="left" valign="middle" class="form-label">Errors</td>
...
...
@@ -57,6 +61,7 @@
<pre tal:content="python:modules['string'].join(errors, '\n')">errors</pre>
</td>
</tr>
-->
<tr tal:define="warnings here/pt_warnings" tal:condition="warnings">
<td align="left" valign="middle" class="form-label">Warnings</td>
...
...
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