Permalink
Browse files

Fixed activity blocks for social format and site format so that they

  - display icon properly when moving items

  - display custom icons  (eg on resources)
  • Loading branch information...
1 parent a844bc0 commit facf75c18c14abd58178008d047f2b62e761577f moodler committed May 29, 2004
@@ -49,8 +49,8 @@ function get_content() {
$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,14 +92,19 @@ function get_content() {
} 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;
$this->content->icons[] = '';
} 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.'">';
}
}
}
@@ -46,8 +46,8 @@ function get_content() {
$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,14 +89,19 @@ function get_content() {
} 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;
$this->content->icons[] = '';
} 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.'">';
}
}
}

0 comments on commit facf75c

Please sign in to comment.