aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-10-14 15:43:43 +0200
committerGravatar GitHub <noreply@github.com> 2025-10-14 15:43:43 +0200
commitb7bd18148e65bbdd6be442036a295eb43ca1501e (patch)
tree4fba0694a3c45f015f2ed83ebd2356d169241f79 /app
parentfaaa770bc0b396d6e842fe816012661f07eac395 (diff)
Option to show user labels instead of tags in RSS share (#8112)
* Option to show user labels instead of tags in RSS share fix https://github.com/FreshRSS/FreshRSS/discussions/8108#discussioncomment-14668813 <img width="711" height="182" alt="image" src="https://github.com/user-attachments/assets/8effb2cd-fffb-4f00-b628-54e963e8b2dc" />
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/configureController.php5
-rw-r--r--app/Models/UserQuery.php20
-rw-r--r--app/Models/View.php3
-rw-r--r--app/i18n/cs/conf.php1
-rw-r--r--app/i18n/de/conf.php1
-rw-r--r--app/i18n/el/conf.php1
-rw-r--r--app/i18n/en-US/conf.php1
-rw-r--r--app/i18n/en/conf.php1
-rw-r--r--app/i18n/es/conf.php1
-rw-r--r--app/i18n/fa/conf.php1
-rw-r--r--app/i18n/fi/conf.php1
-rw-r--r--app/i18n/fr/conf.php1
-rw-r--r--app/i18n/he/conf.php1
-rw-r--r--app/i18n/hu/conf.php1
-rw-r--r--app/i18n/id/conf.php1
-rw-r--r--app/i18n/it/conf.php1
-rw-r--r--app/i18n/ja/conf.php1
-rw-r--r--app/i18n/ko/conf.php1
-rw-r--r--app/i18n/lv/conf.php1
-rw-r--r--app/i18n/nl/conf.php1
-rw-r--r--app/i18n/oc/conf.php1
-rw-r--r--app/i18n/pl/conf.php1
-rw-r--r--app/i18n/pt-BR/conf.php1
-rw-r--r--app/i18n/pt-PT/conf.php1
-rw-r--r--app/i18n/ru/conf.php1
-rw-r--r--app/i18n/sk/conf.php1
-rw-r--r--app/i18n/tr/conf.php1
-rw-r--r--app/i18n/uk/conf.php1
-rw-r--r--app/i18n/zh-CN/conf.php1
-rw-r--r--app/i18n/zh-TW/conf.php1
-rw-r--r--app/views/helpers/configure/query.phtml6
-rw-r--r--app/views/index/rss.phtml20
32 files changed, 71 insertions, 10 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index 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.php
index 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.php
index 11ca3a105..104afb3c0 100644
--- a/app/Models/View.php
+++ b/app/Models/View.php
@@ -78,7 +78,7 @@ class FreshRSS_View extends Minz_View {
// Export / Import
public 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 preview
public string $fatalError;
diff --git a/app/i18n/cs/conf.php b/app/i18n/cs/conf.php
index 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 &amp; RSS',
diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php
index 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 &amp; RSS aktivieren',
diff --git a/app/i18n/el/conf.php b/app/i18n/el/conf.php
index 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 &amp; RSS', // TODO
diff --git a/app/i18n/en-US/conf.php b/app/i18n/en-US/conf.php
index 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 &amp; RSS', // IGNORE
diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php
index 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 &amp; RSS',
diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.php
index 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 &amp; RSS',
diff --git a/app/i18n/fa/conf.php b/app/i18n/fa/conf.php
index 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.php
index 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 &amp; RSS -muodossa',
diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php
index 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 &amp; RSS',
diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.php
index 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 &amp; RSS', // TODO
diff --git a/app/i18n/hu/conf.php b/app/i18n/hu/conf.php
index 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 &amp; RSS megosztást',
diff --git a/app/i18n/id/conf.php b/app/i18n/id/conf.php
index 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 &amp; RSS',
diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php
index 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 &amp; RSS',
diff --git a/app/i18n/ja/conf.php b/app/i18n/ja/conf.php
index 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.php
index 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.php
index 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 &amp; RSS', // TODO
diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php
index 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 &amp; RSS delen aanzetten',
diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.php
index 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 &amp; RSS', // TODO
diff --git a/app/i18n/pl/conf.php b/app/i18n/pl/conf.php
index 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.php
index 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 &amp; RSS',
diff --git a/app/i18n/pt-PT/conf.php b/app/i18n/pt-PT/conf.php
index 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 &amp; RSS',
diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php
index 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 &amp; RSS',
diff --git a/app/i18n/sk/conf.php b/app/i18n/sk/conf.php
index 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 &amp; RSS',
diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php
index 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.php
index 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.php
index 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.php
index 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分享 &amp; RSS',
diff --git a/app/views/helpers/configure/query.phtml b/app/views/helpers/configure/query.phtml
index 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.phtml
index 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-thumbnails