original_string: public function htmllize_file_tree($dir) {
          if (empty($dir['subdirs']) and empty($dir['files'])) {
              return '';
          }
          $result = '<ul>';
          foreach ($dir['subdirs'] as $subdir) {
              $result .= '<li>'.s($subdir['dirname']).' '.$this->htmllize_file_tree($subdir).'</li>';
          }
          foreach ($dir['files'] as $file) {
              $filename = $file->get_filename();
              $result .= '<li><span>'.html_writer::link($file->fileurl, $filename).'</span></li>';
          }
          $result .= '</ul>';
  
          return $result;
      }
code: public function htmllize_file_tree($dir) {
          if (empty($dir['subdirs']) and empty($dir['files'])) {
              return '';
          }
          $result = '<ul>';
          foreach ($dir['subdirs'] as $subdir) {
              $result .= '<li>'.s($subdir['dirname']).' '.$this->htmllize_file_tree($subdir).'</li>';
          }
          foreach ($dir['files'] as $file) {
              $filename = $file->get_filename();
              $result .= '<li><span>'.html_writer::link($file->fileurl, $filename).'</span></li>';
          }
          $result .= '</ul>';
  
          return $result;
      }
code_tokens: public function htmllize_file_tree ( $ dir ) { if ( empty ( $ dir [ 'subdirs' ] ) and empty ( $ dir [ 'files' ] ) ) { return '' ; } $ result = '<ul>' ; foreach ( $ dir [ 'subdirs' ] as $ subdir ) { $ result .= '<li>' . s ( $ subdir [ 'dirname' ] ) . ' ' . $ this -> htmllize_file_tree ( $ subdir ) . '</li>' ; } foreach ( $ dir [ 'files' ] as $ file ) { $ filename = $ file -> get_filename ( ) ; $ result .= '<li><span>' . html_writer :: link ( $ file -> fileurl , $ filename ) . '</span></li>' ; } $ result .= '</ul>' ; return $ result ; }
docstring: Internal implementation of file tree viewer items rendering.
  
  @param array $dir
  @return string
docstring_tokens: Internal implementation of file tree viewer items rendering .