Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96183052
PhabricatorOwnersDeleteController.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
Mon, Dec 23, 13:28
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 25, 13:28 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23140818
Attached To
rPH Phabricator
PhabricatorOwnersDeleteController.php
View Options
<?php
final
class
PhabricatorOwnersDeleteController
extends
PhabricatorOwnersController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
$data
[
'id'
];
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$package
=
id
(
new
PhabricatorOwnersPackage
())->
load
(
$this
->
id
);
if
(!
$package
)
{
return
new
Aphront404Response
();
}
if
(
$request
->
isDialogFormPost
())
{
$package
->
attachActorPHID
(
$user
->
getPHID
());
$package
->
delete
();
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
'/owners/'
);
}
$text
=
pht
(
'Are you sure you want to delete the "%s" package? This '
.
'operation can not be undone.'
,
$package
->
getName
());
$dialog
=
id
(
new
AphrontDialogView
())
->
setUser
(
$user
)
->
setTitle
(
'Really delete this package?'
)
->
appendChild
(
phutil_tag
(
'p'
,
array
(),
$text
))
->
addSubmitButton
(
pht
(
'Delete'
))
->
addCancelButton
(
'/owners/package/'
.
$package
->
getID
().
'/'
)
->
setSubmitURI
(
$request
->
getRequestURI
());
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
}
Event Timeline
Log In to Comment