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 #}

View File

@@ -985,13 +985,19 @@
<attachments>
<allow_delete>true</allow_delete>
</attachments>
<allowed_portals>
<!-- Defines how other portals -allowed for the current user- will be opened. "tab" for a new tab, "self" for the current window -->
<opening_mode>tab</opening_mode>
</allowed_portals>
</properties>
<bricks>
<brick id="user-profile" xsi:type="Combodo\iTop\Portal\Brick\UserProfileBrick">
<rank>
<!-- Can be either a <default> tag for both home page and navigation menu or distinct <home> or/and <navigation_menu> tags-->
<default>1</default>
</rank>
<title>
<!-- Can be either a <default> tag for both home page and navigation menu or distinct <home> or/and <navigation_menu> tags-->
<default>Brick:Portal:UserProfile:Navigation:Dropdown:MyProfil</default>
</title>
<decoration_class>
@@ -1199,7 +1205,7 @@
<forms>
<form id="servicesubcategory">
<class>ServiceSubcategory</class>
<!-- Optionnal tag to list the fields -->
<!-- Optionnal tag to list the fields. If empty only fields from <twig> tag will be displayed, if ommited fields from zlist details will. -->
<fields />
<!-- Optionnal tag to specify the form layout. Fields that are not positionned in the layout will be placed at the end of the form -->
<twig>