Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93766593
AphrontHeadsupView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Dec 1, 08:07
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Dec 3, 08:07 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22701101
Attached To
rPH Phabricator
AphrontHeadsupView.php
View Options
<?php
final
class
AphrontHeadsupView
extends
AphrontView
{
private
$actionList
;
private
$header
;
private
$properties
;
private
$objectName
;
public
function
setActionList
(
AphrontHeadsupActionListView
$action_list
)
{
$this
->
actionList
=
$action_list
;
return
$this
;
}
public
function
setHeader
(
$header
)
{
$this
->
header
=
$header
;
return
$this
;
}
public
function
setProperties
(
array
$dict
)
{
$this
->
properties
=
$dict
;
return
$this
;
}
public
function
setObjectName
(
$name
)
{
$this
->
objectName
=
$name
;
return
$this
;
}
public
function
render
()
{
$header
=
'<h1>'
.
phutil_tag
(
'a'
,
array
(
'href'
=>
'/'
.
$this
->
objectName
,
'class'
=>
'aphront-headsup-object-name'
,
),
$this
->
objectName
).
' '
.
phutil_escape_html
(
$this
->
header
).
'</h1>'
;
require_celerity_resource
(
'aphront-headsup-view-css'
);
$prop_table
=
null
;
if
(
$this
->
properties
)
{
$prop_table
=
array
();
foreach
(
$this
->
properties
as
$key
=>
$value
)
{
$prop_table
[]
=
'<tr>'
.
'<th>'
.
phutil_escape_html
(
$key
.
':'
).
'</th>'
.
'<td>'
.
$value
.
'</td>'
.
'</tr>'
;
}
$prop_table
=
'<table class="aphront-headsup-property-table">'
.
implode
(
"
\n
"
,
$prop_table
).
'</table>'
;
}
$children
=
$this
->
renderChildren
();
if
(
strlen
(
$children
))
{
$children
=
'<div class="aphront-headsup-details">'
.
$children
.
'</div>'
;
}
return
'<div class="aphront-headsup-panel">'
.
self
::
renderSingleView
(
$this
->
actionList
).
'<div class="aphront-headsup-core">'
.
$header
.
$prop_table
.
$children
.
'</div>'
.
'</div>'
;
}
}
Event Timeline
Log In to Comment