]> git.mjollnir.org Git - moodle.git/commitdiff
edit link corrected
authorgustav_delius <gustav_delius>
Thu, 29 Jul 2004 22:16:53 +0000 (22:16 +0000)
committergustav_delius <gustav_delius>
Thu, 29 Jul 2004 22:16:53 +0000 (22:16 +0000)
blocks/course_summary/block_course_summary.php

index bca89f1851788897bc785271b71dcf86035e4c34..6f2a8c33daa5c19c9718b310f6233eb2376b67dc 100644 (file)
@@ -26,13 +26,17 @@ class CourseBlock_course_summary extends MoodleBlock {
         $this->content = New stdClass;
         $this->content->text = format_text($this->course->summary, FORMAT_HTML);
         if (isediting($this->course->id)) {
-            $path = $CFG->wwwroot.'/course';
+            if (empty($this->course->category)) {
+                $editpage = "$CFG->wwwroot/admin/site.php";
+            } else {
+                $editpage = $CFG->wwwroot.'/course/edit.php?id='.$this->course->id;
+            }
             if (empty($THEME->custompix)) {
-                 $pixpath = $path.'/../pix';
+                 $pixpath = $CFG->wwwroot.'/pix';
             } else {
-                 $pixpath = $path.'/../theme/'.$CFG->theme.'/pix';
+                 $pixpath = $CFG->wwwroot.'/theme/'.$CFG->theme.'/pix';
             }
-            $this->content->text .= "<div align=\"right\"><a href=\"$CFG->wwwroot/admin/site.php\"><img src=\"$pixpath/t/edit.gif\" /></a></div>";
+            $this->content->text .= "<div align=\"right\"><a href=\"$editpage\"><img src=\"$pixpath/t/edit.gif\" /></a></div>";
         }
         $this->content->footer = '';