Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92987743
PhabricatorDashboardPanelRenderController.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
Mon, Nov 25, 09:41
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Nov 27, 09:41 (2 d)
Engine
blob
Format
Raw Data
Handle
22550459
Attached To
rPH Phabricator
PhabricatorDashboardPanelRenderController.php
View Options
<?php
final
class
PhabricatorDashboardPanelRenderController
extends
PhabricatorDashboardController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
$data
[
'id'
];
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$panel
=
id
(
new
PhabricatorDashboardPanelQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$this
->
id
))
->
executeOne
();
if
(!
$panel
)
{
return
new
Aphront404Response
();
}
if
(
$request
->
isAjax
())
{
$parent_phids
=
$request
->
getStrList
(
'parentPanelPHIDs'
,
null
);
if
(
$parent_phids
===
null
)
{
throw
new
Exception
(
pht
(
'Required parameter `parentPanelPHIDs` is not present in '
.
'request.'
));
}
}
else
{
$parent_phids
=
array
();
}
$rendered_panel
=
id
(
new
PhabricatorDashboardPanelRenderingEngine
())
->
setViewer
(
$viewer
)
->
setPanel
(
$panel
)
->
setParentPanelPHIDs
(
$parent_phids
)
->
setHeaderMode
(
$request
->
getStr
(
'headerMode'
))
->
setDashboardID
(
$request
->
getInt
(
'dashboardID'
))
->
renderPanel
();
if
(
$request
->
isAjax
())
{
return
id
(
new
AphrontAjaxResponse
())
->
setContent
(
array
(
'panelMarkup'
=>
hsprintf
(
'%s'
,
$rendered_panel
),
));
}
$crumbs
=
$this
->
buildApplicationCrumbs
()
->
addTextCrumb
(
pht
(
'Panels'
),
$this
->
getApplicationURI
(
'panel/'
))
->
addTextCrumb
(
$panel
->
getMonogram
(),
'/'
.
$panel
->
getMonogram
())
->
addTextCrumb
(
pht
(
'Standalone View'
));
$view
=
id
(
new
PHUIBoxView
())
->
addClass
(
'dashboard-view'
)
->
appendChild
(
$rendered_panel
);
return
$this
->
buildApplicationPage
(
array
(
$crumbs
,
$view
,
),
array
(
'title'
=>
array
(
pht
(
'Panel'
),
$panel
->
getName
()),
));
}
}
Event Timeline
Log In to Comment