diff --git a/src/applications/uiexample/examples/JavelinReactorUIExample.php b/src/applications/uiexample/examples/JavelinReactorUIExample.php index 2ecb69bf3d..9104c84c27 100644 --- a/src/applications/uiexample/examples/JavelinReactorUIExample.php +++ b/src/applications/uiexample/examples/JavelinReactorUIExample.php @@ -82,7 +82,8 @@ final class JavelinReactorUIExample extends PhabricatorUIExample { $table = new AphrontTableView($rows); - $panel = new AphrontPanelView(); + $panel = new PHUIObjectBoxView(); + $panel->setHeaderText(pht('Example')); $panel->appendChild($table); return $panel; diff --git a/src/applications/uiexample/examples/JavelinViewUIExample.php b/src/applications/uiexample/examples/JavelinViewUIExample.php index 0928722c2c..73389475a7 100644 --- a/src/applications/uiexample/examples/JavelinViewUIExample.php +++ b/src/applications/uiexample/examples/JavelinViewUIExample.php @@ -35,8 +35,10 @@ final class JavelinViewUIExample extends PhabricatorUIExample { $child_server_template->appendChild($child_client_template); $child_client_template->appendChild('Hey, it worked.'); - $panel = new AphrontPanelView(); - $panel->appendChild($parent_server_template); + $panel = new PHUIObjectBoxView(); + $panel->setHeaderText(pht('Example')); + $panel->appendChild( + phutil_tag_div('ml', $parent_server_template)); return $panel; } diff --git a/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php b/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php index 1a8b323da6..6520aab0cf 100644 --- a/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php +++ b/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php @@ -11,19 +11,19 @@ final class PhabricatorAphrontBarUIExample extends PhabricatorUIExample { } public function renderExample() { - $out = ''; - $out .= $this->renderTestThings('AphrontProgressBarView', 13, 10); - $out .= $this->renderTestThings('AphrontGlyphBarView', 13, 10); - $out .= $this->renderWeirdOrderGlyphBars(); - $out .= $this->renderAsciiStarBar(); - return phutil_safe_html($out); + $out = array(); + $out[] = $this->renderTestThings('AphrontProgressBarView', 13, 10); + $out[] = $this->renderTestThings('AphrontGlyphBarView', 13, 10); + $out[] = $this->renderWeirdOrderGlyphBars(); + $out[] = $this->renderAsciiStarBar(); + return $out; } private function wrap($title, $thing) { - return id(new AphrontPanelView()) - ->setHeader($title) - ->appendChild($thing) - ->render(); + $thing = phutil_tag_div('ml grouped', $thing); + return id(new PHUIObjectBoxView()) + ->setHeaderText($title) + ->appendChild($thing); } private function renderTestThings($class, $max, $incr) { @@ -34,9 +34,7 @@ final class PhabricatorAphrontBarUIExample extends PhabricatorUIExample { ->setMax($max * $incr) ->setCaption("{$ii} outta {$max} ain't bad!"); } - return $this->wrap( - "Test {$class}", - phutil_implode_html('', mpull($bars, 'render'))); + return $this->wrap("Test {$class}", $bars); } private function renderWeirdOrderGlyphBars() { @@ -50,26 +48,25 @@ final class PhabricatorAphrontBarUIExample extends PhabricatorUIExample { ->setNumGlyphs(5) ->setCaption("Lol score is {$index}/{$max}") ->setGlyph(hsprintf('%s', 'LOL!')) - ->setBackgroundGlyph(hsprintf('%s', '____')) - ->render(); + ->setBackgroundGlyph(hsprintf('%s', '____')); $views[] = hsprintf('
'); } return $this->wrap( 'Glyph bars in weird order', - phutil_implode_html('', $views)); + $views); } private function renderAsciiStarBar() { - return $this->wrap( - 'Ascii star glyph bar', - id(new AphrontGlyphBarView()) + $bar = id(new AphrontGlyphBarView()) ->setValue(50) ->setMax(100) ->setCaption('Glyphs!') ->setNumGlyphs(10) - ->setGlyph(hsprintf('%s', '*')) - ->render()); + ->setGlyph(hsprintf('%s', '*')); + + return $this->wrap( + 'Ascii star glyph bar', $bar); } } diff --git a/src/applications/uiexample/examples/PhabricatorPagerUIExample.php b/src/applications/uiexample/examples/PhabricatorPagerUIExample.php index b79eae5e7a..cb5212d046 100644 --- a/src/applications/uiexample/examples/PhabricatorPagerUIExample.php +++ b/src/applications/uiexample/examples/PhabricatorPagerUIExample.php @@ -32,7 +32,8 @@ final class PhabricatorPagerUIExample extends PhabricatorUIExample { array( 'Item', )); - $panel = new AphrontPanelView(); + $panel = new PHUIObjectBoxView(); + $panel->setHeaderText(pht('Example')); $panel->appendChild($table); $panel->appendChild(hsprintf(