Page MenuHomec4science

PhabricatorPasteController.php
No OneTemporary

File Metadata

Created
Wed, Jan 22, 11:00

PhabricatorPasteController.php

<?php
abstract class PhabricatorPasteController extends PhabricatorController {
public function buildSideNavView($for_app = false) {
$user = $this->getRequest()->getUser();
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
if ($for_app) {
$nav->addFilter('create', pht('Create Paste'));
}
id(new PhabricatorPasteSearchEngine())
->setViewer($user)
->addNavigationItems($nav->getMenu());
$nav->selectFilter(null);
return $nav;
}
public function buildApplicationMenu() {
return $this->buildSideNavView(true)->getMenu();
}
public function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
$crumbs->addAction(
id(new PhabricatorMenuItemView())
->setName(pht('Create Paste'))
->setHref($this->getApplicationURI('create/'))
->setIcon('create'));
return $crumbs;
}
public function buildSourceCodeView(
PhabricatorPaste $paste,
$max_lines = null) {
$lines = phutil_split_lines($paste->getContent());
return id(new PhabricatorSourceCodeView())
->setLimit($max_lines)
->setLines($lines);
}
}

Event Timeline