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
38891274
Commit
38891274
authored
Jul 06, 2003
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Collector #628: Applied patch to fix several textarea resize
problems.
parent
27d54537
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
157 additions
and
132 deletions
+157
-132
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/App/dtml/manage_zmi_prefs.dtml
lib/python/App/dtml/manage_zmi_prefs.dtml
+5
-7
lib/python/DocumentTemplate/DT_UI.py
lib/python/DocumentTemplate/DT_UI.py
+11
-8
lib/python/OFS/DTMLDocument.py
lib/python/OFS/DTMLDocument.py
+2
-2
lib/python/OFS/DTMLMethod.py
lib/python/OFS/DTMLMethod.py
+13
-15
lib/python/OFS/dtml/documentEdit.dtml
lib/python/OFS/dtml/documentEdit.dtml
+4
-6
lib/python/OFS/dtml/fileEdit.dtml
lib/python/OFS/dtml/fileEdit.dtml
+9
-3
lib/python/Products/PageTemplates/ZopePageTemplate.py
lib/python/Products/PageTemplates/ZopePageTemplate.py
+19
-27
lib/python/Products/PageTemplates/www/ptEdit.zpt
lib/python/Products/PageTemplates/www/ptEdit.zpt
+5
-6
lib/python/Products/PythonScripts/PythonScript.py
lib/python/Products/PythonScripts/PythonScript.py
+20
-14
lib/python/Products/PythonScripts/www/pyScriptEdit.dtml
lib/python/Products/PythonScripts/www/pyScriptEdit.dtml
+9
-3
lib/python/Products/SiteAccess/www/manage_edit.dtml
lib/python/Products/SiteAccess/www/manage_edit.dtml
+8
-4
lib/python/Products/ZReST/ZReST.py
lib/python/Products/ZReST/ZReST.py
+13
-9
lib/python/Products/ZReST/dtml/manage_editForm.dtml
lib/python/Products/ZReST/dtml/manage_editForm.dtml
+9
-5
lib/python/Products/ZSQLMethods/dtml/edit.dtml
lib/python/Products/ZSQLMethods/dtml/edit.dtml
+9
-5
lib/python/Shared/DC/ZRDB/DA.py
lib/python/Shared/DC/ZRDB/DA.py
+18
-18
No files found.
doc/CHANGES.txt
View file @
38891274
...
...
@@ -71,6 +71,9 @@ Zope Changes
Bugs Fixed
- Collector #628: Applied patch to fix several textarea resize
problems.
- Collector #954: clear() method of TopicIndex removed all filter sets
instead of clearing them.
...
...
lib/python/App/dtml/manage_zmi_prefs.dtml
View file @
38891274
...
...
@@ -91,7 +91,7 @@ button in order for some changes to take effect.
</div>
</td>
<td align="left" valign="top">
<input type="text" name="dtpref_rows" value="&dtml-rows;" size="6" />
<input type="text" name="dtpref_rows
:int
" value="&dtml-rows;" size="6" />
</td>
</tr>
</table>
...
...
@@ -102,14 +102,12 @@ button in order for some changes to take effect.
<div class="form-help">
<dtml-if expr="cols[-1]=='%'">
<textarea name="data:text" wrap="off" style="width:&dtml-cols;"
rows="&dtml-rows;"
>This is a sample edit textarea.</textarea>
<textarea name="data:text" rows="&dtml-rows;" style="width: &dtml-cols;;">
<dtml-else>
<textarea name="data:text" wrap="off" cols="&dtml-cols;"
rows="&dtml-rows;"
>This is a sample edit textarea.</textarea>
<textarea name="data:text" cols="&dtml-cols;" rows="&dtml-rows;">
</dtml-if>
This is a sample edit textarea.
</textarea>
</div>
</dtml-let>
...
...
lib/python/DocumentTemplate/DT_UI.py
View file @
38891274
...
...
@@ -12,8 +12,8 @@
##############################################################################
__doc__
=
'''Machinery to support through-the-web editing
$Id: DT_UI.py,v 1.1
3 2002/08/26 13:30:18 Brian
Exp $'''
__version__
=
'$Revision: 1.1
3
$'
[
11
:
-
2
]
$Id: DT_UI.py,v 1.1
4 2003/07/06 10:43:46 andreasjung
Exp $'''
__version__
=
'$Revision: 1.1
4
$'
[
11
:
-
2
]
from
DT_HTML
import
HTML
...
...
@@ -25,9 +25,6 @@ HTML.document_template_edit_footer=(
"""<FONT SIZE="-1">
<I><A HREF="http://www.zope.com">
© 2002 Zope Corporation</A></I></FONT>"""
)
HTML
.
document_template_edit_width
=
58
HTML
.
_manage_editForm
=
HTML
(
"""<HTML>
<HEAD>
...
...
@@ -41,9 +38,15 @@ HTML._manage_editForm = HTML(
Document template source:
<center>
<br>
<TEXTAREA NAME="data:text" cols="<!--#var document_template_edit_width-->"
rows="20"><!--#var __str__--></TEXTAREA>
<dtml-let cols="REQUEST.get('dtpref_cols', '100%')"
rows="REQUEST.get('dtpref_rows', '20')">
<dtml-if expr="cols[-1]=='%'">
<textarea name="data:text" style="width: &dtml-cols;;"
<dtml-else>
<textarea name="data:text" cols="&dtml-cols;"
</dtml-if>
rows="&dtml-rows;"><dtml-var __str__></textarea>
</dtml-let>
<br>
<INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Change">
<INPUT NAME=SUBMIT TYPE="RESET" VALUE="Reset">
...
...
lib/python/OFS/DTMLDocument.py
View file @
38891274
...
...
@@ -12,7 +12,7 @@
##############################################################################
"""DTML Document objects."""
__version__
=
'$Revision: 1.4
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
9
$'
[
11
:
-
2
]
from
ZPublisher.Converters
import
type_converters
from
Globals
import
HTML
,
DTMLFile
,
MessageDialog
...
...
@@ -55,7 +55,7 @@ class DTMLDocument(PropertyManager, DTMLMethod):
),
)
def
manage_edit
(
self
,
data
,
title
,
SUBMIT
=
'Change'
,
dtpref_cols
=
'
50
'
,
def
manage_edit
(
self
,
data
,
title
,
SUBMIT
=
'Change'
,
dtpref_cols
=
'
100%
'
,
dtpref_rows
=
'20'
,
REQUEST
=
None
):
"""
Replaces a Documents contents with Data, Title with Title.
...
...
lib/python/OFS/DTMLMethod.py
View file @
38891274
...
...
@@ -12,7 +12,7 @@
##############################################################################
"""DTML Method objects."""
__version__
=
'$Revision: 1.8
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.8
1
$'
[
11
:
-
2
]
import
History
from
Globals
import
HTML
,
DTMLFile
,
MessageDialog
...
...
@@ -220,21 +220,19 @@ class DTMLMethod(RestrictedDTML, HTML, Acquisition.Implicit, RoleManager,
def
_er
(
self
,
data
,
title
,
SUBMIT
,
dtpref_cols
,
dtpref_rows
,
REQUEST
):
dr
,
dc
=
self
.
_size_changes
[
SUBMIT
]
rows
=
str
(
max
(
1
,
int
(
dtpref_rows
)
+
dr
))
if
dtpref_cols
[
-
1
]
==
'%'
:
cols
=
str
(
min
(
100
,
max
(
25
,
int
(
dtpref_cols
[:
-
1
])
+
dc
)))
+
'%'
rows
=
str
(
max
(
1
,
int
(
dtpref_rows
)
+
dr
))
cols
=
str
(
dtpref_cols
)
if
cols
.
endswith
(
'%'
):
cols
=
str
(
min
(
100
,
max
(
25
,
int
(
cols
[:
-
1
])
+
dc
)))
+
'%'
else
:
cols
=
str
(
max
(
35
,
int
(
dtpref_cols
)
+
dc
))
e
=
(
DateTime
(
'GMT'
)
+
365
).
rfc822
()
resp
=
REQUEST
[
'RESPONSE'
]
resp
.
setCookie
(
'dtpref_rows'
,
str
(
rows
),
path
=
'/'
,
expires
=
e
)
resp
.
setCookie
(
'dtpref_cols'
,
str
(
cols
),
path
=
'/'
,
expires
=
e
)
return
self
.
manage_main
(
self
,
REQUEST
,
title
=
title
,
__str__
=
self
.
quotedHTML
(
data
),
dtpref_cols
=
cols
,
dtpref_rows
=
rows
)
cols
=
str
(
max
(
35
,
int
(
cols
)
+
dc
))
e
=
(
DateTime
(
"GMT"
)
+
365
).
rfc822
()
setCookie
=
REQUEST
[
"RESPONSE"
].
setCookie
setCookie
(
"dtpref_rows"
,
rows
,
path
=
'/'
,
expires
=
e
)
setCookie
(
"dtpref_cols"
,
cols
,
path
=
'/'
,
expires
=
e
)
REQUEST
.
other
.
update
({
"dtpref_cols"
:
cols
,
"dtpref_rows"
:
rows
})
return
self
.
manage_main
(
self
,
REQUEST
,
title
=
title
,
__str__
=
self
.
quotedHTML
(
data
))
def
manage_edit
(
self
,
data
,
title
,
SUBMIT
=
'Change'
,
dtpref_cols
=
'100%'
,
dtpref_rows
=
'20'
,
REQUEST
=
None
):
...
...
lib/python/OFS/dtml/documentEdit.dtml
View file @
38891274
...
...
@@ -25,16 +25,14 @@ the <em>browse</em> button to select a local file to upload.
<tr>
<td align="left" valign="top" colspan="2">
<dtml-let cols="REQUEST.get('dtpref_cols', '100%')">
<dtml-let cols="REQUEST.get('dtpref_cols', '100%')"
rows="REQUEST.get('dtpref_rows', '20')">
<dtml-if expr="cols[-1]=='%'">
<textarea name="data:text" wrap="off" style="width:&dtml-cols;"
rows="<dtml-var dtpref_rows missing="20" html_quote>"
><dtml-var __str__></textarea>
<textarea name="data:text" wrap="off" style="width: &dtml-cols;;"
<dtml-else>
<textarea name="data:text" wrap="off" cols="&dtml-cols;"
rows="<dtml-var dtpref_rows missing="20" html_quote>"
><dtml-var __str__></textarea>
</dtml-if>
rows="&dtml-rows;"><dtml-var __str__></textarea>
</dtml-let>
</td>
</tr>
...
...
lib/python/OFS/dtml/fileEdit.dtml
View file @
38891274
...
...
@@ -52,9 +52,15 @@ text type and small enough to be edited in a text area.
<tr>
<td align="left" valign="top" colspan="2">
<div style="width: 100%;">
<textarea name="filedata:text" wrap="off" style="width: 100%;"<dtml-if
dtpref_cols> cols="&dtml-dtpref_cols;"<dtml-else
> cols="50"</dtml-if><dtml-if dtpref_rows> rows="&dtml-dtpref_rows;"<dtml-else> rows="20"</dtml-if>><dtml-var __str__ html_quote></textarea>
<dtml-let cols="REQUEST.get('dtpref_cols', '100%')"
rows="REQUEST.get('dtpref_rows', '20')">
<dtml-if "cols[-1]=='%'">
<textarea name="filedata:text" wrap="off" style="width: &dtml-cols;;"
<dtml-else>
<textarea name="filedata:text" wrap="off" cols="&dtml-cols;"
</dtml-if>
rows="&dtml-rows;"><dtml-var __str__ html_quote></textarea>
</dtml-let>
</div>
</td>
</tr>
...
...
lib/python/Products/PageTemplates/ZopePageTemplate.py
View file @
38891274
...
...
@@ -15,7 +15,7 @@
Zope object encapsulating a Page Template.
"""
__version__
=
'$Revision: 1.4
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
5
$'
[
11
:
-
2
]
import
os
,
AccessControl
,
Acquisition
,
sys
from
types
import
StringType
...
...
@@ -138,33 +138,25 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
return
self
.
pt_editForm
(
manage_tabs_message
=
message
)
def
pt_changePrefs
(
self
,
REQUEST
,
height
=
None
,
width
=
None
,
dtpref_cols
=
'100%'
,
dtpref_rows
=
'20'
):
dtpref_cols
=
"100%"
,
dtpref_rows
=
"20"
):
"""Change editing preferences."""
szchh
=
{
'Taller'
:
1
,
'Shorter'
:
-
1
,
None
:
0
}
szchw
=
{
'Wider'
:
5
,
'Narrower'
:
-
5
,
None
:
0
}
# The <textarea> can have dimensions expressed in percentages
if
type
(
width
)
is
StringType
and
width
.
endswith
(
'%'
):
cols
=
int
(
width
[:
-
1
])
cols
=
max
(
cols
,
25
)
# Min width 25%
cols
=
max
(
cols
,
100
)
# Max width 100%
cols
=
"%d%%"
%
cols
# Add percent sign back on
elif
type
(
width
)
is
StringType
and
dtpref_cols
.
endswith
(
'%'
):
cols
=
int
(
dtpref_cols
[:
-
1
])
cols
=
max
(
cols
+
szchw
.
get
(
width
,
0
),
25
)
# Min width 25%
cols
=
min
(
cols
,
100
)
# Max width 100%
cols
=
"%d%%"
%
cols
# Add percent sign back on
else
:
# Absolute width
try
:
cols
=
int
(
width
)
except
:
cols
=
max
(
40
,
int
(
dtpref_cols
)
+
szchw
.
get
(
width
,
0
))
try
:
rows
=
int
(
height
)
except
:
rows
=
max
(
1
,
int
(
dtpref_rows
)
+
szchh
.
get
(
height
,
0
))
e
=
(
DateTime
(
'GMT'
)
+
365
).
rfc822
()
setc
=
REQUEST
[
'RESPONSE'
].
setCookie
setc
(
'dtpref_rows'
,
str
(
rows
),
path
=
'/'
,
expires
=
e
)
setc
(
'dtpref_cols'
,
str
(
cols
),
path
=
'/'
,
expires
=
e
)
REQUEST
.
form
.
update
({
'dtpref_cols'
:
cols
,
'dtpref_rows'
:
rows
})
dr
=
{
"Taller"
:
5
,
"Shorter"
:
-
5
}.
get
(
height
,
0
)
dc
=
{
"Wider"
:
5
,
"Narrower"
:
-
5
}.
get
(
width
,
0
)
if
isinstance
(
height
,
int
):
dtpref_rows
=
height
if
isinstance
(
width
,
int
)
or
\
isinstance
(
width
,
str
)
and
width
.
endswith
(
'%'
):
dtpref_cols
=
width
rows
=
str
(
max
(
1
,
int
(
dtpref_rows
)
+
dr
))
cols
=
str
(
dtpref_cols
)
if
cols
.
endswith
(
'%'
):
cols
=
str
(
min
(
100
,
max
(
25
,
int
(
cols
[:
-
1
])
+
dc
)))
+
'%'
else
:
cols
=
str
(
max
(
35
,
int
(
cols
)
+
dc
))
e
=
(
DateTime
(
"GMT"
)
+
365
).
rfc822
()
setCookie
=
REQUEST
[
"RESPONSE"
].
setCookie
setCookie
(
"dtpref_rows"
,
rows
,
path
=
'/'
,
expires
=
e
)
setCookie
(
"dtpref_cols"
,
cols
,
path
=
'/'
,
expires
=
e
)
REQUEST
.
other
.
update
({
"dtpref_cols"
:
cols
,
"dtpref_rows"
:
rows
})
return
self
.
manage_main
()
def
ZScriptHTML_tryParams
(
self
):
...
...
lib/python/Products/PageTemplates/www/ptEdit.zpt
View file @
38891274
...
...
@@ -68,17 +68,16 @@
<tr>
<td align="left" valign="top" colspan="4"
tal:define="width request/
form/dtpref_cols | request/
dtpref_cols | string:100%;
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"
<textarea name="text:text" wrap="off" style="width:
100%;" rows="20"
tal:condition="relative_width"
tal:attributes="style string:width:
$width;
rows request/
form/dtpref_rows | request/
dtpref_rows | default"
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/form/dtpref_rows | request/dtpref_rows | default"
tal:attributes="cols width; rows request/dtpref_rows | default"
tal:content="body">Template Body</textarea>
</td>
</tr>
...
...
lib/python/Products/PythonScripts/PythonScript.py
View file @
38891274
...
...
@@ -17,7 +17,7 @@ This product provides support for Script objects containing restricted
Python code.
"""
__version__
=
'$Revision: 1.4
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
7
$'
[
11
:
-
2
]
import
sys
,
os
,
traceback
,
re
,
marshal
,
new
from
Globals
import
DTMLFile
,
MessageDialog
,
package_home
...
...
@@ -164,20 +164,26 @@ class PythonScript(Script, Historical, Cacheable):
manage_tabs_message
=
message
)
def
ZPythonScriptHTML_changePrefs
(
self
,
REQUEST
,
height
=
None
,
width
=
None
,
dtpref_cols
=
'50'
,
dtpref_rows
=
'20'
):
dtpref_cols
=
"100%"
,
dtpref_rows
=
"20"
):
"""Change editing preferences."""
szchh
=
{
'Taller'
:
1
,
'Shorter'
:
-
1
,
None
:
0
}
szchw
=
{
'Wider'
:
5
,
'Narrower'
:
-
5
,
None
:
0
}
try
:
rows
=
int
(
height
)
except
:
rows
=
max
(
1
,
int
(
dtpref_rows
)
+
szchh
.
get
(
height
,
0
))
try
:
cols
=
int
(
width
)
except
:
cols
=
max
(
40
,
int
(
dtpref_cols
)
+
szchw
.
get
(
width
,
0
))
e
=
(
DateTime
(
'GMT'
)
+
365
).
rfc822
()
setc
=
REQUEST
[
'RESPONSE'
].
setCookie
setc
(
'dtpref_rows'
,
str
(
rows
),
path
=
'/'
,
expires
=
e
)
setc
(
'dtpref_cols'
,
str
(
cols
),
path
=
'/'
,
expires
=
e
)
REQUEST
.
form
.
update
({
'dtpref_cols'
:
cols
,
'dtpref_rows'
:
rows
})
return
apply
(
self
.
manage_main
,
(
self
,
REQUEST
),
REQUEST
.
form
)
dr
=
{
"Taller"
:
5
,
"Shorter"
:
-
5
}.
get
(
height
,
0
)
dc
=
{
"Wider"
:
5
,
"Narrower"
:
-
5
}.
get
(
width
,
0
)
if
isinstance
(
height
,
int
):
dtpref_rows
=
height
if
isinstance
(
width
,
int
)
or
\
isinstance
(
width
,
str
)
and
width
.
endswith
(
'%'
):
dtpref_cols
=
width
rows
=
str
(
max
(
1
,
int
(
dtpref_rows
)
+
dr
))
cols
=
str
(
dtpref_cols
)
if
cols
.
endswith
(
'%'
):
cols
=
str
(
min
(
100
,
max
(
25
,
int
(
cols
[:
-
1
])
+
dc
)))
+
'%'
else
:
cols
=
str
(
max
(
35
,
int
(
cols
)
+
dc
))
e
=
(
DateTime
(
"GMT"
)
+
365
).
rfc822
()
setCookie
=
REQUEST
[
"RESPONSE"
].
setCookie
setCookie
(
"dtpref_rows"
,
rows
,
path
=
'/'
,
expires
=
e
)
setCookie
(
"dtpref_cols"
,
cols
,
path
=
'/'
,
expires
=
e
)
REQUEST
.
other
.
update
({
"dtpref_cols"
:
cols
,
"dtpref_rows"
:
rows
})
return
self
.
manage_main
(
self
,
REQUEST
)
def
ZScriptHTML_tryParams
(
self
):
"""Parameters to test the script with."""
...
...
lib/python/Products/PythonScripts/www/pyScriptEdit.dtml
View file @
38891274
...
...
@@ -82,9 +82,15 @@
<tr>
<td align="left" valign="top" colspan="2">
<div style="width: 100%;">
<textarea name="body:text" wrap="off" style="width: 100%;"
cols=<dtml-var dtpref_cols html_quote missing="50">
rows=<dtml-var dtpref_rows html_quote missing="20">>&dtml-body;</textarea>
<dtml-let cols="REQUEST.get('dtpref_cols', '100%')"
rows="REQUEST.get('dtpref_rows', '20')">
<dtml-if "cols[-1]=='%'">
<textarea name="body:text" wrap="off" style="width: &dtml-cols;;"
<dtml-else>
<textarea name="body:text" wrap="off" cols="&dtml-cols;"
</dtml-if>
rows="&dtml-rows;">&dtml-body;</textarea>
</dtml-let>
</div>
</td>
</tr>
...
...
lib/python/Products/SiteAccess/www/manage_edit.dtml
View file @
38891274
...
...
@@ -28,10 +28,14 @@ probably need to manage Zope using its raw IP address to fix things.
(<strong>host/path</strong>),
or a set of hosts (<strong>*.host/path</strong>).
<div style="width: 100%;">
<textarea name="map_text:text" wrap="off" style="width: 100%;"<dtml-if
dtpref_cols> cols="&dtml-dtpref_cols;"<dtml-else
> cols="50"</dtml-if><dtml-if dtpref_rows> rows="&dtml-dtpref_rows;"<dtml-else> rows="20"</dtml-if>><dtml-in
lines>&dtml-sequence-item;
<dtml-let cols="REQUEST.get('dtpref_cols', '100%')"
rows="REQUEST.get('dtpref_rows', '20')">
<dtml-if "cols[-1]=='%'">
<textarea name="map_text:text" wrap="off" style="width: &dtml-cols;;"
<dtml-else>
<textarea name="map_text:text" wrap="off" cols="&dtml-cols;"
</dtml-if>
rows="&dtml-rows;"><dtml-in lines>&dtml-sequence-item;
</dtml-in></textarea>
</div>
</td>
...
...
lib/python/Products/ZReST/ZReST.py
View file @
38891274
#
# $Id: ZReST.py,v 1.
6 2003/02/22 07:08:12
andreasjung Exp $
# $Id: ZReST.py,v 1.
7 2003/07/06 10:44:11
andreasjung Exp $
#
''' ReStructuredText Product for Zope
...
...
@@ -121,14 +121,18 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent):
}
def
_er
(
self
,
data
,
SUBMIT
,
dtpref_cols
,
dtpref_rows
,
REQUEST
):
dr
,
dc
=
self
.
_size_changes
[
SUBMIT
]
rows
=
max
(
1
,
int
(
dtpref_rows
)
+
dr
)
cols
=
max
(
40
,
int
(
dtpref_cols
)
+
dc
)
e
=
(
DateTime
(
'GMT'
)
+
365
).
rfc822
()
resp
=
REQUEST
[
'RESPONSE'
]
resp
.
setCookie
(
'dtpref_rows'
,
str
(
rows
),
path
=
'/'
,
expires
=
e
)
resp
.
setCookie
(
'dtpref_cols'
,
str
(
cols
),
path
=
'/'
,
expires
=
e
)
return
self
.
manage_main
(
self
,
REQUEST
,
__str__
=
self
.
quotedHTML
(
data
),
dtpref_cols
=
cols
,
dtpref_rows
=
rows
)
rows
=
str
(
max
(
1
,
int
(
dtpref_rows
)
+
dr
))
cols
=
str
(
dtpref_cols
)
if
cols
.
endswith
(
'%'
):
cols
=
str
(
min
(
100
,
max
(
25
,
int
(
cols
[:
-
1
])
+
dc
)))
+
'%'
else
:
cols
=
str
(
max
(
35
,
int
(
cols
)
+
dc
))
e
=
(
DateTime
(
"GMT"
)
+
365
).
rfc822
()
setCookie
=
REQUEST
[
"RESPONSE"
].
setCookie
setCookie
(
"dtpref_rows"
,
rows
,
path
=
'/'
,
expires
=
e
)
setCookie
(
"dtpref_cols"
,
cols
,
path
=
'/'
,
expires
=
e
)
REQUEST
.
other
.
update
({
"dtpref_cols"
:
cols
,
"dtpref_rows"
:
rows
})
return
self
.
manage_main
(
self
,
REQUEST
,
__str__
=
self
.
quotedHTML
(
data
))
security
.
declarePrivate
(
'quotedHTML'
)
def
quotedHTML
(
self
,
text
=
None
,
...
...
lib/python/Products/ZReST/dtml/manage_editForm.dtml
View file @
38891274
...
...
@@ -29,11 +29,15 @@ the <em>browse</em> button to select a local file to upload.
<tr>
<td align="left" valign="top" colspan="2">
<div style="width: 100%;">
<textarea name="data:text" wrap="off" style="width: 100%;"<dtml-if
dtpref_cols> cols="<dtml-var dtpref_cols>"<dtml-else
> cols="50"</dtml-if><dtml-if dtpref_rows> rows="<dtml-var
dtpref_rows>"<dtml-else> rows="20"</dtml-if>><dtml-var
__str__></textarea>
<dtml-let cols="REQUEST.get('dtpref_cols', '100%')"
rows="REQUEST.get('dtpref_rows', '20')">
<dtml-if "cols[-1]=='%'">
<textarea name="data:text" wrap="off" style="width: &dtml-cols;;"
<dtml-else>
<textarea name="data:text" wrap="off" cols="&dtml-cols;"
</dtml-if>
rows="&dtml-rows;"><dtml-var __str__></textarea>
</dtml-let>
</div>
</td>
</tr>
...
...
lib/python/Products/ZSQLMethods/dtml/edit.dtml
View file @
38891274
...
...
@@ -57,11 +57,15 @@
</tr>
<tr>
<td align="left" valign="top" colspan="2">
<div style="width: 100%;">
<textarea name="template:text" wrap="off" style="width: 100%;"
cols=<dtml-var sql_pref__cols html_quote missing="60">
rows=<dtml-var sql_pref__rows html_quote missing="20">>&dtml-src;</textarea>
</div>
<dtml-let cols="REQUEST.get('dtpref_cols', '100%')"
rows="REQUEST.get('dtpref_rows', '20')">
<dtml-if expr="cols[-1]=='%'">
<textarea name="template:text" wrap="off" style="width: &dtml-cols;;"
<dtml-else>
<textarea name="template:text" wrap="off" cols="&dtml-cols;"
</dtml-if>
rows="&dtml-rows;">&dtml-src;</textarea>
</dtml-let>
</td>
</tr>
...
...
lib/python/Shared/DC/ZRDB/DA.py
View file @
38891274
...
...
@@ -13,7 +13,7 @@
__doc__
=
'''Generic Database adapter'''
__version__
=
'$Revision: 1.11
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.11
1
$'
[
11
:
-
2
]
import
OFS.SimpleItem
,
Aqueduct
,
RDB
,
re
import
DocumentTemplate
,
marshal
,
md5
,
base64
,
Acquisition
,
os
...
...
@@ -124,25 +124,25 @@ class DA(
}
def
_er
(
self
,
title
,
connection_id
,
arguments
,
template
,
SUBMIT
,
sql_pref__cols
,
sql_pref_
_rows
,
REQUEST
):
SUBMIT
,
dtpref_cols
,
dtpref
_rows
,
REQUEST
):
dr
,
dc
=
self
.
_size_changes
[
SUBMIT
]
rows
=
max
(
1
,
atoi
(
sql_pref__rows
)
+
dr
)
cols
=
max
(
40
,
atoi
(
sql_pref__cols
)
+
dc
)
e
=
(
DateTime
(
'GMT'
)
+
365
).
rfc822
()
resp
=
REQUEST
[
'RESPONSE'
]
resp
.
setCookie
(
'sql_pref__rows'
,
str
(
rows
),
path
=
'/'
,
expires
=
e
)
resp
.
setCookie
(
'sql_pref__cols'
,
str
(
cols
),
path
=
'/'
,
expires
=
e
)
return
self
.
manage_main
(
self
,
REQUEST
,
title
=
title
,
arguments_src
=
arguments
,
connection_id
=
connection_id
,
src
=
template
,
sql_pref__cols
=
cols
,
sql_pref__rows
=
rows
)
rows
=
str
(
max
(
1
,
int
(
dtpref_rows
)
+
dr
))
cols
=
str
(
dtpref_cols
)
if
cols
.
endswith
(
'%'
):
cols
=
str
(
min
(
100
,
max
(
25
,
int
(
cols
[:
-
1
])
+
dc
)))
+
'%'
else
:
cols
=
str
(
max
(
35
,
int
(
cols
)
+
dc
)
)
e
=
(
DateTime
(
"GMT"
)
+
365
).
rfc822
(
)
setCookie
=
REQUEST
[
"RESPONSE"
].
setCookie
setCookie
(
"dtpref_rows"
,
rows
,
path
=
'/'
,
expires
=
e
)
setCookie
(
"dtpref_cols"
,
cols
,
path
=
'/'
,
expires
=
e
)
REQUEST
.
other
.
update
({
"dtpref_cols"
:
cols
,
"dtpref_rows"
:
rows
})
return
self
.
manage_main
(
self
,
REQUEST
,
title
=
title
,
arguments_src
=
arguments
,
connection_id
=
connection_id
,
src
=
template
)
def
manage_edit
(
self
,
title
,
connection_id
,
arguments
,
template
,
SUBMIT
=
'Change'
,
sql_pref__cols
=
'50'
,
sql_pref_
_rows
=
'20'
,
SUBMIT
=
'Change'
,
dtpref_cols
=
'100%'
,
dtpref
_rows
=
'20'
,
REQUEST
=
None
):
"""Change database method properties
...
...
@@ -159,7 +159,7 @@ class DA(
if
self
.
_size_changes
.
has_key
(
SUBMIT
):
return
self
.
_er
(
title
,
connection_id
,
arguments
,
template
,
SUBMIT
,
sql_pref__cols
,
sql_pref_
_rows
,
REQUEST
)
SUBMIT
,
dtpref_cols
,
dtpref
_rows
,
REQUEST
)
if
self
.
wl_isLocked
():
raise
ResourceLockedError
,
'SQL Method is locked via WebDAV'
...
...
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