Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93513676
PhabricatorProjectCardView.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
Fri, Nov 29, 09:03
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 09:03 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22657799
Attached To
rPH Phabricator
PhabricatorProjectCardView.php
View Options
<?php
final
class
PhabricatorProjectCardView
extends
AphrontTagView
{
private
$project
;
private
$viewer
;
private
$tag
;
public
function
setProject
(
PhabricatorProject
$project
)
{
$this
->
project
=
$project
;
return
$this
;
}
public
function
setViewer
(
PhabricatorUser
$viewer
)
{
$this
->
viewer
=
$viewer
;
return
$this
;
}
public
function
setTag
(
$tag
)
{
$this
->
tag
=
$tag
;
return
$this
;
}
protected
function
getTagName
()
{
if
(
$this
->
tag
)
{
return
$this
->
tag
;
}
return
'div'
;
}
protected
function
getTagAttributes
()
{
$classes
=
array
();
$classes
[]
=
'project-card-view'
;
$color
=
$this
->
project
->
getColor
();
$classes
[]
=
'project-card-'
.
$color
;
return
array
(
'class'
=>
implode
(
$classes
,
' '
),
);
}
protected
function
getTagContent
()
{
$project
=
$this
->
project
;
$viewer
=
$this
->
viewer
;
require_celerity_resource
(
'project-card-view-css'
);
$icon
=
$project
->
getDisplayIconIcon
();
$icon_name
=
$project
->
getDisplayIconName
();
$tag
=
id
(
new
PHUITagView
())
->
setIcon
(
$icon
)
->
setName
(
$icon_name
)
->
addClass
(
'project-view-header-tag'
)
->
setType
(
PHUITagView
::
TYPE_SHADE
);
$header
=
id
(
new
PHUIHeaderView
())
->
setHeader
(
array
(
$project
->
getDisplayName
(),
$tag
))
->
setUser
(
$viewer
)
->
setPolicyObject
(
$project
)
->
setImage
(
$project
->
getProfileImageURI
());
if
(
$project
->
getStatus
()
==
PhabricatorProjectStatus
::
STATUS_ACTIVE
)
{
$header
->
setStatus
(
'fa-check'
,
'bluegrey'
,
pht
(
'Active'
));
}
else
{
$header
->
setStatus
(
'fa-ban'
,
'red'
,
pht
(
'Archived'
));
}
$description
=
null
;
$card
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'project-card-inner'
,
),
array
(
$header
,
$description
,
));
return
$card
;
}
}
Event Timeline
Log In to Comment