]> git.mjollnir.org Git - moodle.git/commitdiff
merged fixing xhtml and display issues in restore
authortoyomoyo <toyomoyo>
Thu, 1 Mar 2007 02:46:04 +0000 (02:46 +0000)
committertoyomoyo <toyomoyo>
Thu, 1 Mar 2007 02:46:04 +0000 (02:46 +0000)
backup/restore_check.html
backup/restore_form.html
backup/restorelib.php

index 065df0a94b7467e25d528f1b1fe3853f9fefaf18..359adb56c9f16a0d6be8ce9b9c5fa92e16f3888e 100644 (file)
         if ($show_continue_button) {
             //Print the continue button to execute the restore NOW !!!!
             //All is prepared !!!
-            echo "<center>";
+            echo "<div style='text-align:center'>";
             $hidden["launch"]             = "execute";
             $hidden["file"]               =  $file;
             $hidden["id"]                 =  $id;
                 }
             }
             print_single_button("restore.php", $hidden, get_string("restorecoursenow"),"post");
-            echo "</center>";
+            echo "</div>";
         } else {
             //Show error
             error ("Something was wrong checking restore preferences");
index a6a334fa050d0b5744f4629a431baee9f4b31c54..d97a40ac70b9130b8b513768166feb899e27c150 100644 (file)
@@ -160,7 +160,8 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
 </script>
 
 <form id="form1" method="post" action="restore.php">
-<table cellpadding="5">
+<div>
+<table cellpadding="5" class="boxaligncenter">
 <?php
 
     //First, course destination
@@ -291,23 +292,23 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
                         }
                     } else {
                         //Module isn't restorable
-                        echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\" />";
-                        echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\" />";
+                        $nonrestmod .= "<input type=\"hidden\" name=\"$restore_var\" value=\"0\" />";
+                        $nonrestmod .= "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\" />";
                     }
                 } else {
                     //Module isn't restorable
-                    echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\" />";
-                    echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\" />";
+                    $nonrestmod .= "<input type=\"hidden\" name=\"$restore_var\" value=\"0\" />";
+                    $nonrestmod .= "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\" />";
                 }
             } else {
                 //Module isn't restorable
-                echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\" />";
-                echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\" />";
+                $nonrestmod .= "<input type=\"hidden\" name=\"$restore_var\" value=\"0\" />";
+                $nonrestmod .= "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\" />";
             }
             $currentrow = ($currentrow + 1) % 2;
         }
         //Line
-        echo "<tr><td colspan=\"4\"><hr /></td></tr>";
+        echo "<tr><td colspan=\"4\">$nonrestmod<hr /></td></tr>";
 
         //Now print the Metacourse tr
         echo "<tr>";
@@ -415,7 +416,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
         echo "</td></tr>";
     }
 ?>
-</td></tr></table>
+</table>
 
 <hr/>
 <?php
@@ -434,7 +435,7 @@ if ($course->id == SITEID) {
 }
 
 echo ('<table width="100%" class="restore-form-instances">');
-echo ('<tr><td align="right"><b>'.get_string('sourcerole').'</b></td><td align="left"><b>'.get_string('targetrole').'</b></td></tr>');
+echo ('<tr><td align="right" style="width:50%"><b>'.get_string('sourcerole').'</b></td><td align="left" style="width:50%"><b>'.get_string('targetrole').'</b></td></tr>');
 
 if ($info->backup_moodle_version < 2006092801) {
     // 1.6 and below backup
@@ -510,11 +511,12 @@ echo ('</table>'); // end of role mappings table
 
 ?>
 <br />
-<center>
+<div style="text-align:center">
 <input type="hidden" name="id"     value="<?php  p($id) ?>" />
 <input type="hidden" name="launch" value="check" />
 <input type="hidden" name="fromform" value="1" />
 <input type="submit" value="<?php  print_string("continue") ?>" />
 <input type="submit" name="cancel" value="<?php  print_string("cancel") ?>" />
-</center>
+</div>
+</div>
 </form>
index e4fbc728a1be538aee3245b1a0cfd451d48b0cd9..d817303212d76d80e06ed10e56ee3e2c04c93b35 100644 (file)
                 if (function_exists($function_name)) {
                     if (!defined('RESTORE_SILENTLY')) {
                         echo "<li>".get_string ("from")." ".get_string("modulenameplural",$name);
-                        echo '</li>';
                     }
                     $status = $function_name($restore);
+                    if (!defined('RESTORE_SILENTLY')) {
+                        echo '</li>';
+                    }
                 }
             }
         }
         //with some hidden fields
         if ($status) {
             if (!defined('RESTORE_SILENTLY')) {
-                echo "<br /><center>";
+                echo "<br /><div style='text-align:center'>";
                 $hidden["backup_unique_code"] = $backup_unique_code;
                 $hidden["launch"]             = "form";
                 $hidden["file"]               =  $file;
                 $hidden["id"]                 =  $id;
                 print_single_button("restore.php", $hidden, get_string("continue"),"post");
-                echo "</center>";
+                echo "</div>";
             }
             else {
                 if (empty($noredirect)) {
                     } // no need to return false here, it's recoverable.
                 }
             }
+            
+            if (!defined('RESTORE_SILENTLY')) {
+                echo "</li>";
+            }
         }
         
         //Now create metacourse info
             //Only to new courses!
             if ($restore->restoreto == 2) {
                 if (!defined('RESTORE_SILENTLY')) {
-                    echo "</li><li>".get_string("creatingmetacoursedata");
+                    echo "<li>".get_string("creatingmetacoursedata");
                 }
                 if (!$status = restore_create_metacourse($restore,$xml_file)) {
                     if (!defined('RESTORE_SILENTLY')) {
         //Now create course files as needed
         if ($status and ($restore->course_files)) {
             if (!defined('RESTORE_SILENTLY')) {
-                echo "<li>".get_string("copyingcoursefiles")."</li>";
+                echo "<li>".get_string("copyingcoursefiles");
             }
             if (!$status = restore_course_files($restore)) {
                 if (empty($status)) {
                     echo "</ul>";
                 }       
             }
+            if (!defined('RESTORE_SILENTLY')) {
+                echo "</li>";
+            }
         }
 
         //Now create messages as needed