diff --git a/application/loginwebpage.class.inc.php b/application/loginwebpage.class.inc.php index a7ecd12fb9..1f66ef5ba6 100644 --- a/application/loginwebpage.class.inc.php +++ b/application/loginwebpage.class.inc.php @@ -82,7 +82,7 @@ public static function NewLoginWebPage() } protected static $m_sLoginFailedMessage = ''; - + public function __construct($sTitle = null) { if ($sTitle === null) { @@ -101,6 +101,17 @@ public function SetStyleSheet() $this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-awesome/css/all.min.css'); } + /** + * 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 4b1ad7e4cb..991b752f89 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, @@ -1833,6 +1841,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/combodo-backoffice-darkmoon-theme/datamodel.combodo-backoffice-darkmoon-theme.xml b/datamodels/2.x/combodo-backoffice-darkmoon-theme/datamodel.combodo-backoffice-darkmoon-theme.xml index cbebe53208..2f9e04b56e 100644 --- a/datamodels/2.x/combodo-backoffice-darkmoon-theme/datamodel.combodo-backoffice-darkmoon-theme.xml +++ b/datamodels/2.x/combodo-backoffice-darkmoon-theme/datamodel.combodo-backoffice-darkmoon-theme.xml @@ -1,6 +1,6 @@ - + @@ -17,5 +17,5 @@ combodo-backoffice-darkmoon-theme/precompiled-themes/main.css - + 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 5a6d125274..33f4047a10 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 @@ -52,6 +52,8 @@ public function Process(Container $oContainer) $aPortalConf = $this->ParseGlobalProperties($aPortalConf); // - Rectifying portal logo url $aPortalConf = $this->AppendLogoUri($aPortalConf); + // - Rectifying portal favicon url + $aPortalConf = $this->AppendFavIconUri($aPortalConf); } catch (Exception $oException) { @@ -69,22 +71,24 @@ public function Process(Container $oContainer) */ private function GetInitialPortalConf() { + $aPortalConf = array( 'properties' => array( - 'id' => $_ENV['PORTAL_ID'], - 'name' => 'Page:DefaultTitle', - 'logo' => Branding::GetPortalLogoAbsoluteUrl(), - 'themes' => array( + 'id' => $_ENV['PORTAL_ID'], + 'name' => 'Page:DefaultTitle', + 'logo' => Branding::GetPortalLogoAbsoluteUrl(), + '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, ), @@ -116,11 +120,8 @@ private function ParseGlobalProperties(array $aPortalConf) case 'name': case 'urlmaker_class': case 'triggers_query': - $aPortalConf['properties'][$oPropertyNode->nodeName] = $oPropertyNode->GetText( - $aPortalConf['properties'][$oPropertyNode->nodeName] - ); - break; case 'logo': + case 'favicon': $aPortalConf['properties'][$oPropertyNode->nodeName] = $oPropertyNode->GetText( $aPortalConf['properties'][$oPropertyNode->nodeName] ); @@ -263,8 +264,7 @@ private function ParseAllowedPortalsOptions(array $aPortalConf, DesignElement $o private function AppendLogoUri(array $aPortalConf) { $sLogoUri = $aPortalConf['properties']['logo']; - if (!preg_match('/^http/', $sLogoUri)) - { + if (!preg_match('/^http/', $sLogoUri)) { // We prefix it with the server base url $sLogoUri = utils::GetAbsoluteUrlAppRoot().'env-'.utils::GetCurrentEnvironment().'/'.$sLogoUri; } @@ -272,4 +272,23 @@ private function AppendLogoUri(array $aPortalConf) return $aPortalConf; } + + /** + * @param array $aPortalConf + * + * @return array + * @throws \Exception + * @since 3.1.1 N°3363 + */ + private function AppendFaviconUri(array $aPortalConf) + { + $sFaviconUri = $aPortalConf['properties']['favicon']; + if (!preg_match('/^http/', $sFaviconUri)) { + // We prefix it with the server base url + $sFaviconUri = utils::GetAbsoluteUrlAppRoot().'env-'.utils::GetCurrentEnvironment().'/'.$sFaviconUri; + } + $aPortalConf['properties']['favicon'] = $sFaviconUri; + + return $aPortalConf; + } } \ No newline at end of file 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 afb837ba7f..cf4a308efa 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 @@ -23,7 +23,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 #} @@ -250,7 +250,7 @@ {% endblock %} - {# Sidebar navigation menu for normal screens #} + {# Sidebar navigation menu for normal screens #} {% block pNavigationSideMenuWrapper %}