Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99635624
PhabricatorCalendarController.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
Sat, Jan 25, 21:57
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jan 27, 21:57 (2 d)
Engine
blob
Format
Raw Data
Handle
23836504
Attached To
rPH Phabricator
PhabricatorCalendarController.php
View Options
<?php
abstract
class
PhabricatorCalendarController
extends
PhabricatorController
{
protected
function
newICSResponse
(
PhabricatorUser
$viewer
,
$file_name
,
array
$events
)
{
$ics_data
=
id
(
new
PhabricatorCalendarICSWriter
())
->
setViewer
(
$viewer
)
->
setEvents
(
$events
)
->
writeICSDocument
();
return
id
(
new
AphrontFileResponse
())
->
setDownload
(
$file_name
)
->
setMimeType
(
'text/calendar'
)
->
setContent
(
$ics_data
);
}
protected
function
newImportedEventResponse
(
PhabricatorCalendarEvent
$event
)
{
if
(!
$event
->
isImportedEvent
())
{
return
null
;
}
// Give the user a specific, detailed message if they try to edit an
// imported event via common web paths. Other edits (including those via
// the API) are blocked by the normal policy system, but this makes it more
// clear exactly why the event can't be edited.
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'Can Not Edit Imported Event'
))
->
appendParagraph
(
pht
(
'This event has been imported from an external source and '
.
'can not be edited.'
))
->
addCancelButton
(
$event
->
getURI
(),
pht
(
'Done'
));
}
}
Event Timeline
Log In to Comment