mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-11 22:38:36 +01:00
Summary: Adds very basic crumbs to Differential, to prevent regression when we drop the application menu. I'll do a more proper pass at this but want to unblock landing the commit sequence for all this stuff. Test Plan: Looked at detail view and list view, saw crumbs, clicked them. Reviewers: chad Reviewed By: chad CC: aran Maniphest Tasks: T1960 Differential Revision: https://secure.phabricator.com/D4111
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('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('Create Diff')
|
|
->setIcon('create'));
|
|
|
|
return $crumbs;
|
|
}
|
|
|
|
}
|