]> git.mjollnir.org Git - moodle.git/commitdiff
New restore link for admins so they can restore courses ...
authormoodler <moodler>
Fri, 1 Aug 2003 15:09:35 +0000 (15:09 +0000)
committermoodler <moodler>
Fri, 1 Aug 2003 15:09:35 +0000 (15:09 +0000)
admin/index.php
files/index.php

index 71ef12c3162ca913484139d0c5e868287a55ef2b..7fd01bdc45f2561d01732cec9e6404f776cf45b7 100644 (file)
                          "<p><a href=\"teacher.php\">".get_string("assignteachers")."</a></p>".
                          "<p><a href=\"../course/delete.php\">".get_string("deletecourse")."</a></p>".
                          "<p><a href=\"../course/categories.php\">".get_string("categories")."</a></p>";
-                if (!empty($CFG->backup_version)) {
-                    //MODIFY RELATIVE PATH TO backup.php
-                    $backup_path = "../backup/backup.php";
-                    //END MODIFY
-                    $table->data[0][1] .= "<p><a href=\"".$backup_path."\">".get_string("coursebackup")."</a></p>";
-                }
+        $table->data[0][1] .= "<p><a href=\"../backup/backup.php\">".get_string("coursebackup")."</a></p>";
+        $table->data[0][1] .= "<p><a href=\"../files/index.php?id=$site->id\">".get_string("courserestore")."</a></p>";
         if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual") {
                    $table->data[0][2] = "<p><a href=\"user.php?newuser=true\">".get_string("addnewuser")."</a></p>";
         }    
index 504a193c4a91d0055bdbe62436aad096bc653f0f..bc43c73df8d7e99d1db86339b32f1066a0bb23dd 100644 (file)
     
     function html_header($course, $wdir, $formfield=""){
 
+        global $CFG;
+
         $strfiles = get_string("files");
     
         if ($wdir == "/") {
-            print_header("$course->shortname: $strfiles", "$course->fullname", 
-                         "<A HREF=\"../course/view.php?id=$course->id\">$course->shortname</A> 
-                          -> $strfiles", $formfield);
+            $fullnav = "$strfiles";
         } else {
             $dirs = explode("/", $wdir);
             $numdirs = count($dirs);
                $link .= "/".urlencode($dirs[$i]);
                $navigation .= "<A HREF=\"index.php?id=$course->id&wdir=$link\">".$dirs[$i]."</A>";
             }
+            $fullnav = "<a href=\"index.php?id=$course->id&wdir=/\">$strfiles</a> $navigation";
+        }
 
+        if (! $site = get_site()) {
+            error("Invalid site!");
+        }
+
+        if ($course->id == $site->id) {
+            print_header("$course->shortname: $strfiles", "$course->fullname", 
+                         "<a href=\"../$CFG->admin/index.php\">".get_string("administration").
+                         "</a> -> $fullnav", $formfield);
+        } else {
             print_header("$course->shortname: $strfiles", "$course->fullname", 
-                         "<A HREF=\"../course/view.php?id=$course->id\">$course->shortname</A> -> 
-                          <A HREF=\"index.php?id=$course->id&wdir=/\">$strfiles</A> $navigation", $formfield);
+                         "<a href=\"../course/view.php?id=$course->id\">$course->shortname".
+                         "</a> -> $fullnav", $formfield);
         }
         echo "<table border=0 align=center cellspacing=3 cellpadding=3 width=640>";
         echo "<tr>";