Ignore:
Timestamp:
2013-08-27T14:48:01+12:00 (11 years ago)
Author:
sjm84
Message:

Make the user information available to the javascript gs variable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/javascript-global-setup.xsl

    r27081 r28165  
    2424        <xsl:call-template name="populate-metadata-values"/>
    2525        <xsl:call-template name="populate-request-information-values"/>
     26        <xsl:call-template name="populate-user-information-values"/>
    2627        <xsl:call-template name="include-global-javascript-functions"/>
    2728    </xsl:template>
     
    140141            </xsl:text>
    141142        </script>
     143    </xsl:template>
     144   
     145    <xsl:template name="populate-user-information-values">
     146        <xsl:if test="/page/pageRequest/userInformation">
     147            <script type="text/javascript">
     148                <xsl:text disable-output-escaping="yes">
     149                    gs.userInformation = new Array();
     150                    gs.userInformation.username = "</xsl:text><xsl:value-of select="/page/pageRequest/userInformation/@username"/><xsl:text disable-output-escaping="yes">";
     151                    gs.userInformation.groups = "</xsl:text><xsl:value-of select="/page/pageRequest/userInformation/@groups"/><xsl:text disable-output-escaping="yes">";
     152                </xsl:text>
     153            </script>
     154        </xsl:if>
    142155    </xsl:template>
    143156   
Note: See TracChangeset for help on using the changeset viewer.