diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7488c44a..6bbff694 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 #256: 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', + ], ])); }