Customer portal : Portal logo source order is : "/images/itop-logo.png" < "/env-xxx/branding/portal-logo.png" < "value of //properties/logo of the portal module_design"

SVN:trunk[4078]
This commit is contained in:
Guillaume Lajarige
2016-05-13 12:06:35 +00:00
parent 2720f6e54b
commit 291a5847f0
2 changed files with 15 additions and 23 deletions

View File

@@ -283,14 +283,14 @@ class ApplicationHelper
throw new Exception('Cannot load module design, Portal ID is not defined');
}
$oDesign = new ModuleDesign(PORTAL_ID);
// Parsing file
// - Default values
$aPortalConf = array(
'properties' => array(
'id' => PORTAL_ID,
'name' => 'Page:DefaultTitle',
'logo' => null,
'logo' => (file_exists(MODULESROOT . 'branding/portal-logo.png')) ? utils::GetAbsoluteUrlModulesRoot() . 'branding/portal-logo.png' : '../images/itop-logo.png',
'themes' => array(
'bootstrap' => $oApp['combodo.portal.base.absolute_url'] . 'css/bootstrap-theme.min.css',
'portal' => $oApp['combodo.portal.base.absolute_url'] . 'css/portal.css',
@@ -321,23 +321,7 @@ class ApplicationHelper
$aPortalConf['properties'][$oPropertyNode->nodeName] = $oPropertyNode->GetText($aPortalConf['properties'][$oPropertyNode->nodeName]);
break;
case 'logo':
$sLogoUri = $oPropertyNode->GetText($aPortalConf['properties'][$oPropertyNode->nodeName]);
if ($sLogoUri === null)
{
// There is no logo : do nothing
}
elseif (preg_match('/^http/', $sLogoUri))
{
// The uri is already complete : do nothing
}
else
{
// We prefix it with the server base url
$sLogoUri = utils::GetAbsoluteUrlAppRoot() . 'env-' . utils::GetCurrentEnvironment() . '/' . $sLogoUri;
}
$aPortalConf['properties'][$oPropertyNode->nodeName] = $sLogoUri;
$aPortalConf['properties'][$oPropertyNode->nodeName] = $oPropertyNode->GetText($aPortalConf['properties'][$oPropertyNode->nodeName]);
break;
case 'themes':
case 'templates':
@@ -398,6 +382,14 @@ class ApplicationHelper
break;
}
}
// - Rectifying portal logo url
$sLogoUri = $aPortalConf['properties']['logo'];
if (!preg_match('/^http/', $sLogoUri))
{
// We prefix it with the server base url
$sLogoUri = utils::GetAbsoluteUrlAppRoot() . 'env-' . utils::GetCurrentEnvironment() . '/' . $sLogoUri;
}
$aPortalConf['properties']['logo'] = $sLogoUri;
// - User allowed portals
$aPortalConf['portals'] = UserRights::GetAllowedPortals();
// - Bricks

View File

@@ -962,10 +962,10 @@
<module_designs>
<module_design id="itop-portal" xsi:type="portal" _delta="define">
<properties>
<name>Portal:Instance:Name</name>
<!-- Can be either a fileref or a relative path to the file (To be tested) -->
<!--<fileref ref="brt_6a2be154b2a62659d3332c513bdad715" />-->
<logo>../images/itop-logo.png</logo>
<name>portal:itop-portal</name>
<!-- Can be either a fileref or a relative path to the file (To be tested). Takes over env-xxx/branding/portal-logo.png -->
<!--<fileref ref="brt_6a2be154b2a62659d3332c513bdad715" />-->
<!--<logo>../images/itop-logo.png</logo>-->
<!-- Can be either a fileref or a relative path to the file from /env-xxx -->
<!-- Available themes must have a unique id. Some ids are loaded in a specific order : bootstrap/portal/custom. Other ids are loaded after them, but their order cannot be predicted -->
<themes/>