Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F552347
HeraldWebhookEditEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
HeraldWebhookEditEngine.php
View Options
<?php
final
class
HeraldWebhookEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'herald.webhook'
;
public
function
isEngineConfigurable
()
{
return
false
;
}
public
function
getEngineName
()
{
return
pht
(
'Webhooks'
);
}
public
function
getSummaryHeader
()
{
return
pht
(
'Edit Webhook Configurations'
);
}
public
function
getSummaryText
()
{
return
pht
(
'This engine is used to edit webhooks.'
);
}
public
function
getEngineApplicationClass
()
{
return
PhabricatorHeraldApplication
::
class
;
}
protected
function
newEditableObject
()
{
$viewer
=
$this
->
getViewer
();
return
HeraldWebhook
::
initializeNewWebhook
(
$viewer
);
}
protected
function
newObjectQuery
()
{
return
new
HeraldWebhookQuery
();
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create Webhook'
);
}
protected
function
getObjectCreateButtonText
(
$object
)
{
return
pht
(
'Create Webhook'
);
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Webhook: %s'
,
$object
->
getName
());
}
protected
function
getObjectEditShortText
(
$object
)
{
return
pht
(
'Edit Webhook'
);
}
protected
function
getObjectCreateShortText
()
{
return
pht
(
'Create Webhook'
);
}
protected
function
getObjectName
()
{
return
pht
(
'Webhook'
);
}
protected
function
getEditorURI
()
{
return
'/herald/webhook/edit/'
;
}
protected
function
getObjectCreateCancelURI
(
$object
)
{
return
'/herald/webhook/'
;
}
protected
function
getObjectViewURI
(
$object
)
{
return
$object
->
getURI
();
}
protected
function
getCreateNewObjectPolicy
()
{
return
$this
->
getApplication
()->
getPolicy
(
HeraldCreateWebhooksCapability
::
CAPABILITY
);
}
protected
function
buildCustomEditFields
(
$object
)
{
return
array
(
id
(
new
PhabricatorTextEditField
())
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
))
->
setDescription
(
pht
(
'Name of the webhook.'
))
->
setTransactionType
(
HeraldWebhookNameTransaction
::
TRANSACTIONTYPE
)
->
setIsRequired
(
true
)
->
setValue
(
$object
->
getName
()),
id
(
new
PhabricatorTextEditField
())
->
setKey
(
'uri'
)
->
setLabel
(
pht
(
'URI'
))
->
setDescription
(
pht
(
'URI for the webhook.'
))
->
setTransactionType
(
HeraldWebhookURITransaction
::
TRANSACTIONTYPE
)
->
setIsRequired
(
true
)
->
setValue
(
$object
->
getWebhookURI
()),
id
(
new
PhabricatorSelectEditField
())
->
setKey
(
'status'
)
->
setLabel
(
pht
(
'Status'
))
->
setDescription
(
pht
(
'Status mode for the webhook.'
))
->
setTransactionType
(
HeraldWebhookStatusTransaction
::
TRANSACTIONTYPE
)
->
setOptions
(
HeraldWebhook
::
getStatusDisplayNameMap
())
->
setValue
(
$object
->
getStatus
()),
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 4:19 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
123489
Default Alt Text
HeraldWebhookEditEngine.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment