Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120132761
PhabricatorDashboardTextPanelType.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, Jul 2, 04:11
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jul 4, 04:11 (2 d)
Engine
blob
Format
Raw Data
Handle
27145271
Attached To
rPH Phabricator
PhabricatorDashboardTextPanelType.php
View Options
<?php
final
class
PhabricatorDashboardTextPanelType
extends
PhabricatorDashboardPanelType
{
public
function
getPanelTypeKey
()
{
return
'text'
;
}
public
function
getPanelTypeName
()
{
return
pht
(
'Text Panel'
);
}
public
function
getPanelTypeDescription
()
{
return
pht
(
'Add some static text to the dashboard. This can be used to '
.
'provide instructions or context.'
);
}
public
function
getFieldSpecifications
()
{
return
array
(
'text'
=>
array
(
'name'
=>
pht
(
'Text'
),
'type'
=>
'remarkup'
,
),
);
}
public
function
shouldRenderAsync
()
{
// Rendering text panels is normally a cheap cache hit.
return
false
;
}
public
function
renderPanelContent
(
PhabricatorUser
$viewer
,
PhabricatorDashboardPanel
$panel
,
PhabricatorDashboardPanelRenderingEngine
$engine
)
{
$text
=
$panel
->
getProperty
(
'text'
,
''
);
$text_content
=
PhabricatorMarkupEngine
::
renderOneObject
(
id
(
new
PhabricatorMarkupOneOff
())->
setContent
(
$text
),
'default'
,
$viewer
);
return
id
(
new
PHUIPropertyListView
())
->
addTextContent
(
$text_content
);
}
}
Event Timeline
Log In to Comment