Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F105984778
ReleephProjectListController.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, Mar 21, 07:10
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Mar 23, 07:10 (2 d)
Engine
blob
Format
Raw Data
Handle
25053670
Attached To
rPH Phabricator
ReleephProjectListController.php
View Options
<?php
final
class
ReleephProjectListController
extends
PhabricatorController
{
public
function
processRequest
()
{
$path
=
$this
->
getRequest
()->
getRequestURI
()->
getPath
();
$is_active
=
strpos
(
$path
,
'inactive/'
)
===
false
;
$releeph_projects
=
mfilter
(
id
(
new
ReleephProject
())->
loadAll
(),
'getIsActive'
,
!
$is_active
);
$releeph_projects
=
msort
(
$releeph_projects
,
'getName'
);
$releeph_projects_set
=
new
LiskDAOSet
();
foreach
(
$releeph_projects
as
$releeph_project
)
{
$releeph_projects_set
->
addToSet
(
$releeph_project
);
}
$panel
=
new
AphrontPanelView
();
if
(
$is_active
)
{
$view_inactive_link
=
phutil_tag
(
'a'
,
array
(
'href'
=>
'/releeph/project/inactive/'
,
),
'View inactive projects'
);
$panel
->
setHeader
(
hsprintf
(
'Active Releeph Projects · %s'
,
$view_inactive_link
))
->
appendChild
(
id
(
new
ReleephActiveProjectListView
())
->
setUser
(
$this
->
getRequest
()->
getUser
())
->
setReleephProjects
(
$releeph_projects
));
}
else
{
$view_active_link
=
phutil_tag
(
'a'
,
array
(
'href'
=>
'/releeph/project/'
),
'View active projects'
);
$panel
->
setHeader
(
hsprintf
(
'Inactive Releeph Projects · %s'
,
$view_active_link
))
->
appendChild
(
id
(
new
ReleephInactiveProjectListView
())
->
setUser
(
$this
->
getRequest
()->
getUser
())
->
setReleephProjects
(
$releeph_projects
));
}
if
(
$is_active
)
{
$create_new_project_button
=
phutil_tag
(
'a'
,
array
(
'href'
=>
'/releeph/project/create/'
,
'class'
=>
'green button'
,
),
'Create New Project'
);
$panel
->
addButton
(
$create_new_project_button
);
}
return
$this
->
buildStandardPageResponse
(
$panel
,
array
(
'title'
=>
'List Releeph Projects'
));
}
}
Event Timeline
Log In to Comment