Export feature

This commit is contained in:
Eric Espie
2026-01-23 09:52:37 +01:00
parent 4abf948a03
commit 1bb7ddd488
5 changed files with 91 additions and 17 deletions

View File

@@ -769,4 +769,27 @@ JS
$this->aGridDashlets[] = $aGridDashlet;
}
}
public function ToModelData(): mixed
{
$this->sLayoutClass = DashboardLayoutGrid::class;
$this->sTitle = $aDashboardValues['title'];
$iRefresh = $aDashboardValues['refresh'];
$this->bAutoReload = $iRefresh > 0;
$this->iAutoReloadSec = $iRefresh;
foreach ($aDashboardValues['pos_dashlets'] as $sId => $aPosDashlet) {
$aGridDashlet = [];
$aGridDashlet['position_x'] = $aPosDashlet['position_x'] ?? 0;
$aGridDashlet['position_y'] = $aPosDashlet['position_y'] ?? 0;
$aGridDashlet['width'] = $aPosDashlet['width'] ?? 2;
$aGridDashlet['height'] = $aPosDashlet['height'] ?? 1;
$aDashlet = $aPosDashlet['dashlet'];
$sType = $aDashlet['type'];
$oDashlet = DashletFactory::GetInstance()->CreateDashlet($sType, $sId);
$oDashlet->FromModelData($aDashlet['properties']);
$aGridDashlet['dashlet'] = $oDashlet;
$this->aGridDashlets[] = $aGridDashlet;
}
}
}