[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/ Merge
theuni's r25886 from trunk:
Philipp von Weitershausen
philikon at philikon.de
Thu Jul 29 10:18:17 EDT 2004
Log message for revision 26829:
Merge theuni's r25886 from trunk:
New path adapter: 'url' for providing inline url quoting capabilities
from page templates.
Changed:
U Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/configure.zcml
U Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/interfaces.py
A Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/tests/test_urlquote.py
A Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/urlquote.py
U Zope3/branches/ZopeX3-3.0/src/zope/app/rotterdam/template.pt
-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/configure.zcml
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/configure.zcml 2004-07-29 05:07:57 UTC (rev 26828)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/configure.zcml 2004-07-29 14:18:16 UTC (rev 26829)
@@ -18,6 +18,12 @@
name="zope"
/>
+ <adapter
+ for="*"
+ provides="zope.app.traversing.interfaces.IPathAdapter"
+ factory=".urlquote.URLQuote"
+ name="url"/>
+
<content class="zope.tales.tales.Iterator">
<allow interface="zope.tales.interfaces.ITALESIterator" />
</content>
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/interfaces.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/interfaces.py 2004-07-29 05:07:57 UTC (rev 26828)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/interfaces.py 2004-07-29 14:18:16 UTC (rev 26829)
@@ -17,6 +17,7 @@
"""
from zope.app.dublincore.interfaces import IDCDescriptiveProperties
from zope.app.dublincore.interfaces import IDCTimes
+from zope.interface import Interface
class IZopeTalesAPI(IDCDescriptiveProperties, IDCTimes):
@@ -39,3 +40,17 @@
(e.g. the object has no size), an empty string is returned.
"""
+class IURLQuote(Interface):
+
+ def quote():
+ """Return the objects URL quote representation."""
+
+ def quote_plus():
+ """Return the objects URL quote_plus representation."""
+
+ def unquote():
+ """Return the objects URL unquote representation."""
+
+ def unquote_plus():
+ """Return the objects URL unquote_plus representation."""
+
Copied: Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/tests/test_urlquote.py (from rev 25886, Zope3/trunk/src/zope/app/pagetemplate/tests/test_urlquote.py)
Copied: Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/urlquote.py (from rev 25886, Zope3/trunk/src/zope/app/pagetemplate/urlquote.py)
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/rotterdam/template.pt
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/rotterdam/template.pt 2004-07-29 05:07:57 UTC (rev 26828)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/rotterdam/template.pt 2004-07-29 14:18:16 UTC (rev 26829)
@@ -49,12 +49,12 @@
</tal:block>
</metal:block>
<a href=""
- tal:attributes="href string:@@logout.html?nextURL=${request/URL}"
+ tal:attributes="href string:@@logout.html?nextURL=${request/URL/url:quote}"
tal:condition="python: hasattr(request.principal, 'getLogin')"
i18n:translate="">
[Logout]</a>
<a href=""
- tal:attributes="href string:@@login.html?nextURL=${request/URL}"
+ tal:attributes="href string:@@login.html?nextURL=${request/URL/url:quote}"
tal:condition="python: not hasattr(request.principal, 'getLogin')"
i18n:translate="">
[Login]</a>
More information about the Zope3-Checkins
mailing list