This commit is contained in:
Eric Espie
2022-05-31 15:37:29 +02:00
parent aed8337c51
commit c9317542c8
8 changed files with 150 additions and 66 deletions

View File

@@ -1080,11 +1080,21 @@ EOF
$sName = $oEvent->getAttribute('id');
$oDescription = $oEvent->GetOptionalElement('description');
$sDescription = empty($oDescription) ? '' : $oDescription->GetText('');
$aArguments = [];
foreach ($oEvent->GetNodes('./arguments/argument') as $oArgumentNode) {
$aArg = [];
$sArgId = $oArgumentNode->getAttribute('id');
$oArgDesc = $oArgumentNode->GetOptionalElement('description');
$aArg['description'] = empty($oArgDesc) ? '' : $oArgDesc->GetText('');
$oArgType = $oArgumentNode->GetOptionalElement('type');
$aArg['type'] = empty($oArgType) ? '' : $oArgType->GetText('');
$aArguments[$sArgId] = $aArg;
}
$sArguments = var_export($aArguments, true);
$sConstant = $sName;
$sOutput = "define('$sConstant', '$sName');\n";
$sOutput .= "Combodo\iTop\Service\EventService::RegisterEvent('$sName', '$sDescription', '$sModuleName');\n";
$sOutput .= "Combodo\iTop\Service\EventService::RegisterEvent('$sName', '$sDescription', $sArguments, '$sModuleName');\n";
return $sOutput;
}