bug 2900: Improve web service output

git-svn-id: http://piwigo.org/svn/trunk@22729 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2013-05-18 03:58:36 +00:00
parent ac75099200
commit 8083ba10ec
4 changed files with 157 additions and 274 deletions
+3 -5
View File
@@ -226,11 +226,9 @@ class PwgRestEncoder extends PwgResponseEncoder
continue;
if ( is_null($value) )
continue; // null means we dont put it
if ($name!=WS_XML_CONTENT)
$this->_writer->start_element($name);
$this->_writer->start_element($name);
$this->encode($value);
if ($name!=WS_XML_CONTENT)
$this->_writer->end_element($name);
$this->_writer->end_element($name);
}
}
@@ -270,7 +268,7 @@ class PwgRestEncoder extends PwgResponseEncoder
$this->encode_array($data->_content, $data->_itemName, $data->_xmlAttributes);
break;
case 'pwgnamedstruct':
$this->encode_array( array($data->_content), $data->_name, $data->_xmlAttributes);
$this->encode_struct($data->_content, false, $data->_xmlAttributes);
break;
default:
$this->encode_struct(get_object_vars($data), true);