Changeset View
Changeset View
Standalone View
Standalone View
src/view/form/PHUIInfoView.php
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | public function addButton(PHUIButtonView $button) { | ||||
$this->buttons[] = $button; | $this->buttons[] = $button; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function render() { | public function render() { | ||||
require_celerity_resource('phui-info-view-css'); | require_celerity_resource('phui-info-view-css'); | ||||
$errors = $this->errors; | $errors = $this->errors; | ||||
if ($errors) { | if (count($errors) > 1) { | ||||
$list = array(); | $list = array(); | ||||
foreach ($errors as $error) { | foreach ($errors as $error) { | ||||
$list[] = phutil_tag( | $list[] = phutil_tag( | ||||
'li', | 'li', | ||||
array(), | array(), | ||||
$error); | $error); | ||||
} | } | ||||
$list = phutil_tag( | $list = phutil_tag( | ||||
'ul', | 'ul', | ||||
array( | array( | ||||
'class' => 'phui-info-view-list', | 'class' => 'phui-info-view-list', | ||||
), | ), | ||||
$list); | $list); | ||||
} else if (count($errors) == 1) { | |||||
$list = $this->errors[0]; | |||||
} else { | } else { | ||||
$list = null; | $list = null; | ||||
} | } | ||||
$title = $this->title; | $title = $this->title; | ||||
if (strlen($title)) { | if (strlen($title)) { | ||||
$title = phutil_tag( | $title = phutil_tag( | ||||
'h1', | 'h1', | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |