Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106523829
PhabricatorDashboardPanelRenderingEngine.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
Wed, Mar 26, 19:22
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Mar 28, 19:22 (2 d)
Engine
blob
Format
Raw Data
Handle
25208410
Attached To
rPH Phabricator
PhabricatorDashboardPanelRenderingEngine.php
View Options
<?php
final
class
PhabricatorDashboardPanelRenderingEngine
extends
Phobject
{
private
$panel
;
private
$viewer
;
public
function
setViewer
(
PhabricatorUser
$viewer
)
{
$this
->
viewer
=
$viewer
;
return
$this
;
}
public
function
setPanel
(
PhabricatorDashboardPanel
$panel
)
{
$this
->
panel
=
$panel
;
return
$this
;
}
public
function
renderPanel
()
{
$panel
=
$this
->
panel
;
$viewer
=
$this
->
viewer
;
if
(!
$panel
)
{
return
$this
->
renderErrorPanel
(
pht
(
'Missing Panel'
),
pht
(
'This panel does not exist.'
));
}
$panel_type
=
$panel
->
getImplementation
();
if
(!
$panel_type
)
{
return
$this
->
renderErrorPanel
(
$panel
->
getName
(),
pht
(
'This panel has type "%s", but that panel type is not known to '
.
'Phabricator.'
,
$panel
->
getPanelType
()));
}
return
$panel_type
->
renderPanel
(
$viewer
,
$panel
);
}
private
function
renderErrorPanel
(
$title
,
$body
)
{
return
id
(
new
PHUIObjectBoxView
())
->
setHeaderText
(
$title
)
->
setFormErrors
(
array
(
$body
));
}
}
Event Timeline
Log In to Comment