1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 00:02:41 +01:00
phorge-phorge/src/applications/differential/customfield/DifferentialPathField.php
epriestley f6a13fd1c7 Use CustomField, not AuxiliaryField, to power RevisionView
Summary: Ref T2222. This will probably have some rough edges for a bit (e.g., weird cases I didn't remember or think of), but there's no change to the underlying data and we can easily revert if things get too messy.

Test Plan: Looked at a variety of revisions and saw sensible output.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222

Differential Revision: https://secure.phabricator.com/D8361
2014-02-27 11:06:14 -08:00

39 lines
744 B
PHP

<?php
final class DifferentialPathField
extends DifferentialCustomField {
public function getFieldKey() {
return 'differential:path';
}
public function getFieldName() {
return pht('Path');
}
public function getFieldDescription() {
return pht('Shows the local path where the diff came from.');
}
public function shouldDisableByDefault() {
return true;
}
public function shouldAppearInPropertyView() {
return true;
}
public function renderPropertyViewLabel() {
return $this->getFieldName();
}
public function renderPropertyViewValue(array $handles) {
$path = $this->getObject()->getActiveDiff()->getSourcePath();
if (!$path) {
return null;
}
return $path;
}
}