[CMF-checkins] CVS: CMF - filterCookie.py:1.1 folder_contents.dtml:1.10 iconHTML.py:1.2

andrew@digicool.com andrew@digicool.com
Thu, 5 Jul 2001 14:32:28 -0400 (EDT)


Update of /cvs-repository/CMF/CMFDefault/skins/generic
In directory korak.digicool.com:/tmp/cvs-serv2399

Modified Files:
	folder_contents.dtml iconHTML.py 
Added Files:
	filterCookie.py 
Log Message:

*factored out the folder filtering (folder_contents.dtml) into a
python script filterCookie.py
*fixed iconHTML.py to ensure the context for getIcon and Type was
explicitly set, otherwise the methods were being called on the
container, not the objects being renamed
(folder_rename_form.dtml)



--- Added File filterCookie.py in package CMF ---
## Script (Python) "filterCookie.py $Revision: 1.1 $"
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Manage filter cookie
##
REQUEST=context.REQUEST
if REQUEST.get('clear_view_filter', 0):
  context.clearCookie()
  REQUEST.set('folderfilter', '')
  REQUEST.set('close_filter_form', '1')
elif REQUEST.get('set_view_filter', 0):
  filter=context.encodeFolderFilter(REQUEST)
  REQUEST.RESPONSE.setCookie('folderfilter', filter, path='/',
                              expires='Wed, 19 Feb 2020 14:28:00 GMT')
  REQUEST.set('folderfilter', '%s' % filter)

--- Updated File folder_contents.dtml in package CMF --
--- folder_contents.dtml	2001/06/29 19:23:43	1.9
+++ folder_contents.dtml	2001/07/05 18:32:27	1.10
@@ -1,19 +1,8 @@
 <dtml-comment>
 folderfilter cookie maintenance.
 </dtml-comment>
-
-<dtml-if expr="REQUEST.get('clear_view_filter', 0)">
- <dtml-call clearCookie>
- <dtml-call expr="REQUEST.set('folderfilter', '')">
- <dtml-call expr="REQUEST.set('close_filter_form', '1')">
-<dtml-elif expr="REQUEST.get('set_view_filter', 0)">
- <dtml-let filter="encodeFolderFilter(REQUEST)">
-  <dtml-call expr="RESPONSE.setCookie('folderfilter', filter,
-                   path='/', expires='Wed, 19 Feb 2020 14:28:00 GMT')">
-  <dtml-call expr="REQUEST.set('folderfilter', filter)">
- </dtml-let>
-</dtml-if>
-
+<dtml-in filterCookie>
+</dtml-in>
 <dtml-comment>
 Folder contents display.
 </dtml-comment>

--- Updated File iconHTML.py in package CMF --
--- iconHTML.py	2001/06/28 19:58:11	1.1
+++ iconHTML.py	2001/07/05 18:32:27	1.2
@@ -5,7 +5,7 @@
 
 # dont you just wish namespaces had a get(name,default) method?! ;-)
 try:
-    iconURL=_['getIcon']
+    iconURL=context.getIcon()
 except KeyError:
     try:
         iconURL=_['icon']
@@ -14,7 +14,7 @@
 
 if iconURL:
     try:
-        Type = _['Type']
+        Type = context.Type()
     except:
         Type=''
     return '<img src="%s" align="left" alt="%s" border="0"/>' % (iconURL,