diff --git a/application/dashboard.class.inc.php b/application/dashboard.class.inc.php index bc6ef3d80..6cf87500e 100644 --- a/application/dashboard.class.inc.php +++ b/application/dashboard.class.inc.php @@ -28,11 +28,12 @@ abstract class Dashboard protected $aWidgetsData; protected $oDOMNode; protected $sId; + protected $aCells; public function __construct($sId) { $this->sLayoutClass = null; - $this->aDashlets = array(); + $this->aCells = array(); $this->oDOMNode = null; $this->sId = $sId; } @@ -49,15 +50,21 @@ abstract class Dashboard $oTitleNode = $this->oDOMNode->getElementsByTagName('title')->item(0); $this->sTitle = $oTitleNode->textContent; - $oDashletsNode = $this->oDOMNode->getElementsByTagName('dashlets')->item(0); - $oDashletList = $oDashletsNode->getElementsByTagName('dashlet'); - foreach($oDashletList as $oDomNode) + $oCellsNode = $this->oDOMNode->getElementsByTagName('cells')->item(0); + $oCellsList = $oCellsNode->getElementsByTagName('cell'); + foreach($oCellsList as $oCellNode) { - $sDashletClass = $oDomNode->getAttribute('xsi:type'); - $sId = $oDomNode->getAttribute('id'); - $oNewDashlet = new $sDashletClass($sId); - $oNewDashlet->FromDOMNode($oDomNode); - $this->aDashlets[] = $oNewDashlet; + $aDashletList = array(); + $oDashletList = $oCellNode->getElementsByTagName('dashlet'); + foreach($oDashletList as $oDomNode) + { + $sDashletClass = $oDomNode->getAttribute('xsi:type'); + $sId = $oDomNode->getAttribute('id'); + $oNewDashlet = new $sDashletClass($sId); + $oNewDashlet->FromDOMNode($oDomNode); + $aDashletList[] = $oNewDashlet; + } + $this->aCells[] = $aDashletList; } } @@ -77,16 +84,21 @@ abstract class Dashboard $oNode = $oDoc->createElement('title', $this->sTitle); $oMainNode->appendChild($oNode); - $oDashletsNode = $oDoc->createElement('dashlets'); - $oMainNode->appendChild($oDashletsNode); + $oCellsNode = $oDoc->createElement('cells'); + $oMainNode->appendChild($oCellsNode); - foreach ($this->aDashlets as $oDashlet) + foreach ($this->aCells as $aCell) { - $oNode = $oDoc->createElement('dashlet'); - $oDashletsNode->appendChild($oNode); - $oNode->setAttribute('id', $oDashlet->GetID()); - $oNode->setAttribute('xsi:type', get_class($oDashlet)); - $oDashlet->ToDOMNode($oNode); + $oCellNode = $oDoc->createElement('cell'); + $oCellsNode->appendChild($oCellNode); + foreach ($aCell as $oDashlet) + { + $oNode = $oDoc->createElement('dashlet'); + $oCellNode->appendChild($oNode); + $oNode->setAttribute('id', $oDashlet->GetID()); + $oNode->setAttribute('xsi:type', get_class($oDashlet)); + $oDashlet->ToDOMNode($oNode); + } } $sXml = $oDoc->saveXML(); @@ -98,18 +110,23 @@ abstract class Dashboard $this->sLayoutClass = $aParams['layout_class']; $this->sTitle = $aParams['title']; - foreach($aParams['dashlets'] as $aDashletParams) + foreach($aParams['cells'] as $aCell) { - $sDashletClass = $aDashletParams['dashlet_class']; - $sId = $aDashletParams['dashlet_id']; - $oNewDashlet = new $sDashletClass($sId); - - $oForm = $oNewDashlet->GetForm(); - $oForm->SetParamsContainer($sId); - $oForm->SetPrefix(''); - $aValues = $oForm->ReadParams(); - $oNewDashlet->FromParams($aValues); - $this->aDashlets[] = $oNewDashlet; + $aCellDashlets = array(); + foreach($aCell as $aDashletParams) + { + $sDashletClass = $aDashletParams['dashlet_class']; + $sId = $aDashletParams['dashlet_id']; + $oNewDashlet = new $sDashletClass($sId); + + $oForm = $oNewDashlet->GetForm(); + $oForm->SetParamsContainer($sId); + $oForm->SetPrefix(''); + $aValues = $oForm->ReadParams(); + $oNewDashlet->FromParams($aValues); + $aCellDashlets[] = $oNewDashlet; + } + $this->aCells[] = $aCellDashlets; } } @@ -138,7 +155,7 @@ abstract class Dashboard { $this->sTitle = $sTitle; } - + public function AddDashlet() { } @@ -147,7 +164,7 @@ abstract class Dashboard { $oPage->add('