<form id="form1" method="post" action="backup.php">
<table cellpadding="5" style="margin-left:auto;margin-right:auto;">
<?php
+/// Acummulator for hidden options and proper XHTML output
+ $hidden_options = '';
//Now, check modules and info and show posibilities
if ($allmods = get_records("modules") ) {
//Print option to select/deselect everything with 1 click.
//Line
echo "<tr><td colspan=\"4\"><hr /></td></tr>\n";
- if (empty($to)) {
+ if (empty($to) && !empty($course->metacourse)) {
//Now print the Metacourse tr
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo "</td></tr>";
}
else {
- echo '<input type="hidden" name="backup_metacourse" value="0" />';
+ $hidden_options .= '<input type="hidden" name="backup_metacourse" value="0" />';
}
if (empty($to)) {
echo "</td></tr>";
}
else {
- echo '<input type="hidden" name="backup_users" value="0" />';
+ $hidden_options .= '<input type="hidden" name="backup_users" value="0" />';
}
if (empty($to)) {
echo "</td></tr>";
}
else {
- echo '<input type="hidden" name="backup_logs" value="0" />';
+ $hidden_options .= '<input type="hidden" name="backup_logs" value="0" />';
}
if (empty($to)) {
echo "</td></tr>";
}
else {
- echo '<input type="hidden" name="backup_user_files" value="0" />';
+ $hidden_options .= '<input type="hidden" name="backup_user_files" value="0" />';
}
//Now print the Course Files tr
echo "<tr>";
echo "</td></tr>";
}
else {
- echo '<input type="hidden" name="backup_messages" value="0" />';
+ $hidden_options .= '<input type="hidden" name="backup_messages" value="0" />';
}
}
?>
</table>
+<?php
+/// Print captured hidden options, now that we have closed the table
+ echo $hidden_options;
+?>
<div style="text-align:center;margin-left:auto;margin-right:auto">
<input type="hidden" name="id" value="<?php p($id) ?>" />