mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 11:22:40 +01:00
a5dc9067af
Summary: We currently have a lot of calls to `addCrumb(id(new PhabricatorCrumbView())->...)` which can be expressed much more simply with a convenience method. Nearly all crumbs are only textual. Test Plan: - This was mostly automated, then I cleaned up a few unusual sites manually. - Bunch of grep / randomly clicking around. Reviewers: btrahan, chad Reviewed By: btrahan CC: hach-que, aran Differential Revision: https://secure.phabricator.com/D7787
26 lines
709 B
PHP
26 lines
709 B
PHP
<?php
|
|
|
|
abstract class DiffusionRepositoryEditController
|
|
extends DiffusionController {
|
|
|
|
public function buildApplicationCrumbs($is_main = false) {
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
if ($this->diffusionRequest) {
|
|
$repository = $this->getDiffusionRequest()->getRepository();
|
|
$repo_uri = $this->getRepositoryControllerURI($repository, '');
|
|
$edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
|
|
|
|
$crumbs->addTextCrumb('r'.$repository->getCallsign(), $repo_uri);
|
|
|
|
if ($is_main) {
|
|
$crumbs->addTextCrumb(pht('Edit Repository'));
|
|
} else {
|
|
$crumbs->addTextCrumb(pht('Edit'), $edit_uri);
|
|
}
|
|
}
|
|
|
|
return $crumbs;
|
|
}
|
|
|
|
}
|