|
1 | 1 | <?php |
2 | | - namespace Plugin\Podcaster; |
3 | 2 |
|
4 | | - require_once __DIR__ . '/../utils/PodcasterUtils.php'; |
| 3 | +namespace Plugin\Podcaster; |
| 4 | + |
| 5 | +use str; |
| 6 | +use addslashes; |
| 7 | + |
| 8 | +require_once __DIR__ . '/../utils/PodcasterUtils.php'; |
5 | 9 |
|
6 | 10 | $podcasterUtils = new PodcasterUtils(); |
7 | 11 | $podcasterUtils->setFeed($podcast); |
8 | 12 | $podcasterUtils->setCurrentEpisode($page); |
9 | 13 |
|
10 | 14 | $cover = false; |
11 | | - if($page->podcasterCover()->isNotEmpty()) { |
| 15 | + if ($page->podcasterCover()->isNotEmpty()) { |
12 | 16 | $cover = $page->podcasterCover()->toFile()->resize(200)->url(); |
13 | | - } else if($podcast->podcasterCover()->isNotEmpty()) { |
| 17 | + } elseif ($podcast->podcasterCover()->isNotEmpty()) { |
14 | 18 | $cover = $podcast->podcasterCover()->toFile()->resize(200)->url(); |
15 | 19 | } |
16 | 20 |
|
|
21 | 25 |
|
22 | 26 | <script> |
23 | 27 | podlovePlayer('#podlovePlayerContainer', { |
24 | | - <?php if($podcast->podcasterPodloveMainColor()->isNotEmpty() && $podcast->podcasterPodloveHighlighColor()->isNotEmpty()) : ?> |
| 28 | + <?php if ($podcast->podcasterPodloveMainColor()->isNotEmpty() && $podcast->podcasterPodloveHighlighColor()->isNotEmpty()) : ?> |
25 | 29 | theme: { |
26 | 30 | main: '#<?php echo str_replace('#', '', $podcast->podcasterPodloveMainColor()); ?>', |
27 | 31 | highlight: '#<?php echo str_replace('#', '', $podcast->podcasterPodloveHighlighColor()); ?>' |
|
34 | 38 | audio: <?php echo ($podcast->podcasterPodloveTabsAudio()->isTrue()) ? 'true' : 'false'; ?>, |
35 | 39 | download: <?php echo ($podcast->podcasterPodloveTabsDownload()->isTrue()) ? 'true' : 'false'; ?> |
36 | 40 | }, |
37 | | - title: '<?php echo $page->podcasterTitle()->or($page->title()); ?>', |
38 | | - subtitle: '<?php echo $page->podcasterSubtitle(); ?>', |
39 | | - summary: '<?php echo $page->podcasterDescription(); ?>', |
| 41 | + title: '<?php echo addslashes(Str::replace(Str::unhtml($page->podcasterTitle()->or($page->title())), "\n", ' ')); ?>', |
| 42 | + subtitle: '<?php echo addslashes(Str::replace(Str::unhtml($page->podcasterSubtitle()), "\n", ' ')); ?>', |
| 43 | + summary: '<?php echo addslashes(Str::replace(Str::unhtml($page->podcasterDescription()), "\n", ' ')); ?>', |
40 | 44 | publicationDate: '<?php echo date('r', $page->date()->toDate()); ?>', |
41 | | - <?php if($cover !== false) : ?> |
| 45 | + <?php if ($cover !== false) : ?> |
42 | 46 | poster: '<?php echo $cover; ?>', |
43 | 47 | <?php endif; ?> |
44 | 48 | link: '<?php echo $page->url(); ?>', |
45 | 49 | show: { |
46 | | - title: '<?php echo $podcast->podcasterTitle(); ?>', |
47 | | - subtitle: '<?php echo $podcast->podcasterSubtitle(); ?>', |
48 | | - summary: '<?php echo $podcast->podcasterDescription(); ?>', |
49 | | - <?php if($cover !== false) : ?> |
| 50 | + title: '<?php echo addslashes(Str::replace(Str::unhtml(($podcast->podcasterTitle())), "\n", ' ')); ?>', |
| 51 | + subtitle: '<?php echo addslashes(Str::replace(Str::unhtml($podcast->podcasterSubtitle()), "\n", ' ')); ?>', |
| 52 | + summary: '<?php echo addslashes(Str::replace(Str::unhtml($podcast->podcasterDescription()), "\n", ' ')); ?>', |
| 53 | + <?php if ($cover !== false) : ?> |
50 | 54 | poster: '<?php echo $cover; ?>', |
51 | 55 | <?php endif; ?> |
52 | 56 | link: '<?php echo $podcast->podcasterLink(); ?>' |
|
0 commit comments