Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93027773
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, Nov 25, 16:09
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Nov 27, 16:09 (2 d)
Engine
blob
Format
Raw Data
Handle
22561133
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
())
{
id
(
new
PhabricatorOwnersPackageEditor
())
->
setActor
(
$user
)
->
setPackage
(
$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
(
pht
(
'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