Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99375930
PhabricatorProjectListView.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, Jan 24, 00:04
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 26, 00:04 (2 d)
Engine
blob
Format
Raw Data
Handle
23786713
Attached To
rPH Phabricator
PhabricatorProjectListView.php
View Options
<?php
final
class
PhabricatorProjectListView
extends
AphrontView
{
private
$projects
;
public
function
setProjects
(
array
$projects
)
{
$this
->
projects
=
$projects
;
return
$this
;
}
public
function
getProjects
()
{
return
$this
->
projects
;
}
public
function
renderList
()
{
$viewer
=
$this
->
getUser
();
$projects
=
$this
->
getProjects
();
$handles
=
$viewer
->
loadHandles
(
mpull
(
$projects
,
'getPHID'
));
$list
=
id
(
new
PHUIObjectItemListView
())
->
setUser
(
$viewer
);
foreach
(
$projects
as
$key
=>
$project
)
{
$id
=
$project
->
getID
();
$icon
=
$project
->
getDisplayIconIcon
();
$color
=
$project
->
getColor
();
$icon_icon
=
id
(
new
PHUIIconView
())
->
setIconFont
(
"{$icon} {$color}"
);
$icon_name
=
$project
->
getDisplayIconName
();
$item
=
id
(
new
PHUIObjectItemView
())
->
setHeader
(
$project
->
getName
())
->
setHref
(
"/project/view/{$id}/"
)
->
setImageURI
(
$project
->
getProfileImageURI
())
->
addAttribute
(
array
(
$icon_icon
,
' '
,
$icon_name
,
));
if
(
$project
->
getStatus
()
==
PhabricatorProjectStatus
::
STATUS_ARCHIVED
)
{
$item
->
addIcon
(
'delete-grey'
,
pht
(
'Archived'
));
$item
->
setDisabled
(
true
);
}
$list
->
addItem
(
$item
);
}
return
$list
;
}
public
function
render
()
{
return
$this
->
renderList
();
}
}
Event Timeline
Log In to Comment