Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/controller/PhabricatorPasteController.php
Show All 33 Lines | $crumbs->addAction( | ||||
->setHref($this->getApplicationURI('create/')) | ->setHref($this->getApplicationURI('create/')) | ||||
->setIcon('fa-plus-square')); | ->setIcon('fa-plus-square')); | ||||
return $crumbs; | return $crumbs; | ||||
} | } | ||||
public function buildSourceCodeView( | public function buildSourceCodeView( | ||||
PhabricatorPaste $paste, | PhabricatorPaste $paste, | ||||
$max_lines = null, | |||||
$highlights = array()) { | $highlights = array()) { | ||||
$lines = phutil_split_lines($paste->getContent()); | $lines = phutil_split_lines($paste->getContent()); | ||||
return id(new PhabricatorSourceCodeView()) | return id(new PhabricatorSourceCodeView()) | ||||
->setLimit($max_lines) | |||||
->setLines($lines) | ->setLines($lines) | ||||
->setHighlights($highlights) | ->setHighlights($highlights) | ||||
->setURI(new PhutilURI($paste->getURI())); | ->setURI(new PhutilURI($paste->getURI())); | ||||
} | } | ||||
} | } |