(string)$proposedValue);
}
return $proposedValue;
}
public function GetAsHTML($value, $oHostObject = null, $bLocalize = true)
{
if (!is_array($value)) {
throw new CoreException('Expecting an array', array('found' => get_class($value)));
}
if (count($value) == 0) {
return "";
}
$sRes = "
";
$sRes .= "";
foreach ($value as $sProperty => $sValue) {
if ($sProperty == 'auth_pwd') {
$sValue = '*****';
}
$sRes .= "";
$sCell = str_replace("\n", "
\n", Str::pure2html(@(string)$sValue));
$sRes .= "$sProperty | $sCell | ";
$sRes .= "
";
}
$sRes .= "";
$sRes .= "
";
return $sRes;
}
public function GetAsCSV(
$value, $sSeparator = ',', $sTextQualifier = '"', $oHostObject = null, $bLocalize = true,
$bConvertToPlainText = false
)
{
if (!is_array($value) || count($value) == 0) {
return "";
}
$aRes = array();
foreach ($value as $sProperty => $sValue) {
if ($sProperty == 'auth_pwd') {
$sValue = '*****';
}
$sFrom = array(',', '=');
$sTo = array('\,', '\=');
$aRes[] = $sProperty.'='.str_replace($sFrom, $sTo, (string)$sValue);
}
$sRaw = implode(',', $aRes);
$sFrom = array("\r\n", $sTextQualifier);
$sTo = array("\n", $sTextQualifier.$sTextQualifier);
$sEscaped = str_replace($sFrom, $sTo, $sRaw);
return $sTextQualifier.$sEscaped.$sTextQualifier;
}
public function GetAsXML($value, $oHostObject = null, $bLocalize = true)
{
if (!is_array($value) || count($value) == 0) {
return "";
}
$sRes = "";
foreach ($value as $sProperty => $sValue) {
if ($sProperty == 'auth_pwd') {
$sValue = '*****';
}
$sRes .= "";
$sRes .= Str::pure2xml((string)$sValue);
$sRes .= "";
}
return $sRes;
}
}