(Retrofit from trunk) N°1123.2 AttributeImage: default_image is no longer mandatory.

SVN:2.4[5041]
This commit is contained in:
Guillaume Lajarige
2017-10-18 14:53:36 +00:00
parent 70561d6331
commit 9f4d07aaa5
3 changed files with 8 additions and 4 deletions

View File

@@ -5522,8 +5522,8 @@ class AttributeImage extends AttributeBlob
{
$iMaxWidthPx = $this->Get('display_max_width');
$iMaxHeightPx = $this->Get('display_max_height');
$sUrl = $this->GetOptional('default_image', '');
$sRet = '<img src="'.$sUrl.'" style="max-width: '.$iMaxWidthPx.'px; max-height: '.$iMaxHeightPx.'px">';
$sUrl = $this->Get('default_image');
$sRet = ($sUrl !== null) ? '<img src="'.$sUrl.'" style="max-width: '.$iMaxWidthPx.'px; max-height: '.$iMaxHeightPx.'px">' : '';
if (is_object($value) && !$value->IsEmpty())
{
if ($oHostObject->IsNew() || ($oHostObject->IsModified() && (array_key_exists($this->GetCode(), $oHostObject->ListChanges()))))

View File

@@ -226,9 +226,9 @@ EOF
$iNewWidth = $iWidth * $fScale;
$iNewHeight = $iHeight * $fScale;
$sUrl = 'data:' . $value->GetMimeType() . ';base64,' . base64_encode($value->GetData());
$sUrl = 'data:'.$value->GetMimeType().';base64,'.base64_encode($value->GetData());
}
$sRet = '<img src="' . $sUrl . '" style="width: ' . $iNewWidth . 'px; height: ' . $iNewHeight . 'px">';
$sRet = ($sUrl !== null) ? '<img src="'.$sUrl.'" style="width: '.$iNewWidth.'px; height: '.$iNewHeight.'px">' : '';
$sRet = '<div class="view-image">'.$sRet.'</div>';
}
else

View File

@@ -1252,6 +1252,10 @@ EOF
{
$aParameters['default_image'] = "utils::GetAbsoluteUrlModulesRoot().'$sModuleRelativeDir/$sDefault'";
}
else
{
$aParameters['default_image'] = 'null';
}
}
elseif ($sAttType == 'AttributeStopWatch')
{