Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97258946
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
Fri, Jan 3, 20:46
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 5, 20:46 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23367282
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