Fixed setup issues (improved modularity)

SVN:trunk[1982]
This commit is contained in:
Romain Quetiez
2012-05-10 09:30:48 +00:00
parent fb8d93319d
commit 39be3b449e
9 changed files with 457 additions and 340 deletions

View File

@@ -124,6 +124,7 @@ class ModelFactory
$this->sRootDir = $sRootDir;
$this->oDOMDocument = new MFDocument();
$this->oRoot = $this->oDOMDocument->CreateElement('itop_design');
$this->oRoot->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance");
$this->oDOMDocument->AppendChild($this->oRoot);
$this->oModules = $this->oDOMDocument->CreateElement('loaded_modules');
$this->oRoot->AppendChild($this->oModules);
@@ -299,12 +300,18 @@ class ModelFactory
$oNodeList = $oXPath->query('/itop_design/classes//class');
foreach($oNodeList as $oNode)
{
$oNode->SetAttribute('_created_in', $sModuleName);
if ($oNode->getAttribute('_created_in') == '')
{
$oNode->SetAttribute('_created_in', $sModuleName);
}
}
$oNodeList = $oXPath->query('/itop_design/menus/menu');
foreach($oNodeList as $oNode)
{
$oNode->SetAttribute('_created_in', $sModuleName);
if ($oNode->getAttribute('_created_in') == '')
{
$oNode->SetAttribute('_created_in', $sModuleName);
}
}
$oDeltaRoot = $oDocument->childNodes->item(0);
@@ -1648,9 +1655,9 @@ class MFDocument extends DOMDocument
if (!$oRootNode)
{
$oRootNode = $this->createElement('itop_design'); // make sure that the document is not empty
$oRootNode->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance");
$this->appendChild($oRootNode);
}
$oRootNode->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance");
return parent::saveXML();
}
/**