Skip to content

Commit

Permalink
v3.0.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jetiben committed Oct 7, 2017
1 parent 03f207b commit 992dbf5
Showing 1 changed file with 43 additions and 4 deletions.
47 changes: 43 additions & 4 deletions php/v3.0(C)/common/incfiles/lib/jtbc/page.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,51 @@ public static function breadcrumb($argAry = null)
return $breadcrumb;
}

public static function formatResult($argStatus, $argHTML)
public static function formatResult($argStatus, $argResult)
{
$status = $argStatus;
$html = $argHTML;
$html = str_replace(']]>', ']]]]><![CDATA[>', $html);
$tmpstr = '<?xml version="1.0" encoding="utf-8"?><result status="' . base::getNum($status, 0) . '"><![CDATA[' . $html . ']]></result>';
$result = $argResult;
$tmpstr = '<?xml version="1.0" encoding="utf-8"?>';
if (!is_array($result))
{
$result = str_replace(']]>', ']]]]><![CDATA[>', $result);
$tmpstr .= '<result status="' . base::getNum($status, 0) . '"><![CDATA[' . $result . ']]></result>';
}
else
{
$tmpstr .= '<result status="' . base::getNum($status, 0) . '">';
if (count($result) == count($result, 1))
{
$tmpstr .= '<item';
foreach ($result as $key => $val)
{
if (!is_numeric($key))
{
$tmpstr .= ' ' . base::htmlEncode(base::getLRStr($key, '_', 'rightr')) . '="' . base::htmlEncode($val) . '"';
}
}
$tmpstr .= '></item>';
}
else
{
foreach ($result as $i => $item)
{
if (is_array($item))
{
$tmpstr .= '<item';
foreach ($item as $key => $val)
{
if (!is_numeric($key))
{
$tmpstr .= ' ' . base::htmlEncode(base::getLRStr($key, '_', 'rightr')) . '="' . base::htmlEncode($val) . '"';
}
}
$tmpstr .= '></item>';
}
}
}
$tmpstr .= '</result>';
}
return $tmpstr;
}

Expand Down

0 comments on commit 992dbf5

Please sign in to comment.