original_string: public function view($request) {
  		$object = null;
  		if ($id = $request->param('ID')) {
  			$object = ExternalContent::getDataObjectFor($id);
  			if ($object instanceof ExternalContentSource) {
  				$object = $object->getRoot();
  			}
  
  			if ($object && ($object instanceof ExternalContentItem || $object instanceof ExternalContentSource)) {
  				$this->data()->setRequestedItem($object);
  				$type = $object instanceof ExternalContentItem ? $object->getType() : 'source';
  				$template = 'ExternalContent_' . get_class($object) . '_' . $type;
  
  				$viewer = new SSViewer(array($template, 'ExternalContent_' . get_class($object), 'ExternalContent', 'Page'));
  				$action = 'view';
  				$this->extend('updateViewer', $action, $viewer);
  
  				return $this->customise($object)->renderWith($viewer);
  			}
  		}
  
  		echo "Template not found for " . ($object ? get_class($object) . ' #' . $object->ID : '');
  	}
code: public function view($request) {
  		$object = null;
  		if ($id = $request->param('ID')) {
  			$object = ExternalContent::getDataObjectFor($id);
  			if ($object instanceof ExternalContentSource) {
  				$object = $object->getRoot();
  			}
  
  			if ($object && ($object instanceof ExternalContentItem || $object instanceof ExternalContentSource)) {
  				$this->data()->setRequestedItem($object);
  				$type = $object instanceof ExternalContentItem ? $object->getType() : 'source';
  				$template = 'ExternalContent_' . get_class($object) . '_' . $type;
  
  				$viewer = new SSViewer(array($template, 'ExternalContent_' . get_class($object), 'ExternalContent', 'Page'));
  				$action = 'view';
  				$this->extend('updateViewer', $action, $viewer);
  
  				return $this->customise($object)->renderWith($viewer);
  			}
  		}
  
  		echo "Template not found for " . ($object ? get_class($object) . ' #' . $object->ID : '');
  	}
code_tokens: public function view ( $ request ) { $ object = null ; if ( $ id = $ request -> param ( 'ID' ) ) { $ object = ExternalContent :: getDataObjectFor ( $ id ) ; if ( $ object instanceof ExternalContentSource ) { $ object = $ object -> getRoot ( ) ; } if ( $ object && ( $ object instanceof ExternalContentItem || $ object instanceof ExternalContentSource ) ) { $ this -> data ( ) -> setRequestedItem ( $ object ) ; $ type = $ object instanceof ExternalContentItem ? $ object -> getType ( ) : 'source' ; $ template = 'ExternalContent_' . get_class ( $ object ) . '_' . $ type ; $ viewer = new SSViewer ( array ( $ template , 'ExternalContent_' . get_class ( $ object ) , 'ExternalContent' , 'Page' ) ) ; $ action = 'view' ; $ this -> extend ( 'updateViewer' , $ action , $ viewer ) ; return $ this -> customise ( $ object ) -> renderWith ( $ viewer ) ; } } echo "Template not found for " . ( $ object ? get_class ( $ object ) . ' #' . $ object -> ID : '' ) ; }
docstring: Display an item.
  
  @param HTTP_Request $request
  @return String
docstring_tokens: Display an item .