Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891410
PhabricatorDashboardEditEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
3 KB
Referenced Files
None
Subscribers
None
PhabricatorDashboardEditEngine.php
View Options
<?php
final
class
PhabricatorDashboardEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'dashboard'
;
public
function
isEngineConfigurable
(
)
{
return
false
;
}
public
function
getEngineName
(
)
{
return
pht
(
'Dashboards'
)
;
}
public
function
getSummaryHeader
(
)
{
return
pht
(
'Edit Dashboards'
)
;
}
public
function
getSummaryText
(
)
{
return
pht
(
'This engine is used to modify dashboards.'
)
;
}
public
function
getEngineApplicationClass
(
)
{
return
PhabricatorDashboardApplication
::
class
;
}
protected
function
newEditableObject
(
)
{
$viewer
=
$this
->
getViewer
(
)
;
return
PhabricatorDashboard
::
initializeNewDashboard
(
$viewer
)
;
}
protected
function
newObjectQuery
(
)
{
return
new
PhabricatorDashboardQuery
(
)
;
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create Dashboard'
)
;
}
protected
function
getObjectCreateButtonText
(
$object
)
{
return
pht
(
'Create Dashboard'
)
;
}
protected
function
getObjectCreateCancelURI
(
$object
)
{
return
'/dashboard/'
;
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Dashboard: %s'
,
$object
->
getName
(
)
)
;
}
protected
function
getObjectEditShortText
(
$object
)
{
return
pht
(
'Edit Dashboard'
)
;
}
protected
function
getObjectCreateShortText
(
)
{
return
pht
(
'Create Dashboard'
)
;
}
protected
function
getObjectName
(
)
{
return
pht
(
'Dashboard'
)
;
}
protected
function
getObjectViewURI
(
$object
)
{
return
$object
->
getURI
(
)
;
}
protected
function
getCreateNewObjectPolicy
(
)
{
return
$this
->
getApplication
(
)
->
getPolicy
(
PhabricatorDashboardCreateCapability
::
CAPABILITY
)
;
}
protected
function
buildCustomEditFields
(
$object
)
{
$layout_options
=
PhabricatorDashboardLayoutMode
::
getLayoutModeMap
(
)
;
$fields
=
array
(
id
(
new
PhabricatorTextEditField
(
)
)
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
)
)
->
setDescription
(
pht
(
'Name of the dashboard.'
)
)
->
setConduitDescription
(
pht
(
'Rename the dashboard.'
)
)
->
setConduitTypeDescription
(
pht
(
'New dashboard name.'
)
)
->
setTransactionType
(
PhabricatorDashboardNameTransaction
::
TRANSACTIONTYPE
)
->
setIsRequired
(
true
)
->
setValue
(
$object
->
getName
(
)
)
,
id
(
new
PhabricatorIconSetEditField
(
)
)
->
setKey
(
'icon'
)
->
setLabel
(
pht
(
'Icon'
)
)
->
setTransactionType
(
PhabricatorDashboardIconTransaction
::
TRANSACTIONTYPE
)
->
setIconSet
(
new
PhabricatorDashboardIconSet
(
)
)
->
setDescription
(
pht
(
'Dashboard icon.'
)
)
->
setConduitDescription
(
pht
(
'Change the dashboard icon.'
)
)
->
setConduitTypeDescription
(
pht
(
'New dashboard icon.'
)
)
->
setValue
(
$object
->
getIcon
(
)
)
,
id
(
new
PhabricatorSelectEditField
(
)
)
->
setKey
(
'layout'
)
->
setLabel
(
pht
(
'Layout'
)
)
->
setDescription
(
pht
(
'Dashboard layout mode.'
)
)
->
setConduitDescription
(
pht
(
'Change the dashboard layout mode.'
)
)
->
setConduitTypeDescription
(
pht
(
'New dashboard layout mode.'
)
)
->
setTransactionType
(
PhabricatorDashboardLayoutTransaction
::
TRANSACTIONTYPE
)
->
setOptions
(
$layout_options
)
->
setValue
(
$object
->
getRawLayoutMode
(
)
)
,
)
;
return
$fields
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 15:10 (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125830
Default Alt Text
PhabricatorDashboardEditEngine.php (3 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment