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
ec56ce7e
Commit
ec56ce7e
authored
Dec 17, 2005
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed pt_encoding() since we use utf-8 in the ZMI only
parent
8ee69e8f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
lib/python/Products/PageTemplates/ZopePageTemplate.py
lib/python/Products/PageTemplates/ZopePageTemplate.py
+2
-9
lib/python/Products/PageTemplates/pt/ptEdit.pt
lib/python/Products/PageTemplates/pt/ptEdit.pt
+2
-2
No files found.
lib/python/Products/PageTemplates/ZopePageTemplate.py
View file @
ec56ce7e
...
@@ -127,14 +127,6 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
...
@@ -127,14 +127,6 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
self.ZBindings_edit(self._default_bindings)
self.ZBindings_edit(self._default_bindings)
self.pt_edit(text, content_type, encoding)
self.pt_edit(text, content_type, encoding)
security.declareProtected(change_page_templates, '
pt_encoding
')
def pt_encoding(self):
encoding = sniffEncoding(self.read())
return encoding
from ComputedAttribute import ComputedAttribute
management_page_charset = ComputedAttribute(pt_encoding, 1)
security.declareProtected(change_page_templates, '
pt_edit
')
security.declareProtected(change_page_templates, '
pt_edit
')
def pt_edit(self, text, content_type, encoding='
utf
-
8
'):
def pt_edit(self, text, content_type, encoding='
utf
-
8
'):
...
@@ -423,7 +415,7 @@ def manage_addPageTemplate(self, id, title='', text=None, encoding='utf-8', subm
...
@@ -423,7 +415,7 @@ def manage_addPageTemplate(self, id, title='', text=None, encoding='utf-8', subm
content_type = headers['content_type']
content_type = headers['content_type']
else:
else:
content_type = guess_type(filename, text)
content_type = guess_type(filename, text)
encoding = sniffEncoding(text)
encoding = sniffEncoding(text
, encoding
)
else:
else:
if hasattr(text, 'read'):
if hasattr(text, 'read'):
...
@@ -434,6 +426,7 @@ def manage_addPageTemplate(self, id, title='', text=None, encoding='utf-8', subm
...
@@ -434,6 +426,7 @@ def manage_addPageTemplate(self, id, title='', text=None, encoding='utf-8', subm
content_type = headers['content_type']
content_type = headers['content_type']
else:
else:
content_type = guess_type(filename, text)
content_type = guess_type(filename, text)
encoding = sniffEncoding(text, encoding)
if not text:
if not text:
text = open(_default_content_fn).read()
text = open(_default_content_fn).read()
...
...
lib/python/Products/PageTemplates/pt/ptEdit.pt
View file @
ec56ce7e
<h1 tal:replace="structure python: context.manage_page_header(management_page_charset=
context.pt_encoding()
)">Header</h1>
<h1 tal:replace="structure python: context.manage_page_header(management_page_charset=
'utf-8'
)">Header</h1>
<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
tal:replace="structure context/manage_tabs">Tabs</h2>
tal:replace="structure context/manage_tabs">Tabs</h2>
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
| context/read" />
| context/read" />
<form action="" method="post" tal:attributes="action request/URL1">
<form action="" method="post" tal:attributes="action request/URL1">
<input type="hidden" name=":default_method" value="pt_changePrefs">
<input type="hidden" name=":default_method" value="pt_changePrefs">
<input type="hidden" name="encoding"
tal:attributes="value context/pt_encoding"
/>
<input type="hidden" name="encoding"
value="utf-8"
/>
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<tr>
<td align="left" valign="middle">
<td align="left" valign="middle">
...
...
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