From dd2ef8ffa697a0765d4057214aa95a2dec9ef14e Mon Sep 17 00:00:00 2001 From: Gerard Alvear Porras <55630227+Elgeryy1@users.noreply.github.com> Date: Wed, 29 Jul 2026 16:58:54 +0200 Subject: [PATCH] Group export feeds by category (#9079) * Group export feeds by category ## What changed - Groups feed choices in the import/export page by their existing FreshRSS category. - Preserves the current export request format and selection behavior. ## Why The export selector previously mixed feeds from every category, making a category-specific export difficult to assemble. Closes #5555 * Declare export feed count view data * Fix select size --------- Co-authored-by: Gerard Alvear Co-authored-by: Alexandre Alapetite --- app/Controllers/importExportController.php | 3 ++- app/Models/View.php | 1 + app/views/importExport/index.phtml | 19 ++++++++++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index f39fc2722..59221f3f5 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -32,7 +32,8 @@ class FreshRSS_importExport_Controller extends FreshRSS_ActionController { * This action displays the main page for import / export system. */ public function indexAction(): void { - $this->view->feeds = $this->feedDAO->listFeeds(); + $this->view->categories = $this->categoryDAO->listCategories(); + $this->view->feedCount = array_sum(array_map(static fn(FreshRSS_Category $category): int => count($category->feeds()), $this->view->categories)); FreshRSS_View::prependTitle(_t('sub.import_export.title') . ' ยท '); $this->listSqliteArchives(); } diff --git a/app/Models/View.php b/app/Models/View.php index 69ffd04d9..61160b3c3 100644 --- a/app/Models/View.php +++ b/app/Models/View.php @@ -91,6 +91,7 @@ class FreshRSS_View extends Minz_View { // Export / Import public string $content; + public int $feedCount; /** @var array> */ public array $entryIdsTagNames = []; public string $list_title; diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml index 60acee31b..f0aa68b0b 100644 --- a/app/views/importExport/index.phtml +++ b/app/views/importExport/index.phtml @@ -35,7 +35,7 @@

- feeds) > 0) { ?> + feedCount > 0) { ?>
@@ -58,14 +58,23 @@ feeds)) . '" multiple="multiple"'; + $select_args = ' size="' . min(10, count($this->categories) + $this->feedCount) . '" multiple="multiple"'; } ?>