From a948c3c54ec23f01eac347cd3515c8c405eeb16d Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Wed, 10 Mar 2021 11:15:42 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B03566=20Hub=20connector=20migrate=20to=20?= =?UTF-8?q?UiBlock=20:=20deployed=20extensions=20page=20Hub=20button=20is?= =?UTF-8?q?=20back=20between=20fieldsets.=20it=20is=20also=20now=20primary?= =?UTF-8?q?=20and=20has=20a=20specific=20css=20class=20applied?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2.x/itop-hub-connector/myextensions.php | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/datamodels/2.x/itop-hub-connector/myextensions.php b/datamodels/2.x/itop-hub-connector/myextensions.php index 1a4ec3aa2..0e058926f 100644 --- a/datamodels/2.x/itop-hub-connector/myextensions.php +++ b/datamodels/2.x/itop-hub-connector/myextensions.php @@ -8,6 +8,7 @@ use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\FieldSet\FieldSetUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\Title\TitleUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory; use Combodo\iTop\Application\UI\Base\UIBlock; require_once('../approot.inc.php'); @@ -47,12 +48,6 @@ try { $oPage->AddUiBlock(TitleUIBlockFactory::MakeForPage(Dict::S('iTopHub:InstalledExtensions'))); - //--- add extension button START - $sUrl = utils::GetAbsoluteUrlModulePage('itop-hub-connector', 'launch.php', array('target' => 'browse_extensions')); - $oInstallExtButton = ButtonUIBlockFactory::MakeNeutral(Dict::S('iTopHub:GetMoreExtensions'), 'install-extensions-button') - ->SetOnClickJsCode("window.location.href='$sUrl'"); - $oPage->AddSubBlock($oInstallExtButton); - //--- add extension button END /**------------------------------------------------------------------------------------------------------ @@ -79,6 +74,17 @@ try { } } + /**------------------------------------------------------------------------------------------------------ + * Hub button + */ + $oHubButtonContainer = UIContentBlockUIBlockFactory::MakeStandard() + ->AddCSSClass('hub-button'); + $oPage->AddSubBlock($oHubButtonContainer); + $sUrl = utils::GetAbsoluteUrlModulePage('itop-hub-connector', 'launch.php', array('target' => 'browse_extensions')); + $oHubButton = ButtonUIBlockFactory::MakeForPrimaryAction(Dict::S('iTopHub:GetMoreExtensions'), 'install-extensions-button') + ->SetOnClickJsCode("window.location.href='$sUrl'"); + $oHubButtonContainer->AddSubBlock($oHubButton); + /**------------------------------------------------------------------------------------------------------ * Manually deployed ext @@ -101,6 +107,12 @@ try { $sExtensionsDirTooltip = json_encode(APPROOT.'extensions'); $oPage->add_style( <<