Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101308558
ManiphestController.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, Feb 7, 16:01
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 9, 16:01 (2 d)
Engine
blob
Format
Raw Data
Handle
24132054
Attached To
rPH Phabricator
ManiphestController.php
View Options
<?php
abstract
class
ManiphestController
extends
PhabricatorController
{
public
function
buildApplicationMenu
()
{
return
$this
->
buildSideNavView
(
true
)->
getMenu
();
}
public
function
buildSideNavView
(
$for_app
=
false
)
{
$user
=
$this
->
getRequest
()->
getUser
();
$nav
=
new
AphrontSideNavFilterView
();
$nav
->
setBaseURI
(
new
PhutilURI
(
$this
->
getApplicationURI
()));
if
(
$for_app
)
{
$nav
->
addFilter
(
'create'
,
pht
(
'Create Task'
));
}
id
(
new
ManiphestTaskSearchEngine
())
->
setViewer
(
$user
)
->
addNavigationItems
(
$nav
->
getMenu
());
if
(
$user
->
isLoggedIn
())
{
// For now, don't give logged-out users access to reports.
$nav
->
addLabel
(
pht
(
'Reports'
));
$nav
->
addFilter
(
'report'
,
pht
(
'Reports'
));
}
$nav
->
selectFilter
(
null
);
return
$nav
;
}
protected
function
buildApplicationCrumbs
()
{
$crumbs
=
parent
::
buildApplicationCrumbs
();
$crumbs
->
addAction
(
id
(
new
PHUIListItemView
())
->
setName
(
pht
(
'Create Task'
))
->
setHref
(
$this
->
getApplicationURI
(
'task/create/'
))
->
setIcon
(
'fa-plus-square'
));
return
$crumbs
;
}
protected
function
renderSingleTask
(
ManiphestTask
$task
)
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$phids
=
$task
->
getProjectPHIDs
();
if
(
$task
->
getOwnerPHID
())
{
$phids
[]
=
$task
->
getOwnerPHID
();
}
$handles
=
id
(
new
PhabricatorHandleQuery
())
->
setViewer
(
$user
)
->
withPHIDs
(
$phids
)
->
execute
();
$view
=
id
(
new
ManiphestTaskListView
())
->
setUser
(
$user
)
->
setShowSubpriorityControls
(!
$request
->
getStr
(
'ungrippable'
))
->
setShowBatchControls
(
true
)
->
setHandles
(
$handles
)
->
setTasks
(
array
(
$task
));
return
$view
;
}
}
Event Timeline
Log In to Comment