From 3c8bea89212e0c8ec63cd19f1ed04f7d4647f1f9 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Wed, 28 Jun 2023 10:11:51 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B05945=20-=20Fix=20"menu"=20option=20in=20?= =?UTF-8?q?dashlet=20list=20having=20no=20effect=20since=20relations=20ref?= =?UTF-8?q?actoring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/displayblock.class.inc.php | 8 +++++++- .../UI/Links/Indirect/BlockIndirectLinkSetViewTable.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/application/displayblock.class.inc.php b/application/displayblock.class.inc.php index 1d58f5380..e79d94161 100644 --- a/application/displayblock.class.inc.php +++ b/application/displayblock.class.inc.php @@ -1871,7 +1871,13 @@ class MenuBlock extends DisplayBlock /** @var array $aToolkitActions Any "legacy" toolkit menu item, which are now displayed in the same menu as the $aRegularActions, after them */ $aToolkitActions = []; - if (!isset($aExtraParams['selection_mode']) || ($aExtraParams['selection_mode'] == "")) { + // Display menu actions only if... + if ( + // ... NOT in a selection mode + (!isset($aExtraParams['selection_mode']) || ($aExtraParams['selection_mode'] == "")) + // ... "menu" parameter is NOT EXPLICITLY disabled + && (!isset($aExtraParams['menu']) || $aExtraParams['menu'] === "1" || $aExtraParams['menu'] === true) + ) { $oAppContext = new ApplicationContext(); $sContext = $oAppContext->GetForLink(); if (utils::IsNotNullOrEmptyString($sContext)) { diff --git a/sources/Application/UI/Links/Indirect/BlockIndirectLinkSetViewTable.php b/sources/Application/UI/Links/Indirect/BlockIndirectLinkSetViewTable.php index 94f222f6c..41aed8cd1 100644 --- a/sources/Application/UI/Links/Indirect/BlockIndirectLinkSetViewTable.php +++ b/sources/Application/UI/Links/Indirect/BlockIndirectLinkSetViewTable.php @@ -43,7 +43,7 @@ class BlockIndirectLinkSetViewTable extends AbstractBlockLinkSetViewTable 'object_id' => $this->oDbObject->GetKey(), 'target_attr' => $this->oAttDef->GetExtKeyToRemote(), 'view_link' => false, - 'menu' => false, + 'menu' => MetaModel::GetConfig()->Get('allow_menu_on_linkset'), 'display_limit' => true, 'table_id' => $this->GetTableId(), 'zlist' => false,