Enhance Service locator

This commit is contained in:
Eric Espie
2026-01-27 11:54:05 +01:00
parent 390b5c0bc3
commit bfa7a209d6
43 changed files with 338 additions and 210 deletions

View File

@@ -3,14 +3,17 @@
namespace Combodo\iTop\Application\UI\Base\Layout\DashletPanel;
use Combodo\iTop\Application\Dashlet\Service\DashletService;
use MetaModel;
class DashletPanelFactory
{
public static function MakeForDashboardEditor(string $sId = null): DashletPanel
{
/** @var DashletService $oDashletService */
$oDashletService = MetaModel::GetService('DashletService');
$oDashletPanel = new DashletPanel($sId);
$aAvailableDashlets = DashletService::GetInstance()->GetAvailableDashlets('can_be_created');
$aAvailableDashlets = $oDashletService->GetAvailableDashlets('can_be_created');
foreach ($aAvailableDashlets as $sDashletClass => $aDashletInformation) {
$oDashletEntry = new DashletEntry($sDashletClass, $aDashletInformation['label'], $aDashletInformation['description'], $aDashletInformation['icon']);