Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96464341
PhabricatorCountdownDeleteController.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, Dec 27, 00:10
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 29, 00:10 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23172499
Attached To
rPH Phabricator
PhabricatorCountdownDeleteController.php
View Options
<?php
final
class
PhabricatorCountdownDeleteController
extends
PhabricatorCountdownController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
$id
=
$request
->
getURIData
(
'id'
);
$countdown
=
id
(
new
PhabricatorCountdownQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
executeOne
();
if
(!
$countdown
)
{
return
new
Aphront404Response
();
}
if
(
$request
->
isFormPost
())
{
$countdown
->
delete
();
return
id
(
new
AphrontRedirectResponse
())
->
setURI
(
'/countdown/'
);
}
$inst
=
pht
(
'Are you sure you want to delete the countdown %s?'
,
$countdown
->
getTitle
());
$dialog
=
new
AphrontDialogView
();
$dialog
->
setUser
(
$request
->
getUser
());
$dialog
->
setTitle
(
pht
(
'Really delete this countdown?'
));
$dialog
->
appendChild
(
phutil_tag
(
'p'
,
array
(),
$inst
));
$dialog
->
addSubmitButton
(
pht
(
'Delete'
));
$dialog
->
addCancelButton
(
'/countdown/'
);
$dialog
->
setSubmitURI
(
$request
->
getPath
());
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
}
Event Timeline
Log In to Comment