Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78078332
AlmanacServiceEditEngine.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
Sun, Aug 18, 07:19
Size
2 KB
Mime Type
text/x-php
Expires
Tue, Aug 20, 07:19 (2 d)
Engine
blob
Format
Raw Data
Handle
19978221
Attached To
rPH Phabricator
AlmanacServiceEditEngine.php
View Options
<?php
final
class
AlmanacServiceEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'almanac.service'
;
private
$serviceType
;
public
function
setServiceType
(
$service_type
)
{
$this
->
serviceType
=
$service_type
;
return
$this
;
}
public
function
getServiceType
()
{
return
$this
->
serviceType
;
}
public
function
isEngineConfigurable
()
{
return
false
;
}
public
function
getEngineName
()
{
return
pht
(
'Almanac Services'
);
}
public
function
getSummaryHeader
()
{
return
pht
(
'Edit Almanac Service Configurations'
);
}
public
function
getSummaryText
()
{
return
pht
(
'This engine is used to edit Almanac services.'
);
}
public
function
getEngineApplicationClass
()
{
return
'PhabricatorAlmanacApplication'
;
}
protected
function
newEditableObject
()
{
$service_type
=
$this
->
getServiceType
();
return
AlmanacService
::
initializeNewService
(
$service_type
);
}
protected
function
newObjectQuery
()
{
return
new
AlmanacServiceQuery
();
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create Service'
);
}
protected
function
getObjectCreateButtonText
(
$object
)
{
return
pht
(
'Create Service'
);
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Service: %s'
,
$object
->
getName
());
}
protected
function
getObjectEditShortText
(
$object
)
{
return
pht
(
'Edit Service'
);
}
protected
function
getObjectCreateShortText
()
{
return
pht
(
'Create Service'
);
}
protected
function
getObjectName
()
{
return
pht
(
'Service'
);
}
protected
function
getEditorURI
()
{
return
'/almanac/service/edit/'
;
}
protected
function
getObjectCreateCancelURI
(
$object
)
{
return
'/almanac/service/'
;
}
protected
function
getObjectViewURI
(
$object
)
{
return
$object
->
getURI
();
}
protected
function
getCreateNewObjectPolicy
()
{
return
$this
->
getApplication
()->
getPolicy
(
AlmanacCreateServicesCapability
::
CAPABILITY
);
}
protected
function
buildCustomEditFields
(
$object
)
{
return
array
(
id
(
new
PhabricatorTextEditField
())
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
))
->
setDescription
(
pht
(
'Name of the service.'
))
->
setTransactionType
(
AlmanacServiceTransaction
::
TYPE_NAME
)
->
setIsRequired
(
true
)
->
setValue
(
$object
->
getName
()),
);
}
}
Event Timeline
Log In to Comment