Permalink
Browse files

The restore option in course page is only showed if th

"backupdata" dir exists
  • Loading branch information...
1 parent 0c6e10b commit 03162427df0c2dbd683cee956d50770fa7a31069 stronk7 committed Aug 2, 2003
Showing with 6 additions and 3 deletions.
  1. +6 −3 course/lib.php
View
@@ -789,9 +789,12 @@ function print_course_admin_links($course, $width=180) {
$admindata[]="<a href=\"$CFG->wwwroot/backup/backup.php?id=$course->id\">".get_string("backup")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/backup.gif\" height=16 width=16 alt=\"\">";
-
- $admindata[]="<a href=\"$CFG->wwwroot/files/index.php?id=$course->id&wdir=/backupdata\">".get_string("restore")."...</a>";
- $adminicon[]="<img src=\"$pixpath/i/restore.gif\" height=16 width=16 alt=\"\">";
+
+ //Only showed if "backupdata" dir exists
+ if (is_dir($CFG->dataroot."/".$course->id."/".backupdata)) {
+ $admindata[]="<a href=\"$CFG->wwwroot/files/index.php?id=$course->id&wdir=/backupdata\">".get_string("restore")."...</a>";
+ $adminicon[]="<img src=\"$pixpath/i/restore.gif\" height=16 width=16 alt=\"\">";
+ }
$admindata[]="<a href=\"$CFG->wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."...</a>";
$adminicon[]="<img src=\"$modpixpath/resource/icon.gif\" height=16 width=16 alt=\"\">";

0 comments on commit 0316242

Please sign in to comment.