contentSource = $content_source; return $this; } public function setUser(PhabricatorUser $user) { $this->user = $user; return $this; } public function render() { require_celerity_resource('phabricator-content-source-view-css'); $type = null; $map = array( PhabricatorContentSource::SOURCE_WEB => 'web', PhabricatorContentSource::SOURCE_CONDUIT => 'conduit', PhabricatorContentSource::SOURCE_EMAIL => 'email', PhabricatorContentSource::SOURCE_MOBILE => 'mobile', PhabricatorContentSource::SOURCE_TABLET => 'tablet', ); $source = $this->contentSource->getSource(); $type = idx($map, $source, null); if (!$type) { return; } $type_class = 'phabricator-content-source-'.$type; return phutil_render_tag( 'span', array( 'class' => "phabricator-content-source-view {$type_class}", ), 'Via'); } }