Exports: attribute "final class" is either translated or not, depending on the no_localize option (all formats concerned with this option: CSV and spreadsheet -That field is not present in the XML format output)

SVN:trunk[3727]
This commit is contained in:
Romain Quetiez
2015-09-07 14:30:07 +00:00
parent 1bb2d168fa
commit 5fa83c84d3

View File

@@ -1910,11 +1910,52 @@ class AttributeFinalClass extends AttributeString
}
public function GetAsHTML($sValue, $oHostObject = null, $bLocalize = true)
{
if (empty($sValue)) return '';
if ($bLocalize)
{
return MetaModel::GetName($sValue);
}
else
{
return $sValue;
}
}
// Because this is sometimes used to get a localized/string version of an attribute...
public function GetEditValue($sValue, $oHostObj = null)
{
if (empty($sValue)) return '';
return MetaModel::GetName($sValue);
}
public function GetAsCSV($value, $sSeparator = ',', $sTextQualifier = '"', $oHostObject = null, $bLocalize = true)
{
if ($bLocalize && $value != '')
{
$sRawValue = MetaModel::GetName($value);
}
else
{
$sRawValue = $value;
}
return parent::GetAsCSV($sRawValue, $sSeparator, $sTextQualifier, null, false);
}
public function GetAsXML($value, $oHostObject = null, $bLocalize = true)
{
if (empty($value)) return '';
if ($bLocalize)
{
$sRawValue = MetaModel::GetName($value);
}
else
{
$sRawValue = $value;
}
return Str::pure2xml($sRawValue);
}
public function GetBasicFilterLooseOperator()
{
return '=';