Source for file jsfunctions.php

Documentation is available at jsfunctions.php

  1. <?php
  2. /**
  3. * Miscellaneous javascript functions to be included in each page
  4. *
  5. @author    Stuart Prescott
  6. @copyright  Copyright Stuart Prescott
  7. @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  8. @version    $Id$
  9. @package    Bumblebee
  10. @subpackage Misc
  11. *
  12. @todo //TODO: selectall code needs updating to include InstrumentGroups etc
  13. */
  14.  
  15. /** Load ancillary functions */
  16. require_once 'inc/typeinfo.php';
  17. ?>
  18. <script type='text/javascript'>
  19. <!--
  20. function selectall () {
  21.   return setcheckboxes(true, '', 0, 1);
  22. }
  23.  
  24. function deselectall () {
  25.   return setcheckboxes(false, '', 0, 1);
  26. }
  27.  
  28. function selectsome (targetname, offset, mod) {
  29.   return setcheckboxes(true, targetname, offset, mod);
  30. }
  31.  
  32. function deselectsome (targetname, offset, mod) {
  33.   return setcheckboxes(false, targetname, offset, mod);
  34. }
  35.  
  36. function setcheckboxes (setval, targetname, offset, mod) {
  37.   //alert("start");
  38.   count = 0;
  39.   rightForm = "bumblebeeform";
  40.   for (var i=0; i<document.forms[rightForm].length; i++) {
  41.     if (document.forms[rightForm].elements[i].type == "checkbox") {
  42.       //alert('c='+count+'\no='+offset+'\nm='+mod+'\ny='+((count-offset)%mod));
  43.       namestart = document.forms[rightForm].elements[i].name.substr(0, targetname.length);
  44.       if (targetname == namestart) {
  45.         if ((count-offset) % mod == 0) {
  46.           document.forms[rightForm].elements[i].checked=setval;
  47.         }
  48.         count++;
  49.       }
  50.     }
  51.     //alert(document.forms[0].elements[i].value);
  52.   }
  53.   return false;
  54. }
  55. -->
  56. </script>

Documentation generated on Tue, 06 Mar 2007 10:01:43 +0000 by phpDocumentor 1.3.0