Web widget prolonging uportal/ENT into apps
!! this is what Université Paris Pantheon-Sorbonne is using in production. It has not yet been used elsewhere and would need moving custom paris1 stuff somewhere else !!
- create
config.inc.php
usingconfig.sample.inc.php
. - create
config-menu.inc.php
usingconfig-menu-sample.inc.php
- add the following to applications:
<script> window.bandeau_ENT = { current: 'xxx' } </script>
<script async src="https://bandeau-ENT.univ.fr/bandeau-ENT-loader.js"></script>
- to enable links in uportal to go out of uportal, you can use bandeau-ENT
redirect.php
on iframes:
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="@portletName='IFrame'">
https://bandeau-ENT.univ.fr/redirect.php?id=<xsl:value-of select="@fname"/>
</xsl:when>
<xsl:otherwise>
RequestHeader unset Accept-Encoding
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|</head>| <script type=\"text/javascript\">window.bandeau_ENT = { current: \"xxx\"}; </script><script async src=\"https://bandeau-ENT.univ.fr/bandeau-ENT-loader.js\"></script> </head>|"
-
current, currentAppIds
-
no_titlebar
-
hide_menu
-
account_links
-
logout: used to find the logout button. bandeau's logout will trigger a click on app's logout button
-
login
-
is_logged
-
ping_to_increase_session_timeout
-
quirks
-
div_id, div_is_uid
Small javascript loader calling bandeau-ENT-js.php
.
If a cached bandeau is found in localStorage
, it will use it.
PHP code generating code that will display the bandeau.
It tries to authenticate the user and then computes its "layout".
It bundles various files to reduce the number of requests: bandeau-ENT-static.js
, bandeau-ENT.css
, bandeau-ENT-desktop.css
Code that displays the bandeau using various data computed/bundled by bandeau-ENT-js.php
A neat feature is "background" update: the localStorage version is used, but if it is old, an updated version is requested from server and the bandeau is updated if there is a change.
Small helper script to detect if the user wants to reload the page.
When detected, code in bandeau-ENT-static.js
will trigger an update of the bandeau (it will first display the localStorage version, but will asap try to get updated version)
Small script used to redirect to an application using its code/fname. For uportal 3, it is useful since it handles the computing of the activeTab (would not be needed on uportal 4)