mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
Added support for the 'replaced' operation which is useful for display lists
SVN:trunk[1776]
This commit is contained in:
@@ -522,6 +522,11 @@ class ModelFactory
|
||||
|
||||
protected function _priv_AlterNode(DOMNode $oNode, DOMNode $oDeltaNode)
|
||||
{
|
||||
foreach ($oDeltaNode->attributes as $sName => $oAttrNode)
|
||||
{
|
||||
$oNode->setAttribute($sName, $oAttrNode->value);
|
||||
}
|
||||
|
||||
foreach($oDeltaNode->childNodes as $oChildNode)
|
||||
{
|
||||
$sOperation = $oChildNode->getAttribute('_operation');
|
||||
@@ -553,6 +558,12 @@ class ModelFactory
|
||||
}
|
||||
break;
|
||||
|
||||
case 'replaced':
|
||||
$oNewNode = $this->oDOMDocument->importNode($oChildNode, true); // Import the node and its child nodes
|
||||
$oToModify = $this->_priv_GetNodes($sPath, $oNode)->item(0);
|
||||
$oNode->replaceChild($oNewNode, $oToModify);
|
||||
break;
|
||||
|
||||
case 'created':
|
||||
$oNewNode = $this->oDOMDocument->importNode($oChildNode);
|
||||
$oNode->appendChild($oNewNode);
|
||||
|
||||
Reference in New Issue
Block a user