N°619 - Portal: Other allowed portals (eg. the administration console or other portal instances) can now be opened in the current window or a new tab. This is a new xml property of the portal instance.

SVN:trunk[4552]
This commit is contained in:
Guillaume Lajarige
2017-02-21 08:04:46 +00:00
parent f3f9e98aa4
commit 9a6a562ed2
3 changed files with 29 additions and 3 deletions

View File

@@ -324,7 +324,10 @@ class ApplicationHelper
'triggers_query' => null,
'attachments' => array(
'allow_delete' => true
)
),
'allowed_portals' => array(
'opening_mode' => null,
),
),
'portals' => array(),
'forms' => array(),
@@ -401,6 +404,23 @@ class ApplicationHelper
}
}
break;
case 'allowed_portals':
foreach ($oPropertyNode->GetNodes('*') as $oSubNode)
{
switch ($oSubNode->nodeName)
{
case 'opening_mode':
$sValue = $oSubNode->GetText();
// If the text is null, we keep the default value
// Else we set it
if ($sValue !== null)
{
$aPortalConf['properties']['allowed_portals'][$oSubNode->nodeName] = ($sValue === 'self') ? 'self' : 'tab';
}
break;
}
}
break;
}
}
// - Rectifying portal logo url

View File

@@ -199,7 +199,7 @@
{% for aPortal in app['combodo.portal.instance.conf'].portals %}
{% if aPortal.id != app['combodo.portal.instance.conf'].properties.id %}
{% set sGlyphiconClass = (aPortal.id == 'backoffice') ? 'fa-list-alt' : 'fa-external-link' %}
<li><a href="{{ aPortal.url }}" target="_blank" title="{{ aPortal.label|dict_s }}"><span class="brick_icon fa {{ sGlyphiconClass }} fa-lg fa-fw"></span>{{ aPortal.label|dict_s }}</a></li>
<li><a href="{{ aPortal.url }}" {% if app['combodo.portal.instance.conf'].properties.allowed_portals.opening_mode == 'tab' %}target="_blank"{% endif %} title="{{ aPortal.label|dict_s }}"><span class="brick_icon fa {{ sGlyphiconClass }} fa-lg fa-fw"></span>{{ aPortal.label|dict_s }}</a></li>
{% endif %}
{% endfor %}
{# We display the separator only if the user has more then 1 portal. Meaning default portal + console or several portal at least #}