]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed activity blocks for social format and site format so that they
authormoodler <moodler>
Sat, 29 May 2004 06:22:30 +0000 (06:22 +0000)
committermoodler <moodler>
Sat, 29 May 2004 06:22:30 +0000 (06:22 +0000)
  - display icon properly when moving items

  - display custom icons  (eg on resources)

blocks/site_main_menu/block_site_main_menu.php
blocks/social_activities/block_social_activities.php

index 9d99bb1e5d8eb963e1ecedb14598e5d728bfa596..7c36cf6c513936cda54521081b702dc078eb3f09 100644 (file)
@@ -49,8 +49,8 @@ class CourseBlock_site_main_menu extends MoodleBlock {
         $editbuttons = '';
 
         if ($ismoving) {
-            $this->content->items[] = '&nbsp;<img align="bottom" src="'.$CFG->pixpath.'/t/move.gif" height="11" width="11">';
-            $this->content->icons[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true">'.$strcancel.'</a>)';
+            $this->content->icons[] = '&nbsp;<img align="bottom" src="'.$CFG->pixpath.'/t/move.gif" height="11" width="11">';
+            $this->content->items[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true">'.$strcancel.'</a>)';
         }
 
         if (!empty($section->sequence)) {
@@ -92,6 +92,11 @@ class CourseBlock_site_main_menu extends MoodleBlock {
                     } else {
                         $extra = '';
                     }
+                    if (!empty($modinfo[$modnumber]->icon)) {
+                        $icon = $CFG->pixpath.'/'.urldecode($modinfo[$modnumber]->icon);
+                    } else {
+                        $icon = $CFG->modpixpath.'/'.$mod->modname.'/icon.gif';
+                    }
 
                     if ($mod->modname == 'label') {
                         $this->content->items[] = format_text($extra, FORMAT_HTML).$editbuttons;
@@ -99,7 +104,7 @@ class CourseBlock_site_main_menu extends MoodleBlock {
                     } else {
                         $this->content->items[] = '<a title="'.$mod->modfullname.'" '.$linkcss.' '.$extra.
                             ' href="'.$CFG->wwwroot.'/mod/'.$mod->modname.'/view.php?id='.$mod->id.'">'.$instancename.'</a>'.$editbuttons;
-                        $this->content->icons[] = '<img src="'.$CFG->modpixpath.'/'.$mod->modname.'/icon.gif" height="16" width="16" alt="'.$mod->modfullname.'">';
+                        $this->content->icons[] = '<img src="'.$icon.'" height="16" width="16" alt="'.$mod->modfullname.'">';
                     }
                 }
             }
index 1506a5e73c20904a460dbcc1da17bb5f40090b9b..222974abdc664c7c2a5f4581d7b483c5bac6cef8 100644 (file)
@@ -46,8 +46,8 @@ class CourseBlock_social_activities extends MoodleBlock {
         $editbuttons = '';
 
         if ($ismoving) {
-            $this->content->items[] = '&nbsp;<img align="bottom" src="'.$CFG->pixpath.'/t/move.gif" height="11" width="11">';
-            $this->content->icons[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true">'.$strcancel.'</a>)';
+            $this->content->icons[] = '&nbsp;<img align="bottom" src="'.$CFG->pixpath.'/t/move.gif" height="11" width="11">';
+            $this->content->items[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true">'.$strcancel.'</a>)';
         }
 
         if (!empty($section->sequence)) {
@@ -89,6 +89,11 @@ class CourseBlock_social_activities extends MoodleBlock {
                     } else {
                         $extra = '';
                     }
+                    if (!empty($modinfo[$modnumber]->icon)) {
+                        $icon = $CFG->pixpath.'/'.urldecode($modinfo[$modnumber]->icon);
+                    } else {
+                        $icon = $CFG->modpixpath.'/'.$mod->modname.'/icon.gif';
+                    }
 
                     if ($mod->modname == 'label') {
                         $this->content->items[] = format_text($extra, FORMAT_HTML).$editbuttons;
@@ -96,7 +101,7 @@ class CourseBlock_social_activities extends MoodleBlock {
                     } else {
                         $this->content->items[] = '<a title="'.$mod->modfullname.'" '.$linkcss.' '.$extra.
                             ' href="'.$CFG->wwwroot.'/mod/'.$mod->modname.'/view.php?id='.$mod->id.'">'.$instancename.'</a>'.$editbuttons;
-                        $this->content->icons[] = '<img src="'.$CFG->modpixpath.'/'.$mod->modname.'/icon.gif" height="16" width="16" alt="'.$mod->modfullname.'">';
+                        $this->content->icons[] = '<img src="'.$icon.'" height="16" width="16" alt="'.$mod->modfullname.'">';
                     }
                 }
             }