Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80115141
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
Thu, Aug 29, 23:25
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Aug 31, 23:25 (2 d)
Engine
blob
Format
Raw Data
Handle
20298262
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