Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F108615391
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
Thu, Apr 17, 16:18
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Apr 19, 16:18 (7 h, 27 m)
Engine
blob
Format
Raw Data
Handle
25630230
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/'
);
}
$dialog
=
id
(
new
AphrontDialogView
())
->
setUser
(
$user
)
->
setTitle
(
'Really delete this package?'
)
->
appendChild
(
hsprintf
(
'<p>Are you sure you want to delete the "%s" package? This operation '
.
'can not be undone.</p>'
,
$package
->
getName
()))
->
addSubmitButton
(
'Delete'
)
->
addCancelButton
(
'/owners/package/'
.
$package
->
getID
().
'/'
)
->
setSubmitURI
(
$request
->
getRequestURI
());
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
}
Event Timeline
Log In to Comment