Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104850771
PhabricatorCalendarImportReloadController.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
Wed, Mar 12, 21:31
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Mar 14, 21:31 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24866458
Attached To
rPH Phabricator
PhabricatorCalendarImportReloadController.php
View Options
<?php
final
class
PhabricatorCalendarImportReloadController
extends
PhabricatorCalendarController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
$import
=
id
(
new
PhabricatorCalendarImportQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$request
->
getURIData
(
'id'
)))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
executeOne
();
if
(!
$import
)
{
return
new
Aphront404Response
();
}
$import_uri
=
$import
->
getURI
();
if
(
$request
->
isFormPost
())
{
$xactions
=
array
();
$xactions
[]
=
id
(
new
PhabricatorCalendarImportTransaction
())
->
setTransactionType
(
PhabricatorCalendarImportReloadTransaction
::
TRANSACTIONTYPE
)
->
setNewValue
(
true
);
$editor
=
id
(
new
PhabricatorCalendarImportEditor
())
->
setActor
(
$viewer
)
->
setContinueOnNoEffect
(
true
)
->
setContinueOnMissingFields
(
true
)
->
setContentSourceFromRequest
(
$request
);
$editor
->
applyTransactions
(
$import
,
$xactions
);
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$import_uri
);
}
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'Reload Events'
))
->
appendParagraph
(
pht
(
'Reload this source? Events imported from this source will '
.
'be updated.'
))
->
addCancelButton
(
$import_uri
)
->
addSubmitButton
(
pht
(
'Reload Events'
));
}
}
Event Timeline
Log In to Comment