[2010-12-03 16:46:07] Rev:638 | 2 files Modified

erik: Languages Export, reingering of this module was apply
--------------------------------------------------------------------------------
1. M /trunk/workflow/engine/methods/setup/languages_Export.php
2. M /trunk/gulliver/system/class.dynaformhandler.php
This commit is contained in:
Erik Amaru Ortiz
2010-12-09 13:21:40 +00:00
parent 74b497c90b
commit e59d934a43
2 changed files with 170 additions and 120 deletions

View File

@@ -551,6 +551,39 @@ class dynaFormHandler
} else
$xnode->appendChild($newNode);
}
function getArray($node, $attributes = null)
{
$array = false;
$array['__nodeName__'] = $node->nodeName;
if ($node->hasAttributes()){
if( isset($attributes) ){
foreach ($attributes as $attr) {
if( $node->hasAttribute($attr) )
$array[$attr] = $node->getAttribute($attr);
}
} else {
foreach ($node->attributes as $attr) {
$array[$attr->nodeName] = $attr->nodeValue;
}
}
}
if ($node->hasChildNodes()) {
if ($node->childNodes->length == 0)
$return;
else {
foreach ($node->childNodes as $childNode) {
if ($childNode->nodeType != XML_TEXT_NODE && $childNode->nodeType != XML_CDATA_SECTION_NODE)
$array[$childNode->nodeName][] = $this->getArray($childNode);
else
$array[$childNode->nodeName] = $childNode->nodeValue;
}
}
}
return $array;
}
}
//examples...........