N°3185 - Rename tag to "main_logo_compact" and complete XML migration methods

This commit is contained in:
Molkobain
2020-08-04 10:17:11 +02:00
parent 19b5290e80
commit c93c53488d
4 changed files with 13 additions and 9 deletions

View File

@@ -2747,7 +2747,7 @@ EOF;
$this->CompileLogo($oBrandingNode, $sTempTargetDir, $sFinalTargetDir, 'login_logo', 'login-logo');
$this->CompileLogo($oBrandingNode, $sTempTargetDir, $sFinalTargetDir, 'main_logo', 'main-logo-full');
$this->CompileLogo($oBrandingNode, $sTempTargetDir, $sFinalTargetDir, 'main_logo_square', 'main-logo-square');
$this->CompileLogo($oBrandingNode, $sTempTargetDir, $sFinalTargetDir, 'main_logo_compact', 'main-logo-compact');
$this->CompileLogo($oBrandingNode, $sTempTargetDir, $sFinalTargetDir, 'portal_logo', 'portal-logo');
// Cleanup the images directory (eventually made by CompileFiles)

View File

@@ -783,6 +783,10 @@ class iTopDesignFormat
// -- 3182 - Remove style node from MenuGroup
$sPath = "/itop_design/menus/menu[@xsi:type='MenuGroup']/style";
$this->RemoveNodeFromXPath($sPath);
// -- 3185 - Remove main_logo_compact node from branding
$sPath = "/itop_design/branding/main_logo_compact";
$this->RemoveNodeFromXPath($sPath);
}
/**

View File

@@ -32,8 +32,8 @@ class Branding
{
/** @var string Full main logo, used everywhere when there is no need for a special one */
const ENUM_LOGO_TYPE_MAIN_LOGO_FULL = 'main_logo_full';
/** @var string Square main logo, used in the collapsed menu of the backoffice */
const ENUM_LOGO_TYPE_MAIN_LOGO_SQUARE = 'main_logo_square';
/** @var string Compact main logo, used in the collapsed menu of the backoffice */
const ENUM_LOGO_TYPE_MAIN_LOGO_COMPACT = 'main_logo_compact';
/** @var string Logo used in the end-users portal */
const ENUM_LOGO_TYPE_PORTAL_LOGO = 'portal_logo';
/** @var string Logo used in the login pages */
@@ -47,9 +47,9 @@ class Branding
'default' => 'images/itop-logo.png',
'custom' => 'branding/main-logo-full.png',
],
self::ENUM_LOGO_TYPE_MAIN_LOGO_SQUARE => [
self::ENUM_LOGO_TYPE_MAIN_LOGO_COMPACT => [
'default' => 'images/itop-logo-square.png',
'custom' => 'branding/main-logo-square.png',
'custom' => 'branding/main-logo-compact.png',
],
self::ENUM_LOGO_TYPE_PORTAL_LOGO => [
'default' => 'images/logo-itop-dark-bg.svg',
@@ -99,14 +99,14 @@ class Branding
}
/**
* Return the absolute URL for the square main logo
* Return the absolute URL for the compact main logo
*
* @return string
* @throws \Exception
*/
public static function GetSquareMainLogoAbsoluteUrl()
public static function GetCompactMainLogoAbsoluteUrl()
{
return static::GetLogoAbsoluteUrl(static::ENUM_LOGO_TYPE_MAIN_LOGO_SQUARE);
return static::GetLogoAbsoluteUrl(static::ENUM_LOGO_TYPE_MAIN_LOGO_COMPACT);
}
/**

View File

@@ -84,7 +84,7 @@ class NavigationMenu extends UIBlock
parent::__construct($sId);
$this->sAppRevisionNumber = utils::GetAppRevisionNumber();
$this->sAppSquareIconUrl = Branding::GetSquareMainLogoAbsoluteUrl();
$this->sAppSquareIconUrl = Branding::GetCompactMainLogoAbsoluteUrl();
$this->sAppFullIconUrl = Branding::GetFullMainLogoAbsoluteUrl();
$this->sAppIconLink = MetaModel::GetConfig()->Get('app_icon_url');
$this->aMenuGroups = ApplicationMenu::GetMenuGroups($oAppContext->GetAsHash());