Changeset View
Changeset View
Standalone View
Standalone View
src/view/AphrontDialogView.php
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | final class AphrontDialogView | ||||
public function setObjectList(PHUIObjectItemListView $list) { | public function setObjectList(PHUIObjectItemListView $list) { | ||||
$this->objectList = true; | $this->objectList = true; | ||||
$box = id(new PHUIObjectBoxView()) | $box = id(new PHUIObjectBoxView()) | ||||
->setObjectList($list); | ->setObjectList($list); | ||||
return $this->appendChild($box); | return $this->appendChild($box); | ||||
} | } | ||||
public function appendParagraph($paragraph) { | public function appendParagraph($paragraph) { | ||||
return $this->appendChild( | return $this->appendParagraphTag($paragraph); | ||||
phutil_tag( | } | ||||
public function appendCommand($command) { | |||||
$command_tag = phutil_tag('tt', array(), $command); | |||||
return $this->appendParagraphTag( | |||||
$command_tag, | |||||
'aphront-dialog-view-command'); | |||||
} | |||||
private function appendParagraphTag($content, $classes = null) { | |||||
if ($classes) { | |||||
$classes = (array)$classes; | |||||
} else { | |||||
$classes = array(); | |||||
} | |||||
array_unshift($classes, 'aphront-dialog-view-paragraph'); | |||||
$paragraph_tag = phutil_tag( | |||||
'p', | 'p', | ||||
array( | array( | ||||
'class' => 'aphront-dialog-view-paragraph', | 'class' => implode(' ', $classes), | ||||
), | ), | ||||
$paragraph)); | $content); | ||||
return $this->appendChild($paragraph_tag); | |||||
} | } | ||||
public function appendList(array $items) { | public function appendList(array $items) { | ||||
$listitems = array(); | $listitems = array(); | ||||
foreach ($items as $item) { | foreach ($items as $item) { | ||||
$listitems[] = phutil_tag( | $listitems[] = phutil_tag( | ||||
'li', | 'li', | ||||
array( | array( | ||||
'class' => 'remarkup-list-item', | 'class' => 'remarkup-list-item', | ||||
), | ), | ||||
▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines |