mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 02:02:41 +01:00
68affb72ec
Summary: Went through this last night, I had to remove some static vars, but didn't see that as a huge perf issue. Lint Test Plan: Tested numerous differential pages, creating a diff, commenting, editing. Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4617
40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
|
|
|
abstract class DifferentialController extends PhabricatorController {
|
|
|
|
protected function allowsAnonymousAccess() {
|
|
return PhabricatorEnv::getEnvConfig('differential.anonymous-access');
|
|
}
|
|
|
|
public function buildStandardPageResponse($view, array $data) {
|
|
|
|
require_celerity_resource('differential-core-view-css');
|
|
|
|
$viewer_is_anonymous = !$this->getRequest()->getUser()->isLoggedIn();
|
|
|
|
$page = $this->buildStandardPageView();
|
|
$page->setApplicationName(pht('Differential'));
|
|
$page->setBaseURI('/differential/');
|
|
$page->setTitle(idx($data, 'title'));
|
|
$page->setGlyph("\xE2\x9A\x99");
|
|
$page->appendChild($view);
|
|
$page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_OPEN_REVISIONS);
|
|
|
|
$response = new AphrontWebpageResponse();
|
|
return $response->setContent($page->render());
|
|
}
|
|
|
|
public function buildApplicationCrumbs() {
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
$create_uri = new PhutilURI('/differential/diff/create/');
|
|
$crumbs->addAction(
|
|
id(new PhabricatorMenuItemView())
|
|
->setHref($this->getApplicationURI('/diff/create/'))
|
|
->setName(pht('Create Diff'))
|
|
->setIcon('create'));
|
|
|
|
return $crumbs;
|
|
}
|
|
|
|
}
|