mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 02:02:41 +01:00
3c1b8df8ae
Summary: Done manually. Test Plan: Loaded homepage. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4509
39 lines
999 B
PHP
39 lines
999 B
PHP
<?php
|
|
|
|
final class PhabricatorContentSourceView extends AphrontView {
|
|
|
|
private $contentSource;
|
|
|
|
public function setContentSource(PhabricatorContentSource $content_source) {
|
|
$this->contentSource = $content_source;
|
|
return $this;
|
|
}
|
|
|
|
public function render() {
|
|
require_celerity_resource('phabricator-content-source-view-css');
|
|
|
|
$map = array(
|
|
PhabricatorContentSource::SOURCE_WEB => 'Web',
|
|
PhabricatorContentSource::SOURCE_CONDUIT => 'Conduit',
|
|
PhabricatorContentSource::SOURCE_EMAIL => 'Email',
|
|
PhabricatorContentSource::SOURCE_MOBILE => 'Mobile',
|
|
PhabricatorContentSource::SOURCE_TABLET => 'Tablet',
|
|
PhabricatorContentSource::SOURCE_FAX => 'Fax',
|
|
);
|
|
|
|
$source = $this->contentSource->getSource();
|
|
$type = idx($map, $source, null);
|
|
|
|
if (!$type) {
|
|
return;
|
|
}
|
|
|
|
return phutil_tag(
|
|
'span',
|
|
array(
|
|
'class' => "phabricator-content-source-view",
|
|
),
|
|
"Via {$type}");
|
|
}
|
|
|
|
}
|