Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98058730
PhabricatorDashboardPanelEditEngine.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, Jan 9, 04:15
Size
2 KB
Mime Type
text/x-php
Expires
Sat, Jan 11, 04:15 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23490855
Attached To
rPH Phabricator
PhabricatorDashboardPanelEditEngine.php
View Options
<?php
final
class
PhabricatorDashboardPanelEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'dashboard.panel'
;
private
$panelType
;
public
function
setPanelType
(
$panel_type
)
{
$this
->
panelType
=
$panel_type
;
return
$this
;
}
public
function
getPanelType
()
{
return
$this
->
panelType
;
}
public
function
isEngineConfigurable
()
{
return
false
;
}
public
function
getEngineName
()
{
return
pht
(
'Dashboard Panels'
);
}
public
function
getSummaryHeader
()
{
return
pht
(
'Edit Dashboard Panels'
);
}
public
function
getSummaryText
()
{
return
pht
(
'This engine is used to modify dashboard panels.'
);
}
public
function
getEngineApplicationClass
()
{
return
'PhabricatorSearchApplication'
;
}
protected
function
newEditableObject
()
{
$viewer
=
$this
->
getViewer
();
$panel
=
PhabricatorDashboardPanel
::
initializeNewPanel
(
$viewer
);
if
(
$this
->
panelType
)
{
$panel
->
setPanelType
(
$this
->
panelType
);
}
return
$panel
;
}
protected
function
newObjectQuery
()
{
return
new
PhabricatorDashboardPanelQuery
();
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create Dashboard Panel'
);
}
protected
function
getObjectCreateButtonText
(
$object
)
{
return
pht
(
'Create Panel'
);
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Panel: %s'
,
$object
->
getName
());
}
protected
function
getObjectEditShortText
(
$object
)
{
return
pht
(
'Edit Panel'
);
}
protected
function
getObjectCreateShortText
()
{
return
pht
(
'Edit Panel'
);
}
protected
function
getObjectName
()
{
return
pht
(
'Dashboard Panel'
);
}
protected
function
getObjectViewURI
(
$object
)
{
return
$object
->
getURI
();
}
protected
function
buildCustomEditFields
(
$object
)
{
return
array
(
id
(
new
PhabricatorTextEditField
())
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
))
->
setDescription
(
pht
(
'Name of the panel.'
))
->
setConduitDescription
(
pht
(
'Rename the panel.'
))
->
setConduitTypeDescription
(
pht
(
'New panel name.'
))
->
setTransactionType
(
PhabricatorDashboardPanelTransaction
::
TYPE_NAME
)
->
setIsRequired
(
true
)
->
setValue
(
$object
->
getName
()),
);
}
}
Event Timeline
Log In to Comment