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
53ca50ef
Commit
53ca50ef
authored
Dec 08, 2005
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preparing my personal playfield and mineground
parent
7de75ded
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
305 additions
and
0 deletions
+305
-0
lib/python/Products/ZPT/ZPT.py
lib/python/Products/ZPT/ZPT.py
+64
-0
lib/python/Products/ZPT/__init__.py
lib/python/Products/ZPT/__init__.py
+28
-0
lib/python/Products/ZPT/version.txt
lib/python/Products/ZPT/version.txt
+1
-0
lib/python/Products/ZPT/www/default.html
lib/python/Products/ZPT/www/default.html
+13
-0
lib/python/Products/ZPT/www/exclamation.gif
lib/python/Products/ZPT/www/exclamation.gif
+0
-0
lib/python/Products/ZPT/www/ptAdd.zpt
lib/python/Products/ZPT/www/ptAdd.zpt
+51
-0
lib/python/Products/ZPT/www/ptEdit.zpt
lib/python/Products/ZPT/www/ptEdit.zpt
+148
-0
lib/python/Products/ZPT/www/zpt.gif
lib/python/Products/ZPT/www/zpt.gif
+0
-0
No files found.
lib/python/Products/ZPT/ZPT.py
0 → 100755
View file @
53ca50ef
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""Zope Page Template module
Zope object encapsulating a Page Template.
"""
__version__
=
'$Revision: 1.48 $'
[
11
:
-
2
]
from
types
import
StringType
from
Globals
import
DTMLFile
,
ImageFile
,
MessageDialog
,
package_home
,
Persistent
from
zLOG
import
LOG
,
ERROR
,
INFO
from
OFS.SimpleItem
import
SimpleItem
from
AccessControl
import
getSecurityManager
from
zope.pagetemplate.pagetemplate
import
PageTemplate
from
Products.PageTemplates.PageTemplateFile
import
PageTemplateFile
class
ZPT
(
PageTemplate
):
"Zope wrapper for Page Template using TAL, TALES, and METAL"
meta_type
=
'ZPT'
def
__init__
(
self
,
id
,
text
=
None
,
content_type
=
None
):
self
.
id
=
str
(
id
)
pt_editForm
=
PageTemplateFile
(
'www/ptEdit'
,
globals
(),
__name__
=
'pt_editForm'
)
def
manage_addZPT
(
self
,
id
,
title
=
None
,
text
=
None
,
REQUEST
=
None
,
submit
=
None
):
"Add a Page Template with optional file content."
self
.
_setObject
(
id
,
ZPT
(
id
,
text
))
ob
=
getattr
(
self
,
id
)
REQUEST
.
RESPONSE
.
redirect
(
self
.
absolute_url
()
+
'/manage_main'
)
manage_addZPTForm
=
PageTemplateFile
(
'www/ptAdd'
,
globals
(),
__name__
=
'manage_addPageTemplateForm'
)
def
initialize
(
context
):
context
.
registerClass
(
ZPT
,
permission
=
'Add Page Templates'
,
constructors
=
(
manage_addZPTForm
,
manage_addZPT
),
icon
=
'www/zpt.gif'
,
)
context
.
registerHelp
()
context
.
registerHelpTitle
(
'Zope Help'
)
lib/python/Products/ZPT/__init__.py
0 → 100644
View file @
53ca50ef
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
__doc__
=
'''Package wrapper for Page Templates
This wrapper allows the Page Template modules to be segregated in a
separate package.
$Id: __init__.py 40218 2005-11-18 14:39:19Z andreasjung $'''
__version__
=
'$$'
[
11
:
-
2
]
# Placeholder for Zope Product data
misc_
=
{}
def
initialize
(
context
):
# Import lazily, and defer initialization to the module
import
ZPT
ZPT
.
initialize
(
context
)
lib/python/Products/ZPT/version.txt
0 → 100644
View file @
53ca50ef
PageTemplates-1-4-0
lib/python/Products/ZPT/www/default.html
0 → 100644
View file @
53ca50ef
<html>
<head>
<title
tal:content=
"template/title"
>
The title
</title>
</head>
<body>
<h2><span
tal:replace=
"here/title_or_id"
>
content title or id
</span>
<span
tal:condition=
"template/title"
tal:replace=
"template/title"
>
optional template title
</span></h2>
This is Page Template
<em
tal:content=
"template/id"
>
template id
</em>
.
</body>
</html>
lib/python/Products/ZPT/www/exclamation.gif
0 → 100644
View file @
53ca50ef
210 Bytes
lib/python/Products/ZPT/www/ptAdd.zpt
0 → 100644
View file @
53ca50ef
<h1 tal:replace="structure here/manage_page_header">Header</h1>
<h2 tal:define="form_title string:Add Page Template"
tal:replace="structure here/manage_form_title">Form Title</h2>
<p class="form-help">
Page Templates allow you to use simple HTML or XML attributes to
create dynamic templates. You may choose to upload the template text
from a local file by typing the file name or using the <em>browse</em>
button.
</p>
<form action="manage_addPageTemplate" method="post"
enctype="multipart/form-data">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
<div class="form-label">
Id
</div>
</td>
<td align="left" valign="top">
<input type="text" name="id" size="40" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-optional">
File
</div>
</td>
<td align="left" valign="top">
<input type="file" name="file" size="25" value="" />
</td>
</tr>
<tr>
<td align="left" valign="top">
</td>
<td align="left" valign="top">
<div class="form-element">
<input class="form-element" type="submit" name="submit"
value=" Add " />
<input class="form-element" type="submit" name="submit"
value=" Add and Edit " />
</div>
</td>
</tr>
</table>
</form>
<h1 tal:replace="structure here/manage_page_footer">Footer</h1>
lib/python/Products/ZPT/www/ptEdit.zpt
0 → 100644
View file @
53ca50ef
<h1 tal:replace="structure here/manage_page_header">Header</h1>
<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
tal:replace="structure here/manage_tabs">Tabs</h2>
<tal:block define="global body request/other/text | request/form/text
| here/read" />
<form action="" method="post" tal:attributes="action request/URL1">
<input type="hidden" name=":default_method" value="pt_changePrefs">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="middle">
<div class="form-optional">
Title
</div>
</td>
<td align="left" valign="middle">
<input type="text" name="title" size="40"
tal:attributes="value request/title | here/title" />
</td>
<td align="left" valign="middle">
<div class="form-optional">
Content-Type
</div>
</td>
<td align="left" valign="middle">
<input type="text" name="content_type" size="14"
tal:attributes="value request/content_type | here/content_type" />
</td>
</tr>
<tr>
<td align="left" valign="middle">
<div class="form-label">
Last Modified
</div>
</td>
<td align="left" valign="middle">
<div class="form-text"
tal:content="python:here.bobobase_modification_time().strftime('%Y-%m-%d %I:%M %p')">1/1/2000
</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"
tal:attributes="checked request/expand | here/expand">
Expand macros when editing
</td>
</tr>
<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>
<td align="left" valign="middle" style="background-color: #FFDDDD"
colspan="3">
<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>
<td align="left" valign="middle" style="background-color: #FFEEDD"
colspan="3">
<pre tal:content="python:modules['string'].join(warnings, '\n')">errors</pre>
</td>
</tr>
<tr>
<td align="left" valign="top" colspan="4"
tal:define="width request/dtpref_cols | string:100%;
relative_width python:str(width).endswith('%')">
<textarea name="text:text" wrap="off" style="width: 100%;" rows="20"
tal:condition="relative_width"
tal:attributes="style string:width: $width;;;
rows request/dtpref_rows | default"
tal:content="body">Template Body</textarea>
<textarea name="text:text" wrap="off" rows="20" cols="50"
tal:condition="not:relative_width"
tal:attributes="cols width; rows request/dtpref_rows | default"
tal:content="body">Template Body</textarea>
</td>
</tr>
<tr>
<td align="left" valign="top" colspan="4">
<div class="form-element">
<em tal:condition="here/wl_isLocked">Locked by WebDAV</em>
<input tal:condition="not:here/wl_isLocked"
class="form-element" type="submit"
name="pt_editAction:method" value="Save Changes">
<input class="form-element" type="submit" name="height" value="Taller">
<input class="form-element" type="submit" name="height" value="Shorter">
<input class="form-element" type="submit" name="width" value="Wider">
<input class="form-element" type="submit" name="width" value="Narrower">
</div>
</td>
</tr>
</table>
</form>
<p class="form-help">
You can upload the text for <span tal:replace="here/title_and_id" />
using the following form.
Choose an existing HTML or XML file from your local computer by clicking
<em>browse</em>. You can also <a href="document_src">click here</a>
to view or download the current text.
</p>
<form action="pt_upload" method="post"
enctype="multipart/form-data">
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td align="left" valign="top">
<div class="form-label">
File
</div>
</td>
<td align="left" valign="top">
<input type="file" name="file" size="25" value="">
</td>
</tr>
<tr tal:condition="context/management_page_charset|nothing">
<td align="left" valign="top">
<div class="form-label">
Encoding
</div>
</td>
<td align="left" valign="top">
<input name="charset" value=""
tal:attributes="value here/management_page_charset|default" />
</td>
</tr>
<tr>
<td></td>
<td align="left" valign="top">
<div class="form-element">
<em tal:condition="here/wl_isLocked">Locked by WebDAV</em>
<input tal:condition="not:here/wl_isLocked"
class="form-element" type="submit" value="Upload File">
</div>
</td>
</tr>
</table>
</form>
<h1 tal:replace="structure here/manage_page_footer">Footer</h1>
lib/python/Products/ZPT/www/zpt.gif
0 → 100644
View file @
53ca50ef
130 Bytes
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