Loading app/Helpers/rss_helper.php +6 −2 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ if (! function_exists('get_rss_feed')) { "<?xml version='1.0' encoding='utf-8'?><rss version='2.0' xmlns:itunes='{$itunesNamespace}' xmlns:podcast='{$podcastNamespace}' xmlns:atom='{$atomNamespace}' xmlns:content='http://purl.org/rss/1.0/modules/content/'></rss>" ); $plugins->rssBeforeChannel($podcast); $channel = $rss->addChild('channel'); $atomLink = $channel->addChild('link', null, $atomNamespace); Loading Loading @@ -298,13 +300,15 @@ if (! function_exists('get_rss_feed')) { } // run plugins hook at the end $plugins->channelTag($podcast, $channel); $plugins->rssAfterChannel($podcast, $channel); foreach ($episodes as $episode) { if ($episode->is_premium && ! $subscription instanceof Subscription) { continue; } $plugins->rssBeforeItem($episode); $item = $channel->addChild('item'); $item->addChild('title', $episode->title, null, false); $enclosure = $item->addChild('enclosure'); Loading Loading @@ -460,7 +464,7 @@ if (! function_exists('get_rss_feed')) { ], $item); } $plugins->itemTag($episode, $item); $plugins->rssAfterItem($episode, $item); } return $rss->asXML(); Loading modules/Plugins/Controllers/PluginController.php +1 −1 Original line number Diff line number Diff line Loading @@ -187,7 +187,7 @@ class PluginController extends BaseController $validatedData = $this->validator->getValidated(); foreach ($plugin->getSettingsFields('general') as $field) { foreach ($plugin->getSettingsFields($type) as $field) { $value = $validatedData[$field->key] ?? null; $fieldValue = $value === '' ? null : match ($plugins::FIELDS_CASTS[$field->type] ?? 'text') { 'bool' => $value === 'yes', Loading modules/Plugins/Core/BasePlugin.php +7 −6 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ abstract class BasePlugin implements PluginInterface // TODO: cache manifest data $manifestPath = $directory . '/manifest.json'; $manifestContents = file_get_contents($manifestPath); $manifestContents = @file_get_contents($manifestPath); if (! $manifestContents) { $manifestContents = '{}'; Loading Loading @@ -93,18 +93,19 @@ abstract class BasePlugin implements PluginInterface $this->{$name} = $value; } public function init(): void public function rssBeforeChannel(Podcast $podcast): void { // add to admin navigation } // TODO: setup navigation and views? public function rssAfterChannel(Podcast $podcast, SimpleRSSElement $channel): void { } public function channelTag(Podcast $podcast, SimpleRSSElement $channel): void public function rssBeforeItem(Episode $episode): void { } public function itemTag(Episode $episode, SimpleRSSElement $item): void public function rssAfterItem(Episode $episode, SimpleRSSElement $item): void { } Loading modules/Plugins/Core/PluginInterface.php +6 −2 Original line number Diff line number Diff line Loading @@ -10,9 +10,13 @@ use App\Libraries\SimpleRSSElement; interface PluginInterface { public function channelTag(Podcast $podcast, SimpleRSSElement $channel): void; public function rssBeforeChannel(Podcast $podcast): void; public function itemTag(Episode $episode, SimpleRSSElement $item): void; public function rssAfterChannel(Podcast $podcast, SimpleRSSElement $channel): void; public function rssBeforeItem(Episode $episode): void; public function rssAfterItem(Episode $episode, SimpleRSSElement $item): void; public function siteHead(): void; } modules/Plugins/Core/Plugins.php +6 −4 Original line number Diff line number Diff line Loading @@ -10,9 +10,11 @@ use App\Libraries\SimpleRSSElement; use Config\Database; /** * @method void channelTag(Podcast $podcast, SimpleRSSElement $channel) * @method void itemTag(Episode $episode, SimpleRSSElement $item) * @method string siteHead() * @method void rssBeforeChannel(Podcast $podcast) * @method void rssAfterChannel(Podcast $podcast, SimpleRSSElement $channel) * @method void rssBeforeItem(Episode $episode) * @method void rssAfterItem(Episode $episode, SimpleRSSElement $item) * @method void siteHead() */ class Plugins { Loading @@ -21,7 +23,7 @@ class Plugins /** * @var list<string> */ public const HOOKS = ['channelTag', 'itemTag', 'siteHead']; public const HOOKS = ['rssBeforeChannel', 'rssAfterChannel', 'rssBeforeItem', 'rssAfterItem', 'siteHead']; public const FIELDS_VALIDATIONS = [ 'checkbox' => ['permit_empty'], Loading Loading
app/Helpers/rss_helper.php +6 −2 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ if (! function_exists('get_rss_feed')) { "<?xml version='1.0' encoding='utf-8'?><rss version='2.0' xmlns:itunes='{$itunesNamespace}' xmlns:podcast='{$podcastNamespace}' xmlns:atom='{$atomNamespace}' xmlns:content='http://purl.org/rss/1.0/modules/content/'></rss>" ); $plugins->rssBeforeChannel($podcast); $channel = $rss->addChild('channel'); $atomLink = $channel->addChild('link', null, $atomNamespace); Loading Loading @@ -298,13 +300,15 @@ if (! function_exists('get_rss_feed')) { } // run plugins hook at the end $plugins->channelTag($podcast, $channel); $plugins->rssAfterChannel($podcast, $channel); foreach ($episodes as $episode) { if ($episode->is_premium && ! $subscription instanceof Subscription) { continue; } $plugins->rssBeforeItem($episode); $item = $channel->addChild('item'); $item->addChild('title', $episode->title, null, false); $enclosure = $item->addChild('enclosure'); Loading Loading @@ -460,7 +464,7 @@ if (! function_exists('get_rss_feed')) { ], $item); } $plugins->itemTag($episode, $item); $plugins->rssAfterItem($episode, $item); } return $rss->asXML(); Loading
modules/Plugins/Controllers/PluginController.php +1 −1 Original line number Diff line number Diff line Loading @@ -187,7 +187,7 @@ class PluginController extends BaseController $validatedData = $this->validator->getValidated(); foreach ($plugin->getSettingsFields('general') as $field) { foreach ($plugin->getSettingsFields($type) as $field) { $value = $validatedData[$field->key] ?? null; $fieldValue = $value === '' ? null : match ($plugins::FIELDS_CASTS[$field->type] ?? 'text') { 'bool' => $value === 'yes', Loading
modules/Plugins/Core/BasePlugin.php +7 −6 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ abstract class BasePlugin implements PluginInterface // TODO: cache manifest data $manifestPath = $directory . '/manifest.json'; $manifestContents = file_get_contents($manifestPath); $manifestContents = @file_get_contents($manifestPath); if (! $manifestContents) { $manifestContents = '{}'; Loading Loading @@ -93,18 +93,19 @@ abstract class BasePlugin implements PluginInterface $this->{$name} = $value; } public function init(): void public function rssBeforeChannel(Podcast $podcast): void { // add to admin navigation } // TODO: setup navigation and views? public function rssAfterChannel(Podcast $podcast, SimpleRSSElement $channel): void { } public function channelTag(Podcast $podcast, SimpleRSSElement $channel): void public function rssBeforeItem(Episode $episode): void { } public function itemTag(Episode $episode, SimpleRSSElement $item): void public function rssAfterItem(Episode $episode, SimpleRSSElement $item): void { } Loading
modules/Plugins/Core/PluginInterface.php +6 −2 Original line number Diff line number Diff line Loading @@ -10,9 +10,13 @@ use App\Libraries\SimpleRSSElement; interface PluginInterface { public function channelTag(Podcast $podcast, SimpleRSSElement $channel): void; public function rssBeforeChannel(Podcast $podcast): void; public function itemTag(Episode $episode, SimpleRSSElement $item): void; public function rssAfterChannel(Podcast $podcast, SimpleRSSElement $channel): void; public function rssBeforeItem(Episode $episode): void; public function rssAfterItem(Episode $episode, SimpleRSSElement $item): void; public function siteHead(): void; }
modules/Plugins/Core/Plugins.php +6 −4 Original line number Diff line number Diff line Loading @@ -10,9 +10,11 @@ use App\Libraries\SimpleRSSElement; use Config\Database; /** * @method void channelTag(Podcast $podcast, SimpleRSSElement $channel) * @method void itemTag(Episode $episode, SimpleRSSElement $item) * @method string siteHead() * @method void rssBeforeChannel(Podcast $podcast) * @method void rssAfterChannel(Podcast $podcast, SimpleRSSElement $channel) * @method void rssBeforeItem(Episode $episode) * @method void rssAfterItem(Episode $episode, SimpleRSSElement $item) * @method void siteHead() */ class Plugins { Loading @@ -21,7 +23,7 @@ class Plugins /** * @var list<string> */ public const HOOKS = ['channelTag', 'itemTag', 'siteHead']; public const HOOKS = ['rssBeforeChannel', 'rssAfterChannel', 'rssBeforeItem', 'rssAfterItem', 'siteHead']; public const FIELDS_VALIDATIONS = [ 'checkbox' => ['permit_empty'], Loading