N°7315 - Migrate relative images URLs to absolute ones in order to support pages on different depth levels

This commit is contained in:
Molkobain
2024-01-18 19:35:24 +01:00
parent db4dfe1ba3
commit 8c7b33fb06
16 changed files with 51 additions and 45 deletions

View File

@@ -55,7 +55,6 @@ class FormHelper
*/
public static function DisableAttributeBlobInputs(string $sClassName, array &$aExtraParams): void
{
// Initialize extra params array
if (!array_key_exists('fieldsFlags', $aExtraParams)) {
$aExtraParams['fieldsFlags'] = [];
@@ -64,13 +63,13 @@ class FormHelper
$aExtraParams['fieldsComments'] = [];
}
// Iterate throw class attributes...
// Iterate through class attributes...
$sAppRootUrl = utils::GetAbsoluteUrlAppRoot();
foreach (MetaModel::ListAttributeDefs($sClassName) as $sAttCode => $oAttDef) {
// Set attribute blobs in read only
if ($oAttDef instanceof AttributeBlob) {
$aExtraParams['fieldsFlags'][$sAttCode] = OPT_ATT_READONLY;
$aExtraParams['fieldsComments'][$sAttCode] = '&nbsp;<img src="../images/transp-lock.png" style="vertical-align:middle" title="'.utils::EscapeHtml(Dict::S('UI:UploadNotSupportedInThisMode')).'"/>';
$aExtraParams['fieldsComments'][$sAttCode] = '&nbsp;<img src="' . $sAppRootUrl . 'images/transp-lock.png" style="vertical-align:middle" title="'.utils::EscapeHtml(Dict::S('UI:UploadNotSupportedInThisMode')).'"/>';
}
}
}