Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2343677
PHUIFormBoxView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PHUIFormBoxView.php
View Options
<?php
final
class
PHUIFormBoxView
extends
AphrontView
{
private
$headerText
;
private
$formError
=
null
;
private
$form
;
private
$validationException
;
public
function
setHeaderText
(
$text
)
{
$this
->
headerText
=
$text
;
return
$this
;
}
public
function
setFormError
(
$error
)
{
$this
->
formError
=
$error
;
return
$this
;
}
public
function
setForm
(
$form
)
{
$this
->
form
=
$form
;
return
$this
;
}
public
function
setValidationException
(
PhabricatorApplicationTransactionValidationException
$ex
=
null
)
{
$this
->
validationException
=
$ex
;
return
$this
;
}
public
function
render
()
{
$header
=
id
(
new
PhabricatorActionHeaderView
())
->
setHeaderTitle
(
$this
->
headerText
)
->
setHeaderColor
(
PhabricatorActionHeaderView
::
HEADER_LIGHTBLUE
);
$ex
=
$this
->
validationException
;
$exception_errors
=
null
;
if
(
$ex
)
{
$messages
=
array
();
foreach
(
$ex
->
getErrors
()
as
$error
)
{
$messages
[]
=
$error
->
getMessage
();
}
if
(
$messages
)
{
$exception_errors
=
id
(
new
AphrontErrorView
())
->
setErrors
(
$messages
);
}
}
$content
=
id
(
new
PHUIBoxView
())
->
appendChild
(
array
(
$header
,
$this
->
formError
,
$exception_errors
,
$this
->
form
,
))
->
setBorder
(
true
)
->
addMargin
(
PHUI
::
MARGIN_LARGE_TOP
)
->
addMargin
(
PHUI
::
MARGIN_LARGE_LEFT
)
->
addMargin
(
PHUI
::
MARGIN_LARGE_RIGHT
)
->
addClass
(
'phui-form-box'
);
return
$content
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 16, 10:00 AM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
443869
Default Alt Text
PHUIFormBoxView.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment