mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-21 16:22:20 +02:00
EventService: refactoring
This commit is contained in:
@@ -564,6 +564,8 @@ class ModelFactory
|
||||
|
||||
$this->oMeta = $this->oDOMDocument->CreateElement('meta');
|
||||
$this->oRoot->AppendChild($this->oMeta);
|
||||
$this->oMeta = $this->oDOMDocument->CreateElement('events');
|
||||
$this->oRoot->AppendChild($this->oMeta);
|
||||
|
||||
foreach ($aRootNodeExtensions as $sElementName)
|
||||
{
|
||||
@@ -844,6 +846,14 @@ class ModelFactory
|
||||
$oNode->SetAttribute('_created_in', $sModuleName);
|
||||
}
|
||||
}
|
||||
$oNodeList = $oXPath->query('/itop_design/events/event');
|
||||
foreach ($oNodeList as $oNode)
|
||||
{
|
||||
if ($oNode->getAttribute('_created_in') == '')
|
||||
{
|
||||
$oNode->SetAttribute('_created_in', $sModuleName);
|
||||
}
|
||||
}
|
||||
$oNodeList = $oXPath->query('/itop_design/menus/menu');
|
||||
foreach ($oNodeList as $oNode)
|
||||
{
|
||||
@@ -1236,6 +1246,19 @@ EOF
|
||||
return $this->GetNodes("/itop_design/constants/constant[@_created_in='$sModuleName']");
|
||||
}
|
||||
|
||||
/**
|
||||
* List all events from the DOM, for a given module
|
||||
*
|
||||
* @param string $sModuleName
|
||||
*
|
||||
* @return \DOMNodeList
|
||||
* @throws Exception
|
||||
*/
|
||||
public function ListEvents($sModuleName)
|
||||
{
|
||||
return $this->GetNodes("/itop_design/events/event[@_created_in='$sModuleName']");
|
||||
}
|
||||
|
||||
/**
|
||||
* List all classes from the DOM, for a given module
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user