XML Datamodel: new format (version + zlists changed) - not compatible with 2.0 alpha!!!

SVN:trunk[2342]
This commit is contained in:
Romain Quetiez
2012-10-24 13:54:02 +00:00
parent 80ec842042
commit d7e492b711
25 changed files with 16555 additions and 6801 deletions

View File

@@ -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";