Skip to content

Commit f35509e

Browse files
committed
Update to use PHUIRemarkupView everywhere possible
Summary: Moves all the one off object calls to PHUIRemarkupView, adds a "Document" call as well (future plans). Test Plan: Visited most pages I could get access to, but may want extra careful eyes on this diff. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15281
1 parent 376c85a commit f35509e

File tree

34 files changed

+83
-199
lines changed

34 files changed

+83
-199
lines changed

src/applications/calendar/controller/PhabricatorCalendarEventViewController.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,7 @@ private function buildPropertyView(PhabricatorCalendarEvent $event) {
363363
->getIconLabel($event->getIcon()));
364364

365365
if (strlen($event->getDescription())) {
366-
$description = PhabricatorMarkupEngine::renderOneObject(
367-
id(new PhabricatorMarkupOneOff())->setContent($event->getDescription()),
368-
'default',
369-
$viewer);
370-
366+
$description = new PHUIRemarkupView($viewer, $event->getDescription());
371367
$properties->addSectionHeader(
372368
pht('Description'),
373369
PHUIPropertyListView::ICON_SUMMARY);

src/applications/config/controller/PhabricatorConfigWelcomeController.php

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -341,23 +341,14 @@ public function buildWelcomeScreen(AphrontRequest $request) {
341341
$header = id(new PHUIHeaderView())
342342
->setHeader(pht('Welcome to Phabricator'));
343343

344-
$setup_header = PhabricatorMarkupEngine::renderOneObject(
345-
id(new PhabricatorMarkupOneOff())
346-
->setContent(pht('=Setup and Configuration')),
347-
'default',
348-
$viewer);
349-
350-
$explore_header = PhabricatorMarkupEngine::renderOneObject(
351-
id(new PhabricatorMarkupOneOff())
352-
->setContent(pht('=Explore Phabricator')),
353-
'default',
354-
$viewer);
355-
356-
$quick_header = PhabricatorMarkupEngine::renderOneObject(
357-
id(new PhabricatorMarkupOneOff())
358-
->setContent(pht('=Quick Start Guides')),
359-
'default',
360-
$viewer);
344+
$setup_header = new PHUIRemarkupView(
345+
$viewer, pht('=Setup and Configuration'));
346+
347+
$explore_header = new PHUIRemarkupView(
348+
$viewer, pht('=Explore Phabricator'));
349+
350+
$quick_header = new PHUIRemarkupView(
351+
$viewer, pht('=Quick Start Guide'));
361352

362353
return id(new PHUIDocumentView())
363354
->setHeader($header)
@@ -376,10 +367,7 @@ private function newItem(AphrontRequest $request, $icon, $content) {
376367
$icon = id(new PHUIIconView())
377368
->setIcon($icon.' fa-2x');
378369

379-
$content = PhabricatorMarkupEngine::renderOneObject(
380-
id(new PhabricatorMarkupOneOff())->setContent($content),
381-
'default',
382-
$viewer);
370+
$content = new PHUIRemarkupView($viewer, $content);
383371

384372
$icon = phutil_tag(
385373
'div',

src/applications/countdown/controller/PhabricatorCountdownViewController.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,7 @@ private function buildPropertyListView(
132132

133133
$description = $countdown->getDescription();
134134
if (strlen($description)) {
135-
$description = PhabricatorMarkupEngine::renderOneObject(
136-
id(new PhabricatorMarkupOneOff())->setContent($description),
137-
'default',
138-
$viewer);
139-
135+
$description = new PHUIRemarkupView($viewer, $description);
140136
$view->addSectionHeader(
141137
pht('Description'),
142138
PHUIPropertyListView::ICON_SUMMARY);

src/applications/differential/customfield/DifferentialRevertPlanField.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ public function renderPropertyViewValue(array $handles) {
4444
return null;
4545
}
4646

47-
return PhabricatorMarkupEngine::renderOneObject(
48-
id(new PhabricatorMarkupOneOff())
49-
->setPreserveLinebreaks(true)
50-
->setContent($this->getValue()),
51-
'default',
52-
$this->getViewer());
47+
return new PHUIRemarkupView($this->getViewer(), $this->getValue());
5348
}
5449

5550
public function shouldAppearInGlobalSearch() {

src/applications/differential/customfield/DifferentialSummaryField.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,7 @@ public function renderPropertyViewValue(array $handles) {
122122
return null;
123123
}
124124

125-
return PhabricatorMarkupEngine::renderOneObject(
126-
id(new PhabricatorMarkupOneOff())
127-
->setPreserveLinebreaks(true)
128-
->setContent($this->getValue()),
129-
'default',
130-
$this->getViewer());
125+
return new PHUIRemarkupView($this->getViewer(), $this->getValue());
131126
}
132127

133128
public function getApplicationTransactionRemarkupBlocks(

src/applications/differential/customfield/DifferentialTestPlanField.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,7 @@ public function renderPropertyViewValue(array $handles) {
136136
return null;
137137
}
138138

139-
return PhabricatorMarkupEngine::renderOneObject(
140-
id(new PhabricatorMarkupOneOff())
141-
->setPreserveLinebreaks(true)
142-
->setContent($this->getValue()),
143-
'default',
144-
$this->getViewer());
139+
return new PHUIRemarkupView($this->getViewer(), $this->getValue());
145140
}
146141

147142
public function getApplicationTransactionRemarkupBlocks(

src/applications/diffusion/controller/DiffusionRepositoryController.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,7 @@ private function buildPropertiesTable(PhabricatorRepository $repository) {
290290

291291
$description = $repository->getDetail('description');
292292
if (strlen($description)) {
293-
$description = PhabricatorMarkupEngine::renderOneObject(
294-
$repository,
295-
'description',
296-
$user);
293+
$description = new PHUIRemarkupView($user, $description);
297294
$view->addSectionHeader(
298295
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
299296
$view->addTextContent($description);

src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,7 @@ private function buildBasicProperties(
309309
if (!strlen($description)) {
310310
$description = phutil_tag('em', array(), pht('No description provided.'));
311311
} else {
312-
$description = PhabricatorMarkupEngine::renderOneObject(
313-
$repository,
314-
'description',
315-
$viewer);
312+
$description = new PHUIRemarkupView($viewer, $description);
316313
}
317314
$view->addTextContent($description);
318315

src/applications/diviner/controller/DivinerBookController.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ public function handleRequest(AphrontRequest $request) {
9494
$preface = $book->getPreface();
9595
$preface_view = null;
9696
if (strlen($preface)) {
97-
$preface_view =
98-
PhabricatorMarkupEngine::renderOneObject(
99-
id(new PhabricatorMarkupOneOff())->setContent($preface),
100-
'default',
101-
$viewer);
97+
$preface_view = new PHUIRemarkupView($viewer, $preface);
10298
}
10399

104100
$document->appendChild($preface_view);

src/applications/diviner/controller/DivinerMainController.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ public function handleRequest(AphrontRequest $request) {
6161
" %s\n\n",
6262
'phabricator/ $ ./bin/diviner generate');
6363

64-
$text = PhabricatorMarkupEngine::renderOneObject(
65-
id(new PhabricatorMarkupOneOff())->setContent($text),
66-
'default',
67-
$viewer);
68-
64+
$text = new PHUIRemarkupView($viewer, $text);
6965
$document->appendChild($text);
7066
}
7167

0 commit comments

Comments
 (0)