original_string: public function render_blog_entry_attachment(blog_entry_attachment $attachment) {
  
          $syscontext = context_system::instance();
  
          // Image attachments don't get printed as links.
          if (file_mimetype_in_typegroup($attachment->file->get_mimetype(), 'web_image')) {
              $attrs = array('src' => $attachment->url, 'alt' => '');
              $o = html_writer::empty_tag('img', $attrs);
              $class = 'attachedimages';
          } else {
              $image = $this->output->pix_icon(file_file_icon($attachment->file),
                                               $attachment->filename,
                                               'moodle',
                                               array('class' => 'icon'));
              $o = html_writer::link($attachment->url, $image);
              $o .= format_text(html_writer::link($attachment->url, $attachment->filename),
                                FORMAT_HTML,
                                array('context' => $syscontext));
              $class = 'attachments';
          }
  
          return $this->output->container($o, $class);
      }
code: public function render_blog_entry_attachment(blog_entry_attachment $attachment) {
  
          $syscontext = context_system::instance();
  
          // Image attachments don't get printed as links.
          if (file_mimetype_in_typegroup($attachment->file->get_mimetype(), 'web_image')) {
              $attrs = array('src' => $attachment->url, 'alt' => '');
              $o = html_writer::empty_tag('img', $attrs);
              $class = 'attachedimages';
          } else {
              $image = $this->output->pix_icon(file_file_icon($attachment->file),
                                               $attachment->filename,
                                               'moodle',
                                               array('class' => 'icon'));
              $o = html_writer::link($attachment->url, $image);
              $o .= format_text(html_writer::link($attachment->url, $attachment->filename),
                                FORMAT_HTML,
                                array('context' => $syscontext));
              $class = 'attachments';
          }
  
          return $this->output->container($o, $class);
      }
code_tokens: public function render_blog_entry_attachment ( blog_entry_attachment $ attachment ) { $ syscontext = context_system :: instance ( ) ; // Image attachments don't get printed as links. if ( file_mimetype_in_typegroup ( $ attachment -> file -> get_mimetype ( ) , 'web_image' ) ) { $ attrs = array ( 'src' => $ attachment -> url , 'alt' => '' ) ; $ o = html_writer :: empty_tag ( 'img' , $ attrs ) ; $ class = 'attachedimages' ; } else { $ image = $ this -> output -> pix_icon ( file_file_icon ( $ attachment -> file ) , $ attachment -> filename , 'moodle' , array ( 'class' => 'icon' ) ) ; $ o = html_writer :: link ( $ attachment -> url , $ image ) ; $ o .= format_text ( html_writer :: link ( $ attachment -> url , $ attachment -> filename ) , FORMAT_HTML , array ( 'context' => $ syscontext ) ) ; $ class = 'attachments' ; } return $ this -> output -> container ( $ o , $ class ) ; }
docstring: Renders an entry attachment
  
  Print link for non-images and returns images as HTML
  
  @param blog_entry_attachment $attachment
  @return string List of attachments depending on the $return input
docstring_tokens: Renders an entry attachment