A free, self-hostable news aggregator…
Option to show user labels instead of tags in RSS share (#8112)
Alexandre Alapetiteb7bd18148e65
diff --git a/README.fr.md b/README.fr.mdindex 127d1b568..6e9142a86 100644--- a/README.fr.md+++ b/README.fr.md@@ -238,7 +238,7 @@ Voir le [dépôt dédié à ces extensions](https://github.com/FreshRSS/Extensio| עברית (he) | ■■■■・・・・・・ 45% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fhe+%2F%28TODO%7CDIRTY%29%24%2F) || Magyar (hu) | ■■■■■■■■■・ 98% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fhu+%2F%28TODO%7CDIRTY%29%24%2F) || Bahasa Indonesia (id) | ■■■■■■■■■・ 96% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fid+%2F%28TODO%7CDIRTY%29%24%2F) |-| Italiano (it) | ■■■■■■■■■■ 100% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fit+%2F%28TODO%7CDIRTY%29%24%2F) |+| Italiano (it) | ■■■■■■■■■・ 99% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fit+%2F%28TODO%7CDIRTY%29%24%2F) || 日本語 (ja) | ■■■■■■■■■・ 94% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fja+%2F%28TODO%7CDIRTY%29%24%2F) || 한국어 (ko) | ■■■■■■■■・・ 88% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fko+%2F%28TODO%7CDIRTY%29%24%2F) || Latviešu (lv) | ■■■■■■■■・・ 82% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Flv+%2F%28TODO%7CDIRTY%29%24%2F) |@@ -248,8 +248,8 @@ Voir le [dépôt dédié à ces extensions](https://github.com/FreshRSS/Extensio| Português (Brasil) (pt-BR) | ■■■■■■■■・・ 87% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fpt-BR+%2F%28TODO%7CDIRTY%29%24%2F) || Português (Portugal) (pt-PT) | ■■■■■■■■・・ 87% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fpt-PT+%2F%28TODO%7CDIRTY%29%24%2F) || Русский (ru) | ■■■■■■■■・・ 88% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fru+%2F%28TODO%7CDIRTY%29%24%2F) |-| Slovenčina (sk) | ■■■■■■■■・・ 88% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fsk+%2F%28TODO%7CDIRTY%29%24%2F) |-| Türkçe (tr) | ■■■■■■■■■・ 96% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ftr+%2F%28TODO%7CDIRTY%29%24%2F) |+| Slovenčina (sk) | ■■■■■■■■・・ 87% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fsk+%2F%28TODO%7CDIRTY%29%24%2F) |+| Türkçe (tr) | ■■■■■■■■■・ 95% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ftr+%2F%28TODO%7CDIRTY%29%24%2F) || Українська (uk) | ■■■■■■■■■・ 98% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fuk+%2F%28TODO%7CDIRTY%29%24%2F) || 简体中文 (zh-CN) | ■■■■■■■■・・ 89% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fzh-CN+%2F%28TODO%7CDIRTY%29%24%2F) || 正體中文 (zh-TW) | ■■■■■■■■・・ 88% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fzh-TW+%2F%28TODO%7CDIRTY%29%24%2F) |diff --git a/README.md b/README.mdindex 74240b385..4e8233bf5 100644--- a/README.md+++ b/README.md@@ -134,7 +134,7 @@ See the [repository dedicated to those extensions](https://github.com/FreshRSS/E| עברית (he) | ■■■■・・・・・・ 45% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fhe+%2F%28TODO%7CDIRTY%29%24%2F) || Magyar (hu) | ■■■■■■■■■・ 98% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fhu+%2F%28TODO%7CDIRTY%29%24%2F) || Bahasa Indonesia (id) | ■■■■■■■■■・ 96% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fid+%2F%28TODO%7CDIRTY%29%24%2F) |-| Italiano (it) | ■■■■■■■■■■ 100% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fit+%2F%28TODO%7CDIRTY%29%24%2F) |+| Italiano (it) | ■■■■■■■■■・ 99% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fit+%2F%28TODO%7CDIRTY%29%24%2F) || 日本語 (ja) | ■■■■■■■■■・ 94% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fja+%2F%28TODO%7CDIRTY%29%24%2F) || 한국어 (ko) | ■■■■■■■■・・ 88% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fko+%2F%28TODO%7CDIRTY%29%24%2F) || Latviešu (lv) | ■■■■■■■■・・ 82% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Flv+%2F%28TODO%7CDIRTY%29%24%2F) |@@ -144,8 +144,8 @@ See the [repository dedicated to those extensions](https://github.com/FreshRSS/E| Português (Brasil) (pt-BR) | ■■■■■■■■・・ 87% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fpt-BR+%2F%28TODO%7CDIRTY%29%24%2F) || Português (Portugal) (pt-PT) | ■■■■■■■■・・ 87% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fpt-PT+%2F%28TODO%7CDIRTY%29%24%2F) || Русский (ru) | ■■■■■■■■・・ 88% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fru+%2F%28TODO%7CDIRTY%29%24%2F) |-| Slovenčina (sk) | ■■■■■■■■・・ 88% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fsk+%2F%28TODO%7CDIRTY%29%24%2F) |-| Türkçe (tr) | ■■■■■■■■■・ 96% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ftr+%2F%28TODO%7CDIRTY%29%24%2F) |+| Slovenčina (sk) | ■■■■■■■■・・ 87% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fsk+%2F%28TODO%7CDIRTY%29%24%2F) |+| Türkçe (tr) | ■■■■■■■■■・ 95% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ftr+%2F%28TODO%7CDIRTY%29%24%2F) || Українська (uk) | ■■■■■■■■■・ 98% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fuk+%2F%28TODO%7CDIRTY%29%24%2F) || 简体中文 (zh-CN) | ■■■■■■■■・・ 89% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fzh-CN+%2F%28TODO%7CDIRTY%29%24%2F) || 正體中文 (zh-TW) | ■■■■■■■■・・ 88% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fzh-TW+%2F%28TODO%7CDIRTY%29%24%2F) |diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.phpindex aedb7a2e6..427fcb584 100644--- a/app/Controllers/configureController.php+++ b/app/Controllers/configureController.php@@ -458,6 +458,9 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {if (!empty($params['shareRss']) && ctype_digit($params['shareRss'])) {$queryParams['shareRss'] = (bool)$params['shareRss'];}+ if (!empty($params['publishLabelsInsteadOfTags']) && ctype_digit($params['publishLabelsInsteadOfTags'])) {+ $queryParams['publishLabelsInsteadOfTags'] = (bool)$params['publishLabelsInsteadOfTags'];+ }$queries = FreshRSS_Context::userConf()->queries;$queries[$id] = (new FreshRSS_UserQuery($queryParams, FreshRSS_Context::categories(), FreshRSS_Context::labels()))->toArray();@@ -518,7 +521,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {$params = array_filter($_GET, 'is_string', ARRAY_FILTER_USE_KEY);unset($params['name']);unset($params['rid']);- /** @var array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string,shareRss?:bool,shareOpml?:bool,description?:string,imageUrl?:string} $params */+ /** @var array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string,shareRss?:bool,shareOpml?:bool,publishLabelsInsteadOfTags?:bool,description?:string,imageUrl?:string} $params */$params['url'] = Minz_Url::display(['params' => $params]);$params['name'] = _t('conf.query.number', count($queries) + 1);$queries[] = (new FreshRSS_UserQuery($params, FreshRSS_Context::categories(), FreshRSS_Context::labels()))->toArray();diff --git a/app/Models/UserQuery.php b/app/Models/UserQuery.phpindex 077ae0b90..26264fa24 100644--- a/app/Models/UserQuery.php+++ b/app/Models/UserQuery.php@@ -21,6 +21,7 @@ class FreshRSS_UserQuery {private string $token = '';private bool $shareRss = false;private bool $shareOpml = false;+ private bool $publishLabelsInsteadOfTags = false;/** @var array<int,FreshRSS_Category> $categories where the key is the category ID */private array $categories;/** @var array<int,FreshRSS_Tag> $labels where the key is the label ID */@@ -43,7 +44,7 @@ class FreshRSS_UserQuery {/*** @param array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string,- * shareRss?:bool,shareOpml?:bool,description?:string,imageUrl?:string} $query+ * shareRss?:bool,shareOpml?:bool,publishLabelsInsteadOfTags?:bool,description?:string,imageUrl?:string} $query* @param array<FreshRSS_Category> $categories* @param array<FreshRSS_Tag> $labels*/@@ -75,6 +76,7 @@ class FreshRSS_UserQuery {unset($link['name']);unset($link['shareOpml']);unset($link['shareRss']);+ unset($link['publishLabelsInsteadOfTags']);$this->url = Minz_Url::display(['params' => $link]);}} else {@@ -92,6 +94,9 @@ class FreshRSS_UserQuery {if (isset($query['shareOpml'])) {$this->shareOpml = $query['shareOpml'];}+ if (isset($query['publishLabelsInsteadOfTags'])) {+ $this->publishLabelsInsteadOfTags = (bool)$query['publishLabelsInsteadOfTags'];+ }if (isset($query['description'])) {$this->description = $query['description'];}@@ -109,7 +114,9 @@ class FreshRSS_UserQuery {/*** Convert the current object to an array.*- * @return array{'get'?:string,'name'?:string,'order'?:string,'search'?:string,'state'?:int,'url'?:string,'token'?:string}+ * @return array{get?:string,name?:string,order?:string,search?:string,+ * state?:int,url?:string,token?:string,shareRss?:bool,shareOpml?:bool,+ * publishLabelsInsteadOfTags?:bool,description?:string,imageUrl?:string}*/public function toArray(): array {return array_filter([@@ -122,6 +129,7 @@ class FreshRSS_UserQuery {'token' => $this->token,'shareRss' => $this->shareRss,'shareOpml' => $this->shareOpml,+ 'publishLabelsInsteadOfTags' => $this->publishLabelsInsteadOfTags,'description' => $this->description,'imageUrl' => $this->imageUrl,], fn($v): bool => $v !== '' && $v !== 0 && $v !== false);@@ -279,6 +287,14 @@ class FreshRSS_UserQuery {return $this->shareOpml;}+ public function setPublishLabelsInsteadOfTags(bool $publishLabelsInsteadOfTags): void {+ $this->publishLabelsInsteadOfTags = $publishLabelsInsteadOfTags;+ }++ public function publishLabelsInsteadOfTags(): bool {+ return $this->publishLabelsInsteadOfTags;+ }+protected function sharedUrl(bool $xmlEscaped = true): string {$currentUser = Minz_User::name() ?? '';return Minz_Url::display("/api/query.php?user={$currentUser}&t={$this->token}", $xmlEscaped ? 'html' : '', true);diff --git a/app/Models/View.php b/app/Models/View.phpindex 11ca3a105..104afb3c0 100644--- a/app/Models/View.php+++ b/app/Models/View.php@@ -78,7 +78,7 @@ class FreshRSS_View extends Minz_View {// Export / Importpublic string $content;/** @var array<string,array<string>> */- public array $entryIdsTagNames;+ public array $entryIdsTagNames = [];public string $list_title;public int $queryId;public string $type;@@ -111,6 +111,7 @@ class FreshRSS_View extends Minz_View {public bool $internal_rendering = false;public string $description = '';public string $image_url = '';+ public bool $publishLabelsInsteadOfTags = false;// Content previewpublic string $fatalError;diff --git a/app/i18n/cs/conf.php b/app/i18n/cs/conf.phpindex 75412206a..9662e0108 100644--- a/app/i18n/cs/conf.php+++ b/app/i18n/cs/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Zobrazit podle kategorie','feeds' => 'Zobrazit podle kanálu','order' => 'Seřadit podle data',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Výraz','shareOpml' => 'Povolit sdílení příslušných kategorií a kanálů pomocí OPML','shareRss' => 'Povolit sdílení pomocí HTML & RSS',diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.phpindex 7f6f4f5f9..9c3e22f75 100644--- a/app/i18n/de/conf.php+++ b/app/i18n/de/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Nach Kategorie filtern','feeds' => 'Nach Feed filtern','order' => 'Nach Datum sortieren',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Suchbegriff','shareOpml' => 'Teilen via OPML mit zugehörigen Kategorien und Feeds aktivieren','shareRss' => 'Teilen via HTML & RSS aktivieren',diff --git a/app/i18n/el/conf.php b/app/i18n/el/conf.phpindex 9936f18a7..d254c1853 100644--- a/app/i18n/el/conf.php+++ b/app/i18n/el/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Display by category', // TODO'feeds' => 'Display by feed', // TODO'order' => 'Sort by date', // TODO+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Expression', // TODO'shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', // TODO'shareRss' => 'Enable sharing by HTML & RSS', // TODOdiff --git a/app/i18n/en-US/conf.php b/app/i18n/en-US/conf.phpindex d64e93ca1..34d93b7d0 100644--- a/app/i18n/en-US/conf.php+++ b/app/i18n/en-US/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Display by category', // IGNORE'feeds' => 'Display by feed', // IGNORE'order' => 'Sort by date', // IGNORE+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // IGNORE'search' => 'Expression', // IGNORE'shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', // IGNORE'shareRss' => 'Enable sharing by HTML & RSS', // IGNOREdiff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.phpindex 025cb4f8f..0b69aede1 100644--- a/app/i18n/en/conf.php+++ b/app/i18n/en/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Display by category','feeds' => 'Display by feed','order' => 'Sort by date',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS','search' => 'Expression','shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds','shareRss' => 'Enable sharing by HTML & RSS',diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.phpindex 7548a0a38..6655852e6 100644--- a/app/i18n/es/conf.php+++ b/app/i18n/es/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Mostrar por categoría','feeds' => 'Mostrar por fuente','order' => 'Ordenar por fecha',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Expresión','shareOpml' => 'Permitir que OPML comparta las categorías y fuentes correspondientes','shareRss' => 'Permite compartir por HTML & RSS',diff --git a/app/i18n/fa/conf.php b/app/i18n/fa/conf.phpindex 96dae6faa..9bf8b7501 100644--- a/app/i18n/fa/conf.php+++ b/app/i18n/fa/conf.php@@ -152,6 +152,7 @@ return array('categories' => ' نمایش بر اساس دسته بندی','feeds' => ' نمایش با فید','order' => ' مرتب سازی بر اساس تاریخ',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => ' بیان','shareOpml' => 'فعالسازی اشتراکگذاری دستهها و فیدهای مربوطه با OPML','shareRss' => 'اشتراکگذاری RSS',diff --git a/app/i18n/fi/conf.php b/app/i18n/fi/conf.phpindex 40f2be3a7..196137e76 100644--- a/app/i18n/fi/conf.php+++ b/app/i18n/fi/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Näytä luokan mukaan','feeds' => 'Näytä syötteen mukaan','order' => 'Lajittele päivämäärän mukaan',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Lauseke','shareOpml' => 'Jaa kyselyä vastaavat luokat ja syötteet OPML-muodossa','shareRss' => 'Jaa HTML & RSS -muodossa',diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.phpindex 432db40c3..befd951f0 100644--- a/app/i18n/fr/conf.php+++ b/app/i18n/fr/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Afficher par catégorie','feeds' => 'Afficher par flux','order' => 'Tri par date',+ 'publish_labels_instead_of_tags' => 'Remplacer les <i>tags des flux</i> par les <i>étiquettes d’utilisateur</i> dans le RSS partagé','search' => 'Expression', // IGNORE'shareOpml' => 'Active le partage par OPML des catégories et flux correspondants','shareRss' => 'Active le partage par HTML & RSS',diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.phpindex c67888256..65014e92c 100644--- a/app/i18n/he/conf.php+++ b/app/i18n/he/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Display by category', // TODO'feeds' => 'Display by feed', // TODO'order' => 'Sort by date', // TODO+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Expression', // TODO'shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', // TODO'shareRss' => 'Enable sharing by HTML & RSS', // TODOdiff --git a/app/i18n/hu/conf.php b/app/i18n/hu/conf.phpindex ee37e7c44..f99590288 100644--- a/app/i18n/hu/conf.php+++ b/app/i18n/hu/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Rendezés kategória szerint','feeds' => 'Rendezés hírforrás szerint','order' => 'Rendezés dátum szerint',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Kifejezés','shareOpml' => 'Engedélyezze a megfelelő kategóriák és hírcsatornák OPML-alapú megosztását','shareRss' => 'Engedélyezze a HTML & RSS megosztást',diff --git a/app/i18n/id/conf.php b/app/i18n/id/conf.phpindex 64e1bc7c3..26f3fc5fa 100644--- a/app/i18n/id/conf.php+++ b/app/i18n/id/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Tampilkan berdasarkan kategori','feeds' => 'Tampilkan berdasarkan umpan','order' => 'Urutkan berdasarkan tanggal',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Ekspresi Pencarian','shareOpml' => 'Aktifkan berbagi melalui OPML dari kategori dan umpan terkait','shareRss' => 'Aktifkan berbagi melalui HTML & RSS',diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.phpindex 9b8f38c30..2327db4f6 100644--- a/app/i18n/it/conf.php+++ b/app/i18n/it/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Mostra per categoria','feeds' => 'Mostra per feed','order' => 'Ordina per data',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Espressione','shareOpml' => 'Abilita la condivisione di OPML di categorie e feed corrispondenti','shareRss' => 'Abilita la condivisione di HTML & RSS',diff --git a/app/i18n/ja/conf.php b/app/i18n/ja/conf.phpindex db04ea4f9..bf1b58413 100644--- a/app/i18n/ja/conf.php+++ b/app/i18n/ja/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'カテゴリごとに表示する','feeds' => 'フィードごとに表示する','order' => '日付ごとにソートする',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => '式','shareOpml' => 'カテゴリとフィードのOPMLによる共有を有効にする','shareRss' => 'HTMLとRSSによる共有を有効にする',diff --git a/app/i18n/ko/conf.php b/app/i18n/ko/conf.phpindex b659190d2..82da8dd53 100644--- a/app/i18n/ko/conf.php+++ b/app/i18n/ko/conf.php@@ -152,6 +152,7 @@ return array('categories' => '카테고리별로 표시','feeds' => '피드별로 표시','order' => '날짜순으로 정렬',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => '정규 표현식','shareOpml' => '해당 카테고리와 피드에 대한 OPML 공유 활성화','shareRss' => 'HTML 및 RSS 공유 활성화',diff --git a/app/i18n/lv/conf.php b/app/i18n/lv/conf.phpindex 6375860e4..929826f3f 100644--- a/app/i18n/lv/conf.php+++ b/app/i18n/lv/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Rādīt pēc kategorijas','feeds' => 'Rādīt pēc barotnes','order' => 'Kārtot pēc datuma',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Izteiksme','shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', // TODO'shareRss' => 'Enable sharing by HTML & RSS', // TODOdiff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.phpindex d3cd21cd2..47690b475 100644--- a/app/i18n/nl/conf.php+++ b/app/i18n/nl/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Weergeven op categorie','feeds' => 'Weergeven op feed','order' => 'Sorteren op datum',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Expressie','shareOpml' => 'Via OPML delen van bijbehorende categorieën en feeds aanzetten','shareRss' => 'Via HTML & RSS delen aanzetten',diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.phpindex f8c5ecb44..6d02a97c9 100644--- a/app/i18n/oc/conf.php+++ b/app/i18n/oc/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Afichatge per categoria','feeds' => 'Afichatge per flux','order' => 'Triar per data',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Expression', // IGNORE'shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', // TODO'shareRss' => 'Enable sharing by HTML & RSS', // TODOdiff --git a/app/i18n/pl/conf.php b/app/i18n/pl/conf.phpindex 41a6e9808..69f158ee7 100644--- a/app/i18n/pl/conf.php+++ b/app/i18n/pl/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Według kategorii','feeds' => 'Według kanału','order' => 'Sortowanie wg daty',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Wyrażenie','shareOpml' => 'Włącz udostępnianie OPML-ów zawierających kategorie i kanały','shareRss' => 'Włącz udostępnianie przez HTML i RSS',diff --git a/app/i18n/pt-BR/conf.php b/app/i18n/pt-BR/conf.phpindex 9f2daba08..39d6ec077 100644--- a/app/i18n/pt-BR/conf.php+++ b/app/i18n/pt-BR/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Exibir por categoria','feeds' => 'Exibir por feed','order' => 'Ordenar por data',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Expressão','shareOpml' => 'Habilita o compartilhamento por OPML de categorias e feeds correspondentes','shareRss' => 'Habilita o compartilhamento por HTML & RSS',diff --git a/app/i18n/pt-PT/conf.php b/app/i18n/pt-PT/conf.phpindex 5977c0b97..c7a310156 100644--- a/app/i18n/pt-PT/conf.php+++ b/app/i18n/pt-PT/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Mostrar por categoria','feeds' => 'Mostrar por feed','order' => 'Ordenar por data',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Expressão','shareOpml' => 'Activa a partilha por OPML de categorias e feeds correspondentes','shareRss' => 'Activa o partilha por HTML & RSS',diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.phpindex 8f1eedc7f..31ed9b3cb 100644--- a/app/i18n/ru/conf.php+++ b/app/i18n/ru/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Отображение по категории','feeds' => 'Отображение по ленте','order' => 'Сортировать по дате',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Выражение','shareOpml' => 'Включить общий доступ с помощью OPML к соответствующим категориям и лентам','shareRss' => 'Включить общий доступ с помощью HTML & RSS',diff --git a/app/i18n/sk/conf.php b/app/i18n/sk/conf.phpindex 604f2f9ad..d848d8f0d 100644--- a/app/i18n/sk/conf.php+++ b/app/i18n/sk/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Zobraziť podľa kategórie','feeds' => 'Zobraziť podľa kanála','order' => 'Zobraziť podľa dátumu',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Výraz','shareOpml' => 'Povoliť zdieľanie prostredníctvom OPML zodpovedajúdich kategórií a kanálov','shareRss' => 'Povoliť zdieľanie prostredníctvom HTML & RSS',diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.phpindex 32c8060c5..7c1fae419 100644--- a/app/i18n/tr/conf.php+++ b/app/i18n/tr/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Kategoriye göre göster','feeds' => 'Beslemeye göre göster','order' => 'Tarihe göre sırala',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'İfade','shareOpml' => 'İlgili kategori ve beslemelerin OPML ile paylaşımını etkinleştir','shareRss' => 'HTML ve RSS ile paylaşımı etkinleştir',diff --git a/app/i18n/uk/conf.php b/app/i18n/uk/conf.phpindex e3e9a8fae..9a46c2e15 100644--- a/app/i18n/uk/conf.php+++ b/app/i18n/uk/conf.php@@ -152,6 +152,7 @@ return array('categories' => 'Показати категорію','feeds' => 'Показати стрічку','order' => 'Впорядкувати за датою',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => 'Вираз','shareOpml' => 'Увімкнути OPML-поширення відповідних категорій і стрічок','shareRss' => 'Увімкнути поширення в форматі HTML і RSS',diff --git a/app/i18n/zh-CN/conf.php b/app/i18n/zh-CN/conf.phpindex 1ee9bf404..6b188e5ff 100644--- a/app/i18n/zh-CN/conf.php+++ b/app/i18n/zh-CN/conf.php@@ -152,6 +152,7 @@ return array('categories' => '按分类显示','feeds' => '按订阅源显示','order' => '按日期排序',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => '表达式','shareOpml' => '启用相应类别和 feed 的 OPML 分享','shareRss' => '启用 HTML 和 RSS 分享',diff --git a/app/i18n/zh-TW/conf.php b/app/i18n/zh-TW/conf.phpindex ac83b7c1f..6057f46b0 100644--- a/app/i18n/zh-TW/conf.php+++ b/app/i18n/zh-TW/conf.php@@ -152,6 +152,7 @@ return array('categories' => '按分類顯示','feeds' => '按訂閱源顯示','order' => '按日期排序',+ 'publish_labels_instead_of_tags' => 'Replace <i>feed tags</i> by <i>user labels</i> in the shared RSS', // TODO'search' => '表達式','shareOpml' => '啟用透過對應類別和源的OPML分享','shareRss' => '啟用透過HTML分享 & RSS',diff --git a/app/views/helpers/configure/query.phtml b/app/views/helpers/configure/query.phtmlindex 9336772bb..e97ceeeed 100644--- a/app/views/helpers/configure/query.phtml+++ b/app/views/helpers/configure/query.phtml@@ -46,9 +46,13 @@<?php if ($this->query->sharedUrlRss() !== ''): ?><ul><li><a href="<?= $this->query->sharedUrlHtml() ?>"><?= _i('link') ?> <?= _t('conf.query.share.html') ?></a></li>- <li><a href="<?= $this->query->sharedUrlRss() ?>"><?= _i('link') ?> <?= _t('conf.query.share.rss') ?></a></li><li><a href="<?= $this->query->sharedUrlGreader() ?>"><?= _i('link') ?> <?= _t('conf.query.share.greader') ?></a></li>+ <li><a href="<?= $this->query->sharedUrlRss() ?>"><?= _i('link') ?> <?= _t('conf.query.share.rss') ?></a></li></ul>+ <label class="checkbox" for="publishLabelsInsteadOfTags">+ <input type="checkbox" name="query[publishLabelsInsteadOfTags]" id="publishLabelsInsteadOfTags" value="1" <?= $this->query->publishLabelsInsteadOfTags() ? 'checked="checked"' : ''?> />+ <?= _t('conf.query.filter.publish_labels_instead_of_tags') ?>+ </label><?php endif; ?></div><div class="group-controls">diff --git a/app/views/index/rss.phtml b/app/views/index/rss.phtmlindex 3d531c554..bcd71fa90 100644--- a/app/views/index/rss.phtml+++ b/app/views/index/rss.phtml@@ -39,14 +39,24 @@ foreach ($this->entries as $item) {echo "\t\t\t", '<dc:creator>', $author, '</dc:creator>', "\n";}}- $categories = $item->tags();- if (is_array($categories)) {- foreach ($categories as $category) {- echo "\t\t\t", '<category>', $category, '</category>', "\n";++ if ($this->publishLabelsInsteadOfTags) {+ $categories = $this->entryIdsTagNames['e_' . $item->id()] ?? [];+ if (is_array($categories)) {+ foreach ($categories as $category) {+ echo "\t\t\t", '<category>', $category, '</category>', "\n";+ }+ }+ } else {+ $categories = $item->tags();+ if (is_array($categories)) {+ foreach ($categories as $category) {+ echo "\t\t\t", '<category>', $category, '</category>', "\n";+ }}}- $enclosures = iterator_to_array($item->enclosures(false)); // TODO: Optimise: avoid iterator_to_array if possible+ $enclosures = iterator_to_array($item->enclosures(false), preserve_keys: false); // TODO: Optimise: avoid iterator_to_array if possible$thumbnail = $item->thumbnail(false);if (!empty($thumbnail['url'])) {// https://www.rssboard.org/media-rss#media-thumbnailsdiff --git a/p/api/query.php b/p/api/query.phpindex 4618f3e1b..3fb4cadd7 100644--- a/p/api/query.php+++ b/p/api/query.php@@ -160,6 +160,16 @@ $view->rss_url = $query->sharedUrlRss();$view->rss_title = $query->getName();$view->image_url = $query->getImageUrl();$view->description = $query->getDescription() ?: _t('index.feed.rss_of', $view->rss_title);+$view->publishLabelsInsteadOfTags = $query->publishLabelsInsteadOfTags();+$view->entryIdsTagNames = [];+if ($view->publishLabelsInsteadOfTags && in_array($format, ['rss', 'atom'], true)) {+ $entries = iterator_to_array($view->entries, preserve_keys: false); // TODO: Optimise: avoid iterator_to_array if possible+ $view->entries = $entries;+ if (!empty($entries)) {+ $tagDAO = FreshRSS_Factory::createTagDao();+ $view->entryIdsTagNames = $tagDAO->getEntryIdsTagNames($entries);+ }+}if ($query->getName() != '') {FreshRSS_View::_title($query->getName());}