original_string: protected function build_breadcrumb($path) {
          $breadcrumb = array(array(
              'name' => get_string('root', 'repository_filesystem'),
              'path' => $this->build_node_path('root')
          ));
  
          $crumbs = explode('|', $path);
          $trail = '';
  
          foreach ($crumbs as $crumb) {
              list($mode, $nodepath, $display) = $this->explode_node_path($crumb);
              switch ($mode) {
                  case 'search':
                      $breadcrumb[] = array(
                          'name' => get_string('searchresults', 'repository_filesystem'),
                          'path' => $this->build_node_path($mode, $nodepath, $display, $trail),
                      );
                      break;
  
                  case 'browse':
                      $breadcrumb[] = array(
                          'name' => $display,
                          'path' => $this->build_node_path($mode, $nodepath, $display, $trail),
                      );
                      break;
              }
  
              $lastcrumb = end($breadcrumb);
              $trail = $lastcrumb['path'];
          }
  
          return $breadcrumb;
      }
code: protected function build_breadcrumb($path) {
          $breadcrumb = array(array(
              'name' => get_string('root', 'repository_filesystem'),
              'path' => $this->build_node_path('root')
          ));
  
          $crumbs = explode('|', $path);
          $trail = '';
  
          foreach ($crumbs as $crumb) {
              list($mode, $nodepath, $display) = $this->explode_node_path($crumb);
              switch ($mode) {
                  case 'search':
                      $breadcrumb[] = array(
                          'name' => get_string('searchresults', 'repository_filesystem'),
                          'path' => $this->build_node_path($mode, $nodepath, $display, $trail),
                      );
                      break;
  
                  case 'browse':
                      $breadcrumb[] = array(
                          'name' => $display,
                          'path' => $this->build_node_path($mode, $nodepath, $display, $trail),
                      );
                      break;
              }
  
              $lastcrumb = end($breadcrumb);
              $trail = $lastcrumb['path'];
          }
  
          return $breadcrumb;
      }
code_tokens: protected function build_breadcrumb ( $ path ) { $ breadcrumb = array ( array ( 'name' => get_string ( 'root' , 'repository_filesystem' ) , 'path' => $ this -> build_node_path ( 'root' ) ) ) ; $ crumbs = explode ( '|' , $ path ) ; $ trail = '' ; foreach ( $ crumbs as $ crumb ) { list ( $ mode , $ nodepath , $ display ) = $ this -> explode_node_path ( $ crumb ) ; switch ( $ mode ) { case 'search' : $ breadcrumb [ ] = array ( 'name' => get_string ( 'searchresults' , 'repository_filesystem' ) , 'path' => $ this -> build_node_path ( $ mode , $ nodepath , $ display , $ trail ) , ) ; break ; case 'browse' : $ breadcrumb [ ] = array ( 'name' => $ display , 'path' => $ this -> build_node_path ( $ mode , $ nodepath , $ display , $ trail ) , ) ; break ; } $ lastcrumb = end ( $ breadcrumb ) ; $ trail = $ lastcrumb [ 'path' ] ; } return $ breadcrumb ; }
docstring: Build the breadcrumb from a full path.
  
  @param string $path A path generated by {@link self::build_node_path()}.
  @return array
docstring_tokens: Build the breadcrumb from a full path .