]> git.mjollnir.org Git - moodle.git/commitdiff
added editing icon in course summary block
authorgustav_delius <gustav_delius>
Wed, 30 Jun 2004 12:41:05 +0000 (12:41 +0000)
committergustav_delius <gustav_delius>
Wed, 30 Jun 2004 12:41:05 +0000 (12:41 +0000)
blocks/course_summary/block_course_summary.php

index f35427fbb54ae2e6d7769bb71cfabf64b01d0a97..c2c8642b5416fa8e3229a4f49d49a3fd2677ef43 100644 (file)
@@ -13,6 +13,7 @@ class CourseBlock_course_summary extends MoodleBlock {
     }
 
     function get_content() {
+        global $CFG, $THEME;
 
         if($this->content !== NULL) {
             return $this->content;
@@ -20,6 +21,15 @@ 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($THEME->custompix)) {
+                 $pixpath = $path.'/../pix';
+            } else {
+                 $pixpath = $path.'/../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->footer = '';
 
         return $this->content;