AddToOutlook.php in Open Social 10.2.x
Same filename and directory in other branches
- 8.9 modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToOutlook.php
- 10.3.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToOutlook.php
- 10.0.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToOutlook.php
- 10.1.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToOutlook.php
File
modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToOutlook.phpView source
<?php
namespace Drupal\social_event_addtocal\Plugin\SocialAddToCalendar;
use Drupal\Core\Url;
use Drupal\node\NodeInterface;
use Drupal\social_event_addtocal\Plugin\SocialAddToCalendarBase;
/**
* Provides add to Outlook calendar plugin.
*
* @SocialAddToCalendar(
* id = "outlook",
* label = @Translation("Outlook"),
* url = "https://outlook.live.com/calendar/0/deeplink/compose",
* allDayFormat = "Y-m-d",
* dateFormat = "Y-m-d\TH:i:s",
* utcDateFormat = "Y-m-d\TH:i:s\Z"
* )
*/
class AddToOutlook extends SocialAddToCalendarBase {
/**
* {@inheritdoc}
*/
public function generateUrl(NodeInterface $node) {
$settings = $this
->generateSettings($node);
$options = [
'query' => [
'path' => '/calendar/action/compose',
'rru' => 'addevent',
'subject' => $settings['title'],
'startdt' => $settings['dates']['start'],
'enddt' => $settings['dates']['end'],
'allday' => $settings['dates']['all_day'] ? 'true' : 'false',
'location' => $settings['location'],
],
'attributes' => [
'target' => '_blank',
],
];
return Url::fromUri($this->pluginDefinition['url'], $options);
}
}
Classes
Name | Description |
---|---|
AddToOutlook | Provides add to Outlook calendar plugin. |