@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhortuneOrderDescriptionView
4 extends AphrontView {
5
6 private $order;
7
8 public function setOrder(PhortuneCart $order) {
9 $this->order = $order;
10 return $this;
11 }
12
13 public function getOrder() {
14 return $this->order;
15 }
16
17 public function render() {
18 $viewer = $this->getViewer();
19 $order = $this->getOrder();
20
21 $description = $order->getDescription();
22 if (!strlen($description)) {
23 return null;
24 }
25
26 $output = new PHUIRemarkupView($viewer, $description);
27
28 $description_box = id(new PHUIBoxView())
29 ->addMargin(PHUI::MARGIN_LARGE)
30 ->appendChild($output);
31
32 return id(new PHUIObjectBoxView())
33 ->setHeaderText(pht('Description'))
34 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
35 ->appendChild($description_box);
36 }
37
38
39}