[CMF-checkins] CVS: CMF/CMFDefault/skins/generic - doFormSearch.py:1.1.4.1 search.dtml:1.6.4.1 search_form.dtml:1.7.8.1
Tres Seaver
tseaver@zope.com
Fri, 4 Jan 2002 20:29:40 -0500
Update of /cvs-repository/CMF/CMFDefault/skins/generic
In directory cvs.zope.org:/tmp/cvs-serv25574/CMFDefault/skins/generic
Modified Files:
Tag: CMF-1_2-branch
search.dtml search_form.dtml
Added Files:
Tag: CMF-1_2-branch
doFormSearch.py
Log Message:
- Worked around Opera's strange insistence on selecting an option,
even for multi-select lists (Tracker #332).
=== Added File CMF/CMFDefault/skins/generic/doFormSearch.py ===
## Script (Python) "doFormSearch"
##parameters=REQUEST
##title=Pre-process form variables, then return catalog query results.
##
form_vars = {}
select_vars = ( 'review_state'
, 'Subject'
, 'created'
, 'Type'
)
for k, v in REQUEST.form.items():
if k in select_vars:
if same_type( v, [] ):
v = filter( None, v )
if not v:
continue
form_vars[ k ] = v
return context.portal_catalog( form_vars )
=== CMF/CMFDefault/skins/generic/search.dtml 1.6 => 1.6.4.1 ===
<h1> Search Results </h1>
-<dtml-let results="portal_catalog( REQUEST=REQUEST )">
+<dtml-let results="doFormSearch( REQUEST=REQUEST )">
<p>Found <dtml-var expr="_.len(results)" thousands_commas>
items<dtml-if name="SearchableText"> matching "&dtml-SearchableText;"</dtml-if>.</p>
=== CMF/CMFDefault/skins/generic/search_form.dtml 1.7 => 1.7.8.1 ===
</th>
<td>
- <select name="review_state" size="3" multiple>
- <option>private</option>
- <option>pending</option>
- <option>published</option>
+ <select name="review_state:list" size="3" multiple>
+ <option value="" selected>-- any --</option>
+ <option value="private">private</option>
+ <option value="pending">pending</option>
+ <option value="published">published</option>
</select>
<dl class="FieldHelp">
<dd> As a reviewer, you may search for items based on their
@@ -56,6 +57,7 @@
<th>Subject</th>
<td>
<select name="Subject:list" multiple size="4">
+ <option value="" selected>-- any --</option>
<dtml-in expr="portal_catalog.uniqueValuesFor( 'Subject' )">
<option value="&dtml-sequence-item;"> &dtml-sequence-item; </option>
</dtml-in>
@@ -114,6 +116,7 @@
</th>
<td>
<select name="Type:list" multiple size="5">
+ <option value="" selected>-- any --</option>
<dtml-in expr="portal_types.listContentTypes()">
<option><dtml-var sequence-item></option>
</dtml-in>