From: stronk7 Date: Sat, 2 Aug 2003 18:23:58 +0000 (+0000) Subject: The restore option in course page is only showed if th X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=03162427df0c2dbd683cee956d50770fa7a31069;p=moodle.git The restore option in course page is only showed if th "backupdata" dir exists --- diff --git a/course/lib.php b/course/lib.php index 645db19ce6..ab1c8e7b2a 100644 --- a/course/lib.php +++ b/course/lib.php @@ -789,9 +789,12 @@ function print_course_admin_links($course, $width=180) { $admindata[]="wwwroot/backup/backup.php?id=$course->id\">".get_string("backup")."..."; $adminicon[]="\"\""; - - $admindata[]="wwwroot/files/index.php?id=$course->id&wdir=/backupdata\">".get_string("restore")."..."; - $adminicon[]="\"\""; + + //Only showed if "backupdata" dir exists + if (is_dir($CFG->dataroot."/".$course->id."/".backupdata)) { + $admindata[]="wwwroot/files/index.php?id=$course->id&wdir=/backupdata\">".get_string("restore")."..."; + $adminicon[]="\"\""; + } $admindata[]="wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."..."; $adminicon[]="\"\"";