issue 2119. supporting php 5.4. widget and xml classes.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12697 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2013-02-05 03:25:47 +00:00
parent 285301a8c9
commit ba9800ff34
37 changed files with 1187 additions and 473 deletions

View file

@ -1,4 +1,5 @@
<?php
/**
* XmlGenerator class
* @author NHN (developers@xpressengine.com)
@ -7,6 +8,7 @@
*/
class XmlGenerator
{
/**
* object change to xml
* @param object $xml
@ -36,12 +38,11 @@ class XmlGenerator
switch($key)
{
case 'node_name' : break;
case 'attrs' :
{
case 'attrs' : {
$attrs = '';
if (isset($value))
if(isset($value))
{
foreach($value as $attrName=>$attrValue)
foreach($value as $attrName => $attrValue)
{
$attrs .= sprintf(' %s="%s"', $attrName, htmlspecialchars($attrValue));
}
@ -51,9 +52,8 @@ class XmlGenerator
case 'body' :
$body = $value;
break;
default :
{
if (is_array($value))
default : {
if(is_array($value))
{
foreach($value as $idx => $arrNode)
{
@ -67,8 +67,9 @@ class XmlGenerator
}
}
}
return sprintf('<%s%s>%s</%s>'."\n", $node->node_name, $attrs, $body, $node->node_name);
return sprintf('<%s%s>%s</%s>' . "\n", $node->node_name, $attrs, $body, $node->node_name);
}
}
/* End of file XmlGenerator.class.php */
/* Location: ./classes/xml/XmlGenerator.class.php */