Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/controller/blog/PhameBlogManageController.php
Show All 30 Lines | public function handleRequest(AphrontRequest $request) { | ||||
} | } | ||||
$picture = $blog->getProfileImageURI(); | $picture = $blog->getProfileImageURI(); | ||||
$view = id(new PHUIButtonView()) | $view = id(new PHUIButtonView()) | ||||
->setTag('a') | ->setTag('a') | ||||
->setText(pht('View Live')) | ->setText(pht('View Live')) | ||||
->setIcon('fa-external-link') | ->setIcon('fa-external-link') | ||||
->setHref($blog->getLiveURI()); | ->setHref($blog->getLiveURI()) | ||||
->setDisabled($blog->isArchived()); | |||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->setHeader($blog->getName()) | ->setHeader($blog->getName()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setPolicyObject($blog) | ->setPolicyObject($blog) | ||||
->setImage($picture) | ->setImage($picture) | ||||
->setStatus($header_icon, $header_color, $header_name) | ->setStatus($header_icon, $header_color, $header_name) | ||||
->addActionLink($view); | ->addActionLink($view); | ||||
$can_edit = PhabricatorPolicyFilter::hasCapability( | |||||
$viewer, | |||||
$blog, | |||||
PhabricatorPolicyCapability::CAN_EDIT); | |||||
if ($can_edit) { | |||||
$header->setImageEditURL( | |||||
$this->getApplicationURI('blog/picture/'.$blog->getID().'/')); | |||||
} | |||||
$curtain = $this->buildCurtain($blog); | $curtain = $this->buildCurtain($blog); | ||||
$properties = $this->buildPropertyView($blog); | $properties = $this->buildPropertyView($blog); | ||||
$file = $this->buildFileView($blog); | $file = $this->buildFileView($blog); | ||||
$crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
$crumbs->addTextCrumb( | $crumbs->addTextCrumb( | ||||
pht('Blogs'), | pht('Blogs'), | ||||
$this->getApplicationURI('blog/')); | $this->getApplicationURI('blog/')); | ||||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |