[Zope-Checkins] CVS: Zope/lib/python/OFS/dtml - cmassoc.dtml:1.4

Jens Vagelpohl jens@zope.com
Wed, 3 Apr 2002 12:41:05 -0500


Update of /cvs-repository/Zope/lib/python/OFS/dtml
In directory cvs.zope.org:/tmp/cvs-serv5049

Modified Files:
	cmassoc.dtml 
Log Message:
added "select all" and "deselect all" capability to cache manager 
"Associate" tab like in the standard ZMI folder contents view



=== Zope/lib/python/OFS/dtml/cmassoc.dtml 1.3 => 1.4 ===
 <dtml-var manage_tabs>
 
-<form action="&dtml-URL1;" method="POST">
+<script type="text/javascript">
+<!--
+
+isSelected = false;
+
+function toggleSelect() {
+  if (isSelected == false) {
+    for (i = 0; i < document.objectItems.length; i++)
+      document.objectItems.elements[i].checked = true ;
+      isSelected = true;
+      document.objectItems.selectButton.value = "Deselect All";
+      return isSelected;
+  }
+  else {
+    for (i = 0; i < document.objectItems.length; i++)
+      document.objectItems.elements[i].checked = false ;
+      isSelected = false;
+      document.objectItems.selectButton.value = "Select All";
+      return isSelected;
+  }
+}
+
+//-->
+</script>
+
+<form action="&dtml-URL1;" name="objectItems" method="POST">
 
 <dtml-if show_results>
 <dtml-if results>
@@ -39,10 +64,18 @@
   <div class="form-element">
   <input type="submit" name="ZCacheManager_setAssociations:method" 
    value="Save Changes">
+<script type="text/javascript">
+<!--
+if (document.forms[0]) {
+  document.write('<input class="form-element" type="submit" name="selectButton" value="Select All" onClick="toggleSelect(); return false">')
+  }
+//-->
+</script>
   </div>
   </td>
 </tr>
 </table>
+</form>
 
 <dtml-else>
 <p class="form-text">
@@ -52,6 +85,7 @@
 <hr>
 </dtml-if>
 
+<form target="&dtml-URL1;" method="post">
 <table cellspacing="0" cellpadding="2" border="0">
   <tr>
     <td align="left" valign="top">