]> git.mjollnir.org Git - moodle.git/commitdiff
Hide the metacourse dropdown menu if the course
authorstronk7 <stronk7>
Sun, 16 Sep 2007 19:26:13 +0000 (19:26 +0000)
committerstronk7 <stronk7>
Sun, 16 Sep 2007 19:26:13 +0000 (19:26 +0000)
isn't a metacourse and general XHTML compliance. MDL-9922

Merged from MOODLE_18_STABLE

backup/backup_form.html

index ca36bd97831725d9ee1033a2767fe99e8f73f3d8..d7b63bf3260b819948e1fb1600d9142849013bad 100644 (file)
@@ -117,6 +117,8 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
 <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.
@@ -192,7 +194,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
         //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>";
@@ -204,7 +206,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
             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)) {
@@ -220,7 +222,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
             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)) {
@@ -235,7 +237,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
             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)) {
@@ -250,7 +252,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
             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>";
@@ -298,7 +300,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
             echo "</td></tr>";
         }
         else {
-            echo '<input type="hidden" name="backup_messages" value="0" />';
+            $hidden_options .= '<input type="hidden" name="backup_messages" value="0" />';
         }
     }
 
@@ -312,6 +314,10 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
 
 ?>
 </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) ?>" />