N°3928 - Polishing: Impact analysis

This commit is contained in:
acognet
2021-10-07 11:45:53 +02:00
parent a7a9e5f0eb
commit 0eba00259a
2 changed files with 18 additions and 2 deletions

View File

@@ -71,15 +71,31 @@ class Branding
$sDefaultLogoPath = static::$aLogoPaths[$sType]['default'];
$sWorkingPath = APPROOT.'env-'.utils::GetCurrentEnvironment().'/';
$aThemeParameters = json_decode(@file_get_contents($sWorkingPath.'branding/logos.json'), true);
if ( isset( $aThemeParameters[$sType])) {
if (isset($aThemeParameters[$sType])) {
$sCustomLogoPath = $aThemeParameters[$sType];
if (file_exists($sWorkingPath.$sCustomLogoPath)) {
return utils::GetAbsoluteUrlModulesRoot().$sCustomLogoPath.'?t='.utils::GetCacheBusterTimestamp();
}
}
return utils::GetAbsoluteUrlAppRoot().$sDefaultLogoPath.'?t='.utils::GetCacheBusterTimestamp();
}
public static function GetLogoRelativePath($sType = self::DEFAULT_LOGO_TYPE)
{
$sDefaultLogoPath = static::$aLogoPaths[$sType]['default'];
$sWorkingPath = APPROOT.'env-'.utils::GetCurrentEnvironment().'/';
$aThemeParameters = json_decode(@file_get_contents($sWorkingPath.'branding/logos.json'), true);
if (isset($aThemeParameters[$sType])) {
$sCustomLogoPath = $aThemeParameters[$sType];
if (file_exists($sWorkingPath.$sCustomLogoPath)) {
return $sWorkingPath.$sCustomLogoPath;
}
}
return $sWorkingPath.$sDefaultLogoPath;
}
/**
* Return the absolute URL for the full main logo
*

View File

@@ -93,7 +93,7 @@ class iTopPDF extends TCPDF
'', true, 0, false, true, 15, 'M' /* $valign */);
// Branding logo
$sBrandingIcon = Branding::GetFullMainLogoAbsoluteUrl();
$sBrandingIcon = Branding::GetLogoRelativePath(Branding::ENUM_LOGO_TYPE_MAIN_LOGO_FULL);
$this->Image($sBrandingIcon, $aMargins['left'], 5, 0, 10);
}