Save as XML serialized

This commit is contained in:
Eric Espie
2026-01-21 17:27:16 +01:00
parent 945d2f32c5
commit e909c41445
27 changed files with 536 additions and 919 deletions

View File

@@ -64,7 +64,7 @@ class DashletObjectList extends Dashlet
$oBlock = new DisplayBlock($oFilter, 'list');
$aParams = [
'menu' => $sShowMenu,
'table_id' => self::APPUSERPREFERENCES_PREFIX.$this->sId,
'table_id' => self::APP_USER_PREFERENCES_PREFIX.$this->sId,
'surround_with_panel' => true,
'max_height' => '500px',
"panel_title" => Dict::S($sTitle),

View File

@@ -7,11 +7,7 @@
namespace Combodo\iTop\Application\Dashlet;
use Combodo\iTop\Application\Helper\WebResourcesHelper;
use Combodo\iTop\Application\UI\Base\Component\Dashlet\DashletContainer;
use Combodo\iTop\Application\UI\Base\Component\Dashlet\DashletFactory;
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory;
use Combodo\iTop\Application\UI\Base\iUIBlock;
use Combodo\iTop\Application\UI\Base\UIBlock;
use Combodo\iTop\Application\WebPage\WebPage;
@@ -38,7 +34,7 @@ use utils;
abstract class Dashlet
{
/** @var string */
public const APPUSERPREFERENCES_PREFIX = 'Dashlet';
public const APP_USER_PREFERENCES_PREFIX = 'Dashlet';
protected $oModelReflection;
protected $sId;
@@ -203,9 +199,10 @@ abstract class Dashlet
$this->OnUpdate();
}
public function FromDenormalizedParams(array $aDenormalizedParams)
public function FromModelData(array $aModelData)
{
$this->aProperties = XMLNormalizer::GetInstance()->Normalize($aDenormalizedParams, $this->sDashletType, 'Dashlet');
$this->aProperties = $aModelData;
// $this->aProperties = XMLNormalizer::GetInstance()->Normalize($aModelData, $this->sDashletType, 'Dashlet');
$this->OnUpdate();
}
@@ -331,7 +328,10 @@ EOF
*
* @return mixed
*/
abstract public function GetPropertiesFields(\DesignerForm $oForm);
public function GetPropertiesFields(\DesignerForm $oForm)
{
return null;
}
/**
* @param \DOMNode $oContainerNode
@@ -514,8 +514,9 @@ EOF
$this->sDashletType = $sDashletType;
}
public function GetDenormalizedProperties(): ?array
public function GetModelData(): ?array
{
return XMLNormalizer::GetInstance()->Denormalize($this->aProperties, $this->sDashletType, 'Dashlet');
return $this->aProperties;
//return XMLNormalizer::GetInstance()->Denormalize($this->aProperties, $this->sDashletType, 'Dashlet');
}
}