Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103033070
PhabricatorEditEngineConfigurationSaveController.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
Wed, Feb 26, 17:14
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Feb 28, 17:14 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
24482169
Attached To
rPH Phabricator
PhabricatorEditEngineConfigurationSaveController.php
View Options
<?php
final
class
PhabricatorEditEngineConfigurationSaveController
extends
PhabricatorEditEngineController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$engine_key
=
$request
->
getURIData
(
'engineKey'
);
$this
->
setEngineKey
(
$engine_key
);
$key
=
$request
->
getURIData
(
'key'
);
$viewer
=
$this
->
getViewer
();
$config
=
id
(
new
PhabricatorEditEngineConfigurationQuery
())
->
setViewer
(
$viewer
)
->
withEngineKeys
(
array
(
$engine_key
))
->
withIdentifiers
(
array
(
$key
))
->
executeOne
();
if
(!
$config
)
{
return
id
(
new
Aphront404Response
());
}
$view_uri
=
$config
->
getURI
();
if
(
$config
->
getID
())
{
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'Already Editable'
))
->
appendParagraph
(
pht
(
'This form configuration is already editable.'
))
->
addCancelButton
(
$view_uri
);
}
if
(
$request
->
isFormPost
())
{
$editor
=
id
(
new
PhabricatorEditEngineConfigurationEditor
())
->
setActor
(
$viewer
)
->
setContentSourceFromRequest
(
$request
)
->
setContinueOnNoEffect
(
true
);
$editor
->
applyTransactions
(
$config
,
array
());
return
id
(
new
AphrontRedirectResponse
())
->
setURI
(
$config
->
getURI
());
}
// TODO: Explain what this means in more detail once the implications are
// more clear, or just link to some docs or something.
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'Make Builtin Editable'
))
->
appendParagraph
(
pht
(
'Make this builtin form editable?'
))
->
addSubmitButton
(
pht
(
'Make Editable'
))
->
addCancelButton
(
$view_uri
);
}
}
Event Timeline
Log In to Comment