mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-05 00:18:46 +02:00
XML Datamodel: new format (version + zlists changed) - not compatible with 2.0 alpha!!!
SVN:trunk[2342]
This commit is contained in:
@@ -242,6 +242,30 @@ EOF;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to form a valid ZList from the array built by GetNodeAsArrayOfItems()
|
||||
*/
|
||||
protected function ArrayOfItemsToZList(&$aItems)
|
||||
{
|
||||
$aTransformed = array();
|
||||
foreach ($aItems as $key => $value)
|
||||
{
|
||||
if (is_null($value))
|
||||
{
|
||||
$aTransformed[] = $key;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (is_array($value))
|
||||
{
|
||||
$this->ArrayOfItemsToZList($value);
|
||||
}
|
||||
$aTransformed[$key] = $value;
|
||||
}
|
||||
}
|
||||
$aItems = $aTransformed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to format the flags for an attribute, in a given state
|
||||
* @param object $oAttNode DOM node containing the information to build the flags
|
||||
@@ -847,6 +871,7 @@ EOF;
|
||||
if ($oListNode)
|
||||
{
|
||||
$aAttributes = $oListNode->GetNodeAsArrayOfItems();
|
||||
$this->ArrayOfItemsToZList($aAttributes);
|
||||
|
||||
$sZAttributes = var_export($aAttributes, true);
|
||||
$sZlists .= " MetaModel::Init_SetZListItems('$sListCode', $sZAttributes);\n";
|
||||
|
||||
Reference in New Issue
Block a user