public function WebformHelpManager::getVideoLinks in Webform 8.5
Same name and namespace in other branches
- 6.x src/WebformHelpManager.php \Drupal\webform\WebformHelpManager::getVideoLinks()
Get video links.
Parameters
string $id: Video id.
Return value
array An array of links.
Overrides WebformHelpManagerInterface::getVideoLinks
1 call to WebformHelpManager::getVideoLinks()
- WebformHelpManager::buildVideos in src/
WebformHelpManager.php - Build the videos section.
File
- src/
WebformHelpManager.php, line 186
Class
- WebformHelpManager
- Webform help manager.
Namespace
Drupal\webformCode
public function getVideoLinks($id) {
$video = $this
->getVideo($id);
// Presentation.
$links = [];
if (!empty($video['presentation_id'])) {
$links[] = [
'title' => $video['title'] . ' | ' . $this
->t('Slides'),
'url' => Url::fromUri('https://docs.google.com/presentation/d/' . $video['presentation_id']),
];
}
// Related resources.
if (!empty($video['links'])) {
foreach ($video['links'] as $link) {
$link['url'] = Url::fromUri($link['url']);
$links[] = $link;
}
}
return $links;
}