Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/controller/post/PhamePostViewController.php
Show All 18 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$is_external = $this->getIsExternal(); | $is_external = $this->getIsExternal(); | ||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->addClass('phame-header-bar') | ->addClass('phame-header-bar') | ||||
->setUser($viewer); | ->setUser($viewer); | ||||
$hero = $this->buildPhamePostHeader($post); | $hero = $this->buildPhamePostHeader($post); | ||||
if (!$is_external) { | if (!$is_external && $viewer->isLoggedIn()) { | ||||
$actions = $this->renderActions($post); | $actions = $this->renderActions($post); | ||||
$header->setPolicyObject($post); | $header->setPolicyObject($post); | ||||
$header->setActionList($actions); | $header->setActionList($actions); | ||||
} | } | ||||
$document = id(new PHUIDocumentView()) | $document = id(new PHUIDocumentView()) | ||||
->setHeader($header); | ->setHeader($header); | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$monogram = $post->getMonogram(); | $monogram = $post->getMonogram(); | ||||
$timeline = $this->buildTransactionTimeline( | $timeline = $this->buildTransactionTimeline( | ||||
$post, | $post, | ||||
id(new PhamePostTransactionQuery()) | id(new PhamePostTransactionQuery()) | ||||
->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT))); | ->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT))); | ||||
$timeline->setQuoteRef($monogram); | $timeline->setQuoteRef($monogram); | ||||
if ($is_external) { | if ($is_external || !$viewer->isLoggedIn()) { | ||||
$add_comment = null; | $add_comment = null; | ||||
} else { | } else { | ||||
$add_comment = $this->buildCommentForm($post, $timeline); | $add_comment = $this->buildCommentForm($post, $timeline); | ||||
$add_comment = phutil_tag_div('mlb mlt phame-comment-view', $add_comment); | $add_comment = phutil_tag_div('mlb mlt phame-comment-view', $add_comment); | ||||
} | } | ||||
$timeline = phutil_tag_div('phui-document-view-pro-box', $timeline); | $timeline = phutil_tag_div('phui-document-view-pro-box', $timeline); | ||||
▲ Show 20 Lines • Show All 213 Lines • Show Last 20 Lines |