AddToGoogle.php in Open Social 10.3.x
Same filename and directory in other branches
- 8.9 modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToGoogle.php
- 10.0.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToGoogle.php
- 10.1.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToGoogle.php
- 10.2.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToGoogle.php
File
modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToGoogle.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 Google calendar plugin.
*
* @SocialAddToCalendar(
* id = "google",
* label = @Translation("Google"),
* url = "http://www.google.com/calendar/event"
* )
*/
class AddToGoogle extends SocialAddToCalendarBase {
/**
* {@inheritdoc}
*/
public function generateUrl(NodeInterface $node) {
$settings = $this
->generateSettings($node);
$options = [
'query' => [
'action' => 'TEMPLATE',
'text' => $settings['title'],
'dates' => $settings['dates']['both'],
'ctz' => $settings['timezone'],
'details' => $settings['description'],
'location' => $settings['location'],
],
'attributes' => [
'target' => '_blank',
],
];
return Url::fromUri($this->pluginDefinition['url'], $options);
}
}
Classes
Name | Description |
---|---|
AddToGoogle | Provides add to Google calendar plugin. |