Skip to content

Commit

Permalink
Add option in feed setting to use an episode image
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansl committed Mar 2, 2021
1 parent 6d7ce05 commit 4d8edd9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/NewsPodcasts.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ protected static function generateFiles($arrFeed): void
);

// Add episode image
if (null !== $objPodcasts->singleSRC) {
if (null !== $objPodcasts->singleSRC && $arrFeed['useEpisodeImage']) {
$objItem->image = self::generateEpisodeImage($objPodcasts->singleSRC);
}

Expand Down
12 changes: 9 additions & 3 deletions src/Resources/contao/dca/tl_news_podcasts_feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

// Palettes
'palettes' => [
'default' => '{title_legend},title,alias,language;{description_legend},subtitle,description,category,explicit;{author_legend},author,owner,email,image,copyright;{archives_legend},archives,news_categoriesRoot;{config_legend},maxItems,feedBase;{statistic_legend},addStatistics;',
'default' => '{title_legend},title,alias,language;{description_legend},subtitle,description,category,explicit;{author_legend},author,owner,email,copyright;{image_legend},image,useEpisodeImage;{archives_legend},archives,news_categoriesRoot;{config_legend},maxItems,feedBase;{statistic_legend},addStatistics;',
'__selector__' => ['addStatistics'],
],

Expand Down Expand Up @@ -209,11 +209,17 @@
'filesOnly' => true,
'extensions' => 'jpg,png',
'mandatory' => true,
'tl_class' => 'long clr',
'tl_class' => 'w50',
],
'sql' => 'blob NULL',
],

'useEpisodeImage' => [
'label' => &$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['useEpisodeImage'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50 m12'],
'sql' => "char(1) NOT NULL default ''",
],
'archives' => [
'label' => &$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['archives'],
'exclude' => true,
Expand Down
12 changes: 8 additions & 4 deletions src/Resources/contao/languages/de/tl_news_podcasts_feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['email']['1'] = 'Die E-Mail-Adresse des Podcast-Besitzers';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['feedBase']['0'] = 'Basis URL';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['feedBase']['1'] = 'Bitte geben Sie die Basis-URL mit Protokoll (z.B. http://) ein.';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['image_legend'] = 'Bild Einstellungen';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['image']['0'] = 'Podcast-Bild';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['image']['1'] = 'Gibt die Grafik für den Podcast an. Die Covergrafik muss eine JPEG- oder PNG-Datei im RGB-Farbformat mit einer Größe von mindestens 1400 x 1400 Pixeln und höchstens 3000 x 3000 Pixeln sein.';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['useEpisodeImage']['0'] = 'Bild pro Episode';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['useEpisodeImage']['1'] = 'Aktivieren Sie diese Option, um das News-Teaserbild als Episoden-Bild zu verwenden. Das Bild wird automatisch angepasst.';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['news_categoriesRoot']['0'] = 'News Kategorie';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['news_categoriesRoot']['1'] = 'Wählen Sie optional eine Kategorie aus dem Modul news_categories aus';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['language']['0'] = 'Feed Sprache';
Expand All @@ -60,7 +63,8 @@
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['title']['1'] = 'Bitte geben Sie einen Titel ein';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['title_legend'] = 'Titel und Sprache';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['statistic_legend'] = 'Statistiken';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['addStatistics'][0] = 'Externes Statistiktool aktivieren';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['addStatistics'][1] = 'Sie können hier externe Statistiktools, wie blubrry.com oder podtrac.com aktivieren';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['statisticsPrefix'][0] = 'Media Redirect URL Präfix';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['statisticsPrefix'][1] = 'Bitte tragen Sie hier Ihren URL Präfix ein (z.B. für blubrry http://media.blubrry.com/mein_account)';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['addStatistics']['0'] = 'Externes Statistiktool aktivieren';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['addStatistics']['1'] = 'Sie können hier externe Statistiktools, wie blubrry.com oder podtrac.com aktivieren';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['statisticsPrefix']['0'] = 'Media Redirect URL Präfix';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['statisticsPrefix']['1'] = 'Bitte tragen Sie hier Ihren URL Präfix ein (z.B. für blubrry http://media.blubrry.com/mein_account)';

6 changes: 5 additions & 1 deletion src/Resources/contao/languages/en/tl_news_podcasts_feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['email']['1'] = 'The owner\'s email address';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['feedBase']['0'] = 'Base URL';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['feedBase']['1'] = 'Please enter the base URL with protocol (e.g. http://).';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['image_legend'] = 'Image settings';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['image']['0'] = 'Image for iTunes';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['image']['1'] = 'Points to the artwork for your podcast. Cover art must be in the JPEG or PNG file formats and in the RGB color space with a minimum size of 1400 x 1400 pixels and a maximum size of 3000 x 3000 pixels.';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['useEpisodeImage'][0] = 'Episode image';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['useEpisodeImage'][1] = 'Activate, if you want to use your news teaser images as episode image. The image will be cropped automatically';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['news_categoriesRoot']['0'] = 'News category';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['news_categoriesRoot']['1'] = 'Choose optionally a category from the news_categories module';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['language']['0'] = 'Feed language';
Expand All @@ -62,4 +65,5 @@
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['addStatistics'][0] = 'Activate external statistics';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['addStatistics'][1] = 'Provide external statistic tools like blubrry.com or podtrac.com';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['statisticsPrefix'][0] = 'Media redirect url prefix';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['statisticsPrefix'][1] = 'Please enter the statistics prefix url (e.g. for blubrry use http://media.blubrry.com/your_accountname)';
$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['statisticsPrefix'][1] = 'Please enter the statistics prefix url (e.g. for blubrry use http://media.blubrry.com/your_accountname)';$GLOBALS['TL_LANG']['tl_news_podcasts_feed']['statisticsPrefix'][0] = 'Media redirect url prefix';

0 comments on commit 4d8edd9

Please sign in to comment.