Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892690
PhabricatorEditEngineConfigurationIsEditController.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
1 KB
Referenced Files
None
Subscribers
None
PhabricatorEditEngineConfigurationIsEditController.php
View Options
<?php
final
class
PhabricatorEditEngineConfigurationIsEditController
extends
PhabricatorEditEngineController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
(
)
;
$config
=
$this
->
loadConfigForEdit
(
)
;
if
(
!
$config
)
{
return
id
(
new
Aphront404Response
(
)
)
;
}
$engine_key
=
$config
->
getEngineKey
(
)
;
$key
=
$config
->
getIdentifier
(
)
;
$cancel_uri
=
"/transactions/editengine/{$engine_key}/view/{$key}/"
;
$type
=
PhabricatorEditEngineIsEditTransaction
::
TRANSACTIONTYPE
;
if
(
$request
->
isFormPost
(
)
)
{
$xactions
=
array
(
)
;
$xactions
[
]
=
id
(
new
PhabricatorEditEngineConfigurationTransaction
(
)
)
->
setTransactionType
(
$type
)
->
setNewValue
(
!
$config
->
getIsEdit
(
)
)
;
$editor
=
id
(
new
PhabricatorEditEngineConfigurationEditor
(
)
)
->
setActor
(
$viewer
)
->
setContentSourceFromRequest
(
$request
)
->
setContinueOnMissingFields
(
true
)
->
setContinueOnNoEffect
(
true
)
;
$editor
->
applyTransactions
(
$config
,
$xactions
)
;
return
id
(
new
AphrontRedirectResponse
(
)
)
->
setURI
(
$cancel_uri
)
;
}
if
(
$config
->
getIsEdit
(
)
)
{
$title
=
pht
(
'Unmark as Edit Form'
)
;
$body
=
pht
(
'Unmark this form as an edit form? It will no longer be able to be '
.
'used to edit objects.'
)
;
$button
=
pht
(
'Unmark Form'
)
;
}
else
{
$title
=
pht
(
'Mark as Edit Form'
)
;
$body
=
pht
(
'Mark this form as an edit form? Users who can view it will be able '
.
'to use it to edit objects.'
)
;
$button
=
pht
(
'Mark Form'
)
;
}
return
$this
->
newDialog
(
)
->
setTitle
(
$title
)
->
appendParagraph
(
$body
)
->
addSubmitButton
(
$button
)
->
addCancelbutton
(
$cancel_uri
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 17:12 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126835
Default Alt Text
PhabricatorEditEngineConfigurationIsEditController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment