1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 02:02:41 +01:00
phorge-phorge/src/applications/metamta/contentsource/PhabricatorContentSourceView.php
vrana 3c1b8df8ae Convert simple phutil_render_tag() to phutil_tag()
Summary: Done manually.

Test Plan: Loaded homepage.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4509
2013-01-24 19:30:50 -08:00

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}");
}
}