1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 11:12:42 +01:00
phorge-phorge/src/applications/metamta/contentsource/PhabricatorContentSourceView.php

33 lines
676 B
PHP
Raw Normal View History

<?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 = PhabricatorContentSource::getSourceNameMap();
$source = $this->contentSource->getSource();
$type = idx($map, $source, null);
if (!$type) {
return null;
}
return phutil_tag(
'span',
array(
'class' => "phabricator-content-source-view",
),
"Via {$type}");
}
}