From 24ae45c876b89b9e3217231540e0499a1e764408 Mon Sep 17 00:00:00 2001 From: ikenfin Date: Thu, 21 Feb 2019 13:11:14 +0400 Subject: [PATCH] prevent false positive zip download button show --- upload/admin/controller/extension/module/foc_csv.php | 9 ++++++--- upload/admin/model/extension/module/foc_csv_exporter.php | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/upload/admin/controller/extension/module/foc_csv.php b/upload/admin/controller/extension/module/foc_csv.php index 73e25f6..5c05166 100644 --- a/upload/admin/controller/extension/module/foc_csv.php +++ b/upload/admin/controller/extension/module/foc_csv.php @@ -385,11 +385,14 @@ public function exportPart () { $position = $offset + $limit; - $this->sendOk(array( + $response = array( 'key' => $key, 'position' => $position, - 'errors' => $errors - )); + 'errors' => $errors, + 'collected_images' => $this->model_extension_module_foc_csv_exporter->getCollectedImagesCount() + ); + + $this->sendOk($response); } } } diff --git a/upload/admin/model/extension/module/foc_csv_exporter.php b/upload/admin/model/extension/module/foc_csv_exporter.php index 7950c09..c57b57c 100644 --- a/upload/admin/model/extension/module/foc_csv_exporter.php +++ b/upload/admin/model/extension/module/foc_csv_exporter.php @@ -255,7 +255,11 @@ public function addCollectedImage ($path) { } public function hasCollectedImages () { - return count(self::$foundImages) > 0; + return $this->getCollectedImagesCount() > 0; + } + + public function getCollectedImagesCount () { + return count(self::$foundImages); } public function getCollectedImages () {