- $output .= "<br />";
-
- } else if ($type == 'text') {
- $output .= "$strattachment ".s($filename).":\n$path\n";
-
- } else { //'returnimages'
- if (in_array($mimetype, array('image/gif', 'image/jpeg', 'image/png'))) {
- // Image attachments don't get printed as links
- $imagereturn .= "<br /><img src=\"$path\" alt=\"\" />";
- if ($canexport) {
- $button->set_callback_options('forum_portfolio_caller', array('postid' => $post->id, 'attachment' => $file->get_id()), '/mod/forum/locallib.php');
- $button->set_format_by_file($file);
- $imagereturn .= $button->to_html(PORTFOLIO_ADD_ICON_LINK);
- }
- } else {
- $output .= "<a href=\"$path\">$iconimage</a> ";
- $output .= format_text("<a href=\"$path\">".s($filename)."</a>", FORMAT_HTML, array('context'=>$context));
- if ($canexport) {
- $button->set_callback_options('forum_portfolio_caller', array('postid' => $post->id, 'attachment' => $file->get_id()), '/mod/forum/locallib.php');
- $button->set_format_by_file($file);
- $output .= $button->to_html(PORTFOLIO_ADD_ICON_LINK);
- }
- $output .= '<br />';
- }