diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php
index 085a6e6ce..fff4b5745 100644
--- a/application/cmdbabstract.class.inc.php
+++ b/application/cmdbabstract.class.inc.php
@@ -2008,7 +2008,7 @@ EOF
}
else
{
- $sUrl = $sDefaultUrl;
+ $sUrl = null;
}
$sHTMLValue = "
\n";
diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php
index 6e22a32e6..f2772e7a3 100644
--- a/core/attributedef.class.inc.php
+++ b/core/attributedef.class.inc.php
@@ -7284,10 +7284,13 @@ class AttributeImage extends AttributeBlob
* @param bool $bLocalize
*
* @return string
+ *
+ * @see edit_image.js for JS generated markup in form edition
*/
public function GetAsHTML($value, $oHostObject = null, $bLocalize = true)
{
$sRet = '';
+ $bIsCustomImage = false;
$iMaxWidthPx = $this->Get('display_max_width').'px';
$iMaxHeightPx = $this->Get('display_max_height').'px';
@@ -7299,10 +7302,14 @@ class AttributeImage extends AttributeBlob
$sCustomImageUrl = $this->GetAttributeImageFileUrl($value, $oHostObject);
if ($sCustomImageUrl !== null) {
+ $bIsCustomImage = true;
$sRet = $this->GetHtmlForImageUrl($sCustomImageUrl, $iMaxWidthPx, $iMaxHeightPx);
}
- return ''.$sRet.'
';
+ $sCssClasses = 'view-image attribute-image';
+ $sCssClasses .= ' '.(($bIsCustomImage) ? 'attribute-image-custom' : 'attribute-image-default');
+
+ return ''.$sRet.'
';
}
private function GetHtmlForImageUrl($sUrl, $iMaxWidthPx, $iMaxHeightPx) {
diff --git a/js/edit_image.js b/js/edit_image.js
index 667fd2873..3d094423c 100644
--- a/js/edit_image.js
+++ b/js/edit_image.js
@@ -32,9 +32,25 @@ $(function()
var sMarkup = '';
sMarkup += '';
- sMarkup += '