Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F71201356
PHUIWorkpanelView.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
Wed, Jul 10, 06:34
Size
2 KB
Mime Type
text/x-php
Expires
Fri, Jul 12, 06:34 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
18919929
Attached To
rPH Phabricator
PHUIWorkpanelView.php
View Options
<?php
final
class
PHUIWorkpanelView
extends
AphrontTagView
{
private
$cards
=
array
();
private
$header
;
private
$editURI
;
private
$headerAction
;
private
$footerAction
;
private
$headerColor
=
PHUIActionHeaderView
::
HEADER_GREY
;
public
function
setHeaderAction
(
PHUIIconView
$header_action
)
{
$this
->
headerAction
=
$header_action
;
return
$this
;
}
public
function
setCards
(
PHUIObjectItemListView
$cards
)
{
$this
->
cards
[]
=
$cards
;
return
$this
;
}
public
function
setHeader
(
$header
)
{
$this
->
header
=
$header
;
return
$this
;
}
public
function
setEditURI
(
$edit_uri
)
{
$this
->
editURI
=
$edit_uri
;
return
$this
;
}
public
function
setFooterAction
(
PHUIListItemView
$footer_action
)
{
$this
->
footerAction
=
$footer_action
;
return
$this
;
}
public
function
setHeaderColor
(
$header_color
)
{
$this
->
headerColor
=
$header_color
;
return
$this
;
}
public
function
getTagAttributes
()
{
return
array
(
'class'
=>
'phui-workpanel-view'
,
);
}
public
function
getTagContent
()
{
require_celerity_resource
(
'phui-workpanel-view-css'
);
$classes
=
array
();
$classes
[]
=
'phui-workpanel-view-inner'
;
$footer
=
''
;
if
(
$this
->
footerAction
)
{
$footer_tag
=
$this
->
footerAction
;
$footer
=
phutil_tag
(
'ul'
,
array
(
'class'
=>
'phui-workpanel-footer-action mst ps'
),
$footer_tag
);
}
$header_edit
=
null
;
if
(
$this
->
editURI
)
{
$header_edit
=
id
(
new
PHUIIconView
())
->
setIconFont
(
'fa-pencil'
)
->
setHref
(
$this
->
editURI
);
}
$header
=
id
(
new
PHUIActionHeaderView
())
->
setHeaderTitle
(
$this
->
header
)
->
setHeaderColor
(
$this
->
headerColor
);
if
(
$header_edit
)
{
$header
->
addAction
(
$header_edit
);
}
if
(
$this
->
headerAction
)
{
$header
->
addAction
(
$this
->
headerAction
);
}
$classes
[]
=
'phui-workpanel-'
.
$this
->
headerColor
;
$body
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'phui-workpanel-body'
),
$this
->
cards
);
$view
=
phutil_tag
(
'div'
,
array
(
'class'
=>
implode
(
' '
,
$classes
),
),
array
(
$header
,
$body
,
$footer
,
));
return
$view
;
}
}
Event Timeline
Log In to Comment