class Yahoo in Add to Cal 8
Provides generic calendar type (ics).
Plugin annotation
@AddToCalType(
id = "yahoo",
label = @Translation("Yahoo Calendar"),
description = @Translation("Yahoo calendar type.")
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\addtocal\AddToCalTypeBase implements AddToCalTypeInterface
- class \Drupal\addtocal\Plugin\AddToCal\Type\Yahoo
- class \Drupal\addtocal\AddToCalTypeBase implements AddToCalTypeInterface
Expanded class hierarchy of Yahoo
File
- src/
Plugin/ AddToCal/ Type/ Yahoo.php, line 20
Namespace
Drupal\addtocal\Plugin\AddToCal\TypeView source
class Yahoo extends AddToCalTypeBase {
/**
* Generates a Yahoo! calendar link
*
* @param array $info
* @return \Drupal\Core\Url
*/
public function generateStructure(array $info) {
$url = Url::fromUri('http://calendar.yahoo.com/', [
'query' => [
'v' => 60,
'TITLE' => $info['title'],
'ST' => $info['rfc3339']['start'],
'ET' => $info['rfc3339']['end'],
'URL' => $_SERVER['HTTP_HOST'],
'in_loc' => $info['location'],
'desc' => $info['description'],
],
]);
return $url;
}
/**
* @inheritdoc
*/
public function downloadSubmit(EntityInterface $entity, array $settings, $delta, FormStateInterface $form_state) {
$eventDetails = $this
->extractEventDetails($entity, $settings, $delta);
/** @var Url $url */
$url = $this
->generateStructure($eventDetails);
// External URLS require to be a trusted response
$response = new TrustedRedirectResponse($url
->toString());
$form_state
->setResponse($response);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AddToCalTypeBase:: |
protected | property | The date formatter service. | |
AddToCalTypeBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
1 |
AddToCalTypeBase:: |
constant | |||
AddToCalTypeBase:: |
protected | function | ||
AddToCalTypeBase:: |
protected | function | ||
AddToCalTypeBase:: |
public | function |
Return the name of the type plugin. Overrides AddToCalTypeInterface:: |
|
AddToCalTypeBase:: |
constant | |||
AddToCalTypeBase:: |
protected | function | Returns an array containing RFC 3339 formatted start and end dates. | |
AddToCalTypeBase:: |
public | function |
Constructs a AddToCalPluginBase object. Overrides PluginBase:: |
1 |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
Yahoo:: |
public | function |
@inheritdoc Overrides AddToCalTypeInterface:: |
|
Yahoo:: |
public | function |
Generates a Yahoo! calendar link Overrides AddToCalTypeInterface:: |