mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°3928 - Polishing: Impact analysis
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user