-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(embed): LibCal playing - without pagination
- Loading branch information
1 parent
ea71043
commit 5f663b7
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...ofiles/custom/yalesites_profile/modules/custom/ys_embed/src/Plugin/EmbedSource/LibCal.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Drupal\ys_embed\Plugin\EmbedSource; | ||
|
||
use Drupal\ys_embed\Plugin\EmbedSourceBase; | ||
use Drupal\ys_embed\Plugin\EmbedSourceInterface; | ||
|
||
/** | ||
* Instagram post embed source. | ||
* | ||
* @EmbedSource( | ||
* id = "libcal", | ||
* label = @Translation("LibCal"), | ||
* description = @Translation("LibCal embed source."), | ||
* thumbnail = "", | ||
* active = TRUE, | ||
* ) | ||
*/ | ||
class LibCal extends EmbedSourceBase implements EmbedSourceInterface { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected static $pattern = '/(?<embed_code>\<div id="([^"]+)"\>\<\/div\>\<script src="https:\/\/schedule\.yale\.edu\/.*<\/script>)/'; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected static $template = '{{ embed_code|raw }}'; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected static $instructions = 'Find the embed code for an LibCal listing'; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected static $example = '<div id="api_hours_today_iid457_lid4211"></div><script src="https://schedule.yale.edu/api_hours_today.php?iid=457&lid=4211&format=js&systemTime=0&context=object"> </script>'; | ||
|
||
} |