You are here

class AddToYahoo in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToYahoo.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToYahoo
  2. 10.0.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToYahoo.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToYahoo
  3. 10.1.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToYahoo.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToYahoo
  4. 10.2.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToYahoo.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToYahoo

Provides add to Yahoo calendar plugin.

Plugin annotation


@SocialAddToCalendar(
  id = "yahoo",
  label = @Translation("Yahoo"),
  url = "http://calendar.yahoo.com"
)

Hierarchy

Expanded class hierarchy of AddToYahoo

File

modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToYahoo.php, line 18

Namespace

Drupal\social_event_addtocal\Plugin\SocialAddToCalendar
View source
class AddToYahoo extends SocialAddToCalendarBase {

  /**
   * {@inheritdoc}
   */
  public function generateUrl(NodeInterface $node) {
    $settings = $this
      ->generateSettings($node);
    $options = [
      'query' => [
        'v' => 60,
        'TITLE' => $settings['title'],
        'ST' => $settings['dates']['start'],
        'ET' => $settings['dates']['end'],
        'desc' => $settings['description'],
        'in_loc' => $settings['location'],
      ],
      'attributes' => [
        'target' => '_blank',
      ],
    ];
    return Url::fromUri($this->pluginDefinition['url'], $options);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AddToYahoo::generateUrl public function Returns the 'Add to calendar' link. Overrides SocialAddToCalendarBase::generateUrl
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 2
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. 98
SocialAddToCalendarBase::generateSettings public function Returns array of event settings for url options. Overrides SocialAddToCalendarInterface::generateSettings
SocialAddToCalendarBase::getEventDates public function Returns array of event dates for calendar. Overrides SocialAddToCalendarInterface::getEventDates
SocialAddToCalendarBase::getEventDescription public function Returns the event description for calendar. Overrides SocialAddToCalendarInterface::getEventDescription
SocialAddToCalendarBase::getEventLocation public function Returns the event location for calendar. Overrides SocialAddToCalendarInterface::getEventLocation
SocialAddToCalendarBase::getName public function Returns plugin name for label. Overrides SocialAddToCalendarInterface::getName