From 8ed0a990c78ff0bc313ffba50514fcff75c3d908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Farr=C3=A9?= Date: Mon, 6 Oct 2025 15:41:53 +0100 Subject: [PATCH 1/2] Fix: Missing icon in Context Menu (File handler) and wrong styling in files context menu - https://github.com/humhub/humhub-internal/issues/857 --- docs/CHANGELOG.md | 1 + models/ZipImportHandler.php | 11 +++++++---- widgets/FileListContextMenu.php | 5 ++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7488c44a..c9d62401 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,7 @@ Changelog 0.17.1 - (Unreleased) ------------------------ - Enh #255: Improved Module Test GitHub Actions +- Fix: Missing icon in Context Menu (File handler) and wrong styling in files context menu 0.17.0 - August 29, 2025 ------------------------ diff --git a/models/ZipImportHandler.php b/models/ZipImportHandler.php index bef17045..633ee670 100644 --- a/models/ZipImportHandler.php +++ b/models/ZipImportHandler.php @@ -9,22 +9,25 @@ namespace humhub\modules\cfiles\models; -use Yii; use humhub\modules\file\handler\BaseFileHandler; +use humhub\modules\ui\icon\widgets\Icon; +use Yii; class ZipImportHandler extends BaseFileHandler { + public string $icon = 'file-archive-o'; + /** * The file handler link * - * @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. - * @see \humhub\modules\file\widgets\FileHandlerButtonDropdown * @return array the HTML attributes of the button. + * @see \humhub\modules\file\widgets\FileHandlerButtonDropdown + * @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. */ public function getLinkAttributes() { return [ - 'label' => Yii::t('CfilesModule.base', 'Import Zip'), + 'label' => Icon::get($this->icon) . Yii::t('CfilesModule.base', 'Import Zip'), 'data-action-click' => 'file.upload', 'data-action-target' => '#cfilesUploadZipFile', ]; diff --git a/widgets/FileListContextMenu.php b/widgets/FileListContextMenu.php index 4cd846a8..034f2ac7 100644 --- a/widgets/FileListContextMenu.php +++ b/widgets/FileListContextMenu.php @@ -165,7 +165,10 @@ private function addMenu(string $label, string $action, string $icon, int $sortO 'url' => '#', 'icon' => $icon, 'sortOrder' => $sortOrder, - 'htmlOptions' => ['data-action' => $action], + 'htmlOptions' => [ + 'data-action' => $action, + 'class' => 'link dropdown-item', + ], ])); } From d6bf8c3717c882886696a4149d8934a677145331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Farr=C3=A9?= Date: Mon, 6 Oct 2025 16:02:37 +0100 Subject: [PATCH 2/2] Add PR ID to CHANGELOG --- docs/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c9d62401..6bbff694 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,7 +4,7 @@ Changelog 0.17.1 - (Unreleased) ------------------------ - Enh #255: Improved Module Test GitHub Actions -- Fix: Missing icon in Context Menu (File handler) and wrong styling in files context menu +- Fix #256: Missing icon in Context Menu (File handler) and wrong styling in files context menu 0.17.0 - August 29, 2025 ------------------------