original_string: protected function build_node($rootpath, $path, $name, $isdir, $rootnodepath) {
          global $OUTPUT;
  
          $relpath = trim($path, '/') . '/' . $name;
          $abspath = $rootpath . $relpath;
          $node = array(
              'title' => $name,
              'datecreated' => filectime($abspath),
              'datemodified' => filemtime($abspath),
          );
  
          if ($isdir) {
              $node['children'] = array();
              $node['thumbnail'] = $OUTPUT->image_url(file_folder_icon(90))->out(false);
              $node['path'] = $this->build_node_path('browse', $relpath, $name, $rootnodepath);
  
          } else {
              $node['source'] = $relpath;
              $node['size'] = filesize($abspath);
              $node['thumbnail'] = $OUTPUT->image_url(file_extension_icon($name, 90))->out(false);
              $node['icon'] = $OUTPUT->image_url(file_extension_icon($name, 24))->out(false);
              $node['path'] = $relpath;
  
              if (file_extension_in_typegroup($name, 'image') && ($imageinfo = @getimagesize($abspath))) {
                  // This means it is an image and we can return dimensions and try to generate thumbnail/icon.
                  $token = $node['datemodified'] . $node['size']; // To prevent caching by browser.
                  $node['realthumbnail'] = $this->get_thumbnail_url($relpath, 'thumb', $token)->out(false);
                  $node['realicon'] = $this->get_thumbnail_url($relpath, 'icon', $token)->out(false);
                  $node['image_width'] = $imageinfo[0];
                  $node['image_height'] = $imageinfo[1];
              }
          }
  
          return $node;
      }
code: protected function build_node($rootpath, $path, $name, $isdir, $rootnodepath) {
          global $OUTPUT;
  
          $relpath = trim($path, '/') . '/' . $name;
          $abspath = $rootpath . $relpath;
          $node = array(
              'title' => $name,
              'datecreated' => filectime($abspath),
              'datemodified' => filemtime($abspath),
          );
  
          if ($isdir) {
              $node['children'] = array();
              $node['thumbnail'] = $OUTPUT->image_url(file_folder_icon(90))->out(false);
              $node['path'] = $this->build_node_path('browse', $relpath, $name, $rootnodepath);
  
          } else {
              $node['source'] = $relpath;
              $node['size'] = filesize($abspath);
              $node['thumbnail'] = $OUTPUT->image_url(file_extension_icon($name, 90))->out(false);
              $node['icon'] = $OUTPUT->image_url(file_extension_icon($name, 24))->out(false);
              $node['path'] = $relpath;
  
              if (file_extension_in_typegroup($name, 'image') && ($imageinfo = @getimagesize($abspath))) {
                  // This means it is an image and we can return dimensions and try to generate thumbnail/icon.
                  $token = $node['datemodified'] . $node['size']; // To prevent caching by browser.
                  $node['realthumbnail'] = $this->get_thumbnail_url($relpath, 'thumb', $token)->out(false);
                  $node['realicon'] = $this->get_thumbnail_url($relpath, 'icon', $token)->out(false);
                  $node['image_width'] = $imageinfo[0];
                  $node['image_height'] = $imageinfo[1];
              }
          }
  
          return $node;
      }
code_tokens: protected function build_node ( $ rootpath , $ path , $ name , $ isdir , $ rootnodepath ) { global $ OUTPUT ; $ relpath = trim ( $ path , '/' ) . '/' . $ name ; $ abspath = $ rootpath . $ relpath ; $ node = array ( 'title' => $ name , 'datecreated' => filectime ( $ abspath ) , 'datemodified' => filemtime ( $ abspath ) , ) ; if ( $ isdir ) { $ node [ 'children' ] = array ( ) ; $ node [ 'thumbnail' ] = $ OUTPUT -> image_url ( file_folder_icon ( 90 ) ) -> out ( false ) ; $ node [ 'path' ] = $ this -> build_node_path ( 'browse' , $ relpath , $ name , $ rootnodepath ) ; } else { $ node [ 'source' ] = $ relpath ; $ node [ 'size' ] = filesize ( $ abspath ) ; $ node [ 'thumbnail' ] = $ OUTPUT -> image_url ( file_extension_icon ( $ name , 90 ) ) -> out ( false ) ; $ node [ 'icon' ] = $ OUTPUT -> image_url ( file_extension_icon ( $ name , 24 ) ) -> out ( false ) ; $ node [ 'path' ] = $ relpath ; if ( file_extension_in_typegroup ( $ name , 'image' ) && ( $ imageinfo = @ getimagesize ( $ abspath ) ) ) { // This means it is an image and we can return dimensions and try to generate thumbnail/icon. $ token = $ node [ 'datemodified' ] . $ node [ 'size' ] ; // To prevent caching by browser. $ node [ 'realthumbnail' ] = $ this -> get_thumbnail_url ( $ relpath , 'thumb' , $ token ) -> out ( false ) ; $ node [ 'realicon' ] = $ this -> get_thumbnail_url ( $ relpath , 'icon' , $ token ) -> out ( false ) ; $ node [ 'image_width' ] = $ imageinfo [ 0 ] ; $ node [ 'image_height' ] = $ imageinfo [ 1 ] ; } } return $ node ; }
docstring: Build a file or directory node.
  
  @param string $rootpath The absolute path to the repository.
  @param string $path The relative path of the object
  @param string $name The name of the object
  @param string $isdir Is the object a directory?
  @param string $rootnodepath The node leading to this node (for breadcrumb).
  @return array
docstring_tokens: Build a file or directory node .