Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F109673663
PhabricatorEditEngineConfigurationEditEngine.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
Tue, Apr 22, 22:55
Size
2 KB
Mime Type
text/x-php
Expires
Thu, Apr 24, 22:55 (2 d)
Engine
blob
Format
Raw Data
Handle
25747459
Attached To
rPH Phabricator
PhabricatorEditEngineConfigurationEditEngine.php
View Options
<?php
final
class
PhabricatorEditEngineConfigurationEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'transactions.editengine.config'
;
private
$targetEngine
;
public
function
setTargetEngine
(
PhabricatorEditEngine
$target_engine
)
{
$this
->
targetEngine
=
$target_engine
;
return
$this
;
}
public
function
getTargetEngine
()
{
return
$this
->
targetEngine
;
}
public
function
getEngineName
()
{
return
pht
(
'Edit Configurations'
);
}
public
function
getEngineApplicationClass
()
{
return
'PhabricatorTransactionsApplication'
;
}
protected
function
newEditableObject
()
{
return
PhabricatorEditEngineConfiguration
::
initializeNewConfiguration
(
$this
->
getViewer
(),
$this
->
getTargetEngine
());
}
protected
function
newObjectQuery
()
{
return
id
(
new
PhabricatorEditEngineConfigurationQuery
());
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create New Form'
);
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Form %d: %s'
,
$object
->
getID
(),
$object
->
getDisplayName
());
}
protected
function
getObjectEditShortText
(
$object
)
{
return
pht
(
'Form %d'
,
$object
->
getID
());
}
protected
function
getObjectCreateShortText
()
{
return
pht
(
'Create Form'
);
}
protected
function
getObjectViewURI
(
$object
)
{
$id
=
$object
->
getID
();
return
$this
->
getURI
(
"view/{$id}/"
);
}
protected
function
getEditorURI
()
{
return
$this
->
getURI
(
'edit/'
);
}
protected
function
getObjectCreateCancelURI
(
$object
)
{
return
$this
->
getURI
();
}
private
function
getURI
(
$path
=
null
)
{
$engine_key
=
$this
->
getTargetEngine
()->
getEngineKey
();
return
"/transactions/editengine/{$engine_key}/{$path}"
;
}
protected
function
buildCustomEditFields
(
$object
)
{
return
array
(
id
(
new
PhabricatorTextEditField
())
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
))
->
setDescription
(
pht
(
'Name of the form.'
))
->
setTransactionType
(
PhabricatorEditEngineConfigurationTransaction
::
TYPE_NAME
)
->
setValue
(
$object
->
getName
()),
id
(
new
PhabricatorRemarkupEditField
())
->
setKey
(
'preamble'
)
->
setLabel
(
pht
(
'Preamble'
))
->
setDescription
(
pht
(
'Optional instructions, shown above the form.'
))
->
setTransactionType
(
PhabricatorEditEngineConfigurationTransaction
::
TYPE_PREAMBLE
)
->
setValue
(
$object
->
getPreamble
()),
);
}
}
Event Timeline
Log In to Comment