Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3295516
PhragmentSnapshotDeleteController.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
PhragmentSnapshotDeleteController.php
View Options
<?php
final
class
PhragmentSnapshotDeleteController
extends
PhragmentController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
$data
[
'id'
]
;
}
public
function
processRequest
(
)
{
$request
=
$this
->
getRequest
(
)
;
$viewer
=
$request
->
getUser
(
)
;
$snapshot
=
id
(
new
PhragmentSnapshotQuery
(
)
)
->
setViewer
(
$viewer
)
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
)
)
->
withIDs
(
array
(
$this
->
id
)
)
->
executeOne
(
)
;
if
(
$snapshot
===
null
)
{
return
new
Aphront404Response
(
)
;
}
if
(
$request
->
isDialogFormPost
(
)
)
{
$fragment_uri
=
$snapshot
->
getPrimaryFragment
(
)
->
getURI
(
)
;
$snapshot
->
delete
(
)
;
return
id
(
new
AphrontRedirectResponse
(
)
)
->
setURI
(
$fragment_uri
)
;
}
return
$this
->
createDialog
(
)
;
}
function
createDialog
(
)
{
$request
=
$this
->
getRequest
(
)
;
$viewer
=
$request
->
getUser
(
)
;
$dialog
=
id
(
new
AphrontDialogView
(
)
)
->
setTitle
(
pht
(
'Really delete this snapshot?'
)
)
->
setUser
(
$request
->
getUser
(
)
)
->
addSubmitButton
(
pht
(
'Delete'
)
)
->
addCancelButton
(
pht
(
'Cancel'
)
)
->
appendParagraph
(
pht
(
'Deleting this snapshot is a permanent operation. You can not '
.
'recover the state of the snapshot.'
)
)
;
return
id
(
new
AphrontDialogResponse
(
)
)
->
setDialog
(
$dialog
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Mar 27, 02:18 (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1144901
Default Alt Text
PhragmentSnapshotDeleteController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment