From 27022ed93a7d023ded589f08a331e0843833bd2d Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Mon, 26 Feb 2024 18:51:38 +0100 Subject: [PATCH 1/3] =?UTF-8?q?N=C2=B03777=20-=20favicon:=20change=20easil?= =?UTF-8?q?y=20favicon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/loginwebpage.class.inc.php | 11 +++ core/config.class.inc.php | 75 +++++++++++-------- .../PortalXmlConfiguration/Basic.php | 13 ++-- .../portal/templates/layout.html.twig | 4 +- .../datamodel.itop-structure.xml | 4 +- setup/compiler.class.inc.php | 45 +++++------ setup/itopdesignformat.class.inc.php | 30 +++++++- sources/Application/Branding.php | 33 ++++++-- .../WebPage/UnauthenticatedWebPage.php | 11 +++ .../datamodels/datamodel-branding.xml | 6 +- 10 files changed, 156 insertions(+), 76 deletions(-) diff --git a/application/loginwebpage.class.inc.php b/application/loginwebpage.class.inc.php index e047cf7619..cd7904cf55 100644 --- a/application/loginwebpage.class.inc.php +++ b/application/loginwebpage.class.inc.php @@ -110,6 +110,17 @@ protected function GetFaviconAbsoluteUrl() return Branding::GetLoginFavIconAbsoluteUrl(); } + /** + * Return the absolute URL for the favicon + * + * @return string + * @throws \Exception + */ + protected function GetFaviconAbsoluteUrl() + { + return Branding::GetLoginFavIconAbsoluteUrl(); + } + public static function SetLoginFailedMessage($sMessage) { self::$m_sLoginFailedMessage = $sMessage; diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 8380a3fdc9..2d1830582c 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -185,7 +185,7 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => false, ], - 'temporary_object.garbage_interval' => [ + 'temporary_object.garbage_interval' => [ 'type' => 'integer', 'description' => 'Seconds between garbage collections', 'default' => 60, @@ -193,7 +193,7 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => false, ], - 'app_env_label' => [ + 'app_env_label' => [ 'type' => 'string', 'description' => 'Label displayed to describe the current application environment, defaults to the environment name (e.g. "production")', 'default' => '', @@ -201,7 +201,7 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => false, ], - 'app_root_url' => [ + 'app_root_url' => [ 'type' => 'string', 'description' => 'Root URL used for navigating within the application, or from an email to the application (you can put $SERVER_NAME$ as a placeholder for the server\'s name)', 'default' => '', @@ -209,7 +209,15 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => true, ], - 'app_icon_url' => [ + 'branding_environment' => [ + 'type' => 'string', + 'description' => 'type of branding. usefull for put different logo depending environment', + 'default' => null, + 'value' => null, + 'source_of_value' => '', + 'show_in_conf_sample' => false, + ], + 'app_icon_url' => [ 'type' => 'string', 'description' => 'Hyperlink to redirect the user when clicking on the application icon (in the main window, or login/logoff pages)', 'default' => 'http://www.combodo.com/itop', @@ -217,50 +225,50 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => false, ], - 'db_host' => [ + 'db_host' => [ 'type' => 'string', 'default' => null, 'value' => '', 'source_of_value' => '', 'show_in_conf_sample' => true, ], - 'db_user' => [ - 'type' => 'string', - 'default' => null, - 'value' => '', - 'source_of_value' => '', + 'db_user' => [ + 'type' => 'string', + 'default' => null, + 'value' => '', + 'source_of_value' => '', 'show_in_conf_sample' => true, ], - 'db_pwd' => [ - 'type' => 'string', - 'default' => null, - 'value' => '', - 'source_of_value' => '', + 'db_pwd' => [ + 'type' => 'string', + 'default' => null, + 'value' => '', + 'source_of_value' => '', 'show_in_conf_sample' => true, ], - 'db_name' => [ - 'type' => 'string', - 'default' => null, - 'value' => '', - 'source_of_value' => '', + 'db_name' => [ + 'type' => 'string', + 'default' => null, + 'value' => '', + 'source_of_value' => '', 'show_in_conf_sample' => true, ], - 'db_subname' => [ - 'type' => 'string', - 'default' => null, - 'value' => '', - 'source_of_value' => '', + 'db_subname' => [ + 'type' => 'string', + 'default' => null, + 'value' => '', + 'source_of_value' => '', 'show_in_conf_sample' => true, ], - 'db_tls.enabled' => [ - 'type' => 'bool', - 'description' => 'If true then the connection to the DB will be encrypted', - 'default' => false, - 'value' => false, - 'source_of_value' => '', + 'db_tls.enabled' => [ + 'type' => 'bool', + 'description' => 'If true then the connection to the DB will be encrypted', + 'default' => false, + 'value' => false, + 'source_of_value' => '', 'show_in_conf_sample' => false, ], - 'db_tls.ca' => [ + 'db_tls.ca' => [ 'type' => 'string', 'description' => 'Path to certificate authority file for SSL', 'default' => null, @@ -268,7 +276,7 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => false, ], - 'db_core_transactions_enabled' => [ + 'db_core_transactions_enabled' => [ 'type' => 'bool', 'description' => 'If true, CRUD transactions in iTop core will be enabled', 'default' => true, @@ -1888,6 +1896,7 @@ public function Set($sPropCode, $value, $sSourceDesc = 'unknown', $bCanOverride */ public function Get($sPropCode) { + return $this->m_aSettings[$sPropCode]['value']; } diff --git a/datamodels/2.x/itop-portal-base/portal/src/DependencyInjection/SilexCompatBootstrap/PortalXmlConfiguration/Basic.php b/datamodels/2.x/itop-portal-base/portal/src/DependencyInjection/SilexCompatBootstrap/PortalXmlConfiguration/Basic.php index 2c8f40a788..7fcf31ecdd 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/DependencyInjection/SilexCompatBootstrap/PortalXmlConfiguration/Basic.php +++ b/datamodels/2.x/itop-portal-base/portal/src/DependencyInjection/SilexCompatBootstrap/PortalXmlConfiguration/Basic.php @@ -72,6 +72,7 @@ public function Process(Container $oContainer) */ private function GetInitialPortalConf() { + $aPortalConf = array( 'properties' => array( 'id' => $_ENV['PORTAL_ID'], @@ -81,15 +82,15 @@ private function GetInitialPortalConf() 'favicon' => Branding::GetPortalFavIconAbsoluteUrl(), 'themes' => array( 'bootstrap' => 'itop-portal-base/portal/public/css/bootstrap-theme-combodo.scss', - 'portal' => 'itop-portal-base/portal/public/css/portal.scss', - 'others' => array(), + 'portal' => 'itop-portal-base/portal/public/css/portal.scss', + 'others' => array(), ), - 'templates' => array( + 'templates' => array( 'layout' => 'itop-portal-base/portal/templates/layout.html.twig', - 'home' => 'itop-portal-base/portal/templates/home/layout.html.twig', + 'home' => 'itop-portal-base/portal/templates/home/layout.html.twig', ), - 'urlmaker_class' => null, - 'triggers_query' => null, + 'urlmaker_class' => null, + 'triggers_query' => null, 'attachments' => array( 'allow_delete' => true, ), diff --git a/datamodels/2.x/itop-portal-base/portal/templates/layout.html.twig b/datamodels/2.x/itop-portal-base/portal/templates/layout.html.twig index 25f1c37415..8f9578c6c4 100644 --- a/datamodels/2.x/itop-portal-base/portal/templates/layout.html.twig +++ b/datamodels/2.x/itop-portal-base/portal/templates/layout.html.twig @@ -25,7 +25,7 @@ {% block pPageExtraMetas %} {% endblock %} {% block pPageTitle %}{% if sPageTitle is defined and sPageTitle is not null %}{{ sPageTitle }} - {{ constant('ITOP_APPLICATION_SHORT') }}{% else %}{{ 'Page:DefaultTitle'|dict_format(constant('ITOP_APPLICATION_SHORT')) }}{% endif %}{% endblock %} - + {% block pPageStylesheets %} {# First bootstrap core, lib themes, then bootstrap theme, portal adjustements #} @@ -251,7 +251,7 @@ {% endblock %} - {# Sidebar navigation menu for normal screens #} + {# Sidebar navigation menu for normal screens #} {% block pNavigationSideMenuWrapper %}