Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F546815
PhabricatorCalendarController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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'
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:22 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
100555
Default Alt Text
PhabricatorCalendarController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment