]> git.mjollnir.org Git - moodle.git/commitdiff
Now, all "with/without user data" can be selected from one option. This
authorstronk7 <stronk7>
Sat, 3 Apr 2004 23:52:23 +0000 (23:52 +0000)
committerstronk7 <stronk7>
Sat, 3 Apr 2004 23:52:23 +0000 (23:52 +0000)
should avoid a lot of clicks to Gustav. :-D
Current implementation can  be modified to buttons...if desirable.

backup/restore_form.html

index e89acc6f6ae0d81a75d2cbdf92c5dc6e4957d5b4..0e1b4d9d9ed896c8402cccfc48716887e96e9ece 100644 (file)
 
 ?>
 
-<form name="form" method="post" action="<?php echo $ME ?>">
+<SCRIPT LANGUAGE="JavaScript">
+<!--
+function selectItemInMenuByName(formId, menuName, selectIndex ) {
+       myForm = document.getElementById(formId)
+        for (i=0,n=myForm.elements.length;i<n;i++) {
+            myLen = menuName.length;
+                       myName = myForm.elements[i].name;
+                       if (myName.substring(0,myLen) == menuName)
+                myForm.elements[i].options[selectIndex].selected = true;
+               }
+}
+-->
+</script>
+
+<form name="form1" id="form1" method="post" action="<?php echo $ME ?>">
 <table cellpadding=5>
 <?php
 
     echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
     //Now, check modules and info and show posibilities
     if ($allmods = get_records("modules") ) {
+        //Print option to select/deselect every "with user info" popup. For Gustav, lol, Eloy :-)
+        echo "<tr>";
+        echo "<td colspan=\"2\" align=\"right\"><font size=\"-1\">";
+        echo get_string("userdata").":";
+        echo "<a href=\"javascript:void(0);\" onclick=\"selectItemInMenuByName('form1', 'restore_user_info_', '1');\">".
+             get_string("all")."</a>/";
+        echo "<a href=\"javascript:void(0);\" onclick=\"selectItemInMenuByName('form1', 'restore_user_info_', '0');\">".
+             get_string("none")."</a>";
+        echo "</font></td>";
+        echo "</tr>";
+        echo "<tr><td colspan=\"2\"><hr noshade size=\"1\"></td></tr>";
         foreach ($allmods as $mod) {
             $modname = $mod->name;
             $modrestore = $modname."_restore_mods";