Now, all "with/without user data" can be selected from one option. This

should avoid a lot of clicks to Gustav. :-D
Current implementation can  be modified to buttons...if desirable.
This commit is contained in:
stronk7 2004-04-03 23:52:23 +00:00
parent bdb2f23f70
commit 70441d0f8c

View file

@ -98,7 +98,21 @@
?>
<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
@ -123,6 +137,17 @@
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";